commit afbb41ec43f6eee2fa7eceb5fa03421e219bbf48 Author: Steve Date: Fri Feb 4 18:48:09 2022 -0500 init diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..1a585fc --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' +gem 'discordrb' +gem 'mimemagic' +gem 'down' +gem 'astro_moon' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..3691b98 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,61 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + astro_moon (0.2) + discordrb (3.4.0) + discordrb-webhooks (~> 3.3.0) + ffi (>= 1.9.24) + opus-ruby + rest-client (>= 2.0.0) + websocket-client-simple (>= 0.3.0) + discordrb-webhooks (3.3.0) + rest-client (>= 2.1.0.rc1) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + down (5.2.4) + addressable (~> 2.8) + event_emitter (0.2.6) + ffi (1.15.5) + http-accept (1.7.0) + http-cookie (1.0.4) + domain_name (~> 0.5) + mime-types (3.4.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2022.0105) + mimemagic (0.4.3) + nokogiri (~> 1) + rake + netrc (0.11.0) + nokogiri (1.13.1-x86_64-linux) + racc (~> 1.4) + opus-ruby (1.0.1) + ffi + public_suffix (4.0.6) + racc (1.6.0) + rake (13.0.6) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + unf (0.1.4) + unf_ext + unf_ext (0.0.8) + websocket (1.2.9) + websocket-client-simple (0.5.1) + event_emitter + websocket + +PLATFORMS + x86_64-linux + +DEPENDENCIES + astro_moon + discordrb + down + mimemagic + +BUNDLED WITH + 2.3.3 diff --git a/folder.rb b/folder.rb new file mode 100644 index 0000000..12f3cb2 --- /dev/null +++ b/folder.rb @@ -0,0 +1,69 @@ +class Folder + def initialize() + @steves = [] + @fallen = [] + @submissions = [] + @idgen = 1 + end + + def add_steve(uid) + @steves.append(uid) + end + + def curse(user) + @steves.delete(user.id) + @fallen.append(user.id) + end + + def steve?(user) + return (@steves.include?(user) or @fallen.include?(user)) + end + + def submit(sub) + sub.set_id(@idgen) + @submissions.append(sub) + @idgen = @idgen + 1 + end + + def harass_steve() + if @steves.length <= 0 + return nil + end + target = @steves.sample + if @submissions.length <= 0 + return nil + end + message = @submissions.sample + i = 0 + #until message.sender != target or i == 5 do + # message = @submissions.sample + # i = i + 1 + #end + if i == 5 + return nil + end + @submissions.delete(message) + if File.exist?(message.content) + return nil + end + + if message.local + File.delete(message.content) if File.exist?(message.content) + end + return target,message + end +end + + +class Submission + def initialize(content,local,sender) + @local = local + @content = content + @sender = sender + end + def set_id(i) + @id = i + end + attr_reader :local,:content,:sender,:id +end + diff --git a/main.rb b/main.rb new file mode 100755 index 0000000..10f6b72 --- /dev/null +++ b/main.rb @@ -0,0 +1,117 @@ +#!/usr/bin/ruby +require 'bundler/setup' +require 'discordrb' +require 'yaml' +require 'mimemagic' +require 'down' +require 'fileutils' +require 'time' +require 'logger' +require 'astro/moon' +require './folder.rb' + +logger = Logger.new(STDOUT) +logger.level = Logger::INFO + +config_obj = YAML::load_file( './config.yaml' ) +logger.info("loaded config") +bot = Discordrb::Commands::CommandBot.new token: config_obj["bot_token"], prefix: "!folder" +folder = Folder.new +config_obj['steves'].each do |steve| + folder.add_steve(steve) +end + +bot.message(private: true,contains: "!folder fall") do |event| + if folder.steve?(event.user) + folder.curse(event.user) + mem = bot.member(config_obj['server_id'],event.user.id) + mem.set_nick("Geoff","This Steve has seperated himself from the Ideal Steve") + event.respond("May Snen have Mercy on your Soul") + else + event.respond("Oh that you could be so blessed as to have that option") + end +end + +bot.message(private: true,contains: "!folder rise") do |event| + if folder.steve?(event.user) + folder.bless(event.user) + mem = bot.member(config_obj['server_id'],event.user.id) + mem.set_nick("","Steve-ness restored") + event.respond("Welcome back to the winning team") + else + event.respond("Fat chance, non-Steve") + end +end + +bot.message(private: true, contains: "!folder help") do |event| + event.respond("Commands: rise,fall,help") +end + +bot.message(private: true) do |event| + (mem,au) = event.author + i = 1 + if mem == nil + sender = au.username + else + sender = mem.username + end + event.message.attachments.each do |file| + res = MimeMagic.by_path(file.filename) + if res != nil + if res.image? or res.video? + download = Down.download(file.url) + FileUtils.mv(download.path, "./spool/#{download.original_filename}") + folder.submit(Submission.new("./spool/#{download.original_filename}",true,sender)) + event.respond("Submission #{i} accepted") + i = i + 1 + else + event.respond("File type #{res} not supported yet") + end + else + event.respond("Submission denied; attached file but I can't figure out the file type") + end + end + + urls = URI.extract(event.content) + urls.each do |url| + mime_guess = MimeMagic.by_extension(url) + if mime_guess != nil + if mime_guess.image? or mime_guess.video? + download = Down.download(file.url) + FileUtils.mv(download.path, "./spool/#{download.original_filename}") + folder.submit(Submission.new("./spool/#{download.original_filename}",true,sender)) + end + else + folder.submit(Submission.new(url,false,sender)) + end + event.respond("Submission #{i} accepted") + i= i+1 + end +end + + + + +logger.info("Starting bot") +bot.run(true) +loop do + timer = Astro::Moon.phase.phase * (3600 * (1 + rand(3))) + logger.info("sleeping for #{timer} seconds") + sleep timer + t = Time.new + if t.hour < 9 or t.hour > 2 + next + end + sid,msg = folder.harass_steve() + if msg == nil + logger.info("no submissions ready") + next + end + steve = bot.users[sid] + logger.info("sending submission #{msg.id}") + if msg.local + steve.send_file(File.open(msg.content,'r')) + else + steve.pm(msg.content) + end +end diff --git a/vendor/bundle/ruby/3.1.0/bin/nokogiri b/vendor/bundle/ruby/3.1.0/bin/nokogiri new file mode 100755 index 0000000..1d1e69f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/bin/nokogiri @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby.ruby3.1 +# +# This file was generated by RubyGems. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +Gem.use_gemdeps + +version = ">= 0.a" + +str = ARGV.first +if str + str = str.b[/\A_(.*)_\z/, 1] + if str and Gem::Version.correct?(str) + version = str + ARGV.shift + end +end + +if Gem.respond_to?(:activate_bin_path) +load Gem.activate_bin_path('nokogiri', 'nokogiri', version) +else +gem "nokogiri", version +load Gem.bin_path("nokogiri", "nokogiri", version) +end diff --git a/vendor/bundle/ruby/3.1.0/bin/rake b/vendor/bundle/ruby/3.1.0/bin/rake new file mode 100755 index 0000000..56f0617 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/bin/rake @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby.ruby3.1 +# +# This file was generated by RubyGems. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +Gem.use_gemdeps + +version = ">= 0.a" + +str = ARGV.first +if str + str = str.b[/\A_(.*)_\z/, 1] + if str and Gem::Version.correct?(str) + version = str + ARGV.shift + end +end + +if Gem.respond_to?(:activate_bin_path) +load Gem.activate_bin_path('rake', 'rake', version) +else +gem "rake", version +load Gem.bin_path("rake", "rake", version) +end diff --git a/vendor/bundle/ruby/3.1.0/bin/restclient b/vendor/bundle/ruby/3.1.0/bin/restclient new file mode 100755 index 0000000..0c9feb5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/bin/restclient @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby.ruby3.1 +# +# This file was generated by RubyGems. +# +# The application 'rest-client' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +Gem.use_gemdeps + +version = ">= 0.a" + +str = ARGV.first +if str + str = str.b[/\A_(.*)_\z/, 1] + if str and Gem::Version.correct?(str) + version = str + ARGV.shift + end +end + +if Gem.respond_to?(:activate_bin_path) +load Gem.activate_bin_path('rest-client', 'restclient', version) +else +gem "rest-client", version +load Gem.bin_path("rest-client", "restclient", version) +end diff --git a/vendor/bundle/ruby/3.1.0/cache/addressable-2.8.0.gem b/vendor/bundle/ruby/3.1.0/cache/addressable-2.8.0.gem new file mode 100644 index 0000000..1e41e1c Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/addressable-2.8.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/astro_moon-0.2.gem b/vendor/bundle/ruby/3.1.0/cache/astro_moon-0.2.gem new file mode 100644 index 0000000..88fcaff Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/astro_moon-0.2.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/discordrb-3.4.0.gem b/vendor/bundle/ruby/3.1.0/cache/discordrb-3.4.0.gem new file mode 100644 index 0000000..651b6e4 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/discordrb-3.4.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/discordrb-webhooks-3.3.0.gem b/vendor/bundle/ruby/3.1.0/cache/discordrb-webhooks-3.3.0.gem new file mode 100644 index 0000000..7c83acf Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/discordrb-webhooks-3.3.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/domain_name-0.5.20190701.gem b/vendor/bundle/ruby/3.1.0/cache/domain_name-0.5.20190701.gem new file mode 100644 index 0000000..c1a2c32 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/domain_name-0.5.20190701.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/down-5.2.4.gem b/vendor/bundle/ruby/3.1.0/cache/down-5.2.4.gem new file mode 100644 index 0000000..32fb190 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/down-5.2.4.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/event_emitter-0.2.6.gem b/vendor/bundle/ruby/3.1.0/cache/event_emitter-0.2.6.gem new file mode 100644 index 0000000..f552bd5 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/event_emitter-0.2.6.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/ffi-1.15.5.gem b/vendor/bundle/ruby/3.1.0/cache/ffi-1.15.5.gem new file mode 100644 index 0000000..a632047 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/ffi-1.15.5.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/http-accept-1.7.0.gem b/vendor/bundle/ruby/3.1.0/cache/http-accept-1.7.0.gem new file mode 100644 index 0000000..f648db4 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/http-accept-1.7.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/http-cookie-1.0.4.gem b/vendor/bundle/ruby/3.1.0/cache/http-cookie-1.0.4.gem new file mode 100644 index 0000000..804fe5c Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/http-cookie-1.0.4.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/mime-types-3.4.1.gem b/vendor/bundle/ruby/3.1.0/cache/mime-types-3.4.1.gem new file mode 100644 index 0000000..7b1056e Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/mime-types-3.4.1.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/mime-types-data-3.2022.0105.gem b/vendor/bundle/ruby/3.1.0/cache/mime-types-data-3.2022.0105.gem new file mode 100644 index 0000000..d227a21 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/mime-types-data-3.2022.0105.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/mimemagic-0.4.3.gem b/vendor/bundle/ruby/3.1.0/cache/mimemagic-0.4.3.gem new file mode 100644 index 0000000..aaa4175 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/mimemagic-0.4.3.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/netrc-0.11.0.gem b/vendor/bundle/ruby/3.1.0/cache/netrc-0.11.0.gem new file mode 100644 index 0000000..78226f3 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/netrc-0.11.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/nokogiri-1.13.1-x86_64-linux.gem b/vendor/bundle/ruby/3.1.0/cache/nokogiri-1.13.1-x86_64-linux.gem new file mode 100644 index 0000000..fe62027 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/nokogiri-1.13.1-x86_64-linux.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/opus-ruby-1.0.1.gem b/vendor/bundle/ruby/3.1.0/cache/opus-ruby-1.0.1.gem new file mode 100644 index 0000000..4c8d212 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/opus-ruby-1.0.1.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/public_suffix-4.0.6.gem b/vendor/bundle/ruby/3.1.0/cache/public_suffix-4.0.6.gem new file mode 100644 index 0000000..6f183f4 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/public_suffix-4.0.6.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/rake-13.0.6.gem b/vendor/bundle/ruby/3.1.0/cache/rake-13.0.6.gem new file mode 100644 index 0000000..19ae802 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/rake-13.0.6.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/rest-client-2.1.0.gem b/vendor/bundle/ruby/3.1.0/cache/rest-client-2.1.0.gem new file mode 100644 index 0000000..8af1a2f Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/rest-client-2.1.0.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/unf-0.1.4.gem b/vendor/bundle/ruby/3.1.0/cache/unf-0.1.4.gem new file mode 100644 index 0000000..01f1852 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/unf-0.1.4.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/unf_ext-0.0.8.gem b/vendor/bundle/ruby/3.1.0/cache/unf_ext-0.0.8.gem new file mode 100644 index 0000000..83ab41e Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/unf_ext-0.0.8.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/websocket-1.2.9.gem b/vendor/bundle/ruby/3.1.0/cache/websocket-1.2.9.gem new file mode 100644 index 0000000..2578fac Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/websocket-1.2.9.gem differ diff --git a/vendor/bundle/ruby/3.1.0/cache/websocket-client-simple-0.5.1.gem b/vendor/bundle/ruby/3.1.0/cache/websocket-client-simple-0.5.1.gem new file mode 100644 index 0000000..74f8b4d Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/cache/websocket-client-simple-0.5.1.gem differ diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/ffi_c.so b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/ffi_c.so new file mode 100755 index 0000000..9347d1f Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/ffi_c.so differ diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/gem.build_complete b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/gem.build_complete new file mode 100644 index 0000000..e69de29 diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/gem_make.out b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/gem_make.out new file mode 100644 index 0000000..68084b2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/gem_make.out @@ -0,0 +1,134 @@ +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c +/usr/bin/ruby.ruby3.1 -I /usr/lib64/ruby/3.1.0 -r ./siteconf20220204-28723-jqj0he.rb extconf.rb +checking for ffi_prep_closure_loc() in -lffi... yes +checking for ffi_prep_cif_var()... yes +checking for ffi_raw_call()... yes +checking for ffi_prep_raw_closure()... yes +checking for whether -pthread is accepted as LDFLAGS... yes +creating extconf.h +creating Makefile + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c +make DESTDIR\= clean + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c +make DESTDIR\= +compiling AbstractMemory.c +AbstractMemory.c:480:1: warning: ‘memory_read_array_of_string’ defined but not used [-Wunused-function] + 480 | memory_read_array_of_string(int argc, VALUE* argv, VALUE self) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +AbstractMemory.c:175:1: warning: ‘memory_read_array_of_bool’ defined but not used [-Wunused-function] + 175 | memory_read_array_of_##name(VALUE self, VALUE length) \ + | ^~~~~~~~~~~~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:151:1: warning: ‘memory_write_array_of_bool’ defined but not used [-Wunused-function] + 151 | memory_write_array_of_##name(VALUE self, VALUE ary) \ + | ^~~~~~~~~~~~~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:123:1: warning: ‘memory_read_bool’ defined but not used [-Wunused-function] + 123 | memory_read_##name(VALUE self) \ + | ^~~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:115:1: warning: ‘memory_get_bool’ defined but not used [-Wunused-function] + 115 | memory_get_##name(VALUE self, VALUE offset) \ + | ^~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:96:1: warning: ‘memory_write_bool’ defined but not used [-Wunused-function] + 96 | memory_write_##name(VALUE self, VALUE value) \ + | ^~~~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:87:1: warning: ‘memory_put_bool’ defined but not used [-Wunused-function] + 87 | memory_put_##name(VALUE self, VALUE offset, VALUE value) \ + | ^~~~~~~~~~~ +AbstractMemory.c:298:1: note: in expansion of macro ‘NUM_OP’ + 298 | NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:175:1: warning: ‘memory_read_array_of_longdouble’ defined but not used [-Wunused-function] + 175 | memory_read_array_of_##name(VALUE self, VALUE length) \ + | ^~~~~~~~~~~~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:151:1: warning: ‘memory_write_array_of_longdouble’ defined but not used [-Wunused-function] + 151 | memory_write_array_of_##name(VALUE self, VALUE ary) \ + | ^~~~~~~~~~~~~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:123:1: warning: ‘memory_read_longdouble’ defined but not used [-Wunused-function] + 123 | memory_read_##name(VALUE self) \ + | ^~~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:115:1: warning: ‘memory_get_longdouble’ defined but not used [-Wunused-function] + 115 | memory_get_##name(VALUE self, VALUE offset) \ + | ^~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:96:1: warning: ‘memory_write_longdouble’ defined but not used [-Wunused-function] + 96 | memory_write_##name(VALUE self, VALUE value) \ + | ^~~~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +AbstractMemory.c:87:1: warning: ‘memory_put_longdouble’ defined but not used [-Wunused-function] + 87 | memory_put_##name(VALUE self, VALUE offset, VALUE value) \ + | ^~~~~~~~~~~ +AbstractMemory.c:262:1: note: in expansion of macro ‘NUM_OP’ + 262 | NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + | ^~~~~~ +compiling ArrayType.c +compiling Buffer.c +compiling Call.c +compiling ClosurePool.c +compiling DynamicLibrary.c +compiling Function.c +Function.c: In function ‘callback_invoke’: +Function.c:484:14: warning: variable ‘empty’ set but not used [-Wunused-but-set-variable] + 484 | bool empty = false; + | ^~~~~ +compiling FunctionInfo.c +FunctionInfo.c: In function ‘fntype_initialize’: +FunctionInfo.c:117:27: warning: variable ‘rbConvention’ set but not used [-Wunused-but-set-variable] + 117 | VALUE rbEnums = Qnil, rbConvention = Qnil, rbBlocking = Qnil; + | ^~~~~~~~~~~~ +compiling LastError.c +compiling LongDouble.c +compiling MappedType.c +compiling MemoryPointer.c +compiling MethodHandle.c +compiling Platform.c +compiling Pointer.c +compiling Struct.c +compiling StructByValue.c +compiling StructLayout.c +StructLayout.c: In function ‘struct_field_initialize’: +StructLayout.c:99:9: warning: variable ‘nargs’ set but not used [-Wunused-but-set-variable] + 99 | int nargs; + | ^~~~~ +compiling Thread.c +compiling Type.c +compiling Types.c +compiling Variadic.c +Variadic.c: In function ‘variadic_initialize’: +Variadic.c:101:11: warning: variable ‘convention’ set but not used [-Wunused-but-set-variable] + 101 | VALUE convention = Qnil; + | ^~~~~~~~~~ +compiling ffi.c +linking shared-object ffi_c.so + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c +make DESTDIR\= install +/usr/bin/install -c -m 0755 ffi_c.so ./.gem.20220204-28723-jrafwf diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/mkmf.log b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/mkmf.log new file mode 100644 index 0000000..e8b0d55 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.15.5/mkmf.log @@ -0,0 +1,232 @@ +LD_LIBRARY_PATH=.:/usr/lib64 pkg-config --exists libffi +LD_LIBRARY_PATH=.:/usr/lib64 pkg-config --libs libffi | +=> "-L/usr/lib64/../lib64 -lffi \n" +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -lruby3.1 -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return !!argv[argc]; +6: } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -lruby3.1 -L/usr/lib64/../lib64 -lffi -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return !!argv[argc]; +6: } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 pkg-config --cflags-only-I libffi | +=> "\n" +LD_LIBRARY_PATH=.:/usr/lib64 pkg-config --cflags-only-other libffi | +=> "\n" +LD_LIBRARY_PATH=.:/usr/lib64 pkg-config --libs-only-l libffi | +=> "-lffi \n" +package configuration for libffi +incflags: +cflags: +ldflags: -L/usr/lib64/../lib64 +libs: -lffi + +have_library: checking for ffi_prep_closure_loc() in -lffi... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lruby3.1 -lffi -lffi -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: int (* volatile tp)(void)=(int (*)(void))&t; +11: printf("%d", (*tp)()); +12: } +13: +14: return !!argv[argc]; +15: } +16: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_closure_loc; return !p; } +/* end */ + +-------------------- + +have_func: checking for ffi_prep_cif_var()... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +conftest.c: In function ‘t’: +conftest.c:14:57: error: ‘ffi_prep_cif_var’ undeclared (first use in this function) + 14 | int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; } + | ^~~~~~~~~~~~~~~~ +conftest.c:14:57: note: each undeclared identifier is reported only once for each function it appears in +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: extern void ffi_prep_cif_var(); +15: int t(void) { ffi_prep_cif_var(); return 0; } +/* end */ + +-------------------- + +have_func: checking for ffi_raw_call()... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +conftest.c: In function ‘t’: +conftest.c:14:57: error: ‘ffi_raw_call’ undeclared (first use in this function) + 14 | int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; } + | ^~~~~~~~~~~~ +conftest.c:14:57: note: each undeclared identifier is reported only once for each function it appears in +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: extern void ffi_raw_call(); +15: int t(void) { ffi_raw_call(); return 0; } +/* end */ + +-------------------- + +have_func: checking for ffi_prep_raw_closure()... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +conftest.c: In function ‘t’: +conftest.c:14:57: error: ‘ffi_prep_raw_closure’ undeclared (first use in this function) + 14 | int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; } + | ^~~~~~~~~~~~~~~~~~~~ +conftest.c:14:57: note: each undeclared identifier is reported only once for each function it appears in +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -lffi -lffi -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: extern void ffi_prep_raw_closure(); +15: int t(void) { ffi_prep_raw_closure(); return 0; } +/* end */ + +-------------------- + +block in append_ldflags: checking for whether -pthread is accepted as LDFLAGS... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -lffi -lffi -lruby3.1 -pthread -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return !!argv[argc]; +6: } +/* end */ + +-------------------- + +extconf.h is: +/* begin */ +1: #ifndef EXTCONF_H +2: #define EXTCONF_H +3: #define HAVE_FFI_PREP_CIF_VAR 1 +4: #define HAVE_FFI_RAW_CALL 1 +5: #define HAVE_FFI_PREP_RAW_CLOSURE 1 +6: #define HAVE_RAW_API 1 +7: #endif +/* end */ + diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/gem.build_complete b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/gem.build_complete new file mode 100644 index 0000000..e69de29 diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/gem_make.out b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/gem_make.out new file mode 100644 index 0000000..0b0470e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/gem_make.out @@ -0,0 +1,3 @@ +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/ext/mimemagic +/usr/bin/ruby.ruby3.1 -I/usr/lib64/ruby/3.1.0 -rrubygems /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3 RUBYLIBDIR\=/home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3 +mkdir -p /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/mimemagic diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/mimemagic/path.rb b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/mimemagic/path.rb new file mode 100644 index 0000000..df1a52f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/mimemagic-0.4.3/mimemagic/path.rb @@ -0,0 +1,3 @@ +class MimeMagic + DATABASE_PATH="/usr/share/mime/packages/freedesktop.org.xml" +end diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/gem.build_complete b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/gem.build_complete new file mode 100644 index 0000000..e69de29 diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/gem_make.out b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/gem_make.out new file mode 100644 index 0000000..31e49eb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/gem_make.out @@ -0,0 +1,16 @@ +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/unf_ext-0.0.8/ext/unf_ext +/usr/bin/ruby.ruby3.1 -I /usr/lib64/ruby/3.1.0 -r ./siteconf20220204-28723-f888s4.rb extconf.rb +checking for -lstdc++... yes +creating Makefile + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/unf_ext-0.0.8/ext/unf_ext +make DESTDIR\= clean + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/unf_ext-0.0.8/ext/unf_ext +make DESTDIR\= +compiling unf.cc +linking shared-object unf_ext.so + +current directory: /home/stryan/code/stevefolder/vendor/bundle/ruby/3.1.0/gems/unf_ext-0.0.8/ext/unf_ext +make DESTDIR\= install +/usr/bin/install -c -m 0755 unf_ext.so ./.gem.20220204-28723-gq159b diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/mkmf.log b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/mkmf.log new file mode 100644 index 0000000..1a54e28 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/mkmf.log @@ -0,0 +1,35 @@ +have_library: checking for -lstdc++... -------------------- yes + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -std=gnu99 -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -lruby3.1 -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return !!argv[argc]; +6: } +/* end */ + +LD_LIBRARY_PATH=.:/usr/lib64 "gcc -o conftest -I/usr/include/ruby-3.1.0/x86_64-linux-gnu -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -std=gnu99 -fPIC conftest.c -L. -L/usr/lib64 -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -lruby3.1 -lstdc++ -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: int (* volatile tp)(void)=(int (*)(void))&t; + 9: printf("%d", (*tp)()); +10: } +11: +12: return !!argv[argc]; +13: } +14: +15: int t(void) { ; return 0; } +/* end */ + +-------------------- + diff --git a/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/unf_ext.so b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/unf_ext.so new file mode 100755 index 0000000..9da4c3c Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/unf_ext-0.0.8/unf_ext.so differ diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/CHANGELOG.md new file mode 100644 index 0000000..4a9f866 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/CHANGELOG.md @@ -0,0 +1,246 @@ +# Addressable 2.8.0 +- fixes ReDoS vulnerability in Addressable::Template#match +- no longer replaces `+` with spaces in queries for non-http(s) schemes +- fixed encoding ipv6 literals +- the `:compacted` flag for `normalized_query` now dedupes parameters +- fix broken `escape_component` alias +- dropping support for Ruby 2.0 and 2.1 +- adding Ruby 3.0 compatibility for development tasks +- drop support for `rack-mount` and remove Addressable::Template#generate +- performance improvements +- switch CI/CD to GitHub Actions + +# Addressable 2.7.0 +- added `:compacted` flag to `normalized_query` +- `heuristic_parse` handles `mailto:` more intuitively +- dropped explicit support for JRuby 9.0.5.0 +- compatibility w/ public_suffix 4.x +- performance improvements + +# Addressable 2.6.0 +- added `tld=` method to allow assignment to the public suffix +- most `heuristic_parse` patterns are now case-insensitive +- `heuristic_parse` handles more `file://` URI variations +- fixes bug in `heuristic_parse` when uri starts with digit +- fixes bug in `request_uri=` with query strings +- fixes template issues with `nil` and `?` operator +- `frozen_string_literal` pragmas added +- minor performance improvements in regexps +- fixes to eliminate warnings + +# Addressable 2.5.2 +- better support for frozen string literals +- fixed bug w/ uppercase characters in scheme +- IDNA errors w/ emoji URLs +- compatibility w/ public_suffix 3.x + +# Addressable 2.5.1 +- allow unicode normalization to be disabled for URI Template expansion +- removed duplicate test + +# Addressable 2.5.0 +- dropping support for Ruby 1.9 +- adding support for Ruby 2.4 preview +- add support for public suffixes and tld; first runtime dependency +- hostname escaping should match RFC; underscores in hostnames no longer escaped +- paths beginning with // and missing an authority are now considered invalid +- validation now also takes place after setting a path +- handle backslashes in authority more like a browser for `heuristic_parse` +- unescaped backslashes in host now raise an `InvalidURIError` +- `merge!`, `join!`, `omit!` and `normalize!` don't disable deferred validation +- `heuristic_parse` now trims whitespace before parsing +- host parts longer than 63 bytes will be ignored and not passed to libidn +- normalized values always encoded as UTF-8 + +# Addressable 2.4.0 +- support for 1.8.x dropped +- double quotes in a host now raises an error +- newlines in host will no longer get unescaped during normalization +- stricter handling of bogus scheme values +- stricter handling of encoded port values +- calling `require 'addressable'` will now load both the URI and Template files +- assigning to the `hostname` component with an `IPAddr` object is now supported +- assigning to the `origin` component is now supported +- fixed minor bug where an exception would be thrown for a missing ACE suffix +- better partial expansion of URI templates + +# Addressable 2.3.8 +- fix warnings +- update dependency gems +- support for 1.8.x officially deprecated + +# Addressable 2.3.7 +- fix scenario in which invalid URIs don't get an exception until inspected +- handle hostnames with two adjacent periods correctly +- upgrade of RSpec + +# Addressable 2.3.6 +- normalization drops empty query string +- better handling in template extract for missing values +- template modifier for `'?'` now treated as optional +- fixed issue where character class parameters were modified +- templates can now be tested for equality +- added `:sorted` option to normalization of query strings +- fixed issue with normalization of hosts given in `'example.com.'` form + +# Addressable 2.3.5 +- added Addressable::URI#empty? method +- Addressable::URI#hostname methods now strip square brackets from IPv6 hosts +- compatibility with Net::HTTP in Ruby 2.0.0 +- Addressable::URI#route_from should always give relative URIs + +# Addressable 2.3.4 +- fixed issue with encoding altering its inputs +- query string normalization now leaves ';' characters alone +- FakeFS is detected before attempting to load unicode tables +- additional testing to ensure frozen objects don't cause problems + +# Addressable 2.3.3 +- fixed issue with converting common primitives during template expansion +- fixed port encoding issue +- removed a few warnings +- normalize should now ignore %2B in query strings +- the IDNA logic should now be handled by libidn in Ruby 1.9 +- no template match should now result in nil instead of an empty MatchData +- added license information to gemspec + +# Addressable 2.3.2 +- added Addressable::URI#default_port method +- fixed issue with Marshalling Unicode data on Windows +- improved heuristic parsing to better handle IPv4 addresses + +# Addressable 2.3.1 +- fixed missing unicode data file + +# Addressable 2.3.0 +- updated Addressable::Template to use RFC 6570, level 4 +- fixed compatibility problems with some versions of Ruby +- moved unicode tables into a data file for performance reasons +- removing support for multiple query value notations + +# Addressable 2.2.8 +- fixed issues with dot segment removal code +- form encoding can now handle multiple values per key +- updated development environment + +# Addressable 2.2.7 +- fixed issues related to Addressable::URI#query_values= +- the Addressable::URI.parse method is now polymorphic + +# Addressable 2.2.6 +- changed the way ambiguous paths are handled +- fixed bug with frozen URIs +- https supported in heuristic parsing + +# Addressable 2.2.5 +- 'parsing' a pre-parsed URI object is now a dup operation +- introduced conditional support for libidn +- fixed normalization issue on ampersands in query strings +- added additional tests around handling of query strings + +# Addressable 2.2.4 +- added origin support from draft-ietf-websec-origin-00 +- resolved issue with attempting to navigate below root +- fixed bug with string splitting in query strings + +# Addressable 2.2.3 +- added :flat_array notation for query strings + +# Addressable 2.2.2 +- fixed issue with percent escaping of '+' character in query strings + +# Addressable 2.2.1 +- added support for application/x-www-form-urlencoded. + +# Addressable 2.2.0 +- added site methods +- improved documentation + +# Addressable 2.1.2 +- added HTTP request URI methods +- better handling of Windows file paths +- validation_deferred boolean replaced with defer_validation block +- normalization of percent-encoded paths should now be correct +- fixed issue with constructing URIs with relative paths +- fixed warnings + +# Addressable 2.1.1 +- more type checking changes +- fixed issue with unicode normalization +- added method to find template defaults +- symbolic keys are now allowed in template mappings +- numeric values and symbolic values are now allowed in template mappings + +# Addressable 2.1.0 +- refactored URI template support out into its own class +- removed extract method due to being useless and unreliable +- removed Addressable::URI.expand_template +- removed Addressable::URI#extract_mapping +- added partial template expansion +- fixed minor bugs in the parse and heuristic_parse methods +- fixed incompatibility with Ruby 1.9.1 +- fixed bottleneck in Addressable::URI#hash and Addressable::URI#to_s +- fixed unicode normalization exception +- updated query_values methods to better handle subscript notation +- worked around issue with freezing URIs +- improved specs + +# Addressable 2.0.2 +- fixed issue with URI template expansion +- fixed issue with percent escaping characters 0-15 + +# Addressable 2.0.1 +- fixed issue with query string assignment +- fixed issue with improperly encoded components + +# Addressable 2.0.0 +- the initialize method now takes an options hash as its only parameter +- added query_values method to URI class +- completely replaced IDNA implementation with pure Ruby +- renamed Addressable::ADDRESSABLE_VERSION to Addressable::VERSION +- completely reworked the Rakefile +- changed the behavior of the port method significantly +- Addressable::URI.encode_segment, Addressable::URI.unencode_segment renamed +- documentation is now in YARD format +- more rigorous type checking +- to_str method implemented, implicit conversion to Strings now allowed +- Addressable::URI#omit method added, Addressable::URI#merge method replaced +- updated URI Template code to match v 03 of the draft spec +- added a bunch of new specifications + +# Addressable 1.0.4 +- switched to using RSpec's pending system for specs that rely on IDN +- fixed issue with creating URIs with paths that are not prefixed with '/' + +# Addressable 1.0.3 +- implemented a hash method + +# Addressable 1.0.2 +- fixed minor bug with the extract_mapping method + +# Addressable 1.0.1 +- fixed minor bug with the extract_mapping method + +# Addressable 1.0.0 +- heuristic parse method added +- parsing is slightly more strict +- replaced to_h with to_hash +- fixed routing methods +- improved specifications +- improved heckle rake task +- no surviving heckle mutations + +# Addressable 0.1.2 +- improved normalization +- fixed bug in joining algorithm +- updated specifications + +# Addressable 0.1.1 +- updated documentation +- added URI Template variable extraction + +# Addressable 0.1.0 +- initial release +- implementation based on RFC 3986, 3987 +- support for IRIs via libidn +- support for the URI Template draft spec diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Gemfile b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Gemfile new file mode 100644 index 0000000..2684c15 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Gemfile @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gemspec(path: __FILE__ == "(eval)" ? ".." : ".") + +group :test do + gem 'rspec', '~> 3.8' + gem 'rspec-its', '~> 1.3' +end + +group :coverage do + gem "coveralls", "> 0.7", require: false, platforms: :mri + gem "simplecov", require: false +end + +group :development do + gem 'launchy', '~> 2.4', '>= 2.4.3' + gem 'redcarpet', :platform => :mri_19 + gem 'yard' +end + +group :test, :development do + gem 'memory_profiler' + gem "rake", ">= 12.3.3" +end + +gem "idn-ruby", platform: :mri diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/LICENSE.txt new file mode 100644 index 0000000..ef51da2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/README.md b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/README.md new file mode 100644 index 0000000..9892f61 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/README.md @@ -0,0 +1,121 @@ +# Addressable + +
+
Homepage
github.com/sporkmonger/addressable
+
Author
Bob Aman
+
Copyright
Copyright © Bob Aman
+
License
Apache 2.0
+
+ +[![Gem Version](https://img.shields.io/gem/dt/addressable.svg)][gem] +[![Build Status](https://github.com/sporkmonger/addressable/workflows/CI/badge.svg)][actions] +[![Test Coverage Status](https://img.shields.io/coveralls/sporkmonger/addressable.svg)][coveralls] +[![Documentation Coverage Status](https://inch-ci.org/github/sporkmonger/addressable.svg?branch=master)][inch] + +[gem]: https://rubygems.org/gems/addressable +[actions]: https://github.com/sporkmonger/addressable/actions +[coveralls]: https://coveralls.io/r/sporkmonger/addressable +[inch]: https://inch-ci.org/github/sporkmonger/addressable + +# Description + +Addressable is an alternative implementation to the URI implementation +that is part of Ruby's standard library. It is flexible, offers heuristic +parsing, and additionally provides extensive support for IRIs and URI templates. + +Addressable closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4). + +# Reference + +- {Addressable::URI} +- {Addressable::Template} + +# Example usage + +```ruby +require "addressable/uri" + +uri = Addressable::URI.parse("http://example.com/path/to/resource/") +uri.scheme +#=> "http" +uri.host +#=> "example.com" +uri.path +#=> "/path/to/resource/" + +uri = Addressable::URI.parse("http://www.詹姆斯.com/") +uri.normalize +#=> # +``` + + +# URI Templates + +For more details, see [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.txt). + + +```ruby + +require "addressable/template" + +template = Addressable::Template.new("http://example.com/{?query*}") +template.expand({ + "query" => { + 'foo' => 'bar', + 'color' => 'red' + } +}) +#=> # + +template = Addressable::Template.new("http://example.com/{?one,two,three}") +template.partial_expand({"one" => "1", "three" => 3}).pattern +#=> "http://example.com/?one=1{&two}&three=3" + +template = Addressable::Template.new( + "http://{host}{/segments*}/{?one,two,bogus}{#fragment}" +) +uri = Addressable::URI.parse( + "http://example.com/a/b/c/?one=1&two=2#foo" +) +template.extract(uri) +#=> +# { +# "host" => "example.com", +# "segments" => ["a", "b", "c"], +# "one" => "1", +# "two" => "2", +# "fragment" => "foo" +# } +``` + +# Install + +```console +$ gem install addressable +``` + +You may optionally turn on native IDN support by installing libidn and the +idn gem: + +```console +$ sudo apt-get install libidn11-dev # Debian/Ubuntu +$ brew install libidn # OS X +$ gem install idn-ruby +``` + +# Semantic Versioning + +This project uses [Semantic Versioning](https://semver.org/). You can (and should) specify your +dependency using a pessimistic version constraint covering the major and minor +values: + +```ruby +spec.add_dependency 'addressable', '~> 2.7' +``` + +If you need a specific bug fix, you can also specify minimum tiny versions +without preventing updates to the latest minor release: + +```ruby +spec.add_dependency 'addressable', '~> 2.3', '>= 2.3.7' +``` diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Rakefile b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Rakefile new file mode 100644 index 0000000..b7e0ff3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/Rakefile @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require 'rubygems' +require 'rake' + +require File.join(File.dirname(__FILE__), 'lib', 'addressable', 'version') + +PKG_DISPLAY_NAME = 'Addressable' +PKG_NAME = PKG_DISPLAY_NAME.downcase +PKG_VERSION = Addressable::VERSION::STRING +PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" + +RELEASE_NAME = "REL #{PKG_VERSION}" + +PKG_SUMMARY = "URI Implementation" +PKG_DESCRIPTION = <<-TEXT +Addressable is an alternative implementation to the URI implementation that is +part of Ruby's standard library. It is flexible, offers heuristic parsing, and +additionally provides extensive support for IRIs and URI templates. +TEXT + +PKG_FILES = FileList[ + "lib/**/*", "spec/**/*", "vendor/**/*", "data/**/*", + "tasks/**/*", + "[A-Z]*", "Rakefile" +].exclude(/pkg/).exclude(/database\.yml/). + exclude(/Gemfile\.lock/).exclude(/[_\.]git$/) + +task :default => "spec" + +WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false +SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS']) + +Dir['tasks/**/*.rake'].each { |rake| load rake } diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/addressable.gemspec b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/addressable.gemspec new file mode 100644 index 0000000..12666a0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/addressable.gemspec @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- +# stub: addressable 2.8.0 ruby lib + +Gem::Specification.new do |s| + s.name = "addressable".freeze + s.version = "2.8.0" + + s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib".freeze] + s.authors = ["Bob Aman".freeze] + s.date = "2021-07-03" + s.description = "Addressable is an alternative implementation to the URI implementation that is\npart of Ruby's standard library. It is flexible, offers heuristic parsing, and\nadditionally provides extensive support for IRIs and URI templates.\n".freeze + s.email = "bob@sporkmonger.com".freeze + s.extra_rdoc_files = ["README.md".freeze] + s.files = ["CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "addressable.gemspec".freeze, "data/unicode.data".freeze, "lib/addressable.rb".freeze, "lib/addressable/idna.rb".freeze, "lib/addressable/idna/native.rb".freeze, "lib/addressable/idna/pure.rb".freeze, "lib/addressable/template.rb".freeze, "lib/addressable/uri.rb".freeze, "lib/addressable/version.rb".freeze, "spec/addressable/idna_spec.rb".freeze, "spec/addressable/net_http_compat_spec.rb".freeze, "spec/addressable/security_spec.rb".freeze, "spec/addressable/template_spec.rb".freeze, "spec/addressable/uri_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tasks/clobber.rake".freeze, "tasks/gem.rake".freeze, "tasks/git.rake".freeze, "tasks/metrics.rake".freeze, "tasks/profile.rake".freeze, "tasks/rspec.rake".freeze, "tasks/yard.rake".freeze] + s.homepage = "https://github.com/sporkmonger/addressable".freeze + s.licenses = ["Apache-2.0".freeze] + s.rdoc_options = ["--main".freeze, "README.md".freeze] + s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze) + s.rubygems_version = "3.0.3".freeze + s.summary = "URI Implementation".freeze + + if s.respond_to? :specification_version then + s.specification_version = 4 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q.freeze, [">= 2.0.2", "< 5.0"]) + s.add_development_dependency(%q.freeze, [">= 1.0", "< 3.0"]) + else + s.add_dependency(%q.freeze, [">= 2.0.2", "< 5.0"]) + s.add_dependency(%q.freeze, [">= 1.0", "< 3.0"]) + end + else + s.add_dependency(%q.freeze, [">= 2.0.2", "< 5.0"]) + s.add_dependency(%q.freeze, [">= 1.0", "< 3.0"]) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/data/unicode.data b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/data/unicode.data new file mode 100644 index 0000000..cdfc224 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/data/unicode.data differ diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable.rb new file mode 100644 index 0000000..b4e98b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +require 'addressable/uri' +require 'addressable/template' diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna.rb new file mode 100644 index 0000000..e41c1f5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +begin + require "addressable/idna/native" +rescue LoadError + # libidn or the idn gem was not available, fall back on a pure-Ruby + # implementation... + require "addressable/idna/pure" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/native.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/native.rb new file mode 100644 index 0000000..84de8e8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/native.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +require "idn" + +module Addressable + module IDNA + def self.punycode_encode(value) + IDN::Punycode.encode(value.to_s) + end + + def self.punycode_decode(value) + IDN::Punycode.decode(value.to_s) + end + + def self.unicode_normalize_kc(value) + IDN::Stringprep.nfkc_normalize(value.to_s) + end + + def self.to_ascii(value) + value.to_s.split('.', -1).map do |segment| + if segment.size > 0 && segment.size < 64 + IDN::Idna.toASCII(segment, IDN::Idna::ALLOW_UNASSIGNED) + elsif segment.size >= 64 + segment + else + '' + end + end.join('.') + end + + def self.to_unicode(value) + value.to_s.split('.', -1).map do |segment| + if segment.size > 0 && segment.size < 64 + IDN::Idna.toUnicode(segment, IDN::Idna::ALLOW_UNASSIGNED) + elsif segment.size >= 64 + segment + else + '' + end + end.join('.') + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/pure.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/pure.rb new file mode 100644 index 0000000..7a0c1fd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/idna/pure.rb @@ -0,0 +1,678 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +module Addressable + module IDNA + # This module is loosely based on idn_actionmailer by Mick Staugaard, + # the unicode library by Yoshida Masato, and the punycode implementation + # by Kazuhiro Nishiyama. Most of the code was copied verbatim, but + # some reformatting was done, and some translation from C was done. + # + # Without their code to work from as a base, we'd all still be relying + # on the presence of libidn. Which nobody ever seems to have installed. + # + # Original sources: + # http://github.com/staugaard/idn_actionmailer + # http://www.yoshidam.net/Ruby.html#unicode + # http://rubyforge.org/frs/?group_id=2550 + + + UNICODE_TABLE = File.expand_path( + File.join(File.dirname(__FILE__), '../../..', 'data/unicode.data') + ) + + ACE_PREFIX = "xn--" + + UTF8_REGEX = /\A(?: + [\x09\x0A\x0D\x20-\x7E] # ASCII + | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4nil5 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 + )*\z/mnx + + UTF8_REGEX_MULTIBYTE = /(?: + [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4nil5 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 + )/mnx + + # :startdoc: + + # Converts from a Unicode internationalized domain name to an ASCII + # domain name as described in RFC 3490. + def self.to_ascii(input) + input = input.to_s unless input.is_a?(String) + input = input.dup + if input.respond_to?(:force_encoding) + input.force_encoding(Encoding::ASCII_8BIT) + end + if input =~ UTF8_REGEX && input =~ UTF8_REGEX_MULTIBYTE + parts = unicode_downcase(input).split('.') + parts.map! do |part| + if part.respond_to?(:force_encoding) + part.force_encoding(Encoding::ASCII_8BIT) + end + if part =~ UTF8_REGEX && part =~ UTF8_REGEX_MULTIBYTE + ACE_PREFIX + punycode_encode(unicode_normalize_kc(part)) + else + part + end + end + parts.join('.') + else + input + end + end + + # Converts from an ASCII domain name to a Unicode internationalized + # domain name as described in RFC 3490. + def self.to_unicode(input) + input = input.to_s unless input.is_a?(String) + parts = input.split('.') + parts.map! do |part| + if part =~ /^#{ACE_PREFIX}(.+)/ + begin + punycode_decode(part[/^#{ACE_PREFIX}(.+)/, 1]) + rescue Addressable::IDNA::PunycodeBadInput + # toUnicode is explicitly defined as never-fails by the spec + part + end + else + part + end + end + output = parts.join('.') + if output.respond_to?(:force_encoding) + output.force_encoding(Encoding::UTF_8) + end + output + end + + # Unicode normalization form KC. + def self.unicode_normalize_kc(input) + input = input.to_s unless input.is_a?(String) + unpacked = input.unpack("U*") + unpacked = + unicode_compose(unicode_sort_canonical(unicode_decompose(unpacked))) + return unpacked.pack("U*") + end + + ## + # Unicode aware downcase method. + # + # @api private + # @param [String] input + # The input string. + # @return [String] The downcased result. + def self.unicode_downcase(input) + input = input.to_s unless input.is_a?(String) + unpacked = input.unpack("U*") + unpacked.map! { |codepoint| lookup_unicode_lowercase(codepoint) } + return unpacked.pack("U*") + end + private_class_method :unicode_downcase + + def self.unicode_compose(unpacked) + unpacked_result = [] + length = unpacked.length + + return unpacked if length == 0 + + starter = unpacked[0] + starter_cc = lookup_unicode_combining_class(starter) + starter_cc = 256 if starter_cc != 0 + for i in 1...length + ch = unpacked[i] + + if (starter_cc == 0 && + (composite = unicode_compose_pair(starter, ch)) != nil) + starter = composite + else + unpacked_result << starter + starter = ch + end + end + unpacked_result << starter + return unpacked_result + end + private_class_method :unicode_compose + + def self.unicode_compose_pair(ch_one, ch_two) + if ch_one >= HANGUL_LBASE && ch_one < HANGUL_LBASE + HANGUL_LCOUNT && + ch_two >= HANGUL_VBASE && ch_two < HANGUL_VBASE + HANGUL_VCOUNT + # Hangul L + V + return HANGUL_SBASE + ( + (ch_one - HANGUL_LBASE) * HANGUL_VCOUNT + (ch_two - HANGUL_VBASE) + ) * HANGUL_TCOUNT + elsif ch_one >= HANGUL_SBASE && + ch_one < HANGUL_SBASE + HANGUL_SCOUNT && + (ch_one - HANGUL_SBASE) % HANGUL_TCOUNT == 0 && + ch_two >= HANGUL_TBASE && ch_two < HANGUL_TBASE + HANGUL_TCOUNT + # Hangul LV + T + return ch_one + (ch_two - HANGUL_TBASE) + end + + p = [] + + ucs4_to_utf8(ch_one, p) + ucs4_to_utf8(ch_two, p) + + return lookup_unicode_composition(p) + end + private_class_method :unicode_compose_pair + + def self.ucs4_to_utf8(char, buffer) + if char < 128 + buffer << char + elsif char < 2048 + buffer << (char >> 6 | 192) + buffer << (char & 63 | 128) + elsif char < 0x10000 + buffer << (char >> 12 | 224) + buffer << (char >> 6 & 63 | 128) + buffer << (char & 63 | 128) + elsif char < 0x200000 + buffer << (char >> 18 | 240) + buffer << (char >> 12 & 63 | 128) + buffer << (char >> 6 & 63 | 128) + buffer << (char & 63 | 128) + elsif char < 0x4000000 + buffer << (char >> 24 | 248) + buffer << (char >> 18 & 63 | 128) + buffer << (char >> 12 & 63 | 128) + buffer << (char >> 6 & 63 | 128) + buffer << (char & 63 | 128) + elsif char < 0x80000000 + buffer << (char >> 30 | 252) + buffer << (char >> 24 & 63 | 128) + buffer << (char >> 18 & 63 | 128) + buffer << (char >> 12 & 63 | 128) + buffer << (char >> 6 & 63 | 128) + buffer << (char & 63 | 128) + end + end + private_class_method :ucs4_to_utf8 + + def self.unicode_sort_canonical(unpacked) + unpacked = unpacked.dup + i = 1 + length = unpacked.length + + return unpacked if length < 2 + + while i < length + last = unpacked[i-1] + ch = unpacked[i] + last_cc = lookup_unicode_combining_class(last) + cc = lookup_unicode_combining_class(ch) + if cc != 0 && last_cc != 0 && last_cc > cc + unpacked[i] = last + unpacked[i-1] = ch + i -= 1 if i > 1 + else + i += 1 + end + end + return unpacked + end + private_class_method :unicode_sort_canonical + + def self.unicode_decompose(unpacked) + unpacked_result = [] + for cp in unpacked + if cp >= HANGUL_SBASE && cp < HANGUL_SBASE + HANGUL_SCOUNT + l, v, t = unicode_decompose_hangul(cp) + unpacked_result << l + unpacked_result << v if v + unpacked_result << t if t + else + dc = lookup_unicode_compatibility(cp) + unless dc + unpacked_result << cp + else + unpacked_result.concat(unicode_decompose(dc.unpack("U*"))) + end + end + end + return unpacked_result + end + private_class_method :unicode_decompose + + def self.unicode_decompose_hangul(codepoint) + sindex = codepoint - HANGUL_SBASE; + if sindex < 0 || sindex >= HANGUL_SCOUNT + l = codepoint + v = t = nil + return l, v, t + end + l = HANGUL_LBASE + sindex / HANGUL_NCOUNT + v = HANGUL_VBASE + (sindex % HANGUL_NCOUNT) / HANGUL_TCOUNT + t = HANGUL_TBASE + sindex % HANGUL_TCOUNT + if t == HANGUL_TBASE + t = nil + end + return l, v, t + end + private_class_method :unicode_decompose_hangul + + def self.lookup_unicode_combining_class(codepoint) + codepoint_data = UNICODE_DATA[codepoint] + (codepoint_data ? + (codepoint_data[UNICODE_DATA_COMBINING_CLASS] || 0) : + 0) + end + private_class_method :lookup_unicode_combining_class + + def self.lookup_unicode_compatibility(codepoint) + codepoint_data = UNICODE_DATA[codepoint] + (codepoint_data ? + codepoint_data[UNICODE_DATA_COMPATIBILITY] : nil) + end + private_class_method :lookup_unicode_compatibility + + def self.lookup_unicode_lowercase(codepoint) + codepoint_data = UNICODE_DATA[codepoint] + (codepoint_data ? + (codepoint_data[UNICODE_DATA_LOWERCASE] || codepoint) : + codepoint) + end + private_class_method :lookup_unicode_lowercase + + def self.lookup_unicode_composition(unpacked) + return COMPOSITION_TABLE[unpacked] + end + private_class_method :lookup_unicode_composition + + HANGUL_SBASE = 0xac00 + HANGUL_LBASE = 0x1100 + HANGUL_LCOUNT = 19 + HANGUL_VBASE = 0x1161 + HANGUL_VCOUNT = 21 + HANGUL_TBASE = 0x11a7 + HANGUL_TCOUNT = 28 + HANGUL_NCOUNT = HANGUL_VCOUNT * HANGUL_TCOUNT # 588 + HANGUL_SCOUNT = HANGUL_LCOUNT * HANGUL_NCOUNT # 11172 + + UNICODE_DATA_COMBINING_CLASS = 0 + UNICODE_DATA_EXCLUSION = 1 + UNICODE_DATA_CANONICAL = 2 + UNICODE_DATA_COMPATIBILITY = 3 + UNICODE_DATA_UPPERCASE = 4 + UNICODE_DATA_LOWERCASE = 5 + UNICODE_DATA_TITLECASE = 6 + + begin + if defined?(FakeFS) + fakefs_state = FakeFS.activated? + FakeFS.deactivate! + end + # This is a sparse Unicode table. Codepoints without entries are + # assumed to have the value: [0, 0, nil, nil, nil, nil, nil] + UNICODE_DATA = File.open(UNICODE_TABLE, "rb") do |file| + Marshal.load(file.read) + end + ensure + if defined?(FakeFS) + FakeFS.activate! if fakefs_state + end + end + + COMPOSITION_TABLE = {} + UNICODE_DATA.each do |codepoint, data| + canonical = data[UNICODE_DATA_CANONICAL] + exclusion = data[UNICODE_DATA_EXCLUSION] + + if canonical && exclusion == 0 + COMPOSITION_TABLE[canonical.unpack("C*")] = codepoint + end + end + + UNICODE_MAX_LENGTH = 256 + ACE_MAX_LENGTH = 256 + + PUNYCODE_BASE = 36 + PUNYCODE_TMIN = 1 + PUNYCODE_TMAX = 26 + PUNYCODE_SKEW = 38 + PUNYCODE_DAMP = 700 + PUNYCODE_INITIAL_BIAS = 72 + PUNYCODE_INITIAL_N = 0x80 + PUNYCODE_DELIMITER = 0x2D + + PUNYCODE_MAXINT = 1 << 64 + + PUNYCODE_PRINT_ASCII = + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + + " !\"\#$%&'()*+,-./" + + "0123456789:;<=>?" + + "@ABCDEFGHIJKLMNO" + + "PQRSTUVWXYZ[\\]^_" + + "`abcdefghijklmno" + + "pqrstuvwxyz{|}~\n" + + # Input is invalid. + class PunycodeBadInput < StandardError; end + # Output would exceed the space provided. + class PunycodeBigOutput < StandardError; end + # Input needs wider integers to process. + class PunycodeOverflow < StandardError; end + + def self.punycode_encode(unicode) + unicode = unicode.to_s unless unicode.is_a?(String) + input = unicode.unpack("U*") + output = [0] * (ACE_MAX_LENGTH + 1) + input_length = input.size + output_length = [ACE_MAX_LENGTH] + + # Initialize the state + n = PUNYCODE_INITIAL_N + delta = out = 0 + max_out = output_length[0] + bias = PUNYCODE_INITIAL_BIAS + + # Handle the basic code points: + input_length.times do |j| + if punycode_basic?(input[j]) + if max_out - out < 2 + raise PunycodeBigOutput, + "Output would exceed the space provided." + end + output[out] = input[j] + out += 1 + end + end + + h = b = out + + # h is the number of code points that have been handled, b is the + # number of basic code points, and out is the number of characters + # that have been output. + + if b > 0 + output[out] = PUNYCODE_DELIMITER + out += 1 + end + + # Main encoding loop: + + while h < input_length + # All non-basic code points < n have been + # handled already. Find the next larger one: + + m = PUNYCODE_MAXINT + input_length.times do |j| + m = input[j] if (n...m) === input[j] + end + + # Increase delta enough to advance the decoder's + # state to , but guard against overflow: + + if m - n > (PUNYCODE_MAXINT - delta) / (h + 1) + raise PunycodeOverflow, "Input needs wider integers to process." + end + delta += (m - n) * (h + 1) + n = m + + input_length.times do |j| + # Punycode does not need to check whether input[j] is basic: + if input[j] < n + delta += 1 + if delta == 0 + raise PunycodeOverflow, + "Input needs wider integers to process." + end + end + + if input[j] == n + # Represent delta as a generalized variable-length integer: + + q = delta; k = PUNYCODE_BASE + while true + if out >= max_out + raise PunycodeBigOutput, + "Output would exceed the space provided." + end + t = ( + if k <= bias + PUNYCODE_TMIN + elsif k >= bias + PUNYCODE_TMAX + PUNYCODE_TMAX + else + k - bias + end + ) + break if q < t + output[out] = + punycode_encode_digit(t + (q - t) % (PUNYCODE_BASE - t)) + out += 1 + q = (q - t) / (PUNYCODE_BASE - t) + k += PUNYCODE_BASE + end + + output[out] = punycode_encode_digit(q) + out += 1 + bias = punycode_adapt(delta, h + 1, h == b) + delta = 0 + h += 1 + end + end + + delta += 1 + n += 1 + end + + output_length[0] = out + + outlen = out + outlen.times do |j| + c = output[j] + unless c >= 0 && c <= 127 + raise StandardError, "Invalid output char." + end + unless PUNYCODE_PRINT_ASCII[c] + raise PunycodeBadInput, "Input is invalid." + end + end + + output[0..outlen].map { |x| x.chr }.join("").sub(/\0+\z/, "") + end + private_class_method :punycode_encode + + def self.punycode_decode(punycode) + input = [] + output = [] + + if ACE_MAX_LENGTH * 2 < punycode.size + raise PunycodeBigOutput, "Output would exceed the space provided." + end + punycode.each_byte do |c| + unless c >= 0 && c <= 127 + raise PunycodeBadInput, "Input is invalid." + end + input.push(c) + end + + input_length = input.length + output_length = [UNICODE_MAX_LENGTH] + + # Initialize the state + n = PUNYCODE_INITIAL_N + + out = i = 0 + max_out = output_length[0] + bias = PUNYCODE_INITIAL_BIAS + + # Handle the basic code points: Let b be the number of input code + # points before the last delimiter, or 0 if there is none, then + # copy the first b code points to the output. + + b = 0 + input_length.times do |j| + b = j if punycode_delimiter?(input[j]) + end + if b > max_out + raise PunycodeBigOutput, "Output would exceed the space provided." + end + + b.times do |j| + unless punycode_basic?(input[j]) + raise PunycodeBadInput, "Input is invalid." + end + output[out] = input[j] + out+=1 + end + + # Main decoding loop: Start just after the last delimiter if any + # basic code points were copied; start at the beginning otherwise. + + in_ = b > 0 ? b + 1 : 0 + while in_ < input_length + + # in_ is the index of the next character to be consumed, and + # out is the number of code points in the output array. + + # Decode a generalized variable-length integer into delta, + # which gets added to i. The overflow checking is easier + # if we increase i as we go, then subtract off its starting + # value at the end to obtain delta. + + oldi = i; w = 1; k = PUNYCODE_BASE + while true + if in_ >= input_length + raise PunycodeBadInput, "Input is invalid." + end + digit = punycode_decode_digit(input[in_]) + in_+=1 + if digit >= PUNYCODE_BASE + raise PunycodeBadInput, "Input is invalid." + end + if digit > (PUNYCODE_MAXINT - i) / w + raise PunycodeOverflow, "Input needs wider integers to process." + end + i += digit * w + t = ( + if k <= bias + PUNYCODE_TMIN + elsif k >= bias + PUNYCODE_TMAX + PUNYCODE_TMAX + else + k - bias + end + ) + break if digit < t + if w > PUNYCODE_MAXINT / (PUNYCODE_BASE - t) + raise PunycodeOverflow, "Input needs wider integers to process." + end + w *= PUNYCODE_BASE - t + k += PUNYCODE_BASE + end + + bias = punycode_adapt(i - oldi, out + 1, oldi == 0) + + # I was supposed to wrap around from out + 1 to 0, + # incrementing n each time, so we'll fix that now: + + if i / (out + 1) > PUNYCODE_MAXINT - n + raise PunycodeOverflow, "Input needs wider integers to process." + end + n += i / (out + 1) + i %= out + 1 + + # Insert n at position i of the output: + + # not needed for Punycode: + # raise PUNYCODE_INVALID_INPUT if decode_digit(n) <= base + if out >= max_out + raise PunycodeBigOutput, "Output would exceed the space provided." + end + + #memmove(output + i + 1, output + i, (out - i) * sizeof *output) + output[i + 1, out - i] = output[i, out - i] + output[i] = n + i += 1 + + out += 1 + end + + output_length[0] = out + + output.pack("U*") + end + private_class_method :punycode_decode + + def self.punycode_basic?(codepoint) + codepoint < 0x80 + end + private_class_method :punycode_basic? + + def self.punycode_delimiter?(codepoint) + codepoint == PUNYCODE_DELIMITER + end + private_class_method :punycode_delimiter? + + def self.punycode_encode_digit(d) + d + 22 + 75 * ((d < 26) ? 1 : 0) + end + private_class_method :punycode_encode_digit + + # Returns the numeric value of a basic codepoint + # (for use in representing integers) in the range 0 to + # base - 1, or PUNYCODE_BASE if codepoint does not represent a value. + def self.punycode_decode_digit(codepoint) + if codepoint - 48 < 10 + codepoint - 22 + elsif codepoint - 65 < 26 + codepoint - 65 + elsif codepoint - 97 < 26 + codepoint - 97 + else + PUNYCODE_BASE + end + end + private_class_method :punycode_decode_digit + + # Bias adaptation method + def self.punycode_adapt(delta, numpoints, firsttime) + delta = firsttime ? delta / PUNYCODE_DAMP : delta >> 1 + # delta >> 1 is a faster way of doing delta / 2 + delta += delta / numpoints + difference = PUNYCODE_BASE - PUNYCODE_TMIN + + k = 0 + while delta > (difference * PUNYCODE_TMAX) / 2 + delta /= difference + k += PUNYCODE_BASE + end + + k + (difference + 1) * delta / (delta + PUNYCODE_SKEW) + end + private_class_method :punycode_adapt + end + # :startdoc: +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/template.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/template.rb new file mode 100644 index 0000000..45f6ae6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/template.rb @@ -0,0 +1,1031 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +require "addressable/version" +require "addressable/uri" + +module Addressable + ## + # This is an implementation of a URI template based on + # RFC 6570 (http://tools.ietf.org/html/rfc6570). + class Template + # Constants used throughout the template code. + anything = + Addressable::URI::CharacterClasses::RESERVED + + Addressable::URI::CharacterClasses::UNRESERVED + + + variable_char_class = + Addressable::URI::CharacterClasses::ALPHA + + Addressable::URI::CharacterClasses::DIGIT + '_' + + var_char = + "(?>(?:[#{variable_char_class}]|%[a-fA-F0-9][a-fA-F0-9])+)" + RESERVED = + "(?:[#{anything}]|%[a-fA-F0-9][a-fA-F0-9])" + UNRESERVED = + "(?:[#{ + Addressable::URI::CharacterClasses::UNRESERVED + }]|%[a-fA-F0-9][a-fA-F0-9])" + variable = + "(?:#{var_char}(?:\\.?#{var_char})*)" + varspec = + "(?:(#{variable})(\\*|:\\d+)?)" + VARNAME = + /^#{variable}$/ + VARSPEC = + /^#{varspec}$/ + VARIABLE_LIST = + /^#{varspec}(?:,#{varspec})*$/ + operator = + "+#./;?&=,!@|" + EXPRESSION = + /\{([#{operator}])?(#{varspec}(?:,#{varspec})*)\}/ + + + LEADERS = { + '?' => '?', + '/' => '/', + '#' => '#', + '.' => '.', + ';' => ';', + '&' => '&' + } + JOINERS = { + '?' => '&', + '.' => '.', + ';' => ';', + '&' => '&', + '/' => '/' + } + + ## + # Raised if an invalid template value is supplied. + class InvalidTemplateValueError < StandardError + end + + ## + # Raised if an invalid template operator is used in a pattern. + class InvalidTemplateOperatorError < StandardError + end + + ## + # Raised if an invalid template operator is used in a pattern. + class TemplateOperatorAbortedError < StandardError + end + + ## + # This class represents the data that is extracted when a Template + # is matched against a URI. + class MatchData + ## + # Creates a new MatchData object. + # MatchData objects should never be instantiated directly. + # + # @param [Addressable::URI] uri + # The URI that the template was matched against. + def initialize(uri, template, mapping) + @uri = uri.dup.freeze + @template = template + @mapping = mapping.dup.freeze + end + + ## + # @return [Addressable::URI] + # The URI that the Template was matched against. + attr_reader :uri + + ## + # @return [Addressable::Template] + # The Template used for the match. + attr_reader :template + + ## + # @return [Hash] + # The mapping that resulted from the match. + # Note that this mapping does not include keys or values for + # variables that appear in the Template, but are not present + # in the URI. + attr_reader :mapping + + ## + # @return [Array] + # The list of variables that were present in the Template. + # Note that this list will include variables which do not appear + # in the mapping because they were not present in URI. + def variables + self.template.variables + end + alias_method :keys, :variables + alias_method :names, :variables + + ## + # @return [Array] + # The list of values that were captured by the Template. + # Note that this list will include nils for any variables which + # were in the Template, but did not appear in the URI. + def values + @values ||= self.variables.inject([]) do |accu, key| + accu << self.mapping[key] + accu + end + end + alias_method :captures, :values + + ## + # Accesses captured values by name or by index. + # + # @param [String, Symbol, Fixnum] key + # Capture index or name. Note that when accessing by with index + # of 0, the full URI will be returned. The intention is to mimic + # the ::MatchData#[] behavior. + # + # @param [#to_int, nil] len + # If provided, an array of values will be returend with the given + # parameter used as length. + # + # @return [Array, String, nil] + # The captured value corresponding to the index or name. If the + # value was not provided or the key is unknown, nil will be + # returned. + # + # If the second parameter is provided, an array of that length will + # be returned instead. + def [](key, len = nil) + if len + to_a[key, len] + elsif String === key or Symbol === key + mapping[key.to_s] + else + to_a[key] + end + end + + ## + # @return [Array] + # Array with the matched URI as first element followed by the captured + # values. + def to_a + [to_s, *values] + end + + ## + # @return [String] + # The matched URI as String. + def to_s + uri.to_s + end + alias_method :string, :to_s + + # Returns multiple captured values at once. + # + # @param [String, Symbol, Fixnum] *indexes + # Indices of the captures to be returned + # + # @return [Array] + # Values corresponding to given indices. + # + # @see Addressable::Template::MatchData#[] + def values_at(*indexes) + indexes.map { |i| self[i] } + end + + ## + # Returns a String representation of the MatchData's state. + # + # @return [String] The MatchData's state, as a String. + def inspect + sprintf("#<%s:%#0x RESULT:%s>", + self.class.to_s, self.object_id, self.mapping.inspect) + end + + ## + # Dummy method for code expecting a ::MatchData instance + # + # @return [String] An empty string. + def pre_match + "" + end + alias_method :post_match, :pre_match + end + + ## + # Creates a new Addressable::Template object. + # + # @param [#to_str] pattern The URI Template pattern. + # + # @return [Addressable::Template] The initialized Template object. + def initialize(pattern) + if !pattern.respond_to?(:to_str) + raise TypeError, "Can't convert #{pattern.class} into String." + end + @pattern = pattern.to_str.dup.freeze + end + + ## + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + def freeze + self.variables + self.variable_defaults + self.named_captures + super + end + + ## + # @return [String] The Template object's pattern. + attr_reader :pattern + + ## + # Returns a String representation of the Template object's state. + # + # @return [String] The Template object's state, as a String. + def inspect + sprintf("#<%s:%#0x PATTERN:%s>", + self.class.to_s, self.object_id, self.pattern) + end + + ## + # Returns true if the Template objects are equal. This method + # does NOT normalize either Template before doing the comparison. + # + # @param [Object] template The Template to compare. + # + # @return [TrueClass, FalseClass] + # true if the Templates are equivalent, false + # otherwise. + def ==(template) + return false unless template.kind_of?(Template) + return self.pattern == template.pattern + end + + ## + # Addressable::Template makes no distinction between `==` and `eql?`. + # + # @see #== + alias_method :eql?, :== + + ## + # Extracts a mapping from the URI using a URI Template pattern. + # + # @param [Addressable::URI, #to_str] uri + # The URI to extract from. + # + # @param [#restore, #match] processor + # A template processor object may optionally be supplied. + # + # The object should respond to either the restore or + # match messages or both. The restore method should + # take two parameters: `[String] name` and `[String] value`. + # The restore method should reverse any transformations that + # have been performed on the value to ensure a valid URI. + # The match method should take a single + # parameter: `[String] name`. The match method should return + # a String containing a regular expression capture group for + # matching on that particular variable. The default value is `".*?"`. + # The match method has no effect on multivariate operator + # expansions. + # + # @return [Hash, NilClass] + # The Hash mapping that was extracted from the URI, or + # nil if the URI didn't match the template. + # + # @example + # class ExampleProcessor + # def self.restore(name, value) + # return value.gsub(/\+/, " ") if name == "query" + # return value + # end + # + # def self.match(name) + # return ".*?" if name == "first" + # return ".*" + # end + # end + # + # uri = Addressable::URI.parse( + # "http://example.com/search/an+example+search+query/" + # ) + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).extract(uri, ExampleProcessor) + # #=> {"query" => "an example search query"} + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # Addressable::Template.new( + # "http://example.com/{first}/{second}/" + # ).extract(uri, ExampleProcessor) + # #=> {"first" => "a", "second" => "b/c"} + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # Addressable::Template.new( + # "http://example.com/{first}/{-list|/|second}/" + # ).extract(uri) + # #=> {"first" => "a", "second" => ["b", "c"]} + def extract(uri, processor=nil) + match_data = self.match(uri, processor) + return (match_data ? match_data.mapping : nil) + end + + ## + # Extracts match data from the URI using a URI Template pattern. + # + # @param [Addressable::URI, #to_str] uri + # The URI to extract from. + # + # @param [#restore, #match] processor + # A template processor object may optionally be supplied. + # + # The object should respond to either the restore or + # match messages or both. The restore method should + # take two parameters: `[String] name` and `[String] value`. + # The restore method should reverse any transformations that + # have been performed on the value to ensure a valid URI. + # The match method should take a single + # parameter: `[String] name`. The match method should return + # a String containing a regular expression capture group for + # matching on that particular variable. The default value is `".*?"`. + # The match method has no effect on multivariate operator + # expansions. + # + # @return [Hash, NilClass] + # The Hash mapping that was extracted from the URI, or + # nil if the URI didn't match the template. + # + # @example + # class ExampleProcessor + # def self.restore(name, value) + # return value.gsub(/\+/, " ") if name == "query" + # return value + # end + # + # def self.match(name) + # return ".*?" if name == "first" + # return ".*" + # end + # end + # + # uri = Addressable::URI.parse( + # "http://example.com/search/an+example+search+query/" + # ) + # match = Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).match(uri, ExampleProcessor) + # match.variables + # #=> ["query"] + # match.captures + # #=> ["an example search query"] + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # match = Addressable::Template.new( + # "http://example.com/{first}/{+second}/" + # ).match(uri, ExampleProcessor) + # match.variables + # #=> ["first", "second"] + # match.captures + # #=> ["a", "b/c"] + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # match = Addressable::Template.new( + # "http://example.com/{first}{/second*}/" + # ).match(uri) + # match.variables + # #=> ["first", "second"] + # match.captures + # #=> ["a", ["b", "c"]] + def match(uri, processor=nil) + uri = Addressable::URI.parse(uri) unless uri.is_a?(Addressable::URI) + mapping = {} + + # First, we need to process the pattern, and extract the values. + expansions, expansion_regexp = + parse_template_pattern(pattern, processor) + + return nil unless uri.to_str.match(expansion_regexp) + unparsed_values = uri.to_str.scan(expansion_regexp).flatten + + if uri.to_str == pattern + return Addressable::Template::MatchData.new(uri, self, mapping) + elsif expansions.size > 0 + index = 0 + expansions.each do |expansion| + _, operator, varlist = *expansion.match(EXPRESSION) + varlist.split(',').each do |varspec| + _, name, modifier = *varspec.match(VARSPEC) + mapping[name] ||= nil + case operator + when nil, '+', '#', '/', '.' + unparsed_value = unparsed_values[index] + name = varspec[VARSPEC, 1] + value = unparsed_value + value = value.split(JOINERS[operator]) if value && modifier == '*' + when ';', '?', '&' + if modifier == '*' + if unparsed_values[index] + value = unparsed_values[index].split(JOINERS[operator]) + value = value.inject({}) do |acc, v| + key, val = v.split('=') + val = "" if val.nil? + acc[key] = val + acc + end + end + else + if (unparsed_values[index]) + name, value = unparsed_values[index].split('=') + value = "" if value.nil? + end + end + end + if processor != nil && processor.respond_to?(:restore) + value = processor.restore(name, value) + end + if processor == nil + if value.is_a?(Hash) + value = value.inject({}){|acc, (k, v)| + acc[Addressable::URI.unencode_component(k)] = + Addressable::URI.unencode_component(v) + acc + } + elsif value.is_a?(Array) + value = value.map{|v| Addressable::URI.unencode_component(v) } + else + value = Addressable::URI.unencode_component(value) + end + end + if !mapping.has_key?(name) || mapping[name].nil? + # Doesn't exist, set to value (even if value is nil) + mapping[name] = value + end + index = index + 1 + end + end + return Addressable::Template::MatchData.new(uri, self, mapping) + else + return nil + end + end + + ## + # Expands a URI template into another URI template. + # + # @param [Hash] mapping The mapping that corresponds to the pattern. + # @param [#validate, #transform] processor + # An optional processor object may be supplied. + # @param [Boolean] normalize_values + # Optional flag to enable/disable unicode normalization. Default: true + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError + # exception will be raised if the value is invalid. The transform + # method should return the transformed variable value as a String. + # If a transform method is used, the value will not be percent + # encoded automatically. Unicode normalization will be performed both + # before and after sending the value to the transform method. + # + # @return [Addressable::Template] The partially expanded URI template. + # + # @example + # Addressable::Template.new( + # "http://example.com/{one}/{two}/" + # ).partial_expand({"one" => "1"}).pattern + # #=> "http://example.com/1/{two}/" + # + # Addressable::Template.new( + # "http://example.com/{?one,two}/" + # ).partial_expand({"one" => "1"}).pattern + # #=> "http://example.com/?one=1{&two}/" + # + # Addressable::Template.new( + # "http://example.com/{?one,two,three}/" + # ).partial_expand({"one" => "1", "three" => 3}).pattern + # #=> "http://example.com/?one=1{&two}&three=3" + def partial_expand(mapping, processor=nil, normalize_values=true) + result = self.pattern.dup + mapping = normalize_keys(mapping) + result.gsub!( EXPRESSION ) do |capture| + transform_partial_capture(mapping, capture, processor, normalize_values) + end + return Addressable::Template.new(result) + end + + ## + # Expands a URI template into a full URI. + # + # @param [Hash] mapping The mapping that corresponds to the pattern. + # @param [#validate, #transform] processor + # An optional processor object may be supplied. + # @param [Boolean] normalize_values + # Optional flag to enable/disable unicode normalization. Default: true + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError + # exception will be raised if the value is invalid. The transform + # method should return the transformed variable value as a String. + # If a transform method is used, the value will not be percent + # encoded automatically. Unicode normalization will be performed both + # before and after sending the value to the transform method. + # + # @return [Addressable::URI] The expanded URI template. + # + # @example + # class ExampleProcessor + # def self.validate(name, value) + # return !!(value =~ /^[\w ]+$/) if name == "query" + # return true + # end + # + # def self.transform(name, value) + # return value.gsub(/ /, "+") if name == "query" + # return value + # end + # end + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "an example search query"}, + # ExampleProcessor + # ).to_str + # #=> "http://example.com/search/an+example+search+query/" + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "an example search query"} + # ).to_str + # #=> "http://example.com/search/an%20example%20search%20query/" + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "bogus!"}, + # ExampleProcessor + # ).to_str + # #=> Addressable::Template::InvalidTemplateValueError + def expand(mapping, processor=nil, normalize_values=true) + result = self.pattern.dup + mapping = normalize_keys(mapping) + result.gsub!( EXPRESSION ) do |capture| + transform_capture(mapping, capture, processor, normalize_values) + end + return Addressable::URI.parse(result) + end + + ## + # Returns an Array of variables used within the template pattern. + # The variables are listed in the Array in the order they appear within + # the pattern. Multiple occurrences of a variable within a pattern are + # not represented in this Array. + # + # @return [Array] The variables present in the template's pattern. + def variables + @variables ||= ordered_variable_defaults.map { |var, val| var }.uniq + end + alias_method :keys, :variables + alias_method :names, :variables + + ## + # Returns a mapping of variables to their default values specified + # in the template. Variables without defaults are not returned. + # + # @return [Hash] Mapping of template variables to their defaults + def variable_defaults + @variable_defaults ||= + Hash[*ordered_variable_defaults.reject { |k, v| v.nil? }.flatten] + end + + ## + # Coerces a template into a `Regexp` object. This regular expression will + # behave very similarly to the actual template, and should match the same + # URI values, but it cannot fully handle, for example, values that would + # extract to an `Array`. + # + # @return [Regexp] A regular expression which should match the template. + def to_regexp + _, source = parse_template_pattern(pattern) + Regexp.new(source) + end + + ## + # Returns the source of the coerced `Regexp`. + # + # @return [String] The source of the `Regexp` given by {#to_regexp}. + # + # @api private + def source + self.to_regexp.source + end + + ## + # Returns the named captures of the coerced `Regexp`. + # + # @return [Hash] The named captures of the `Regexp` given by {#to_regexp}. + # + # @api private + def named_captures + self.to_regexp.named_captures + end + + private + def ordered_variable_defaults + @ordered_variable_defaults ||= begin + expansions, _ = parse_template_pattern(pattern) + expansions.map do |capture| + _, _, varlist = *capture.match(EXPRESSION) + varlist.split(',').map do |varspec| + varspec[VARSPEC, 1] + end + end.flatten + end + end + + + ## + # Loops through each capture and expands any values available in mapping + # + # @param [Hash] mapping + # Set of keys to expand + # @param [String] capture + # The expression to expand + # @param [#validate, #transform] processor + # An optional processor object may be supplied. + # @param [Boolean] normalize_values + # Optional flag to enable/disable unicode normalization. Default: true + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError exception + # will be raised if the value is invalid. The transform method + # should return the transformed variable value as a String. If a + # transform method is used, the value will not be percent encoded + # automatically. Unicode normalization will be performed both before and + # after sending the value to the transform method. + # + # @return [String] The expanded expression + def transform_partial_capture(mapping, capture, processor = nil, + normalize_values = true) + _, operator, varlist = *capture.match(EXPRESSION) + + vars = varlist.split(",") + + if operator == "?" + # partial expansion of form style query variables sometimes requires a + # slight reordering of the variables to produce a valid url. + first_to_expand = vars.find { |varspec| + _, name, _ = *varspec.match(VARSPEC) + mapping.key?(name) && !mapping[name].nil? + } + + vars = [first_to_expand] + vars.reject {|varspec| varspec == first_to_expand} if first_to_expand + end + + vars. + inject("".dup) do |acc, varspec| + _, name, _ = *varspec.match(VARSPEC) + next_val = if mapping.key? name + transform_capture(mapping, "{#{operator}#{varspec}}", + processor, normalize_values) + else + "{#{operator}#{varspec}}" + end + # If we've already expanded at least one '?' operator with non-empty + # value, change to '&' + operator = "&" if (operator == "?") && (next_val != "") + acc << next_val + end + end + + ## + # Transforms a mapped value so that values can be substituted into the + # template. + # + # @param [Hash] mapping The mapping to replace captures + # @param [String] capture + # The expression to replace + # @param [#validate, #transform] processor + # An optional processor object may be supplied. + # @param [Boolean] normalize_values + # Optional flag to enable/disable unicode normalization. Default: true + # + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError exception + # will be raised if the value is invalid. The transform method + # should return the transformed variable value as a String. If a + # transform method is used, the value will not be percent encoded + # automatically. Unicode normalization will be performed both before and + # after sending the value to the transform method. + # + # @return [String] The expanded expression + def transform_capture(mapping, capture, processor=nil, + normalize_values=true) + _, operator, varlist = *capture.match(EXPRESSION) + return_value = varlist.split(',').inject([]) do |acc, varspec| + _, name, modifier = *varspec.match(VARSPEC) + value = mapping[name] + unless value == nil || value == {} + allow_reserved = %w(+ #).include?(operator) + # Common primitives where the .to_s output is well-defined + if Numeric === value || Symbol === value || + value == true || value == false + value = value.to_s + end + length = modifier.gsub(':', '').to_i if modifier =~ /^:\d+/ + + unless (Hash === value) || + value.respond_to?(:to_ary) || value.respond_to?(:to_str) + raise TypeError, + "Can't convert #{value.class} into String or Array." + end + + value = normalize_value(value) if normalize_values + + if processor == nil || !processor.respond_to?(:transform) + # Handle percent escaping + if allow_reserved + encode_map = + Addressable::URI::CharacterClasses::RESERVED + + Addressable::URI::CharacterClasses::UNRESERVED + else + encode_map = Addressable::URI::CharacterClasses::UNRESERVED + end + if value.kind_of?(Array) + transformed_value = value.map do |val| + if length + Addressable::URI.encode_component(val[0...length], encode_map) + else + Addressable::URI.encode_component(val, encode_map) + end + end + unless modifier == "*" + transformed_value = transformed_value.join(',') + end + elsif value.kind_of?(Hash) + transformed_value = value.map do |key, val| + if modifier == "*" + "#{ + Addressable::URI.encode_component( key, encode_map) + }=#{ + Addressable::URI.encode_component( val, encode_map) + }" + else + "#{ + Addressable::URI.encode_component( key, encode_map) + },#{ + Addressable::URI.encode_component( val, encode_map) + }" + end + end + unless modifier == "*" + transformed_value = transformed_value.join(',') + end + else + if length + transformed_value = Addressable::URI.encode_component( + value[0...length], encode_map) + else + transformed_value = Addressable::URI.encode_component( + value, encode_map) + end + end + end + + # Process, if we've got a processor + if processor != nil + if processor.respond_to?(:validate) + if !processor.validate(name, value) + display_value = value.kind_of?(Array) ? value.inspect : value + raise InvalidTemplateValueError, + "#{name}=#{display_value} is an invalid template value." + end + end + if processor.respond_to?(:transform) + transformed_value = processor.transform(name, value) + if normalize_values + transformed_value = normalize_value(transformed_value) + end + end + end + acc << [name, transformed_value] + end + acc + end + return "" if return_value.empty? + join_values(operator, return_value) + end + + ## + # Takes a set of values, and joins them together based on the + # operator. + # + # @param [String, Nil] operator One of the operators from the set + # (?,&,+,#,;,/,.), or nil if there wasn't one. + # @param [Array] return_value + # The set of return values (as [variable_name, value] tuples) that will + # be joined together. + # + # @return [String] The transformed mapped value + def join_values(operator, return_value) + leader = LEADERS.fetch(operator, '') + joiner = JOINERS.fetch(operator, ',') + case operator + when '&', '?' + leader + return_value.map{|k,v| + if v.is_a?(Array) && v.first =~ /=/ + v.join(joiner) + elsif v.is_a?(Array) + v.map{|inner_value| "#{k}=#{inner_value}"}.join(joiner) + else + "#{k}=#{v}" + end + }.join(joiner) + when ';' + return_value.map{|k,v| + if v.is_a?(Array) && v.first =~ /=/ + ';' + v.join(";") + elsif v.is_a?(Array) + ';' + v.map{|inner_value| "#{k}=#{inner_value}"}.join(";") + else + v && v != '' ? ";#{k}=#{v}" : ";#{k}" + end + }.join + else + leader + return_value.map{|k,v| v}.join(joiner) + end + end + + ## + # Takes a set of values, and joins them together based on the + # operator. + # + # @param [Hash, Array, String] value + # Normalizes keys and values with IDNA#unicode_normalize_kc + # + # @return [Hash, Array, String] The normalized values + def normalize_value(value) + unless value.is_a?(Hash) + value = value.respond_to?(:to_ary) ? value.to_ary : value.to_str + end + + # Handle unicode normalization + if value.kind_of?(Array) + value.map! { |val| Addressable::IDNA.unicode_normalize_kc(val) } + elsif value.kind_of?(Hash) + value = value.inject({}) { |acc, (k, v)| + acc[Addressable::IDNA.unicode_normalize_kc(k)] = + Addressable::IDNA.unicode_normalize_kc(v) + acc + } + else + value = Addressable::IDNA.unicode_normalize_kc(value) + end + value + end + + ## + # Generates a hash with string keys + # + # @param [Hash] mapping A mapping hash to normalize + # + # @return [Hash] + # A hash with stringified keys + def normalize_keys(mapping) + return mapping.inject({}) do |accu, pair| + name, value = pair + if Symbol === name + name = name.to_s + elsif name.respond_to?(:to_str) + name = name.to_str + else + raise TypeError, + "Can't convert #{name.class} into String." + end + accu[name] = value + accu + end + end + + ## + # Generates the Regexp that parses a template pattern. Memoizes the + # value if template processor not set (processors may not be deterministic) + # + # @param [String] pattern The URI template pattern. + # @param [#match] processor The template processor to use. + # + # @return [Array, Regexp] + # An array of expansion variables nad a regular expression which may be + # used to parse a template pattern + def parse_template_pattern(pattern, processor = nil) + if processor.nil? && pattern == @pattern + @cached_template_parse ||= + parse_new_template_pattern(pattern, processor) + else + parse_new_template_pattern(pattern, processor) + end + end + + ## + # Generates the Regexp that parses a template pattern. + # + # @param [String] pattern The URI template pattern. + # @param [#match] processor The template processor to use. + # + # @return [Array, Regexp] + # An array of expansion variables nad a regular expression which may be + # used to parse a template pattern + def parse_new_template_pattern(pattern, processor = nil) + # Escape the pattern. The two gsubs restore the escaped curly braces + # back to their original form. Basically, escape everything that isn't + # within an expansion. + escaped_pattern = Regexp.escape( + pattern + ).gsub(/\\\{(.*?)\\\}/) do |escaped| + escaped.gsub(/\\(.)/, "\\1") + end + + expansions = [] + + # Create a regular expression that captures the values of the + # variables in the URI. + regexp_string = escaped_pattern.gsub( EXPRESSION ) do |expansion| + + expansions << expansion + _, operator, varlist = *expansion.match(EXPRESSION) + leader = Regexp.escape(LEADERS.fetch(operator, '')) + joiner = Regexp.escape(JOINERS.fetch(operator, ',')) + combined = varlist.split(',').map do |varspec| + _, name, modifier = *varspec.match(VARSPEC) + + result = processor && processor.respond_to?(:match) ? processor.match(name) : nil + if result + "(?<#{name}>#{ result })" + else + group = case operator + when '+' + "#{ RESERVED }*?" + when '#' + "#{ RESERVED }*?" + when '/' + "#{ UNRESERVED }*?" + when '.' + "#{ UNRESERVED.gsub('\.', '') }*?" + when ';' + "#{ UNRESERVED }*=?#{ UNRESERVED }*?" + when '?' + "#{ UNRESERVED }*=#{ UNRESERVED }*?" + when '&' + "#{ UNRESERVED }*=#{ UNRESERVED }*?" + else + "#{ UNRESERVED }*?" + end + if modifier == '*' + "(?<#{name}>#{group}(?:#{joiner}?#{group})*)?" + else + "(?<#{name}>#{group})?" + end + end + end.join("#{joiner}?") + "(?:|#{leader}#{combined})" + end + + # Ensure that the regular expression matches the whole URI. + regexp_string = "^#{regexp_string}$" + return expansions, Regexp.new(regexp_string) + end + + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/uri.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/uri.rb new file mode 100644 index 0000000..6b5f4fa --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/uri.rb @@ -0,0 +1,2556 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +require "addressable/version" +require "addressable/idna" +require "public_suffix" + +## +# Addressable is a library for processing links and URIs. +module Addressable + ## + # This is an implementation of a URI parser based on + # RFC 3986, + # RFC 3987. + class URI + ## + # Raised if something other than a uri is supplied. + class InvalidURIError < StandardError + end + + ## + # Container for the character classes specified in + # RFC 3986. + module CharacterClasses + ALPHA = "a-zA-Z" + DIGIT = "0-9" + GEN_DELIMS = "\\:\\/\\?\\#\\[\\]\\@" + SUB_DELIMS = "\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=" + RESERVED = GEN_DELIMS + SUB_DELIMS + UNRESERVED = ALPHA + DIGIT + "\\-\\.\\_\\~" + PCHAR = UNRESERVED + SUB_DELIMS + "\\:\\@" + SCHEME = ALPHA + DIGIT + "\\-\\+\\." + HOST = UNRESERVED + SUB_DELIMS + "\\[\\:\\]" + AUTHORITY = PCHAR + "\\[\\:\\]" + PATH = PCHAR + "\\/" + QUERY = PCHAR + "\\/\\?" + FRAGMENT = PCHAR + "\\/\\?" + end + + module NormalizeCharacterClasses + HOST = /[^#{CharacterClasses::HOST}]/ + UNRESERVED = /[^#{CharacterClasses::UNRESERVED}]/ + PCHAR = /[^#{CharacterClasses::PCHAR}]/ + SCHEME = /[^#{CharacterClasses::SCHEME}]/ + FRAGMENT = /[^#{CharacterClasses::FRAGMENT}]/ + QUERY = %r{[^a-zA-Z0-9\-\.\_\~\!\$\'\(\)\*\+\,\=\:\@\/\?%]|%(?!2B|2b)} + end + + SLASH = '/' + EMPTY_STR = '' + + URIREGEX = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/ + + PORT_MAPPING = { + "http" => 80, + "https" => 443, + "ftp" => 21, + "tftp" => 69, + "sftp" => 22, + "ssh" => 22, + "svn+ssh" => 22, + "telnet" => 23, + "nntp" => 119, + "gopher" => 70, + "wais" => 210, + "ldap" => 389, + "prospero" => 1525 + }.freeze + + ## + # Returns a URI object based on the parsed string. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # + # @return [Addressable::URI] The parsed URI. + def self.parse(uri) + # If we were given nil, return nil. + return nil unless uri + # If a URI object is passed, just return itself. + return uri.dup if uri.kind_of?(self) + + # If a URI object of the Ruby standard library variety is passed, + # convert it to a string, then parse the string. + # We do the check this way because we don't want to accidentally + # cause a missing constant exception to be thrown. + if uri.class.name =~ /^URI\b/ + uri = uri.to_s + end + + # Otherwise, convert to a String + begin + uri = uri.to_str + rescue TypeError, NoMethodError + raise TypeError, "Can't convert #{uri.class} into String." + end if not uri.is_a? String + + # This Regexp supplied as an example in RFC 3986, and it works great. + scan = uri.scan(URIREGEX) + fragments = scan[0] + scheme = fragments[1] + authority = fragments[3] + path = fragments[4] + query = fragments[6] + fragment = fragments[8] + user = nil + password = nil + host = nil + port = nil + if authority != nil + # The Regexp above doesn't split apart the authority. + userinfo = authority[/^([^\[\]]*)@/, 1] + if userinfo != nil + user = userinfo.strip[/^([^:]*):?/, 1] + password = userinfo.strip[/:(.*)$/, 1] + end + host = authority.sub( + /^([^\[\]]*)@/, EMPTY_STR + ).sub( + /:([^:@\[\]]*?)$/, EMPTY_STR + ) + port = authority[/:([^:@\[\]]*?)$/, 1] + end + if port == EMPTY_STR + port = nil + end + + return new( + :scheme => scheme, + :user => user, + :password => password, + :host => host, + :port => port, + :path => path, + :query => query, + :fragment => fragment + ) + end + + ## + # Converts an input to a URI. The input does not have to be a valid + # URI — the method will use heuristics to guess what URI was intended. + # This is not standards-compliant, merely user-friendly. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @param [Hash] hints + # A Hash of hints to the heuristic parser. + # Defaults to {:scheme => "http"}. + # + # @return [Addressable::URI] The parsed URI. + def self.heuristic_parse(uri, hints={}) + # If we were given nil, return nil. + return nil unless uri + # If a URI object is passed, just return itself. + return uri.dup if uri.kind_of?(self) + + # If a URI object of the Ruby standard library variety is passed, + # convert it to a string, then parse the string. + # We do the check this way because we don't want to accidentally + # cause a missing constant exception to be thrown. + if uri.class.name =~ /^URI\b/ + uri = uri.to_s + end + + if !uri.respond_to?(:to_str) + raise TypeError, "Can't convert #{uri.class} into String." + end + # Otherwise, convert to a String + uri = uri.to_str.dup.strip + hints = { + :scheme => "http" + }.merge(hints) + case uri + when /^http:\//i + uri.sub!(/^http:\/+/i, "http://") + when /^https:\//i + uri.sub!(/^https:\/+/i, "https://") + when /^feed:\/+http:\//i + uri.sub!(/^feed:\/+http:\/+/i, "feed:http://") + when /^feed:\//i + uri.sub!(/^feed:\/+/i, "feed://") + when %r[^file:/{4}]i + uri.sub!(%r[^file:/+]i, "file:////") + when %r[^file://localhost/]i + uri.sub!(%r[^file://localhost/+]i, "file:///") + when %r[^file:/+]i + uri.sub!(%r[^file:/+]i, "file:///") + when /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ + uri.sub!(/^/, hints[:scheme] + "://") + when /\A\d+\..*:\d+\z/ + uri = "#{hints[:scheme]}://#{uri}" + end + match = uri.match(URIREGEX) + fragments = match.captures + authority = fragments[3] + if authority && authority.length > 0 + new_authority = authority.tr("\\", "/").gsub(" ", "%20") + # NOTE: We want offset 4, not 3! + offset = match.offset(4) + uri = uri.dup + uri[offset[0]...offset[1]] = new_authority + end + parsed = self.parse(uri) + if parsed.scheme =~ /^[^\/?#\.]+\.[^\/?#]+$/ + parsed = self.parse(hints[:scheme] + "://" + uri) + end + if parsed.path.include?(".") + if parsed.path[/\b@\b/] + parsed.scheme = "mailto" unless parsed.scheme + elsif new_host = parsed.path[/^([^\/]+\.[^\/]*)/, 1] + parsed.defer_validation do + new_path = parsed.path.sub( + Regexp.new("^" + Regexp.escape(new_host)), EMPTY_STR) + parsed.host = new_host + parsed.path = new_path + parsed.scheme = hints[:scheme] unless parsed.scheme + end + end + end + return parsed + end + + ## + # Converts a path to a file scheme URI. If the path supplied is + # relative, it will be returned as a relative URI. If the path supplied + # is actually a non-file URI, it will parse the URI as if it had been + # parsed with Addressable::URI.parse. Handles all of the + # various Microsoft-specific formats for specifying paths. + # + # @param [String, Addressable::URI, #to_str] path + # Typically a String path to a file or directory, but + # will return a sensible return value if an absolute URI is supplied + # instead. + # + # @return [Addressable::URI] + # The parsed file scheme URI or the original URI if some other URI + # scheme was provided. + # + # @example + # base = Addressable::URI.convert_path("/absolute/path/") + # uri = Addressable::URI.convert_path("relative/path") + # (base + uri).to_s + # #=> "file:///absolute/path/relative/path" + # + # Addressable::URI.convert_path( + # "c:\\windows\\My Documents 100%20\\foo.txt" + # ).to_s + # #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt" + # + # Addressable::URI.convert_path("http://example.com/").to_s + # #=> "http://example.com/" + def self.convert_path(path) + # If we were given nil, return nil. + return nil unless path + # If a URI object is passed, just return itself. + return path if path.kind_of?(self) + if !path.respond_to?(:to_str) + raise TypeError, "Can't convert #{path.class} into String." + end + # Otherwise, convert to a String + path = path.to_str.strip + + path.sub!(/^file:\/?\/?/, EMPTY_STR) if path =~ /^file:\/?\/?/ + path = SLASH + path if path =~ /^([a-zA-Z])[\|:]/ + uri = self.parse(path) + + if uri.scheme == nil + # Adjust windows-style uris + uri.path.sub!(/^\/?([a-zA-Z])[\|:][\\\/]/) do + "/#{$1.downcase}:/" + end + uri.path.tr!("\\", SLASH) + if File.exist?(uri.path) && + File.stat(uri.path).directory? + uri.path.chomp!(SLASH) + uri.path = uri.path + '/' + end + + # If the path is absolute, set the scheme and host. + if uri.path.start_with?(SLASH) + uri.scheme = "file" + uri.host = EMPTY_STR + end + uri.normalize! + end + + return uri + end + + ## + # Joins several URIs together. + # + # @param [String, Addressable::URI, #to_str] *uris + # The URIs to join. + # + # @return [Addressable::URI] The joined URI. + # + # @example + # base = "http://example.com/" + # uri = Addressable::URI.parse("relative/path") + # Addressable::URI.join(base, uri) + # #=> # + def self.join(*uris) + uri_objects = uris.collect do |uri| + if !uri.respond_to?(:to_str) + raise TypeError, "Can't convert #{uri.class} into String." + end + uri.kind_of?(self) ? uri : self.parse(uri.to_str) + end + result = uri_objects.shift.dup + for uri in uri_objects + result.join!(uri) + end + return result + end + + ## + # Tables used to optimize encoding operations in `self.encode_component` + # and `self.normalize_component` + SEQUENCE_ENCODING_TABLE = Hash.new do |hash, sequence| + hash[sequence] = sequence.unpack("C*").map do |c| + format("%02x", c) + end.join + end + + SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = Hash.new do |hash, sequence| + hash[sequence] = sequence.unpack("C*").map do |c| + format("%%%02X", c) + end.join + end + + ## + # Percent encodes a URI component. + # + # @param [String, #to_str] component The URI component to encode. + # + # @param [String, Regexp] character_class + # The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' through + # '9' to be percent encoded. If a Regexp is passed, the + # value /[^b-zB-Z0-9]/ would have the same effect. A set of + # useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @param [Regexp] upcase_encoded + # A string of characters that may already be percent encoded, and whose + # encodings should be upcased. This allows normalization of percent + # encodings for characters not included in the + # character_class. + # + # @return [String] The encoded component. + # + # @example + # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component( + # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + def self.encode_component(component, character_class= + CharacterClasses::RESERVED + CharacterClasses::UNRESERVED, + upcase_encoded='') + return nil if component.nil? + + begin + if component.kind_of?(Symbol) || + component.kind_of?(Numeric) || + component.kind_of?(TrueClass) || + component.kind_of?(FalseClass) + component = component.to_s + else + component = component.to_str + end + rescue TypeError, NoMethodError + raise TypeError, "Can't convert #{component.class} into String." + end if !component.is_a? String + + if ![String, Regexp].include?(character_class.class) + raise TypeError, + "Expected String or Regexp, got #{character_class.inspect}" + end + if character_class.kind_of?(String) + character_class = /[^#{character_class}]/ + end + # We can't perform regexps on invalid UTF sequences, but + # here we need to, so switch to ASCII. + component = component.dup + component.force_encoding(Encoding::ASCII_8BIT) + # Avoiding gsub! because there are edge cases with frozen strings + component = component.gsub(character_class) do |sequence| + SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE[sequence] + end + if upcase_encoded.length > 0 + upcase_encoded_chars = upcase_encoded.chars.map do |char| + SEQUENCE_ENCODING_TABLE[char] + end + component = component.gsub(/%(#{upcase_encoded_chars.join('|')})/, + &:upcase) + end + return component + end + + class << self + alias_method :escape_component, :encode_component + end + + ## + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI or component to unencode. + # + # @param [Class] return_type + # The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # + # @param [String] leave_encoded + # A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # + # @return [String, Addressable::URI] + # The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + def self.unencode(uri, return_type=String, leave_encoded='') + return nil if uri.nil? + + begin + uri = uri.to_str + rescue NoMethodError, TypeError + raise TypeError, "Can't convert #{uri.class} into String." + end if !uri.is_a? String + if ![String, ::Addressable::URI].include?(return_type) + raise TypeError, + "Expected Class (String or Addressable::URI), " + + "got #{return_type.inspect}" + end + uri = uri.dup + # Seriously, only use UTF-8. I'm really not kidding! + uri.force_encoding("utf-8") + + unless leave_encoded.empty? + leave_encoded = leave_encoded.dup.force_encoding("utf-8") + end + + result = uri.gsub(/%[0-9a-f]{2}/iu) do |sequence| + c = sequence[1..3].to_i(16).chr + c.force_encoding("utf-8") + leave_encoded.include?(c) ? sequence : c + end + result.force_encoding("utf-8") + if return_type == String + return result + elsif return_type == ::Addressable::URI + return ::Addressable::URI.parse(result) + end + end + + class << self + alias_method :unescape, :unencode + alias_method :unencode_component, :unencode + alias_method :unescape_component, :unencode + end + + + ## + # Normalizes the encoding of a URI component. + # + # @param [String, #to_str] component The URI component to encode. + # + # @param [String, Regexp] character_class + # The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' + # through '9' to be percent encoded. If a Regexp is passed, + # the value /[^b-zB-Z0-9]/ would have the same effect. A + # set of useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @param [String] leave_encoded + # When character_class is a String then + # leave_encoded is a string of characters that should remain + # percent encoded while normalizing the component; if they appear percent + # encoded in the original component, then they will be upcased ("%2f" + # normalized to "%2F") but otherwise left alone. + # + # @return [String] The normalized component. + # + # @example + # Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z") + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", /[^b-zB-Z]/ + # ) + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", + # Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # Addressable::URI.normalize_component( + # "one%20two%2fthree%26four", + # "0-9a-zA-Z &/", + # "/" + # ) + # => "one two%2Fthree&four" + def self.normalize_component(component, character_class= + CharacterClasses::RESERVED + CharacterClasses::UNRESERVED, + leave_encoded='') + return nil if component.nil? + + begin + component = component.to_str + rescue NoMethodError, TypeError + raise TypeError, "Can't convert #{component.class} into String." + end if !component.is_a? String + + if ![String, Regexp].include?(character_class.class) + raise TypeError, + "Expected String or Regexp, got #{character_class.inspect}" + end + if character_class.kind_of?(String) + leave_re = if leave_encoded.length > 0 + character_class = "#{character_class}%" unless character_class.include?('%') + + "|%(?!#{leave_encoded.chars.map do |char| + seq = SEQUENCE_ENCODING_TABLE[char] + [seq.upcase, seq.downcase] + end.flatten.join('|')})" + end + + character_class = if leave_re + /[^#{character_class}]#{leave_re}/ + else + /[^#{character_class}]/ + end + end + # We can't perform regexps on invalid UTF sequences, but + # here we need to, so switch to ASCII. + component = component.dup + component.force_encoding(Encoding::ASCII_8BIT) + unencoded = self.unencode_component(component, String, leave_encoded) + begin + encoded = self.encode_component( + Addressable::IDNA.unicode_normalize_kc(unencoded), + character_class, + leave_encoded + ) + rescue ArgumentError + encoded = self.encode_component(unencoded) + end + encoded.force_encoding(Encoding::UTF_8) + return encoded + end + + ## + # Percent encodes any special characters in the URI. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI to encode. + # + # @param [Class] return_type + # The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # + # @return [String, Addressable::URI] + # The encoded URI. + # The return type is determined by the return_type + # parameter. + def self.encode(uri, return_type=String) + return nil if uri.nil? + + begin + uri = uri.to_str + rescue NoMethodError, TypeError + raise TypeError, "Can't convert #{uri.class} into String." + end if !uri.is_a? String + + if ![String, ::Addressable::URI].include?(return_type) + raise TypeError, + "Expected Class (String or Addressable::URI), " + + "got #{return_type.inspect}" + end + uri_object = uri.kind_of?(self) ? uri : self.parse(uri) + encoded_uri = Addressable::URI.new( + :scheme => self.encode_component(uri_object.scheme, + Addressable::URI::CharacterClasses::SCHEME), + :authority => self.encode_component(uri_object.authority, + Addressable::URI::CharacterClasses::AUTHORITY), + :path => self.encode_component(uri_object.path, + Addressable::URI::CharacterClasses::PATH), + :query => self.encode_component(uri_object.query, + Addressable::URI::CharacterClasses::QUERY), + :fragment => self.encode_component(uri_object.fragment, + Addressable::URI::CharacterClasses::FRAGMENT) + ) + if return_type == String + return encoded_uri.to_s + elsif return_type == ::Addressable::URI + return encoded_uri + end + end + + class << self + alias_method :escape, :encode + end + + ## + # Normalizes the encoding of a URI. Characters within a hostname are + # not percent encoded to allow for internationalized domain names. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI to encode. + # + # @param [Class] return_type + # The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # + # @return [String, Addressable::URI] + # The encoded URI. + # The return type is determined by the return_type + # parameter. + def self.normalized_encode(uri, return_type=String) + begin + uri = uri.to_str + rescue NoMethodError, TypeError + raise TypeError, "Can't convert #{uri.class} into String." + end if !uri.is_a? String + + if ![String, ::Addressable::URI].include?(return_type) + raise TypeError, + "Expected Class (String or Addressable::URI), " + + "got #{return_type.inspect}" + end + uri_object = uri.kind_of?(self) ? uri : self.parse(uri) + components = { + :scheme => self.unencode_component(uri_object.scheme), + :user => self.unencode_component(uri_object.user), + :password => self.unencode_component(uri_object.password), + :host => self.unencode_component(uri_object.host), + :port => (uri_object.port.nil? ? nil : uri_object.port.to_s), + :path => self.unencode_component(uri_object.path), + :query => self.unencode_component(uri_object.query), + :fragment => self.unencode_component(uri_object.fragment) + } + components.each do |key, value| + if value != nil + begin + components[key] = + Addressable::IDNA.unicode_normalize_kc(value.to_str) + rescue ArgumentError + # Likely a malformed UTF-8 character, skip unicode normalization + components[key] = value.to_str + end + end + end + encoded_uri = Addressable::URI.new( + :scheme => self.encode_component(components[:scheme], + Addressable::URI::CharacterClasses::SCHEME), + :user => self.encode_component(components[:user], + Addressable::URI::CharacterClasses::UNRESERVED), + :password => self.encode_component(components[:password], + Addressable::URI::CharacterClasses::UNRESERVED), + :host => components[:host], + :port => components[:port], + :path => self.encode_component(components[:path], + Addressable::URI::CharacterClasses::PATH), + :query => self.encode_component(components[:query], + Addressable::URI::CharacterClasses::QUERY), + :fragment => self.encode_component(components[:fragment], + Addressable::URI::CharacterClasses::FRAGMENT) + ) + if return_type == String + return encoded_uri.to_s + elsif return_type == ::Addressable::URI + return encoded_uri + end + end + + ## + # Encodes a set of key/value pairs according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param [#to_hash, #to_ary] form_values + # The form values to encode. + # + # @param [TrueClass, FalseClass] sort + # Sort the key/value pairs prior to encoding. + # Defaults to false. + # + # @return [String] + # The encoded value. + def self.form_encode(form_values, sort=false) + if form_values.respond_to?(:to_hash) + form_values = form_values.to_hash.to_a + elsif form_values.respond_to?(:to_ary) + form_values = form_values.to_ary + else + raise TypeError, "Can't convert #{form_values.class} into Array." + end + + form_values = form_values.inject([]) do |accu, (key, value)| + if value.kind_of?(Array) + value.each do |v| + accu << [key.to_s, v.to_s] + end + else + accu << [key.to_s, value.to_s] + end + accu + end + + if sort + # Useful for OAuth and optimizing caching systems + form_values = form_values.sort + end + escaped_form_values = form_values.map do |(key, value)| + # Line breaks are CRLF pairs + [ + self.encode_component( + key.gsub(/(\r\n|\n|\r)/, "\r\n"), + CharacterClasses::UNRESERVED + ).gsub("%20", "+"), + self.encode_component( + value.gsub(/(\r\n|\n|\r)/, "\r\n"), + CharacterClasses::UNRESERVED + ).gsub("%20", "+") + ] + end + return escaped_form_values.map do |(key, value)| + "#{key}=#{value}" + end.join("&") + end + + ## + # Decodes a String according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param [String, #to_str] encoded_value + # The form values to decode. + # + # @return [Array] + # The decoded values. + # This is not a Hash because of the possibility for + # duplicate keys. + def self.form_unencode(encoded_value) + if !encoded_value.respond_to?(:to_str) + raise TypeError, "Can't convert #{encoded_value.class} into String." + end + encoded_value = encoded_value.to_str + split_values = encoded_value.split("&").map do |pair| + pair.split("=", 2) + end + return split_values.map do |(key, value)| + [ + key ? self.unencode_component( + key.gsub("+", "%20")).gsub(/(\r\n|\n|\r)/, "\n") : nil, + value ? (self.unencode_component( + value.gsub("+", "%20")).gsub(/(\r\n|\n|\r)/, "\n")) : nil + ] + end + end + + ## + # Creates a new uri object from component parts. + # + # @option [String, #to_str] scheme The scheme component. + # @option [String, #to_str] user The user component. + # @option [String, #to_str] password The password component. + # @option [String, #to_str] userinfo + # The userinfo component. If this is supplied, the user and password + # components must be omitted. + # @option [String, #to_str] host The host component. + # @option [String, #to_str] port The port component. + # @option [String, #to_str] authority + # The authority component. If this is supplied, the user, password, + # userinfo, host, and port components must be omitted. + # @option [String, #to_str] path The path component. + # @option [String, #to_str] query The query component. + # @option [String, #to_str] fragment The fragment component. + # + # @return [Addressable::URI] The constructed URI object. + def initialize(options={}) + if options.has_key?(:authority) + if (options.keys & [:userinfo, :user, :password, :host, :port]).any? + raise ArgumentError, + "Cannot specify both an authority and any of the components " + + "within the authority." + end + end + if options.has_key?(:userinfo) + if (options.keys & [:user, :password]).any? + raise ArgumentError, + "Cannot specify both a userinfo and either the user or password." + end + end + + self.defer_validation do + # Bunch of crazy logic required because of the composite components + # like userinfo and authority. + self.scheme = options[:scheme] if options[:scheme] + self.user = options[:user] if options[:user] + self.password = options[:password] if options[:password] + self.userinfo = options[:userinfo] if options[:userinfo] + self.host = options[:host] if options[:host] + self.port = options[:port] if options[:port] + self.authority = options[:authority] if options[:authority] + self.path = options[:path] if options[:path] + self.query = options[:query] if options[:query] + self.query_values = options[:query_values] if options[:query_values] + self.fragment = options[:fragment] if options[:fragment] + end + self.to_s + end + + ## + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + def freeze + self.normalized_scheme + self.normalized_user + self.normalized_password + self.normalized_userinfo + self.normalized_host + self.normalized_port + self.normalized_authority + self.normalized_site + self.normalized_path + self.normalized_query + self.normalized_fragment + self.hash + super + end + + ## + # The scheme component for this URI. + # + # @return [String] The scheme component. + def scheme + return defined?(@scheme) ? @scheme : nil + end + + ## + # The scheme component for this URI, normalized. + # + # @return [String] The scheme component, normalized. + def normalized_scheme + return nil unless self.scheme + @normalized_scheme ||= begin + if self.scheme =~ /^\s*ssh\+svn\s*$/i + "svn+ssh".dup + else + Addressable::URI.normalize_component( + self.scheme.strip.downcase, + Addressable::URI::NormalizeCharacterClasses::SCHEME + ) + end + end + # All normalized values should be UTF-8 + @normalized_scheme.force_encoding(Encoding::UTF_8) if @normalized_scheme + @normalized_scheme + end + + ## + # Sets the scheme component for this URI. + # + # @param [String, #to_str] new_scheme The new scheme component. + def scheme=(new_scheme) + if new_scheme && !new_scheme.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_scheme.class} into String." + elsif new_scheme + new_scheme = new_scheme.to_str + end + if new_scheme && new_scheme !~ /\A[a-z][a-z0-9\.\+\-]*\z/i + raise InvalidURIError, "Invalid scheme format: '#{new_scheme}'" + end + @scheme = new_scheme + @scheme = nil if @scheme.to_s.strip.empty? + + # Reset dependent values + remove_instance_variable(:@normalized_scheme) if defined?(@normalized_scheme) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The user component for this URI. + # + # @return [String] The user component. + def user + return defined?(@user) ? @user : nil + end + + ## + # The user component for this URI, normalized. + # + # @return [String] The user component, normalized. + def normalized_user + return nil unless self.user + return @normalized_user if defined?(@normalized_user) + @normalized_user ||= begin + if normalized_scheme =~ /https?/ && self.user.strip.empty? && + (!self.password || self.password.strip.empty?) + nil + else + Addressable::URI.normalize_component( + self.user.strip, + Addressable::URI::NormalizeCharacterClasses::UNRESERVED + ) + end + end + # All normalized values should be UTF-8 + @normalized_user.force_encoding(Encoding::UTF_8) if @normalized_user + @normalized_user + end + + ## + # Sets the user component for this URI. + # + # @param [String, #to_str] new_user The new user component. + def user=(new_user) + if new_user && !new_user.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_user.class} into String." + end + @user = new_user ? new_user.to_str : nil + + # You can't have a nil user with a non-nil password + if password != nil + @user = EMPTY_STR if @user.nil? + end + + # Reset dependent values + remove_instance_variable(:@userinfo) if defined?(@userinfo) + remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) + remove_instance_variable(:@authority) if defined?(@authority) + remove_instance_variable(:@normalized_user) if defined?(@normalized_user) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The password component for this URI. + # + # @return [String] The password component. + def password + return defined?(@password) ? @password : nil + end + + ## + # The password component for this URI, normalized. + # + # @return [String] The password component, normalized. + def normalized_password + return nil unless self.password + return @normalized_password if defined?(@normalized_password) + @normalized_password ||= begin + if self.normalized_scheme =~ /https?/ && self.password.strip.empty? && + (!self.user || self.user.strip.empty?) + nil + else + Addressable::URI.normalize_component( + self.password.strip, + Addressable::URI::NormalizeCharacterClasses::UNRESERVED + ) + end + end + # All normalized values should be UTF-8 + if @normalized_password + @normalized_password.force_encoding(Encoding::UTF_8) + end + @normalized_password + end + + ## + # Sets the password component for this URI. + # + # @param [String, #to_str] new_password The new password component. + def password=(new_password) + if new_password && !new_password.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_password.class} into String." + end + @password = new_password ? new_password.to_str : nil + + # You can't have a nil user with a non-nil password + @password ||= nil + @user ||= nil + if @password != nil + @user = EMPTY_STR if @user.nil? + end + + # Reset dependent values + remove_instance_variable(:@userinfo) if defined?(@userinfo) + remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) + remove_instance_variable(:@authority) if defined?(@authority) + remove_instance_variable(:@normalized_password) if defined?(@normalized_password) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The userinfo component for this URI. + # Combines the user and password components. + # + # @return [String] The userinfo component. + def userinfo + current_user = self.user + current_password = self.password + (current_user || current_password) && @userinfo ||= begin + if current_user && current_password + "#{current_user}:#{current_password}" + elsif current_user && !current_password + "#{current_user}" + end + end + end + + ## + # The userinfo component for this URI, normalized. + # + # @return [String] The userinfo component, normalized. + def normalized_userinfo + return nil unless self.userinfo + return @normalized_userinfo if defined?(@normalized_userinfo) + @normalized_userinfo ||= begin + current_user = self.normalized_user + current_password = self.normalized_password + if !current_user && !current_password + nil + elsif current_user && current_password + "#{current_user}:#{current_password}".dup + elsif current_user && !current_password + "#{current_user}".dup + end + end + # All normalized values should be UTF-8 + if @normalized_userinfo + @normalized_userinfo.force_encoding(Encoding::UTF_8) + end + @normalized_userinfo + end + + ## + # Sets the userinfo component for this URI. + # + # @param [String, #to_str] new_userinfo The new userinfo component. + def userinfo=(new_userinfo) + if new_userinfo && !new_userinfo.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_userinfo.class} into String." + end + new_user, new_password = if new_userinfo + [ + new_userinfo.to_str.strip[/^(.*):/, 1], + new_userinfo.to_str.strip[/:(.*)$/, 1] + ] + else + [nil, nil] + end + + # Password assigned first to ensure validity in case of nil + self.password = new_password + self.user = new_user + + # Reset dependent values + remove_instance_variable(:@authority) if defined?(@authority) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The host component for this URI. + # + # @return [String] The host component. + def host + return defined?(@host) ? @host : nil + end + + ## + # The host component for this URI, normalized. + # + # @return [String] The host component, normalized. + def normalized_host + return nil unless self.host + + @normalized_host ||= begin + if !self.host.strip.empty? + result = ::Addressable::IDNA.to_ascii( + URI.unencode_component(self.host.strip.downcase) + ) + if result =~ /[^\.]\.$/ + # Single trailing dots are unnecessary. + result = result[0...-1] + end + result = Addressable::URI.normalize_component( + result, + NormalizeCharacterClasses::HOST + ) + result + else + EMPTY_STR.dup + end + end + # All normalized values should be UTF-8 + if @normalized_host && !@normalized_host.empty? + @normalized_host.force_encoding(Encoding::UTF_8) + end + @normalized_host + end + + ## + # Sets the host component for this URI. + # + # @param [String, #to_str] new_host The new host component. + def host=(new_host) + if new_host && !new_host.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_host.class} into String." + end + @host = new_host ? new_host.to_str : nil + + # Reset dependent values + remove_instance_variable(:@authority) if defined?(@authority) + remove_instance_variable(:@normalized_host) if defined?(@normalized_host) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # This method is same as URI::Generic#host except + # brackets for IPv6 (and 'IPvFuture') addresses are removed. + # + # @see Addressable::URI#host + # + # @return [String] The hostname for this URI. + def hostname + v = self.host + /\A\[(.*)\]\z/ =~ v ? $1 : v + end + + ## + # This method is same as URI::Generic#host= except + # the argument can be a bare IPv6 address (or 'IPvFuture'). + # + # @see Addressable::URI#host= + # + # @param [String, #to_str] new_hostname The new hostname for this URI. + def hostname=(new_hostname) + if new_hostname && + (new_hostname.respond_to?(:ipv4?) || new_hostname.respond_to?(:ipv6?)) + new_hostname = new_hostname.to_s + elsif new_hostname && !new_hostname.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_hostname.class} into String." + end + v = new_hostname ? new_hostname.to_str : nil + v = "[#{v}]" if /\A\[.*\]\z/ !~ v && /:/ =~ v + self.host = v + end + + ## + # Returns the top-level domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk" + def tld + PublicSuffix.parse(self.host, ignore_private: true).tld + end + + ## + # Sets the top-level domain for this URI. + # + # @param [String, #to_str] new_tld The new top-level domain. + def tld=(new_tld) + replaced_tld = host.sub(/#{tld}\z/, new_tld) + self.host = PublicSuffix::Domain.new(replaced_tld).to_s + end + + ## + # Returns the public suffix domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk" + def domain + PublicSuffix.domain(self.host, ignore_private: true) + end + + ## + # The authority component for this URI. + # Combines the user, password, host, and port components. + # + # @return [String] The authority component. + def authority + self.host && @authority ||= begin + authority = String.new + if self.userinfo != nil + authority << "#{self.userinfo}@" + end + authority << self.host + if self.port != nil + authority << ":#{self.port}" + end + authority + end + end + + ## + # The authority component for this URI, normalized. + # + # @return [String] The authority component, normalized. + def normalized_authority + return nil unless self.authority + @normalized_authority ||= begin + authority = String.new + if self.normalized_userinfo != nil + authority << "#{self.normalized_userinfo}@" + end + authority << self.normalized_host + if self.normalized_port != nil + authority << ":#{self.normalized_port}" + end + authority + end + # All normalized values should be UTF-8 + if @normalized_authority + @normalized_authority.force_encoding(Encoding::UTF_8) + end + @normalized_authority + end + + ## + # Sets the authority component for this URI. + # + # @param [String, #to_str] new_authority The new authority component. + def authority=(new_authority) + if new_authority + if !new_authority.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_authority.class} into String." + end + new_authority = new_authority.to_str + new_userinfo = new_authority[/^([^\[\]]*)@/, 1] + if new_userinfo + new_user = new_userinfo.strip[/^([^:]*):?/, 1] + new_password = new_userinfo.strip[/:(.*)$/, 1] + end + new_host = new_authority.sub( + /^([^\[\]]*)@/, EMPTY_STR + ).sub( + /:([^:@\[\]]*?)$/, EMPTY_STR + ) + new_port = + new_authority[/:([^:@\[\]]*?)$/, 1] + end + + # Password assigned first to ensure validity in case of nil + self.password = defined?(new_password) ? new_password : nil + self.user = defined?(new_user) ? new_user : nil + self.host = defined?(new_host) ? new_host : nil + self.port = defined?(new_port) ? new_port : nil + + # Reset dependent values + remove_instance_variable(:@userinfo) if defined?(@userinfo) + remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. + # + # @return [String] The serialized origin. + def origin + if self.scheme && self.authority + if self.normalized_port + "#{self.normalized_scheme}://#{self.normalized_host}" + + ":#{self.normalized_port}" + else + "#{self.normalized_scheme}://#{self.normalized_host}" + end + else + "null" + end + end + + ## + # Sets the origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. This assignment will reset the `userinfo` + # component. + # + # @param [String, #to_str] new_origin The new origin component. + def origin=(new_origin) + if new_origin + if !new_origin.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_origin.class} into String." + end + new_origin = new_origin.to_str + new_scheme = new_origin[/^([^:\/?#]+):\/\//, 1] + unless new_scheme + raise InvalidURIError, 'An origin cannot omit the scheme.' + end + new_host = new_origin[/:\/\/([^\/?#:]+)/, 1] + unless new_host + raise InvalidURIError, 'An origin cannot omit the host.' + end + new_port = new_origin[/:([^:@\[\]\/]*?)$/, 1] + end + + self.scheme = defined?(new_scheme) ? new_scheme : nil + self.host = defined?(new_host) ? new_host : nil + self.port = defined?(new_port) ? new_port : nil + self.userinfo = nil + + # Reset dependent values + remove_instance_variable(:@userinfo) if defined?(@userinfo) + remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) + remove_instance_variable(:@authority) if defined?(@authority) + remove_instance_variable(:@normalized_authority) if defined?(@normalized_authority) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + # Returns an array of known ip-based schemes. These schemes typically + # use a similar URI form: + # //:@:/ + def self.ip_based_schemes + return self.port_mapping.keys + end + + # Returns a hash of common IP-based schemes and their default port + # numbers. Adding new schemes to this hash, as necessary, will allow + # for better URI normalization. + def self.port_mapping + PORT_MAPPING + end + + ## + # The port component for this URI. + # This is the port number actually given in the URI. This does not + # infer port numbers from default values. + # + # @return [Integer] The port component. + def port + return defined?(@port) ? @port : nil + end + + ## + # The port component for this URI, normalized. + # + # @return [Integer] The port component, normalized. + def normalized_port + return nil unless self.port + return @normalized_port if defined?(@normalized_port) + @normalized_port ||= begin + if URI.port_mapping[self.normalized_scheme] == self.port + nil + else + self.port + end + end + end + + ## + # Sets the port component for this URI. + # + # @param [String, Integer, #to_s] new_port The new port component. + def port=(new_port) + if new_port != nil && new_port.respond_to?(:to_str) + new_port = Addressable::URI.unencode_component(new_port.to_str) + end + + if new_port.respond_to?(:valid_encoding?) && !new_port.valid_encoding? + raise InvalidURIError, "Invalid encoding in port" + end + + if new_port != nil && !(new_port.to_s =~ /^\d+$/) + raise InvalidURIError, + "Invalid port number: #{new_port.inspect}" + end + + @port = new_port.to_s.to_i + @port = nil if @port == 0 + + # Reset dependent values + remove_instance_variable(:@authority) if defined?(@authority) + remove_instance_variable(:@normalized_port) if defined?(@normalized_port) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The inferred port component for this URI. + # This method will normalize to the default port for the URI's scheme if + # the port isn't explicitly specified in the URI. + # + # @return [Integer] The inferred port component. + def inferred_port + if self.port.to_i == 0 + self.default_port + else + self.port.to_i + end + end + + ## + # The default port for this URI's scheme. + # This method will always returns the default port for the URI's scheme + # regardless of the presence of an explicit port in the URI. + # + # @return [Integer] The default port. + def default_port + URI.port_mapping[self.scheme.strip.downcase] if self.scheme + end + + ## + # The combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The components that identify a site. + def site + (self.scheme || self.authority) && @site ||= begin + site_string = "".dup + site_string << "#{self.scheme}:" if self.scheme != nil + site_string << "//#{self.authority}" if self.authority != nil + site_string + end + end + + ## + # The normalized combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The normalized components that identify a site. + def normalized_site + return nil unless self.site + @normalized_site ||= begin + site_string = "".dup + if self.normalized_scheme != nil + site_string << "#{self.normalized_scheme}:" + end + if self.normalized_authority != nil + site_string << "//#{self.normalized_authority}" + end + site_string + end + # All normalized values should be UTF-8 + @normalized_site.force_encoding(Encoding::UTF_8) if @normalized_site + @normalized_site + end + + ## + # Sets the site value for this URI. + # + # @param [String, #to_str] new_site The new site value. + def site=(new_site) + if new_site + if !new_site.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_site.class} into String." + end + new_site = new_site.to_str + # These two regular expressions derived from the primary parsing + # expression + self.scheme = new_site[/^(?:([^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?$/, 1] + self.authority = new_site[ + /^(?:(?:[^:\/?#]+):)?(?:\/\/([^\/?#]*))?$/, 1 + ] + else + self.scheme = nil + self.authority = nil + end + end + + ## + # The path component for this URI. + # + # @return [String] The path component. + def path + return defined?(@path) ? @path : EMPTY_STR + end + + NORMPATH = /^(?!\/)[^\/:]*:.*$/ + ## + # The path component for this URI, normalized. + # + # @return [String] The path component, normalized. + def normalized_path + @normalized_path ||= begin + path = self.path.to_s + if self.scheme == nil && path =~ NORMPATH + # Relative paths with colons in the first segment are ambiguous. + path = path.sub(":", "%2F") + end + # String#split(delimeter, -1) uses the more strict splitting behavior + # found by default in Python. + result = path.strip.split(SLASH, -1).map do |segment| + Addressable::URI.normalize_component( + segment, + Addressable::URI::NormalizeCharacterClasses::PCHAR + ) + end.join(SLASH) + + result = URI.normalize_path(result) + if result.empty? && + ["http", "https", "ftp", "tftp"].include?(self.normalized_scheme) + result = SLASH.dup + end + result + end + # All normalized values should be UTF-8 + @normalized_path.force_encoding(Encoding::UTF_8) if @normalized_path + @normalized_path + end + + ## + # Sets the path component for this URI. + # + # @param [String, #to_str] new_path The new path component. + def path=(new_path) + if new_path && !new_path.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_path.class} into String." + end + @path = (new_path || EMPTY_STR).to_str + if !@path.empty? && @path[0..0] != SLASH && host != nil + @path = "/#{@path}" + end + + # Reset dependent values + remove_instance_variable(:@normalized_path) if defined?(@normalized_path) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # The basename, if any, of the file in the path component. + # + # @return [String] The path's basename. + def basename + # Path cannot be nil + return File.basename(self.path).sub(/;[^\/]*$/, EMPTY_STR) + end + + ## + # The extname, if any, of the file in the path component. + # Empty string if there is no extension. + # + # @return [String] The path's extname. + def extname + return nil unless self.path + return File.extname(self.basename) + end + + ## + # The query component for this URI. + # + # @return [String] The query component. + def query + return defined?(@query) ? @query : nil + end + + ## + # The query component for this URI, normalized. + # + # @return [String] The query component, normalized. + def normalized_query(*flags) + return nil unless self.query + return @normalized_query if defined?(@normalized_query) + @normalized_query ||= begin + modified_query_class = Addressable::URI::CharacterClasses::QUERY.dup + # Make sure possible key-value pair delimiters are escaped. + modified_query_class.sub!("\\&", "").sub!("\\;", "") + pairs = (query || "").split("&", -1) + pairs.delete_if(&:empty?).uniq! if flags.include?(:compacted) + pairs.sort! if flags.include?(:sorted) + component = pairs.map do |pair| + Addressable::URI.normalize_component( + pair, + Addressable::URI::NormalizeCharacterClasses::QUERY, + "+" + ) + end.join("&") + component == "" ? nil : component + end + # All normalized values should be UTF-8 + @normalized_query.force_encoding(Encoding::UTF_8) if @normalized_query + @normalized_query + end + + ## + # Sets the query component for this URI. + # + # @param [String, #to_str] new_query The new query component. + def query=(new_query) + if new_query && !new_query.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_query.class} into String." + end + @query = new_query ? new_query.to_str : nil + + # Reset dependent values + remove_instance_variable(:@normalized_query) if defined?(@normalized_query) + remove_composite_values + end + + ## + # Converts the query component to a Hash value. + # + # @param [Class] return_type The return type desired. Value must be either + # `Hash` or `Array`. + # + # @return [Hash, Array, nil] The query string parsed as a Hash or Array + # or nil if the query string is blank. + # + # @example + # Addressable::URI.parse("?one=1&two=2&three=3").query_values + # #=> {"one" => "1", "two" => "2", "three" => "3"} + # Addressable::URI.parse("?one=two&one=three").query_values(Array) + # #=> [["one", "two"], ["one", "three"]] + # Addressable::URI.parse("?one=two&one=three").query_values(Hash) + # #=> {"one" => "three"} + # Addressable::URI.parse("?").query_values + # #=> {} + # Addressable::URI.parse("").query_values + # #=> nil + def query_values(return_type=Hash) + empty_accumulator = Array == return_type ? [] : {} + if return_type != Hash && return_type != Array + raise ArgumentError, "Invalid return type. Must be Hash or Array." + end + return nil if self.query == nil + split_query = self.query.split("&").map do |pair| + pair.split("=", 2) if pair && !pair.empty? + end.compact + return split_query.inject(empty_accumulator.dup) do |accu, pair| + # I'd rather use key/value identifiers instead of array lookups, + # but in this case I really want to maintain the exact pair structure, + # so it's best to make all changes in-place. + pair[0] = URI.unencode_component(pair[0]) + if pair[1].respond_to?(:to_str) + value = pair[1].to_str + # I loathe the fact that I have to do this. Stupid HTML 4.01. + # Treating '+' as a space was just an unbelievably bad idea. + # There was nothing wrong with '%20'! + # If it ain't broke, don't fix it! + value = value.tr("+", " ") if ["http", "https", nil].include?(scheme) + pair[1] = URI.unencode_component(value) + end + if return_type == Hash + accu[pair[0]] = pair[1] + else + accu << pair + end + accu + end + end + + ## + # Sets the query component for this URI from a Hash object. + # An empty Hash or Array will result in an empty query string. + # + # @param [Hash, #to_hash, Array] new_query_values The new query values. + # + # @example + # uri.query_values = {:a => "a", :b => ["c", "d", "e"]} + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['flag'], ['key', 'value']] + # uri.query + # # => "flag&key=value" + def query_values=(new_query_values) + if new_query_values == nil + self.query = nil + return nil + end + + if !new_query_values.is_a?(Array) + if !new_query_values.respond_to?(:to_hash) + raise TypeError, + "Can't convert #{new_query_values.class} into Hash." + end + new_query_values = new_query_values.to_hash + new_query_values = new_query_values.map do |key, value| + key = key.to_s if key.kind_of?(Symbol) + [key, value] + end + # Useful default for OAuth and caching. + # Only to be used for non-Array inputs. Arrays should preserve order. + new_query_values.sort! + end + + # new_query_values have form [['key1', 'value1'], ['key2', 'value2']] + buffer = "".dup + new_query_values.each do |key, value| + encoded_key = URI.encode_component( + key, CharacterClasses::UNRESERVED + ) + if value == nil + buffer << "#{encoded_key}&" + elsif value.kind_of?(Array) + value.each do |sub_value| + encoded_value = URI.encode_component( + sub_value, CharacterClasses::UNRESERVED + ) + buffer << "#{encoded_key}=#{encoded_value}&" + end + else + encoded_value = URI.encode_component( + value, CharacterClasses::UNRESERVED + ) + buffer << "#{encoded_key}=#{encoded_value}&" + end + end + self.query = buffer.chop + end + + ## + # The HTTP request URI for this URI. This is the path and the + # query string. + # + # @return [String] The request URI required for an HTTP request. + def request_uri + return nil if self.absolute? && self.scheme !~ /^https?$/i + return ( + (!self.path.empty? ? self.path : SLASH) + + (self.query ? "?#{self.query}" : EMPTY_STR) + ) + end + + ## + # Sets the HTTP request URI for this URI. + # + # @param [String, #to_str] new_request_uri The new HTTP request URI. + def request_uri=(new_request_uri) + if !new_request_uri.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_request_uri.class} into String." + end + if self.absolute? && self.scheme !~ /^https?$/i + raise InvalidURIError, + "Cannot set an HTTP request URI for a non-HTTP URI." + end + new_request_uri = new_request_uri.to_str + path_component = new_request_uri[/^([^\?]*)\??(?:.*)$/, 1] + query_component = new_request_uri[/^(?:[^\?]*)\?(.*)$/, 1] + path_component = path_component.to_s + path_component = (!path_component.empty? ? path_component : SLASH) + self.path = path_component + self.query = query_component + + # Reset dependent values + remove_composite_values + end + + ## + # The fragment component for this URI. + # + # @return [String] The fragment component. + def fragment + return defined?(@fragment) ? @fragment : nil + end + + ## + # The fragment component for this URI, normalized. + # + # @return [String] The fragment component, normalized. + def normalized_fragment + return nil unless self.fragment + return @normalized_fragment if defined?(@normalized_fragment) + @normalized_fragment ||= begin + component = Addressable::URI.normalize_component( + self.fragment, + Addressable::URI::NormalizeCharacterClasses::FRAGMENT + ) + component == "" ? nil : component + end + # All normalized values should be UTF-8 + if @normalized_fragment + @normalized_fragment.force_encoding(Encoding::UTF_8) + end + @normalized_fragment + end + + ## + # Sets the fragment component for this URI. + # + # @param [String, #to_str] new_fragment The new fragment component. + def fragment=(new_fragment) + if new_fragment && !new_fragment.respond_to?(:to_str) + raise TypeError, "Can't convert #{new_fragment.class} into String." + end + @fragment = new_fragment ? new_fragment.to_str : nil + + # Reset dependent values + remove_instance_variable(:@normalized_fragment) if defined?(@normalized_fragment) + remove_composite_values + + # Ensure we haven't created an invalid URI + validate() + end + + ## + # Determines if the scheme indicates an IP-based protocol. + # + # @return [TrueClass, FalseClass] + # true if the scheme indicates an IP-based protocol. + # false otherwise. + def ip_based? + if self.scheme + return URI.ip_based_schemes.include?( + self.scheme.strip.downcase) + end + return false + end + + ## + # Determines if the URI is relative. + # + # @return [TrueClass, FalseClass] + # true if the URI is relative. false + # otherwise. + def relative? + return self.scheme.nil? + end + + ## + # Determines if the URI is absolute. + # + # @return [TrueClass, FalseClass] + # true if the URI is absolute. false + # otherwise. + def absolute? + return !relative? + end + + ## + # Joins two URIs together. + # + # @param [String, Addressable::URI, #to_str] The URI to join with. + # + # @return [Addressable::URI] The joined URI. + def join(uri) + if !uri.respond_to?(:to_str) + raise TypeError, "Can't convert #{uri.class} into String." + end + if !uri.kind_of?(URI) + # Otherwise, convert to a String, then parse. + uri = URI.parse(uri.to_str) + end + if uri.to_s.empty? + return self.dup + end + + joined_scheme = nil + joined_user = nil + joined_password = nil + joined_host = nil + joined_port = nil + joined_path = nil + joined_query = nil + joined_fragment = nil + + # Section 5.2.2 of RFC 3986 + if uri.scheme != nil + joined_scheme = uri.scheme + joined_user = uri.user + joined_password = uri.password + joined_host = uri.host + joined_port = uri.port + joined_path = URI.normalize_path(uri.path) + joined_query = uri.query + else + if uri.authority != nil + joined_user = uri.user + joined_password = uri.password + joined_host = uri.host + joined_port = uri.port + joined_path = URI.normalize_path(uri.path) + joined_query = uri.query + else + if uri.path == nil || uri.path.empty? + joined_path = self.path + if uri.query != nil + joined_query = uri.query + else + joined_query = self.query + end + else + if uri.path[0..0] == SLASH + joined_path = URI.normalize_path(uri.path) + else + base_path = self.path.dup + base_path = EMPTY_STR if base_path == nil + base_path = URI.normalize_path(base_path) + + # Section 5.2.3 of RFC 3986 + # + # Removes the right-most path segment from the base path. + if base_path.include?(SLASH) + base_path.sub!(/\/[^\/]+$/, SLASH) + else + base_path = EMPTY_STR + end + + # If the base path is empty and an authority segment has been + # defined, use a base path of SLASH + if base_path.empty? && self.authority != nil + base_path = SLASH + end + + joined_path = URI.normalize_path(base_path + uri.path) + end + joined_query = uri.query + end + joined_user = self.user + joined_password = self.password + joined_host = self.host + joined_port = self.port + end + joined_scheme = self.scheme + end + joined_fragment = uri.fragment + + return self.class.new( + :scheme => joined_scheme, + :user => joined_user, + :password => joined_password, + :host => joined_host, + :port => joined_port, + :path => joined_path, + :query => joined_query, + :fragment => joined_fragment + ) + end + alias_method :+, :join + + ## + # Destructive form of join. + # + # @param [String, Addressable::URI, #to_str] The URI to join with. + # + # @return [Addressable::URI] The joined URI. + # + # @see Addressable::URI#join + def join!(uri) + replace_self(self.join(uri)) + end + + ## + # Merges a URI with a Hash of components. + # This method has different behavior from join. Any + # components present in the hash parameter will override the + # original components. The path component is not treated specially. + # + # @param [Hash, Addressable::URI, #to_hash] The components to merge with. + # + # @return [Addressable::URI] The merged URI. + # + # @see Hash#merge + def merge(hash) + if !hash.respond_to?(:to_hash) + raise TypeError, "Can't convert #{hash.class} into Hash." + end + hash = hash.to_hash + + if hash.has_key?(:authority) + if (hash.keys & [:userinfo, :user, :password, :host, :port]).any? + raise ArgumentError, + "Cannot specify both an authority and any of the components " + + "within the authority." + end + end + if hash.has_key?(:userinfo) + if (hash.keys & [:user, :password]).any? + raise ArgumentError, + "Cannot specify both a userinfo and either the user or password." + end + end + + uri = self.class.new + uri.defer_validation do + # Bunch of crazy logic required because of the composite components + # like userinfo and authority. + uri.scheme = + hash.has_key?(:scheme) ? hash[:scheme] : self.scheme + if hash.has_key?(:authority) + uri.authority = + hash.has_key?(:authority) ? hash[:authority] : self.authority + end + if hash.has_key?(:userinfo) + uri.userinfo = + hash.has_key?(:userinfo) ? hash[:userinfo] : self.userinfo + end + if !hash.has_key?(:userinfo) && !hash.has_key?(:authority) + uri.user = + hash.has_key?(:user) ? hash[:user] : self.user + uri.password = + hash.has_key?(:password) ? hash[:password] : self.password + end + if !hash.has_key?(:authority) + uri.host = + hash.has_key?(:host) ? hash[:host] : self.host + uri.port = + hash.has_key?(:port) ? hash[:port] : self.port + end + uri.path = + hash.has_key?(:path) ? hash[:path] : self.path + uri.query = + hash.has_key?(:query) ? hash[:query] : self.query + uri.fragment = + hash.has_key?(:fragment) ? hash[:fragment] : self.fragment + end + + return uri + end + + ## + # Destructive form of merge. + # + # @param [Hash, Addressable::URI, #to_hash] The components to merge with. + # + # @return [Addressable::URI] The merged URI. + # + # @see Addressable::URI#merge + def merge!(uri) + replace_self(self.merge(uri)) + end + + ## + # Returns the shortest normalized relative form of this URI that uses the + # supplied URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_to. + # + # @param [String, Addressable::URI, #to_str] uri The URI to route from. + # + # @return [Addressable::URI] + # The normalized relative URI that is equivalent to the original URI. + def route_from(uri) + uri = URI.parse(uri).normalize + normalized_self = self.normalize + if normalized_self.relative? + raise ArgumentError, "Expected absolute URI, got: #{self.to_s}" + end + if uri.relative? + raise ArgumentError, "Expected absolute URI, got: #{uri.to_s}" + end + if normalized_self == uri + return Addressable::URI.parse("##{normalized_self.fragment}") + end + components = normalized_self.to_hash + if normalized_self.scheme == uri.scheme + components[:scheme] = nil + if normalized_self.authority == uri.authority + components[:user] = nil + components[:password] = nil + components[:host] = nil + components[:port] = nil + if normalized_self.path == uri.path + components[:path] = nil + if normalized_self.query == uri.query + components[:query] = nil + end + else + if uri.path != SLASH and components[:path] + self_splitted_path = split_path(components[:path]) + uri_splitted_path = split_path(uri.path) + self_dir = self_splitted_path.shift + uri_dir = uri_splitted_path.shift + while !self_splitted_path.empty? && !uri_splitted_path.empty? and self_dir == uri_dir + self_dir = self_splitted_path.shift + uri_dir = uri_splitted_path.shift + end + components[:path] = (uri_splitted_path.fill('..') + [self_dir] + self_splitted_path).join(SLASH) + end + end + end + end + # Avoid network-path references. + if components[:host] != nil + components[:scheme] = normalized_self.scheme + end + return Addressable::URI.new( + :scheme => components[:scheme], + :user => components[:user], + :password => components[:password], + :host => components[:host], + :port => components[:port], + :path => components[:path], + :query => components[:query], + :fragment => components[:fragment] + ) + end + + ## + # Returns the shortest normalized relative form of the supplied URI that + # uses this URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_from. + # + # @param [String, Addressable::URI, #to_str] uri The URI to route to. + # + # @return [Addressable::URI] + # The normalized relative URI that is equivalent to the supplied URI. + def route_to(uri) + return URI.parse(uri).route_from(self) + end + + ## + # Returns a normalized URI object. + # + # NOTE: This method does not attempt to fully conform to specifications. + # It exists largely to correct other people's failures to read the + # specifications, and also to deal with caching issues since several + # different URIs may represent the same resource and should not be + # cached multiple times. + # + # @return [Addressable::URI] The normalized URI. + def normalize + # This is a special exception for the frequently misused feed + # URI scheme. + if normalized_scheme == "feed" + if self.to_s =~ /^feed:\/*http:\/*/ + return URI.parse( + self.to_s[/^feed:\/*(http:\/*.*)/, 1] + ).normalize + end + end + + return self.class.new( + :scheme => normalized_scheme, + :authority => normalized_authority, + :path => normalized_path, + :query => normalized_query, + :fragment => normalized_fragment + ) + end + + ## + # Destructively normalizes this URI object. + # + # @return [Addressable::URI] The normalized URI. + # + # @see Addressable::URI#normalize + def normalize! + replace_self(self.normalize) + end + + ## + # Creates a URI suitable for display to users. If semantic attacks are + # likely, the application should try to detect these and warn the user. + # See RFC 3986, + # section 7.6 for more information. + # + # @return [Addressable::URI] A URI suitable for display purposes. + def display_uri + display_uri = self.normalize + display_uri.host = ::Addressable::IDNA.to_unicode(display_uri.host) + return display_uri + end + + ## + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison, and allows comparison + # against Strings. + # + # @param [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + def ===(uri) + if uri.respond_to?(:normalize) + uri_string = uri.normalize.to_s + else + begin + uri_string = ::Addressable::URI.parse(uri).normalize.to_s + rescue InvalidURIError, TypeError + return false + end + end + return self.normalize.to_s == uri_string + end + + ## + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison. + # + # @param [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + def ==(uri) + return false unless uri.kind_of?(URI) + return self.normalize.to_s == uri.normalize.to_s + end + + ## + # Returns true if the URI objects are equal. This method + # does NOT normalize either URI before doing the comparison. + # + # @param [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + def eql?(uri) + return false unless uri.kind_of?(URI) + return self.to_s == uri.to_s + end + + ## + # A hash value that will make a URI equivalent to its normalized + # form. + # + # @return [Integer] A hash of the URI. + def hash + @hash ||= self.to_s.hash * -1 + end + + ## + # Clones the URI object. + # + # @return [Addressable::URI] The cloned URI. + def dup + duplicated_uri = self.class.new( + :scheme => self.scheme ? self.scheme.dup : nil, + :user => self.user ? self.user.dup : nil, + :password => self.password ? self.password.dup : nil, + :host => self.host ? self.host.dup : nil, + :port => self.port, + :path => self.path ? self.path.dup : nil, + :query => self.query ? self.query.dup : nil, + :fragment => self.fragment ? self.fragment.dup : nil + ) + return duplicated_uri + end + + ## + # Omits components from a URI. + # + # @param [Symbol] *components The components to be omitted. + # + # @return [Addressable::URI] The URI with components omitted. + # + # @example + # uri = Addressable::URI.parse("http://example.com/path?query") + # #=> # + # uri.omit(:scheme, :authority) + # #=> # + def omit(*components) + invalid_components = components - [ + :scheme, :user, :password, :userinfo, :host, :port, :authority, + :path, :query, :fragment + ] + unless invalid_components.empty? + raise ArgumentError, + "Invalid component names: #{invalid_components.inspect}." + end + duplicated_uri = self.dup + duplicated_uri.defer_validation do + components.each do |component| + duplicated_uri.send((component.to_s + "=").to_sym, nil) + end + duplicated_uri.user = duplicated_uri.normalized_user + end + duplicated_uri + end + + ## + # Destructive form of omit. + # + # @param [Symbol] *components The components to be omitted. + # + # @return [Addressable::URI] The URI with components omitted. + # + # @see Addressable::URI#omit + def omit!(*components) + replace_self(self.omit(*components)) + end + + ## + # Determines if the URI is an empty string. + # + # @return [TrueClass, FalseClass] + # Returns true if empty, false otherwise. + def empty? + return self.to_s.empty? + end + + ## + # Converts the URI to a String. + # + # @return [String] The URI's String representation. + def to_s + if self.scheme == nil && self.path != nil && !self.path.empty? && + self.path =~ NORMPATH + raise InvalidURIError, + "Cannot assemble URI string with ambiguous path: '#{self.path}'" + end + @uri_string ||= begin + uri_string = String.new + uri_string << "#{self.scheme}:" if self.scheme != nil + uri_string << "//#{self.authority}" if self.authority != nil + uri_string << self.path.to_s + uri_string << "?#{self.query}" if self.query != nil + uri_string << "##{self.fragment}" if self.fragment != nil + uri_string.force_encoding(Encoding::UTF_8) + uri_string + end + end + + ## + # URI's are glorified Strings. Allow implicit conversion. + alias_method :to_str, :to_s + + ## + # Returns a Hash of the URI components. + # + # @return [Hash] The URI as a Hash of components. + def to_hash + return { + :scheme => self.scheme, + :user => self.user, + :password => self.password, + :host => self.host, + :port => self.port, + :path => self.path, + :query => self.query, + :fragment => self.fragment + } + end + + ## + # Returns a String representation of the URI object's state. + # + # @return [String] The URI object's state, as a String. + def inspect + sprintf("#<%s:%#0x URI:%s>", URI.to_s, self.object_id, self.to_s) + end + + ## + # This method allows you to make several changes to a URI simultaneously, + # which separately would cause validation errors, but in conjunction, + # are valid. The URI will be revalidated as soon as the entire block has + # been executed. + # + # @param [Proc] block + # A set of operations to perform on a given URI. + def defer_validation + raise LocalJumpError, "No block given." unless block_given? + @validation_deferred = true + yield + @validation_deferred = false + validate + return nil + end + + protected + SELF_REF = '.' + PARENT = '..' + + RULE_2A = /\/\.\/|\/\.$/ + RULE_2B_2C = /\/([^\/]*)\/\.\.\/|\/([^\/]*)\/\.\.$/ + RULE_2D = /^\.\.?\/?/ + RULE_PREFIXED_PARENT = /^\/\.\.?\/|^(\/\.\.?)+\/?$/ + + ## + # Resolves paths to their simplest form. + # + # @param [String] path The path to normalize. + # + # @return [String] The normalized path. + def self.normalize_path(path) + # Section 5.2.4 of RFC 3986 + + return nil if path.nil? + normalized_path = path.dup + begin + mod = nil + mod ||= normalized_path.gsub!(RULE_2A, SLASH) + + pair = normalized_path.match(RULE_2B_2C) + parent, current = pair[1], pair[2] if pair + if pair && ((parent != SELF_REF && parent != PARENT) || + (current != SELF_REF && current != PARENT)) + mod ||= normalized_path.gsub!( + Regexp.new( + "/#{Regexp.escape(parent.to_s)}/\\.\\./|" + + "(/#{Regexp.escape(current.to_s)}/\\.\\.$)" + ), SLASH + ) + end + + mod ||= normalized_path.gsub!(RULE_2D, EMPTY_STR) + # Non-standard, removes prefixed dotted segments from path. + mod ||= normalized_path.gsub!(RULE_PREFIXED_PARENT, SLASH) + end until mod.nil? + + return normalized_path + end + + ## + # Ensures that the URI is valid. + def validate + return if !!@validation_deferred + if self.scheme != nil && self.ip_based? && + (self.host == nil || self.host.empty?) && + (self.path == nil || self.path.empty?) + raise InvalidURIError, + "Absolute URI missing hierarchical segment: '#{self.to_s}'" + end + if self.host == nil + if self.port != nil || + self.user != nil || + self.password != nil + raise InvalidURIError, "Hostname not supplied: '#{self.to_s}'" + end + end + if self.path != nil && !self.path.empty? && self.path[0..0] != SLASH && + self.authority != nil + raise InvalidURIError, + "Cannot have a relative path with an authority set: '#{self.to_s}'" + end + if self.path != nil && !self.path.empty? && + self.path[0..1] == SLASH + SLASH && self.authority == nil + raise InvalidURIError, + "Cannot have a path with two leading slashes " + + "without an authority set: '#{self.to_s}'" + end + unreserved = CharacterClasses::UNRESERVED + sub_delims = CharacterClasses::SUB_DELIMS + if !self.host.nil? && (self.host =~ /[<>{}\/\\\?\#\@"[[:space:]]]/ || + (self.host[/^\[(.*)\]$/, 1] != nil && self.host[/^\[(.*)\]$/, 1] !~ + Regexp.new("^[#{unreserved}#{sub_delims}:]*$"))) + raise InvalidURIError, "Invalid character in host: '#{self.host.to_s}'" + end + return nil + end + + ## + # Replaces the internal state of self with the specified URI's state. + # Used in destructive operations to avoid massive code repetition. + # + # @param [Addressable::URI] uri The URI to replace self with. + # + # @return [Addressable::URI] self. + def replace_self(uri) + # Reset dependent values + instance_variables.each do |var| + if instance_variable_defined?(var) && var != :@validation_deferred + remove_instance_variable(var) + end + end + + @scheme = uri.scheme + @user = uri.user + @password = uri.password + @host = uri.host + @port = uri.port + @path = uri.path + @query = uri.query + @fragment = uri.fragment + return self + end + + ## + # Splits path string with "/" (slash). + # It is considered that there is empty string after last slash when + # path ends with slash. + # + # @param [String] path The path to split. + # + # @return [Array] An array of parts of path. + def split_path(path) + splitted = path.split(SLASH) + splitted << EMPTY_STR if path.end_with? SLASH + splitted + end + + ## + # Resets composite values for the entire URI + # + # @api private + def remove_composite_values + remove_instance_variable(:@uri_string) if defined?(@uri_string) + remove_instance_variable(:@hash) if defined?(@hash) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/version.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/version.rb new file mode 100644 index 0000000..2efe434 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/lib/addressable/version.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# encoding:utf-8 +#-- +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#++ + + +# Used to prevent the class/module from being loaded more than once +if !defined?(Addressable::VERSION) + module Addressable + module VERSION + MAJOR = 2 + MINOR = 8 + TINY = 0 + + STRING = [MAJOR, MINOR, TINY].join('.') + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/idna_spec.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/idna_spec.rb new file mode 100644 index 0000000..4104b37 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/idna_spec.rb @@ -0,0 +1,302 @@ +# frozen_string_literal: true + +# coding: utf-8 +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +require "spec_helper" + +# Have to use RubyGems to load the idn gem. +require "rubygems" + +require "addressable/idna" + +shared_examples_for "converting from unicode to ASCII" do + it "should convert 'www.google.com' correctly" do + expect(Addressable::IDNA.to_ascii("www.google.com")).to eq("www.google.com") + end + + long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com' + it "should convert '#{long}' correctly" do + expect(Addressable::IDNA.to_ascii(long)).to eq(long) + end + + it "should convert 'www.詹姆斯.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "www.詹姆斯.com" + )).to eq("www.xn--8ws00zhy3a.com") + end + + it "should convert 'www.Iñtërnâtiônàlizætiøn.com' correctly" do + "www.Iñtërnâtiônàlizætiøn.com" + expect(Addressable::IDNA.to_ascii( + "www.I\xC3\xB1t\xC3\xABrn\xC3\xA2ti\xC3\xB4" + + "n\xC3\xA0liz\xC3\xA6ti\xC3\xB8n.com" + )).to eq("www.xn--itrntinliztin-vdb0a5exd8ewcye.com") + end + + it "should convert 'www.Iñtërnâtiônàlizætiøn.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "www.In\xCC\x83te\xCC\x88rna\xCC\x82tio\xCC\x82n" + + "a\xCC\x80liz\xC3\xA6ti\xC3\xB8n.com" + )).to eq("www.xn--itrntinliztin-vdb0a5exd8ewcye.com") + end + + it "should convert " + + "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " + + "correctly" do + expect(Addressable::IDNA.to_ascii( + "www.\343\201\273\343\202\223\343\201\250\343\201\206\343\201\253\343" + + "\201\252\343\201\214\343\201\204\343\202\217\343\201\221\343\201\256" + + "\343\202\217\343\201\213\343\202\211\343\201\252\343\201\204\343\201" + + "\251\343\202\201\343\201\204\343\202\223\343\202\201\343\201\204\343" + + "\201\256\343\202\211\343\201\271\343\202\213\343\201\276\343\201\240" + + "\343\201\252\343\201\214\343\201\217\343\201\227\343\201\252\343\201" + + "\204\343\201\250\343\201\237\343\202\212\343\201\252\343\201\204." + + "w3.mag.keio.ac.jp" + )).to eq( + "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" + + "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp" + ) + end + + it "should convert " + + "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " + + "correctly" do + expect(Addressable::IDNA.to_ascii( + "www.\343\201\273\343\202\223\343\201\250\343\201\206\343\201\253\343" + + "\201\252\343\201\213\343\202\231\343\201\204\343\202\217\343\201\221" + + "\343\201\256\343\202\217\343\201\213\343\202\211\343\201\252\343\201" + + "\204\343\201\250\343\202\231\343\202\201\343\201\204\343\202\223\343" + + "\202\201\343\201\204\343\201\256\343\202\211\343\201\270\343\202\231" + + "\343\202\213\343\201\276\343\201\237\343\202\231\343\201\252\343\201" + + "\213\343\202\231\343\201\217\343\201\227\343\201\252\343\201\204\343" + + "\201\250\343\201\237\343\202\212\343\201\252\343\201\204." + + "w3.mag.keio.ac.jp" + )).to eq( + "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" + + "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp" + ) + end + + it "should convert '点心和烤鸭.w3.mag.keio.ac.jp' correctly" do + expect(Addressable::IDNA.to_ascii( + "点心和烤鸭.w3.mag.keio.ac.jp" + )).to eq("xn--0trv4xfvn8el34t.w3.mag.keio.ac.jp") + end + + it "should convert '가각갂갃간갅갆갇갈갉힢힣.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "가각갂갃간갅갆갇갈갉힢힣.com" + )).to eq("xn--o39acdefghijk5883jma.com") + end + + it "should convert " + + "'\347\242\274\346\250\231\346\272\226\350" + + "\220\254\345\234\213\347\242\274.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "\347\242\274\346\250\231\346\272\226\350" + + "\220\254\345\234\213\347\242\274.com" + )).to eq("xn--9cs565brid46mda086o.com") + end + + it "should convert 'リ宠퐱〹.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "\357\276\230\345\256\240\355\220\261\343\200\271.com" + )).to eq("xn--eek174hoxfpr4k.com") + end + + it "should convert 'リ宠퐱卄.com' correctly" do + expect(Addressable::IDNA.to_ascii( + "\343\203\252\345\256\240\355\220\261\345\215\204.com" + )).to eq("xn--eek174hoxfpr4k.com") + end + + it "should convert 'ᆵ' correctly" do + expect(Addressable::IDNA.to_ascii( + "\341\206\265" + )).to eq("xn--4ud") + end + + it "should convert 'ᆵ' correctly" do + expect(Addressable::IDNA.to_ascii( + "\357\276\257" + )).to eq("xn--4ud") + end + + it "should convert '🌹🌹🌹.ws' correctly" do + expect(Addressable::IDNA.to_ascii( + "\360\237\214\271\360\237\214\271\360\237\214\271.ws" + )).to eq("xn--2h8haa.ws") + end + + it "should handle two adjacent '.'s correctly" do + expect(Addressable::IDNA.to_ascii( + "example..host" + )).to eq("example..host") + end +end + +shared_examples_for "converting from ASCII to unicode" do + long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com' + it "should convert '#{long}' correctly" do + expect(Addressable::IDNA.to_unicode(long)).to eq(long) + end + + it "should return the identity conversion when punycode decode fails" do + expect(Addressable::IDNA.to_unicode("xn--zckp1cyg1.sblo.jp")).to eq( + "xn--zckp1cyg1.sblo.jp") + end + + it "should return the identity conversion when the ACE prefix has no suffix" do + expect(Addressable::IDNA.to_unicode("xn--...-")).to eq("xn--...-") + end + + it "should convert 'www.google.com' correctly" do + expect(Addressable::IDNA.to_unicode("www.google.com")).to eq( + "www.google.com") + end + + it "should convert 'www.詹姆斯.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "www.xn--8ws00zhy3a.com" + )).to eq("www.詹姆斯.com") + end + + it "should convert '詹姆斯.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--8ws00zhy3a.com" + )).to eq("詹姆斯.com") + end + + it "should convert 'www.iñtërnâtiônàlizætiøn.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "www.xn--itrntinliztin-vdb0a5exd8ewcye.com" + )).to eq("www.iñtërnâtiônàlizætiøn.com") + end + + it "should convert 'iñtërnâtiônàlizætiøn.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--itrntinliztin-vdb0a5exd8ewcye.com" + )).to eq("iñtërnâtiônàlizætiøn.com") + end + + it "should convert " + + "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " + + "correctly" do + expect(Addressable::IDNA.to_unicode( + "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" + + "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp" + )).to eq( + "www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp" + ) + end + + it "should convert '点心和烤鸭.w3.mag.keio.ac.jp' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--0trv4xfvn8el34t.w3.mag.keio.ac.jp" + )).to eq("点心和烤鸭.w3.mag.keio.ac.jp") + end + + it "should convert '가각갂갃간갅갆갇갈갉힢힣.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--o39acdefghijk5883jma.com" + )).to eq("가각갂갃간갅갆갇갈갉힢힣.com") + end + + it "should convert " + + "'\347\242\274\346\250\231\346\272\226\350" + + "\220\254\345\234\213\347\242\274.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--9cs565brid46mda086o.com" + )).to eq( + "\347\242\274\346\250\231\346\272\226\350" + + "\220\254\345\234\213\347\242\274.com" + ) + end + + it "should convert 'リ宠퐱卄.com' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--eek174hoxfpr4k.com" + )).to eq("\343\203\252\345\256\240\355\220\261\345\215\204.com") + end + + it "should convert 'ᆵ' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--4ud" + )).to eq("\341\206\265") + end + + it "should convert '🌹🌹🌹.ws' correctly" do + expect(Addressable::IDNA.to_unicode( + "xn--2h8haa.ws" + )).to eq("\360\237\214\271\360\237\214\271\360\237\214\271.ws") + end + + it "should handle two adjacent '.'s correctly" do + expect(Addressable::IDNA.to_unicode( + "example..host" + )).to eq("example..host") + end + + it "should normalize 'string' correctly" do + expect(Addressable::IDNA.unicode_normalize_kc(:'string')).to eq("string") + expect(Addressable::IDNA.unicode_normalize_kc("string")).to eq("string") + end +end + +describe Addressable::IDNA, "when using the pure-Ruby implementation" do + before do + Addressable.send(:remove_const, :IDNA) + load "addressable/idna/pure.rb" + end + + it_should_behave_like "converting from unicode to ASCII" + it_should_behave_like "converting from ASCII to unicode" + + begin + require "fiber" + + it "should not blow up inside fibers" do + f = Fiber.new do + Addressable.send(:remove_const, :IDNA) + load "addressable/idna/pure.rb" + end + f.resume + end + rescue LoadError + # Fibers aren't supported in this version of Ruby, skip this test. + warn('Fibers unsupported.') + end +end + +begin + require "idn" + + describe Addressable::IDNA, "when using the native-code implementation" do + before do + Addressable.send(:remove_const, :IDNA) + load "addressable/idna/native.rb" + end + + it_should_behave_like "converting from unicode to ASCII" + it_should_behave_like "converting from ASCII to unicode" + end +rescue LoadError => error + raise error if ENV["CI"] && TestHelper.native_supported? + + # Cannot test the native implementation without libidn support. + warn('Could not load native IDN implementation.') +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/net_http_compat_spec.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/net_http_compat_spec.rb new file mode 100644 index 0000000..8663a86 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/net_http_compat_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# coding: utf-8 +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +require "spec_helper" + +require "addressable/uri" +require "net/http" + +describe Net::HTTP do + it "should be compatible with Addressable" do + response_body = + Net::HTTP.get(Addressable::URI.parse('http://www.google.com/')) + expect(response_body).not_to be_nil + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/security_spec.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/security_spec.rb new file mode 100644 index 0000000..601e808 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/security_spec.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# coding: utf-8 +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +require "spec_helper" + +require "addressable/uri" + +describe Addressable::URI, "when created with a URI known to cause crashes " + + "in certain browsers" do + it "should parse correctly" do + uri = Addressable::URI.parse('%%30%30') + expect(uri.path).to eq('%%30%30') + expect(uri.normalize.path).to eq('%2500') + end + + it "should parse correctly as a full URI" do + uri = Addressable::URI.parse('http://www.example.com/%%30%30') + expect(uri.path).to eq('/%%30%30') + expect(uri.normalize.path).to eq('/%2500') + end +end + +describe Addressable::URI, "when created with a URI known to cause crashes " + + "in certain browsers" do + it "should parse correctly" do + uri = Addressable::URI.parse('لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗') + expect(uri.path).to eq('لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗') + expect(uri.normalize.path).to eq( + '%D9%84%D9%8F%D8%B5%D9%91%D8%A8%D9%8F%D9%84%D9%8F%D9%84%D8%B5%D9%91' + + '%D8%A8%D9%8F%D8%B1%D8%B1%D9%8B%20%E0%A5%A3%20%E0%A5%A3h%20%E0%A5' + + '%A3%20%E0%A5%A3%20%E5%86%97' + ) + end + + it "should parse correctly as a full URI" do + uri = Addressable::URI.parse('http://www.example.com/لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗') + expect(uri.path).to eq('/لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗') + expect(uri.normalize.path).to eq( + '/%D9%84%D9%8F%D8%B5%D9%91%D8%A8%D9%8F%D9%84%D9%8F%D9%84%D8%B5%D9%91' + + '%D8%A8%D9%8F%D8%B1%D8%B1%D9%8B%20%E0%A5%A3%20%E0%A5%A3h%20%E0%A5' + + '%A3%20%E0%A5%A3%20%E5%86%97' + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/template_spec.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/template_spec.rb new file mode 100644 index 0000000..d47589a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/template_spec.rb @@ -0,0 +1,1460 @@ +# frozen_string_literal: true + +# coding: utf-8 +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +require "spec_helper" + +require "bigdecimal" +require "timeout" +require "addressable/template" + +shared_examples_for 'expands' do |tests| + tests.each do |template, expansion| + exp = expansion.is_a?(Array) ? expansion.first : expansion + it "#{template} to #{exp}" do + tmpl = Addressable::Template.new(template).expand(subject) + if expansion.is_a?(Array) + expect(expansion.any?{|i| i == tmpl.to_str}).to be true + else + expect(tmpl.to_str).to eq(expansion) + end + end + end +end + +describe "eql?" do + let(:template) { Addressable::Template.new('https://www.example.com/{foo}') } + it 'is equal when the pattern matches' do + other_template = Addressable::Template.new('https://www.example.com/{foo}') + expect(template).to be_eql(other_template) + expect(other_template).to be_eql(template) + end + it 'is not equal when the pattern differs' do + other_template = Addressable::Template.new('https://www.example.com/{bar}') + expect(template).to_not be_eql(other_template) + expect(other_template).to_not be_eql(template) + end + it 'is not equal to non-templates' do + uri = 'https://www.example.com/foo/bar' + addressable_template = Addressable::Template.new uri + addressable_uri = Addressable::URI.parse uri + expect(addressable_template).to_not be_eql(addressable_uri) + expect(addressable_uri).to_not be_eql(addressable_template) + end +end + +describe "==" do + let(:template) { Addressable::Template.new('https://www.example.com/{foo}') } + it 'is equal when the pattern matches' do + other_template = Addressable::Template.new('https://www.example.com/{foo}') + expect(template).to eq other_template + expect(other_template).to eq template + end + it 'is not equal when the pattern differs' do + other_template = Addressable::Template.new('https://www.example.com/{bar}') + expect(template).not_to eq other_template + expect(other_template).not_to eq template + end + it 'is not equal to non-templates' do + uri = 'https://www.example.com/foo/bar' + addressable_template = Addressable::Template.new uri + addressable_uri = Addressable::URI.parse uri + expect(addressable_template).not_to eq addressable_uri + expect(addressable_uri).not_to eq addressable_template + end +end + +describe "Type conversion" do + subject { + { + :var => true, + :hello => 1234, + :nothing => nil, + :sym => :symbolic, + :decimal => BigDecimal('1') + } + } + + it_behaves_like 'expands', { + '{var}' => 'true', + '{hello}' => '1234', + '{nothing}' => '', + '{sym}' => 'symbolic', + '{decimal}' => RUBY_VERSION < '2.4.0' ? '0.1E1' : '0.1e1' + } +end + +describe "Level 1:" do + subject { + {:var => "value", :hello => "Hello World!"} + } + it_behaves_like 'expands', { + '{var}' => 'value', + '{hello}' => 'Hello%20World%21' + } +end + +describe "Level 2" do + subject { + { + :var => "value", + :hello => "Hello World!", + :path => "/foo/bar" + } + } + context "Operator +:" do + it_behaves_like 'expands', { + '{+var}' => 'value', + '{+hello}' => 'Hello%20World!', + '{+path}/here' => '/foo/bar/here', + 'here?ref={+path}' => 'here?ref=/foo/bar' + } + end + context "Operator #:" do + it_behaves_like 'expands', { + 'X{#var}' => 'X#value', + 'X{#hello}' => 'X#Hello%20World!' + } + end +end + +describe "Level 3" do + subject { + { + :var => "value", + :hello => "Hello World!", + :empty => "", + :path => "/foo/bar", + :x => "1024", + :y => "768" + } + } + context "Operator nil (multiple vars):" do + it_behaves_like 'expands', { + 'map?{x,y}' => 'map?1024,768', + '{x,hello,y}' => '1024,Hello%20World%21,768' + } + end + context "Operator + (multiple vars):" do + it_behaves_like 'expands', { + '{+x,hello,y}' => '1024,Hello%20World!,768', + '{+path,x}/here' => '/foo/bar,1024/here' + } + end + context "Operator # (multiple vars):" do + it_behaves_like 'expands', { + '{#x,hello,y}' => '#1024,Hello%20World!,768', + '{#path,x}/here' => '#/foo/bar,1024/here' + } + end + context "Operator ." do + it_behaves_like 'expands', { + 'X{.var}' => 'X.value', + 'X{.x,y}' => 'X.1024.768' + } + end + context "Operator /" do + it_behaves_like 'expands', { + '{/var}' => '/value', + '{/var,x}/here' => '/value/1024/here' + } + end + context "Operator ;" do + it_behaves_like 'expands', { + '{;x,y}' => ';x=1024;y=768', + '{;x,y,empty}' => ';x=1024;y=768;empty' + } + end + context "Operator ?" do + it_behaves_like 'expands', { + '{?x,y}' => '?x=1024&y=768', + '{?x,y,empty}' => '?x=1024&y=768&empty=' + } + end + context "Operator &" do + it_behaves_like 'expands', { + '?fixed=yes{&x}' => '?fixed=yes&x=1024', + '{&x,y,empty}' => '&x=1024&y=768&empty=' + } + end +end + +describe "Level 4" do + subject { + { + :var => "value", + :hello => "Hello World!", + :path => "/foo/bar", + :semi => ";", + :list => %w(red green blue), + :keys => {"semi" => ';', "dot" => '.', "comma" => ','} + } + } + context "Expansion with value modifiers" do + it_behaves_like 'expands', { + '{var:3}' => 'val', + '{var:30}' => 'value', + '{list}' => 'red,green,blue', + '{list*}' => 'red,green,blue', + '{keys}' => [ + 'semi,%3B,dot,.,comma,%2C', + 'dot,.,semi,%3B,comma,%2C', + 'comma,%2C,semi,%3B,dot,.', + 'semi,%3B,comma,%2C,dot,.', + 'dot,.,comma,%2C,semi,%3B', + 'comma,%2C,dot,.,semi,%3B' + ], + '{keys*}' => [ + 'semi=%3B,dot=.,comma=%2C', + 'dot=.,semi=%3B,comma=%2C', + 'comma=%2C,semi=%3B,dot=.', + 'semi=%3B,comma=%2C,dot=.', + 'dot=.,comma=%2C,semi=%3B', + 'comma=%2C,dot=.,semi=%3B' + ] + } + end + context "Operator + with value modifiers" do + it_behaves_like 'expands', { + '{+path:6}/here' => '/foo/b/here', + '{+list}' => 'red,green,blue', + '{+list*}' => 'red,green,blue', + '{+keys}' => [ + 'semi,;,dot,.,comma,,', + 'dot,.,semi,;,comma,,', + 'comma,,,semi,;,dot,.', + 'semi,;,comma,,,dot,.', + 'dot,.,comma,,,semi,;', + 'comma,,,dot,.,semi,;' + ], + '{+keys*}' => [ + 'semi=;,dot=.,comma=,', + 'dot=.,semi=;,comma=,', + 'comma=,,semi=;,dot=.', + 'semi=;,comma=,,dot=.', + 'dot=.,comma=,,semi=;', + 'comma=,,dot=.,semi=;' + ] + } + end + context "Operator # with value modifiers" do + it_behaves_like 'expands', { + '{#path:6}/here' => '#/foo/b/here', + '{#list}' => '#red,green,blue', + '{#list*}' => '#red,green,blue', + '{#keys}' => [ + '#semi,;,dot,.,comma,,', + '#dot,.,semi,;,comma,,', + '#comma,,,semi,;,dot,.', + '#semi,;,comma,,,dot,.', + '#dot,.,comma,,,semi,;', + '#comma,,,dot,.,semi,;' + ], + '{#keys*}' => [ + '#semi=;,dot=.,comma=,', + '#dot=.,semi=;,comma=,', + '#comma=,,semi=;,dot=.', + '#semi=;,comma=,,dot=.', + '#dot=.,comma=,,semi=;', + '#comma=,,dot=.,semi=;' + ] + } + end + context "Operator . with value modifiers" do + it_behaves_like 'expands', { + 'X{.var:3}' => 'X.val', + 'X{.list}' => 'X.red,green,blue', + 'X{.list*}' => 'X.red.green.blue', + 'X{.keys}' => [ + 'X.semi,%3B,dot,.,comma,%2C', + 'X.dot,.,semi,%3B,comma,%2C', + 'X.comma,%2C,semi,%3B,dot,.', + 'X.semi,%3B,comma,%2C,dot,.', + 'X.dot,.,comma,%2C,semi,%3B', + 'X.comma,%2C,dot,.,semi,%3B' + ], + 'X{.keys*}' => [ + 'X.semi=%3B.dot=..comma=%2C', + 'X.dot=..semi=%3B.comma=%2C', + 'X.comma=%2C.semi=%3B.dot=.', + 'X.semi=%3B.comma=%2C.dot=.', + 'X.dot=..comma=%2C.semi=%3B', + 'X.comma=%2C.dot=..semi=%3B' + ] + } + end + context "Operator / with value modifiers" do + it_behaves_like 'expands', { + '{/var:1,var}' => '/v/value', + '{/list}' => '/red,green,blue', + '{/list*}' => '/red/green/blue', + '{/list*,path:4}' => '/red/green/blue/%2Ffoo', + '{/keys}' => [ + '/semi,%3B,dot,.,comma,%2C', + '/dot,.,semi,%3B,comma,%2C', + '/comma,%2C,semi,%3B,dot,.', + '/semi,%3B,comma,%2C,dot,.', + '/dot,.,comma,%2C,semi,%3B', + '/comma,%2C,dot,.,semi,%3B' + ], + '{/keys*}' => [ + '/semi=%3B/dot=./comma=%2C', + '/dot=./semi=%3B/comma=%2C', + '/comma=%2C/semi=%3B/dot=.', + '/semi=%3B/comma=%2C/dot=.', + '/dot=./comma=%2C/semi=%3B', + '/comma=%2C/dot=./semi=%3B' + ] + } + end + context "Operator ; with value modifiers" do + it_behaves_like 'expands', { + '{;hello:5}' => ';hello=Hello', + '{;list}' => ';list=red,green,blue', + '{;list*}' => ';list=red;list=green;list=blue', + '{;keys}' => [ + ';keys=semi,%3B,dot,.,comma,%2C', + ';keys=dot,.,semi,%3B,comma,%2C', + ';keys=comma,%2C,semi,%3B,dot,.', + ';keys=semi,%3B,comma,%2C,dot,.', + ';keys=dot,.,comma,%2C,semi,%3B', + ';keys=comma,%2C,dot,.,semi,%3B' + ], + '{;keys*}' => [ + ';semi=%3B;dot=.;comma=%2C', + ';dot=.;semi=%3B;comma=%2C', + ';comma=%2C;semi=%3B;dot=.', + ';semi=%3B;comma=%2C;dot=.', + ';dot=.;comma=%2C;semi=%3B', + ';comma=%2C;dot=.;semi=%3B' + ] + } + end + context "Operator ? with value modifiers" do + it_behaves_like 'expands', { + '{?var:3}' => '?var=val', + '{?list}' => '?list=red,green,blue', + '{?list*}' => '?list=red&list=green&list=blue', + '{?keys}' => [ + '?keys=semi,%3B,dot,.,comma,%2C', + '?keys=dot,.,semi,%3B,comma,%2C', + '?keys=comma,%2C,semi,%3B,dot,.', + '?keys=semi,%3B,comma,%2C,dot,.', + '?keys=dot,.,comma,%2C,semi,%3B', + '?keys=comma,%2C,dot,.,semi,%3B' + ], + '{?keys*}' => [ + '?semi=%3B&dot=.&comma=%2C', + '?dot=.&semi=%3B&comma=%2C', + '?comma=%2C&semi=%3B&dot=.', + '?semi=%3B&comma=%2C&dot=.', + '?dot=.&comma=%2C&semi=%3B', + '?comma=%2C&dot=.&semi=%3B' + ] + } + end + context "Operator & with value modifiers" do + it_behaves_like 'expands', { + '{&var:3}' => '&var=val', + '{&list}' => '&list=red,green,blue', + '{&list*}' => '&list=red&list=green&list=blue', + '{&keys}' => [ + '&keys=semi,%3B,dot,.,comma,%2C', + '&keys=dot,.,semi,%3B,comma,%2C', + '&keys=comma,%2C,semi,%3B,dot,.', + '&keys=semi,%3B,comma,%2C,dot,.', + '&keys=dot,.,comma,%2C,semi,%3B', + '&keys=comma,%2C,dot,.,semi,%3B' + ], + '{&keys*}' => [ + '&semi=%3B&dot=.&comma=%2C', + '&dot=.&semi=%3B&comma=%2C', + '&comma=%2C&semi=%3B&dot=.', + '&semi=%3B&comma=%2C&dot=.', + '&dot=.&comma=%2C&semi=%3B', + '&comma=%2C&dot=.&semi=%3B' + ] + } + end +end +describe "Modifiers" do + subject { + { + :var => "value", + :semi => ";", + :year => %w(1965 2000 2012), + :dom => %w(example com) + } + } + context "length" do + it_behaves_like 'expands', { + '{var:3}' => 'val', + '{var:30}' => 'value', + '{var}' => 'value', + '{semi}' => '%3B', + '{semi:2}' => '%3B' + } + end + context "explode" do + it_behaves_like 'expands', { + 'find{?year*}' => 'find?year=1965&year=2000&year=2012', + 'www{.dom*}' => 'www.example.com', + } + end +end +describe "Expansion" do + subject { + { + :count => ["one", "two", "three"], + :dom => ["example", "com"], + :dub => "me/too", + :hello => "Hello World!", + :half => "50%", + :var => "value", + :who => "fred", + :base => "http://example.com/home/", + :path => "/foo/bar", + :list => ["red", "green", "blue"], + :keys => {"semi" => ";","dot" => ".","comma" => ","}, + :v => "6", + :x => "1024", + :y => "768", + :empty => "", + :empty_keys => {}, + :undef => nil + } + } + context "concatenation" do + it_behaves_like 'expands', { + '{count}' => 'one,two,three', + '{count*}' => 'one,two,three', + '{/count}' => '/one,two,three', + '{/count*}' => '/one/two/three', + '{;count}' => ';count=one,two,three', + '{;count*}' => ';count=one;count=two;count=three', + '{?count}' => '?count=one,two,three', + '{?count*}' => '?count=one&count=two&count=three', + '{&count*}' => '&count=one&count=two&count=three' + } + end + context "simple expansion" do + it_behaves_like 'expands', { + '{var}' => 'value', + '{hello}' => 'Hello%20World%21', + '{half}' => '50%25', + 'O{empty}X' => 'OX', + 'O{undef}X' => 'OX', + '{x,y}' => '1024,768', + '{x,hello,y}' => '1024,Hello%20World%21,768', + '?{x,empty}' => '?1024,', + '?{x,undef}' => '?1024', + '?{undef,y}' => '?768', + '{var:3}' => 'val', + '{var:30}' => 'value', + '{list}' => 'red,green,blue', + '{list*}' => 'red,green,blue', + '{keys}' => [ + 'semi,%3B,dot,.,comma,%2C', + 'dot,.,semi,%3B,comma,%2C', + 'comma,%2C,semi,%3B,dot,.', + 'semi,%3B,comma,%2C,dot,.', + 'dot,.,comma,%2C,semi,%3B', + 'comma,%2C,dot,.,semi,%3B' + ], + '{keys*}' => [ + 'semi=%3B,dot=.,comma=%2C', + 'dot=.,semi=%3B,comma=%2C', + 'comma=%2C,semi=%3B,dot=.', + 'semi=%3B,comma=%2C,dot=.', + 'dot=.,comma=%2C,semi=%3B', + 'comma=%2C,dot=.,semi=%3B' + ] + } + end + context "reserved expansion (+)" do + it_behaves_like 'expands', { + '{+var}' => 'value', + '{+hello}' => 'Hello%20World!', + '{+half}' => '50%25', + '{base}index' => 'http%3A%2F%2Fexample.com%2Fhome%2Findex', + '{+base}index' => 'http://example.com/home/index', + 'O{+empty}X' => 'OX', + 'O{+undef}X' => 'OX', + '{+path}/here' => '/foo/bar/here', + 'here?ref={+path}' => 'here?ref=/foo/bar', + 'up{+path}{var}/here' => 'up/foo/barvalue/here', + '{+x,hello,y}' => '1024,Hello%20World!,768', + '{+path,x}/here' => '/foo/bar,1024/here', + '{+path:6}/here' => '/foo/b/here', + '{+list}' => 'red,green,blue', + '{+list*}' => 'red,green,blue', + '{+keys}' => [ + 'semi,;,dot,.,comma,,', + 'dot,.,semi,;,comma,,', + 'comma,,,semi,;,dot,.', + 'semi,;,comma,,,dot,.', + 'dot,.,comma,,,semi,;', + 'comma,,,dot,.,semi,;' + ], + '{+keys*}' => [ + 'semi=;,dot=.,comma=,', + 'dot=.,semi=;,comma=,', + 'comma=,,semi=;,dot=.', + 'semi=;,comma=,,dot=.', + 'dot=.,comma=,,semi=;', + 'comma=,,dot=.,semi=;' + ] + } + end + context "fragment expansion (#)" do + it_behaves_like 'expands', { + '{#var}' => '#value', + '{#hello}' => '#Hello%20World!', + '{#half}' => '#50%25', + 'foo{#empty}' => 'foo#', + 'foo{#undef}' => 'foo', + '{#x,hello,y}' => '#1024,Hello%20World!,768', + '{#path,x}/here' => '#/foo/bar,1024/here', + '{#path:6}/here' => '#/foo/b/here', + '{#list}' => '#red,green,blue', + '{#list*}' => '#red,green,blue', + '{#keys}' => [ + '#semi,;,dot,.,comma,,', + '#dot,.,semi,;,comma,,', + '#comma,,,semi,;,dot,.', + '#semi,;,comma,,,dot,.', + '#dot,.,comma,,,semi,;', + '#comma,,,dot,.,semi,;' + ], + '{#keys*}' => [ + '#semi=;,dot=.,comma=,', + '#dot=.,semi=;,comma=,', + '#comma=,,semi=;,dot=.', + '#semi=;,comma=,,dot=.', + '#dot=.,comma=,,semi=;', + '#comma=,,dot=.,semi=;' + ] + } + end + context "label expansion (.)" do + it_behaves_like 'expands', { + '{.who}' => '.fred', + '{.who,who}' => '.fred.fred', + '{.half,who}' => '.50%25.fred', + 'www{.dom*}' => 'www.example.com', + 'X{.var}' => 'X.value', + 'X{.empty}' => 'X.', + 'X{.undef}' => 'X', + 'X{.var:3}' => 'X.val', + 'X{.list}' => 'X.red,green,blue', + 'X{.list*}' => 'X.red.green.blue', + 'X{.keys}' => [ + 'X.semi,%3B,dot,.,comma,%2C', + 'X.dot,.,semi,%3B,comma,%2C', + 'X.comma,%2C,semi,%3B,dot,.', + 'X.semi,%3B,comma,%2C,dot,.', + 'X.dot,.,comma,%2C,semi,%3B', + 'X.comma,%2C,dot,.,semi,%3B' + ], + 'X{.keys*}' => [ + 'X.semi=%3B.dot=..comma=%2C', + 'X.dot=..semi=%3B.comma=%2C', + 'X.comma=%2C.semi=%3B.dot=.', + 'X.semi=%3B.comma=%2C.dot=.', + 'X.dot=..comma=%2C.semi=%3B', + 'X.comma=%2C.dot=..semi=%3B' + ], + 'X{.empty_keys}' => 'X', + 'X{.empty_keys*}' => 'X' + } + end + context "path expansion (/)" do + it_behaves_like 'expands', { + '{/who}' => '/fred', + '{/who,who}' => '/fred/fred', + '{/half,who}' => '/50%25/fred', + '{/who,dub}' => '/fred/me%2Ftoo', + '{/var}' => '/value', + '{/var,empty}' => '/value/', + '{/var,undef}' => '/value', + '{/var,x}/here' => '/value/1024/here', + '{/var:1,var}' => '/v/value', + '{/list}' => '/red,green,blue', + '{/list*}' => '/red/green/blue', + '{/list*,path:4}' => '/red/green/blue/%2Ffoo', + '{/keys}' => [ + '/semi,%3B,dot,.,comma,%2C', + '/dot,.,semi,%3B,comma,%2C', + '/comma,%2C,semi,%3B,dot,.', + '/semi,%3B,comma,%2C,dot,.', + '/dot,.,comma,%2C,semi,%3B', + '/comma,%2C,dot,.,semi,%3B' + ], + '{/keys*}' => [ + '/semi=%3B/dot=./comma=%2C', + '/dot=./semi=%3B/comma=%2C', + '/comma=%2C/semi=%3B/dot=.', + '/semi=%3B/comma=%2C/dot=.', + '/dot=./comma=%2C/semi=%3B', + '/comma=%2C/dot=./semi=%3B' + ] + } + end + context "path-style expansion (;)" do + it_behaves_like 'expands', { + '{;who}' => ';who=fred', + '{;half}' => ';half=50%25', + '{;empty}' => ';empty', + '{;v,empty,who}' => ';v=6;empty;who=fred', + '{;v,bar,who}' => ';v=6;who=fred', + '{;x,y}' => ';x=1024;y=768', + '{;x,y,empty}' => ';x=1024;y=768;empty', + '{;x,y,undef}' => ';x=1024;y=768', + '{;hello:5}' => ';hello=Hello', + '{;list}' => ';list=red,green,blue', + '{;list*}' => ';list=red;list=green;list=blue', + '{;keys}' => [ + ';keys=semi,%3B,dot,.,comma,%2C', + ';keys=dot,.,semi,%3B,comma,%2C', + ';keys=comma,%2C,semi,%3B,dot,.', + ';keys=semi,%3B,comma,%2C,dot,.', + ';keys=dot,.,comma,%2C,semi,%3B', + ';keys=comma,%2C,dot,.,semi,%3B' + ], + '{;keys*}' => [ + ';semi=%3B;dot=.;comma=%2C', + ';dot=.;semi=%3B;comma=%2C', + ';comma=%2C;semi=%3B;dot=.', + ';semi=%3B;comma=%2C;dot=.', + ';dot=.;comma=%2C;semi=%3B', + ';comma=%2C;dot=.;semi=%3B' + ] + } + end + context "form query expansion (?)" do + it_behaves_like 'expands', { + '{?who}' => '?who=fred', + '{?half}' => '?half=50%25', + '{?x,y}' => '?x=1024&y=768', + '{?x,y,empty}' => '?x=1024&y=768&empty=', + '{?x,y,undef}' => '?x=1024&y=768', + '{?var:3}' => '?var=val', + '{?list}' => '?list=red,green,blue', + '{?list*}' => '?list=red&list=green&list=blue', + '{?keys}' => [ + '?keys=semi,%3B,dot,.,comma,%2C', + '?keys=dot,.,semi,%3B,comma,%2C', + '?keys=comma,%2C,semi,%3B,dot,.', + '?keys=semi,%3B,comma,%2C,dot,.', + '?keys=dot,.,comma,%2C,semi,%3B', + '?keys=comma,%2C,dot,.,semi,%3B' + ], + '{?keys*}' => [ + '?semi=%3B&dot=.&comma=%2C', + '?dot=.&semi=%3B&comma=%2C', + '?comma=%2C&semi=%3B&dot=.', + '?semi=%3B&comma=%2C&dot=.', + '?dot=.&comma=%2C&semi=%3B', + '?comma=%2C&dot=.&semi=%3B' + ] + } + end + context "form query expansion (&)" do + it_behaves_like 'expands', { + '{&who}' => '&who=fred', + '{&half}' => '&half=50%25', + '?fixed=yes{&x}' => '?fixed=yes&x=1024', + '{&x,y,empty}' => '&x=1024&y=768&empty=', + '{&x,y,undef}' => '&x=1024&y=768', + '{&var:3}' => '&var=val', + '{&list}' => '&list=red,green,blue', + '{&list*}' => '&list=red&list=green&list=blue', + '{&keys}' => [ + '&keys=semi,%3B,dot,.,comma,%2C', + '&keys=dot,.,semi,%3B,comma,%2C', + '&keys=comma,%2C,semi,%3B,dot,.', + '&keys=semi,%3B,comma,%2C,dot,.', + '&keys=dot,.,comma,%2C,semi,%3B', + '&keys=comma,%2C,dot,.,semi,%3B' + ], + '{&keys*}' => [ + '&semi=%3B&dot=.&comma=%2C', + '&dot=.&semi=%3B&comma=%2C', + '&comma=%2C&semi=%3B&dot=.', + '&semi=%3B&comma=%2C&dot=.', + '&dot=.&comma=%2C&semi=%3B', + '&comma=%2C&dot=.&semi=%3B' + ] + } + end + context "non-string key in match data" do + subject {Addressable::Template.new("http://example.com/{one}")} + + it "raises TypeError" do + expect { subject.expand(Object.new => "1") }.to raise_error TypeError + end + end +end + +class ExampleTwoProcessor + def self.restore(name, value) + return value.gsub(/-/, " ") if name == "query" + return value + end + + def self.match(name) + return ".*?" if name == "first" + return ".*" + end + def self.validate(name, value) + return !!(value =~ /^[\w ]+$/) if name == "query" + return true + end + + def self.transform(name, value) + return value.gsub(/ /, "+") if name == "query" + return value + end +end + +class DumbProcessor + def self.match(name) + return ".*?" if name == "first" + end +end + +describe Addressable::Template do + describe 'initialize' do + context 'with a non-string' do + it 'raises a TypeError' do + expect { Addressable::Template.new(nil) }.to raise_error(TypeError) + end + end + end + + describe 'freeze' do + subject { Addressable::Template.new("http://example.com/{first}/{+second}/") } + it 'freezes the template' do + expect(subject.freeze).to be_frozen + end + end + + describe "Matching" do + let(:uri){ + Addressable::URI.parse( + "http://example.com/search/an-example-search-query/" + ) + } + let(:uri2){ + Addressable::URI.parse("http://example.com/a/b/c/") + } + let(:uri3){ + Addressable::URI.parse("http://example.com/;a=1;b=2;c=3;first=foo") + } + let(:uri4){ + Addressable::URI.parse("http://example.com/?a=1&b=2&c=3&first=foo") + } + let(:uri5){ + "http://example.com/foo" + } + context "first uri with ExampleTwoProcessor" do + subject { + Addressable::Template.new( + "http://example.com/search/{query}/" + ).match(uri, ExampleTwoProcessor) + } + its(:variables){ should == ["query"] } + its(:captures){ should == ["an example search query"] } + end + + context "second uri with ExampleTwoProcessor" do + subject { + Addressable::Template.new( + "http://example.com/{first}/{+second}/" + ).match(uri2, ExampleTwoProcessor) + } + its(:variables){ should == ["first", "second"] } + its(:captures){ should == ["a", "b/c"] } + end + + context "second uri with DumbProcessor" do + subject { + Addressable::Template.new( + "http://example.com/{first}/{+second}/" + ).match(uri2, DumbProcessor) + } + its(:variables){ should == ["first", "second"] } + its(:captures){ should == ["a", "b/c"] } + end + + context "second uri" do + subject { + Addressable::Template.new( + "http://example.com/{first}{/second*}/" + ).match(uri2) + } + its(:variables){ should == ["first", "second"] } + its(:captures){ should == ["a", ["b","c"]] } + end + context "third uri" do + subject { + Addressable::Template.new( + "http://example.com/{;hash*,first}" + ).match(uri3) + } + its(:variables){ should == ["hash", "first"] } + its(:captures){ should == [ + {"a" => "1", "b" => "2", "c" => "3", "first" => "foo"}, nil] } + end + # Note that this expansion is impossible to revert deterministically - the + # * operator means first could have been a key of hash or a separate key. + # Semantically, a separate key is more likely, but both are possible. + context "fourth uri" do + subject { + Addressable::Template.new( + "http://example.com/{?hash*,first}" + ).match(uri4) + } + its(:variables){ should == ["hash", "first"] } + its(:captures){ should == [ + {"a" => "1", "b" => "2", "c" => "3", "first"=> "foo"}, nil] } + end + context "fifth uri" do + subject { + Addressable::Template.new( + "http://example.com/{path}{?hash*,first}" + ).match(uri5) + } + its(:variables){ should == ["path", "hash", "first"] } + its(:captures){ should == ["foo", nil, nil] } + end + end + + describe 'match' do + subject { Addressable::Template.new('http://example.com/first/second/') } + context 'when the URI is the same as the template' do + it 'returns the match data itself with an empty mapping' do + uri = Addressable::URI.parse('http://example.com/first/second/') + match_data = subject.match(uri) + expect(match_data).to be_an Addressable::Template::MatchData + expect(match_data.uri).to eq(uri) + expect(match_data.template).to eq(subject) + expect(match_data.mapping).to be_empty + expect(match_data.inspect).to be_an String + end + end + end + + describe "extract" do + let(:template) { + Addressable::Template.new( + "http://{host}{/segments*}/{?one,two,bogus}{#fragment}" + ) + } + let(:uri){ "http://example.com/a/b/c/?one=1&two=2#foo" } + let(:uri2){ "http://example.com/a/b/c/#foo" } + it "should be able to extract with queries" do + expect(template.extract(uri)).to eq({ + "host" => "example.com", + "segments" => %w(a b c), + "one" => "1", + "bogus" => nil, + "two" => "2", + "fragment" => "foo" + }) + end + it "should be able to extract without queries" do + expect(template.extract(uri2)).to eq({ + "host" => "example.com", + "segments" => %w(a b c), + "one" => nil, + "bogus" => nil, + "two" => nil, + "fragment" => "foo" + }) + end + + context "issue #137" do + subject { Addressable::Template.new('/path{?page,per_page}') } + + it "can match empty" do + data = subject.extract("/path") + expect(data["page"]).to eq(nil) + expect(data["per_page"]).to eq(nil) + expect(data.keys.sort).to eq(['page', 'per_page']) + end + + it "can match first var" do + data = subject.extract("/path?page=1") + expect(data["page"]).to eq("1") + expect(data["per_page"]).to eq(nil) + expect(data.keys.sort).to eq(['page', 'per_page']) + end + + it "can match second var" do + data = subject.extract("/path?per_page=1") + expect(data["page"]).to eq(nil) + expect(data["per_page"]).to eq("1") + expect(data.keys.sort).to eq(['page', 'per_page']) + end + + it "can match both vars" do + data = subject.extract("/path?page=2&per_page=1") + expect(data["page"]).to eq("2") + expect(data["per_page"]).to eq("1") + expect(data.keys.sort).to eq(['page', 'per_page']) + end + end + end + + describe "Partial expand with symbols" do + context "partial_expand with two simple values" do + subject { + Addressable::Template.new("http://example.com/{one}/{two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand(:one => "1").pattern).to eq( + "http://example.com/1/{two}/" + ) + end + end + context "partial_expand query with missing param in middle" do + subject { + Addressable::Template.new("http://example.com/{?one,two,three}/") + } + it "builds a new pattern" do + expect(subject.partial_expand(:one => "1", :three => "3").pattern).to eq( + "http://example.com/?one=1{&two}&three=3/" + ) + end + end + context "partial_expand form style query with missing param at beginning" do + subject { + Addressable::Template.new("http://example.com/{?one,two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand(:two => "2").pattern).to eq( + "http://example.com/?two=2{&one}/" + ) + end + end + context "issue #307 - partial_expand form query with nil params" do + subject do + Addressable::Template.new("http://example.com/{?one,two,three}/") + end + it "builds a new pattern with two=nil" do + expect(subject.partial_expand(two: nil).pattern).to eq( + "http://example.com/{?one}{&three}/" + ) + end + it "builds a new pattern with one=nil and two=nil" do + expect(subject.partial_expand(one: nil, two: nil).pattern).to eq( + "http://example.com/{?three}/" + ) + end + it "builds a new pattern with one=1 and two=nil" do + expect(subject.partial_expand(one: 1, two: nil).pattern).to eq( + "http://example.com/?one=1{&three}/" + ) + end + it "builds a new pattern with one=nil and two=2" do + expect(subject.partial_expand(one: nil, two: 2).pattern).to eq( + "http://example.com/?two=2{&three}/" + ) + end + it "builds a new pattern with one=nil" do + expect(subject.partial_expand(one: nil).pattern).to eq( + "http://example.com/{?two}{&three}/" + ) + end + end + context "partial_expand with query string" do + subject { + Addressable::Template.new("http://example.com/{?two,one}/") + } + it "builds a new pattern" do + expect(subject.partial_expand(:one => "1").pattern).to eq( + "http://example.com/?one=1{&two}/" + ) + end + end + context "partial_expand with path operator" do + subject { + Addressable::Template.new("http://example.com{/one,two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand(:one => "1").pattern).to eq( + "http://example.com/1{/two}/" + ) + end + end + context "partial expand with unicode values" do + subject do + Addressable::Template.new("http://example.com/{resource}/{query}/") + end + it "normalizes unicode by default" do + template = subject.partial_expand("query" => "Cafe\u0301") + expect(template.pattern).to eq( + "http://example.com/{resource}/Caf%C3%A9/" + ) + end + + it "does not normalize unicode when byte semantics requested" do + template = subject.partial_expand({"query" => "Cafe\u0301"}, nil, false) + expect(template.pattern).to eq( + "http://example.com/{resource}/Cafe%CC%81/" + ) + end + end + end + describe "Partial expand with strings" do + context "partial_expand with two simple values" do + subject { + Addressable::Template.new("http://example.com/{one}/{two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1").pattern).to eq( + "http://example.com/1/{two}/" + ) + end + end + context "partial_expand query with missing param in middle" do + subject { + Addressable::Template.new("http://example.com/{?one,two,three}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1", "three" => "3").pattern).to eq( + "http://example.com/?one=1{&two}&three=3/" + ) + end + end + context "partial_expand with query string" do + subject { + Addressable::Template.new("http://example.com/{?two,one}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1").pattern).to eq( + "http://example.com/?one=1{&two}/" + ) + end + end + context "partial_expand with path operator" do + subject { + Addressable::Template.new("http://example.com{/one,two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1").pattern).to eq( + "http://example.com/1{/two}/" + ) + end + end + end + describe "Expand" do + context "expand with unicode values" do + subject do + Addressable::Template.new("http://example.com/search/{query}/") + end + it "normalizes unicode by default" do + uri = subject.expand("query" => "Cafe\u0301").to_str + expect(uri).to eq("http://example.com/search/Caf%C3%A9/") + end + + it "does not normalize unicode when byte semantics requested" do + uri = subject.expand({ "query" => "Cafe\u0301" }, nil, false).to_str + expect(uri).to eq("http://example.com/search/Cafe%CC%81/") + end + end + context "expand with a processor" do + subject { + Addressable::Template.new("http://example.com/search/{query}/") + } + it "processes spaces" do + expect(subject.expand({"query" => "an example search query"}, + ExampleTwoProcessor).to_str).to eq( + "http://example.com/search/an+example+search+query/" + ) + end + it "validates" do + expect{ + subject.expand({"query" => "Bogus!"}, + ExampleTwoProcessor).to_str + }.to raise_error(Addressable::Template::InvalidTemplateValueError) + end + end + context "partial_expand query with missing param in middle" do + subject { + Addressable::Template.new("http://example.com/{?one,two,three}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1", "three" => "3").pattern).to eq( + "http://example.com/?one=1{&two}&three=3/" + ) + end + end + context "partial_expand with query string" do + subject { + Addressable::Template.new("http://example.com/{?two,one}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1").pattern).to eq( + "http://example.com/?one=1{&two}/" + ) + end + end + context "partial_expand with path operator" do + subject { + Addressable::Template.new("http://example.com{/one,two}/") + } + it "builds a new pattern" do + expect(subject.partial_expand("one" => "1").pattern).to eq( + "http://example.com/1{/two}/" + ) + end + end + end + context "Matching with operators" do + describe "Level 1:" do + subject { Addressable::Template.new("foo{foo}/{bar}baz") } + it "can match" do + data = subject.match("foofoo/bananabaz") + expect(data.mapping["foo"]).to eq("foo") + expect(data.mapping["bar"]).to eq("banana") + end + it "can fail" do + expect(subject.match("bar/foo")).to be_nil + expect(subject.match("foobaz")).to be_nil + end + it "can match empty" do + data = subject.match("foo/baz") + expect(data.mapping["foo"]).to eq(nil) + expect(data.mapping["bar"]).to eq(nil) + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + + describe "Level 2:" do + subject { Addressable::Template.new("foo{+foo}{#bar}baz") } + it "can match" do + data = subject.match("foo/test/banana#bazbaz") + expect(data.mapping["foo"]).to eq("/test/banana") + expect(data.mapping["bar"]).to eq("baz") + end + it "can match empty level 2 #" do + data = subject.match("foo/test/bananabaz") + expect(data.mapping["foo"]).to eq("/test/banana") + expect(data.mapping["bar"]).to eq(nil) + data = subject.match("foo/test/banana#baz") + expect(data.mapping["foo"]).to eq("/test/banana") + expect(data.mapping["bar"]).to eq("") + end + it "can match empty level 2 +" do + data = subject.match("foobaz") + expect(data.mapping["foo"]).to eq(nil) + expect(data.mapping["bar"]).to eq(nil) + data = subject.match("foo#barbaz") + expect(data.mapping["foo"]).to eq(nil) + expect(data.mapping["bar"]).to eq("bar") + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + + describe "Level 3:" do + context "no operator" do + subject { Addressable::Template.new("foo{foo,bar}baz") } + it "can match" do + data = subject.match("foofoo,barbaz") + expect(data.mapping["foo"]).to eq("foo") + expect(data.mapping["bar"]).to eq("bar") + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + context "+ operator" do + subject { Addressable::Template.new("foo{+foo,bar}baz") } + it "can match" do + data = subject.match("foofoo/bar,barbaz") + expect(data.mapping["bar"]).to eq("foo/bar,bar") + expect(data.mapping["foo"]).to eq("") + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + context ". operator" do + subject { Addressable::Template.new("foo{.foo,bar}baz") } + it "can match" do + data = subject.match("foo.foo.barbaz") + expect(data.mapping["foo"]).to eq("foo") + expect(data.mapping["bar"]).to eq("bar") + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + context "/ operator" do + subject { Addressable::Template.new("foo{/foo,bar}baz") } + it "can match" do + data = subject.match("foo/foo/barbaz") + expect(data.mapping["foo"]).to eq("foo") + expect(data.mapping["bar"]).to eq("bar") + end + it "lists vars" do + expect(subject.variables).to eq(["foo", "bar"]) + end + end + context "; operator" do + subject { Addressable::Template.new("foo{;foo,bar,baz}baz") } + it "can match" do + data = subject.match("foo;foo=bar%20baz;bar=foo;bazbaz") + expect(data.mapping["foo"]).to eq("bar baz") + expect(data.mapping["bar"]).to eq("foo") + expect(data.mapping["baz"]).to eq("") + end + it "lists vars" do + expect(subject.variables).to eq(%w(foo bar baz)) + end + end + context "? operator" do + context "test" do + subject { Addressable::Template.new("foo{?foo,bar}baz") } + it "can match" do + data = subject.match("foo?foo=bar%20baz&bar=foobaz") + expect(data.mapping["foo"]).to eq("bar baz") + expect(data.mapping["bar"]).to eq("foo") + end + it "lists vars" do + expect(subject.variables).to eq(%w(foo bar)) + end + end + + context "issue #137" do + subject { Addressable::Template.new('/path{?page,per_page}') } + + it "can match empty" do + data = subject.match("/path") + expect(data.mapping["page"]).to eq(nil) + expect(data.mapping["per_page"]).to eq(nil) + expect(data.mapping.keys.sort).to eq(['page', 'per_page']) + end + + it "can match first var" do + data = subject.match("/path?page=1") + expect(data.mapping["page"]).to eq("1") + expect(data.mapping["per_page"]).to eq(nil) + expect(data.mapping.keys.sort).to eq(['page', 'per_page']) + end + + it "can match second var" do + data = subject.match("/path?per_page=1") + expect(data.mapping["page"]).to eq(nil) + expect(data.mapping["per_page"]).to eq("1") + expect(data.mapping.keys.sort).to eq(['page', 'per_page']) + end + + it "can match both vars" do + data = subject.match("/path?page=2&per_page=1") + expect(data.mapping["page"]).to eq("2") + expect(data.mapping["per_page"]).to eq("1") + expect(data.mapping.keys.sort).to eq(['page', 'per_page']) + end + end + + context "issue #71" do + subject { Addressable::Template.new("http://cyberscore.dev/api/users{?username}") } + it "can match" do + data = subject.match("http://cyberscore.dev/api/users?username=foobaz") + expect(data.mapping["username"]).to eq("foobaz") + end + it "lists vars" do + expect(subject.variables).to eq(%w(username)) + expect(subject.keys).to eq(%w(username)) + end + end + end + context "& operator" do + subject { Addressable::Template.new("foo{&foo,bar}baz") } + it "can match" do + data = subject.match("foo&foo=bar%20baz&bar=foobaz") + expect(data.mapping["foo"]).to eq("bar baz") + expect(data.mapping["bar"]).to eq("foo") + end + it "lists vars" do + expect(subject.variables).to eq(%w(foo bar)) + end + end + end + end + + context "support regexes:" do + context "EXPRESSION" do + subject { Addressable::Template::EXPRESSION } + it "should be able to match an expression" do + expect(subject).to match("{foo}") + expect(subject).to match("{foo,9}") + expect(subject).to match("{foo.bar,baz}") + expect(subject).to match("{+foo.bar,baz}") + expect(subject).to match("{foo,foo%20bar}") + expect(subject).to match("{#foo:20,baz*}") + expect(subject).to match("stuff{#foo:20,baz*}things") + end + it "should fail on non vars" do + expect(subject).not_to match("!{foo") + expect(subject).not_to match("{foo.bar.}") + expect(subject).not_to match("!{}") + end + end + context "VARNAME" do + subject { Addressable::Template::VARNAME } + it "should be able to match a variable" do + expect(subject).to match("foo") + expect(subject).to match("9") + expect(subject).to match("foo.bar") + expect(subject).to match("foo_bar") + expect(subject).to match("foo_bar.baz") + expect(subject).to match("foo%20bar") + expect(subject).to match("foo%20bar.baz") + end + it "should fail on non vars" do + expect(subject).not_to match("!foo") + expect(subject).not_to match("foo.bar.") + expect(subject).not_to match("foo%2%00bar") + expect(subject).not_to match("foo_ba%r") + expect(subject).not_to match("foo_bar*") + expect(subject).not_to match("foo_bar:20") + end + + it 'should parse in a reasonable time' do + expect do + Timeout.timeout(0.1) do + expect(subject).not_to match("0"*25 + "!") + end + end.not_to raise_error + end + end + context "VARIABLE_LIST" do + subject { Addressable::Template::VARIABLE_LIST } + it "should be able to match a variable list" do + expect(subject).to match("foo,bar") + expect(subject).to match("foo") + expect(subject).to match("foo,bar*,baz") + expect(subject).to match("foo.bar,bar_baz*,baz:12") + end + it "should fail on non vars" do + expect(subject).not_to match(",foo,bar*,baz") + expect(subject).not_to match("foo,*bar,baz") + expect(subject).not_to match("foo,,bar*,baz") + end + end + context "VARSPEC" do + subject { Addressable::Template::VARSPEC } + it "should be able to match a variable with modifier" do + expect(subject).to match("9:8") + expect(subject).to match("foo.bar*") + expect(subject).to match("foo_bar:12") + expect(subject).to match("foo_bar.baz*") + expect(subject).to match("foo%20bar:12") + expect(subject).to match("foo%20bar.baz*") + end + it "should fail on non vars" do + expect(subject).not_to match("!foo") + expect(subject).not_to match("*foo") + expect(subject).not_to match("fo*o") + expect(subject).not_to match("fo:o") + expect(subject).not_to match("foo:") + end + end + end +end + +describe Addressable::Template::MatchData do + let(:template) { Addressable::Template.new('{foo}/{bar}') } + subject(:its) { template.match('ab/cd') } + its(:uri) { should == Addressable::URI.parse('ab/cd') } + its(:template) { should == template } + its(:mapping) { should == { 'foo' => 'ab', 'bar' => 'cd' } } + its(:variables) { should == ['foo', 'bar'] } + its(:keys) { should == ['foo', 'bar'] } + its(:names) { should == ['foo', 'bar'] } + its(:values) { should == ['ab', 'cd'] } + its(:captures) { should == ['ab', 'cd'] } + its(:to_a) { should == ['ab/cd', 'ab', 'cd'] } + its(:to_s) { should == 'ab/cd' } + its(:string) { should == its.to_s } + its(:pre_match) { should == "" } + its(:post_match) { should == "" } + + describe 'values_at' do + it 'returns an array with the values' do + expect(its.values_at(0, 2)).to eq(['ab/cd', 'cd']) + end + it 'allows mixing integer an string keys' do + expect(its.values_at('foo', 1)).to eq(['ab', 'ab']) + end + it 'accepts unknown keys' do + expect(its.values_at('baz', 'foo')).to eq([nil, 'ab']) + end + end + + describe '[]' do + context 'string key' do + it 'returns the corresponding capture' do + expect(its['foo']).to eq('ab') + expect(its['bar']).to eq('cd') + end + it 'returns nil for unknown keys' do + expect(its['baz']).to be_nil + end + end + context 'symbol key' do + it 'returns the corresponding capture' do + expect(its[:foo]).to eq('ab') + expect(its[:bar]).to eq('cd') + end + it 'returns nil for unknown keys' do + expect(its[:baz]).to be_nil + end + end + context 'integer key' do + it 'returns the full URI for index 0' do + expect(its[0]).to eq('ab/cd') + end + it 'returns the corresponding capture' do + expect(its[1]).to eq('ab') + expect(its[2]).to eq('cd') + end + it 'returns nil for unknown keys' do + expect(its[3]).to be_nil + end + end + context 'other key' do + it 'raises an exception' do + expect { its[Object.new] }.to raise_error(TypeError) + end + end + context 'with length' do + it 'returns an array starting at index with given length' do + expect(its[0, 2]).to eq(['ab/cd', 'ab']) + expect(its[2, 1]).to eq(['cd']) + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/uri_spec.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/uri_spec.rb new file mode 100644 index 0000000..00baaac --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/addressable/uri_spec.rb @@ -0,0 +1,6665 @@ +# frozen_string_literal: true + +# coding: utf-8 +# Copyright (C) Bob Aman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +require "spec_helper" + +require "addressable/uri" +require "uri" +require "ipaddr" + +if !"".respond_to?("force_encoding") + class String + def force_encoding(encoding) + @encoding = encoding + end + + def encoding + @encoding ||= Encoding::ASCII_8BIT + end + end + + class Encoding + def initialize(name) + @name = name + end + + def to_s + return @name + end + + UTF_8 = Encoding.new("UTF-8") + ASCII_8BIT = Encoding.new("US-ASCII") + end +end + +module Fake + module URI + class HTTP + def initialize(uri) + @uri = uri + end + + def to_s + return @uri.to_s + end + + alias :to_str :to_s + end + end +end + +describe Addressable::URI, "when created with a non-numeric port number" do + it "should raise an error" do + expect do + Addressable::URI.new(:port => "bogus") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with a invalid encoded port number" do + it "should raise an error" do + expect do + Addressable::URI.new(:port => "%eb") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with a non-string scheme" do + it "should raise an error" do + expect do + Addressable::URI.new(:scheme => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string user" do + it "should raise an error" do + expect do + Addressable::URI.new(:user => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string password" do + it "should raise an error" do + expect do + Addressable::URI.new(:password => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string userinfo" do + it "should raise an error" do + expect do + Addressable::URI.new(:userinfo => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string host" do + it "should raise an error" do + expect do + Addressable::URI.new(:host => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string authority" do + it "should raise an error" do + expect do + Addressable::URI.new(:authority => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string path" do + it "should raise an error" do + expect do + Addressable::URI.new(:path => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string query" do + it "should raise an error" do + expect do + Addressable::URI.new(:query => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a non-string fragment" do + it "should raise an error" do + expect do + Addressable::URI.new(:fragment => :bogus) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when created with a scheme but no hierarchical " + + "segment" do + it "should raise an error" do + expect do + Addressable::URI.parse("http:") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "quote handling" do + describe 'in host name' do + it "should raise an error for single quote" do + expect do + Addressable::URI.parse("http://local\"host/") + end.to raise_error(Addressable::URI::InvalidURIError) + end + end +end + +describe Addressable::URI, "newline normalization" do + it "should not accept newlines in scheme" do + expect do + Addressable::URI.parse("ht%0atp://localhost/") + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should not unescape newline in path" do + uri = Addressable::URI.parse("http://localhost/%0a").normalize + expect(uri.to_s).to eq("http://localhost/%0A") + end + + it "should not unescape newline in hostname" do + uri = Addressable::URI.parse("http://local%0ahost/").normalize + expect(uri.to_s).to eq("http://local%0Ahost/") + end + + it "should not unescape newline in username" do + uri = Addressable::URI.parse("http://foo%0abar@localhost/").normalize + expect(uri.to_s).to eq("http://foo%0Abar@localhost/") + end + + it "should not unescape newline in username" do + uri = Addressable::URI.parse("http://example:foo%0abar@example/").normalize + expect(uri.to_s).to eq("http://example:foo%0Abar@example/") + end + + it "should not accept newline in hostname" do + uri = Addressable::URI.parse("http://localhost/") + expect do + uri.host = "local\nhost" + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with ambiguous path" do + it "should raise an error" do + expect do + Addressable::URI.parse("::http") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with an invalid host" do + it "should raise an error" do + expect do + Addressable::URI.new(:host => "") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with a host consisting of " + + "sub-delims characters" do + it "should not raise an error" do + expect do + Addressable::URI.new( + :host => Addressable::URI::CharacterClasses::SUB_DELIMS.gsub(/\\/, '') + ) + end.not_to raise_error + end +end + +describe Addressable::URI, "when created with a host consisting of " + + "unreserved characters" do + it "should not raise an error" do + expect do + Addressable::URI.new( + :host => Addressable::URI::CharacterClasses::UNRESERVED.gsub(/\\/, '') + ) + end.not_to raise_error + end +end + +describe Addressable::URI, "when created from nil components" do + before do + @uri = Addressable::URI.new + end + + it "should have a nil site value" do + expect(@uri.site).to eq(nil) + end + + it "should have an empty path" do + expect(@uri.path).to eq("") + end + + it "should be an empty uri" do + expect(@uri.to_s).to eq("") + end + + it "should have a nil default port" do + expect(@uri.default_port).to eq(nil) + end + + it "should be empty" do + expect(@uri).to be_empty + end + + it "should raise an error if the scheme is set to whitespace" do + expect do + @uri.scheme = "\t \n" + end.to raise_error(Addressable::URI::InvalidURIError, /'\t \n'/) + end + + it "should raise an error if the scheme is set to all digits" do + expect do + @uri.scheme = "123" + end.to raise_error(Addressable::URI::InvalidURIError, /'123'/) + end + + it "should raise an error if the scheme begins with a digit" do + expect do + @uri.scheme = "1scheme" + end.to raise_error(Addressable::URI::InvalidURIError, /'1scheme'/) + end + + it "should raise an error if the scheme begins with a plus" do + expect do + @uri.scheme = "+scheme" + end.to raise_error(Addressable::URI::InvalidURIError, /'\+scheme'/) + end + + it "should raise an error if the scheme begins with a dot" do + expect do + @uri.scheme = ".scheme" + end.to raise_error(Addressable::URI::InvalidURIError, /'\.scheme'/) + end + + it "should raise an error if the scheme begins with a dash" do + expect do + @uri.scheme = "-scheme" + end.to raise_error(Addressable::URI::InvalidURIError, /'-scheme'/) + end + + it "should raise an error if the scheme contains an illegal character" do + expect do + @uri.scheme = "scheme!" + end.to raise_error(Addressable::URI::InvalidURIError, /'scheme!'/) + end + + it "should raise an error if the scheme contains whitespace" do + expect do + @uri.scheme = "sch eme" + end.to raise_error(Addressable::URI::InvalidURIError, /'sch eme'/) + end + + it "should raise an error if the scheme contains a newline" do + expect do + @uri.scheme = "sch\neme" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should raise an error if set into an invalid state" do + expect do + @uri.user = "user" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should raise an error if set into an invalid state" do + expect do + @uri.password = "pass" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should raise an error if set into an invalid state" do + expect do + @uri.scheme = "http" + @uri.fragment = "fragment" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should raise an error if set into an invalid state" do + expect do + @uri.fragment = "fragment" + @uri.scheme = "http" + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when initialized from individual components" do + before do + @uri = Addressable::URI.new( + :scheme => "http", + :user => "user", + :password => "password", + :host => "example.com", + :port => 8080, + :path => "/path", + :query => "query=value", + :fragment => "fragment" + ) + end + + it "returns 'http' for #scheme" do + expect(@uri.scheme).to eq("http") + end + + it "returns 'http' for #normalized_scheme" do + expect(@uri.normalized_scheme).to eq("http") + end + + it "returns 'user' for #user" do + expect(@uri.user).to eq("user") + end + + it "returns 'user' for #normalized_user" do + expect(@uri.normalized_user).to eq("user") + end + + it "returns 'password' for #password" do + expect(@uri.password).to eq("password") + end + + it "returns 'password' for #normalized_password" do + expect(@uri.normalized_password).to eq("password") + end + + it "returns 'user:password' for #userinfo" do + expect(@uri.userinfo).to eq("user:password") + end + + it "returns 'user:password' for #normalized_userinfo" do + expect(@uri.normalized_userinfo).to eq("user:password") + end + + it "returns 'example.com' for #host" do + expect(@uri.host).to eq("example.com") + end + + it "returns 'example.com' for #normalized_host" do + expect(@uri.normalized_host).to eq("example.com") + end + + it "returns 'com' for #tld" do + expect(@uri.tld).to eq("com") + end + + it "returns 'user:password@example.com:8080' for #authority" do + expect(@uri.authority).to eq("user:password@example.com:8080") + end + + it "returns 'user:password@example.com:8080' for #normalized_authority" do + expect(@uri.normalized_authority).to eq("user:password@example.com:8080") + end + + it "returns 8080 for #port" do + expect(@uri.port).to eq(8080) + end + + it "returns 8080 for #normalized_port" do + expect(@uri.normalized_port).to eq(8080) + end + + it "returns 80 for #default_port" do + expect(@uri.default_port).to eq(80) + end + + it "returns 'http://user:password@example.com:8080' for #site" do + expect(@uri.site).to eq("http://user:password@example.com:8080") + end + + it "returns 'http://user:password@example.com:8080' for #normalized_site" do + expect(@uri.normalized_site).to eq("http://user:password@example.com:8080") + end + + it "returns '/path' for #path" do + expect(@uri.path).to eq("/path") + end + + it "returns '/path' for #normalized_path" do + expect(@uri.normalized_path).to eq("/path") + end + + it "returns 'query=value' for #query" do + expect(@uri.query).to eq("query=value") + end + + it "returns 'query=value' for #normalized_query" do + expect(@uri.normalized_query).to eq("query=value") + end + + it "returns 'fragment' for #fragment" do + expect(@uri.fragment).to eq("fragment") + end + + it "returns 'fragment' for #normalized_fragment" do + expect(@uri.normalized_fragment).to eq("fragment") + end + + it "returns #hash" do + expect(@uri.hash).not_to be nil + end + + it "returns #to_s" do + expect(@uri.to_s).to eq( + "http://user:password@example.com:8080/path?query=value#fragment" + ) + end + + it "should not be empty" do + expect(@uri).not_to be_empty + end + + it "should not be frozen" do + expect(@uri).not_to be_frozen + end + + it "should allow destructive operations" do + expect { @uri.normalize! }.not_to raise_error + end +end + +describe Addressable::URI, "when initialized from " + + "frozen individual components" do + before do + @uri = Addressable::URI.new( + :scheme => "http".freeze, + :user => "user".freeze, + :password => "password".freeze, + :host => "example.com".freeze, + :port => "8080".freeze, + :path => "/path".freeze, + :query => "query=value".freeze, + :fragment => "fragment".freeze + ) + end + + it "returns 'http' for #scheme" do + expect(@uri.scheme).to eq("http") + end + + it "returns 'http' for #normalized_scheme" do + expect(@uri.normalized_scheme).to eq("http") + end + + it "returns 'user' for #user" do + expect(@uri.user).to eq("user") + end + + it "returns 'user' for #normalized_user" do + expect(@uri.normalized_user).to eq("user") + end + + it "returns 'password' for #password" do + expect(@uri.password).to eq("password") + end + + it "returns 'password' for #normalized_password" do + expect(@uri.normalized_password).to eq("password") + end + + it "returns 'user:password' for #userinfo" do + expect(@uri.userinfo).to eq("user:password") + end + + it "returns 'user:password' for #normalized_userinfo" do + expect(@uri.normalized_userinfo).to eq("user:password") + end + + it "returns 'example.com' for #host" do + expect(@uri.host).to eq("example.com") + end + + it "returns 'example.com' for #normalized_host" do + expect(@uri.normalized_host).to eq("example.com") + end + + it "returns 'user:password@example.com:8080' for #authority" do + expect(@uri.authority).to eq("user:password@example.com:8080") + end + + it "returns 'user:password@example.com:8080' for #normalized_authority" do + expect(@uri.normalized_authority).to eq("user:password@example.com:8080") + end + + it "returns 8080 for #port" do + expect(@uri.port).to eq(8080) + end + + it "returns 8080 for #normalized_port" do + expect(@uri.normalized_port).to eq(8080) + end + + it "returns 80 for #default_port" do + expect(@uri.default_port).to eq(80) + end + + it "returns 'http://user:password@example.com:8080' for #site" do + expect(@uri.site).to eq("http://user:password@example.com:8080") + end + + it "returns 'http://user:password@example.com:8080' for #normalized_site" do + expect(@uri.normalized_site).to eq("http://user:password@example.com:8080") + end + + it "returns '/path' for #path" do + expect(@uri.path).to eq("/path") + end + + it "returns '/path' for #normalized_path" do + expect(@uri.normalized_path).to eq("/path") + end + + it "returns 'query=value' for #query" do + expect(@uri.query).to eq("query=value") + end + + it "returns 'query=value' for #normalized_query" do + expect(@uri.normalized_query).to eq("query=value") + end + + it "returns 'fragment' for #fragment" do + expect(@uri.fragment).to eq("fragment") + end + + it "returns 'fragment' for #normalized_fragment" do + expect(@uri.normalized_fragment).to eq("fragment") + end + + it "returns #hash" do + expect(@uri.hash).not_to be nil + end + + it "returns #to_s" do + expect(@uri.to_s).to eq( + "http://user:password@example.com:8080/path?query=value#fragment" + ) + end + + it "should not be empty" do + expect(@uri).not_to be_empty + end + + it "should not be frozen" do + expect(@uri).not_to be_frozen + end + + it "should allow destructive operations" do + expect { @uri.normalize! }.not_to raise_error + end +end + +describe Addressable::URI, "when parsed from a frozen string" do + before do + @uri = Addressable::URI.parse( + "http://user:password@example.com:8080/path?query=value#fragment".freeze + ) + end + + it "returns 'http' for #scheme" do + expect(@uri.scheme).to eq("http") + end + + it "returns 'http' for #normalized_scheme" do + expect(@uri.normalized_scheme).to eq("http") + end + + it "returns 'user' for #user" do + expect(@uri.user).to eq("user") + end + + it "returns 'user' for #normalized_user" do + expect(@uri.normalized_user).to eq("user") + end + + it "returns 'password' for #password" do + expect(@uri.password).to eq("password") + end + + it "returns 'password' for #normalized_password" do + expect(@uri.normalized_password).to eq("password") + end + + it "returns 'user:password' for #userinfo" do + expect(@uri.userinfo).to eq("user:password") + end + + it "returns 'user:password' for #normalized_userinfo" do + expect(@uri.normalized_userinfo).to eq("user:password") + end + + it "returns 'example.com' for #host" do + expect(@uri.host).to eq("example.com") + end + + it "returns 'example.com' for #normalized_host" do + expect(@uri.normalized_host).to eq("example.com") + end + + it "returns 'user:password@example.com:8080' for #authority" do + expect(@uri.authority).to eq("user:password@example.com:8080") + end + + it "returns 'user:password@example.com:8080' for #normalized_authority" do + expect(@uri.normalized_authority).to eq("user:password@example.com:8080") + end + + it "returns 8080 for #port" do + expect(@uri.port).to eq(8080) + end + + it "returns 8080 for #normalized_port" do + expect(@uri.normalized_port).to eq(8080) + end + + it "returns 80 for #default_port" do + expect(@uri.default_port).to eq(80) + end + + it "returns 'http://user:password@example.com:8080' for #site" do + expect(@uri.site).to eq("http://user:password@example.com:8080") + end + + it "returns 'http://user:password@example.com:8080' for #normalized_site" do + expect(@uri.normalized_site).to eq("http://user:password@example.com:8080") + end + + it "returns '/path' for #path" do + expect(@uri.path).to eq("/path") + end + + it "returns '/path' for #normalized_path" do + expect(@uri.normalized_path).to eq("/path") + end + + it "returns 'query=value' for #query" do + expect(@uri.query).to eq("query=value") + end + + it "returns 'query=value' for #normalized_query" do + expect(@uri.normalized_query).to eq("query=value") + end + + it "returns 'fragment' for #fragment" do + expect(@uri.fragment).to eq("fragment") + end + + it "returns 'fragment' for #normalized_fragment" do + expect(@uri.normalized_fragment).to eq("fragment") + end + + it "returns #hash" do + expect(@uri.hash).not_to be nil + end + + it "returns #to_s" do + expect(@uri.to_s).to eq( + "http://user:password@example.com:8080/path?query=value#fragment" + ) + end + + it "should not be empty" do + expect(@uri).not_to be_empty + end + + it "should not be frozen" do + expect(@uri).not_to be_frozen + end + + it "should allow destructive operations" do + expect { @uri.normalize! }.not_to raise_error + end +end + +describe Addressable::URI, "when frozen" do + before do + @uri = Addressable::URI.new.freeze + end + + it "returns nil for #scheme" do + expect(@uri.scheme).to eq(nil) + end + + it "returns nil for #normalized_scheme" do + expect(@uri.normalized_scheme).to eq(nil) + end + + it "returns nil for #user" do + expect(@uri.user).to eq(nil) + end + + it "returns nil for #normalized_user" do + expect(@uri.normalized_user).to eq(nil) + end + + it "returns nil for #password" do + expect(@uri.password).to eq(nil) + end + + it "returns nil for #normalized_password" do + expect(@uri.normalized_password).to eq(nil) + end + + it "returns nil for #userinfo" do + expect(@uri.userinfo).to eq(nil) + end + + it "returns nil for #normalized_userinfo" do + expect(@uri.normalized_userinfo).to eq(nil) + end + + it "returns nil for #host" do + expect(@uri.host).to eq(nil) + end + + it "returns nil for #normalized_host" do + expect(@uri.normalized_host).to eq(nil) + end + + it "returns nil for #authority" do + expect(@uri.authority).to eq(nil) + end + + it "returns nil for #normalized_authority" do + expect(@uri.normalized_authority).to eq(nil) + end + + it "returns nil for #port" do + expect(@uri.port).to eq(nil) + end + + it "returns nil for #normalized_port" do + expect(@uri.normalized_port).to eq(nil) + end + + it "returns nil for #default_port" do + expect(@uri.default_port).to eq(nil) + end + + it "returns nil for #site" do + expect(@uri.site).to eq(nil) + end + + it "returns nil for #normalized_site" do + expect(@uri.normalized_site).to eq(nil) + end + + it "returns '' for #path" do + expect(@uri.path).to eq('') + end + + it "returns '' for #normalized_path" do + expect(@uri.normalized_path).to eq('') + end + + it "returns nil for #query" do + expect(@uri.query).to eq(nil) + end + + it "returns nil for #normalized_query" do + expect(@uri.normalized_query).to eq(nil) + end + + it "returns nil for #fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "returns nil for #normalized_fragment" do + expect(@uri.normalized_fragment).to eq(nil) + end + + it "returns #hash" do + expect(@uri.hash).not_to be nil + end + + it "returns #to_s" do + expect(@uri.to_s).to eq('') + end + + it "should be empty" do + expect(@uri).to be_empty + end + + it "should be frozen" do + expect(@uri).to be_frozen + end + + it "should not be frozen after duping" do + expect(@uri.dup).not_to be_frozen + end + + it "should not allow destructive operations" do + expect { @uri.normalize! }.to raise_error { |error| + expect(error.message).to match(/can't modify frozen/) + expect(error).to satisfy { |e| RuntimeError === e || TypeError === e } + } + end +end + +describe Addressable::URI, "when frozen" do + before do + @uri = Addressable::URI.parse( + "HTTP://example.com.:%38%30/%70a%74%68?a=%31#1%323" + ).freeze + end + + it "returns 'HTTP' for #scheme" do + expect(@uri.scheme).to eq("HTTP") + end + + it "returns 'http' for #normalized_scheme" do + expect(@uri.normalized_scheme).to eq("http") + expect(@uri.normalize.scheme).to eq("http") + end + + it "returns nil for #user" do + expect(@uri.user).to eq(nil) + end + + it "returns nil for #normalized_user" do + expect(@uri.normalized_user).to eq(nil) + end + + it "returns nil for #password" do + expect(@uri.password).to eq(nil) + end + + it "returns nil for #normalized_password" do + expect(@uri.normalized_password).to eq(nil) + end + + it "returns nil for #userinfo" do + expect(@uri.userinfo).to eq(nil) + end + + it "returns nil for #normalized_userinfo" do + expect(@uri.normalized_userinfo).to eq(nil) + end + + it "returns 'example.com.' for #host" do + expect(@uri.host).to eq("example.com.") + end + + it "returns nil for #normalized_host" do + expect(@uri.normalized_host).to eq("example.com") + expect(@uri.normalize.host).to eq("example.com") + end + + it "returns 'example.com.:80' for #authority" do + expect(@uri.authority).to eq("example.com.:80") + end + + it "returns 'example.com:80' for #normalized_authority" do + expect(@uri.normalized_authority).to eq("example.com") + expect(@uri.normalize.authority).to eq("example.com") + end + + it "returns 80 for #port" do + expect(@uri.port).to eq(80) + end + + it "returns nil for #normalized_port" do + expect(@uri.normalized_port).to eq(nil) + expect(@uri.normalize.port).to eq(nil) + end + + it "returns 80 for #default_port" do + expect(@uri.default_port).to eq(80) + end + + it "returns 'HTTP://example.com.:80' for #site" do + expect(@uri.site).to eq("HTTP://example.com.:80") + end + + it "returns 'http://example.com' for #normalized_site" do + expect(@uri.normalized_site).to eq("http://example.com") + expect(@uri.normalize.site).to eq("http://example.com") + end + + it "returns '/%70a%74%68' for #path" do + expect(@uri.path).to eq("/%70a%74%68") + end + + it "returns '/path' for #normalized_path" do + expect(@uri.normalized_path).to eq("/path") + expect(@uri.normalize.path).to eq("/path") + end + + it "returns 'a=%31' for #query" do + expect(@uri.query).to eq("a=%31") + end + + it "returns 'a=1' for #normalized_query" do + expect(@uri.normalized_query).to eq("a=1") + expect(@uri.normalize.query).to eq("a=1") + end + + it "returns '/%70a%74%68?a=%31' for #request_uri" do + expect(@uri.request_uri).to eq("/%70a%74%68?a=%31") + end + + it "returns '1%323' for #fragment" do + expect(@uri.fragment).to eq("1%323") + end + + it "returns '123' for #normalized_fragment" do + expect(@uri.normalized_fragment).to eq("123") + expect(@uri.normalize.fragment).to eq("123") + end + + it "returns #hash" do + expect(@uri.hash).not_to be nil + end + + it "returns #to_s" do + expect(@uri.to_s).to eq('HTTP://example.com.:80/%70a%74%68?a=%31#1%323') + expect(@uri.normalize.to_s).to eq('http://example.com/path?a=1#123') + end + + it "should not be empty" do + expect(@uri).not_to be_empty + end + + it "should be frozen" do + expect(@uri).to be_frozen + end + + it "should not be frozen after duping" do + expect(@uri.dup).not_to be_frozen + end + + it "should not allow destructive operations" do + expect { @uri.normalize! }.to raise_error { |error| + expect(error.message).to match(/can't modify frozen/) + expect(error).to satisfy { |e| RuntimeError === e || TypeError === e } + } + end +end + +describe Addressable::URI, "when created from string components" do + before do + @uri = Addressable::URI.new( + :scheme => "http", :host => "example.com" + ) + end + + it "should have a site value of 'http://example.com'" do + expect(@uri.site).to eq("http://example.com") + end + + it "should be equal to the equivalent parsed URI" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + it "should raise an error if invalid components omitted" do + expect do + @uri.omit(:bogus) + end.to raise_error(ArgumentError) + expect do + @uri.omit(:scheme, :bogus, :path) + end.to raise_error(ArgumentError) + end +end + +describe Addressable::URI, "when created with a nil host but " + + "non-nil authority components" do + it "should raise an error" do + expect do + Addressable::URI.new(:user => "user", :password => "pass", :port => 80) + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with both an authority and a user" do + it "should raise an error" do + expect do + Addressable::URI.new( + :user => "user", :authority => "user@example.com:80" + ) + end.to raise_error(ArgumentError) + end +end + +describe Addressable::URI, "when created with an authority and no port" do + before do + @uri = Addressable::URI.new(:authority => "user@example.com") + end + + it "should not infer a port" do + expect(@uri.port).to eq(nil) + expect(@uri.default_port).to eq(nil) + expect(@uri.inferred_port).to eq(nil) + end + + it "should have a site value of '//user@example.com'" do + expect(@uri.site).to eq("//user@example.com") + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when created with a host with trailing dots" do + before do + @uri = Addressable::URI.new(:authority => "example...") + end + + it "should have a stable normalized form" do + expect(@uri.normalize.normalize.normalize.host).to eq( + @uri.normalize.host + ) + end +end + +describe Addressable::URI, "when created with a host with a backslash" do + it "should raise an error" do + expect do + Addressable::URI.new(:authority => "example\\example") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with a host with a slash" do + it "should raise an error" do + expect do + Addressable::URI.new(:authority => "example/example") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with a host with a space" do + it "should raise an error" do + expect do + Addressable::URI.new(:authority => "example example") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when created with both a userinfo and a user" do + it "should raise an error" do + expect do + Addressable::URI.new(:user => "user", :userinfo => "user:pass") + end.to raise_error(ArgumentError) + end +end + +describe Addressable::URI, "when created with a path that hasn't been " + + "prefixed with a '/' but a host specified" do + before do + @uri = Addressable::URI.new( + :scheme => "http", :host => "example.com", :path => "path" + ) + end + + it "should prefix a '/' to the path" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/path")) + end + + it "should have a site value of 'http://example.com'" do + expect(@uri.site).to eq("http://example.com") + end + + it "should have an origin of 'http://example.com" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when created with a path that hasn't been " + + "prefixed with a '/' but no host specified" do + before do + @uri = Addressable::URI.new( + :scheme => "http", :path => "path" + ) + end + + it "should not prefix a '/' to the path" do + expect(@uri).to eq(Addressable::URI.parse("http:path")) + end + + it "should have a site value of 'http:'" do + expect(@uri.site).to eq("http:") + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from an Addressable::URI object" do + it "should not have unexpected side-effects" do + original_uri = Addressable::URI.parse("http://example.com/") + new_uri = Addressable::URI.parse(original_uri) + new_uri.host = 'www.example.com' + expect(new_uri.host).to eq('www.example.com') + expect(new_uri.to_s).to eq('http://www.example.com/') + expect(original_uri.host).to eq('example.com') + expect(original_uri.to_s).to eq('http://example.com/') + end + + it "should not have unexpected side-effects" do + original_uri = Addressable::URI.parse("http://example.com/") + new_uri = Addressable::URI.heuristic_parse(original_uri) + new_uri.host = 'www.example.com' + expect(new_uri.host).to eq('www.example.com') + expect(new_uri.to_s).to eq('http://www.example.com/') + expect(original_uri.host).to eq('example.com') + expect(original_uri.to_s).to eq('http://example.com/') + end + + it "should not have unexpected side-effects" do + original_uri = Addressable::URI.parse("http://example.com/") + new_uri = Addressable::URI.parse(original_uri) + new_uri.origin = 'https://www.example.com:8080' + expect(new_uri.host).to eq('www.example.com') + expect(new_uri.to_s).to eq('https://www.example.com:8080/') + expect(original_uri.host).to eq('example.com') + expect(original_uri.to_s).to eq('http://example.com/') + end + + it "should not have unexpected side-effects" do + original_uri = Addressable::URI.parse("http://example.com/") + new_uri = Addressable::URI.heuristic_parse(original_uri) + new_uri.origin = 'https://www.example.com:8080' + expect(new_uri.host).to eq('www.example.com') + expect(new_uri.to_s).to eq('https://www.example.com:8080/') + expect(original_uri.host).to eq('example.com') + expect(original_uri.to_s).to eq('http://example.com/') + end +end + +describe Addressable::URI, "when parsed from something that looks " + + "like a URI object" do + it "should parse without error" do + uri = Addressable::URI.parse(Fake::URI::HTTP.new("http://example.com/")) + expect do + Addressable::URI.parse(uri) + end.not_to raise_error + end +end + +describe Addressable::URI, "when parsed from a standard library URI object" do + it "should parse without error" do + uri = Addressable::URI.parse(URI.parse("http://example.com/")) + expect do + Addressable::URI.parse(uri) + end.not_to raise_error + end +end + +describe Addressable::URI, "when parsed from ''" do + before do + @uri = Addressable::URI.parse("") + end + + it "should have no scheme" do + expect(@uri.scheme).to eq(nil) + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of ''" do + expect(@uri.path).to eq("") + end + + it "should have a request URI of '/'" do + expect(@uri.request_uri).to eq("/") + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'ftp://ftp.is.co.za/rfc/rfc1808.txt'" do + before do + @uri = Addressable::URI.parse("ftp://ftp.is.co.za/rfc/rfc1808.txt") + end + + it "should use the 'ftp' scheme" do + expect(@uri.scheme).to eq("ftp") + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a host of 'ftp.is.co.za'" do + expect(@uri.host).to eq("ftp.is.co.za") + end + + it "should have inferred_port of 21" do + expect(@uri.inferred_port).to eq(21) + end + + it "should have a path of '/rfc/rfc1808.txt'" do + expect(@uri.path).to eq("/rfc/rfc1808.txt") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have an origin of 'ftp://ftp.is.co.za'" do + expect(@uri.origin).to eq('ftp://ftp.is.co.za') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'http://www.ietf.org/rfc/rfc2396.txt'" do + before do + @uri = Addressable::URI.parse("http://www.ietf.org/rfc/rfc2396.txt") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a host of 'www.ietf.org'" do + expect(@uri.host).to eq("www.ietf.org") + end + + it "should have inferred_port of 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/rfc/rfc2396.txt'" do + expect(@uri.path).to eq("/rfc/rfc2396.txt") + end + + it "should have a request URI of '/rfc/rfc2396.txt'" do + expect(@uri.request_uri).to eq("/rfc/rfc2396.txt") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should correctly omit components" do + expect(@uri.omit(:scheme).to_s).to eq("//www.ietf.org/rfc/rfc2396.txt") + expect(@uri.omit(:path).to_s).to eq("http://www.ietf.org") + end + + it "should correctly omit components destructively" do + @uri.omit!(:scheme) + expect(@uri.to_s).to eq("//www.ietf.org/rfc/rfc2396.txt") + end + + it "should have an origin of 'http://www.ietf.org'" do + expect(@uri.origin).to eq('http://www.ietf.org') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'ldap://[2001:db8::7]/c=GB?objectClass?one'" do + before do + @uri = Addressable::URI.parse("ldap://[2001:db8::7]/c=GB?objectClass?one") + end + + it "should use the 'ldap' scheme" do + expect(@uri.scheme).to eq("ldap") + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a host of '[2001:db8::7]'" do + expect(@uri.host).to eq("[2001:db8::7]") + end + + it "should have inferred_port of 389" do + expect(@uri.inferred_port).to eq(389) + end + + it "should have a path of '/c=GB'" do + expect(@uri.path).to eq("/c=GB") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should not allow request URI assignment" do + expect do + @uri.request_uri = "/" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should have a query of 'objectClass?one'" do + expect(@uri.query).to eq("objectClass?one") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should correctly omit components" do + expect(@uri.omit(:scheme, :authority).to_s).to eq("/c=GB?objectClass?one") + expect(@uri.omit(:path).to_s).to eq("ldap://[2001:db8::7]?objectClass?one") + end + + it "should correctly omit components destructively" do + @uri.omit!(:scheme, :authority) + expect(@uri.to_s).to eq("/c=GB?objectClass?one") + end + + it "should raise an error if omission would create an invalid URI" do + expect do + @uri.omit(:authority, :path) + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should have an origin of 'ldap://[2001:db8::7]'" do + expect(@uri.origin).to eq('ldap://[2001:db8::7]') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'mailto:John.Doe@example.com'" do + before do + @uri = Addressable::URI.parse("mailto:John.Doe@example.com") + end + + it "should use the 'mailto' scheme" do + expect(@uri.scheme).to eq("mailto") + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should not have an inferred_port" do + expect(@uri.inferred_port).to eq(nil) + end + + it "should have a path of 'John.Doe@example.com'" do + expect(@uri.path).to eq("John.Doe@example.com") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +# Section 2 of RFC 6068 +describe Addressable::URI, "when parsed from " + + "'mailto:?to=addr1@an.example,addr2@an.example'" do + before do + @uri = Addressable::URI.parse( + "mailto:?to=addr1@an.example,addr2@an.example" + ) + end + + it "should use the 'mailto' scheme" do + expect(@uri.scheme).to eq("mailto") + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should not have an inferred_port" do + expect(@uri.inferred_port).to eq(nil) + end + + it "should have a path of ''" do + expect(@uri.path).to eq("") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should have the To: field value parameterized" do + expect(@uri.query_values(Hash)["to"]).to eq( + "addr1@an.example,addr2@an.example" + ) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'news:comp.infosystems.www.servers.unix'" do + before do + @uri = Addressable::URI.parse("news:comp.infosystems.www.servers.unix") + end + + it "should use the 'news' scheme" do + expect(@uri.scheme).to eq("news") + end + + it "should not have an inferred_port" do + expect(@uri.inferred_port).to eq(nil) + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of 'comp.infosystems.www.servers.unix'" do + expect(@uri.path).to eq("comp.infosystems.www.servers.unix") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'tel:+1-816-555-1212'" do + before do + @uri = Addressable::URI.parse("tel:+1-816-555-1212") + end + + it "should use the 'tel' scheme" do + expect(@uri.scheme).to eq("tel") + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should not have an inferred_port" do + expect(@uri.inferred_port).to eq(nil) + end + + it "should have a path of '+1-816-555-1212'" do + expect(@uri.path).to eq("+1-816-555-1212") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'telnet://192.0.2.16:80/'" do + before do + @uri = Addressable::URI.parse("telnet://192.0.2.16:80/") + end + + it "should use the 'telnet' scheme" do + expect(@uri.scheme).to eq("telnet") + end + + it "should have a host of '192.0.2.16'" do + expect(@uri.host).to eq("192.0.2.16") + end + + it "should have a port of 80" do + expect(@uri.port).to eq(80) + end + + it "should have a inferred_port of 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a default_port of 23" do + expect(@uri.default_port).to eq(23) + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a path of '/'" do + expect(@uri.path).to eq("/") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have an origin of 'telnet://192.0.2.16:80'" do + expect(@uri.origin).to eq('telnet://192.0.2.16:80') + end +end + +# Section 1.1.2 of RFC 3986 +describe Addressable::URI, "when parsed from " + + "'urn:oasis:names:specification:docbook:dtd:xml:4.1.2'" do + before do + @uri = Addressable::URI.parse( + "urn:oasis:names:specification:docbook:dtd:xml:4.1.2") + end + + it "should use the 'urn' scheme" do + expect(@uri.scheme).to eq("urn") + end + + it "should not have an inferred_port" do + expect(@uri.inferred_port).to eq(nil) + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of " + + "'oasis:names:specification:docbook:dtd:xml:4.1.2'" do + expect(@uri.path).to eq("oasis:names:specification:docbook:dtd:xml:4.1.2") + end + + it "should not have a request URI" do + expect(@uri.request_uri).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when heuristically parsed from " + + "'192.0.2.16:8000/path'" do + before do + @uri = Addressable::URI.heuristic_parse("192.0.2.16:8000/path") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a host of '192.0.2.16'" do + expect(@uri.host).to eq("192.0.2.16") + end + + it "should have a port of '8000'" do + expect(@uri.port).to eq(8000) + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a path of '/path'" do + expect(@uri.path).to eq("/path") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have an origin of 'http://192.0.2.16:8000'" do + expect(@uri.origin).to eq('http://192.0.2.16:8000') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com'" do + before do + @uri = Addressable::URI.parse("http://example.com") + end + + it "when inspected, should have the correct URI" do + expect(@uri.inspect).to include("http://example.com") + end + + it "when inspected, should have the correct class name" do + expect(@uri.inspect).to include("Addressable::URI") + end + + it "when inspected, should have the correct object id" do + expect(@uri.inspect).to include("%#0x" % @uri.object_id) + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should be considered ip-based" do + expect(@uri).to be_ip_based + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not have a specified port" do + expect(@uri.port).to eq(nil) + end + + it "should have an empty path" do + expect(@uri.path).to eq("") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + expect(@uri.query_values).to eq(nil) + end + + it "should have a request URI of '/'" do + expect(@uri.request_uri).to eq("/") + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should not be considered relative" do + expect(@uri).not_to be_relative + end + + it "should not be exactly equal to 42" do + expect(@uri.eql?(42)).to eq(false) + end + + it "should not be equal to 42" do + expect(@uri == 42).to eq(false) + end + + it "should not be roughly equal to 42" do + expect(@uri === 42).to eq(false) + end + + it "should be exactly equal to http://example.com" do + expect(@uri.eql?(Addressable::URI.parse("http://example.com"))).to eq(true) + end + + it "should be roughly equal to http://example.com/" do + expect(@uri === Addressable::URI.parse("http://example.com/")).to eq(true) + end + + it "should be roughly equal to the string 'http://example.com/'" do + expect(@uri === "http://example.com/").to eq(true) + end + + it "should not be roughly equal to the string " + + "'http://example.com:bogus/'" do + expect do + expect(@uri === "http://example.com:bogus/").to eq(false) + end.not_to raise_error + end + + it "should result in itself when joined with itself" do + expect(@uri.join(@uri).to_s).to eq("http://example.com") + expect(@uri.join!(@uri).to_s).to eq("http://example.com") + end + + it "should be equivalent to http://EXAMPLE.com" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.com")) + end + + it "should be equivalent to http://EXAMPLE.com:80/" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.com:80/")) + end + + it "should have the same hash as http://example.com" do + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com").hash) + end + + it "should have the same hash as http://EXAMPLE.com after assignment" do + @uri.origin = "http://EXAMPLE.com" + expect(@uri.hash).to eq(Addressable::URI.parse("http://EXAMPLE.com").hash) + end + + it "should have a different hash from http://EXAMPLE.com" do + expect(@uri.hash).not_to eq(Addressable::URI.parse("http://EXAMPLE.com").hash) + end + + it "should not allow origin assignment without scheme" do + expect do + @uri.origin = "example.com" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should not allow origin assignment without host" do + expect do + @uri.origin = "http://" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should not allow origin assignment with bogus type" do + expect do + @uri.origin = :bogus + end.to raise_error(TypeError) + end + + # Section 6.2.3 of RFC 3986 + it "should be equivalent to http://example.com/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/")) + end + + # Section 6.2.3 of RFC 3986 + it "should be equivalent to http://example.com:/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:/")) + end + + # Section 6.2.3 of RFC 3986 + it "should be equivalent to http://example.com:80/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:80/")) + end + + # Section 6.2.2.1 of RFC 3986 + it "should be equivalent to http://EXAMPLE.COM/" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.COM/")) + end + + it "should have a route of '/path/' to 'http://example.com/path/'" do + expect(@uri.route_to("http://example.com/path/")).to eq( + Addressable::URI.parse("/path/") + ) + end + + it "should have a route of '..' from 'http://example.com/path/'" do + expect(@uri.route_from("http://example.com/path/")).to eq( + Addressable::URI.parse("..") + ) + end + + it "should have a route of '#' to 'http://example.com/'" do + expect(@uri.route_to("http://example.com/")).to eq( + Addressable::URI.parse("#") + ) + end + + it "should have a route of 'http://elsewhere.com/' to " + + "'http://elsewhere.com/'" do + expect(@uri.route_to("http://elsewhere.com/")).to eq( + Addressable::URI.parse("http://elsewhere.com/") + ) + end + + it "when joined with 'relative/path' should be " + + "'http://example.com/relative/path'" do + expect(@uri.join('relative/path')).to eq( + Addressable::URI.parse("http://example.com/relative/path") + ) + end + + it "when joined with a bogus object a TypeError should be raised" do + expect do + @uri.join(42) + end.to raise_error(TypeError) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq(nil) + expect(@uri.to_s).to eq("http://newuser@example.com") + end + + it "should have the correct username after assignment" do + @uri.user = "user@123!" + expect(@uri.user).to eq("user@123!") + expect(@uri.normalized_user).to eq("user%40123%21") + expect(@uri.password).to eq(nil) + expect(@uri.normalize.to_s).to eq("http://user%40123%21@example.com/") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.user).to eq("") + expect(@uri.to_s).to eq("http://:newpass@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "#secret@123!" + expect(@uri.password).to eq("#secret@123!") + expect(@uri.normalized_password).to eq("%23secret%40123%21") + expect(@uri.user).to eq("") + expect(@uri.normalize.to_s).to eq("http://:%23secret%40123%21@example.com/") + expect(@uri.omit(:password).to_s).to eq("http://example.com") + end + + it "should have the correct user/pass after repeated assignment" do + @uri.user = nil + expect(@uri.user).to eq(nil) + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + # Username cannot be nil if the password is set + expect(@uri.user).to eq("") + expect(@uri.to_s).to eq("http://:newpass@example.com") + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + @uri.password = nil + expect(@uri.password).to eq(nil) + expect(@uri.to_s).to eq("http://newuser@example.com") + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + @uri.password = "" + expect(@uri.password).to eq("") + expect(@uri.to_s).to eq("http://newuser:@example.com") + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + @uri.user = nil + # Username cannot be nil if the password is set + expect(@uri.user).to eq("") + expect(@uri.to_s).to eq("http://:newpass@example.com") + end + + it "should have the correct user/pass after userinfo assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + @uri.userinfo = nil + expect(@uri.userinfo).to eq(nil) + expect(@uri.user).to eq(nil) + expect(@uri.password).to eq(nil) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => nil, + :path => "", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +# Section 5.1.2 of RFC 2616 +describe Addressable::URI, "when parsed from " + + "'HTTP://www.w3.org/pub/WWW/TheProject.html'" do + before do + @uri = Addressable::URI.parse("HTTP://www.w3.org/pub/WWW/TheProject.html") + end + + it "should have the correct request URI" do + expect(@uri.request_uri).to eq("/pub/WWW/TheProject.html") + end + + it "should have the correct request URI after assignment" do + @uri.request_uri = "/pub/WWW/TheProject.html?" + expect(@uri.request_uri).to eq("/pub/WWW/TheProject.html?") + expect(@uri.path).to eq("/pub/WWW/TheProject.html") + expect(@uri.query).to eq("") + end + + it "should have the correct request URI after assignment" do + @uri.request_uri = "/some/where/else.html" + expect(@uri.request_uri).to eq("/some/where/else.html") + expect(@uri.path).to eq("/some/where/else.html") + expect(@uri.query).to eq(nil) + end + + it "should have the correct request URI after assignment" do + @uri.request_uri = "/some/where/else.html?query?string" + expect(@uri.request_uri).to eq("/some/where/else.html?query?string") + expect(@uri.path).to eq("/some/where/else.html") + expect(@uri.query).to eq("query?string") + end + + it "should have the correct request URI after assignment" do + @uri.request_uri = "?x=y" + expect(@uri.request_uri).to eq("/?x=y") + expect(@uri.path).to eq("/") + expect(@uri.query).to eq("x=y") + end + + it "should raise an error if the site value is set to something bogus" do + expect do + @uri.site = 42 + end.to raise_error(TypeError) + end + + it "should raise an error if the request URI is set to something bogus" do + expect do + @uri.request_uri = 42 + end.to raise_error(TypeError) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "HTTP", + :user => nil, + :password => nil, + :host => "www.w3.org", + :port => nil, + :path => "/pub/WWW/TheProject.html", + :query => nil, + :fragment => nil + }) + end + + it "should have an origin of 'http://www.w3.org'" do + expect(@uri.origin).to eq('http://www.w3.org') + end +end + +describe Addressable::URI, "when parsing IPv6 addresses" do + it "should not raise an error for " + + "'http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[fe80:0:0:0:200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[fe80:0:0:0:200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[fe80::200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[fe80::200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[::1]/'" do + Addressable::URI.parse("http://[::1]/") + end + + it "should not raise an error for " + + "'http://[fe80::1]/'" do + Addressable::URI.parse("http://[fe80::1]/") + end + + it "should raise an error for " + + "'http://[]/'" do + expect do + Addressable::URI.parse("http://[]/") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when parsing IPv6 address" do + subject { Addressable::URI.parse("http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]/") } + its(:host) { should == '[3ffe:1900:4545:3:200:f8ff:fe21:67cf]' } + its(:hostname) { should == '3ffe:1900:4545:3:200:f8ff:fe21:67cf' } +end + +describe Addressable::URI, "when assigning IPv6 address" do + it "should allow to set bare IPv6 address as hostname" do + uri = Addressable::URI.parse("http://[::1]/") + uri.hostname = '3ffe:1900:4545:3:200:f8ff:fe21:67cf' + expect(uri.to_s).to eq('http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]/') + end + + it "should allow to set bare IPv6 address as hostname with IPAddr object" do + uri = Addressable::URI.parse("http://[::1]/") + uri.hostname = IPAddr.new('3ffe:1900:4545:3:200:f8ff:fe21:67cf') + expect(uri.to_s).to eq('http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]/') + end + + it "should not allow to set bare IPv6 address as host" do + uri = Addressable::URI.parse("http://[::1]/") + skip "not checked" + expect do + uri.host = '3ffe:1900:4545:3:200:f8ff:fe21:67cf' + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when parsing IPvFuture addresses" do + it "should not raise an error for " + + "'http://[v9.3ffe:1900:4545:3:200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[v9.3ffe:1900:4545:3:200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[vff.fe80:0:0:0:200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[vff.fe80:0:0:0:200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[v12.fe80::200:f8ff:fe21:67cf]/'" do + Addressable::URI.parse("http://[v12.fe80::200:f8ff:fe21:67cf]/") + end + + it "should not raise an error for " + + "'http://[va0.::1]/'" do + Addressable::URI.parse("http://[va0.::1]/") + end + + it "should not raise an error for " + + "'http://[v255.fe80::1]/'" do + Addressable::URI.parse("http://[v255.fe80::1]/") + end + + it "should raise an error for " + + "'http://[v0.]/'" do + expect do + Addressable::URI.parse("http://[v0.]/") + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/'" do + before do + @uri = Addressable::URI.parse("http://example.com/") + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://example.com" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to HTTP://example.com/" do + expect(@uri).to eq(Addressable::URI.parse("HTTP://example.com/")) + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://example.com:/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:/")) + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://example.com:80/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:80/")) + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://Example.com/" do + expect(@uri).to eq(Addressable::URI.parse("http://Example.com/")) + end + + it "should have the correct username after assignment" do + @uri.user = nil + expect(@uri.user).to eq(nil) + expect(@uri.password).to eq(nil) + expect(@uri.to_s).to eq("http://example.com/") + end + + it "should have the correct password after assignment" do + @uri.password = nil + expect(@uri.password).to eq(nil) + expect(@uri.user).to eq(nil) + expect(@uri.to_s).to eq("http://example.com/") + end + + it "should have a request URI of '/'" do + expect(@uri.request_uri).to eq("/") + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => nil, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have the same hash as its duplicate" do + expect(@uri.hash).to eq(@uri.dup.hash) + end + + it "should have a different hash from its equivalent String value" do + expect(@uri.hash).not_to eq(@uri.to_s.hash) + end + + it "should have the same hash as an equal URI" do + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com/").hash) + end + + it "should be equivalent to http://EXAMPLE.com" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.com")) + end + + it "should be equivalent to http://EXAMPLE.com:80/" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.com:80/")) + end + + it "should have the same hash as http://example.com/" do + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com/").hash) + end + + it "should have the same hash as http://example.com after assignment" do + @uri.path = "" + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com").hash) + end + + it "should have the same hash as http://example.com/? after assignment" do + @uri.query = "" + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com/?").hash) + end + + it "should have the same hash as http://example.com/? after assignment" do + @uri.query_values = {} + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com/?").hash) + end + + it "should have the same hash as http://example.com/# after assignment" do + @uri.fragment = "" + expect(@uri.hash).to eq(Addressable::URI.parse("http://example.com/#").hash) + end + + it "should have a different hash from http://example.com" do + expect(@uri.hash).not_to eq(Addressable::URI.parse("http://example.com").hash) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com?#'" do + before do + @uri = Addressable::URI.parse("http://example.com?#") + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => nil, + :path => "", + :query => "", + :fragment => "" + }) + end + + it "should have a request URI of '/?'" do + expect(@uri.request_uri).to eq("/?") + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq("http://example.com") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://@example.com/'" do + before do + @uri = Addressable::URI.parse("http://@example.com/") + end + + it "should be equivalent to http://example.com" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => "", + :password => nil, + :host => "example.com", + :port => nil, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com./'" do + before do + @uri = Addressable::URI.parse("http://example.com./") + end + + it "should be equivalent to http://example.com" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://:@example.com/'" do + before do + @uri = Addressable::URI.parse("http://:@example.com/") + end + + it "should be equivalent to http://example.com" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => "", + :password => "", + :host => "example.com", + :port => nil, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'HTTP://EXAMPLE.COM/'" do + before do + @uri = Addressable::URI.parse("HTTP://EXAMPLE.COM/") + end + + it "should be equivalent to http://example.com" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com")) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "HTTP", + :user => nil, + :password => nil, + :host => "EXAMPLE.COM", + :port => nil, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end + + it "should have a tld of 'com'" do + expect(@uri.tld).to eq('com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.example.co.uk/'" do + before do + @uri = Addressable::URI.parse("http://www.example.co.uk/") + end + + it "should have an origin of 'http://www.example.co.uk'" do + expect(@uri.origin).to eq('http://www.example.co.uk') + end + + it "should have a tld of 'co.uk'" do + expect(@uri.tld).to eq('co.uk') + end + + it "should have a domain of 'example.co.uk'" do + expect(@uri.domain).to eq('example.co.uk') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://sub_domain.blogspot.com/'" do + before do + @uri = Addressable::URI.parse("http://sub_domain.blogspot.com/") + end + + it "should have an origin of 'http://sub_domain.blogspot.com'" do + expect(@uri.origin).to eq('http://sub_domain.blogspot.com') + end + + it "should have a tld of 'com'" do + expect(@uri.tld).to eq('com') + end + + it "should have a domain of 'blogspot.com'" do + expect(@uri.domain).to eq('blogspot.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/~smith/'" do + before do + @uri = Addressable::URI.parse("http://example.com/~smith/") + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://example.com/%7Esmith/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/%7Esmith/")) + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to http://example.com/%7esmith/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/%7esmith/")) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/%E8'" do + before do + @uri = Addressable::URI.parse("http://example.com/%E8") + end + + it "should not raise an exception when normalized" do + expect do + @uri.normalize + end.not_to raise_error + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com/%E8" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com/%E8" + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/path%2Fsegment/'" do + before do + @uri = Addressable::URI.parse("http://example.com/path%2Fsegment/") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should be equal to 'http://example.com/path%2Fsegment/'" do + expect(@uri.normalize).to be_eql( + Addressable::URI.parse("http://example.com/path%2Fsegment/") + ) + end + + it "should not be equal to 'http://example.com/path/segment/'" do + expect(@uri).not_to eq( + Addressable::URI.parse("http://example.com/path/segment/") + ) + end + + it "should not be equal to 'http://example.com/path/segment/'" do + expect(@uri.normalize).not_to be_eql( + Addressable::URI.parse("http://example.com/path/segment/") + ) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?%F6'" do + before do + @uri = Addressable::URI.parse("http://example.com/?%F6") + end + + it "should not raise an exception when normalized" do + expect do + @uri.normalize + end.not_to raise_error + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com/?%F6" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com/?%F6" + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/#%F6'" do + before do + @uri = Addressable::URI.parse("http://example.com/#%F6") + end + + it "should not raise an exception when normalized" do + expect do + @uri.normalize + end.not_to raise_error + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com/#%F6" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com/#%F6" + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/%C3%87'" do + before do + @uri = Addressable::URI.parse("http://example.com/%C3%87") + end + + # Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence + it "should be equivalent to 'http://example.com/C%CC%A7'" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/C%CC%A7")) + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com/%C3%87" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com/%C3%87" + end + + it "should raise an error if encoding with an unexpected return type" do + expect do + Addressable::URI.normalized_encode(@uri, Integer) + end.to raise_error(TypeError) + end + + it "if percent encoded should be 'http://example.com/C%25CC%25A7'" do + expect(Addressable::URI.encode(@uri).to_s).to eq( + "http://example.com/%25C3%2587" + ) + end + + it "if percent encoded should be 'http://example.com/C%25CC%25A7'" do + expect(Addressable::URI.encode(@uri, Addressable::URI)).to eq( + Addressable::URI.parse("http://example.com/%25C3%2587") + ) + end + + it "should raise an error if encoding with an unexpected return type" do + expect do + Addressable::URI.encode(@uri, Integer) + end.to raise_error(TypeError) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q=string'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q=string") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/'" do + expect(@uri.path).to eq("/") + end + + it "should have a query string of 'q=string'" do + expect(@uri.query).to eq("q=string") + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should not be considered relative" do + expect(@uri).not_to be_relative + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com:80/'" do + before do + @uri = Addressable::URI.parse("http://example.com:80/") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com:80'" do + expect(@uri.authority).to eq("example.com:80") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have explicit port 80" do + expect(@uri.port).to eq(80) + end + + it "should have a path of '/'" do + expect(@uri.path).to eq("/") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should not be considered relative" do + expect(@uri).not_to be_relative + end + + it "should be exactly equal to http://example.com:80/" do + expect(@uri.eql?(Addressable::URI.parse("http://example.com:80/"))).to eq(true) + end + + it "should be roughly equal to http://example.com/" do + expect(@uri === Addressable::URI.parse("http://example.com/")).to eq(true) + end + + it "should be roughly equal to the string 'http://example.com/'" do + expect(@uri === "http://example.com/").to eq(true) + end + + it "should not be roughly equal to the string " + + "'http://example.com:bogus/'" do + expect do + expect(@uri === "http://example.com:bogus/").to eq(false) + end.not_to raise_error + end + + it "should result in itself when joined with itself" do + expect(@uri.join(@uri).to_s).to eq("http://example.com:80/") + expect(@uri.join!(@uri).to_s).to eq("http://example.com:80/") + end + + # Section 6.2.3 of RFC 3986 + it "should be equal to http://example.com/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com/")) + end + + # Section 6.2.3 of RFC 3986 + it "should be equal to http://example.com:/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:/")) + end + + # Section 6.2.3 of RFC 3986 + it "should be equal to http://example.com:80/" do + expect(@uri).to eq(Addressable::URI.parse("http://example.com:80/")) + end + + # Section 6.2.2.1 of RFC 3986 + it "should be equal to http://EXAMPLE.COM/" do + expect(@uri).to eq(Addressable::URI.parse("http://EXAMPLE.COM/")) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => 80, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com:80/" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com:80/" + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com:8080/'" do + before do + @uri = Addressable::URI.parse("http://example.com:8080/") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com:8080'" do + expect(@uri.authority).to eq("example.com:8080") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 8080" do + expect(@uri.inferred_port).to eq(8080) + end + + it "should have explicit port 8080" do + expect(@uri.port).to eq(8080) + end + + it "should have default port 80" do + expect(@uri.default_port).to eq(80) + end + + it "should have a path of '/'" do + expect(@uri.path).to eq("/") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should not be considered relative" do + expect(@uri).not_to be_relative + end + + it "should be exactly equal to http://example.com:8080/" do + expect(@uri.eql?(Addressable::URI.parse( + "http://example.com:8080/"))).to eq(true) + end + + it "should have a route of 'http://example.com:8080/' from " + + "'http://example.com/path/to/'" do + expect(@uri.route_from("http://example.com/path/to/")).to eq( + Addressable::URI.parse("http://example.com:8080/") + ) + end + + it "should have a route of 'http://example.com:8080/' from " + + "'http://example.com:80/path/to/'" do + expect(@uri.route_from("http://example.com:80/path/to/")).to eq( + Addressable::URI.parse("http://example.com:8080/") + ) + end + + it "should have a route of '../../' from " + + "'http://example.com:8080/path/to/'" do + expect(@uri.route_from("http://example.com:8080/path/to/")).to eq( + Addressable::URI.parse("../../") + ) + end + + it "should have a route of 'http://example.com:8080/' from " + + "'http://user:pass@example.com/path/to/'" do + expect(@uri.route_from("http://user:pass@example.com/path/to/")).to eq( + Addressable::URI.parse("http://example.com:8080/") + ) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => 8080, + :path => "/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com:8080'" do + expect(@uri.origin).to eq('http://example.com:8080') + end + + it "should not change if encoded with the normalizing algorithm" do + expect(Addressable::URI.normalized_encode(@uri).to_s).to eq( + "http://example.com:8080/" + ) + expect(Addressable::URI.normalized_encode(@uri, Addressable::URI).to_s).to be === + "http://example.com:8080/" + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com:%38%30/'" do + before do + @uri = Addressable::URI.parse("http://example.com:%38%30/") + end + + it "should have the correct port" do + expect(@uri.port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/%2E/'" do + before do + @uri = Addressable::URI.parse("http://example.com/%2E/") + end + + it "should be considered to be in normal form" do + skip( + 'path segment normalization should happen before ' + + 'percent escaping normalization' + ) + @uri.normalize.should be_eql(@uri) + end + + it "should normalize to 'http://example.com/%2E/'" do + skip( + 'path segment normalization should happen before ' + + 'percent escaping normalization' + ) + expect(@uri.normalize).to eq("http://example.com/%2E/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/..'" do + before do + @uri = Addressable::URI.parse("http://example.com/..") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/../..'" do + before do + @uri = Addressable::URI.parse("http://example.com/../..") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/path(/..'" do + before do + @uri = Addressable::URI.parse("http://example.com/path(/..") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/(path)/..'" do + before do + @uri = Addressable::URI.parse("http://example.com/(path)/..") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/path(/../'" do + before do + @uri = Addressable::URI.parse("http://example.com/path(/../") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/(path)/../'" do + before do + @uri = Addressable::URI.parse("http://example.com/(path)/../") + end + + it "should have the correct port" do + expect(@uri.inferred_port).to eq(80) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'/..//example.com'" do + before do + @uri = Addressable::URI.parse("/..//example.com") + end + + it "should become invalid when normalized" do + expect do + @uri.normalize + end.to raise_error(Addressable::URI::InvalidURIError, /authority/) + end + + it "should have a path of '/..//example.com'" do + expect(@uri.path).to eq("/..//example.com") + end +end + +describe Addressable::URI, "when parsed from '/a/b/c/./../../g'" do + before do + @uri = Addressable::URI.parse("/a/b/c/./../../g") + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + # Section 5.2.4 of RFC 3986 + it "should normalize to '/a/g'" do + expect(@uri.normalize.to_s).to eq("/a/g") + end +end + +describe Addressable::URI, "when parsed from 'mid/content=5/../6'" do + before do + @uri = Addressable::URI.parse("mid/content=5/../6") + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + # Section 5.2.4 of RFC 3986 + it "should normalize to 'mid/6'" do + expect(@uri.normalize.to_s).to eq("mid/6") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.example.com///../'" do + before do + @uri = Addressable::URI.parse('http://www.example.com///../') + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end + + it "should normalize to 'http://www.example.com//'" do + expect(@uri.normalize.to_s).to eq("http://www.example.com//") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/path/to/resource/'" do + before do + @uri = Addressable::URI.parse("http://example.com/path/to/resource/") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/path/to/resource/'" do + expect(@uri.path).to eq("/path/to/resource/") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should not be considered relative" do + expect(@uri).not_to be_relative + end + + it "should be exactly equal to http://example.com:8080/" do + expect(@uri.eql?(Addressable::URI.parse( + "http://example.com/path/to/resource/"))).to eq(true) + end + + it "should have a route of 'resource/' from " + + "'http://example.com/path/to/'" do + expect(@uri.route_from("http://example.com/path/to/")).to eq( + Addressable::URI.parse("resource/") + ) + end + + it "should have a route of '../' from " + + "'http://example.com/path/to/resource/sub'" do + expect(@uri.route_from("http://example.com/path/to/resource/sub")).to eq( + Addressable::URI.parse("../") + ) + end + + + it "should have a route of 'resource/' from " + + "'http://example.com/path/to/another'" do + expect(@uri.route_from("http://example.com/path/to/another")).to eq( + Addressable::URI.parse("resource/") + ) + end + + it "should have a route of 'resource/' from " + + "'http://example.com/path/to/res'" do + expect(@uri.route_from("http://example.com/path/to/res")).to eq( + Addressable::URI.parse("resource/") + ) + end + + it "should have a route of 'resource/' from " + + "'http://example.com:80/path/to/'" do + expect(@uri.route_from("http://example.com:80/path/to/")).to eq( + Addressable::URI.parse("resource/") + ) + end + + it "should have a route of 'http://example.com/path/to/' from " + + "'http://example.com:8080/path/to/'" do + expect(@uri.route_from("http://example.com:8080/path/to/")).to eq( + Addressable::URI.parse("http://example.com/path/to/resource/") + ) + end + + it "should have a route of 'http://example.com/path/to/' from " + + "'http://user:pass@example.com/path/to/'" do + expect(@uri.route_from("http://user:pass@example.com/path/to/")).to eq( + Addressable::URI.parse("http://example.com/path/to/resource/") + ) + end + + it "should have a route of '../../path/to/resource/' from " + + "'http://example.com/to/resource/'" do + expect(@uri.route_from("http://example.com/to/resource/")).to eq( + Addressable::URI.parse("../../path/to/resource/") + ) + end + + it "should correctly convert to a hash" do + expect(@uri.to_hash).to eq({ + :scheme => "http", + :user => nil, + :password => nil, + :host => "example.com", + :port => nil, + :path => "/path/to/resource/", + :query => nil, + :fragment => nil + }) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end +end + +describe Addressable::URI, "when parsed from " + + "'relative/path/to/resource'" do + before do + @uri = Addressable::URI.parse("relative/path/to/resource") + end + + it "should not have a scheme" do + expect(@uri.scheme).to eq(nil) + end + + it "should not be considered ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should not have an authority segment" do + expect(@uri.authority).to eq(nil) + end + + it "should not have a host" do + expect(@uri.host).to eq(nil) + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should not have a port" do + expect(@uri.port).to eq(nil) + end + + it "should have a path of 'relative/path/to/resource'" do + expect(@uri.path).to eq("relative/path/to/resource") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should not be considered absolute" do + expect(@uri).not_to be_absolute + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "should raise an error if routing is attempted" do + expect do + @uri.route_to("http://example.com/") + end.to raise_error(ArgumentError, /relative\/path\/to\/resource/) + expect do + @uri.route_from("http://example.com/") + end.to raise_error(ArgumentError, /relative\/path\/to\/resource/) + end + + it "when joined with 'another/relative/path' should be " + + "'relative/path/to/another/relative/path'" do + expect(@uri.join('another/relative/path')).to eq( + Addressable::URI.parse("relative/path/to/another/relative/path") + ) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end +end + +describe Addressable::URI, "when parsed from " + + "'relative_path_with_no_slashes'" do + before do + @uri = Addressable::URI.parse("relative_path_with_no_slashes") + end + + it "should not have a scheme" do + expect(@uri.scheme).to eq(nil) + end + + it "should not be considered ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should not have an authority segment" do + expect(@uri.authority).to eq(nil) + end + + it "should not have a host" do + expect(@uri.host).to eq(nil) + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should not have a port" do + expect(@uri.port).to eq(nil) + end + + it "should have a path of 'relative_path_with_no_slashes'" do + expect(@uri.path).to eq("relative_path_with_no_slashes") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should not be considered absolute" do + expect(@uri).not_to be_absolute + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "when joined with 'another_relative_path' should be " + + "'another_relative_path'" do + expect(@uri.join('another_relative_path')).to eq( + Addressable::URI.parse("another_relative_path") + ) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/file.txt'" do + before do + @uri = Addressable::URI.parse("http://example.com/file.txt") + end + + it "should have a scheme of 'http'" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/file.txt'" do + expect(@uri.path).to eq("/file.txt") + end + + it "should have a basename of 'file.txt'" do + expect(@uri.basename).to eq("file.txt") + end + + it "should have an extname of '.txt'" do + expect(@uri.extname).to eq(".txt") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/file.txt;parameter'" do + before do + @uri = Addressable::URI.parse("http://example.com/file.txt;parameter") + end + + it "should have a scheme of 'http'" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/file.txt;parameter'" do + expect(@uri.path).to eq("/file.txt;parameter") + end + + it "should have a basename of 'file.txt'" do + expect(@uri.basename).to eq("file.txt") + end + + it "should have an extname of '.txt'" do + expect(@uri.extname).to eq(".txt") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/file.txt;x=y'" do + before do + @uri = Addressable::URI.parse("http://example.com/file.txt;x=y") + end + + it "should have a scheme of 'http'" do + expect(@uri.scheme).to eq("http") + end + + it "should have a scheme of 'http'" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'example.com'" do + expect(@uri.authority).to eq("example.com") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have no username" do + expect(@uri.user).to eq(nil) + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/file.txt;x=y'" do + expect(@uri.path).to eq("/file.txt;x=y") + end + + it "should have an extname of '.txt'" do + expect(@uri.extname).to eq(".txt") + end + + it "should have no query string" do + expect(@uri.query).to eq(nil) + end + + it "should have no fragment" do + expect(@uri.fragment).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'svn+ssh://developername@rubyforge.org/var/svn/project'" do + before do + @uri = Addressable::URI.parse( + "svn+ssh://developername@rubyforge.org/var/svn/project" + ) + end + + it "should have a scheme of 'svn+ssh'" do + expect(@uri.scheme).to eq("svn+ssh") + end + + it "should be considered to be ip-based" do + expect(@uri).to be_ip_based + end + + it "should have a path of '/var/svn/project'" do + expect(@uri.path).to eq("/var/svn/project") + end + + it "should have a username of 'developername'" do + expect(@uri.user).to eq("developername") + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'ssh+svn://developername@RUBYFORGE.ORG/var/svn/project'" do + before do + @uri = Addressable::URI.parse( + "ssh+svn://developername@RUBYFORGE.ORG/var/svn/project" + ) + end + + it "should have a scheme of 'ssh+svn'" do + expect(@uri.scheme).to eq("ssh+svn") + end + + it "should have a normalized scheme of 'svn+ssh'" do + expect(@uri.normalized_scheme).to eq("svn+ssh") + end + + it "should have a normalized site of 'svn+ssh'" do + expect(@uri.normalized_site).to eq("svn+ssh://developername@rubyforge.org") + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of '/var/svn/project'" do + expect(@uri.path).to eq("/var/svn/project") + end + + it "should have a username of 'developername'" do + expect(@uri.user).to eq("developername") + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should not be considered to be in normal form" do + expect(@uri.normalize).not_to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'mailto:user@example.com'" do + before do + @uri = Addressable::URI.parse("mailto:user@example.com") + end + + it "should have a scheme of 'mailto'" do + expect(@uri.scheme).to eq("mailto") + end + + it "should not be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of 'user@example.com'" do + expect(@uri.path).to eq("user@example.com") + end + + it "should have no user" do + expect(@uri.user).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'tag:example.com,2006-08-18:/path/to/something'" do + before do + @uri = Addressable::URI.parse( + "tag:example.com,2006-08-18:/path/to/something") + end + + it "should have a scheme of 'tag'" do + expect(@uri.scheme).to eq("tag") + end + + it "should be considered to be ip-based" do + expect(@uri).not_to be_ip_based + end + + it "should have a path of " + + "'example.com,2006-08-18:/path/to/something'" do + expect(@uri.path).to eq("example.com,2006-08-18:/path/to/something") + end + + it "should have no user" do + expect(@uri.user).to eq(nil) + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/x;y/'" do + before do + @uri = Addressable::URI.parse("http://example.com/x;y/") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?x=1&y=2'" do + before do + @uri = Addressable::URI.parse("http://example.com/?x=1&y=2") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end +end + +describe Addressable::URI, "when parsed from " + + "'view-source:http://example.com/'" do + before do + @uri = Addressable::URI.parse("view-source:http://example.com/") + end + + it "should have a scheme of 'view-source'" do + expect(@uri.scheme).to eq("view-source") + end + + it "should have a path of 'http://example.com/'" do + expect(@uri.path).to eq("http://example.com/") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://user:pass@example.com/path/to/resource?query=x#fragment'" do + before do + @uri = Addressable::URI.parse( + "http://user:pass@example.com/path/to/resource?query=x#fragment") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have an authority segment of 'user:pass@example.com'" do + expect(@uri.authority).to eq("user:pass@example.com") + end + + it "should have a username of 'user'" do + expect(@uri.user).to eq("user") + end + + it "should have a password of 'pass'" do + expect(@uri.password).to eq("pass") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/path/to/resource'" do + expect(@uri.path).to eq("/path/to/resource") + end + + it "should have a query string of 'query=x'" do + expect(@uri.query).to eq("query=x") + end + + it "should have a fragment of 'fragment'" do + expect(@uri.fragment).to eq("fragment") + end + + it "should be considered to be in normal form" do + expect(@uri.normalize).to be_eql(@uri) + end + + it "should have a route of '../../' to " + + "'http://user:pass@example.com/path/'" do + expect(@uri.route_to("http://user:pass@example.com/path/")).to eq( + Addressable::URI.parse("../../") + ) + end + + it "should have a route of 'to/resource?query=x#fragment' " + + "from 'http://user:pass@example.com/path/'" do + expect(@uri.route_from("http://user:pass@example.com/path/")).to eq( + Addressable::URI.parse("to/resource?query=x#fragment") + ) + end + + it "should have a route of '?query=x#fragment' " + + "from 'http://user:pass@example.com/path/to/resource'" do + expect(@uri.route_from("http://user:pass@example.com/path/to/resource")).to eq( + Addressable::URI.parse("?query=x#fragment") + ) + end + + it "should have a route of '#fragment' " + + "from 'http://user:pass@example.com/path/to/resource?query=x'" do + expect(@uri.route_from( + "http://user:pass@example.com/path/to/resource?query=x")).to eq( + Addressable::URI.parse("#fragment") + ) + end + + it "should have a route of '#fragment' from " + + "'http://user:pass@example.com/path/to/resource?query=x#fragment'" do + expect(@uri.route_from( + "http://user:pass@example.com/path/to/resource?query=x#fragment" + )).to eq(Addressable::URI.parse("#fragment")) + end + + it "should have a route of 'http://elsewhere.com/' to " + + "'http://elsewhere.com/'" do + expect(@uri.route_to("http://elsewhere.com/")).to eq( + Addressable::URI.parse("http://elsewhere.com/") + ) + end + + it "should have a route of " + + "'http://user:pass@example.com/path/to/resource?query=x#fragment' " + + "from 'http://example.com/path/to/'" do + expect(@uri.route_from("http://elsewhere.com/path/to/")).to eq( + Addressable::URI.parse( + "http://user:pass@example.com/path/to/resource?query=x#fragment") + ) + end + + it "should have the correct scheme after assignment" do + @uri.scheme = "ftp" + expect(@uri.scheme).to eq("ftp") + expect(@uri.to_s).to eq( + "ftp://user:pass@example.com/path/to/resource?query=x#fragment" + ) + expect(@uri.to_str).to eq( + "ftp://user:pass@example.com/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct site segment after assignment" do + @uri.site = "https://newuser:newpass@example.com:443" + expect(@uri.scheme).to eq("https") + expect(@uri.authority).to eq("newuser:newpass@example.com:443") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("newpass") + expect(@uri.userinfo).to eq("newuser:newpass") + expect(@uri.normalized_userinfo).to eq("newuser:newpass") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(443) + expect(@uri.inferred_port).to eq(443) + expect(@uri.to_s).to eq( + "https://newuser:newpass@example.com:443" + + "/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct authority segment after assignment" do + @uri.authority = "newuser:newpass@example.com:80" + expect(@uri.authority).to eq("newuser:newpass@example.com:80") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("newpass") + expect(@uri.userinfo).to eq("newuser:newpass") + expect(@uri.normalized_userinfo).to eq("newuser:newpass") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(80) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq( + "http://newuser:newpass@example.com:80" + + "/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct userinfo segment after assignment" do + @uri.userinfo = "newuser:newpass" + expect(@uri.userinfo).to eq("newuser:newpass") + expect(@uri.authority).to eq("newuser:newpass@example.com") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("newpass") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq( + "http://newuser:newpass@example.com" + + "/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.authority).to eq("newuser:pass@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.authority).to eq("user:newpass@example.com") + end + + it "should have the correct host after assignment" do + @uri.host = "newexample.com" + expect(@uri.host).to eq("newexample.com") + expect(@uri.authority).to eq("user:pass@newexample.com") + end + + it "should have the correct host after assignment" do + @uri.hostname = "newexample.com" + expect(@uri.host).to eq("newexample.com") + expect(@uri.hostname).to eq("newexample.com") + expect(@uri.authority).to eq("user:pass@newexample.com") + end + + it "should raise an error if assigning a bogus object to the hostname" do + expect do + @uri.hostname = Object.new + end.to raise_error(TypeError) + end + + it "should have the correct port after assignment" do + @uri.port = 8080 + expect(@uri.port).to eq(8080) + expect(@uri.authority).to eq("user:pass@example.com:8080") + end + + it "should have the correct origin after assignment" do + @uri.origin = "http://newexample.com" + expect(@uri.host).to eq("newexample.com") + expect(@uri.authority).to eq("newexample.com") + end + + it "should have the correct path after assignment" do + @uri.path = "/newpath/to/resource" + expect(@uri.path).to eq("/newpath/to/resource") + expect(@uri.to_s).to eq( + "http://user:pass@example.com/newpath/to/resource?query=x#fragment" + ) + end + + it "should have the correct scheme and authority after nil assignment" do + @uri.site = nil + expect(@uri.scheme).to eq(nil) + expect(@uri.authority).to eq(nil) + expect(@uri.to_s).to eq("/path/to/resource?query=x#fragment") + end + + it "should have the correct scheme and authority after assignment" do + @uri.site = "file://" + expect(@uri.scheme).to eq("file") + expect(@uri.authority).to eq("") + expect(@uri.to_s).to eq("file:///path/to/resource?query=x#fragment") + end + + it "should have the correct path after nil assignment" do + @uri.path = nil + expect(@uri.path).to eq("") + expect(@uri.to_s).to eq( + "http://user:pass@example.com?query=x#fragment" + ) + end + + it "should have the correct query string after assignment" do + @uri.query = "newquery=x" + expect(@uri.query).to eq("newquery=x") + expect(@uri.to_s).to eq( + "http://user:pass@example.com/path/to/resource?newquery=x#fragment" + ) + @uri.query = nil + expect(@uri.query).to eq(nil) + expect(@uri.to_s).to eq( + "http://user:pass@example.com/path/to/resource#fragment" + ) + end + + it "should have the correct query string after hash assignment" do + @uri.query_values = {"?uestion mark" => "=sign", "hello" => "g\xC3\xBCnther"} + expect(@uri.query.split("&")).to include("%3Fuestion%20mark=%3Dsign") + expect(@uri.query.split("&")).to include("hello=g%C3%BCnther") + expect(@uri.query_values).to eq({ + "?uestion mark" => "=sign", "hello" => "g\xC3\xBCnther" + }) + end + + it "should have the correct query string after flag hash assignment" do + @uri.query_values = {'flag?1' => nil, 'fl=ag2' => nil, 'flag3' => nil} + expect(@uri.query.split("&")).to include("flag%3F1") + expect(@uri.query.split("&")).to include("fl%3Dag2") + expect(@uri.query.split("&")).to include("flag3") + expect(@uri.query_values(Array).sort).to eq([["fl=ag2"], ["flag3"], ["flag?1"]]) + expect(@uri.query_values(Hash)).to eq({ + 'flag?1' => nil, 'fl=ag2' => nil, 'flag3' => nil + }) + end + + it "should raise an error if query values are set to a bogus type" do + expect do + @uri.query_values = "bogus" + end.to raise_error(TypeError) + end + + it "should have the correct fragment after assignment" do + @uri.fragment = "newfragment" + expect(@uri.fragment).to eq("newfragment") + expect(@uri.to_s).to eq( + "http://user:pass@example.com/path/to/resource?query=x#newfragment" + ) + + @uri.fragment = nil + expect(@uri.fragment).to eq(nil) + expect(@uri.to_s).to eq( + "http://user:pass@example.com/path/to/resource?query=x" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:fragment => "newfragment").to_s).to eq( + "http://user:pass@example.com/path/to/resource?query=x#newfragment" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:fragment => nil).to_s).to eq( + "http://user:pass@example.com/path/to/resource?query=x" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:userinfo => "newuser:newpass").to_s).to eq( + "http://newuser:newpass@example.com/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:userinfo => nil).to_s).to eq( + "http://example.com/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:path => "newpath").to_s).to eq( + "http://user:pass@example.com/newpath?query=x#fragment" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:port => "42", :path => "newpath", :query => "").to_s).to eq( + "http://user:pass@example.com:42/newpath?#fragment" + ) + end + + it "should have the correct values after a merge" do + expect(@uri.merge(:authority => "foo:bar@baz:42").to_s).to eq( + "http://foo:bar@baz:42/path/to/resource?query=x#fragment" + ) + # Ensure the operation was not destructive + expect(@uri.to_s).to eq( + "http://user:pass@example.com/path/to/resource?query=x#fragment" + ) + end + + it "should have the correct values after a destructive merge" do + @uri.merge!(:authority => "foo:bar@baz:42") + # Ensure the operation was destructive + expect(@uri.to_s).to eq( + "http://foo:bar@baz:42/path/to/resource?query=x#fragment" + ) + end + + it "should fail to merge with bogus values" do + expect do + @uri.merge(:port => "bogus") + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should fail to merge with bogus values" do + expect do + @uri.merge(:authority => "bar@baz:bogus") + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should fail to merge with bogus parameters" do + expect do + @uri.merge(42) + end.to raise_error(TypeError) + end + + it "should fail to merge with bogus parameters" do + expect do + @uri.merge("http://example.com/") + end.to raise_error(TypeError) + end + + it "should fail to merge with both authority and subcomponents" do + expect do + @uri.merge(:authority => "foo:bar@baz:42", :port => "42") + end.to raise_error(ArgumentError) + end + + it "should fail to merge with both userinfo and subcomponents" do + expect do + @uri.merge(:userinfo => "foo:bar", :user => "foo") + end.to raise_error(ArgumentError) + end + + it "should be identical to its duplicate" do + expect(@uri).to eq(@uri.dup) + end + + it "should have an origin of 'http://example.com'" do + expect(@uri.origin).to eq('http://example.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/search?q=Q%26A'" do + + before do + @uri = Addressable::URI.parse("http://example.com/search?q=Q%26A") + end + + it "should have a query of 'q=Q%26A'" do + expect(@uri.query).to eq("q=Q%26A") + end + + it "should have query_values of {'q' => 'Q&A'}" do + expect(@uri.query_values).to eq({ 'q' => 'Q&A' }) + end + + it "should normalize to the original uri " + + "(with the ampersand properly percent-encoded)" do + expect(@uri.normalize.to_s).to eq("http://example.com/search?q=Q%26A") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?&x=b'" do + before do + @uri = Addressable::URI.parse("http://example.com/?&x=b") + end + + it "should have a query of '&x=b'" do + expect(@uri.query).to eq("&x=b") + end + + it "should have query_values of {'x' => 'b'}" do + expect(@uri.query_values).to eq({'x' => 'b'}) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q='one;two'&x=1'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q='one;two'&x=1") + end + + it "should have a query of 'q='one;two'&x=1'" do + expect(@uri.query).to eq("q='one;two'&x=1") + end + + it "should have query_values of {\"q\" => \"'one;two'\", \"x\" => \"1\"}" do + expect(@uri.query_values).to eq({"q" => "'one;two'", "x" => "1"}) + end + + it "should escape the ';' character when normalizing to avoid ambiguity " + + "with the W3C HTML 4.01 specification" do + # HTML 4.01 Section B.2.2 + expect(@uri.normalize.query).to eq("q='one%3Btwo'&x=1") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?&&x=b'" do + before do + @uri = Addressable::URI.parse("http://example.com/?&&x=b") + end + + it "should have a query of '&&x=b'" do + expect(@uri.query).to eq("&&x=b") + end + + it "should have query_values of {'x' => 'b'}" do + expect(@uri.query_values).to eq({'x' => 'b'}) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q=a&&x=b'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q=a&&x=b") + end + + it "should have a query of 'q=a&&x=b'" do + expect(@uri.query).to eq("q=a&&x=b") + end + + it "should have query_values of {'q' => 'a, 'x' => 'b'}" do + expect(@uri.query_values).to eq({'q' => 'a', 'x' => 'b'}) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q&&x=b'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q&&x=b") + end + + it "should have a query of 'q&&x=b'" do + expect(@uri.query).to eq("q&&x=b") + end + + it "should have query_values of {'q' => true, 'x' => 'b'}" do + expect(@uri.query_values).to eq({'q' => nil, 'x' => 'b'}) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q=a+b'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q=a+b") + end + + it "should have a query of 'q=a+b'" do + expect(@uri.query).to eq("q=a+b") + end + + it "should have query_values of {'q' => 'a b'}" do + expect(@uri.query_values).to eq({'q' => 'a b'}) + end + + it "should have a normalized query of 'q=a+b'" do + expect(@uri.normalized_query).to eq("q=a+b") + end +end + +describe Addressable::URI, "when parsed from 'https://example.com/?q=a+b'" do + before do + @uri = Addressable::URI.parse("https://example.com/?q=a+b") + end + + it "should have query_values of {'q' => 'a b'}" do + expect(@uri.query_values).to eq("q" => "a b") + end +end + +describe Addressable::URI, "when parsed from 'example.com?q=a+b'" do + before do + @uri = Addressable::URI.parse("example.com?q=a+b") + end + + it "should have query_values of {'q' => 'a b'}" do + expect(@uri.query_values).to eq("q" => "a b") + end +end + +describe Addressable::URI, "when parsed from 'mailto:?q=a+b'" do + before do + @uri = Addressable::URI.parse("mailto:?q=a+b") + end + + it "should have query_values of {'q' => 'a+b'}" do + expect(@uri.query_values).to eq("q" => "a+b") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q=a%2bb'" do + before do + @uri = Addressable::URI.parse("http://example.com/?q=a%2bb") + end + + it "should have a query of 'q=a+b'" do + expect(@uri.query).to eq("q=a%2bb") + end + + it "should have query_values of {'q' => 'a+b'}" do + expect(@uri.query_values).to eq({'q' => 'a+b'}) + end + + it "should have a normalized query of 'q=a%2Bb'" do + expect(@uri.normalized_query).to eq("q=a%2Bb") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?v=%7E&w=%&x=%25&y=%2B&z=C%CC%A7'" do + before do + @uri = Addressable::URI.parse("http://example.com/?v=%7E&w=%&x=%25&y=%2B&z=C%CC%A7") + end + + it "should have a normalized query of 'v=~&w=%25&x=%25&y=%2B&z=%C3%87'" do + expect(@uri.normalized_query).to eq("v=~&w=%25&x=%25&y=%2B&z=%C3%87") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?v=%7E&w=%&x=%25&y=+&z=C%CC%A7'" do + before do + @uri = Addressable::URI.parse("http://example.com/?v=%7E&w=%&x=%25&y=+&z=C%CC%A7") + end + + it "should have a normalized query of 'v=~&w=%25&x=%25&y=+&z=%C3%87'" do + expect(@uri.normalized_query).to eq("v=~&w=%25&x=%25&y=+&z=%C3%87") + end +end + +describe Addressable::URI, "when parsed from 'http://example/?b=1&a=2&c=3'" do + before do + @uri = Addressable::URI.parse("http://example/?b=1&a=2&c=3") + end + + it "should have a sorted normalized query of 'a=2&b=1&c=3'" do + expect(@uri.normalized_query(:sorted)).to eq("a=2&b=1&c=3") + end +end + +describe Addressable::URI, "when parsed from 'http://example/?&a&&c&'" do + before do + @uri = Addressable::URI.parse("http://example/?&a&&c&") + end + + it "should have a compacted normalized query of 'a&c'" do + expect(@uri.normalized_query(:compacted)).to eq("a&c") + end +end + +describe Addressable::URI, "when parsed from 'http://example.com/?a=1&a=1'" do + before do + @uri = Addressable::URI.parse("http://example.com/?a=1&a=1") + end + + it "should have a compacted normalized query of 'a=1'" do + expect(@uri.normalized_query(:compacted)).to eq("a=1") + end +end + +describe Addressable::URI, "when parsed from 'http://example.com/?a=1&a=2'" do + before do + @uri = Addressable::URI.parse("http://example.com/?a=1&a=2") + end + + it "should have a compacted normalized query of 'a=1&a=2'" do + expect(@uri.normalized_query(:compacted)).to eq("a=1&a=2") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/sound%2bvision'" do + before do + @uri = Addressable::URI.parse("http://example.com/sound%2bvision") + end + + it "should have a normalized path of '/sound+vision'" do + expect(@uri.normalized_path).to eq('/sound+vision') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/?q='" do + before do + @uri = Addressable::URI.parse("http://example.com/?q=") + end + + it "should have a query of 'q='" do + expect(@uri.query).to eq("q=") + end + + it "should have query_values of {'q' => ''}" do + expect(@uri.query_values).to eq({'q' => ''}) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://user@example.com'" do + before do + @uri = Addressable::URI.parse("http://user@example.com") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a username of 'user'" do + expect(@uri.user).to eq("user") + end + + it "should have no password" do + expect(@uri.password).to eq(nil) + end + + it "should have a userinfo of 'user'" do + expect(@uri.userinfo).to eq("user") + end + + it "should have a normalized userinfo of 'user'" do + expect(@uri.normalized_userinfo).to eq("user") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have default_port 80" do + expect(@uri.default_port).to eq(80) + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq(nil) + expect(@uri.to_s).to eq("http://newuser@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.to_s).to eq("http://user:newpass@example.com") + end + + it "should have the correct userinfo segment after assignment" do + @uri.userinfo = "newuser:newpass" + expect(@uri.userinfo).to eq("newuser:newpass") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("newpass") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://newuser:newpass@example.com") + end + + it "should have the correct userinfo segment after nil assignment" do + @uri.userinfo = nil + expect(@uri.userinfo).to eq(nil) + expect(@uri.user).to eq(nil) + expect(@uri.password).to eq(nil) + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://example.com") + end + + it "should have the correct authority segment after assignment" do + @uri.authority = "newuser@example.com" + expect(@uri.authority).to eq("newuser@example.com") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq(nil) + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://newuser@example.com") + end + + it "should raise an error after nil assignment of authority segment" do + expect do + # This would create an invalid URI + @uri.authority = nil + end.to raise_error(Addressable::URI::InvalidURIError) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://user:@example.com'" do + before do + @uri = Addressable::URI.parse("http://user:@example.com") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a username of 'user'" do + expect(@uri.user).to eq("user") + end + + it "should have a password of ''" do + expect(@uri.password).to eq("") + end + + it "should have a normalized userinfo of 'user:'" do + expect(@uri.normalized_userinfo).to eq("user:") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("") + expect(@uri.to_s).to eq("http://newuser:@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.to_s).to eq("http://user:newpass@example.com") + end + + it "should have the correct authority segment after assignment" do + @uri.authority = "newuser:@example.com" + expect(@uri.authority).to eq("newuser:@example.com") + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://newuser:@example.com") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://:pass@example.com'" do + before do + @uri = Addressable::URI.parse("http://:pass@example.com") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a username of ''" do + expect(@uri.user).to eq("") + end + + it "should have a password of 'pass'" do + expect(@uri.password).to eq("pass") + end + + it "should have a userinfo of ':pass'" do + expect(@uri.userinfo).to eq(":pass") + end + + it "should have a normalized userinfo of ':pass'" do + expect(@uri.normalized_userinfo).to eq(":pass") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("pass") + expect(@uri.to_s).to eq("http://newuser:pass@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.user).to eq("") + expect(@uri.to_s).to eq("http://:newpass@example.com") + end + + it "should have the correct authority segment after assignment" do + @uri.authority = ":newpass@example.com" + expect(@uri.authority).to eq(":newpass@example.com") + expect(@uri.user).to eq("") + expect(@uri.password).to eq("newpass") + expect(@uri.host).to eq("example.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://:newpass@example.com") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://:@example.com'" do + before do + @uri = Addressable::URI.parse("http://:@example.com") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a username of ''" do + expect(@uri.user).to eq("") + end + + it "should have a password of ''" do + expect(@uri.password).to eq("") + end + + it "should have a normalized userinfo of nil" do + expect(@uri.normalized_userinfo).to eq(nil) + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have the correct username after assignment" do + @uri.user = "newuser" + expect(@uri.user).to eq("newuser") + expect(@uri.password).to eq("") + expect(@uri.to_s).to eq("http://newuser:@example.com") + end + + it "should have the correct password after assignment" do + @uri.password = "newpass" + expect(@uri.password).to eq("newpass") + expect(@uri.user).to eq("") + expect(@uri.to_s).to eq("http://:newpass@example.com") + end + + it "should have the correct authority segment after assignment" do + @uri.authority = ":@newexample.com" + expect(@uri.authority).to eq(":@newexample.com") + expect(@uri.user).to eq("") + expect(@uri.password).to eq("") + expect(@uri.host).to eq("newexample.com") + expect(@uri.port).to eq(nil) + expect(@uri.inferred_port).to eq(80) + expect(@uri.to_s).to eq("http://:@newexample.com") + end +end + +describe Addressable::URI, "when parsed from " + + "'#example'" do + before do + @uri = Addressable::URI.parse("#example") + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "should have a host of nil" do + expect(@uri.host).to eq(nil) + end + + it "should have a site of nil" do + expect(@uri.site).to eq(nil) + end + + it "should have a normalized_site of nil" do + expect(@uri.normalized_site).to eq(nil) + end + + it "should have a path of ''" do + expect(@uri.path).to eq("") + end + + it "should have a query string of nil" do + expect(@uri.query).to eq(nil) + end + + it "should have a fragment of 'example'" do + expect(@uri.fragment).to eq("example") + end +end + +describe Addressable::URI, "when parsed from " + + "the network-path reference '//example.com/'" do + before do + @uri = Addressable::URI.parse("//example.com/") + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should have a path of '/'" do + expect(@uri.path).to eq("/") + end + + it "should raise an error if routing is attempted" do + expect do + @uri.route_to("http://example.com/") + end.to raise_error(ArgumentError, /\/\/example.com\//) + expect do + @uri.route_from("http://example.com/") + end.to raise_error(ArgumentError, /\/\/example.com\//) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from " + + "'feed://http://example.com/'" do + before do + @uri = Addressable::URI.parse("feed://http://example.com/") + end + + it "should have a host of 'http'" do + expect(@uri.host).to eq("http") + end + + it "should have a path of '//example.com/'" do + expect(@uri.path).to eq("//example.com/") + end +end + +describe Addressable::URI, "when parsed from " + + "'feed:http://example.com/'" do + before do + @uri = Addressable::URI.parse("feed:http://example.com/") + end + + it "should have a path of 'http://example.com/'" do + expect(@uri.path).to eq("http://example.com/") + end + + it "should normalize to 'http://example.com/'" do + expect(@uri.normalize.to_s).to eq("http://example.com/") + expect(@uri.normalize!.to_s).to eq("http://example.com/") + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from " + + "'example://a/b/c/%7Bfoo%7D'" do + before do + @uri = Addressable::URI.parse("example://a/b/c/%7Bfoo%7D") + end + + # Section 6.2.2 of RFC 3986 + it "should be equivalent to eXAMPLE://a/./b/../b/%63/%7bfoo%7d" do + expect(@uri).to eq( + Addressable::URI.parse("eXAMPLE://a/./b/../b/%63/%7bfoo%7d") + ) + end + + it "should have an origin of 'example://a'" do + expect(@uri.origin).to eq('example://a') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://example.com/indirect/path/./to/../resource/'" do + before do + @uri = Addressable::URI.parse( + "http://example.com/indirect/path/./to/../resource/") + end + + it "should use the 'http' scheme" do + expect(@uri.scheme).to eq("http") + end + + it "should have a host of 'example.com'" do + expect(@uri.host).to eq("example.com") + end + + it "should use port 80" do + expect(@uri.inferred_port).to eq(80) + end + + it "should have a path of '/indirect/path/./to/../resource/'" do + expect(@uri.path).to eq("/indirect/path/./to/../resource/") + end + + # Section 6.2.2.3 of RFC 3986 + it "should have a normalized path of '/indirect/path/resource/'" do + expect(@uri.normalize.path).to eq("/indirect/path/resource/") + expect(@uri.normalize!.path).to eq("/indirect/path/resource/") + end +end + +describe Addressable::URI, "when parsed from " + + "'http://under_score.example.com/'" do + it "should not cause an error" do + expect do + Addressable::URI.parse("http://under_score.example.com/") + end.not_to raise_error + end +end + +describe Addressable::URI, "when parsed from " + + "'./this:that'" do + before do + @uri = Addressable::URI.parse("./this:that") + end + + it "should be considered relative" do + expect(@uri).to be_relative + end + + it "should have no scheme" do + expect(@uri.scheme).to eq(nil) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from " + + "'this:that'" do + before do + @uri = Addressable::URI.parse("this:that") + end + + it "should be considered absolute" do + expect(@uri).to be_absolute + end + + it "should have a scheme of 'this'" do + expect(@uri.scheme).to eq("this") + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from '?'" do + before do + @uri = Addressable::URI.parse("?") + end + + it "should normalize to ''" do + expect(@uri.normalize.to_s).to eq("") + end + + it "should have the correct return type" do + expect(@uri.query_values).to eq({}) + expect(@uri.query_values(Hash)).to eq({}) + expect(@uri.query_values(Array)).to eq([]) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from '?one=1&two=2&three=3'" do + before do + @uri = Addressable::URI.parse("?one=1&two=2&three=3") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({"one" => "1", "two" => "2", "three" => "3"}) + end + + it "should raise an error for invalid return type values" do + expect do + @uri.query_values(Integer) + end.to raise_error(ArgumentError) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one", "1"], ["two", "2"], ["three", "3"] + ]) + end + + it "should have a 'null' origin" do + expect(@uri.origin).to eq('null') + end +end + +describe Addressable::URI, "when parsed from '?one=1=uno&two=2=dos'" do + before do + @uri = Addressable::URI.parse("?one=1=uno&two=2=dos") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({"one" => "1=uno", "two" => "2=dos"}) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one", "1=uno"], ["two", "2=dos"] + ]) + end +end + +describe Addressable::URI, "when parsed from '?one[two][three]=four'" do + before do + @uri = Addressable::URI.parse("?one[two][three]=four") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({"one[two][three]" => "four"}) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one[two][three]", "four"] + ]) + end +end + +describe Addressable::URI, "when parsed from '?one.two.three=four'" do + before do + @uri = Addressable::URI.parse("?one.two.three=four") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one.two.three" => "four" + }) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one.two.three", "four"] + ]) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one[two][three]=four&one[two][five]=six'" do + before do + @uri = Addressable::URI.parse("?one[two][three]=four&one[two][five]=six") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one[two][three]" => "four", "one[two][five]" => "six" + }) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one[two][three]", "four"], ["one[two][five]", "six"] + ]) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one.two.three=four&one.two.five=six'" do + before do + @uri = Addressable::URI.parse("?one.two.three=four&one.two.five=six") + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one.two.three" => "four", "one.two.five" => "six" + }) + end + + it "should have the correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one.two.three", "four"], ["one.two.five", "six"] + ]) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one=two&one=three'" do + before do + @uri = Addressable::URI.parse( + "?one=two&one=three&one=four" + ) + end + + it "should have correct array query values" do + expect(@uri.query_values(Array)).to eq( + [['one', 'two'], ['one', 'three'], ['one', 'four']] + ) + end + + it "should have correct hash query values" do + skip("This is probably more desirable behavior.") + expect(@uri.query_values(Hash)).to eq( + {'one' => ['two', 'three', 'four']} + ) + end + + it "should handle assignment with keys of mixed type" do + @uri.query_values = @uri.query_values(Hash).merge({:one => 'three'}) + expect(@uri.query_values(Hash)).to eq({'one' => 'three'}) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one[two][three][]=four&one[two][three][]=five'" do + before do + @uri = Addressable::URI.parse( + "?one[two][three][]=four&one[two][three][]=five" + ) + end + + it "should have correct query values" do + expect(@uri.query_values(Hash)).to eq({"one[two][three][]" => "five"}) + end + + it "should have correct array query values" do + expect(@uri.query_values(Array)).to eq([ + ["one[two][three][]", "four"], ["one[two][three][]", "five"] + ]) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one[two][three][0]=four&one[two][three][1]=five'" do + before do + @uri = Addressable::URI.parse( + "?one[two][three][0]=four&one[two][three][1]=five" + ) + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one[two][three][0]" => "four", "one[two][three][1]" => "five" + }) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one[two][three][1]=four&one[two][three][0]=five'" do + before do + @uri = Addressable::URI.parse( + "?one[two][three][1]=four&one[two][three][0]=five" + ) + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one[two][three][1]" => "four", "one[two][three][0]" => "five" + }) + end +end + +describe Addressable::URI, "when parsed from " + + "'?one[two][three][2]=four&one[two][three][1]=five'" do + before do + @uri = Addressable::URI.parse( + "?one[two][three][2]=four&one[two][three][1]=five" + ) + end + + it "should have the correct query values" do + expect(@uri.query_values).to eq({ + "one[two][three][2]" => "four", "one[two][three][1]" => "five" + }) + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.詹姆斯.com/'" do + before do + @uri = Addressable::URI.parse("http://www.詹姆斯.com/") + end + + it "should be equivalent to 'http://www.xn--8ws00zhy3a.com/'" do + expect(@uri).to eq( + Addressable::URI.parse("http://www.xn--8ws00zhy3a.com/") + ) + end + + it "should not have domain name encoded during normalization" do + expect(Addressable::URI.normalized_encode(@uri.to_s)).to eq( + "http://www.詹姆斯.com/" + ) + end + + it "should have an origin of 'http://www.xn--8ws00zhy3a.com'" do + expect(@uri.origin).to eq('http://www.xn--8ws00zhy3a.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.詹姆斯.com/ some spaces /'" do + before do + @uri = Addressable::URI.parse("http://www.詹姆斯.com/ some spaces /") + end + + it "should be equivalent to " + + "'http://www.xn--8ws00zhy3a.com/%20some%20spaces%20/'" do + expect(@uri).to eq( + Addressable::URI.parse( + "http://www.xn--8ws00zhy3a.com/%20some%20spaces%20/") + ) + end + + it "should not have domain name encoded during normalization" do + expect(Addressable::URI.normalized_encode(@uri.to_s)).to eq( + "http://www.詹姆斯.com/%20some%20spaces%20/" + ) + end + + it "should have an origin of 'http://www.xn--8ws00zhy3a.com'" do + expect(@uri.origin).to eq('http://www.xn--8ws00zhy3a.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.xn--8ws00zhy3a.com/'" do + before do + @uri = Addressable::URI.parse("http://www.xn--8ws00zhy3a.com/") + end + + it "should be displayed as http://www.詹姆斯.com/" do + expect(@uri.display_uri.to_s).to eq("http://www.詹姆斯.com/") + end + + it "should properly force the encoding" do + display_string = @uri.display_uri.to_str + expect(display_string).to eq("http://www.詹姆斯.com/") + if display_string.respond_to?(:encoding) + expect(display_string.encoding.to_s).to eq(Encoding::UTF_8.to_s) + end + end + + it "should have an origin of 'http://www.xn--8ws00zhy3a.com'" do + expect(@uri.origin).to eq('http://www.xn--8ws00zhy3a.com') + end +end + +describe Addressable::URI, "when parsed from " + + "'http://www.詹姆斯.com/atomtests/iri/詹.html'" do + before do + @uri = Addressable::URI.parse("http://www.詹姆斯.com/atomtests/iri/詹.html") + end + + it "should normalize to " + + "http://www.xn--8ws00zhy3a.com/atomtests/iri/%E8%A9%B9.html" do + expect(@uri.normalize.to_s).to eq( + "http://www.xn--8ws00zhy3a.com/atomtests/iri/%E8%A9%B9.html" + ) + expect(@uri.normalize!.to_s).to eq( + "http://www.xn--8ws00zhy3a.com/atomtests/iri/%E8%A9%B9.html" + ) + end +end + +describe Addressable::URI, "when parsed from a percent-encoded IRI" do + before do + @uri = Addressable::URI.parse( + "http://www.%E3%81%BB%E3%82%93%E3%81%A8%E3%81%86%E3%81%AB%E3%81%AA" + + "%E3%81%8C%E3%81%84%E3%82%8F%E3%81%91%E3%81%AE%E3%82%8F%E3%81%8B%E3" + + "%82%89%E3%81%AA%E3%81%84%E3%81%A9%E3%82%81%E3%81%84%E3%82%93%E3%82" + + "%81%E3%81%84%E3%81%AE%E3%82%89%E3%81%B9%E3%82%8B%E3%81%BE%E3%81%A0" + + "%E3%81%AA%E3%81%8C%E3%81%8F%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3" + + "%81%9F%E3%82%8A%E3%81%AA%E3%81%84.w3.mag.keio.ac.jp" + ) + end + + it "should normalize to something sane" do + expect(@uri.normalize.to_s).to eq( + "http://www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3f" + + "g11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp/" + ) + expect(@uri.normalize!.to_s).to eq( + "http://www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3f" + + "g11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp/" + ) + end + + it "should have the correct origin" do + expect(@uri.origin).to eq( + "http://www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3f" + + "g11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp" + ) + end +end + +describe Addressable::URI, "with a base uri of 'http://a/b/c/d;p?q'" do + before do + @uri = Addressable::URI.parse("http://a/b/c/d;p?q") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g:h' should resolve to g:h" do + expect((@uri + "g:h").to_s).to eq("g:h") + expect(Addressable::URI.join(@uri, "g:h").to_s).to eq("g:h") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g' should resolve to http://a/b/c/g" do + expect((@uri + "g").to_s).to eq("http://a/b/c/g") + expect(Addressable::URI.join(@uri.to_s, "g").to_s).to eq("http://a/b/c/g") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with './g' should resolve to http://a/b/c/g" do + expect((@uri + "./g").to_s).to eq("http://a/b/c/g") + expect(Addressable::URI.join(@uri.to_s, "./g").to_s).to eq("http://a/b/c/g") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g/' should resolve to http://a/b/c/g/" do + expect((@uri + "g/").to_s).to eq("http://a/b/c/g/") + expect(Addressable::URI.join(@uri.to_s, "g/").to_s).to eq("http://a/b/c/g/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '/g' should resolve to http://a/g" do + expect((@uri + "/g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "/g").to_s).to eq("http://a/g") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '//g' should resolve to http://g" do + expect((@uri + "//g").to_s).to eq("http://g") + expect(Addressable::URI.join(@uri.to_s, "//g").to_s).to eq("http://g") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '?y' should resolve to http://a/b/c/d;p?y" do + expect((@uri + "?y").to_s).to eq("http://a/b/c/d;p?y") + expect(Addressable::URI.join(@uri.to_s, "?y").to_s).to eq("http://a/b/c/d;p?y") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g?y' should resolve to http://a/b/c/g?y" do + expect((@uri + "g?y").to_s).to eq("http://a/b/c/g?y") + expect(Addressable::URI.join(@uri.to_s, "g?y").to_s).to eq("http://a/b/c/g?y") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '#s' should resolve to http://a/b/c/d;p?q#s" do + expect((@uri + "#s").to_s).to eq("http://a/b/c/d;p?q#s") + expect(Addressable::URI.join(@uri.to_s, "#s").to_s).to eq( + "http://a/b/c/d;p?q#s" + ) + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g#s' should resolve to http://a/b/c/g#s" do + expect((@uri + "g#s").to_s).to eq("http://a/b/c/g#s") + expect(Addressable::URI.join(@uri.to_s, "g#s").to_s).to eq("http://a/b/c/g#s") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g?y#s' should resolve to http://a/b/c/g?y#s" do + expect((@uri + "g?y#s").to_s).to eq("http://a/b/c/g?y#s") + expect(Addressable::URI.join( + @uri.to_s, "g?y#s").to_s).to eq("http://a/b/c/g?y#s") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with ';x' should resolve to http://a/b/c/;x" do + expect((@uri + ";x").to_s).to eq("http://a/b/c/;x") + expect(Addressable::URI.join(@uri.to_s, ";x").to_s).to eq("http://a/b/c/;x") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g;x' should resolve to http://a/b/c/g;x" do + expect((@uri + "g;x").to_s).to eq("http://a/b/c/g;x") + expect(Addressable::URI.join(@uri.to_s, "g;x").to_s).to eq("http://a/b/c/g;x") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with 'g;x?y#s' should resolve to http://a/b/c/g;x?y#s" do + expect((@uri + "g;x?y#s").to_s).to eq("http://a/b/c/g;x?y#s") + expect(Addressable::URI.join( + @uri.to_s, "g;x?y#s").to_s).to eq("http://a/b/c/g;x?y#s") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '' should resolve to http://a/b/c/d;p?q" do + expect((@uri + "").to_s).to eq("http://a/b/c/d;p?q") + expect(Addressable::URI.join(@uri.to_s, "").to_s).to eq("http://a/b/c/d;p?q") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '.' should resolve to http://a/b/c/" do + expect((@uri + ".").to_s).to eq("http://a/b/c/") + expect(Addressable::URI.join(@uri.to_s, ".").to_s).to eq("http://a/b/c/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with './' should resolve to http://a/b/c/" do + expect((@uri + "./").to_s).to eq("http://a/b/c/") + expect(Addressable::URI.join(@uri.to_s, "./").to_s).to eq("http://a/b/c/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '..' should resolve to http://a/b/" do + expect((@uri + "..").to_s).to eq("http://a/b/") + expect(Addressable::URI.join(@uri.to_s, "..").to_s).to eq("http://a/b/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '../' should resolve to http://a/b/" do + expect((@uri + "../").to_s).to eq("http://a/b/") + expect(Addressable::URI.join(@uri.to_s, "../").to_s).to eq("http://a/b/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '../g' should resolve to http://a/b/g" do + expect((@uri + "../g").to_s).to eq("http://a/b/g") + expect(Addressable::URI.join(@uri.to_s, "../g").to_s).to eq("http://a/b/g") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '../..' should resolve to http://a/" do + expect((@uri + "../..").to_s).to eq("http://a/") + expect(Addressable::URI.join(@uri.to_s, "../..").to_s).to eq("http://a/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '../../' should resolve to http://a/" do + expect((@uri + "../../").to_s).to eq("http://a/") + expect(Addressable::URI.join(@uri.to_s, "../../").to_s).to eq("http://a/") + end + + # Section 5.4.1 of RFC 3986 + it "when joined with '../../g' should resolve to http://a/g" do + expect((@uri + "../../g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "../../g").to_s).to eq("http://a/g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '../../../g' should resolve to http://a/g" do + expect((@uri + "../../../g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "../../../g").to_s).to eq("http://a/g") + end + + it "when joined with '../.././../g' should resolve to http://a/g" do + expect((@uri + "../.././../g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "../.././../g").to_s).to eq( + "http://a/g" + ) + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '../../../../g' should resolve to http://a/g" do + expect((@uri + "../../../../g").to_s).to eq("http://a/g") + expect(Addressable::URI.join( + @uri.to_s, "../../../../g").to_s).to eq("http://a/g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '/./g' should resolve to http://a/g" do + expect((@uri + "/./g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "/./g").to_s).to eq("http://a/g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '/../g' should resolve to http://a/g" do + expect((@uri + "/../g").to_s).to eq("http://a/g") + expect(Addressable::URI.join(@uri.to_s, "/../g").to_s).to eq("http://a/g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g.' should resolve to http://a/b/c/g." do + expect((@uri + "g.").to_s).to eq("http://a/b/c/g.") + expect(Addressable::URI.join(@uri.to_s, "g.").to_s).to eq("http://a/b/c/g.") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '.g' should resolve to http://a/b/c/.g" do + expect((@uri + ".g").to_s).to eq("http://a/b/c/.g") + expect(Addressable::URI.join(@uri.to_s, ".g").to_s).to eq("http://a/b/c/.g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g..' should resolve to http://a/b/c/g.." do + expect((@uri + "g..").to_s).to eq("http://a/b/c/g..") + expect(Addressable::URI.join(@uri.to_s, "g..").to_s).to eq("http://a/b/c/g..") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with '..g' should resolve to http://a/b/c/..g" do + expect((@uri + "..g").to_s).to eq("http://a/b/c/..g") + expect(Addressable::URI.join(@uri.to_s, "..g").to_s).to eq("http://a/b/c/..g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with './../g' should resolve to http://a/b/g" do + expect((@uri + "./../g").to_s).to eq("http://a/b/g") + expect(Addressable::URI.join(@uri.to_s, "./../g").to_s).to eq("http://a/b/g") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with './g/.' should resolve to http://a/b/c/g/" do + expect((@uri + "./g/.").to_s).to eq("http://a/b/c/g/") + expect(Addressable::URI.join(@uri.to_s, "./g/.").to_s).to eq("http://a/b/c/g/") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g/./h' should resolve to http://a/b/c/g/h" do + expect((@uri + "g/./h").to_s).to eq("http://a/b/c/g/h") + expect(Addressable::URI.join(@uri.to_s, "g/./h").to_s).to eq("http://a/b/c/g/h") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g/../h' should resolve to http://a/b/c/h" do + expect((@uri + "g/../h").to_s).to eq("http://a/b/c/h") + expect(Addressable::URI.join(@uri.to_s, "g/../h").to_s).to eq("http://a/b/c/h") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g;x=1/./y' " + + "should resolve to http://a/b/c/g;x=1/y" do + expect((@uri + "g;x=1/./y").to_s).to eq("http://a/b/c/g;x=1/y") + expect(Addressable::URI.join( + @uri.to_s, "g;x=1/./y").to_s).to eq("http://a/b/c/g;x=1/y") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g;x=1/../y' should resolve to http://a/b/c/y" do + expect((@uri + "g;x=1/../y").to_s).to eq("http://a/b/c/y") + expect(Addressable::URI.join( + @uri.to_s, "g;x=1/../y").to_s).to eq("http://a/b/c/y") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g?y/./x' " + + "should resolve to http://a/b/c/g?y/./x" do + expect((@uri + "g?y/./x").to_s).to eq("http://a/b/c/g?y/./x") + expect(Addressable::URI.join( + @uri.to_s, "g?y/./x").to_s).to eq("http://a/b/c/g?y/./x") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g?y/../x' " + + "should resolve to http://a/b/c/g?y/../x" do + expect((@uri + "g?y/../x").to_s).to eq("http://a/b/c/g?y/../x") + expect(Addressable::URI.join( + @uri.to_s, "g?y/../x").to_s).to eq("http://a/b/c/g?y/../x") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g#s/./x' " + + "should resolve to http://a/b/c/g#s/./x" do + expect((@uri + "g#s/./x").to_s).to eq("http://a/b/c/g#s/./x") + expect(Addressable::URI.join( + @uri.to_s, "g#s/./x").to_s).to eq("http://a/b/c/g#s/./x") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'g#s/../x' " + + "should resolve to http://a/b/c/g#s/../x" do + expect((@uri + "g#s/../x").to_s).to eq("http://a/b/c/g#s/../x") + expect(Addressable::URI.join( + @uri.to_s, "g#s/../x").to_s).to eq("http://a/b/c/g#s/../x") + end + + # Section 5.4.2 of RFC 3986 + it "when joined with 'http:g' should resolve to http:g" do + expect((@uri + "http:g").to_s).to eq("http:g") + expect(Addressable::URI.join(@uri.to_s, "http:g").to_s).to eq("http:g") + end + + # Edge case to be sure + it "when joined with '//example.com/' should " + + "resolve to http://example.com/" do + expect((@uri + "//example.com/").to_s).to eq("http://example.com/") + expect(Addressable::URI.join( + @uri.to_s, "//example.com/").to_s).to eq("http://example.com/") + end + + it "when joined with a bogus object a TypeError should be raised" do + expect do + Addressable::URI.join(@uri, 42) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when converting the path " + + "'relative/path/to/something'" do + before do + @path = 'relative/path/to/something' + end + + it "should convert to " + + "\'relative/path/to/something\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("relative/path/to/something") + end + + it "should join with an absolute file path correctly" do + @base = Addressable::URI.convert_path("/absolute/path/") + @uri = Addressable::URI.convert_path(@path) + expect((@base + @uri).to_str).to eq( + "file:///absolute/path/relative/path/to/something" + ) + end +end + +describe Addressable::URI, "when converting a bogus path" do + it "should raise a TypeError" do + expect do + Addressable::URI.convert_path(42) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when given a UNIX root directory" do + before do + @path = "/" + end + + it "should convert to \'file:///\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given a Windows root directory" do + before do + @path = "C:\\" + end + + it "should convert to \'file:///c:/\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the path '/one/two/'" do + before do + @path = '/one/two/' + end + + it "should convert to " + + "\'file:///one/two/\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///one/two/") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the tld " do + it "'uk' should have a tld of 'uk'" do + uri = Addressable::URI.parse("http://example.com") + uri.tld = "uk" + + expect(uri.tld).to eq("uk") + end + + context "which " do + let (:uri) { Addressable::URI.parse("http://www.comrade.net/path/to/source/") } + + it "contains a subdomain" do + uri.tld = "co.uk" + + expect(uri.to_s).to eq("http://www.comrade.co.uk/path/to/source/") + end + + it "is part of the domain" do + uri.tld = "com" + + expect(uri.to_s).to eq("http://www.comrade.com/path/to/source/") + end + end +end + +describe Addressable::URI, "when given the path " + + "'c:\\windows\\My Documents 100%20\\foo.txt'" do + before do + @path = "c:\\windows\\My Documents 100%20\\foo.txt" + end + + it "should convert to " + + "\'file:///c:/windows/My%20Documents%20100%20/foo.txt\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/windows/My%20Documents%20100%20/foo.txt") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the path " + + "'file://c:\\windows\\My Documents 100%20\\foo.txt'" do + before do + @path = "file://c:\\windows\\My Documents 100%20\\foo.txt" + end + + it "should convert to " + + "\'file:///c:/windows/My%20Documents%20100%20/foo.txt\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/windows/My%20Documents%20100%20/foo.txt") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the path " + + "'file:c:\\windows\\My Documents 100%20\\foo.txt'" do + before do + @path = "file:c:\\windows\\My Documents 100%20\\foo.txt" + end + + it "should convert to " + + "\'file:///c:/windows/My%20Documents%20100%20/foo.txt\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/windows/My%20Documents%20100%20/foo.txt") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the path " + + "'file:/c:\\windows\\My Documents 100%20\\foo.txt'" do + before do + @path = "file:/c:\\windows\\My Documents 100%20\\foo.txt" + end + + it "should convert to " + + "\'file:///c:/windows/My%20Documents%20100%20/foo.txt\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/windows/My%20Documents%20100%20/foo.txt") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given the path " + + "'file:///c|/windows/My%20Documents%20100%20/foo.txt'" do + before do + @path = "file:///c|/windows/My%20Documents%20100%20/foo.txt" + end + + it "should convert to " + + "\'file:///c:/windows/My%20Documents%20100%20/foo.txt\'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("file:///c:/windows/My%20Documents%20100%20/foo.txt") + end + + it "should have an origin of 'file://'" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.origin).to eq('file://') + end +end + +describe Addressable::URI, "when given an http protocol URI" do + before do + @path = "http://example.com/" + end + + it "should not do any conversion at all" do + @uri = Addressable::URI.convert_path(@path) + expect(@uri.to_str).to eq("http://example.com/") + end +end + +class SuperString + def initialize(string) + @string = string.to_s + end + + def to_str + return @string + end +end + +describe Addressable::URI, "when parsing a non-String object" do + it "should correctly parse anything with a 'to_str' method" do + Addressable::URI.parse(SuperString.new(42)) + end + + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.parse(42) + end.to raise_error(TypeError) + end + + it "should correctly parse heuristically anything with a 'to_str' method" do + Addressable::URI.heuristic_parse(SuperString.new(42)) + end + + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.heuristic_parse(42) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when form encoding a hash" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.form_encode( + [["&one", "/1"], ["=two", "?2"], [":three", "#3"]] + )).to eq("%26one=%2F1&%3Dtwo=%3F2&%3Athree=%233") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.form_encode( + {"q" => "one two three"} + )).to eq("q=one+two+three") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.form_encode( + {"key" => nil} + )).to eq("key=") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.form_encode( + {"q" => ["one", "two", "three"]} + )).to eq("q=one&q=two&q=three") + end + + it "should result in correctly encoded newlines" do + expect(Addressable::URI.form_encode( + {"text" => "one\ntwo\rthree\r\nfour\n\r"} + )).to eq("text=one%0D%0Atwo%0D%0Athree%0D%0Afour%0D%0A%0D%0A") + end + + it "should result in a sorted percent encoded sequence" do + expect(Addressable::URI.form_encode( + [["a", "1"], ["dup", "3"], ["dup", "2"]], true + )).to eq("a=1&dup=2&dup=3") + end +end + +describe Addressable::URI, "when form encoding a non-Array object" do + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.form_encode(42) + end.to raise_error(TypeError) + end +end + +# See https://tools.ietf.org/html/rfc6749#appendix-B +describe Addressable::URI, "when form encoding the example value from OAuth 2" do + it "should result in correct values" do + expect(Addressable::URI.form_encode( + {"value" => " %&+£€"} + )).to eq("value=+%25%26%2B%C2%A3%E2%82%AC") + end +end + +# See https://tools.ietf.org/html/rfc6749#appendix-B +describe Addressable::URI, "when form unencoding the example value from OAuth 2" do + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "value=+%25%26%2B%C2%A3%E2%82%AC" + )).to eq([["value", " %&+£€"]]) + end +end + +describe Addressable::URI, "when form unencoding a string" do + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "%26one=%2F1&%3Dtwo=%3F2&%3Athree=%233" + )).to eq([["&one", "/1"], ["=two", "?2"], [":three", "#3"]]) + end + + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "q=one+two+three" + )).to eq([["q", "one two three"]]) + end + + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "text=one%0D%0Atwo%0D%0Athree%0D%0Afour%0D%0A%0D%0A" + )).to eq([["text", "one\ntwo\nthree\nfour\n\n"]]) + end + + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "a=1&dup=2&dup=3" + )).to eq([["a", "1"], ["dup", "2"], ["dup", "3"]]) + end + + it "should result in correct values" do + expect(Addressable::URI.form_unencode( + "key" + )).to eq([["key", nil]]) + end + + it "should result in correct values" do + expect(Addressable::URI.form_unencode("GivenName=Ren%C3%A9")).to eq( + [["GivenName", "René"]] + ) + end +end + +describe Addressable::URI, "when form unencoding a non-String object" do + it "should correctly parse anything with a 'to_str' method" do + Addressable::URI.form_unencode(SuperString.new(42)) + end + + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.form_unencode(42) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when normalizing a non-String object" do + it "should correctly parse anything with a 'to_str' method" do + Addressable::URI.normalize_component(SuperString.new(42)) + end + + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.normalize_component(42) + end.to raise_error(TypeError) + end + + it "should raise a TypeError for objects than cannot be converted" do + expect do + Addressable::URI.normalize_component("component", 42) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when normalizing a path with an encoded slash" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.parse("/path%2Fsegment/").normalize.path).to eq( + "/path%2Fsegment/" + ) + end +end + +describe Addressable::URI, "when normalizing a partially encoded string" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component( + "partially % encoded%21" + )).to eq("partially%20%25%20encoded!") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component( + "partially %25 encoded!" + )).to eq("partially%20%25%20encoded!") + end +end + +describe Addressable::URI, "when normalizing a unicode sequence" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component( + "/C%CC%A7" + )).to eq("/%C3%87") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component( + "/%C3%87" + )).to eq("/%C3%87") + end +end + +describe Addressable::URI, "when normalizing a multibyte string" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component("günther")).to eq( + "g%C3%BCnther" + ) + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component("g%C3%BCnther")).to eq( + "g%C3%BCnther" + ) + end +end + +describe Addressable::URI, "when normalizing a string but leaving some characters encoded" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.normalize_component("%58X%59Y%5AZ", "0-9a-zXY", "Y")).to eq( + "XX%59Y%5A%5A" + ) + end + + it "should not modify the character class" do + character_class = "0-9a-zXY" + + character_class_copy = character_class.dup + + Addressable::URI.normalize_component("%58X%59Y%5AZ", character_class, "Y") + + expect(character_class).to eq(character_class_copy) + end +end + +describe Addressable::URI, "when encoding IP literals" do + it "should work for IPv4" do + input = "http://127.0.0.1/" + expect(Addressable::URI.encode(input)).to eq(input) + end + + it "should work for IPv6" do + input = "http://[fe80::200:f8ff:fe21:67cf]/" + expect(Addressable::URI.encode(input)).to eq(input) + end +end + +describe Addressable::URI, "when encoding a string with existing encodings to upcase" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.encode_component("JK%4c", "0-9A-IKM-Za-z%", "L")).to eq("%4AK%4C") + end +end + +describe Addressable::URI, "when encoding a multibyte string" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.encode_component("günther")).to eq("g%C3%BCnther") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.encode_component( + "günther", /[^a-zA-Z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\-\.\_\~]/ + )).to eq("g%C3%BCnther") + end +end + +describe Addressable::URI, "when form encoding a multibyte string" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.form_encode({"GivenName" => "René"})).to eq( + "GivenName=Ren%C3%A9" + ) + end +end + +describe Addressable::URI, "when encoding a string with ASCII chars 0-15" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.encode_component("one\ntwo")).to eq("one%0Atwo") + end + + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.encode_component( + "one\ntwo", /[^a-zA-Z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\-\.\_\~]/ + )).to eq("one%0Atwo") + end +end + +describe Addressable::URI, "when unencoding a multibyte string" do + it "should result in correct percent encoded sequence" do + expect(Addressable::URI.unencode_component("g%C3%BCnther")).to eq("günther") + end + + it "should consistently use UTF-8 internally" do + expect(Addressable::URI.unencode_component("ski=%BA%DAɫ")).to eq("ski=\xBA\xDAɫ") + end + + it "should result in correct percent encoded sequence as a URI" do + expect(Addressable::URI.unencode( + "/path?g%C3%BCnther", ::Addressable::URI + )).to eq(Addressable::URI.new( + :path => "/path", :query => "günther" + )) + end +end + +describe Addressable::URI, "when partially unencoding a string" do + it "should unencode all characters by default" do + expect(Addressable::URI.unencode('%%25~%7e+%2b', String)).to eq('%%~~++') + end + + it "should unencode characters not in leave_encoded" do + expect(Addressable::URI.unencode('%%25~%7e+%2b', String, '~')).to eq('%%~%7e++') + end + + it "should leave characters in leave_encoded alone" do + expect(Addressable::URI.unencode('%%25~%7e+%2b', String, '%~+')).to eq('%%25~%7e+%2b') + end +end + +describe Addressable::URI, "when unencoding a bogus object" do + it "should raise a TypeError" do + expect do + Addressable::URI.unencode_component(42) + end.to raise_error(TypeError) + end + + it "should raise a TypeError" do + expect do + Addressable::URI.unencode("/path?g%C3%BCnther", Integer) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when encoding a bogus object" do + it "should raise a TypeError" do + expect do + Addressable::URI.encode(Object.new) + end.to raise_error(TypeError) + end + + it "should raise a TypeError" do + expect do + Addressable::URI.normalized_encode(Object.new) + end.to raise_error(TypeError) + end + + it "should raise a TypeError" do + expect do + Addressable::URI.encode_component("günther", Object.new) + end.to raise_error(TypeError) + end + + it "should raise a TypeError" do + expect do + Addressable::URI.encode_component(Object.new) + end.to raise_error(TypeError) + end +end + +describe Addressable::URI, "when given the input " + + "'http://example.com/'" do + before do + @input = "http://example.com/" + end + + it "should heuristically parse to 'http://example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com/") + end + + it "should not raise error when frozen" do + expect do + Addressable::URI.heuristic_parse(@input).freeze.to_s + end.not_to raise_error + end +end + +describe Addressable::URI, "when given the input " + + "'https://example.com/'" do + before do + @input = "https://example.com/" + end + + it "should heuristically parse to 'https://example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("https://example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'http:example.com/'" do + before do + @input = "http:example.com/" + end + + it "should heuristically parse to 'http://example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com/") + end + + it "should heuristically parse to 'http://example.com/' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'https:example.com/'" do + before do + @input = "https:example.com/" + end + + it "should heuristically parse to 'https://example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("https://example.com/") + end + + it "should heuristically parse to 'https://example.com/' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("https://example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'http://example.com/example.com/'" do + before do + @input = "http://example.com/example.com/" + end + + it "should heuristically parse to 'http://example.com/example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com/example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'http://prefix\\.example.com/'" do + before do + @input = "http://prefix\\.example.com/" + end + + it "should heuristically parse to 'http://prefix/.example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("prefix") + expect(@uri.to_s).to eq("http://prefix/.example.com/") + end + + it "should heuristically parse to 'http://prefix/.example.com/' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://prefix/.example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'http://p:\\/'" do + before do + @input = "http://p:\\/" + end + + it "should heuristically parse to 'http://p//'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("p") + expect(@uri.to_s).to eq("http://p//") + end + + it "should heuristically parse to 'http://p//' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://p//") + end +end + +describe Addressable::URI, "when given the input " + + "'http://p://'" do + before do + @input = "http://p://" + end + + it "should heuristically parse to 'http://p//'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("p") + expect(@uri.to_s).to eq("http://p//") + end + + it "should heuristically parse to 'http://p//' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://p//") + end +end + +describe Addressable::URI, "when given the input " + + "'http://p://p'" do + before do + @input = "http://p://p" + end + + it "should heuristically parse to 'http://p//p'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("p") + expect(@uri.to_s).to eq("http://p//p") + end + + it "should heuristically parse to 'http://p//p' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://p//p") + end +end + +describe Addressable::URI, "when given the input " + + "'http://prefix .example.com/'" do + before do + @input = "http://prefix .example.com/" + end + + # Justification here being that no browser actually tries to resolve this. + # They all treat this as a web search. + it "should heuristically parse to 'http://prefix%20.example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("prefix%20.example.com") + expect(@uri.to_s).to eq("http://prefix%20.example.com/") + end + + it "should heuristically parse to 'http://prefix%20.example.com/' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://prefix%20.example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "' http://www.example.com/ '" do + before do + @input = " http://www.example.com/ " + end + + it "should heuristically parse to 'http://prefix%20.example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.scheme).to eq("http") + expect(@uri.path).to eq("/") + expect(@uri.to_s).to eq("http://www.example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'http://prefix%2F.example.com/'" do + before do + @input = "http://prefix%2F.example.com/" + end + + it "should heuristically parse to 'http://prefix%2F.example.com/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.authority).to eq("prefix%2F.example.com") + expect(@uri.to_s).to eq("http://prefix%2F.example.com/") + end + + it "should heuristically parse to 'http://prefix%2F.example.com/' " + + "even with a scheme hint of 'ftp'" do + @uri = Addressable::URI.heuristic_parse(@input, {:scheme => 'ftp'}) + expect(@uri.to_s).to eq("http://prefix%2F.example.com/") + end +end + +describe Addressable::URI, "when given the input " + + "'/path/to/resource'" do + before do + @input = "/path/to/resource" + end + + it "should heuristically parse to '/path/to/resource'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("/path/to/resource") + end +end + +describe Addressable::URI, "when given the input " + + "'relative/path/to/resource'" do + before do + @input = "relative/path/to/resource" + end + + it "should heuristically parse to 'relative/path/to/resource'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("relative/path/to/resource") + end +end + +describe Addressable::URI, "when given the input " + + "'example.com'" do + before do + @input = "example.com" + end + + it "should heuristically parse to 'http://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com") + end +end + +describe Addressable::URI, "when given the input " + + "'example.com' and a scheme hint of 'ftp'" do + before do + @input = "example.com" + @hints = {:scheme => 'ftp'} + end + + it "should heuristically parse to 'http://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input, @hints) + expect(@uri.to_s).to eq("ftp://example.com") + end +end + +describe Addressable::URI, "when given the input " + + "'example.com:21' and a scheme hint of 'ftp'" do + before do + @input = "example.com:21" + @hints = {:scheme => 'ftp'} + end + + it "should heuristically parse to 'http://example.com:21'" do + @uri = Addressable::URI.heuristic_parse(@input, @hints) + expect(@uri.to_s).to eq("ftp://example.com:21") + end +end + +describe Addressable::URI, "when given the input " + + "'example.com/path/to/resource'" do + before do + @input = "example.com/path/to/resource" + end + + it "should heuristically parse to 'http://example.com/path/to/resource'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com/path/to/resource") + end +end + +describe Addressable::URI, "when given the input " + + "'http:///example.com'" do + before do + @input = "http:///example.com" + end + + it "should heuristically parse to 'http://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com") + end +end + +describe Addressable::URI, "when given the input which "\ + "start with digits and has specified port" do + before do + @input = "7777.example.org:8089" + end + + it "should heuristically parse to 'http://7777.example.org:8089'" do + uri = Addressable::URI.heuristic_parse(@input) + expect(uri.to_s).to eq("http://7777.example.org:8089") + end +end + +describe Addressable::URI, "when given the input " + + "'feed:///example.com'" do + before do + @input = "feed:///example.com" + end + + it "should heuristically parse to 'feed://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("feed://example.com") + end +end + +describe Addressable::URI, "when given the input " + + "'file://localhost/path/to/resource/'" do + before do + @input = "file://localhost/path/to/resource/" + end + + it "should heuristically parse to 'file:///path/to/resource/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("file:///path/to/resource/") + end +end + +describe Addressable::URI, "when given the input " + + "'file://path/to/resource/'" do + before do + @input = "file://path/to/resource/" + end + + it "should heuristically parse to 'file:///path/to/resource/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("file:///path/to/resource/") + end +end + +describe Addressable::URI, "when given the input " + + "'file://///path/to/resource/'" do + before do + @input = "file:///////path/to/resource/" + end + + it "should heuristically parse to 'file:////path/to/resource/'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("file:////path/to/resource/") + end +end + +describe Addressable::URI, "when given the input " + + "'feed://http://example.com'" do + before do + @input = "feed://http://example.com" + end + + it "should heuristically parse to 'feed:http://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("feed:http://example.com") + end +end + +describe Addressable::URI, "when given the input " + + "::URI.parse('http://example.com')" do + before do + @input = ::URI.parse('http://example.com') + end + + it "should heuristically parse to 'http://example.com'" do + @uri = Addressable::URI.heuristic_parse(@input) + expect(@uri.to_s).to eq("http://example.com") + end +end + +describe Addressable::URI, "when given the input: 'user@domain.com'" do + before do + @input = "user@domain.com" + end + + context "for heuristic parse" do + it "should remain 'mailto:user@domain.com'" do + uri = Addressable::URI.heuristic_parse("mailto:#{@input}") + expect(uri.to_s).to eq("mailto:user@domain.com") + end + + it "should have a scheme of 'mailto'" do + uri = Addressable::URI.heuristic_parse(@input) + expect(uri.to_s).to eq("mailto:user@domain.com") + expect(uri.scheme).to eq("mailto") + end + + it "should remain 'acct:user@domain.com'" do + uri = Addressable::URI.heuristic_parse("acct:#{@input}") + expect(uri.to_s).to eq("acct:user@domain.com") + end + + context "HTTP" do + before do + @uri = Addressable::URI.heuristic_parse("http://#{@input}/") + end + + it "should remain 'http://user@domain.com/'" do + expect(@uri.to_s).to eq("http://user@domain.com/") + end + + it "should have the username 'user' for HTTP basic authentication" do + expect(@uri.user).to eq("user") + end + end + end +end + +describe Addressable::URI, "when assigning query values" do + before do + @uri = Addressable::URI.new + end + + it "should correctly assign {:a => 'a', :b => ['c', 'd', 'e']}" do + @uri.query_values = {:a => "a", :b => ["c", "d", "e"]} + expect(@uri.query).to eq("a=a&b=c&b=d&b=e") + end + + it "should raise an error attempting to assign {'a' => {'b' => ['c']}}" do + expect do + @uri.query_values = { 'a' => {'b' => ['c'] } } + end.to raise_error(TypeError) + end + + it "should raise an error attempting to assign " + + "{:b => '2', :a => {:c => '1'}}" do + expect do + @uri.query_values = {:b => '2', :a => {:c => '1'}} + end.to raise_error(TypeError) + end + + it "should raise an error attempting to assign " + + "{:a => 'a', :b => [{:c => 'c', :d => 'd'}, " + + "{:e => 'e', :f => 'f'}]}" do + expect do + @uri.query_values = { + :a => "a", :b => [{:c => "c", :d => "d"}, {:e => "e", :f => "f"}] + } + end.to raise_error(TypeError) + end + + it "should raise an error attempting to assign " + + "{:a => 'a', :b => [{:c => true, :d => 'd'}, " + + "{:e => 'e', :f => 'f'}]}" do + expect do + @uri.query_values = { + :a => 'a', :b => [{:c => true, :d => 'd'}, {:e => 'e', :f => 'f'}] + } + end.to raise_error(TypeError) + end + + it "should raise an error attempting to assign " + + "{:a => 'a', :b => {:c => true, :d => 'd'}}" do + expect do + @uri.query_values = { + :a => 'a', :b => {:c => true, :d => 'd'} + } + end.to raise_error(TypeError) + end + + it "should raise an error attempting to assign " + + "{:a => 'a', :b => {:c => true, :d => 'd'}}" do + expect do + @uri.query_values = { + :a => 'a', :b => {:c => true, :d => 'd'} + } + end.to raise_error(TypeError) + end + + it "should correctly assign {:a => 1, :b => 1.5}" do + @uri.query_values = { :a => 1, :b => 1.5 } + expect(@uri.query).to eq("a=1&b=1.5") + end + + it "should raise an error attempting to assign " + + "{:z => 1, :f => [2, {999.1 => [3,'4']}, ['h', 'i']], " + + ":a => {:b => ['c', 'd'], :e => true, :y => 0.5}}" do + expect do + @uri.query_values = { + :z => 1, + :f => [ 2, {999.1 => [3,'4']}, ['h', 'i'] ], + :a => { :b => ['c', 'd'], :e => true, :y => 0.5 } + } + end.to raise_error(TypeError) + end + + it "should correctly assign {}" do + @uri.query_values = {} + expect(@uri.query).to eq('') + end + + it "should correctly assign nil" do + @uri.query_values = nil + expect(@uri.query).to eq(nil) + end + + it "should correctly sort {'ab' => 'c', :ab => 'a', :a => 'x'}" do + @uri.query_values = {'ab' => 'c', :ab => 'a', :a => 'x'} + expect(@uri.query).to eq("a=x&ab=a&ab=c") + end + + it "should correctly assign " + + "[['b', 'c'], ['b', 'a'], ['a', 'a']]" do + # Order can be guaranteed in this format, so preserve it. + @uri.query_values = [['b', 'c'], ['b', 'a'], ['a', 'a']] + expect(@uri.query).to eq("b=c&b=a&a=a") + end + + it "should preserve query string order" do + query_string = (('a'..'z').to_a.reverse.map { |e| "#{e}=#{e}" }).join("&") + @uri.query = query_string + original_uri = @uri.to_s + @uri.query_values = @uri.query_values(Array) + expect(@uri.to_s).to eq(original_uri) + end + + describe 'when a hash with mixed types is assigned to query_values' do + it 'should not raise an error' do + skip 'Issue #94' + expect { subject.query_values = { "page" => "1", :page => 2 } }.to_not raise_error + end + end +end + +describe Addressable::URI, "when assigning path values" do + before do + @uri = Addressable::URI.new + end + + it "should correctly assign paths containing colons" do + @uri.path = "acct:bob@sporkmonger.com" + expect(@uri.path).to eq("acct:bob@sporkmonger.com") + expect(@uri.normalize.to_str).to eq("acct%2Fbob@sporkmonger.com") + expect { @uri.to_s }.to raise_error( + Addressable::URI::InvalidURIError + ) + end + + it "should correctly assign paths containing colons" do + @uri.path = "/acct:bob@sporkmonger.com" + @uri.authority = "example.com" + expect(@uri.normalize.to_str).to eq("//example.com/acct:bob@sporkmonger.com") + end + + it "should correctly assign paths containing colons" do + @uri.path = "acct:bob@sporkmonger.com" + @uri.scheme = "something" + expect(@uri.normalize.to_str).to eq("something:acct:bob@sporkmonger.com") + end + + it "should not allow relative paths to be assigned on absolute URIs" do + expect do + @uri.scheme = "http" + @uri.host = "example.com" + @uri.path = "acct:bob@sporkmonger.com" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should not allow relative paths to be assigned on absolute URIs" do + expect do + @uri.path = "acct:bob@sporkmonger.com" + @uri.scheme = "http" + @uri.host = "example.com" + end.to raise_error(Addressable::URI::InvalidURIError) + end + + it "should not allow relative paths to be assigned on absolute URIs" do + expect do + @uri.path = "uuid:0b3ecf60-3f93-11df-a9c3-001f5bfffe12" + @uri.scheme = "urn" + end.not_to raise_error + end +end + +describe Addressable::URI, "when initializing a subclass of Addressable::URI" do + before do + @uri = Class.new(Addressable::URI).new + end + + it "should have the same class after being parsed" do + expect(@uri.class).to eq(Addressable::URI.parse(@uri).class) + end + + it "should have the same class as its duplicate" do + expect(@uri.class).to eq(@uri.dup.class) + end + + it "should have the same class after being normalized" do + expect(@uri.class).to eq(@uri.normalize.class) + end + + it "should have the same class after being merged" do + expect(@uri.class).to eq(@uri.merge(:path => 'path').class) + end + + it "should have the same class after being joined" do + expect(@uri.class).to eq(@uri.join('path').class) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/spec_helper.rb b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/spec_helper.rb new file mode 100644 index 0000000..bd8e395 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/spec/spec_helper.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'bundler/setup' +require 'rspec/its' + +begin + require 'coveralls' + Coveralls.wear! do + add_filter "spec/" + add_filter "vendor/" + end +rescue LoadError + warn "warning: coveralls gem not found; skipping Coveralls" + require 'simplecov' + SimpleCov.start do + add_filter "spec/" + add_filter "vendor/" + end +end if Gem.loaded_specs.key?("simplecov") + +class TestHelper + def self.native_supported? + mri = RUBY_ENGINE == "ruby" + windows = RUBY_PLATFORM.include?("mingw") + + mri && !windows + end +end + +RSpec.configure do |config| + config.warnings = true + config.filter_run_when_matching :focus +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/clobber.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/clobber.rake new file mode 100644 index 0000000..a9e32b3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/clobber.rake @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +desc "Remove all build products" +task "clobber" diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/gem.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/gem.rake new file mode 100644 index 0000000..1f793ba --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/gem.rake @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +require "rubygems/package_task" + +namespace :gem do + GEM_SPEC = Gem::Specification.new do |s| + s.name = PKG_NAME + s.version = PKG_VERSION + s.summary = PKG_SUMMARY + s.description = PKG_DESCRIPTION + + s.files = PKG_FILES.to_a + + s.extra_rdoc_files = %w( README.md ) + s.rdoc_options.concat ["--main", "README.md"] + + if !s.respond_to?(:add_development_dependency) + puts "Cannot build Gem with this version of RubyGems." + exit(1) + end + + s.required_ruby_version = ">= 2.0" + + s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 5.0" + s.add_development_dependency "bundler", ">= 1.0", "< 3.0" + + s.require_path = "lib" + + s.author = "Bob Aman" + s.email = "bob@sporkmonger.com" + s.homepage = "https://github.com/sporkmonger/addressable" + s.license = "Apache-2.0" + end + + Gem::PackageTask.new(GEM_SPEC) do |p| + p.gem_spec = GEM_SPEC + p.need_tar = true + p.need_zip = true + end + + desc "Generates .gemspec file" + task :gemspec do + spec_string = GEM_SPEC.to_ruby + File.open("#{GEM_SPEC.name}.gemspec", "w") do |file| + file.write spec_string + end + end + + desc "Show information about the gem" + task :debug do + puts GEM_SPEC.to_ruby + end + + desc "Install the gem" + task :install => ["clobber", "gem:package"] do + sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}" + end + + desc "Uninstall the gem" + task :uninstall do + installed_list = Gem.source_index.find_name(PKG_NAME) + if installed_list && + (installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION)) + sh( + "#{SUDO} gem uninstall --version '#{PKG_VERSION}' " + + "--ignore-dependencies --executables #{PKG_NAME}" + ) + end + end + + desc "Reinstall the gem" + task :reinstall => [:uninstall, :install] + + desc "Package for release" + task :release => ["gem:package", "gem:gemspec"] do |t| + v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z" + abort "Versions don't match #{v} vs #{PROJ.version}" if v != PKG_VERSION + pkg = "pkg/#{GEM_SPEC.full_name}" + + changelog = File.open("CHANGELOG.md") { |file| file.read } + + puts "Releasing #{PKG_NAME} v. #{PKG_VERSION}" + Rake::Task["git:tag:create"].invoke + end +end + +desc "Alias to gem:package" +task "gem" => "gem:package" + +task "gem:release" => "gem:gemspec" + +task "clobber" => ["gem:clobber_package"] diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/git.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/git.rake new file mode 100644 index 0000000..1238c8d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/git.rake @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +namespace :git do + namespace :tag do + desc "List tags from the Git repository" + task :list do + tags = `git tag -l` + tags.gsub!("\r", "") + tags = tags.split("\n").sort {|a, b| b <=> a } + puts tags.join("\n") + end + + desc "Create a new tag in the Git repository" + task :create do + changelog = File.open("CHANGELOG.md", "r") { |file| file.read } + puts "-" * 80 + puts changelog + puts "-" * 80 + puts + + v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z" + abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION + + git_status = `git status` + if git_status !~ /^nothing to commit/ + abort "Working directory isn't clean." + end + + tag = "#{PKG_NAME}-#{PKG_VERSION}" + msg = "Release #{PKG_NAME}-#{PKG_VERSION}" + + existing_tags = `git tag -l #{PKG_NAME}-*`.split('\n') + if existing_tags.include?(tag) + warn("Tag already exists, deleting...") + unless system "git tag -d #{tag}" + abort "Tag deletion failed." + end + end + puts "Creating git tag '#{tag}'..." + unless system "git tag -a -m \"#{msg}\" #{tag}" + abort "Tag creation failed." + end + end + end +end + +task "gem:release" => "git:tag:create" diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/metrics.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/metrics.rake new file mode 100644 index 0000000..107cc24 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/metrics.rake @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +namespace :metrics do + task :lines do + lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 + for file_name in FileList["lib/**/*.rb"] + f = File.open(file_name) + while line = f.gets + lines += 1 + next if line =~ /^\s*$/ + next if line =~ /^\s*#/ + codelines += 1 + end + puts "L: #{sprintf("%4d", lines)}, " + + "LOC #{sprintf("%4d", codelines)} | #{file_name}" + total_lines += lines + total_codelines += codelines + + lines, codelines = 0, 0 + end + + puts "Total: Lines #{total_lines}, LOC #{total_codelines}" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/profile.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/profile.rake new file mode 100644 index 0000000..b697d48 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/profile.rake @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +namespace :profile do + desc "Profile Template match memory allocations" + task :template_match_memory do + require "memory_profiler" + require "addressable/template" + + start_at = Time.now.to_f + template = Addressable::Template.new("http://example.com/{?one,two,three}") + report = MemoryProfiler.report do + 30_000.times do + template.match( + "http://example.com/?one=one&two=floo&three=me" + ) + end + end + end_at = Time.now.to_f + print_options = { scale_bytes: true, normalize_paths: true } + puts "\n\n" + + if ENV["CI"] + report.pretty_print(print_options) + else + t_allocated = report.scale_bytes(report.total_allocated_memsize) + t_retained = report.scale_bytes(report.total_retained_memsize) + + puts "Total allocated: #{t_allocated} (#{report.total_allocated} objects)" + puts "Total retained: #{t_retained} (#{report.total_retained} objects)" + puts "Took #{end_at - start_at} seconds" + + FileUtils.mkdir_p("tmp") + report.pretty_print(to_file: "tmp/memprof.txt", **print_options) + end + end + + desc "Profile URI parse memory allocations" + task :memory do + require "memory_profiler" + require "addressable/uri" + if ENV["IDNA_MODE"] == "pure" + Addressable.send(:remove_const, :IDNA) + load "addressable/idna/pure.rb" + end + + start_at = Time.now.to_f + report = MemoryProfiler.report do + 30_000.times do + Addressable::URI.parse( + "http://google.com/stuff/../?with_lots=of¶ms=asdff#!stuff" + ).normalize + end + end + end_at = Time.now.to_f + print_options = { scale_bytes: true, normalize_paths: true } + puts "\n\n" + + if ENV["CI"] + report.pretty_print(**print_options) + else + t_allocated = report.scale_bytes(report.total_allocated_memsize) + t_retained = report.scale_bytes(report.total_retained_memsize) + + puts "Total allocated: #{t_allocated} (#{report.total_allocated} objects)" + puts "Total retained: #{t_retained} (#{report.total_retained} objects)" + puts "Took #{end_at - start_at} seconds" + + FileUtils.mkdir_p("tmp") + report.pretty_print(to_file: "tmp/memprof.txt", **print_options) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/rspec.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/rspec.rake new file mode 100644 index 0000000..e3d9f01 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/rspec.rake @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require "rspec/core/rake_task" + +namespace :spec do + RSpec::Core::RakeTask.new(:simplecov) do |t| + t.pattern = FileList['spec/**/*_spec.rb'] + t.rspec_opts = %w[--color --format documentation] unless ENV["CI"] + end + + namespace :simplecov do + desc "Browse the code coverage report." + task :browse => "spec:simplecov" do + require "launchy" + Launchy.open("coverage/index.html") + end + end +end + +desc "Alias to spec:simplecov" +task "spec" => "spec:simplecov" + +task "clobber" => ["spec:clobber_simplecov"] diff --git a/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/yard.rake b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/yard.rake new file mode 100644 index 0000000..515f960 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/addressable-2.8.0/tasks/yard.rake @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require "rake" + +begin + require "yard" + require "yard/rake/yardoc_task" + + namespace :doc do + desc "Generate Yardoc documentation" + YARD::Rake::YardocTask.new do |yardoc| + yardoc.name = "yard" + yardoc.options = ["--verbose", "--markup", "markdown"] + yardoc.files = FileList[ + "lib/**/*.rb", "ext/**/*.c", + "README.md", "CHANGELOG.md", "LICENSE.txt" + ].exclude(/idna/) + end + end + + task "clobber" => ["doc:clobber_yard"] + + desc "Alias to doc:yard" + task "doc" => "doc:yard" +rescue LoadError + # If yard isn't available, it's not the end of the world + desc "Alias to doc:rdoc" + task "doc" => "doc:rdoc" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/README b/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/README new file mode 100644 index 0000000..91595a3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/README @@ -0,0 +1,9 @@ +Provides functions for lunar phases and lunar month dates (eg. new/full moon) + +This file is a thoughtless manual compilation of Astro::MoonPhase perl +module (which, in turn, is influenced by moontool.c). I don't know +how it all works. + +This gem contains an example script (bin/moon.rb), which hopefully helps to +understand the API of this module. + diff --git a/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/lib/astro/moon.rb b/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/lib/astro/moon.rb new file mode 100644 index 0000000..cd8b9f9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/astro_moon-0.2/lib/astro/moon.rb @@ -0,0 +1,337 @@ +require 'date' + +module Astro # :nodoc: + # + # Provides functions for lunar phases and lunar month dates (eg. new/full + # moon) + # + # This file is a thoughtless manual compilation of Astro::MoonPhase perl + # module (which, in turn, is influenced by moontool.c). I don't know + # how it all works. + module Moon # :doc: + class << self + + # a container structure for phase() return value. accessors: + # phase - moon phase, 0 or 1 for new moon, 0.5 for full moon, etc + # illumination - moon illumination, 0.0 .. 0.1 + # age - moon age, in days from the most recent new moon + # distance - moon distance from earth, in kilometers + # angle - moon angle + # sun_distance - sun distance from earth, in kilometers + # sun_angle - sun angle + Phase = Struct.new(:phase, :illumination, :age, :distance, :angle, + :sun_distance, :sun_angle) + + # a container structure for phasehunt() return value. accessors: + # moon_start - a DateTime of the most recent new moon + # moon_end - a DateTime of the next new moon + # moon_fill - a DateTime of the full moon of this lunar month + # first_quarter, last_quarter -- <...> + PhaseHunt = Struct.new(:moon_start, :first_quarter, :moon_full, + :last_quarter, :moon_end) + + # Astronomical constants. + # 1980 January 0.0 + EPOCH = 2444238.5 + + # Constants defining the Sun's apparent orbit. + # + # ecliptic longitude of the Sun at epoch 1980.0 + ELONGE = 278.833540 + # ecliptic longitude of the Sun at perigee + ELONGP = 282.596403 + # eccentricity of Earth's orbit + ECCENT = 0.016718 + # semi-major axis of Earth's orbit, km + SUNSMAX = 1.495985e8 + + # sun's angular size, degrees, at semi-major axis distance + SUNANGSIZ = 0.533128 + + # Elements of the Moon's orbit, epoch 1980.0. + + # moon's mean longitude at the epoch + MMLONG = 64.975464 + # mean longitude of the perigee at the epoch + MMLONGP = 349.383063 + # mean longitude of the node at the epoch + MLNODE = 151.950429 + # inclination of the Moon's orbit + MINC = 5.145396 + # eccentricity of the Moon's orbit + MECC = 0.054900 + # moon's angular size at distance a from Earth + MANGSIZ = 0.5181 + # semi-major axis of Moon's orbit in km + MSMAX = 384401.0 + # parallax at distance a from Earth + MPARALLAX = 0.9507 + # synodic month (new Moon to new Moon) + SYNMONTH = 29.53058868 + + + # Finds the key dates of the specified lunar month. + # Takes a DateTime object (or creates one using now() function). + # Returns a PhaseHunt struct instance. (see Constants section) + # + # # find the date/time of the full moon in this lunar month + # Astro::Moon.phasehunt.moon_full.strftime("%D %T %Z") \ + # # => "03/04/07 02:17:40 +0300" + + def phasehunt(date = nil) + date = DateTime.now if !date + sdate = date.ajd + + adate = sdate - 45 + ad1 = DateTime.jd(adate) + + k1 = ((ad1.year + ((ad1.month - 1) * + (1.0 / 12.0)) - 1900) * 12.3685).floor + + adate = nt1 = meanphase(adate, k1) + + while true + adate += SYNMONTH + k2 = k1 + 1 + nt2 = meanphase(adate, k2) + break if nt1 <= sdate && nt2 > sdate + nt1 = nt2 + k1 = k2 + end + + return PhaseHunt.new(*[ + truephase(k1, 0.0), + truephase(k1, 0.25), + truephase(k1, 0.5), + truephase(k1, 0.75), + truephase(k2, 0.0) + ].map { + |_| _.new_offset(date.offset) + }) + end + + # Finds the lunar phase for the specified date. + # Takes a DateTime object (or creates one using now() function). + # Returns a Phase struct instance. (see Constants section) + # + # # find the current moon illumination, in percents + # Astro::Moon.phase.illumination * 100 # => 63.1104513958699 + # + # # find the current moon phase (new moon is 0 or 100, + # # full moon is 50, etc) + # Astro::Moon.phase.phase * 100 # => 70.7802812241989 + + def phase(dt = nil) + dt = DateTime.now if !dt + pdate = dt.ajd + + # Calculation of the Sun's position. + + day = pdate - EPOCH # date within epoch + n = ((360 / 365.2422) * day) % 360.0 + m = (n + ELONGE - ELONGP) % 360.0 # convert from perigee + # co-ordinates to epoch 1980.0 + ec = kepler(m, ECCENT) # solve equation of Kepler + ec = Math.sqrt((1 + ECCENT) / (1 - ECCENT)) * Math.tan(ec / 2) + ec = 2 * todeg(Math.atan(ec)) # true anomaly + lambdasun = (ec + ELONGP) % 360.0 # Sun's geocentric ecliptic + # longitude + # Orbital distance factor. + f = ((1 + ECCENT * Math.cos(torad(ec))) / (1 - ECCENT * ECCENT)) + sundist = SUNSMAX / f # distance to Sun in km + sunang = f * SUNANGSIZ # Sun's angular size in degrees + + # Calculation of the Moon's position. + + # Moon's mean longitude. + ml = (13.1763966 * day + MMLONG) % 360.0 + + # Moon's mean anomaly. + mm = (ml - 0.1114041 * day - MMLONGP) % 360.0 + + # Moon's ascending node mean longitude. + mn = (MLNODE - 0.0529539 * day) % 360.0 + + # Evection. + ev = 1.2739 * Math.sin(torad(2 * (ml - lambdasun) - mm)) + + # Annual equation. + ae = 0.1858 * Math.sin(torad(m)) + + # Correction term. + a3 = 0.37 * Math.sin(torad(m)) + + # Corrected anomaly. + mmp = mm + ev - ae - a3 + + # Correction for the equation of the centre. + mec = 6.2886 * Math.sin(torad(mmp)) + + # Another correction term. + a4 = 0.214 * Math.sin(torad(2 * mmp)) + + # Corrected longitude. + lp = ml + ev + mec - ae + a4 + + # Variation. + v = 0.6583 * Math.sin(torad(2 * (lp - lambdasun))) + + # True longitude. + lpp = lp + v + + # Corrected longitude of the node. + np = mn - 0.16 * Math.sin(torad(m)) + + # Y inclination coordinate. + y = Math.sin(torad(lpp - np)) * Math.cos(torad(MINC)) + + # X inclination coordinate. + x = Math.cos(torad(lpp - np)) + + # Ecliptic longitude. + lambdamoon = todeg(Math.atan2(y, x)) + lambdamoon += np + + # Ecliptic latitude. + betam = todeg(Math.asin(Math.sin(torad(lpp - np)) * + Math.sin(torad(MINC)))) + + # Calculation of the phase of the Moon. + + # Age of the Moon in degrees. + moonage = lpp - lambdasun + + # Phase of the Moon. + moonphase = (1 - Math.cos(torad(moonage))) / 2 + + # Calculate distance of moon from the centre of the Earth. + + moondist = (MSMAX * (1 - MECC * MECC)) / + (1 + MECC * Math.cos(torad(mmp + mec))) + + # Calculate Moon's angular diameter. + + moondfrac = moondist / MSMAX + moonang = MANGSIZ / moondfrac + + # Calculate Moon's parallax. + + moonpar = MPARALLAX / moondfrac + + pphase = moonphase + mpfrac = (moonage % 360) / 360.0 + mage = SYNMONTH * mpfrac + dist = moondist + angdia = moonang + sudist = sundist + suangdia = sunang + Phase.new(mpfrac, pphase, mage, dist, angdia, sudist, suangdia) + end + + private + + def torad(x) ; x * Math::PI / 180.0 ; end + def todeg(x) ; x * 180.0 / Math::PI ; end + def dsin(x) ; Math.sin(torad(x)) ; end + def dcos(x) ; Math.sin(torad(x)) ; end + + def meanphase(sdate, k) + ## Time in Julian centuries from 1900 January 0.5 + t = (sdate - 2415020.0) / 36525 + t2 = t * t + t3 = t2 * t + + nt1 = 2415020.75933 + + SYNMONTH * k + + 0.0001178 * t2 - + 0.000000155 * t3 + + 0.00033 * dsin(166.56 + 132.87 * t - 0.009173 * t2) + end + + def truephase(k, phase) + apcor = 0 + + k += phase # add phase to new moon time + t = k / 1236.85 # time in Julian centuries from + # 1900 January 0.5 + t2 = t * t # square for frequent use + t3 = t2 * t # cube for frequent use + + # mean time of phase */ + pt = 2415020.75933 + + SYNMONTH * k + + 0.0001178 * t2 - + 0.000000155 * t3 + + 0.00033 * dsin(166.56 + 132.87 * t - 0.009173 * t2) + + # Sun's mean anomaly + m = 359.2242 + 29.10535608 * k - 0.0000333 * t2 - 0.00000347 * t3 + + # Moon's mean anomaly + mprime = + 306.0253 + 385.81691806 * k + 0.0107306 * t2 + 0.00001236 * t3 + + # Moon's argument of latitude + f = 21.2964 + 390.67050646 * k - 0.0016528 * t2 - 0.00000239 * t3 + + if phase < 0.01 || (phase - 0.5).abs < 0.01 + # Corrections for New and Full Moon. + + pt += (0.1734 - 0.000393 * t) * dsin(m) + + 0.0021 * dsin(2 * m) - + 0.4068 * dsin(mprime) + + 0.0161 * dsin(2 * mprime) - + 0.0004 * dsin(3 * mprime) + + 0.0104 * dsin(2 * f) - + 0.0051 * dsin(m + mprime) - + 0.0074 * dsin(m - mprime) + + 0.0004 * dsin(2 * f + m) - + 0.0004 * dsin(2 * f - m) - + 0.0006 * dsin(2 * f + mprime) + + 0.0010 * dsin(2 * f - mprime) + + 0.0005 * dsin(m + 2 * mprime) + apcor = 1 + elsif (phase - 0.25).abs < 0.01 || (phase - 0.75).abs < 0.01 + pt += (0.1721 - 0.0004 * t) * dsin(m) + + 0.0021 * dsin(2 * m) - + 0.6280 * dsin(mprime) + + 0.0089 * dsin(2 * mprime) - + 0.0004 * dsin(3 * mprime) + + 0.0079 * dsin(2 * f) - + 0.0119 * dsin(m + mprime) - + 0.0047 * dsin(m - mprime) + + 0.0003 * dsin(2 * f + m) - + 0.0004 * dsin(2 * f - m) - + 0.0006 * dsin(2 * f + mprime) + + 0.0021 * dsin(2 * f - mprime) + + 0.0003 * dsin(m + 2 * mprime) + + 0.0004 * dsin(m - 2 * mprime) - + 0.0003 * dsin(2 * m + mprime) + + corr = 0.0028 - 0.0004 * dcos(m) + 0.0003 * dcos(mprime) + pt += (phase < 0.5 ? corr : -corr) + apcor = 1; + end + + if !apcor || apcor == 0 + raise "truephase() called with invalid phase selector (#{phase})." + end + return DateTime.jd(pt + 0.5) + end + + def kepler(m, ecc) + m = torad(m) + e = m; + loop do + delta = e - ecc * Math.sin(e) - m + e -= delta / (1 - ecc * Math.cos(e)) + break if delta.abs <= 1e-6 + end + return e + end + + end + end +end + + diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.circleci/config.yml b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.circleci/config.yml new file mode 100644 index 0000000..db164c2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.circleci/config.yml @@ -0,0 +1,126 @@ +version: 2.1 + +commands: + setup-env: + description: Sets up the testing environment + steps: + - run: + name: Install OS packages + command: apk add git build-base ruby-dev ruby-etc ruby-json libsodium + - checkout + - run: + name: "Ruby version" + command: | + ruby -v + echo $RUBY_VERSION > ruby_version.txt + - restore_cache: + keys: + - bundle-cache-v1-{{ checksum "ruby_version.txt" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "discordrb.gemspec" }} + - bundle-cache-v1-{{ checksum "ruby_version.txt" }}-{{ .Branch }} + - bundle-cache-v1-{{ checksum "ruby_version.txt" }} + - run: + name: Install dependencies + command: bundle install --path vendor/bundle + - save_cache: + key: bundle-cache-v1-{{ checksum "ruby_version.txt" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "discordrb.gemspec" }} + paths: + - ./vendor/bundle + +jobs: + test_ruby_25: + docker: + - image: ruby:2.5-alpine + steps: + - setup-env + - run: + name: Run RSpec + command: bundle exec rspec + + test_ruby_26: + docker: + - image: ruby:2.6-alpine + steps: + - setup-env + - run: + name: Run RSpec + command: bundle exec rspec + + test_ruby_27: + docker: + - image: ruby:2.7-alpine + steps: + - setup-env + - run: + name: Run RSpec + command: bundle exec rspec + + rubocop: + docker: + - image: ruby:2.5-alpine + steps: + - setup-env + - run: + name: Run Rubocop + command: bundle exec rubocop -P + + yard: + docker: + - image: ruby:2.5-alpine + steps: + - setup-env + - attach_workspace: + at: /tmp/workspace + - run: + name: Run YARD + command: bundle exec yard --output-dir /tmp/workspace/docs + - persist_to_workspace: + root: /tmp/workspace + paths: + - docs + + pages: + machine: true + steps: + - attach_workspace: + at: /tmp/workspace + - run: + name: Clone docs + command: git clone $CIRCLE_REPOSITORY_URL -b gh-pages . + - add_ssh_keys: + fingerprints: + - "9a:4c:50:94:23:46:81:74:41:97:87:04:4e:59:4b:4e" + - run: + name: Push updated docs + command: | + git config user.name "Circle CI" + git config user.email "ci-build@shardlab.dev" + + SOURCE_BRANCH=$CIRCLE_BRANCH + if [ -n "$CIRCLE_TAG" ]; then + SOURCE_BRANCH=$CIRCLE_TAG + fi + + mkdir -p $SOURCE_BRANCH + rm -rf $SOURCE_BRANCH/* + cp -r /tmp/workspace/docs/. ./$SOURCE_BRANCH/ + + git add $SOURCE_BRANCH + git commit --allow-empty -m "[skip ci] Deploy docs" + git push -u origin gh-pages + +workflows: + test: + jobs: + - test_ruby_25 + - test_ruby_26 + - test_ruby_27 + - rubocop + - yard + deploy: + jobs: + - yard: + filters: {branches: {only: main}, tags: {only: /^v.*/}} + - pages: + requires: + - yard + filters: {branches: {only: main}, tags: {only: /^v.*/}} diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.codeclimate.yml b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.codeclimate.yml new file mode 100644 index 0000000..b86b6ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.codeclimate.yml @@ -0,0 +1,16 @@ +--- +engines: + duplication: + enabled: true + config: + languages: + - ruby + fixme: + enabled: true + rubocop: + enabled: true +ratings: + paths: + - "**.rb" +exclude_paths: +- spec/ diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/CONTRIBUTING.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/CONTRIBUTING.md new file mode 100644 index 0000000..d945a59 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing guidelines + +Any contributions are very much appreciated! This project is relatively relaxed when it comes to guidelines, however +there are still some things that would be nice to have considered. + +For bug reports, please try to include a code sample if at all appropriate for +the issue, so we can reproduce it on our own machines. + +For PRs, please make sure that you tested your code before every push; it's a little annoying to keep having to get back +to a PR because of small avoidable oversights. (Huge bonus points if you're adding specs for your code! This project +has very few specs in places where it should have more so every added spec is very much appreciated.) + +If you have any questions at all, don't be afraid to ask in the [discordrb channel on Discord](https://discord.gg/cyK3Hjm). diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/bug_report.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..529140c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug report +about: Report a bug to help us improve the library + +--- + +# Summary + + + +--- + +## Environment + + + +**Ruby version:** + + + +**Discordrb version:** + + diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..0fe2311 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: Feature Request +about: Request a new feature, or change an existing one + +--- + + diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/pull_request_template.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/pull_request_template.md new file mode 100644 index 0000000..59243a2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.github/pull_request_template.md @@ -0,0 +1,37 @@ +# Summary + + + +--- + + + +## Added + +## Changed + +## Deprecated + +## Removed + +## Fixed diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.gitignore b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.gitignore new file mode 100644 index 0000000..595b35c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.gitignore @@ -0,0 +1,16 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/profiles/ +/tmp/ +/.idea/ +.DS_Store +*.gem +**.sw* + +/vendor/bundle diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.overcommit.yml b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.overcommit.yml new file mode 100644 index 0000000..99a942c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.overcommit.yml @@ -0,0 +1,7 @@ +PreCommit: + RuboCop: + enabled: true + on_warn: fail # Treat all warnings as failures + + AuthorName: + enabled: false diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rspec b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rubocop.yml b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rubocop.yml new file mode 100644 index 0000000..108077b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.rubocop.yml @@ -0,0 +1,62 @@ +require: rubocop-performance + +inherit_mode: + merge: + - AllowedNames + +AllCops: + NewCops: enable + TargetRubyVersion: 2.5 + +# Disable line length checks +Layout/LineLength: + Enabled: false + +# TODO: Larger refactor +Lint/MissingSuper: + Enabled: false + +# Allow 'Pokémon-style' exception handling +Lint/RescueException: + Enabled: false + +# Disable all metrics. +Metrics: + Enabled: false + +# Allow some common and/or obvious short method params +Naming/MethodParameterName: + AllowedNames: + - e + +# Ignore `eval` in the examples folder +Security/Eval: + Exclude: + - examples/**/* + +# https://stackoverflow.com/q/4763121/ +Style/Alias: + Enabled: false + +# Prefer compact module/class defs +Style/ClassAndModuleChildren: + Enabled: false + +# So RuboCop doesn't complain about application IDs +Style/NumericLiterals: + Exclude: + - examples/**/* + +# TODO: Requires breaking changes +Style/OptionalBooleanParameter: + Enabled: false + +# Prefer explicit arguments in case global variables like `$;` or `$,` are changed +Style/RedundantArgument: + Enabled: false + +# Prefer |m, e| for the `reduce` block arguments +Style/SingleLineBlockParams: + Methods: + - reduce: [m, e] + - inject: [m, e] diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.travis.yml new file mode 100644 index 0000000..d0734d0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.travis.yml @@ -0,0 +1,32 @@ +language: ruby +rvm: + - 2.5 + - 2.6 +before_script: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -o ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build + - sudo apt-get install libsodium-dev +script: + - bundle exec rspec spec + - bundle exec rubocop -c .rubocop.yml + - bin/travis_build_docs.sh +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT +deploy: + - provider: pages + skip-cleanup: true + github-token: $GITHUB_TOKEN + keep-history: true + local-dir: docs + on: + branch: master + rvm: 2.6 + - provider: pages + skip-cleanup: true + github-token: $GITHUB_TOKEN + keep-history: true + local-dir: docs + on: + tags: true + rvm: 2.6 diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.yardopts b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.yardopts new file mode 100644 index 0000000..800a9fb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/.yardopts @@ -0,0 +1 @@ +--markup markdown --hide-tag todo --fail-on-warning diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/CHANGELOG.md new file mode 100644 index 0000000..7664cf0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/CHANGELOG.md @@ -0,0 +1,1199 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [3.4.0] - 2020-12-06 +[3.4.0]: https://github.com/shardlab/discordrb/releases/tag/v3.3.0 + +[View diff for this release.](https://github.com/shardlab/discordrb/compare/v3.4.0...v3.3.0) + +### Summary + +This release has been a _very_ long time coming. It brings countless fixes, performance increases, features, and changes. So many in fact, that it's only feasible to put the major hilights in summary. + +The largest additions are that of intents support and a massive performance increase in our websocket read loop. + +Intents allow you to pick and choose what types of events are fed to your bot over the gateway. An example usage would be: + +```ruby +Discordrb::Bot.new(token: 'B0T.T0K3N', intents: %i[servers server_messages]) +``` + + +In this example, we would only recieve the following events +- GUILD_CREATE +- GUILD_UPDATE +- GUILD_DELETE +- GUILD_ROLE_CREATE +- GUILD_ROLE_UPDATE +- GUILD_ROLE_DELETE +- CHANNEL_CREATE +- CHANNEL_UPDATE +- CHANNEL_DELETE +- CHANNEL_PINS_UPDATE +- MESSAGE_CREATE +- MESSAGE_UPDATE +- MESSAGE_DELETE +- MESSAGE_DELETE_BULK + +This feature is still experimental, as it is still unclear how some interactions within the library behave when denied previously expected events. This support will improve over time. If you want more information on intents you can read [the official documentation](https://discord.com/developers/docs/topics/gateway#gateway-intents) as well as the documentation for `Discordrb::INTENTS` and `Discordrb::Bot#initialize`. + +### Added + +- `Bot#parse_mentions`, which extracts *all* mentions found in a string ([#526](https://github.com/discordrb/discordrb/pull/526), thanks @SanksTheYokai) +- Issue and pull request templates ([#585](https://github.com/discordrb/discordrb/pull/585)) +- `Server#bot` method for obtaining your bot's own `Member` on a particular server ([#597](https://github.com/discordrb/discordrb/pull/597)) +- `Attachment#spoiler?`, to check if an attachment is a spoiler or not ([#603](https://github.com/discordrb/discordrb/pull/603), thanks @swarley) +- Methods on `Server` to manage the server's emoji ([#595](https://github.com/discordrb/discordrb/pull/595), thanks @swarley) +- `Paginator` utility class for wrapping paginated endpoints ([#579](https://github.com/discordrb/discordrb/pull/579)) +- `EventContainer#message_update`, which is fired whenever a message is updated, either by Discord or the user ([#612](https://github.com/discordrb/discordrb/pull/612), thanks @swarley) +- `Message#server` ([#614](https://github.com/discordrb/discordrb/pull/614), thanks @swarley) +- `Channel#news?`, `Channel#store?` ([#618](https://github.com/discordrb/discordrb/pull/618), thanks @swarley) +- `Server#bot_members`, `Server#non_bot_members` ([#626](https://github.com/discordrb/discordrb/pull/626), thanks @flutterflies) +- `API.get_gateway_bot` ([#632](https://github.com/discordrb/discordrb/pull/632)) +- `Channel#create_webhook` ([#637](https://github.com/discordrb/discordrb/pull/637), thanks @Chew) +- `User#dnd?` and documentation for other user status methods ([#679](https://github.com/discordrb/discordrb/pull/679), thanks @kaine119) +- `Message#link`, `Channel#link`, `Server#link` ([commit](https://github.com/shardlab/discordrb/commit/44f93948a812e06b439968c6b072c0d9b749a842), thanks @z64) +- `ReactionEvent#message_id` and `message` option for `ReactionEventHandler` ([#728](https://github.com/discordrb/discordrb/pull/728), thanks @swarley) +- `intents` option for `Bot#initialize`, `INTENTS`, and `ALL_INTENTS` for experimental intents support ([#698](https://github.com/discordrb/discordrb/pull/698), thanks @swarley) +- `reason` positional arguments for various API methods, support for new audit log events ([#682](https://github.com/discordrb/discordrb/pull/682), thanks @swarley) +- Support for `attachment://` procotol linking in `API::Channel.create_message` and methods that utilize it (`Bot#send_message`, `Channel#send_message`, `Channel#send_temporary_message`, `Channel#send_embed`, `Respondable#send_message`, `Respondable#send_embed`) ([#735](https://github.com/discordrb/discordrb/pull/735), thanks @swarley) +- `AllowedMentions`, and `allowed_mentions` positional arguments to `API::Channel.create_message`, `Bot#send_message`, `Bot#send_temporary_message`, `Channel#send_message`, `Channel#send_temporary_message`, `Channel#send_embed`, `Respondable#send_message`, `Respondable#send_embed`, and `Respondable#send_temporary_message` ([#708](https://github.com/discordrb/discordrb/pull/708), thanks @swarley) +- `with_counts` optional positional argument to `API::Server.resolve` ([#709](https://github.com/discordrb/discordrb/pull/709), thanks @swarley) +- Expose full options to `Bot#send_temporary_message` and `Respondable#send_temporary_message` ([commit](https://github.com/shardlab/discordrb/commit/d20203211603cd4c06212d99e733bf5f5b3c8f0b), thanks @Birdie0) +- `User#client_status`, `PresenceEvent#client_status`, and `client_status` option for `EventContainer#presence` ([#736](https://github.com/discordrb/discordrb/pull/736), thanks @swarley) +- `VoiceServerUpdateEvent`, and `EventContainer#voice_server_update` ([#743](https://github.com/discordrb/discordrb/pull/743), thanks @swarley) +- Invite events, `InviteCreateEvent`, `InviteDeleteEvent`, `EventContainer#invite_create`, `EventContainer#invite_delete` and `Server#splash_hash` ([#744](https://github.com/discordrb/discordrb/pull/744), thanks @swarley) +- `Message#reply!`, `Message#reply?`, `Message#referenced_message` for inline reply support ([#3](https://github.com/shardlab/discordrb/pull/3), thanks @swarley) + +### Changed + +- Drop support for Ruby 2.3 (EOL) ([#583](https://github.com/discordrb/discordrb/pull/583), thanks @PanisSupraOmnia) +- **(breaking change)** Upgraded minimum Ruby version to 2.3.7, and upgraded Rubocop to 0.60.0. This additionally changes the name of some public constants. ([#487](https://github.com/discordrb/discordrb/pull/487), thanks @PanisSupraOmnia) +- Dependencies for `rbnacl`, `rake`, and `rspec` have been updated ([#538](https://github.com/discordrb/discordrb/pull/538), thanks @PanisSupraOmnia) +- The monolithic `data.rb` file has been split into multiple files for easier development ([#482](https://github.com/discordrb/discordrb/pull/482)) +- Loosened `bundler` development dependency to allow use of `bundler` 1.x and 2.x ([#591](https://github.com/discordrb/discordrb/pull/591), thanks @PanisSupraOmnia) +- `API::Server.create_channel` and `Server#create_channel` now accepts `position` ([#592](https://github.com/discordrb/discordrb/pull/592), thanks @swarley) +- `Bot.new` will now raise a more helpful exception when the passed token string is empty or nil ([#599](https://github.com/discordrb/discordrb/pull/599)) +- `compress_mode` in `Bot.new` now defaults to `:large` instead of `:stream` ([#601](https://github.com/discordrb/discordrb/pull/601)) +- `send_file` methods now accept `filename` to rename a file when uploading to Discord ([#605](https://github.com/discordrb/discordrb/pull/605), thanks @swarley) +- Emoji related `API` methods now accept arguments to change an emoji's role whitelist ([#595](https://github.com/discordrb/discordrb/pull/595), thanks @swarley) +- `send_file` API now accepts a `spoiler` kwarg to send the file as a spoiler ([#606](https://github.com/discordrb/discordrb/pull/606), thanks @swarley) +- Clarified use of `API.bot_name=` ([#622](https://github.com/discordrb/discordrb/pull/622), thanks @Daniel-Worrall) +- `Message#reacted_with` can now return all users who reacted with an emoji, instead of just the first 25 ([#615](https://github.com/discordrb/discordrb/pull/615), thanks @swarley) +- `Server#create_channel` can create store and news channels, if you have access to do so ([#618](https://github.com/discordrb/discordrb/pull/618), thanks @swarley) +- Typestrings for API that accepts discord IDs is now consistently represented as `String, Integer` ([#616](https://github.com/discordrb/discordrb/pull/616), thanks @swarley) +- When a command is executed with an invalid number of arguments, the error response is sent as a single message ([#627](https://github.com/discordrb/discordrb/pull/627)) +- The `#split_send` utility method returns `nil`, to avoid the case where the return value is captured in the implicit return message ([#629](https://github.com/discordrb/discordrb/pull/629), thanks @captainSV) +- Give up reconnecting after receiving a fatal close code ([#633](https://github.com/discordrb/discordrb/pull/633)) +- Misc upgrades to RuboCop v0.68 ([#624](https://github.com/discordrb/discordrb/pull/624), thanks @PanisSupraOmnia) +- `await!` methods now accept a block to test for matching event conditions ([#635](https://github.com/discordrb/discordrb/pull/635), thanks @z64) +- Dependency updates for RuboCop v0.74, redcarpet, and simplecov ([#636](https://github.com/discordrb/discordrb/pull/636), thanks @PanisSupraOmnia) +- Update voice logic to connect to the IP address from READY ([#644](https://github.com/discordrb/discordrb/pull/644), thanks @swarley) +- Refactored use of enumerable code in `Discordrb.split_message` ([#646](https://github.com/discordrb/discordrb/pull/646), thanks @piharpi) +- **(deprecated)** `no_sync` argument in `Bot#stop` is now considered deprecated as part of a refactor that removes Ruby 2.3 compatibility ([#652](https://github.com/discordrb/discordrb/pull/652), thanks @PanisSupraOmnia) +- Return `rest-client` dependency to `>= 2.0.0` since `2.1.0` is now released ([#654](https://github.com/discordrb/discordrb/pull/654), thanks @ali-l) +- Added Bit for "Streaming" permission ([#660](https://github.com/discordrb/discordrb/pull/660), thanks @NCPlayz) +- Methods for Nitro boosting related information ([#638](https://github.com/discordrb/discordrb/pull/638), thanks @Chew) +- `ServerDeleteEvent#server` now returns an `Integer` ([commit](https://github.com/discordrb/discordrb/commit/bb457fe981d2b997b704ad85008ec3b185b046e8), thanks @z64) +- User activites are now represented by `ActivitySet`, from `User#activities` ([#677](https://github.com/discordrb/discordrb/pull/677), thanks @swarley) +- **(deprecated)** `User#game`, `User#stream_type`, and `User#stream_url` are considered deprecated in favor of `ActivitySet#games` and `ActivitySet#streaming` as activities are no longer considered to be singular. ([#677](https://github.com/discordrb/discordrb/pull/677), thanks @swarley) +- Non CDN links now use the updated domain name `https://discord.com` ([#720](https://github.com/discordrb/discordrb/pull/720), thanks @swarley) +- Additional fields are included in `Role#inspect` ([#731](https://github.com/discordrb/discordrb/pull/731), thanks @IotaSpencer) +- `Invite#server` and `Invite#channel` can both return partial or full objects depending on the data source ([#744](https://github.com/discordrb/discordrb/pull/744), thanks @swarley) +- Members now have the `@everyone` role ([#739](https://github.com/discordrb/discordrb/pull/739), thanks @kdance21) +- Add `message_reference` as an optional positional argument to the following methods. `API::Channel.create_message`, `Bot#send_message`, `Channel#send_message`, `Channel#send_temporary_message`, `Channel#send_embed`, `Events::MessageEvent#send_message`, and `Events::MessageEvent#send_embed` ([#3](https://github.com/shardlab/discordrb/pull/3), thanks @swarley) +- **(deprecated)** `Message#reply` has been deprecated in favor of `Message#respond`, and the functionality will be replaced with that of `reply!` in 4.0 ([#3](https://github.com/shardlab/discordrb/pull/3), thanks @swarley) + +### Fixed + +- Permission calculation when the internal sorting of roles is unreliable ([#609](https://github.com/discordrb/discordrb/pull/609)) +- `DisconnectEvent` is now raised when a gateway close frame is handled ([#611](https://github.com/discordrb/discordrb/pull/611), thanks @swarley) +- A cached `Channel` is no longer assumed to be NSFW if its name starts with `nsfw` ([#617](https://github.com/discordrb/discordrb/pull/617), thanks @swarley) +- **(breaking change)** `Message#reactions` is changed to return an Array instead of a hash, fixing reactions with the same `name` value from being discarded (#[593](https://github.com/discordrb/discordrb/pull/596)) +- `Channel#nsfw=` correctly forwards updated value to the API ([#628](https://github.com/discordrb/discordrb/pull/628)) +- `Emoji#==` works correctly for unicode emoji ([#590](https://github.com/discordrb/discordrb/pull/590), thanks @soukouki) +- Attribute matching for voice state update events ([#625](https://github.com/discordrb/discordrb/pull/625), thanks @swarley) +- `Emoji#to_reaction` works correctly for unicode emoji ([#642](https://github.com/discordrb/discordrb/pull/642), thanks @z64) +- `Server#add_member_using_token` returns `nil` when user is already a member ([#643](https://github.com/discordrb/discordrb/pull/643), thanks @swarley) +- `CommandBot`'s `Integer` parser interprets all integers as base 10 ([#656](https://github.com/discordrb/discordrb/pull/656), thanks @joshleblanc) +- Broken reference link in `CommandBot#initialize` documentation ([#647](https://github.com/discordrb/discordrb/pull/647), thanks @Daniel-Worrall) +- Return the correct value for `Message#reactions?` ([#729](https://github.com/discordrb/discordrb/pull/729), thanks @swarley) +- Gateway closes with a 4000 code on `RECONNECT`, preserving the session ([#727](https://github.com/discordrb/discordrb/pull/727), thanks @swarley) +- `Emoji#mention` works correctly for unicode emojis ([#715](https://github.com/discordrb/discordrb/pull/715), thanks @swarley) +- Voice now uses gateway v4 ([#648](https://github.com/discordrb/discordrb/pull/648), thanks @swarley) +- VoiceBot now sends a `KILL` signal instead of `TERM` on Windows hosts when ending the ffmpeg process. ([#732](https://github.com/discordrb/discordrb/pull/732), thanks @swarley) +- `Message#emoji` returns more reliably when used with other mention types ([#724](https://github.com/discordrb/discordrb/pull/724), thanks @omnilord) +- Permission calculation now properly considers overwrites ([#712](https://github.com/discordrb/discordrb/pull/712), thanks @swarley) + +### Removed + +- Removed dependency on `rbnacl` in favor of our own FFI bindings ([#641](https://github.com/discordrb/discordrb/pull/641), thanks @z64) + +## [3.3.0] - 2018-10-27 +[3.3.0]: https://github.com/discordrb/discordrb/releases/tag/v3.3.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.2.1...v3.3.0) + + +### Summary + +3.3.0 brings discordrb up to speed with new features added to Discord's API over the last year. Included is a large number of fixes, optimizations, and library features. + +Since there is a lot here, here are highlights of the more notable changes in this release: + +- We now use SSL certificate validation in our gateway connections, and enforce use of TLSv1.2. If this is an issue + for your platform or environment (you get errors related to SSL), please report this with relevant details. You + can revert to the old codepath at any time by setting `DISCORDRB_SSL_VERIFY_NONE`. This environment variable will + be removed in a later release when this proves to be a stable default. + +- `CommandBot` now supports a new method of "aliasing" commands with the `aliases:` keyword. It accepts an array + of symbols of alternate command names. Currently this is supported by passing an array of symbols for the command + name itself, but this essentially makes "copies" of the command, meaning each alias will show up in your help command. + Using `aliases` instead, the library will recognize that these other names *are aliases* instead of copying the command. + Aliases will be listed when users use `!help` with the command name, or any of its aliases. For now you may chose to use + either style, but you cannot use both. Specifying an array for the command name is now considered deprecated. + +- There are now two methods of creating "awaits" in discordrb. The new style is a blocking (synchronous) method that + uses threads and regular event handlers in the background. The new methods are all named with a bang (`!`), + i.e. `user.await!`, `message.await!`, and simply return the raised event. This system should be less confusing than + the current asynchronous one. These blocking awaits no longer have an identifying key and only accept the event + attributes as an argument. There is also a special reserved attribute called `timeout` that will stop waiting for + an event and return `nil` if the given number of seconds has passed. Eventually this new system of awaits will + replace the old one in a later breaking change. A short example: + +```ruby +bot.message(content: '!test') do |event| + event.respond 'What is your name?' + response = event.message.await!(timeout: 3) + if response + event.respond "Hello, #{response.message.content}!" + else + event.respond 'You took too long!' + end +end +``` + +The entire changelog follows, with items that contain breaking changes noted. If you use parts of the library +mentioned in a breaking change, you can read the PR and diff for the full details. If you need help with +understanding, updating your bot, or have any other questions, please feel free to [join us on Discord](https://discord.gg/cyK3Hjm) +or open an issue if necessary. + +Thank you to all of our contributors! + +### Added + +- API methods to add and remove single member roles ([#310](https://github.com/discordrb/discordrb/pull/310)) +- **(breaking change)** API methods and abstractions for listing available voice regions ([#311](https://github.com/discordrb/discordrb/pull/311)) +- `Server` methods to prune members and to get the number of members available for pruning ([#315](https://github.com/discordrb/discordrb/pull/315)) +- Methods for filtering the kinds of overwrites present on a channel ([#321](https://github.com/discordrb/discordrb/pull/321)) +- `Channel#default_channel?`, for checking if a channel is the default channel of a server ([#320](https://github.com/discordrb/discordrb/pull/320), thanks @Reaver01) +- Method for returning a `Server`'s `@everyone` role +- Reactions can now be serialized with `#to_s` to be used in `Message#react` more easily ([#342](https://github.com/discordrb/discordrb/pull/342)) +- Additional objects and attributes for parsing embeds on messages ([#344](https://github.com/discordrb/discordrb/pull/344), thanks @mattantonelli) +- Methods for finding a members highest role, the role that is hoisting the member, or giving the member color ([#335](https://github.com/discordrb/discordrb/pull/335), thanks @Snazzah) +- API support for managing webhooks ([#356](https://github.com/discordrb/discordrb/pull/356), thanks @Daniel-Worrall) +- Support for reading and managing a channel's `nsfw` property ([#380](https://github.com/discordrb/discordrb/pull/380)) +- The `:administrator` permissions value is aliased as `:administrate` ([#322](https://github.com/discordrb/discordrb/pull/322)) +- Class methods on `Permissions` for easily building permissions bits values ([#322](https://github.com/discordrb/discordrb/pull/322)) +- `Gateway#send_packet` and `Gateway#send_raw` methods to send custom data payloads to the gateway +- Methods for reading `icon_url` and `proxy_icon_url` in `EmbedAuthor` +- Methods for obtaining a server and channels invites ([#394](https://github.com/discordrb/discordrb/pull/394)) +- Example of using awaits ([#370](https://github.com/discordrb/discordrb/pull/370)) +- Methods on `Member` for kicking and banning ([#404](https://github.com/discordrb/discordrb/pull/404)) +- API method and abstraction for adding members to guilds with OAuth2 tokens ([#413](https://github.com/discordrb/discordrb/pull/413)) +- Example of using a prefix proc ([#411](https://github.com/discordrb/discordrb/pull/411)) +- **(breaking change)** Methods for managing a server's system channel ([#437](https://github.com/discordrb/discordrb/pull/437), thanks @ldelelis) +- **(breaking change)** Additional error code constants ([#419](https://github.com/discordrb/discordrb/pull/419), thanks @LikeLakers2) +- Commands can be created with a `:rescue` argument, to provide a message or callback when an unhandled exception is raised when executing the command ([#360](https://github.com/discordrb/discordrb/pull/360)) +- **(breaking change)** Additional `Server` properties for verification levels, default message notification levels, and explicit content filter settings ([#414](https://github.com/discordrb/discordrb/pull/414), thanks @PixeLInc) +- **(breaking change)** `nonce` is accepted in `API::Channel.create_message` ([#414](https://github.com/discordrb/discordrb/pull/414), thanks @PixeLInc) +- Setters for new status options (`Bot#listening=`, `Bot#watching=`) ([#432](https://github.com/discordrb/discordrb/pull/432), thanks @PixeLInc) +- Documentation examples for sending a file ([#409](https://github.com/discordrb/discordrb/pull/409)) +- Respondable implements `#send_embed` ([#420](https://github.com/discordrb/discordrb/pull/420)) +- `Invite` now supplies `max_age` and `created_at` +- `Invite` now supplies `member_count` and `online_member_count` ([#454](https://github.com/discordrb/discordrb/pull/454), thanks @Snazzah) +- `Server` methods for managing a server's embed (widget) settings ([#435](https://github.com/discordrb/discordrb/pull/435)) +- **(breaking change)** Support for category channels in `Server` and `Channel` ([#415](https://github.com/discordrb/discordrb/pull/415), [#477](https://github.com/discordrb/discordrb/pull/477), thanks @omnilord) +- `CommandBot` and commands channel whitelist can now be modified after creation ([#446](https://github.com/discordrb/discordrb/pull/446), thanks @omnilord) +- A `Role`'s `position` can now be sorted relative to other roles ([#445](https://github.com/discordrb/discordrb/pull/445), thanks @mattantonelli) +- The `return` keyword inside of commands can be used to return content to Discord ([#462](https://github.com/discordrb/discordrb/pull/462), thanks @TrenchFroast) +- `Emoji` now supplies `animated` ([#464](https://github.com/discordrb/discordrb/pull/464), thanks @PixeLInc) +- Additional instructions for installation of Ruby's devkit for Ruby 2.3+ ([#468](https://github.com/discordrb/discordrb/pull/468), thanks @oct2pus) +- `Server` API for retrieving a server's audit logs ([#353](https://github.com/discordrb/discordrb/pull/353), thanks @Snazzah) +- `EventContainer` methods for server role create, delete, and update events ([#494](https://github.com/discordrb/discordrb/pull/494), thanks @Daniel-Worrall) +- `PlayingEvent` now returns `details` ([#486](https://github.com/discordrb/discordrb/pull/486), thanks @xTVaser) +- `Role` now supplies `server` ([#505](https://github.com/discordrb/discordrb/pull/505), thanks @micke) +- Documentation for the `discordrb-webhooks` gem in `README.md` ([#460](https://github.com/discordrb/discordrb/pull/460)) +- A new, synchronous awaits system available via `#await!` ([#499](https://github.com/discordrb/discordrb/pull/499)) +- `Channel#sort_after`, for moving a channel around a server within categories easily ([#497](https://github.com/discordrb/discordrb/pull/497)) +- The gemspec now includes a link to the changelog ([#515](https://github.com/discordrb/discordrb/pull/515), thanks @PanisSupraOmnia) +- Commands can now be restricted by either `allowed_roles` or `required_roles` ([#469](https://github.com/discordrb/discordrb/pull/469), thanks @elfenars) +- `Bot#parse_mention` parses `Channel` mentions ([#525](https://github.com/discordrb/discordrb/pull/525), thanks @estherbolik) +- Support for Discord's `zlib-stream` gateway compression, as well as options to configure the compression mode in `Bot#initialize` ([#527](https://github.com/discordrb/discordrb/pull/527), thanks @oct2pus for additional testing) +- "Priority Speaker" permission bit ([#530](https://github.com/discordrb/discordrb/pull/530), thanks @Chewsterchew) +- Implemented `aliases` attribute in commands, for an improved alternative to "command copying" by passing an array to the command name ([#524](https://github.com/discordrb/discordrb/pull/524)) +- **(breaking change)** Methods for managing a `Channel`'s slowmode settings ([#573](https://github.com/discordrb/discordrb/pull/573), thanks @badBlackShark) + +### Changed + +- `Channel#make_invite` now accepts an argument to always return a unique invite code ([#312](https://github.com/discordrb/discordrb/pull/312)) +- More of the API accepts objects that respond to `#resolve_id` ([#313](https://github.com/discordrb/discordrb/pull/313), [#328](https://github.com/discordrb/discordrb/pull/328), thanks @Likelakers2) +- **(breaking change)** `Channel#history` and `API::Channel.messages` now accepts `around_id` ([#314](https://github.com/discordrb/discordrb/pull/314)) +- **(breaking change)** `API::Server.prune_count` accepts `days` ([#315](https://github.com/discordrb/discordrb/pull/315)) +- **(breaking change)** Methods for creating channels accept additional arguments ([#321](https://github.com/discordrb/discordrb/pull/321)) +- `Channel` overwrite-related API now returns an `Overwrite` object ([#321](https://github.com/discordrb/discordrb/pull/321)) +- **(breaking change)** Creating roles now accepts more parameters ([#323](https://github.com/discordrb/discordrb/pull/323), thanks @Reaver01) +- Rate limits are now logged to a `:ratelimit` logging level and can be configured +- `client_id` in `Bot#initilalize` is now optional, and will be cached automatically by the API when needed ([#337](https://github.com/discordrb/discordrb/pull/337)) +- `Voice::Encoder#encode_file` now accepts options for ffmpeg ([#341](https://github.com/discordrb/discordrb/pull/341), thanks @oyisre) +- Objects that implement `IDObject` can now be compared using more operators ([#346](https://github.com/discordrb/discordrb/pull/346), thanks @mattantonelli) +- Filled in permissions bit for viewing a server's audit log ([#349](https://github.com/discordrb/discordrb/pull/349), thanks @Daniel-Worrall) +- https://cdn.discordapp.com is now used as the base URL for CDN resources like avatars and server icons ([#358](https://github.com/discordrb/discordrb/pull/358)) +- Reaction events raised from the bot's actions will respect `parse_self` ([#350](https://github.com/discordrb/discordrb/pull/350), thanks @Daniel-Worrall) +- `Webhooks::Embed#initialize` parses its `color`/`colour` argument ([#364](https://github.com/discordrb/discordrb/pull/364), thanks @Daniel-Worrall) +- Webhook related events can now be matched on webhook ID ([#363](https://github.com/discordrb/discordrb/pull/363), thanks @Daniel-Worrall) +- Discord's default user avatar URLs will now be returned when applicable ([#375](https://github.com/discordrb/discordrb/pull/375)) +- `Cache#find_user` can now find individual users if name and discriminator is given ([#384](https://github.com/discordrb/discordrb/pull/384)) +- `ReactionEvent` provides both `server` and `member`, if possible ([#351](https://github.com/discordrb/discordrb/pull/351), thanks @Daniel-Worrall) +- Installation instructions now include guides for installing with Bundler ([#386](https://github.com/discordrb/discordrb/pull/386), [#405](https://github.com/discordrb/discordrb/pull/405), thanks @VxJasonxV and @PixeLInc) +- **(breaking change)** `default_channel` implementation is updated to reflect Discord changes ([#382](https://github.com/discordrb/discordrb/pull/382), [#534](https://github.com/discordrb/discordrb/pull/534)) +- Documentation around the conditions where our API returns `nil` is clarified ([#395](https://github.com/discordrb/discordrb/pull/395), thanks @LikeLakers2) +- Whenever possible, we update cached data about a `Server` returned to us from making changes to it +- **(breaking change)** `Cache#server` now returns `nil` if a server is not found instead of raising an exception ([#424](https://github.com/discordrb/discordrb/pull/424), thanks @soukouki) +- `Bucket#rate_limited?` now accepts an `increment` value for weighted rate limits ([#427](https://github.com/discordrb/discordrb/pull/427), thanks @Lavode) +- **(breaking change)** `Server#bans` now returns `Array`, which contains `reason` data in addition to the user banned ([#404](https://github.com/discordrb/discordrb/pull/404)) +- `Channel#prune` now accepts a block that can be used to filter the messages to be pruned ([#421](https://github.com/discordrb/discordrb/pull/421), thanks @snapcase) +- WSCS verions message is now only printed when using voice functionality ([#438](https://github.com/discordrb/discordrb/pull/438), thanks @dreid) +- **(breaking change)** `API::Server.update_channel` is now `API::Server.update_channel_positions` +- CI is now tested against Ruby 2.3, 2.4, and 2.5 ([#476](https://github.com/discordrb/discordrb/pull/476), thanks @nicolasleger) +- CI now tests with YARD to validate docstrings +- Specs for `Channel` are refactored ([#481](https://github.com/discordrb/discordrb/pull/481), thanks @Daniel-Worrall) +- Specs are refactored to not use `module` namespaces ([#520](https://github.com/discordrb/discordrb/pull/520), thanks @Daniel-Worrall) +- `Bot` now logs to `LOGGER.info` when the bot successfully resumes +- Code climate tooling is updated ([#489](https://github.com/discordrb/discordrb/pull/489), thanks @PanisSupraOmnia) +- `Bot#parse_mention` will now return an `Emoji` object for a mention of an emoji the bot isn't connected to ([#473](https://github.com/discordrb/discordrb/pull/473)) +- The changelog now follows the "Keep a Changelog" format ([#504](https://github.com/discordrb/discordrb/pull/504), thanks @connorshea) +- `Bot#run` documentation is adjusted to clarify the use of its async argument ([#521](https://github.com/discordrb/discordrb/pull/521)) +- **(breaking change)** `Bot#join` is renamed to `Bot#accept_invite` ([#521](https://github.com/discordrb/discordrb/pull/521)) +- `Embed#colour=`/`Embed#color=` now accepts instances of `ColourRGB`/`ColorRGB` ([#523](https://github.com/discordrb/discordrb/pull/523)) +- `Gateway` now performs certificate validation, and enforces use of TLSv1.2. If you experience issues (please report them!), you can return to the old codepath by setting `DISCORDRB_SSL_VERIFY_NONE` ([#528](https://github.com/discordrb/discordrb/pull/528), thanks @cky) +- Documentation clarifications around `voice_state_update`, `member_update`, and `server_create` ([#531](https://github.com/discordrb/discordrb/pull/531)) +- URLs listed across the code base now use https, various other cleanups ([#540](https://github.com/discordrb/discordrb/pull/540), thanks @PanisSupraOmnia) +- Dependency on the `ffi` gem is restricted to `>= 1.9.24` to prevent a security exploit on Windows, per [CVE-2018-1000201](https://nvd.nist.gov/vuln/detail/CVE-2018-1000201) ([#544](https://github.com/discordrb/discordrb/pull/544)) +- Warnings about accessing cached data after server streaming times out are now clarified and printed when accessing relevant methods ([#578](https://github.com/discordrb/discordrb/pull/578), thanks @connorshea) + +### Deprecated + +- The existing awaits system is deprecated in favor of a simpler, synchronous system introduced in [#499](https://github.com/discordrb/discordrb/pull/499) ([#509](https://github.com/discordrb/discordrb/pull/509)) + +### Removed + +- **(breaking change)** Unsupported `mentions` argument in Create Message API ([#420](https://github.com/discordrb/discordrb/pull/420)) +- **(breaking change)** `TrueClass` is no longer an alias for `:debug` logging in `Bot#initialize` + +### Fixed + +- `Errors::MessageTooLong` is now raised correctly ([#325](https://github.com/discordrb/discordrb/pull/325), thanks @Daniel-Worrall) +- Certain `Reaction` related events properly inherit `Event` ([#329](https://github.com/discordrb/discordrb/pull/329), thanks @valeth) +- Permissions calculation now takes the server's `@everyone` role permissions into consideration (additional work by [#357](https://github.com/discordrb/discordrb/pull/357), thanks @mattantonelli) +- `Role#members` had a typo preventing it from working ([#340](https://github.com/discordrb/discordrb/pull/340)) +- `Message#my_reactions` now correctly returns `Array` ([#342](https://github.com/discordrb/discordrb/pull/342)) +- Several internal checks have been added to make bots more resilient to zombie connections +- Documentation for `TypingEvent` is now more accurate ([#367](https://github.com/discordrb/discordrb/pull/367), thanks @Snazzah) +- Corrected implementation of the `reason` parameter in various API ([#372](https://github.com/discordrb/discordrb/pull/372)) +- `CommandBot`'s advanced functionality properly handles empty strings in certain settings ([#379](https://github.com/discordrb/discordrb/pull/379), thanks @LikeLakers2) +- Rate limit headers are processed correctly when running into certain API exceptions ([#440](https://github.com/discordrb/discordrb/pull/440), thanks @unleashy) +- Typos preventing `ArgumentError` from being raised when processing `arg_types` ([#400](https://github.com/discordrb/discordrb/pull/400), thanks @Daniel-Worrall) +- `Server#create_role` correctly accepts a `ColourRGB`/`ColorRGB` via `#combined` +- `EventContainer#add_handler` correctly adds handlers for events that haven't had internal storage created for them yet +- When a server is initially cached, its channels are now cached in a way that prevents REST exceptions from being raised when attempting to process gateway events with uncached channels as a subject ([#391](https://github.com/discordrb/discordrb/pull/391)) +- Await event matching now considers specific subclasses, preventing certain awaits to be triggered wrongly on different events in the same class tree ([#431](https://github.com/discordrb/discordrb/pull/431)) +- Bulk deleting messages properly filters out messages older than two weeks ([#439](https://github.com/discordrb/discordrb/pull/439), thanks @Emberwalker) +- Rate limiting when certain API errors occur are handled properly ([#440](https://github.com/discordrb/discordrb/pull/440), thanks @unleashy) +- Querying the cache for an unknown member no longer adds `nil` elements, which caused unexpected behavior ([#456](https://github.com/discordrb/discordrb/pull/456)) +- Logging behaves correctly when token is an empty string ([#449](https://github.com/discordrb/discordrb/pull/449), thanks @Daniel-Worrall) +- Several typos in documentation ([#444](https://github.com/discordrb/discordrb/pull/444), thanks @ToppleKek) +- When possible, `User` objects are now cached from messages instead of making an API request that may fail +- `rest-client` is upgraded to `>= 2.1.0.rc1`, as `2.1.0` is completely broken on Windows with Ruby 2.5 ([#478](https://github.com/discordrb/discordrb/pull/478), thanks @Daniel-Worrall and @swarley) +- `EmbedAuthor` sets the correct instance variable for `proxy_icon_url` +- `ReactionEvent` correctly returns the server on which it occurred ([#484](https://github.com/discordrb/discordrb/pull/484), thanks @charagarlnad) +- `ServerRoleCreateEvent` no longer fails to match when supplying a `name` attribute ([#493](https://github.com/discordrb/discordrb/pull/493), [#506](https://github.com/discordrb/discordrb/pull/506), thanks @Daniel-Worrall and @micke) +- `PlayingEvent` now correctly returns `server` ([#486](https://github.com/discordrb/discordrb/pull/486), thanks @xTVaser) +- Roles will no longer be cached twice when using `Server#create_role` ([#488](https://github.com/discordrb/discordrb/pull/488)) +- Race condition when creating event handlers inside of other event handlers ([#514](https://github.com/discordrb/discordrb/pull/514)) +- Command chain execution is halted immediately if `execute_command` fails, fixing some possible errors that could occur with `advanced_functionality` ([#517](https://github.com/discordrb/discordrb/pull/517), thanks @unleashy) +- In the event non-existent role IDs are observed in a member object, they are ignored to prevent cache related errors ([#535](https://github.com/discordrb/discordrb/pull/535)) +- `end_with` attribute in `MessageEventHandler` now accepts group-less regular expressions without throwing exceptions ([#571](https://github.com/discordrb/discordrb/pull/571), thanks @badBlackShark) +- `PresenceEvent` is correctly raised when dispatched ([#574](https://github.com/discordrb/discordrb/pull/574)) +- `Attachment#initialize` correctly sets `@id` instance variable ([#575](https://github.com/discordrb/discordrb/pull/575), thanks @kandayo) + +## [3.2.1] - 2017-02-18 +[3.2.1]: https://github.com/discordrb/discordrb/releases/tag/v3.2.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.2.0.1...v3.2.1) + +### Changed +- `Bot#stop` and `Gateway#stop` now explicitly return `nil`, for more convenient use in commands +- The API method to query for users has been removed as the endpoint no longer exists +- Some more methods have been changed to resolve IDs, which means they can be called with integer and string IDs instead of just the objects ([#313](https://github.com/discordrb/discordrb/pull/313), thanks @LikeLakers2) +- Bulk deleting now uses the new non-deprecated URL – this has no immediate effect, but once the old one will be removed bots using it will not be able to bulk delete anymore (see also [#309](https://github.com/discordrb/discordrb/issues/309)) + +### Fixed +- Fixed another bug with resumes that caused issues when resuming a zombie connection +- Fixed a bug that caused issues when playing short files ([#326](https://github.com/discordrb/discordrb/issues/316)) + +## [3.2.0.1] - 2017-01-29 +[3.2.0.1]: https://github.com/discordrb/discordrb/releases/tag/v3.2.0.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.2.0...v3.2.0.1) + +### Fixed +- Attempt to fix an issue that causes a strange problem with dependencies when installing discordrb + +## [3.2.0] - 2017-01-29 +[3.2.0]: https://github.com/discordrb/discordrb/releases/tag/v3.2.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.1.1...v3.2.0) + +### Added +- Various parts of gateway error handling were improved, leading to significant stability improvements: + - A long standing bug was fixed that prevented resumes in most cases, which caused unnecessary reconnections. + - The error handler that handles problems with sending the raw data over TCP now catches errors more broadly. + - Heartbeat ACKs (opcode 11) are now checked, which allows the client to detect zombie connections early on. If this causes problems for you you can disable it using `bot.gateway.check_heartbeat_acks = false`. + - Received heartbeats are now properly handled again +- Added a client for webhooks, implemented as a separate gem `discordrb-webhooks`. This allows the creation of applications that only use webhooks without the overhead provided by the rest of discordrb. The gem is added as a dependency by normal discordrb so you don't need to install it separately if you're already using that. +- Adding, updating or deleting custom emoji is now supported ([#285](https://github.com/discordrb/discordrb/pull/285), thanks @Daniel-Worrall) +- Rich embeds can now be sent alongside messages, for example using the `embed` parameter in `send_message`, or with the new method `Channel#send_embed` +- `advanced_functionality` bots now support escaping using backslashes ([#293](https://github.com/discordrb/discordrb/issues/293) / [#304](https://github.com/discordrb/discordrb/pull/304), thanks @LikeLakers2) +- Added type checking and conversion for commands ([#298](https://github.com/discordrb/discordrb/pull/298), thanks @ohtaavi) +- Bulk deleting messages now checks for message age (see also [discordapp/discord-api-docs#208](https://github.com/discordapp/discord-api-docs/issues/208)). By default, it will ignore messages that are too old to be bulk deleted, but there is also a `strict` mode setting now that raises an exception in such a case. +- Reactions can now be viewed for existing messages ([#262](https://github.com/discordrb/discordrb/pull/262), thanks @z64), added to messages ([#266](https://github.com/discordrb/discordrb/pull/266), thanks @z64), and listened for using gateway events as well as internal handlers ([#300](https://github.com/discordrb/discordrb/issues/300)). +- Game types and stream URLs are now cached ([#297](https://github.com/discordrb/discordrb/issues/297)) +- The default non-streaming game was changed to be `0` instead of `nil` ([#277](https://github.com/discordrb/discordrb/pull/277), thanks @zeyla) +- A method `Channel#delete_message` was added to support deleting single messages by ID without prior resolution. +- Permission overwrites can now be deleted from channels ([#268](https://github.com/discordrb/discordrb/pull/268), thanks @greenbigfrog) +- There is now a utility method `IDObject.synthesise` that creates snowflakes with specific timestamps out of thin air. +- Typing events are now respondable, so you can call `#respond` on them for example ([#270](https://github.com/discordrb/discordrb/pull/270), thanks @VxJasonxV) +- Message authors can now be `User` objects if a `Member` object could not be found or created ([#290](https://github.com/discordrb/discordrb/issues/290)) +- Added two new events, `unknown` ([#288](https://github.com/discordrb/discordrb/issues/288)) and `raw`, that are raised for unknown dispatches and all dispatches, respectively. +- Bots can now be set to fully ignore other bots ([#257](https://github.com/discordrb/discordrb/pull/257), thanks @greenbigfrog) +- Voice state update events now have an `old_channel` property/attribute that denotes the previous channel the user was in in case of joining/moving/leaving. +- The default help command no longer shows commands the user can't use ([#275](https://github.com/discordrb/discordrb/pull/275), thanks @FormalHellhound) +- Updated the command example to no longer include user-specific stuff ([#260](https://github.com/discordrb/discordrb/issues/260)) +- `Server#role` now resolves IDs, so they can be passed as strings if necessary. + +### Fixed +- Fixed bots' shard settings being ignored in certain cases +- Parsing role mentions using `Bot#parse_mention` works properly now. +- Fixed some specific REST methods that were broken by the API module refactor ([#302](https://github.com/discordrb/discordrb/pull/302), thanks @LikeLakers2) +- Cached channel data is now updated properly on change ([#272](https://github.com/discordrb/discordrb/issues/272)) +- Users' avatars are now updated properly on change ([#265](https://github.com/discordrb/discordrb/pull/265), thanks @Roughsketch) +- Fixed voice state tracking for newly created channels ([#292](https://github.com/discordrb/discordrb/issues/292)) +- Fixed event attribute handling for PlayingEvent ([#303](https://github.com/discordrb/discordrb/pull/303), thanks @sven-strothoff) +- Getting specific emoji by ID no longer fails to resolve non-cached emoji ([#283](https://github.com/discordrb/discordrb/pull/283), thanks @greenbigfrog) +- Voice state update events no longer fail to be raised for users leaving channels, if the event handler had a channel attribute set ([#301](https://github.com/discordrb/discordrb/issues/301)) +- Bots that don't define any events should work properly again +- Fixed error handling for messages over the character limit ([#276](https://github.com/discordrb/discordrb/issues/276)) +- Fixed some specific log messages not being called properly ([#263](https://github.com/discordrb/discordrb/pull/263), thanks @Roughsketch) +- Fixed some edge case bugs in the default help command: + - In the case of too many commands to be sent in the channel, it no longer replies with "Sending help in PM!" when called from PM + - It no longer fails completely if called from PM if there are any commands that require server-specific checks ([#308](https://github.com/discordrb/discordrb/issues/308)) + - Fixed a slight formatting mistake +- Quoted command arguments in `advanced_functionality` are no longer split by newline +- Fixed a specific edge case in command chain handling where handling commands with the same name as the chain delimiter was broken + +## [3.1.1] - 2016-10-21 +[3.1.1]: https://github.com/discordrb/discordrb/releases/tag/v3.1.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.1.0...v3.1.1) + +### Fixed +- An oversight where a `GUILD_DELETE` dispatch would cause an internal error was fixed. ([#256](https://github.com/discordrb/discordrb/pull/256), thanks @greenbigfrog) + +## [3.1.0] - 2016-10-20 +[3.1.0]: https://github.com/discordrb/discordrb/releases/tag/v3.1.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.0.2...v3.1.0) + +### Added +- Emoji handling support ([#226](https://github.com/discordrb/discordrb/pull/226), thanks @greenbigfrog) +- A `channels` attribute has been added to `CommandBot` as well as `Command` to restrict the channels in which either of the two works ([#249](https://github.com/discordrb/discordrb/pull/249), thanks @Xzanth) +- The bulk deletion endpoint is now exposed directly using the `Channel#delete_messages` method ([#235](https://github.com/discordrb/discordrb/pull/235), thanks @z64) +- The internal settings fields for user statuses that cause statuses to persist across restarts can now be modified ([#233](https://github.com/discordrb/discordrb/pull/233), thanks @Daniel-Worrall) +- A few examples have been added to the docs ([#250](https://github.com/discordrb/discordrb/pull/250), thanks @SunDwarf) +- The specs have been improved; they're still not exhaustive by far but there are at least slightly more now. + +### Fixed +- Fixed an important bug that caused the logger not to work in some cases. ([#243](https://github.com/discordrb/discordrb/pull/243), thanks @Daniel-Worrall) +- Fixed logger token redaction. +- `unavailable_servers` should no longer crash the bot due to being nil in some cases ([#244](https://github.com/discordrb/discordrb/pull/244), thanks @Daniel-Worrall) +- `Profile#on` for member resolution is now no longer overwritten by an alias for `#online` ([#247](https://github.com/discordrb/discordrb/pull/247), thanks @Daniel-Worrall) +- A `CommandBot` without any commands should no longer crash when receiving a message that triggers it ([#242](https://github.com/discordrb/discordrb/issues/242)) +- Changing nicknames works again, it has apparently been broken in 3.0.0. + +## [3.0.2] - 2016-10-07 +[3.0.2]: https://github.com/discordrb/discordrb/releases/tag/v3.0.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.0.1...v3.0.2) + +### Changed +- A small change to how CommandBot parameter lists are formatted ([#240](https://github.com/discordrb/discordrb/pull/240), thanks @FormalHellhound) + +### Fixed +- Setting properties on a channel (e.g. `Channel#topic=`) works again ([#238](https://github.com/discordrb/discordrb/issues/238) / [#239](https://github.com/discordrb/discordrb/pull/239), thanks @Daniel-Worrall) + +## [3.0.1] - 2016-10-01 +[3.0.1]: https://github.com/discordrb/discordrb/releases/tag/v3.0.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v3.0.0...v3.0.1) + +A tiny update to support webhook-sent messages properly! + +### Added +- Added the utility methods `Message#webhook?` and `User#webhook?` to check whether a message or a user belongs to a webhook +- Added `Message#webhook_id` to get the ID of the sending webhook for webhook messages +- Added the `webhook_commands` parameter to CommandBot that, if false (default true), prevents webhook-sent messages from being parsed and handled as commands. + +### Fixed +- Fixed webhook-sent messages being ignored because their author couldn't be resolved. +- Fixed a minor performance problem where a CommandBot would create unnecessarily create redundant objects for every received message. + +## [3.0.0] - 2016-09-30 +[3.0.0]: https://github.com/discordrb/discordrb/releases/tag/v3.0.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.1.3...v3.0.0) + +I didn't think there could possibly be a release larger than 2.0.0 was, but here it is! Including the respective release commit, there were 540 commits from 1.8.1 to 2.0.0, but a whopping 734 commits from 2.1.3 to 3.0.0. + +As with 2.0.0, there are some breaking changes! They are, as always, highlighted in bold. + +### Added +- **The `application_id` parameter has been renamed to `client_id`**. With the changes to how bot applications work, it would just be confusing to have it be called `application_id` any longer. If you try to use `application_id` now, it will raise a descriptive exception; with 3.1.0 that will be removed too (you'll get a less descriptive exception). +- The gateway implementation has been completely rewritten, for more performance, stability and maintainability. This means that **to call some internal methods like `inject_reconnect`, a `Gateway` instance (available as `Bot#gateway`) now needs to be used.** +- **User login using email and password has been removed**. Use a user token instead, see also [here](https://github.com/discordapp/discord-api-docs/issues/69#issuecomment-223886862). +- In addition to the rewrite, the gateway version has also been upgraded to protocol version 6 (the rewrite was for v5). **With this, the way channel types are handled has been changed a bit!** If you've been using the abstraction methods like `Channel#voice?`, you should be fine though. This also includes support for group chats on user accounts, as that was the only real functionality change on v6. ([#211](https://github.com/discordrb/discordrb/pull/211), thanks @Daniel-Worrall) +- **Custom prefix handlers for `CommandBot`s now get the full message object as their parameter rather than only the content**, for even more flexibility. +- For internal consistency, **the `UnknownGuild` error was renamed to `UnknownServer`**. I doubt this change affects anyone, but if you handle that error specifically in your bot, make sure to change it. +- **The API module has undergone a refactor**, if you were using any manual API calls you will have to update them to the new format. Specifically, endpoints dealing with channels have been moved to `API::Channel`, ones dealing with users to `API::User` and so on. ([#203](https://github.com/discordrb/discordrb/pull/203), thanks @depl0y) +- **Calling `users` on a text channel will now only return users who have permission to read it** ([#186](https://github.com/discordrb/discordrb/issues/186)) +- A variety of new fields have been added to `Message` objects, specifically embeds (`Message#embeds`), when it was last edited (`#edited_timestamp`), whether it uses TTS (`#tts?`), its nonce (`#nonce`), whether it was ever edited (`#edited?`), and whether it mentions everyone (`mention_everyone?`) ([#206](https://github.com/discordrb/discordrb/pull/206), thanks @SnazzyPine25) +- A variety of new functionality has been added to `Server` and `Channel` objects ([#181](https://github.com/discordrb/discordrb/pull/181), thanks @SnazzyPine25): + - Bitrate and user limit can now be read and set for voice channels + - Server integrations can now be read + - Server features and verification level can now be read + - Utility functions to generate widget, widget banner and splash URLs +- Message pinning is now supported, both reading pin status and pinning existing messages ([#145](https://github.com/discordrb/discordrb/issues/145) / [#146](https://github.com/discordrb/discordrb/pull/146), thanks @hlaaftana) +- Support for the new available statuses: + - `Bot#dnd` to make the bot show up as DnD (red dot) + - `Bot#invisible` to make the bot show up as offline +- Setting the bot's status to streaming is now supported ([#128](https://github.com/discordrb/discordrb/pull/128) and [#143](https://github.com/discordrb/discordrb/pull/143), thanks @SnazzyPine25 and @barkerja) +- You can now set a message to be sent when a `CommandBot`'s command fails with a `NoPermission` error ([#200](https://github.com/discordrb/discordrb/pull/200), thanks @PoVa) +- There is now an optional field to list the parameters a command can accept ([#201](https://github.com/discordrb/discordrb/pull/201), thanks @FormalHellhound) +- Commands can now have an array of roles set that are required to be able to use it ([#178](https://github.com/discordrb/discordrb/pull/178), thanks @PoVa) +- Methods like `CommandEvent#<<` for quickly responding to an event are now available in `MessageEvent` too ([#154](https://github.com/discordrb/discordrb/pull/154), thanks @hlaaftana) +- Temporary messages, that automatically delete after some time, can now be sent to channels ([#136](https://github.com/discordrb/discordrb/issues/136) / [#139](https://github.com/discordrb/discordrb/pull/139), thanks @unleashy) +- Captions can now be sent together with files, and files can be attached to events to be sent on completion ([#130](https://github.com/discordrb/discordrb/pull/130), thanks @SnazzyPine25) +- There is now a `Channel#load_message` method to get a single message by its ID ([#174](https://github.com/discordrb/discordrb/pull/174), thanks @z64) +- `Channel#define_overwrite` can now be used with a `Profile` object, together with some internal changes ([#232](https://github.com/discordrb/discordrb/issues/232)) +- There are now endpoint methods to list a server's channels and channel invites ([#197](https://github.com/discordrb/discordrb/pull/197)) +- Two methods, `Member#roles=` and `Member#modify_roles` to manipulate a member's roles in a more advanced way have been added ([#223](https://github.com/discordrb/discordrb/pull/223), thanks @z64) +- Role mentionability can now be set using `Role#mentionable=` +- The current bot's OAuth application can now be read ([#175](https://github.com/discordrb/discordrb/pull/175), thanks @SnazzyPine25) +- You can now mute and deafen other members ([#157](https://github.com/discordrb/discordrb/pull/157), thanks @SnazzyPine25) +- The internal `Logger` now supports writing to a file instead of STDOUT ([#171](https://github.com/discordrb/discordrb/issues/171)) + - Building on top of that, you can also write to multiple streams at the same time now, in case you want to have input on both a file and STDOUT, or even more advanced setups. ([#217](https://github.com/discordrb/discordrb/pull/217), thanks @PoVa) +- Roles can now have their permissions bitfield set directly ([#177](https://github.com/discordrb/discordrb/issues/177)) +- The `Bot#invite_url` method now supports adding permission bits into the generated URL ([#218](https://github.com/discordrb/discordrb/pull/218), thanks @PoVa) +- A utility method `User#send_file` has been added to directly send a file to a user in PM ([#168](https://github.com/discordrb/discordrb/issues/168) / [#172](https://github.com/discordrb/discordrb/pull/172), thanks @SnazzyPine25) +- You can now get the list of members that have a particular role assigned using `Role#members` ([#147](https://github.com/discordrb/discordrb/pull/147), thanks @hlaaftana) +- You can now check whether a `VoiceBot` is playing right now using `#playing?` ([#137](https://github.com/discordrb/discordrb/pull/137), thanks @SnazzyPine25) +- You can now get the channel a `VoiceBot` is playing on ([#138](https://github.com/discordrb/discordrb/pull/138), thanks @snapcase) +- The permissions bit map has been updated for emoji, "Administrator" and nickname changes ([#180](https://github.com/discordrb/discordrb/pull/180), thanks @megumisonoda) +- A method `Bot#connected?` has been added to check whether the bot is currently connected to the gateway. +- The indescriptive error message that was previously sent when calling methods like `Bot#game=` without an active gateway connection has been replaced with a more descriptive one. +- The bot's token is now, by default, redacted from any logging output; this can be turned off if desired using the `redact_token` initialization parameter. ([#225](https://github.com/discordrb/discordrb/issues/225) / [#231](https://github.com/discordrb/discordrb/pull/231), thanks @Daniel-Worrall) +- The new rate limit headers are now supported. This will have no real impact on any code using discordrb, but it means discordrb is now considered compliant again. See also [here](https://github.com/discordapp/discord-api-docs/issues/108). +- Rogue presences, i.e. presences without an associated cached member, now print a log message instead of being completely ignored +- A variety of aliases have been added to existing methods. +- An example to show off voice sending has been added to the repo, and existing examples have been improved. +- A large amount of fixes and clarifications have been made to the docs. + +### Fixed +- The almost a year old bug where changing the own user's username would reset its avatar has finally been fixed. +- The issue where resolving a large server with the owner offline would sometimes cause a stack overflow has been fixed ([#169](https://github.com/discordrb/discordrb/issues/169) / [#170](https://github.com/discordrb/discordrb/issues/170) / [#191](https://github.com/discordrb/discordrb/pull/191), thanks @stoodfarback) +- Fixed an issue where if a server had an AFK channel set, but that AFK channel couldn't be connected to, resolving the server (and in turn all objects depending on it) would fail. This likely fixes any random `NoPermission` errors you've ever encountered in your log. +- A message's author will be resolved over the REST API like other objects in case it's not cached yet. This should fix all instances of "Member not cached even thought it should be". ([#210](https://github.com/discordrb/discordrb/pull/210), thanks @megumisonoda) +- Voice state handling has been completely redone, fixing a variety of caching issues. ([#159](https://github.com/discordrb/discordrb/issues/159)) +- Getting a voice channel's users no longer does a chunk request ([#142](https://github.com/discordrb/discordrb/issues/142)) +- `Channel#define_overwrite` can now be used to define user overwrites, apparently that didn't work at all before +- Nested command chains where an inner command doesn't exist now no longer crash the command chain handler ([#215](https://github.com/discordrb/discordrb/issues/215)) +- Gateway errors should no longer spam the console ([#141](https://github.com/discordrb/discordrb/issues/141) / [#148](https://github.com/discordrb/discordrb/pull/148), thanks @meew0) +- Role hoisting (both setting and reading it) should now work properly +- The `VoiceBot#stop_playing` method should now work more predictably +- Voice states with a nil channel should no longer crash when accessed ([#183](https://github.com/discordrb/discordrb/pull/183), thanks @Apexal) +- A latent bug in how PM channels were cached is fixed, previously they were cached twice - once by channel ID and once by recipient ID. Now they're only cached by recipient ID. +- Two problems in how Discord outages are handled are now fixed; the bot should now no longer break when one happens. Specifically, the fixed problems are: + - `GUILD_DELETE` events for unavailable servers are now ignored + - Opcode 9 packets which are received while no session currently exists are handled correctly +- A possible regression in PM channel creation was fixed. ([#227](https://github.com/discordrb/discordrb/issues/227) / [#228](https://github.com/discordrb/discordrb/pull/228), thanks @heimidal) + +## [2.1.3] - 2016-06-11 +[2.1.3]: https://github.com/discordrb/discordrb/releases/tag/v2.1.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.1.2...v2.1.3) + +### Fixed +- Various messages that were just printed to stdout that should have been using the `Logger` system now do ([#132](https://github.com/discordrb/discordrb/issues/132) and [#133](https://github.com/discordrb/discordrb/pull/133), thanks @PoVa) +- A mistake in the documentation was fixed ([#140](https://github.com/discordrb/discordrb/issues/140)) +- Handling of the `GUILD_MEMBER_DELETE` gateway event should now work even if, for whatever reason, Discord sends an invalid server ID ([#129](https://github.com/discordrb/discordrb/issues/129)) +- If the processing of a particular voice packet takes too long, the user will now be warned instead of an error being raised ([#134](https://github.com/discordrb/discordrb/issues/134)) + +## [2.1.2] - 2016-05-29 +[2.1.2]: https://github.com/discordrb/discordrb/releases/tag/v2.1.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.1.1...v2.1.2) + +### Added +- A reader was added (`Bot#awaits`) to read the hash of awaits, so ones that aren't necessary anymore can be deleted. +- `Channel#prune` now uses the bulk delete endpoint which means it will be much faster and no longer rate limited ([#118](https://github.com/discordrb/discordrb/pull/118), thanks @snapcase) + +### Fixed +- A few unresolved links in the documentation were fixed. +- The tracking of streamed servers was updated so that very long lists of servers should now all be processed. +- Resolution methods now return nil if the object to resolve can't be found, which should alleviate some rare caching problems ([#124](https://github.com/discordrb/discordrb/pull/124), thanks @Snazzah) +- In the rare event that Discord sends a voice state update for a nonexistent member, there should no longer be a gateway error ([#125](https://github.com/discordrb/discordrb/issues/125)) +- Network errors (`EPIPE` and the like) should no longer cause an exception while processing ([#127](https://github.com/discordrb/discordrb/issues/127)) +- Uncached members in messages are now logged. + +## [2.1.1] - 2016-05-08 +[2.1.1]: https://github.com/discordrb/discordrb/releases/tag/v2.1.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.1.0...v2.1.1) + +### Fixed +- Fixed a caching error that occurred when deleting roles ([#113](https://github.com/discordrb/discordrb/issues/113)) +- Commands should no longer be triggered with nil authors ([#114](https://github.com/discordrb/discordrb/issues/114)) + +## [2.1.0] - 2016-04-30 +[2.1.0]: https://github.com/discordrb/discordrb/releases/tag/v2.1.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.0.4...v2.1.0) + +### Added +- API support for the April 29 Discord update, which was the first feature update in a while with more than a few additions to the API, was added. This includes: ([#111](https://github.com/discordrb/discordrb/pull/111)) + - Members' nicknames can now be set and read (`Member#nick`) and updates to them are being tracked. + - Roles now have a `mentionable?` property and a `mention` utility method. + - `Message` now tracks a message's role mentions. +- The internal REST rate limit handler was updated: + - It now tracks message rate limits server wide to properly handle new bot account rate limits. ([#100](https://github.com/discordrb/discordrb/issues/100)) + - It now keeps track of all requests, even those that are known not to be rate limited (it just won't do anything to them). This allows for more flexibility should future rate limits be added. +- Guild sharding is now supported using the optional `shard_id` and `num_shards` to bot initializers. Read about it here: https://github.com/discordapp/discord-api-docs/issues/17 ([#98](https://github.com/discordrb/discordrb/issues/98)) +- Commands can now require users to have specific action permissions to be able to execute them using the `:required_permissions` attribute. ([#104](https://github.com/discordrb/discordrb/issues/104) / [#112](https://github.com/discordrb/discordrb/pull/112)) +- A `heartbeat` event was added that gets triggered every now and then to allow for roughly periodic actions. ([#110](https://github.com/discordrb/discordrb/pull/110)) +- Prefixes are now more flexible in the format they can have - arrays and callables are now allowed as well. Read the documentation for more info.([#107](https://github.com/discordrb/discordrb/issues/107) / [#109](https://github.com/discordrb/discordrb/pull/109)) + +## [2.0.4] - 2016-04-19 +[2.0.4]: https://github.com/discordrb/discordrb/releases/tag/v2.0.4 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.0.3...v2.0.4) + +### Added +- Added a utility method `Invite#url` ([#86](https://github.com/discordrb/discordrb/issues/86)/[#101](https://github.com/discordrb/discordrb/pull/101), thanks @PoVa) + +### Fixed +- Fix a caching inconsistency where a server's channels and a bot's channels wouldn't be identical. This caused server channels to not update properly ([#105](https://github.com/discordrb/discordrb/issues/105)) +- Setting avatars should now work again on Windows ([#96](https://github.com/discordrb/discordrb/issues/96)) +- Message edit events should no longer be raised with nil authors ([#95](https://github.com/discordrb/discordrb/issues/95)) +- Invites can now be created again ([#87](https://github.com/discordrb/discordrb/issues/87)) +- Voice states are now preserved for chunked members, fixes an issue where a voice channel's users would ignore all voice states that occurred before the call ([#103](https://github.com/discordrb/discordrb/issues/103)) +- Fixed some possible problems with heartbeats not being sent with unstable connections + +## [2.0.3] - 2016-04-15 +[2.0.3]: https://github.com/discordrb/discordrb/releases/tag/v2.0.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.0.2...v2.0.3) + +### Added +- All examples now fully use v2 ([#92](https://github.com/discordrb/discordrb/pull/92), thanks @snapcase) +- The message that occurs when a command is missing permission can now be changed or disabled ([#94](https://github.com/discordrb/discordrb/pull/94), thanks @snapcase) +- The log message that occurs when you disconnect from the WebSocket is now more compact ([#90](https://github.com/discordrb/discordrb/issues/90)) +- `Bot#ignored?` now exists to check whether a user is ignored + +### Fixed +- A problem where getting channel history would sometimes cause an exception has been fixed ([#88](https://github.com/discordrb/discordrb/issues/88)) +- `split_message` should now behave correctly in a specific edge case ([#85](https://github.com/discordrb/discordrb/pull/85), thanks @AnhNhan) +- DCA playback should no longer cause an error when playback ends due to a specific reason + +## [2.0.2] - 2016-04-10 +[2.0.2]: https://github.com/discordrb/discordrb/releases/tag/v2.0.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.0.1...v2.0.2) + +### Added +- Added `Server#text_channels` and `#voice_channels` ([#79](https://github.com/discordrb/discordrb/issues/79)) +- Added `Server#online_users` ([#80](https://github.com/discordrb/discordrb/issues/80)) +- Added `Member#role?` ([#83](https://github.com/discordrb/discordrb/issues/83)) +- Added three utility methods `User#online?`, `#offline?`, and `#idle?` +- `Bot#send_message` can now take channel objects as well as the ID + +### Fixed +- Removing the bot from a server will no longer result in a gateway message error +- Fixed an exception raised if a previously unavailable guild goes online after the stream timeout +- `server_create` will no longer be raised for newly available guilds +- Fixed the annoying message about constant reassignment at startup +- Fixed an error where rarely a server's owner wouldn't be initialized correctly + +## [2.0.1] - 2016-04-10 +[2.0.1]: https://github.com/discordrb/discordrb/releases/tag/v2.0.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v2.0.0...v2.0.1) + +### Added +- Added some more examples ([#75](https://github.com/discordrb/discordrb/pull/75), thanks @greenbigfrog) +- Users can now be ignored from messages at gateway level (`Bot#ignore_user`, `Bot#unignore_user`) +- `Member#add_role` and `Member#remove_role` were re-added from User - they were missing before + +### Fixed +- Fixed some typos in the documentation +- If a server is actually unavailable it will no longer spam the console with timeout messages +- VoiceBot now sends five frames of silence after finishing a track. This fixes an issue where the sound from the last track would bleed over into the new one due to interpolation. +- Fixed a bug where playing something right after connecting to voice would sometimes cause the encryption key to not be set + +## [2.0.0] - 2016-04-08 +[2.0.0]: https://github.com/discordrb/discordrb/releases/tag/v2.0.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.8.1...v2.0.0) + +### Added +This is the first major update with some breaking changes! Those are highlighted in bold with migration advice after them. Ask in the Discord channel (see the README) if you have questions. + +- **Bot initializers now only use named parameters.** This shouldn't be a hard change to adjust to, but everyone will have to do it. Here's some examples: + ```rb + # Previously + bot = Discordrb::Bot.new 'email@example.com', 'hunter2', true + + # Now + bot = Discordrb::Bot.new email: 'email@example.com', password: 'hunter2', log_mode: :debug + ``` + ```rb + # Previously + bot = Discordrb::Bot.new :token, 'TOKEN HERE' + + # Now + bot = Discordrb::Bot.new token: 'TOKEN HERE', application_id: 163456789123456789 + ``` + ```rb + # Previously + bot = Discordrb::Commands::CommandBot.new :token, 'TOKEN HERE', '!', nil, {advanced_functionality: false} + + # Now + bot = Discordrb::Commands::CommandBot.new token: 'TOKEN HERE', application_id: 163456789123456789, prefix: '!', advanced_functionality: false + ``` + - Connecting to multiple voice channels at once (only available with bot accounts) is now supported. **This means `bot.voice` now takes the server ID as the parameter**. For a seamless switch, the utility method `MessageEvent#voice` was added - simply replace `bot.voice` with `event.voice` in all instances. + - **The `Member` and `Recipient` classes were split off from `User`**. Members are users on servers and recipients are partners in private messages. Since both are delegates to `User`, most things will work as before, but most notably roles were changed to no longer be by ID (for example, instead of `event.author.roles(event.server.id)`, you'd just use `event.author.roles` instead). + - **All previously deprecated methods were removed.** This includes: + - `Server#afk_channel_id=` (use `afk_channel=`, it works with the ID too) + - `Channel#is_private` (use `private?` instead, it's more reliable with edge cases like Twitch subscriber-only channels) + - `Bot#find` (use `find_channel` instead, it does the exact same thing without confusion with `find_user`) + - **`Server` is now used instead of `Guild` in all external methods and classes.** Previously, all the events regarding roles and such were called `GuildRoleXYZEvent`, now they're all called `ServerRoleXYZEvent` for consistency with other attributes and methods. + - **`advanced_functionality` is now disabled by default.** If you absolutely need it, you can easily re-enable it by just setting that parameter in the CommandBot initializer, but for most people that didn't need it this will fix some bugs with mentions in commands and such. + - **`User#bot?` was renamed to `User#current_bot?`** with the addition of the `User#bot_account?` reader to check for bot account-ness (the "BOT" tag visible on Discord) + - Member chunks will no longer automatically be requested on startup, but rather once they're actually needed (`event.server.members`). This is both a performance change (much faster startup for large bots especially) and an important API compliance one - this is what the Discord devs have requested. + - Initial support for bots that have no WebSocket connection was started. This is useful for web apps that need to get information on something without having to run something in the background all the time. A tutorial on these will be coming soon, in the meantime, use this short example: +```rb +require 'discordrb' +require 'discordrb/light' + +bot = Discordrb::Light::LightBot.new 'token here' +puts bot.profile.username +``` + - OAuth bot accounts are now better supported using a method `Bot#invite_url` to get a bot's invite URL and sending tokens using the new `Bot` prefix. + - discordrb now fully uses [websocket-client-simple](https://github.com/shokai/websocket-client-simple) (a.k.a. WSCS) instead of Faye::WebSocket, this means that the annoying OpenSSL library thing won't have to be done anymore. + - The new version of the Discord gateway (v4) is supported and used by default. This should bring more stability and possibly slight performance improvements. + - Some older v3 features that weren't supported before are now: + - Compressed ready packets (should decrease network overhead for very large bots) + - Discord rate limits are now supported better - the client will never send a message if it knows it's going to be rate limited, instead it's going to wait for the correct time. + - Requests will now automatically be retried if a 502 (cloudflare error) is received. + - `MessageEditEvent`s now have a whole message instead of just the ID to allow for checking the content of edited messages. + - `Message`s now have an `attachments` array with files attached to the message. + - `ReadyEvent` and `DisconnectEvent` now have the bot as a readable attribute - useful for container-based bots that don't have a way to get them otherwise. + - `Bot#find_channel` can now parse channel mentions and search for specific types of channels (text or voice). + - `Server#create_channel` can now create voice channels. + - A utility function `User#distinct` was added to get the distinct representation of a user (i.e. name + discrim, for example "meew0#9811") + - The `User#discriminator` attribute now has more aliases (`#tag`, `#discord_tag`, `#discrim`) + - `Permission` objects can now be created or set even without a role writer, useful to quickly get byte representations of permissions + - Permission overwrites can now be defined more easily using the utility method `Channel#define_overwrite` + - `Message`s returned at the end of commands (for example using `User#pm` or `Message#edit`) will now no longer be sent ([#66](https://github.com/discordrb/discordrb/issues/66)) + - The `:with_text` event attribute is now aliased to `:exact_text` ([#65](https://github.com/discordrb/discordrb/issues/65)) + - Server icons (`Server#icon=`) can now be set just like avatars (`Profile#avatar=`) + - Lots of comments were added to the examples and some bugs fixed + - The overall performance and memory usage was improved, especially on Ruby 2.3 (using the new frozen string literal comment) + - The documentation was slightly improved. + +### Fixed +- A *lot* of latent bugs with caching were fixed. This doesn't really have a noticeable effect, it just means better stability and reliability as a whole. +- **Command bots no longer respond when there are spaces between the prefix and the command.** Because this behaviour may be desirable, a `spaces_allowed` attribute was added to the CommandBot initializer that can be set to true to re-enable this behaviour. +- Permission calculation (`User#permission?`) has been thoroughly rewritten and should now account for edge cases like server owners and Manage Permissions. +- The gateway reconnect logic now uses a correct falloff system - before it would start at 1 second between attempts and immediately jump to 120. Now the transition is more smooth. +- Commands with aliases now show up correctly in the auto-generated help command ([#72](https://github.com/discordrb/discordrb/issues/72)) +- The auto-generated help command can now actually be disabled by setting the corresponding attribute to nil ([#73](https://github.com/discordrb/discordrb/issues/73)) +- Including empty containers now does nothing instead of raising an error +- Command bots now obey `should_parse_self` + +## [1.8.1] - 2016-03-11 +[1.8.1]: https://github.com/discordrb/discordrb/releases/tag/v1.8.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.8.0...v1.8.1) + +### Fixed +* Fixed an error (caused by an undocumented API change) that would write a traceback to the console every time someone started typing in a channel invisible to the bot. + +## [1.8.0] - 2016-03-11 +[1.8.0]: https://github.com/discordrb/discordrb/releases/tag/v1.8.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.5...v1.8.0) + +### Added +* The built-in logger has been somewhat redone. + * It now has a fancy mode, settable using `Discordrb::LOGGER.fancy = true/false`, that makes use of ANSI escape codes to prettify the log output. + * It now supports more things than just `debug`, there's also `warn`, `error`, `good`, `info`, `in`, and `out`. + * You now have finer control over what gets output, using `Discordrb::LOGGER.mode=` which accepts one of `:debug`, `:verbose`, `:normal`, `:quiet`, `:silent`. +* You can now log in with just a token by setting the email parameter to `:token` and the password to the token you want to log in with. +* DCA playback now supports `DCA1`. +* All data classes (now generalized using the `IDObject` mixin) have a `creation_date` parameter that specifies when the object was created. +* `Channel#mention` was added that mentions a channel analogous to `User#mention`. +* The aliases `tag` and `discord_tag` have been added to the discriminator because that's what Discord calls them now. + +### Fixed +* A problem some users had where voice playback would leak FFmpeg processes has been fixed. +* The VWS internal thread now has a name in debug messages (`vws-i`) +* Users' voice channels should now always be set if they are in one + +## [1.7.5] - 2016-03-03 +[1.7.5]: https://github.com/discordrb/discordrb/releases/tag/v1.7.5 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.4...v1.7.5) + +### Changed +* `Channel#send_message` and `Bot#send_message` now have an extra `tts` parameter (false by default) to specify whether the message should use TTS. + +### Fixed +* Attempting to `p` a data class, especially a `User` or `Profile`, should no longer lock up the interpreter due to very deep recursion. +* Manual TTS using `API.send_message` will now work correctly. + +## [1.7.4] - 2016-02-28 +[1.7.4]: https://github.com/discordrb/discordrb/releases/tag/v1.7.4 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.3...v1.7.4) + +### Added +* Added methods `Channel#text?` and `Channel#voice?` to check a channel's type. +* Frequently allocated strings have been turned into symbols or frozen constants, this should improve performance slightly. + +### Fixed +* `VoiceBot#destroy` will now properly disconnect you and should no longer cause segfaults. +* Fixed a bug where you couldn't set any settings on a role created using `Server#create_role`. +* Fixed `Profile#avatar=` doing absolutely nothing. + +## [1.7.3] - 2016-02-27 +[1.7.3]: https://github.com/discordrb/discordrb/releases/tag/v1.7.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.2...v1.7.3) + +### Added +* The server banlist can now be accessed more nicely using `Server#bans`. +* Some abstractions for OAuth application creation were added - `bot.create_oauth_application` and `bot.update_oauth_application`. See the docs about how to use them. + +## [1.7.2] - 2016-02-25 +[1.7.2]: https://github.com/discordrb/discordrb/releases/tag/v1.7.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.1...v1.7.2) + +### Changed +* The `bot` object can now be read from all events, not just from command ones. +* You can now set the `filter_volume` on VoiceBot, which corresponds to the old way of doing volume handling, in case the new way is too slow for you. + +## [1.7.1] - 2016-02-23 +[1.7.1]: https://github.com/discordrb/discordrb/releases/tag/v1.7.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.7.0...v1.7.1) + +### Added +* A `clear!` method was added to EventContainer that removes all events from it, so you can overwrite modules by defining them again. (It's unnecessary for CommandContainers because commands can never be duplicate.) + +### Fixed +* The tokens will now be verified correctly when obtained from the cache. (I messed up last time) +* Events of the same type in different containers will now be merged correctly when including both containers. +* Got rid of the annoying `undefined method 'game' for nil:NilClass` error that sometimes occurred on startup. (It was harmless but now it's gone entirely) + +## [1.7.0] - 2016-02-23 +[1.7.0]: https://github.com/discordrb/discordrb/releases/tag/v1.7.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.6...v1.7.0) + +### Added +* **`bot.find` and `bot.find_user` have had their fuzzy search feature removed because it only caused problems. If you still need it, you can copy the code from the repo's history.** In addition, `find` was renamed to `find_channel` but still exists as a (deprecated) alias. +* The in-line documentation using Yard is now complete and can be [accessed at RubyDoc](https://www.rubydoc.info/github/discordrb/discordrb/master/). It's not quite polished yet and some things may be confusing, but it should be mostly usable. +* Events and commands can now be thoroughly modularized using a system I call 'containers'. (TODO: Add a tutorial here later) +* Support for the latest API changes: + * `Server.leave` does something different than `Server.delete` + * The WebSocket connection now uses version 3 of the protocol +* Voice bots now support playing DCA files using the [`play_dca`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FVoice%2FVoiceBot%3Aplay_dca) method. (TODO: Add a section to the voice tutorial) +* The [volume](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FVoice%2FVoiceBot%3Avolume) of a voice bot can now be changed during playback and not only for future playbacks. +* A `Channel.prune` method was added to quickly delete lots of messages from a channel. (It appears that this is something lots of bots do.) +* [`Server#members`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FServer%3Amembers) is now aliased to `users`. +* An attribute [`Server#member_count`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FServer%3Amember_count) was added that is accurate even if chunked members have not been added yet. +* An attribute [`Server#large?`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FServer%3Alarge) was added that is true if a server could possibly have an inaccurate list of members. +* Some more specific error classes have been added to replace the RestClient generic ones. +* Quickly sending a message using the `event << 'text'` syntax now works in every type of message event, not just commands. +* You can now set the bitrate of sent audio data using `bot.voice.encoder.bitrate = 64000` (see [`Encoder#bitrate=`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb/Voice/Encoder#bitrate%3D-instance_method)). Note that sent audio data will always be unaffected by voice channel bitrate settings, those only tell the client at what bitrate it should send. +* A rate limiting feature was added to commands - you can define buckets using the [`bucket`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FCommands%2FRateLimiter%3Abucket) method and use them as a parameter for [`command`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb%2FCommands%2FCommandContainer%3Acommand). + * A [`SimpleRateLimiter`](https://www.rubydoc.info/github/discordrb/discordrb/master/Discordrb/Commands/SimpleRateLimiter) class was also added if you want rate limiting independent from commands (e. g. for events) +* Connecting to the WebSocket now uses an exponential falloff system so we don't spam Discord with requests anymore. +* Debug timestamps are now accurate to milliseconds. + +### Fixed +* The token cacher will now detect whether a cached token has been invalidated due to a password change. +* `break`ing from an event or command will no longer spew `LocalJumpError`s to the console. + +## [1.6.6] - 2016-02-13 +[1.6.6]: https://github.com/discordrb/discordrb/releases/tag/v1.6.6 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.5...v1.6.6) + +### Fixed +* Fixed a problem that would cause an incompatibility with Ruby 2.1 +* Fixed servers sometimes containing duplicate members + +## [1.6.5] - 2016-02-12 +[1.6.5]: https://github.com/discordrb/discordrb/releases/tag/v1.6.5 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.4...v1.6.5) + +### Changed +* The bot will now request the users that would previously be sent all in one READY packet in multiple chunks. This improves startup time slightly and ensures compatibility with the latest Discord change, but it also means that some users won't be in server members lists until a while after creation (usually a couple seconds at most). + +## [1.6.4] - 2016-02-10 +[1.6.4]: https://github.com/discordrb/discordrb/releases/tag/v1.6.4 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.3...v1.6.4) + +### Fixed +* Fixed a bug that made the joining of servers using an invite impossible. + +## [1.6.3] - 2016-02-08 +[1.6.3]: https://github.com/discordrb/discordrb/releases/tag/v1.6.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.2...v1.6.3) + +### Fixed +* Fixed a bug that prevented the banning of users over the API + +## [1.6.2] - 2016-02-06 +[1.6.2]: https://github.com/discordrb/discordrb/releases/tag/v1.6.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.1...v1.6.2) + +### Fixed +* RbNaCl is now installed directly instead of the wrapper that also contains libsodium. This has the disadvantage that you will have to install libsodium manually but at least it's not broken on Windows anymore. + +## [1.6.1] - 2016-02-04 +[1.6.1]: https://github.com/discordrb/discordrb/releases/tag/v1.6.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.6.0...v1.6.1) + +### Changed +* It's now possible to prevent the `READY` packet from being printed in debug mode, run `bot.suppress_ready_debug` once before the `bot.run` to do it. + +### Fixed +* Token cache files with invalid JSON syntax will no longer crash the bot at login. + +## [1.6.0] - 2016-02-01 +[1.6.0]: https://github.com/discordrb/discordrb/releases/tag/v1.6.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.5.4...v1.6.0) + +### Added +* The inline documentation using YARD was greatly improved and is now mostly usable, at least for the data classes and voice classes. It's still not complete enough to be released on GitHub, but you can build it yourself using [YARD](https://yardoc.org/). +* It's now possible to encrypt sent voice data using an optional parameter in `voice_connect`. The encryption uses RbNaCl's [SecretBox](https://github.com/cryptosphere/rbnacl/wiki/Secret-Key-Encryption#algorithm-details) and is enabled by default. +* The [new library comparison](https://discordapi.com/unofficial/comparison.html) is now fully supported, barring voice receive and multi-send: (#39) + * `bot.invite` will create an `Invite` object from a code containing information about it. + * `server.move(user, channel)` will move a user to a different voice channel. + * The events `bot.message_edit` and `bot.message_delete` are now available for message editing and deletion. Note that Discord doesn't provide the content of edited/deleted messages, so you'll have to implement message caching yourself if you really need it. + * The events `bot.user_ban` and `bot.user_unban` are now available for users getting banned/unbanned from servers. +* A bot's name can now be sent using `bot.name=`. This data will be sent to Discord with the user-agent and it might be used for cool statistics in the future. +* Discord server ownership transfer is now implemented using the writer `server.owner=`. (#41) +* `CommandBot`s can now have command aliases by simply using an array of symbols as the command name. +* A utility method `server.default_channel` was implemented that returns the default text channel of a server, usually called #general. (An alias `general_channel` is available too.) +* Tokens will no longer appear in debug output, so you're safe sending output logs to other people. +* A reader `server.owner` that returns the server's owner as a `User` was added. Previously, users had to manually get the `User` object using `bot.user`. +* Most methods that accept IDs or data objects now also accept `Integer`s or `String`s containing the IDs now. This is implemented by adding a method `resolve_id` to all objects that could potentially contain an ID. (Note that this change is not complete yet and I might have missed some methods.) (#40) +* The writer `server.afk_channel_id=` is now deprecated as its functionality is now covered by `server.afk_channel=`. +* A new reader `user.avatar_url` was added that returns the full image URL to a user's avatar. +* To avoid confusion with `avatar_url`, the reader `user.avatar` was renamed to `avatar_id`. (`user.avatar` still exists but is now deprecated.) +* Symbols are now used instead of strings as hash keys in all methods that send JSON data to somewhere. This might improve performance slightly. + +### Fixed +* Fixed the reader `server.afk_channel_id` not containing a value sometimes. +* An issue was fixed where attempting to create a `Server` object from a stub server that didn't contain any role data would cause an exception. +* The `Invite` `server` property will now be initialized directly from the invite data instead of the channel the invite is to, to prevent it being `nil` when the invite channel was stubbed. +* The `inviter` of an `Invite` will now be `nil` instead of causing an exception when it doesn't exist in the invite data. + +## [1.5.4] - 2016-01-16 +[1.5.4]: https://github.com/discordrb/discordrb/releases/tag/v1.5.4 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.5.3...v1.5.4) + +### Changed +* The `opus-ruby` and `levenshtein` dependencies are now optional - if you don't need them, it won't crash immediately (only when you try to use voice / `find` with a threshold > 0, respectively) + +### Fixed +* Voice volume can now be properly set when using avconv (#37, thanks @purintai) +* `websocket-client-simple`, which is required for voice, is now specified in the dependencies. + +## [1.5.3] - 2016-01-11 +[1.5.3]: https://github.com/discordrb/discordrb/releases/tag/v1.5.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.5.2...v1.5.3) + +### Added +* Voice bot length adjustments are now configurable using `bot.voice.adjust_interval` and `bot.voice.adjust_offset` (make sure the latter is less than the first, or no adjustment will be performed at all) +* Length adjustments can now be made more smooth using `bot.voice.adjust_average` (true allows for more smooth adjustments, *may* improve stutteriness but might make it worse as well) + +## [1.5.2] - 2016-01-11 +[1.5.2]: https://github.com/discordrb/discordrb/releases/tag/v1.5.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.5.1...v1.5.2) + +### Added +* `bot.voice_connect` can now use a channel ID directly. +* A reader `bot.volume` now exists for the corresponding writer. +* The attribute `bot.encoder.use_avconv` was added that makes the bot use avconv instead of ffmpeg (for those on Ubuntu 14.x) +* The PBKDF2 iteration count for token caching was increased to 300,000 for extra security. + +### Fixed +* Fix a bug where `play_file` wouldn't properly accept string file paths (#36, thanks @purintai) +* Fix a concurrency issue where `VoiceBot` would try to read from nil + +## [1.5.1] - 2016-01-10 +[1.5.1]: https://github.com/discordrb/discordrb/releases/tag/v1.5.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.5.0...v1.5.1) + +### Added +* The connection to voice was made more reliable. I haven't experienced any issues with it myself but I got reports where `recv` worked better than `recvmsg`. + +## [1.5.0] - 2016-01-10 +[1.5.0]: https://github.com/discordrb/discordrb/releases/tag/v1.5.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.8...v1.5.0) + +### Added +* Voice support: discordrb can now connect to voice using `bot.voice_connect` and do the following things: + * Play files and URLs using `VoiceBot.play_file` + * Play arbitrary streams using `VoiceBot.play_io` + * Set the volume of future playbacks using `VoiceBot.volume=` + * Pause and resume playback (`VoiceBot.pause` and `VoiceBot.continue`) +* Authentication tokens are now cached and no login request will be made if a cached token is found. This is mostly to reduce strain on Discord's servers. + +### Fixed +* Some latent ID casting errors were fixed - those would probably never have been noticed anyway, but they're fixed now. +* `Bot.parse_mention` now works, it didn't work at all previously + +## [1.4.8] - 2016-01-06 +[1.4.8]: https://github.com/discordrb/discordrb/releases/tag/v1.4.8 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.7...v1.4.8) + +### Added +* The `User` class now has the methods `add_role` and `remove_role` which add a role to a user and remove it, respectively. +* All data classes now have a useful `==` implementation. +* **The `Game` class and all references to it were removed**. Games are now only identified by their name. + +### Fixed +* When a role is deleted, the ID is now obtained correctly. (#30) + +## [1.4.7] - 2016-01-03 +[1.4.7]: https://github.com/discordrb/discordrb/releases/tag/v1.4.7 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.6...v1.4.7) + +### Added +* Presence event handling is now divided into two separate events; `PresenceEvent` to handle online/offline/idle statuses and `PlayingEvent` to handle users playing games. +* The `user` property of `MessageEvent` is now automatically resolved to the cached user, so you can modify roles instantly without having to resolve it yourself. +* `Message` now has a useful `to_s` method that just returns the content. + +### Fixed +* The `TypingEvent` `user` property is now initialized correctly (#29, thanks @purintai) + +## [1.4.6] - 2015-12-25 +[1.4.6]: https://github.com/discordrb/discordrb/releases/tag/v1.4.6 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.4...v1.4.6) + +### Fixed +* The `user` and `server` properties of `PresenceEvent` are now initialized correctly. + +## 1.4.5 + +### Changed +* The `Bot.game` property can now be set to an arbitrary string. +* Discord mentions are handled in the old way again, after Discord reverted an API change. + +## [1.4.4] - 2015-12-18 +[1.4.4]: https://github.com/discordrb/discordrb/releases/tag/v1.4.4 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.3...v1.4.4) + +### Added +* Add `Server.leave_server` as an alias for `delete_server` +* Use the new Discord mention format (mentions array). **Reverted in 1.4.5** +* Discord rate limited API calls are now handled correctly - discordrb will try again after the specified time. +* Debug logging is now handled by a separate `Logger` class + +### Fixed +* Message timestamps are now parsed correctly. +* The quickadders for awaits (`User.await`, `Channel.await` etc.) now add the correct awaits. + +## [1.4.3] - 2015-12-11 +[1.4.3]: https://github.com/discordrb/discordrb/releases/tag/v1.4.3 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.2...v1.4.3) + +### Added +* Added a method `Bot.find_user` analogous to `Bot.find`. + +### Fixed +* Remove a leftover debug line (#23, thanks @VxJasonxV) + +## [1.4.2] - 2015-12-10 +[1.4.2]: https://github.com/discordrb/discordrb/releases/tag/v1.4.2 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.1...v1.4.2) + +### Changed +* discordrb will now send a user agent in the format requested by the Discord devs. + +## [1.4.1] - 2015-12-07 +[1.4.1]: https://github.com/discordrb/discordrb/releases/tag/v1.4.1 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.4.0...v1.4.1) + +### Fixed +* Empty messages will now never be sent +* The command-not-found message in `CommandBot` can now be disabled properly + +## [1.4.0] - 2015-12-04 +[1.4.0]: https://github.com/discordrb/discordrb/releases/tag/v1.4.0 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.12...v1.4.0) + +### Added +* All methods and classes where the words "colour" or "color" are used now have had aliases added with the respective other spelling. (Internally, everything uses "colour" now). +* discordrb now supports everything on the Discord API comparison, except for voice (see also #22) + * Roles can now be created, edited and deleted and their permissions modified. + * There is now a method to get a channel's message history. + * The bot's user profile can now be edited. + * Servers can now be created, edited and deleted. + * The user can now display a "typing" message in a channel. + * Invites can now be created and deleted, and an `Invite` class was made to represent them. +* Command and event handling is now threaded, with each command/event handler execution in a separate thread. +* Debug messages now specify the current thread's name. +* discordrb now handles created/updated/deleted servers properly with events added to handle them. +* The list of games handled by Discord will now be updated automatically. + +### Fixed +* Fixed a bug where command handling would crash if the command didn't exist. + +## [1.3.12] - 2015-11-30 +[1.3.12]: https://github.com/discordrb/discordrb/releases/tag/v1.3.12 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.11...v1.3.12) + +### Added +* Add an attribute `Bot.should_parse_self` (false by default) that prevents the bot from raising an event if it receives a message from itself. +* `User.bot?` and `Message.from_bot?` were implemented to check whether the user is the bot or the message was sent by it. +* Add an event for private messages specifically (`Bot.pm` and `PrivateMessageEvent`) + +### Fixed +* Fix the `MessageEvent` attribute that checks whether the message is from the bot not working at all. + +## [1.3.11] - 2015-11-29 +[1.3.11]: https://github.com/discordrb/discordrb/releases/tag/v1.3.11 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.10...v1.3.11) + +### Added +* Add a user selector (`:bot`) that is usable in the `from:` `MessageEvent` attribute to check whether the message was sent by a bot. + +### Fixed +* `Channel.private?` now checks for the server being nil instead of the `is_private` attribute provided by Discord as the latter is unreliable. (wtf) + +## [1.3.10] - 2015-11-28 +[1.3.10]: https://github.com/discordrb/discordrb/releases/tag/v1.3.10 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.9...v1.3.10) + +### Added +* Add a method `Channel.private?` to check for a PM channel +* Add a `MessageEvent` attribute (`:private`) to check whether a message was sent in a PM channel +* Add various aliases to `MessageEvent` attributes +* Allow regexes to check for strings in `MessageEvent` attributes + +### Fixed +* The `matches_all` method would break in certain edge cases. This didn't really affect discordrb and I don't think anyone else uses that method (it's pretty useless otherwise). This has been fixed + +## [1.3.9] - 2015-11-27 +[1.3.9]: https://github.com/discordrb/discordrb/releases/tag/v1.3.9 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.8...v1.3.9) + +### Added +* Add awaits, a powerful way to add temporary event handlers. +* Add a `Bot.find` method to fuzzy-search for channels. +* Add methods to kick, ban and unban users. + +### Fixed +* Permission overrides now work correctly for private channels (i. e. they don't exist at all) +* Users joining and leaving servers are now handled correctly. + +## [1.3.8] - 2015-11-12 +[1.3.8]: https://github.com/discordrb/discordrb/releases/tag/v1.3.8 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.7...v1.3.8) + +### Added +* Added `Bot.users` and `Bot.servers` readers to get the list of users and servers. + +### Fixed +* POST requests to API calls that don't need a payload will now send a `nil` payload instead. This fixes the bot being unable to join any servers and various other latent problems. (#21, thanks @davidkus) + +## [1.3.7] - 2015-11-07 +[1.3.7]: https://github.com/discordrb/discordrb/releases/tag/v1.3.7 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.6...v1.3.7) + +### Fixed +* Fix the command bot being included wrong, which caused crashes upon startup. + +## [1.3.6] - 2015-11-07 +[1.3.6]: https://github.com/discordrb/discordrb/releases/tag/v1.3.6 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.5...v1.3.6) + +### Added +* The bot can now be stopped from the script using the new method `Bot.stop`. + +### Fixed +* Fix some wrong file requires which caused crashes sometimes. + +## [1.3.5] - 2015-11-07 +[1.3.5]: https://github.com/discordrb/discordrb/releases/tag/v1.3.5 + +[View diff for this release.](https://github.com/discordrb/discordrb/compare/v1.3.4...v1.3.5) + +### Added +* The bot can now be run asynchronously using `Bot.run(:async)` to do further initialization after the bot was started. diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Gemfile b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Gemfile new file mode 100644 index 0000000..e0fbe4d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Gemfile @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +# Specify your gem's dependencies in discordrb.gemspec +gemspec name: 'discordrb' +gemspec name: 'discordrb-webhooks', development_group: 'webhooks' diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/LICENSE.txt new file mode 100644 index 0000000..91b1a60 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2020 meew0 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/README.md b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/README.md new file mode 100644 index 0000000..5d382ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/README.md @@ -0,0 +1,174 @@ +[![Gem](https://img.shields.io/gem/v/discordrb.svg)](https://rubygems.org/gems/discordrb) +[![Gem](https://img.shields.io/gem/dt/discordrb.svg)](https://rubygems.org/gems/discordrb) +[![CircleCI](https://circleci.com/gh/shardlab/discordrb.svg?style=svg)](https://circleci.com/gh/shardlab/discordrb) +[![Inline docs](http://inch-ci.org/github/shardlab/discordrb.svg?branch=main)](http://inch-ci.org/github/shardlab/discordrb) +[![Join Discord](https://img.shields.io/badge/discord-join-7289DA.svg)](https://discord.gg/cyK3Hjm) +# discordrb + +An implementation of the [Discord](https://discord.com/) API using Ruby. + +## Quick links to sections + +* [Introduction](https://github.com/shardlab/discordrb#introduction) +* [Dependencies](https://github.com/shardlab/discordrb#dependencies) +* [Installation](https://github.com/shardlab/discordrb#installation) +* [Usage](https://github.com/shardlab/discordrb#usage) +* [Webhooks Client](https://github.com/shardlab/discordrb#webhooks-client) +* [Support](https://github.com/shardlab/discordrb#support) +* [Development](https://github.com/shardlab/discordrb#development), [Contributing](https://github.com/shardlab/discordrb#contributing) +* [License](https://github.com/shardlab/discordrb#license) + +See also: [Documentation](https://www.rubydoc.info/gems/discordrb), [Tutorials](https://github.com/shardlab/discordrb/wiki) + +## Introduction + +`discordrb` aims to meet the following design goals: + +1. Full coverage of the public bot API. +2. Expressive, high level abstractions for rapid development of common applications. +3. Friendly to Ruby beginners and beginners of open source contribution. + +If you enjoy using the library, consider getting involved with the community to help us improve and meet these goals! + +**You should consider using `discordrb` if:** + +- You need a bot - and fast - for small or medium sized communities, and don't want to be bogged down with "low level" details. Getting started takes minutes, and utilities like a command parser and tools for modularization make it simple to quickly add or change your bots functionality. +- You like or want to learn Ruby, or want to contribute to a Ruby project. A lot of our users are new to Ruby, and eventually make their first open source contributions with us. We have an active Discord channel with experienced members who will happily help you get involved, either as a user or contributor. +- You want to experiment with Discord's API or prototype concepts for Discord bots without too much commitment. + +**You should consider other libraries if:** + +- You need to scale to large volumes of servers (>2,500) with lots of members. It's still possible, but it can be difficult to scale Ruby processes, and it requires more in depth knowledge to do so well. Especially if you already have a bot that is on a large amount of servers, porting to Ruby is unlikely to improve your performance in most cases. +- You want full control over the library that you're using. While we expose some "lower level" interfaces, they are unstable, and only exist to serve the more powerful abstractions in the library. + +## Dependencies + +* Ruby >= 2.5 supported +* An installed build system for native extensions (on Windows, make sure you download the "Ruby+Devkit" version of [RubyInstaller](https://rubyinstaller.org/downloads/)) + +### Voice dependencies + +This section only applies to you if you want to use voice functionality. +* [libsodium](https://github.com/shardlab/discordrb/wiki/Installing-libsodium) +* A compiled libopus distribution for your system, anywhere the script can find it. See [here](https://github.com/shardlab/discordrb/wiki/Installing-libopus) for installation instructions. +* [FFmpeg](https://www.ffmpeg.org/download.html) installed and in your PATH + +## Installation + +### With Bundler + +Using [Bundler](https://bundler.io/#getting-started), you can add discordrb to your Gemfile: + + gem 'discordrb' + +And then install via `bundle install`. + +Run the [ping example](https://github.com/shardlab/discordrb/blob/master/examples/ping.rb) to verify that the installation works (make sure to replace the token and client ID in there with your bots'!): + +To run the bot while using bundler: + + bundle exec ruby ping.rb + +### With Gem + +Alternatively, while Bundler is the recommended option, you can also install discordrb without it. + +#### Linux / macOS + + gem install discordrb + +#### Windows + +> **Make sure you have the DevKit installed! See the [Dependencies](https://github.com/shardlab/discordrb#dependencies) section)** + + gem install discordrb --platform=ruby + +To run the bot: + + ruby ping.rb + +### Installation Troubleshooting + +See https://github.com/shardlab/discordrb/wiki/FAQ#installation for a list of common problems and solutions when installing `discordrb`. + +## Usage + +You can make a simple bot like this: + +```ruby +require 'discordrb' + +bot = Discordrb::Bot.new token: '' + +bot.message(with_text: 'Ping!') do |event| + event.respond 'Pong!' +end + +bot.run +``` + +This bot responds to every "Ping!" with a "Pong!". + +See [additional examples here](https://github.com/shardlab/discordrb/tree/master/examples). + +You can find examples of projects that use discordrb by [searching for the discordrb topic on GitHub](https://github.com/topics/discordrb). + +If you've made an open source project on GitHub that uses discordrb, consider adding the `discordrb` topic to your repo! + +## Webhooks Client + +Also included is a webhooks client, which can be used as a separate gem `discordrb-webhooks`. This special client can be used to form requests to Discord webhook URLs in a high-level manner. + +- [`discordrb-webhooks` documentation](https://www.rubydoc.info/gems/discordrb-webhooks) +- [More information about webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) +- [Embed visualizer tool](https://leovoel.github.io/embed-visualizer/) - Includes a discordrb code generator for forming embeds + +### Usage + +```ruby +require 'discordrb/webhooks' + +WEBHOOK_URL = 'https://discord.com/api/webhooks/424070213278105610/yByxDncRvHi02mhKQheviQI2erKkfRRwFcEp0MMBfib1ds6ZHN13xhPZNS2-fJo_ApSw'.freeze + +client = Discordrb::Webhooks::Client.new(url: WEBHOOK_URL) +client.execute do |builder| + builder.content = 'Hello world!' + builder.add_embed do |embed| + embed.title = 'Embed title' + embed.description = 'Embed description' + embed.timestamp = Time.now + end +end +``` + +**Note:** The `discordrb` gem relies on `discordrb-webhooks`. If you already have `discordrb` installed, `require 'discordrb/webhooks'` will include all of the `Webhooks` features as well. + +## Support + +If you need help or have a question, you can: + +1. Join our [Discord channel](https://discord.gg/cyK3Hjm). This is the fastest means of getting support. +2. [Open an issue](https://github.com/shardlab/discordrb/issues). Be sure to read the issue template, and provide as much detail as you can. + +## Contributing + +Thank you for your interest in contributing! +Bug reports and pull requests are welcome on GitHub at https://github.com/shardlab/discordrb. + +In general, we recommend starting by discussing what you would like to contribute in the [Discord channel](https://discord.gg/cyK3Hjm). +There are usually a handful of people working on things for the library, and what you're looking for may already be on the way. + +Additionally, there is a chance what you are looking for might already exist, or we decided not to pursue it for some reason. +Be sure to use the search feature on our documentation, GitHub, and Discord to see if this might be the case. + +## Development setup + +**This section is for developing discordrb itself! If you just want to make a bot, see the [Installation](https://github.com/shardlab/discordrb#installation) section.** + +After checking out the repo, run `bin/setup` to install dependencies. You can then run tests via `bundle exec rspec spec`. Make sure to run rubocop also: `bundle exec rubocop`. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Rakefile b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Rakefile new file mode 100644 index 0000000..3233c41 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/Rakefile @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'bundler/gem_helper' + +namespace :main do + Bundler::GemHelper.install_tasks(name: 'discordrb') +end + +namespace :webhooks do + Bundler::GemHelper.install_tasks(name: 'discordrb-webhooks') +end + +task build: %i[main:build webhooks:build] +task release: %i[main:release webhooks:release] + +# Make "build" the default task +task default: :build diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/console b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/console new file mode 100755 index 0000000..6c78535 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/console @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'bundler/setup' +require 'discordrb' + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require 'irb' +IRB.start diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/setup b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/setup new file mode 100755 index 0000000..b65ed50 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/setup @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +bundle install + +# Do any other automated setup that you need to do here diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/travis_build_docs.sh b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/travis_build_docs.sh new file mode 100755 index 0000000..37dfa8e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/bin/travis_build_docs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Script to build docs for travis usage + +set -e + +SOURCE_BRANCH=$TRAVIS_BRANCH + +if [ -n "$TRAVIS_TAG" ]; then + SOURCE_BRANCH=$TRAVIS_TAG +fi + +# Use YARD to build docs +bundle exec yard + +# Move to correct folder +mkdir -p docs/$SOURCE_BRANCH +mv doc/* docs/$SOURCE_BRANCH/ diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb-webhooks.gemspec b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb-webhooks.gemspec new file mode 100644 index 0000000..5a37924 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb-webhooks.gemspec @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'discordrb/webhooks/version' + +Gem::Specification.new do |spec| + spec.name = 'discordrb-webhooks' + spec.version = Discordrb::Webhooks::VERSION + spec.authors = %w[meew0 swarley] + spec.email = [''] + + spec.summary = 'Webhook client for discordrb' + spec.description = "A client for Discord's webhooks to fit alongside [discordrb](https://rubygems.org/gems/discordrb)." + spec.homepage = 'https://github.com/shardlab/discordrb' + spec.license = 'MIT' + + spec.files = `git ls-files -z lib/discordrb/webhooks/`.split("\x0") + ['lib/discordrb/webhooks.rb'] + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] + + spec.add_dependency 'rest-client', '>= 2.0.0' + + spec.required_ruby_version = '>= 2.5' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb.gemspec b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb.gemspec new file mode 100644 index 0000000..f0dab9c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/discordrb.gemspec @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'discordrb/version' + +Gem::Specification.new do |spec| + spec.name = 'discordrb' + spec.version = Discordrb::VERSION + spec.authors = %w[meew0 swarley] + spec.email = [''] + + spec.summary = 'Discord API for Ruby' + spec.description = 'A Ruby implementation of the Discord (https://discord.com) API.' + spec.homepage = 'https://github.com/shardlab/discordrb' + spec.license = 'MIT' + + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|examples|lib/discordrb/webhooks)/}) } + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.metadata = { + 'changelog_uri' => 'https://github.com/shardlab/discordrb/blob/master/CHANGELOG.md' + } + spec.require_paths = ['lib'] + + spec.add_dependency 'ffi', '>= 1.9.24' + spec.add_dependency 'opus-ruby' + spec.add_dependency 'rest-client', '>= 2.0.0' + spec.add_dependency 'websocket-client-simple', '>= 0.3.0' + + spec.add_dependency 'discordrb-webhooks', '~> 3.3.0' + + spec.required_ruby_version = '>= 2.5' + + spec.add_development_dependency 'bundler', '>= 1.10', '< 3' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'redcarpet', '~> 3.5.0' # YARD markdown formatting + spec.add_development_dependency 'rspec', '~> 3.10.0' + spec.add_development_dependency 'rspec-prof', '~> 0.0.7' + spec.add_development_dependency 'rubocop', '~> 1.4.0' + spec.add_development_dependency 'rubocop-performance', '~> 1.0' + spec.add_development_dependency 'simplecov', '~> 0.19.0' + spec.add_development_dependency 'yard', '~> 0.9.9' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb.rb new file mode 100644 index 0000000..fdf63a7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +require 'discordrb/version' +require 'discordrb/bot' +require 'discordrb/commands/command_bot' +require 'discordrb/logger' + +# All discordrb functionality, to be extended by other files +module Discordrb + Thread.current[:discordrb_name] = 'main' + + # The default debug logger used by discordrb. + LOGGER = Logger.new(ENV['DISCORDRB_FANCY_LOG']) + + # The Unix timestamp Discord IDs are based on + DISCORD_EPOCH = 1_420_070_400_000 + + # Used to declare what events you wish to recieve from Discord. + # @see https://discordapp.com/developers/docs/topics/gateway#gateway-intents + INTENTS = { + servers: 1 << 0, + server_members: 1 << 1, + server_bans: 1 << 2, + server_emojis: 1 << 3, + server_integrations: 1 << 4, + server_webhooks: 1 << 5, + server_invites: 1 << 6, + server_voice_states: 1 << 7, + server_presences: 1 << 8, + server_messages: 1 << 9, + server_message_reactions: 1 << 10, + server_message_typing: 1 << 11, + direct_messages: 1 << 12, + direct_message_reactions: 1 << 13, + direct_message_typing: 1 << 14 + }.freeze + + # @return [Integer] All available intents + ALL_INTENTS = INTENTS.values.reduce(&:|) + + # Compares two objects based on IDs - either the objects' IDs are equal, or one object is equal to the other's ID. + def self.id_compare(one_id, other) + other.respond_to?(:resolve_id) ? (one_id.resolve_id == other.resolve_id) : (one_id == other) + end + + # The maximum length a Discord message can have + CHARACTER_LIMIT = 2000 + + # Splits a message into chunks of 2000 characters. Attempts to split by lines if possible. + # @param msg [String] The message to split. + # @return [Array] the message split into chunks + def self.split_message(msg) + # If the messages is empty, return an empty array + return [] if msg.empty? + + # Split the message into lines + lines = msg.lines + + # Turn the message into a "triangle" of consecutively longer slices, for example the array [1,2,3,4] would become + # [ + # [1], + # [1, 2], + # [1, 2, 3], + # [1, 2, 3, 4] + # ] + tri = (0...lines.length).map { |i| lines.combination(i + 1).first } + + # Join the individual elements together to get an array of strings with consecutively more lines + joined = tri.map(&:join) + + # Find the largest element that is still below the character limit, or if none such element exists return the first + ideal = joined.max_by { |e| e.length > CHARACTER_LIMIT ? -1 : e.length } + + # If it's still larger than the character limit (none was smaller than it) split it into the largest chunk without + # cutting words apart, breaking on the nearest space within character limit, otherwise just return an array with one element + ideal_ary = ideal.length > CHARACTER_LIMIT ? ideal.split(/(.{1,#{CHARACTER_LIMIT}}\b|.{1,#{CHARACTER_LIMIT}})/o).reject(&:empty?) : [ideal] + + # Slice off the ideal part and strip newlines + rest = msg[ideal.length..-1].strip + + # If none remains, return an empty array -> we're done + return [] unless rest + + # Otherwise, call the method recursively to split the rest of the string and add it onto the ideal array + ideal_ary + split_message(rest) + end +end + +# In discordrb, Integer and {String} are monkey-patched to allow for easy resolution of IDs +class Integer + # @return [Integer] The Discord ID represented by this integer, i.e. the integer itself + def resolve_id + self + end +end + +# In discordrb, {Integer} and String are monkey-patched to allow for easy resolution of IDs +class String + # @return [Integer] The Discord ID represented by this string, i.e. the string converted to an integer + def resolve_id + to_i + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/allowed_mentions.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/allowed_mentions.rb new file mode 100644 index 0000000..e913d53 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/allowed_mentions.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require 'discordrb/id_object' + +module Discordrb + # Builder class for `allowed_mentions` when sending messages. + class AllowedMentions + # @return [Array<"users", "roles", "everyone">, nil] + attr_accessor :parse + + # @return [Array, nil] + attr_accessor :users + + # @return [Array, nil] + attr_accessor :roles + + # @param parse [Array<"users", "roles", "everyone">] Mention types that can be inferred from the message. + # `users` and `roles` allow for all mentions of the respective type to ping. `everyone` allows usage of `@everyone` and `@here` + # @param users [Array] Users or user IDs that can be pinged. Cannot be used in conjunction with `"users"` in `parse` + # @param roles [Array] Roles or role IDs that can be pinged. Cannot be used in conjunction with `"roles"` in `parse` + def initialize(parse: nil, users: nil, roles: nil) + @parse = parse + @users = users + @roles = roles + end + + # @!visibility private + def to_hash + { + parse: @parse, + users: @users&.map { |user| user.is_a?(IDObject) ? user.id : user }, + roles: @roles&.map { |role| role.is_a?(IDObject) ? role.id : role } + }.compact + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api.rb new file mode 100644 index 0000000..8c6cb81 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api.rb @@ -0,0 +1,344 @@ +# frozen_string_literal: true + +require 'rest-client' +require 'json' +require 'time' + +require 'discordrb/errors' + +# List of methods representing endpoints in Discord's API +module Discordrb::API + # The base URL of the Discord REST API. + APIBASE = 'https://discord.com/api/v6' + + # The URL of Discord's CDN + CDN_URL = 'https://cdn.discordapp.com' + + module_function + + # @return [String] the currently used API base URL. + def api_base + @api_base || APIBASE + end + + # Sets the API base URL to something. + def api_base=(value) + @api_base = value + end + + # @return [String] the currently used CDN url + def cdn_url + @cdn_url || CDN_URL + end + + # @return [String] the bot name, previously specified using {.bot_name=}. + def bot_name + @bot_name + end + + # Sets the bot name to something. Used in {.user_agent}. For the bot's username, see {Profile#username=}. + def bot_name=(value) + @bot_name = value + end + + # Changes the rate limit tracing behaviour. If rate limit tracing is on, a full backtrace will be logged on every RL + # hit. + # @param value [true, false] whether or not to enable rate limit tracing + def trace=(value) + @trace = value + end + + # Generate a user agent identifying this requester as discordrb. + def user_agent + # This particular string is required by the Discord devs. + required = "DiscordBot (https://github.com/shardlab/discordrb, v#{Discordrb::VERSION})" + @bot_name ||= '' + + "#{required} rest-client/#{RestClient::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL} discordrb/#{Discordrb::VERSION} #{@bot_name}" + end + + # Resets all rate limit mutexes + def reset_mutexes + @mutexes = {} + @global_mutex = Mutex.new + end + + # Wait a specified amount of time synchronised with the specified mutex. + def sync_wait(time, mutex) + mutex.synchronize { sleep time } + end + + # Wait for a specified mutex to unlock and do nothing with it afterwards. + def mutex_wait(mutex) + mutex.lock + mutex.unlock + end + + # Performs a RestClient request. + # @param type [Symbol] The type of HTTP request to use. + # @param attributes [Array] The attributes for the request. + def raw_request(type, attributes) + RestClient.send(type, *attributes) + rescue RestClient::Forbidden => e + # HACK: for #request, dynamically inject restclient's response into NoPermission - this allows us to rate limit + noprm = Discordrb::Errors::NoPermission.new + noprm.define_singleton_method(:_rc_response) { e.response } + raise noprm, "The bot doesn't have the required permission to do this!" + rescue RestClient::BadGateway + Discordrb::LOGGER.warn('Got a 502 while sending a request! Not a big deal, retrying the request') + retry + end + + # Make an API request, including rate limit handling. + def request(key, major_parameter, type, *attributes) + # Add a custom user agent + attributes.last[:user_agent] = user_agent if attributes.last.is_a? Hash + + # Specify RateLimit precision + attributes.last[:x_ratelimit_precision] = 'millisecond' + + # The most recent Discord rate limit requirements require the support of major parameters, where a particular route + # and major parameter combination (*not* the HTTP method) uniquely identifies a RL bucket. + key = [key, major_parameter].freeze + + begin + mutex = @mutexes[key] ||= Mutex.new + + # Lock and unlock, i.e. wait for the mutex to unlock and don't do anything with it afterwards + mutex_wait(mutex) + + # If the global mutex happens to be locked right now, wait for that as well. + mutex_wait(@global_mutex) if @global_mutex.locked? + + response = nil + begin + response = raw_request(type, attributes) + rescue RestClient::Exception => e + response = e.response + raise e + rescue Discordrb::Errors::NoPermission => e + if e.respond_to?(:_rc_response) + response = e._rc_response + else + Discordrb::LOGGER.warn("NoPermission doesn't respond_to? _rc_response!") + end + + raise e + ensure + if response + handle_preemptive_rl(response.headers, mutex, key) if response.headers[:x_ratelimit_remaining] == '0' && !mutex.locked? + else + Discordrb::LOGGER.ratelimit('Response was nil before trying to preemptively rate limit!') + end + end + rescue RestClient::TooManyRequests => e + # If the 429 is from the global RL, then we have to use the global mutex instead. + mutex = @global_mutex if e.response.headers[:x_ratelimit_global] == 'true' + + unless mutex.locked? + response = JSON.parse(e.response) + wait_seconds = response['retry_after'].to_i / 1000.0 + Discordrb::LOGGER.ratelimit("Locking RL mutex (key: #{key}) for #{wait_seconds} seconds due to Discord rate limiting") + trace("429 #{key.join(' ')}") + + # Wait the required time synchronized by the mutex (so other incoming requests have to wait) but only do it if + # the mutex isn't locked already so it will only ever wait once + sync_wait(wait_seconds, mutex) + end + + retry + end + + response + end + + # Handles pre-emptive rate limiting by waiting the given mutex by the difference of the Date header to the + # X-Ratelimit-Reset header, thus making sure we don't get 429'd in any subsequent requests. + def handle_preemptive_rl(headers, mutex, key) + Discordrb::LOGGER.ratelimit "RL bucket depletion detected! Date: #{headers[:date]} Reset: #{headers[:x_ratelimit_reset]}" + delta = headers[:x_ratelimit_reset_after].to_f + Discordrb::LOGGER.warn("Locking RL mutex (key: #{key}) for #{delta} seconds pre-emptively") + sync_wait(delta, mutex) + end + + # Perform rate limit tracing. All this method does is log the current backtrace to the console with the `:ratelimit` + # level. + # @param reason [String] the reason to include with the backtrace. + def trace(reason) + unless @trace + Discordrb::LOGGER.debug("trace was called with reason #{reason}, but tracing is not enabled") + return + end + + Discordrb::LOGGER.ratelimit("Trace (#{reason}):") + + caller.each do |str| + Discordrb::LOGGER.ratelimit(" #{str}") + end + end + + # Make an icon URL from server and icon IDs + def icon_url(server_id, icon_id, format = 'webp') + "#{cdn_url}/icons/#{server_id}/#{icon_id}.#{format}" + end + + # Make an icon URL from application and icon IDs + def app_icon_url(app_id, icon_id, format = 'webp') + "#{cdn_url}/app-icons/#{app_id}/#{icon_id}.#{format}" + end + + # Make a widget picture URL from server ID + def widget_url(server_id, style = 'shield') + "#{api_base}/guilds/#{server_id}/widget.png?style=#{style}" + end + + # Make a splash URL from server and splash IDs + def splash_url(server_id, splash_id, format = 'webp') + "#{cdn_url}/splashes/#{server_id}/#{splash_id}.#{format}" + end + + # Make a banner URL from server and banner IDs + def banner_url(server_id, banner_id, format = 'webp') + "#{cdn_url}/banners/#{server_id}/#{banner_id}.#{format}" + end + + # Make an emoji icon URL from emoji ID + def emoji_icon_url(emoji_id, format = 'webp') + "#{cdn_url}/emojis/#{emoji_id}.#{format}" + end + + # Make an asset URL from application and asset IDs + def asset_url(application_id, asset_id, format = 'webp') + "#{cdn_url}/app-assets/#{application_id}/#{asset_id}.#{format}" + end + + # Make an achievement icon URL from application ID, achievement ID, and icon hash + def achievement_icon_url(application_id, achievement_id, icon_hash, format = 'webp') + "#{cdn_url}/app-assets/#{application_id}/achievements/#{achievement_id}/icons/#{icon_hash}.#{format}" + end + + # Login to the server + def login(email, password) + request( + :auth_login, + nil, + :post, + "#{api_base}/auth/login", + email: email, + password: password + ) + end + + # Logout from the server + def logout(token) + request( + :auth_logout, + nil, + :post, + "#{api_base}/auth/logout", + nil, + Authorization: token + ) + end + + # Create an OAuth application + def create_oauth_application(token, name, redirect_uris) + request( + :oauth2_applications, + nil, + :post, + "#{api_base}/oauth2/applications", + { name: name, redirect_uris: redirect_uris }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Change an OAuth application's properties + def update_oauth_application(token, name, redirect_uris, description = '', icon = nil) + request( + :oauth2_applications, + nil, + :put, + "#{api_base}/oauth2/applications", + { name: name, redirect_uris: redirect_uris, description: description, icon: icon }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get the bot's OAuth application's information + def oauth_application(token) + request( + :oauth2_applications_me, + nil, + :get, + "#{api_base}/oauth2/applications/@me", + Authorization: token + ) + end + + # Acknowledge that a message has been received + # The last acknowledged message will be sent in the ready packet, + # so this is an easy way to catch up on messages + def acknowledge_message(token, channel_id, message_id) + request( + :channels_cid_messages_mid_ack, + nil, # This endpoint is unavailable for bot accounts and thus isn't subject to its rate limit requirements. + :post, + "#{api_base}/channels/#{channel_id}/messages/#{message_id}/ack", + nil, + Authorization: token + ) + end + + # Get the gateway to be used + def gateway(token) + request( + :gateway, + nil, + :get, + "#{api_base}/gateway", + Authorization: token + ) + end + + # Get the gateway to be used, with additional information for sharding and + # session start limits + def gateway_bot(token) + request( + :gateway_bot, + nil, + :get, + "#{api_base}/gateway/bot", + Authorization: token + ) + end + + # Validate a token (this request will fail if the token is invalid) + def validate_token(token) + request( + :auth_login, + nil, + :post, + "#{api_base}/auth/login", + {}.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get a list of available voice regions + def voice_regions(token) + request( + :voice_regions, + nil, + :get, + "#{api_base}/voice/regions", + Authorization: token, + content_type: :json + ) + end +end + +Discordrb::API.reset_mutexes diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/channel.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/channel.rb new file mode 100644 index 0000000..5d0ba3f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/channel.rb @@ -0,0 +1,428 @@ +# frozen_string_literal: true + +# API calls for Channel +module Discordrb::API::Channel + module_function + + # Get a channel's data + # https://discord.com/developers/docs/resources/channel#get-channel + def resolve(token, channel_id) + Discordrb::API.request( + :channels_cid, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}", + Authorization: token + ) + end + + # Update a channel's data + # https://discord.com/developers/docs/resources/channel#modify-channel + def update(token, channel_id, name, topic, position, bitrate, user_limit, nsfw, permission_overwrites = nil, parent_id = nil, rate_limit_per_user = nil, reason = nil) + data = { name: name, position: position, topic: topic, bitrate: bitrate, user_limit: user_limit, nsfw: nsfw, parent_id: parent_id, rate_limit_per_user: rate_limit_per_user } + data[:permission_overwrites] = permission_overwrites unless permission_overwrites.nil? + Discordrb::API.request( + :channels_cid, + channel_id, + :patch, + "#{Discordrb::API.api_base}/channels/#{channel_id}", + data.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Delete a channel + # https://discord.com/developers/docs/resources/channel#deleteclose-channel + def delete(token, channel_id, reason = nil) + Discordrb::API.request( + :channels_cid, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Get a list of messages from a channel's history + # https://discord.com/developers/docs/resources/channel#get-channel-messages + def messages(token, channel_id, amount, before = nil, after = nil, around = nil) + Discordrb::API.request( + :channels_cid_messages, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages?limit=#{amount}#{"&before=#{before}" if before}#{"&after=#{after}" if after}#{"&around=#{around}" if around}", + Authorization: token + ) + end + + # Get a single message from a channel's history by id + # https://discord.com/developers/docs/resources/channel#get-channel-message + def message(token, channel_id, message_id) + Discordrb::API.request( + :channels_cid_messages_mid, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}", + Authorization: token + ) + end + + # Send a message to a channel + # https://discordapp.com/developers/docs/resources/channel#create-message + # @param attachments [Array, nil] Attachments to use with `attachment://` in embeds. See + # https://discord.com/developers/docs/resources/channel#create-message-using-attachments-within-embeds + def create_message(token, channel_id, message, tts = false, embed = nil, nonce = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + body = { content: message, tts: tts, embed: embed, nonce: nonce, allowed_mentions: allowed_mentions, message_reference: message_reference } + body = if attachments + files = [*0...attachments.size].zip(attachments).to_h + { **files, payload_json: body.to_json } + else + body.to_json + end + + headers = { Authorization: token } + headers[:content_type] = :json unless attachments + + Discordrb::API.request( + :channels_cid_messages_mid, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages", + body, + **headers + ) + rescue RestClient::BadRequest => e + parsed = JSON.parse(e.response.body) + raise Discordrb::Errors::MessageTooLong, "Message over the character limit (#{message.length} > 2000)" if parsed['content'].is_a?(Array) && parsed['content'].first == 'Must be 2000 or fewer in length.' + + raise + end + + # Send a file as a message to a channel + # https://discord.com/developers/docs/resources/channel#upload-file + def upload_file(token, channel_id, file, caption: nil, tts: false) + Discordrb::API.request( + :channels_cid_messages_mid, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages", + { file: file, content: caption, tts: tts }, + Authorization: token + ) + end + + # Edit a message + # https://discord.com/developers/docs/resources/channel#edit-message + def edit_message(token, channel_id, message_id, message, mentions = [], embed = nil) + Discordrb::API.request( + :channels_cid_messages_mid, + channel_id, + :patch, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}", + { content: message, mentions: mentions, embed: embed }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Delete a message + # https://discordapp.com/developers/docs/resources/channel#delete-message + def delete_message(token, channel_id, message_id, reason = nil) + Discordrb::API.request( + :channels_cid_messages_mid, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Delete messages in bulk + # https://discordapp.com/developers/docs/resources/channel#bulk-delete-messages + def bulk_delete_messages(token, channel_id, messages = [], reason = nil) + Discordrb::API.request( + :channels_cid_messages_bulk_delete, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/bulk-delete", + { messages: messages }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Create a reaction on a message using this client + # https://discord.com/developers/docs/resources/channel#create-reaction + def create_reaction(token, channel_id, message_id, emoji) + emoji = URI.encode_www_form_component(emoji) unless emoji.ascii_only? + Discordrb::API.request( + :channels_cid_messages_mid_reactions_emoji_me, + channel_id, + :put, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me", + nil, + Authorization: token, + content_type: :json + ) + end + + # Delete this client's own reaction on a message + # https://discord.com/developers/docs/resources/channel#delete-own-reaction + def delete_own_reaction(token, channel_id, message_id, emoji) + emoji = URI.encode_www_form_component(emoji) unless emoji.ascii_only? + Discordrb::API.request( + :channels_cid_messages_mid_reactions_emoji_me, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me", + Authorization: token + ) + end + + # Delete another client's reaction on a message + # https://discord.com/developers/docs/resources/channel#delete-user-reaction + def delete_user_reaction(token, channel_id, message_id, emoji, user_id) + emoji = URI.encode_www_form_component(emoji) unless emoji.ascii_only? + Discordrb::API.request( + :channels_cid_messages_mid_reactions_emoji_uid, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/#{user_id}", + Authorization: token + ) + end + + # Get a list of clients who reacted with a specific reaction on a message + # https://discord.com/developers/docs/resources/channel#get-reactions + def get_reactions(token, channel_id, message_id, emoji, before_id, after_id, limit = 100) + emoji = URI.encode_www_form_component(emoji) unless emoji.ascii_only? + query_string = "limit=#{limit}#{"&before=#{before_id}" if before_id}#{"&after=#{after_id}" if after_id}" + Discordrb::API.request( + :channels_cid_messages_mid_reactions_emoji, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}?#{query_string}", + Authorization: token + ) + end + + # Deletes all reactions on a message from all clients + # https://discord.com/developers/docs/resources/channel#delete-all-reactions + def delete_all_reactions(token, channel_id, message_id) + Discordrb::API.request( + :channels_cid_messages_mid_reactions, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions", + Authorization: token + ) + end + + # Update a channels permission for a role or member + # https://discord.com/developers/docs/resources/channel#edit-channel-permissions + def update_permission(token, channel_id, overwrite_id, allow, deny, type, reason = nil) + Discordrb::API.request( + :channels_cid_permissions_oid, + channel_id, + :put, + "#{Discordrb::API.api_base}/channels/#{channel_id}/permissions/#{overwrite_id}", + { type: type, id: overwrite_id, allow: allow, deny: deny }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Get a channel's invite list + # https://discord.com/developers/docs/resources/channel#get-channel-invites + def invites(token, channel_id) + Discordrb::API.request( + :channels_cid_invites, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/invites", + Authorization: token + ) + end + + # Create an instant invite from a server or a channel id + # https://discord.com/developers/docs/resources/channel#create-channel-invite + def create_invite(token, channel_id, max_age = 0, max_uses = 0, temporary = false, unique = false, reason = nil) + Discordrb::API.request( + :channels_cid_invites, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/invites", + { max_age: max_age, max_uses: max_uses, temporary: temporary, unique: unique }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Delete channel permission + # https://discord.com/developers/docs/resources/channel#delete-channel-permission + def delete_permission(token, channel_id, overwrite_id, reason = nil) + Discordrb::API.request( + :channels_cid_permissions_oid, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/permissions/#{overwrite_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Start typing (needs to be resent every 5 seconds to keep up the typing) + # https://discord.com/developers/docs/resources/channel#trigger-typing-indicator + def start_typing(token, channel_id) + Discordrb::API.request( + :channels_cid_typing, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/typing", + nil, + Authorization: token + ) + end + + # Get a list of pinned messages in a channel + # https://discord.com/developers/docs/resources/channel#get-pinned-messages + def pinned_messages(token, channel_id) + Discordrb::API.request( + :channels_cid_pins, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/pins", + Authorization: token + ) + end + + # Pin a message + # https://discordapp.com/developers/docs/resources/channel#add-pinned-channel-message + def pin_message(token, channel_id, message_id, reason = nil) + Discordrb::API.request( + :channels_cid_pins_mid, + channel_id, + :put, + "#{Discordrb::API.api_base}/channels/#{channel_id}/pins/#{message_id}", + nil, + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Unpin a message + # https://discordapp.com/developers/docs/resources/channel#delete-pinned-channel-message + def unpin_message(token, channel_id, message_id, reason = nil) + Discordrb::API.request( + :channels_cid_pins_mid, + channel_id, + :delete, + "#{Discordrb::API.api_base}/channels/#{channel_id}/pins/#{message_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Create an empty group channel. + def create_empty_group(token, bot_user_id) + Discordrb::API.request( + :users_uid_channels, + nil, + :post, + "#{Discordrb::API.api_base}/users/#{bot_user_id}/channels", + {}.to_json, + Authorization: token, + content_type: :json + ) + end + + # Create a group channel. + def create_group(token, pm_channel_id, user_id) + Discordrb::API.request( + :channels_cid_recipients_uid, + nil, + :put, + "#{Discordrb::API.api_base}/channels/#{pm_channel_id}/recipients/#{user_id}", + {}.to_json, + Authorization: token, + content_type: :json + ) + rescue RestClient::InternalServerError + raise 'Attempted to add self as a new group channel recipient!' + rescue RestClient::NoContent + raise 'Attempted to create a group channel with the PM channel recipient!' + rescue RestClient::Forbidden + raise 'Attempted to add a user to group channel without permission!' + end + + # Add a user to a group channel. + def add_group_user(token, group_channel_id, user_id) + Discordrb::API.request( + :channels_cid_recipients_uid, + nil, + :put, + "#{Discordrb::API.api_base}/channels/#{group_channel_id}/recipients/#{user_id}", + {}.to_json, + Authorization: token, + content_type: :json + ) + end + + # Remove a user from a group channel. + def remove_group_user(token, group_channel_id, user_id) + Discordrb::API.request( + :channels_cid_recipients_uid, + nil, + :delete, + "#{Discordrb::API.api_base}/channels/#{group_channel_id}/recipients/#{user_id}", + Authorization: token, + content_type: :json + ) + end + + # Leave a group channel. + def leave_group(token, group_channel_id) + Discordrb::API.request( + :channels_cid, + nil, + :delete, + "#{Discordrb::API.api_base}/channels/#{group_channel_id}", + Authorization: token, + content_type: :json + ) + end + + # Create a webhook + # https://discord.com/developers/docs/resources/webhook#create-webhook + def create_webhook(token, channel_id, name, avatar = nil, reason = nil) + Discordrb::API.request( + :channels_cid_webhooks, + channel_id, + :post, + "#{Discordrb::API.api_base}/channels/#{channel_id}/webhooks", + { name: name, avatar: avatar }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Get channel webhooks + # https://discord.com/developers/docs/resources/webhook#get-channel-webhooks + def webhooks(token, channel_id) + Discordrb::API.request( + :channels_cid_webhooks, + channel_id, + :get, + "#{Discordrb::API.api_base}/channels/#{channel_id}/webhooks", + Authorization: token + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/invite.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/invite.rb new file mode 100644 index 0000000..92a4968 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/invite.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# API calls for Invite object +module Discordrb::API::Invite + module_function + + # Resolve an invite + # https://discord.com/developers/docs/resources/invite#get-invite + def resolve(token, invite_code, counts = true) + Discordrb::API.request( + :invite_code, + nil, + :get, + "#{Discordrb::API.api_base}/invite/#{invite_code}#{counts ? '?with_counts=true' : ''}", + Authorization: token + ) + end + + # Delete an invite by code + # https://discord.com/developers/docs/resources/invite#delete-invite + def delete(token, code, reason = nil) + Discordrb::API.request( + :invites_code, + nil, + :delete, + "#{Discordrb::API.api_base}/invites/#{code}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Join a server using an invite + # https://discord.com/developers/docs/resources/invite#accept-invite + def accept(token, invite_code) + Discordrb::API.request( + :invite_code, + nil, + :post, + "#{Discordrb::API.api_base}/invite/#{invite_code}", + nil, + Authorization: token + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/server.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/server.rb new file mode 100644 index 0000000..a660a63 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/server.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true + +# API calls for Server +module Discordrb::API::Server + module_function + + # Create a server + # https://discord.com/developers/docs/resources/guild#create-guild + def create(token, name, region = :'eu-central') + Discordrb::API.request( + :guilds, + nil, + :post, + "#{Discordrb::API.api_base}/guilds", + { name: name, region: region.to_s }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get a server's data + # https://discord.com/developers/docs/resources/guild#get-guild + def resolve(token, server_id, with_counts = nil) + Discordrb::API.request( + :guilds_sid, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}#{'?with_counts=true' if with_counts}", + Authorization: token + ) + end + + # Update a server + # https://discord.com/developers/docs/resources/guild#modify-guild + def update(token, server_id, name, region, icon, afk_channel_id, afk_timeout, splash, default_message_notifications, verification_level, explicit_content_filter, system_channel_id, reason = nil) + Discordrb::API.request( + :guilds_sid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}", + { name: name, region: region, icon: icon, afk_channel_id: afk_channel_id, afk_timeout: afk_timeout, splash: splash, default_message_notifications: default_message_notifications, verification_level: verification_level, explicit_content_filter: explicit_content_filter, system_channel_id: system_channel_id }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Transfer server ownership + def transfer_ownership(token, server_id, user_id, reason = nil) + Discordrb::API.request( + :guilds_sid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}", + { owner_id: user_id }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Delete a server + # https://discord.com/developers/docs/resources/guild#delete-guild + def delete(token, server_id) + Discordrb::API.request( + :guilds_sid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}", + Authorization: token + ) + end + + # Get a server's channels list + # https://discord.com/developers/docs/resources/guild#get-guild-channels + def channels(token, server_id) + Discordrb::API.request( + :guilds_sid_channels, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/channels", + Authorization: token + ) + end + + # Create a channel + # https://discord.com/developers/docs/resources/guild#create-guild-channel + def create_channel(token, server_id, name, type, topic, bitrate, user_limit, permission_overwrites, parent_id, nsfw, rate_limit_per_user, position, reason = nil) + Discordrb::API.request( + :guilds_sid_channels, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/channels", + { name: name, type: type, topic: topic, bitrate: bitrate, user_limit: user_limit, permission_overwrites: permission_overwrites, parent_id: parent_id, nsfw: nsfw, rate_limit_per_user: rate_limit_per_user, position: position }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Update a channels position + # https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions + def update_channel_positions(token, server_id, positions) + Discordrb::API.request( + :guilds_sid_channels, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/channels", + positions.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get a member's data + # https://discord.com/developers/docs/resources/guild#get-guild-member + def resolve_member(token, server_id, user_id) + Discordrb::API.request( + :guilds_sid_members_uid, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}", + Authorization: token + ) + end + + # Gets members from the server + # https://discord.com/developers/docs/resources/guild#list-guild-members + def resolve_members(token, server_id, limit, after = nil) + Discordrb::API.request( + :guilds_sid_members, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members?limit=#{limit}#{"&after=#{after}" if after}", + Authorization: token + ) + end + + # Update a user properties + # https://discord.com/developers/docs/resources/guild#modify-guild-member + def update_member(token, server_id, user_id, nick: nil, roles: nil, mute: nil, deaf: nil, channel_id: nil, reason: nil) + Discordrb::API.request( + :guilds_sid_members_uid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}", { + roles: roles, + nick: nick, + mute: mute, + deaf: deaf, + channel_id: channel_id + }.compact.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Remove user from server + # https://discord.com/developers/docs/resources/guild#remove-guild-member + def remove_member(token, server_id, user_id, reason = nil) + Discordrb::API.request( + :guilds_sid_members_uid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}", + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Get a server's banned users + # https://discord.com/developers/docs/resources/guild#get-guild-bans + def bans(token, server_id) + Discordrb::API.request( + :guilds_sid_bans, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/bans", + Authorization: token + ) + end + + # Ban a user from a server and delete their messages from the last message_days days + # https://discord.com/developers/docs/resources/guild#create-guild-ban + def ban_user(token, server_id, user_id, message_days, reason = nil) + reason = URI.encode_www_form_component(reason) if reason + Discordrb::API.request( + :guilds_sid_bans_uid, + server_id, + :put, + "#{Discordrb::API.api_base}/guilds/#{server_id}/bans/#{user_id}?delete-message-days=#{message_days}&reason=#{reason}", + nil, + Authorization: token + ) + end + + # Unban a user from a server + # https://discord.com/developers/docs/resources/guild#remove-guild-ban + def unban_user(token, server_id, user_id, reason = nil) + Discordrb::API.request( + :guilds_sid_bans_uid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/bans/#{user_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Get server roles + # https://discord.com/developers/docs/resources/guild#get-guild-roles + def roles(token, server_id) + Discordrb::API.request( + :guilds_sid_roles, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/roles", + Authorization: token + ) + end + + # Create a role (parameters such as name and colour if not set can be set by update_role afterwards) + # Permissions are the Discord defaults; allowed: invite creation, reading/sending messages, + # sending TTS messages, embedding links, sending files, reading the history, mentioning everybody, + # connecting to voice, speaking and voice activity (push-to-talk isn't mandatory) + # https://discord.com/developers/docs/resources/guild#get-guild-roles + def create_role(token, server_id, name, colour, hoist, mentionable, packed_permissions, reason = nil) + Discordrb::API.request( + :guilds_sid_roles, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/roles", + { color: colour, name: name, hoist: hoist, mentionable: mentionable, permissions: packed_permissions }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Update a role + # Permissions are the Discord defaults; allowed: invite creation, reading/sending messages, + # sending TTS messages, embedding links, sending files, reading the history, mentioning everybody, + # connecting to voice, speaking and voice activity (push-to-talk isn't mandatory) + # https://discord.com/developers/docs/resources/guild#batch-modify-guild-role + def update_role(token, server_id, role_id, name, colour, hoist = false, mentionable = false, packed_permissions = 104_324_161, reason = nil) + Discordrb::API.request( + :guilds_sid_roles_rid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/roles/#{role_id}", + { color: colour, name: name, hoist: hoist, mentionable: mentionable, permissions: packed_permissions }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Update role positions + # https://discord.com/developers/docs/resources/guild#modify-guild-role-positions + def update_role_positions(token, server_id, roles) + Discordrb::API.request( + :guilds_sid_roles, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/roles", + roles.to_json, + Authorization: token, + content_type: :json + ) + end + + # Delete a role + # https://discord.com/developers/docs/resources/guild#delete-guild-role + def delete_role(token, server_id, role_id, reason = nil) + Discordrb::API.request( + :guilds_sid_roles_rid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/roles/#{role_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Adds a single role to a member + # https://discord.com/developers/docs/resources/guild#add-guild-member-role + def add_member_role(token, server_id, user_id, role_id, reason = nil) + Discordrb::API.request( + :guilds_sid_members_uid_roles_rid, + server_id, + :put, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}/roles/#{role_id}", + nil, + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Removes a single role from a member + # https://discord.com/developers/docs/resources/guild#remove-guild-member-role + def remove_member_role(token, server_id, user_id, role_id, reason = nil) + Discordrb::API.request( + :guilds_sid_members_uid_roles_rid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}/roles/#{role_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Get server prune count + # https://discord.com/developers/docs/resources/guild#get-guild-prune-count + def prune_count(token, server_id, days) + Discordrb::API.request( + :guilds_sid_prune, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/prune?days=#{days}", + Authorization: token + ) + end + + # Begin server prune + # https://discord.com/developers/docs/resources/guild#begin-guild-prune + def begin_prune(token, server_id, days, reason = nil) + Discordrb::API.request( + :guilds_sid_prune, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/prune", + { days: days }, + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Get invites from server + # https://discord.com/developers/docs/resources/guild#get-guild-invites + def invites(token, server_id) + Discordrb::API.request( + :guilds_sid_invites, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/invites", + Authorization: token + ) + end + + # Gets a server's audit logs + # https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log + def audit_logs(token, server_id, limit, user_id = nil, action_type = nil, before = nil) + Discordrb::API.request( + :guilds_sid_auditlogs, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/audit-logs?limit=#{limit}#{"&user_id=#{user_id}" if user_id}#{"&action_type=#{action_type}" if action_type}#{"&before=#{before}" if before}", + Authorization: token + ) + end + + # Get server integrations + # https://discord.com/developers/docs/resources/guild#get-guild-integrations + def integrations(token, server_id) + Discordrb::API.request( + :guilds_sid_integrations, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/integrations", + Authorization: token + ) + end + + # Create a server integration + # https://discordapp.com/developers/docs/resources/guild#create-guild-integration + def create_integration(token, server_id, type, id, reason = nil) + Discordrb::API.request( + :guilds_sid_integrations, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/integrations", + { type: type, id: id }, + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Update integration from server + # https://discord.com/developers/docs/resources/guild#modify-guild-integration + def update_integration(token, server_id, integration_id, expire_behavior, expire_grace_period, enable_emoticons) + Discordrb::API.request( + :guilds_sid_integrations_iid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/integrations/#{integration_id}", + { expire_behavior: expire_behavior, expire_grace_period: expire_grace_period, enable_emoticons: enable_emoticons }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Delete a server integration + # https://discordapp.com/developers/docs/resources/guild#delete-guild-integration + def delete_integration(token, server_id, integration_id, reason = nil) + Discordrb::API.request( + :guilds_sid_integrations_iid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/integrations/#{integration_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Sync an integration + # https://discord.com/developers/docs/resources/guild#sync-guild-integration + def sync_integration(token, server_id, integration_id) + Discordrb::API.request( + :guilds_sid_integrations_iid_sync, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/integrations/#{integration_id}/sync", + nil, + Authorization: token + ) + end + + # Retrieves a server's embed information + # https://discord.com/developers/docs/resources/guild#get-guild-embed + def embed(token, server_id) + Discordrb::API.request( + :guilds_sid_embed, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/embed", + Authorization: token + ) + end + + # Modify a server's embed settings + # https://discord.com/developers/docs/resources/guild#modify-guild-embed + def modify_embed(token, server_id, enabled, channel_id, reason = nil) + Discordrb::API.request( + :guilds_sid_embed, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/embed", + { enabled: enabled, channel_id: channel_id }.to_json, + Authorization: token, + 'X-Audit-Log-Reason': reason, + content_type: :json + ) + end + + # Adds a custom emoji. + # https://discord.com/developers/docs/resources/emoji#create-guild-emoji + def add_emoji(token, server_id, image, name, roles = [], reason = nil) + Discordrb::API.request( + :guilds_sid_emojis, + server_id, + :post, + "#{Discordrb::API.api_base}/guilds/#{server_id}/emojis", + { image: image, name: name, roles: roles }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Changes an emoji name and/or roles. + # https://discord.com/developers/docs/resources/emoji#modify-guild-emoji + def edit_emoji(token, server_id, emoji_id, name, roles = nil, reason = nil) + Discordrb::API.request( + :guilds_sid_emojis_eid, + server_id, + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/emojis/#{emoji_id}", + { name: name, roles: roles }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Deletes a custom emoji + # https://discord.com/developers/docs/resources/emoji#delete-guild-emoji + def delete_emoji(token, server_id, emoji_id, reason = nil) + Discordrb::API.request( + :guilds_sid_emojis_eid, + server_id, + :delete, + "#{Discordrb::API.api_base}/guilds/#{server_id}/emojis/#{emoji_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Available voice regions for this server + def regions(token, server_id) + Discordrb::API.request( + :guilds_sid_regions, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/regions", + Authorization: token + ) + end + + # Get server webhooks + # https://discord.com/developers/docs/resources/webhook#get-guild-webhooks + def webhooks(token, server_id) + Discordrb::API.request( + :guilds_sid_webhooks, + server_id, + :get, + "#{Discordrb::API.api_base}/guilds/#{server_id}/webhooks", + Authorization: token + ) + end + + # Adds a member to a server with an OAuth2 Bearer token that has been granted `guilds.join` + # https://discord.com/developers/docs/resources/guild#add-guild-member + def add_member(token, server_id, user_id, access_token, nick = nil, roles = [], mute = false, deaf = false) + Discordrb::API.request( + :guilds_sid_members_uid, + server_id, + :put, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/#{user_id}", + { access_token: access_token, nick: nick, roles: roles, mute: mute, deaf: deaf }.to_json, + content_type: :json, + Authorization: token + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/user.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/user.rb new file mode 100644 index 0000000..137b46d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/user.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# API calls for User object +module Discordrb::API::User + module_function + + # Get user data + # https://discord.com/developers/docs/resources/user#get-user + def resolve(token, user_id) + Discordrb::API.request( + :users_uid, + nil, + :get, + "#{Discordrb::API.api_base}/users/#{user_id}", + Authorization: token + ) + end + + # Get profile data + # https://discord.com/developers/docs/resources/user#get-current-user + def profile(token) + Discordrb::API.request( + :users_me, + nil, + :get, + "#{Discordrb::API.api_base}/users/@me", + Authorization: token + ) + end + + # Change the current bot's nickname on a server + def change_own_nickname(token, server_id, nick, reason = nil) + Discordrb::API.request( + :guilds_sid_members_me_nick, + server_id, # This is technically a guild endpoint + :patch, + "#{Discordrb::API.api_base}/guilds/#{server_id}/members/@me/nick", + { nick: nick }.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Update user data + # https://discord.com/developers/docs/resources/user#modify-current-user + def update_profile(token, email, password, new_username, avatar, new_password = nil) + Discordrb::API.request( + :users_me, + nil, + :patch, + "#{Discordrb::API.api_base}/users/@me", + { avatar: avatar, email: email, new_password: new_password, password: password, username: new_username }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get the servers a user is connected to + # https://discord.com/developers/docs/resources/user#get-current-user-guilds + def servers(token) + Discordrb::API.request( + :users_me_guilds, + nil, + :get, + "#{Discordrb::API.api_base}/users/@me/guilds", + Authorization: token + ) + end + + # Leave a server + # https://discord.com/developers/docs/resources/user#leave-guild + def leave_server(token, server_id) + Discordrb::API.request( + :users_me_guilds_sid, + nil, + :delete, + "#{Discordrb::API.api_base}/users/@me/guilds/#{server_id}", + Authorization: token + ) + end + + # Get the DMs for the current user + # https://discord.com/developers/docs/resources/user#get-user-dms + def user_dms(token) + Discordrb::API.request( + :users_me_channels, + nil, + :get, + "#{Discordrb::API.api_base}/users/@me/channels", + Authorization: token + ) + end + + # Create a DM to another user + # https://discord.com/developers/docs/resources/user#create-dm + def create_pm(token, recipient_id) + Discordrb::API.request( + :users_me_channels, + nil, + :post, + "#{Discordrb::API.api_base}/users/@me/channels", + { recipient_id: recipient_id }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Get information about a user's connections + # https://discord.com/developers/docs/resources/user#get-users-connections + def connections(token) + Discordrb::API.request( + :users_me_connections, + nil, + :get, + "#{Discordrb::API.api_base}/users/@me/connections", + Authorization: token + ) + end + + # Change user status setting + def change_status_setting(token, status) + Discordrb::API.request( + :users_me_settings, + nil, + :patch, + "#{Discordrb::API.api_base}/users/@me/settings", + { status: status }.to_json, + Authorization: token, + content_type: :json + ) + end + + # Returns one of the "default" discord avatars from the CDN given a discriminator + def default_avatar(discrim = 0) + index = discrim.to_i % 5 + "#{Discordrb::API.cdn_url}/embed/avatars/#{index}.png" + end + + # Make an avatar URL from the user and avatar IDs + def avatar_url(user_id, avatar_id, format = nil) + format ||= if avatar_id.start_with?('a_') + 'gif' + else + 'webp' + end + "#{Discordrb::API.cdn_url}/avatars/#{user_id}/#{avatar_id}.#{format}" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/webhook.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/webhook.rb new file mode 100644 index 0000000..c79a70a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/api/webhook.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# API calls for Webhook object +module Discordrb::API::Webhook + module_function + + # Get a webhook + # https://discord.com/developers/docs/resources/webhook#get-webhook + def webhook(token, webhook_id) + Discordrb::API.request( + :webhooks_wid, + nil, + :get, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}", + Authorization: token + ) + end + + # Get a webhook via webhook token + # https://discord.com/developers/docs/resources/webhook#get-webhook-with-token + def token_webhook(webhook_token, webhook_id) + Discordrb::API.request( + :webhooks_wid, + nil, + :get, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}/#{webhook_token}" + ) + end + + # Update a webhook + # https://discord.com/developers/docs/resources/webhook#modify-webhook + def update_webhook(token, webhook_id, data, reason = nil) + Discordrb::API.request( + :webhooks_wid, + webhook_id, + :patch, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}", + data.to_json, + Authorization: token, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Update a webhook via webhook token + # https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token + def token_update_webhook(webhook_token, webhook_id, data, reason = nil) + Discordrb::API.request( + :webhooks_wid, + webhook_id, + :patch, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}/#{webhook_token}", + data.to_json, + content_type: :json, + 'X-Audit-Log-Reason': reason + ) + end + + # Deletes a webhook + # https://discord.com/developers/docs/resources/webhook#delete-webhook + def delete_webhook(token, webhook_id, reason = nil) + Discordrb::API.request( + :webhooks_wid, + webhook_id, + :delete, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}", + Authorization: token, + 'X-Audit-Log-Reason': reason + ) + end + + # Deletes a webhook via webhook token + # https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token + def token_delete_webhook(webhook_token, webhook_id, reason = nil) + Discordrb::API.request( + :webhooks_wid, + webhook_id, + :delete, + "#{Discordrb::API.api_base}/webhooks/#{webhook_id}/#{webhook_token}", + 'X-Audit-Log-Reason': reason + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/await.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/await.rb new file mode 100644 index 0000000..edb576f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/await.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Discordrb + # Awaits are a way to register new, temporary event handlers on the fly. Awaits can be + # registered using {Bot#add_await}, {User#await}, {Message#await} and {Channel#await}. + # + # Awaits contain a block that will be called before the await event will be triggered. + # If this block returns anything that is not `false` exactly, the await will be deleted. + # If no block is present, the await will also be deleted. This is an easy way to make + # temporary events that are only temporary under certain conditions. + # + # Besides the given block, an {Discordrb::Events::AwaitEvent} will also be executed with the key and + # the type of the await that was triggered. It's possible to register multiple events + # that trigger on the same await. + class Await + # The key that uniquely identifies this await. + # @return [Symbol] The unique key. + attr_reader :key + + # The class of the event that this await listens for. + # @return [Class] The event class. + attr_reader :type + + # The attributes of the event that will be listened for. + # @return [Hash] A hash of attributes. + attr_reader :attributes + + # Makes a new await. For internal use only. + # @!visibility private + def initialize(bot, key, type, attributes, block = nil) + @bot = bot + @key = key + @type = type + @attributes = attributes + @block = block + end + + # Checks whether the await can be triggered by the given event, and if it can, execute the block + # and return its result along with this await's key. + # @param event [Event] An event to check for. + # @return [Array] This await's key and whether or not it should be deleted. If there was no match, both are nil. + def match(event) + dummy_handler = EventContainer.handler_class(@type).new(@attributes, @bot) + return [nil, nil] unless event.instance_of?(@type) && dummy_handler.matches?(event) + + should_delete = true if (@block && @block.call(event) != false) || !@block + + [@key, should_delete] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/bot.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/bot.rb new file mode 100644 index 0000000..b528897 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/bot.rb @@ -0,0 +1,1431 @@ +# frozen_string_literal: true + +require 'rest-client' +require 'zlib' +require 'set' + +require 'discordrb/events/message' +require 'discordrb/events/typing' +require 'discordrb/events/lifetime' +require 'discordrb/events/presence' +require 'discordrb/events/voice_state_update' +require 'discordrb/events/channels' +require 'discordrb/events/members' +require 'discordrb/events/roles' +require 'discordrb/events/guilds' +require 'discordrb/events/await' +require 'discordrb/events/bans' +require 'discordrb/events/raw' +require 'discordrb/events/reactions' +require 'discordrb/events/webhooks' +require 'discordrb/events/invites' + +require 'discordrb/api' +require 'discordrb/api/channel' +require 'discordrb/api/server' +require 'discordrb/api/invite' +require 'discordrb/errors' +require 'discordrb/data' +require 'discordrb/await' +require 'discordrb/container' +require 'discordrb/websocket' +require 'discordrb/cache' +require 'discordrb/gateway' + +require 'discordrb/voice/voice_bot' + +module Discordrb + # Represents a Discord bot, including servers, users, etc. + class Bot + # The list of currently running threads used to parse and call events. + # The threads will have a local variable `:discordrb_name` in the format of `et-1234`, where + # "et" stands for "event thread" and the number is a continually incrementing number representing + # how many events were executed before. + # @return [Array] The threads. + attr_reader :event_threads + + # @return [true, false] whether or not the bot should parse its own messages. Off by default. + attr_accessor :should_parse_self + + # The bot's name which discordrb sends to Discord when making any request, so Discord can identify bots with the + # same codebase. Not required but I recommend setting it anyway. + # @return [String] The bot's name. + attr_accessor :name + + # @return [Array(Integer, Integer)] the current shard key + attr_reader :shard_key + + # @return [Hash Await>] the list of registered {Await}s. + attr_reader :awaits + + # The gateway connection is an internal detail that is useless to most people. It is however essential while + # debugging or developing discordrb itself, or while writing very custom bots. + # @return [Gateway] the underlying {Gateway} object. + attr_reader :gateway + + include EventContainer + include Cache + + # Makes a new bot with the given authentication data. It will be ready to be added event handlers to and can + # eventually be run with {#run}. + # + # As support for logging in using username and password has been removed in version 3.0.0, only a token login is + # possible. Be sure to specify the `type` parameter as `:user` if you're logging in as a user. + # + # Simply creating a bot won't be enough to start sending messages etc. with, only a limited set of methods can + # be used after logging in. If you want to do something when the bot has connected successfully, either do it in the + # {#ready} event, or use the {#run} method with the :async parameter and do the processing after that. + # @param log_mode [Symbol] The mode this bot should use for logging. See {Logger#mode=} for a list of modes. + # @param token [String] The token that should be used to log in. If your bot is a bot account, you have to specify + # this. If you're logging in as a user, make sure to also set the account type to :user so discordrb doesn't think + # you're trying to log in as a bot. + # @param client_id [Integer] If you're logging in as a bot, the bot's client ID. This is optional, and may be fetched + # from the API by calling {Bot#bot_application} (see {Application}). + # @param type [Symbol] This parameter lets you manually overwrite the account type. This needs to be set when + # logging in as a user, otherwise discordrb will treat you as a bot account. Valid values are `:user` and `:bot`. + # @param name [String] Your bot's name. This will be sent to Discord with any API requests, who will use this to + # trace the source of excessive API requests; it's recommended to set this to something if you make bots that many + # people will host on their servers separately. + # @param fancy_log [true, false] Whether the output log should be made extra fancy using ANSI escape codes. (Your + # terminal may not support this.) + # @param suppress_ready [true, false] Whether the READY packet should be exempt from being printed to console. + # Useful for very large bots running in debug or verbose log_mode. + # @param parse_self [true, false] Whether the bot should react on its own messages. It's best to turn this off + # unless you really need this so you don't inadvertently create infinite loops. + # @param shard_id [Integer] The number of the shard this bot should handle. See + # https://github.com/discordapp/discord-api-docs/issues/17 for how to do sharding. + # @param num_shards [Integer] The total number of shards that should be running. See + # https://github.com/discordapp/discord-api-docs/issues/17 for how to do sharding. + # @param redact_token [true, false] Whether the bot should redact the token in logs. Default is true. + # @param ignore_bots [true, false] Whether the bot should ignore bot accounts or not. Default is false. + # @param compress_mode [:none, :large, :stream] Sets which compression mode should be used when connecting + # to Discord's gateway. `:none` will request that no payloads are received compressed (not recommended for + # production bots). `:large` will request that large payloads are received compressed. `:stream` will request + # that all data be received in a continuous compressed stream. + # @param intents [:all, Array, nil] Intents that this bot requires. See {Discordrb::INTENTS}. If `nil`, no intents + # field will be passed. + def initialize( + log_mode: :normal, + token: nil, client_id: nil, + type: nil, name: '', fancy_log: false, suppress_ready: false, parse_self: false, + shard_id: nil, num_shards: nil, redact_token: true, ignore_bots: false, + compress_mode: :large, intents: nil + ) + LOGGER.mode = log_mode + LOGGER.token = token if redact_token + + @should_parse_self = parse_self + + @client_id = client_id + + @type = type || :bot + @name = name + + @shard_key = num_shards ? [shard_id, num_shards] : nil + + LOGGER.fancy = fancy_log + @prevent_ready = suppress_ready + + @compress_mode = compress_mode + + raise 'Token string is empty or nil' if token.nil? || token.empty? + + @intents = intents == :all ? INTENTS.values.reduce(&:|) : calculate_intents(intents) if intents + + @token = process_token(@type, token) + @gateway = Gateway.new(self, @token, @shard_key, @compress_mode, @intents) + + init_cache + + @voices = {} + @should_connect_to_voice = {} + + @ignored_ids = Set.new + @ignore_bots = ignore_bots + + @event_threads = [] + @current_thread = 0 + + @status = :online + end + + # The list of users the bot shares a server with. + # @return [Hash User>] The users by ID. + def users + gateway_check + unavailable_servers_check + @users + end + + # The list of servers the bot is currently in. + # @return [Hash Server>] The servers by ID. + def servers + gateway_check + unavailable_servers_check + @servers + end + + # @overload emoji(id) + # Return an emoji by its ID + # @param id [String, Integer] The emoji's ID. + # @return [Emoji, nil] the emoji object. `nil` if the emoji was not found. + # @overload emoji + # The list of emoji the bot can use. + # @return [Array] the emoji available. + def emoji(id = nil) + emoji_hash = servers.values.map(&:emoji).reduce(&:merge) + if id + id = id.resolve_id + emoji_hash[id] + else + emoji_hash.values + end + end + + alias_method :emojis, :emoji + alias_method :all_emoji, :emoji + + # Finds an emoji by its name. + # @param name [String] The emoji name that should be resolved. + # @return [GlobalEmoji, nil] the emoji identified by the name, or `nil` if it couldn't be found. + def find_emoji(name) + LOGGER.out("Resolving emoji #{name}") + emoji.find { |element| element.name == name } + end + + # The bot's user profile. This special user object can be used + # to edit user data like the current username (see {Profile#username=}). + # @return [Profile] The bot's profile that can be used to edit data. + def profile + gateway_check + @profile + end + + alias_method :bot_user, :profile + + # The bot's OAuth application. + # @return [Application, nil] The bot's application info. Returns `nil` if bot is not a bot account. + def bot_application + return unless @type == :bot + + response = API.oauth_application(token) + Application.new(JSON.parse(response), self) + end + + alias_method :bot_app, :bot_application + + # The Discord API token received when logging in. Useful to explicitly call + # {API} methods. + # @return [String] The API token. + def token + API.bot_name = @name + @token + end + + # @return [String] the raw token, without any prefix + # @see #token + def raw_token + @token.split(' ').last + end + + # Runs the bot, which logs into Discord and connects the WebSocket. This + # prevents all further execution unless it is executed with + # `background` = `true`. + # @param background [true, false] If it is `true`, then the bot will run in + # another thread to allow further execution. If it is `false`, this method + # will block until {#stop} is called. If the bot is run with `true`, make + # sure to eventually call {#join} so the script doesn't stop prematurely. + # @note Running the bot in the background means that you can call some + # methods that require a gateway connection *before* that connection is + # established. In most cases an exception will be raised if you try to do + # this. If you need a way to safely run code after the bot is fully + # connected, use a {#ready} event handler instead. + def run(background = false) + @gateway.run_async + return if background + + debug('Oh wait! Not exiting yet as run was run synchronously.') + @gateway.sync + end + + # Joins the bot's connection thread with the current thread. + # This blocks execution until the websocket stops, which should only happen + # manually triggered. or due to an error. This is necessary to have a + # continuously running bot. + def join + @gateway.sync + end + alias_method :sync, :join + + # Stops the bot gracefully, disconnecting the websocket without immediately killing the thread. This means that + # Discord is immediately aware of the closed connection and makes the bot appear offline instantly. + # @note This method no longer takes an argument as of 3.4.0 + def stop(_no_sync = nil) + @gateway.stop + end + + # @return [true, false] whether or not the bot is currently connected to Discord. + def connected? + @gateway.open? + end + + # Makes the bot join an invite to a server. + # @param invite [String, Invite] The invite to join. For possible formats see {#resolve_invite_code}. + def accept_invite(invite) + resolved = invite(invite).code + API::Invite.accept(token, resolved) + end + + # Creates an OAuth invite URL that can be used to invite this bot to a particular server. + # @param server [Server, nil] The server the bot should be invited to, or nil if a general invite should be created. + # @param permission_bits [String, Integer] Permission bits that should be appended to invite url. + # @return [String] the OAuth invite URL. + def invite_url(server: nil, permission_bits: nil) + @client_id ||= bot_application.id + + server_id_str = server ? "&guild_id=#{server.id}" : '' + permission_bits_str = permission_bits ? "&permissions=#{permission_bits}" : '' + "https://discord.com/oauth2/authorize?&client_id=#{@client_id}#{server_id_str}#{permission_bits_str}&scope=bot" + end + + # @return [Hash VoiceBot>] the voice connections this bot currently has, by the server ID to which they are connected. + attr_reader :voices + + # Gets the voice bot for a particular server or channel. You can connect to a new channel using the {#voice_connect} + # method. + # @param thing [Channel, Server, Integer] the server or channel you want to get the voice bot for, or its ID. + # @return [Voice::VoiceBot, nil] the VoiceBot for the thing you specified, or nil if there is no connection yet + def voice(thing) + id = thing.resolve_id + return @voices[id] if @voices[id] + + channel = channel(id) + return nil unless channel + + server_id = channel.server.id + return @voices[server_id] if @voices[server_id] + end + + # Connects to a voice channel, initializes network connections and returns the {Voice::VoiceBot} over which audio + # data can then be sent. After connecting, the bot can also be accessed using {#voice}. If the bot is already + # connected to voice, the existing connection will be terminated - you don't have to call + # {Discordrb::Voice::VoiceBot#destroy} before calling this method. + # @param chan [Channel, String, Integer] The voice channel, or its ID, to connect to. + # @param encrypted [true, false] Whether voice communication should be encrypted using + # (uses an XSalsa20 stream cipher for encryption and Poly1305 for authentication) + # @return [Voice::VoiceBot] the initialized bot over which audio data can then be sent. + def voice_connect(chan, encrypted = true) + raise ArgumentError, 'Unencrypted voice connections are no longer supported.' unless encrypted + + chan = channel(chan.resolve_id) + server_id = chan.server.id + + if @voices[chan.id] + debug('Voice bot exists already! Destroying it') + @voices[chan.id].destroy + @voices.delete(chan.id) + end + + debug("Got voice channel: #{chan}") + + @should_connect_to_voice[server_id] = chan + @gateway.send_voice_state_update(server_id.to_s, chan.id.to_s, false, false) + + debug('Voice channel init packet sent! Now waiting.') + + sleep(0.05) until @voices[server_id] + debug('Voice connect succeeded!') + @voices[server_id] + end + + # Disconnects the client from a specific voice connection given the server ID. Usually it's more convenient to use + # {Discordrb::Voice::VoiceBot#destroy} rather than this. + # @param server [Server, String, Integer] The server, or server ID, the voice connection is on. + # @param destroy_vws [true, false] Whether or not the VWS should also be destroyed. If you're calling this method + # directly, you should leave it as true. + def voice_destroy(server, destroy_vws = true) + server = server.resolve_id + @gateway.send_voice_state_update(server.to_s, nil, false, false) + @voices[server].destroy if @voices[server] && destroy_vws + @voices.delete(server) + end + + # Revokes an invite to a server. Will fail unless you have the *Manage Server* permission. + # It is recommended that you use {Invite#delete} instead. + # @param code [String, Invite] The invite to revoke. For possible formats see {#resolve_invite_code}. + def delete_invite(code) + invite = resolve_invite_code(code) + API::Invite.delete(token, invite) + end + + # Sends a text message to a channel given its ID and the message's content. + # @param channel [Channel, String, Integer] The channel, or its ID, to send something to. + # @param content [String] The text that should be sent as a message. It is limited to 2000 characters (Discord imposed). + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + # @return [Message] The message that was sent. + def send_message(channel, content, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + channel = channel.resolve_id + debug("Sending message to #{channel} with content '#{content}'") + allowed_mentions = { parse: [] } if allowed_mentions == false + message_reference = { message_id: message_reference.id } if message_reference + + response = API::Channel.create_message(token, channel, content, tts, embed&.to_hash, nil, attachments, allowed_mentions&.to_hash, message_reference) + Message.new(JSON.parse(response), self) + end + + # Sends a text message to a channel given its ID and the message's content, + # then deletes it after the specified timeout in seconds. + # @param channel [Channel, String, Integer] The channel, or its ID, to send something to. + # @param content [String] The text that should be sent as a message. It is limited to 2000 characters (Discord imposed). + # @param timeout [Float] The amount of time in seconds after which the message sent will be deleted. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + def send_temporary_message(channel, content, timeout, tts = false, embed = nil, attachments = nil, allowed_mentions = nil) + Thread.new do + Thread.current[:discordrb_name] = "#{@current_thread}-temp-msg" + + message = send_message(channel, content, tts, embed, attachments, allowed_mentions) + sleep(timeout) + message.delete + end + + nil + end + + # Sends a file to a channel. If it is an image, it will automatically be embedded. + # @note This executes in a blocking way, so if you're sending long files, be wary of delays. + # @param channel [Channel, String, Integer] The channel, or its ID, to send something to. + # @param file [File] The file that should be sent. + # @param caption [string] The caption for the file. + # @param tts [true, false] Whether or not this file's caption should be sent using Discord text-to-speech. + # @param filename [String] Overrides the filename of the uploaded file + # @param spoiler [true, false] Whether or not this file should appear as a spoiler. + # @example Send a file from disk + # bot.send_file(83281822225530880, File.open('rubytaco.png', 'r')) + def send_file(channel, file, caption: nil, tts: false, filename: nil, spoiler: nil) + if file.respond_to?(:read) + if spoiler + filename ||= File.basename(file.path) + filename = "SPOILER_#{filename}" unless filename.start_with? 'SPOILER_' + end + # https://github.com/rest-client/rest-client/blob/v2.0.2/lib/restclient/payload.rb#L160 + file.define_singleton_method(:original_filename) { filename } if filename + end + + channel = channel.resolve_id + response = API::Channel.upload_file(token, channel, file, caption: caption, tts: tts) + Message.new(JSON.parse(response), self) + end + + # Creates a server on Discord with a specified name and a region. + # @note Discord's API doesn't directly return the server when creating it, so this method + # waits until the data has been received via the websocket. This may make the execution take a while. + # @param name [String] The name the new server should have. Doesn't have to be alphanumeric. + # @param region [Symbol] The region where the server should be created, for example 'eu-central' or 'hongkong'. + # @return [Server] The server that was created. + def create_server(name, region = :'eu-central') + response = API::Server.create(token, name, region) + id = JSON.parse(response)['id'].to_i + sleep 0.1 until (server = @servers[id]) + debug "Successfully created server #{server.id} with name #{server.name}" + server + end + + # Creates a new application to do OAuth authorization with. This allows you to use OAuth to authorize users using + # Discord. For information how to use this, see the docs: https://discord.com/developers/docs/topics/oauth2 + # @param name [String] What your application should be called. + # @param redirect_uris [Array] URIs that Discord should redirect your users to after authorizing. + # @return [Array(String, String)] your applications' client ID and client secret to be used in OAuth authorization. + def create_oauth_application(name, redirect_uris) + response = JSON.parse(API.create_oauth_application(@token, name, redirect_uris)) + [response['id'], response['secret']] + end + + # Changes information about your OAuth application + # @param name [String] What your application should be called. + # @param redirect_uris [Array] URIs that Discord should redirect your users to after authorizing. + # @param description [String] A string that describes what your application does. + # @param icon [String, nil] A data URI for your icon image (for example a base 64 encoded image), or nil if no icon + # should be set or changed. + def update_oauth_application(name, redirect_uris, description = '', icon = nil) + API.update_oauth_application(@token, name, redirect_uris, description, icon) + end + + # Gets the users, channels, roles and emoji from a string. + # @param mentions [String] The mentions, which should look like `<@12314873129>`, `<#123456789>`, `<@&123456789>` or `<:name:126328:>`. + # @param server [Server, nil] The server of the associated mentions. (recommended for role parsing, to speed things up) + # @return [Array] The array of users, channels, roles and emoji identified by the mentions, or `nil` if none exists. + def parse_mentions(mentions, server = nil) + array_to_return = [] + # While possible mentions may be in message + while mentions.include?('<') && mentions.include?('>') + # Removing all content before the next possible mention + mentions = mentions.split('<', 2)[1] + # Locate the first valid mention enclosed in `<...>`, otherwise advance to the next open `<` + next unless mentions.split('>', 2).first.length < mentions.split('<', 2).first.length + + # Store the possible mention value to be validated with RegEx + mention = mentions.split('>', 2).first + if /@!?(?\d+)/ =~ mention + array_to_return << user(id) unless user(id).nil? + elsif /#(?\d+)/ =~ mention + array_to_return << channel(id, server) unless channel(id, server).nil? + elsif /@&(?\d+)/ =~ mention + if server + array_to_return << server.role(id) unless server.role(id).nil? + else + @servers.each_value do |element| + array_to_return << element.role(id) unless element.role(id).nil? + end + end + elsif /(?^a|^${0}):(?\w+):(?\d+)/ =~ mention + array_to_return << (emoji(id) || Emoji.new({ 'animated' => !animated.nil?, 'name' => name, 'id' => id }, self, nil)) + end + end + array_to_return + end + + # Gets the user, channel, role or emoji from a string. + # @param mention [String] The mention, which should look like `<@12314873129>`, `<#123456789>`, `<@&123456789>` or `<:name:126328:>`. + # @param server [Server, nil] The server of the associated mention. (recommended for role parsing, to speed things up) + # @return [User, Channel, Role, Emoji] The user, channel, role or emoji identified by the mention, or `nil` if none exists. + def parse_mention(mention, server = nil) + parse_mentions(mention, server).first + end + + # Updates presence status. + # @param status [String] The status the bot should show up as. Can be `online`, `dnd`, `idle`, or `invisible` + # @param activity [String, nil] The name of the activity to be played/watched/listened to/stream name on the stream. + # @param url [String, nil] The Twitch URL to display as a stream. nil for no stream. + # @param since [Integer] When this status was set. + # @param afk [true, false] Whether the bot is AFK. + # @param activity_type [Integer] The type of activity status to display. Can be 0 (Playing), 1 (Streaming), 2 (Listening), 3 (Watching) + # @see Gateway#send_status_update + def update_status(status, activity, url, since = 0, afk = false, activity_type = 0) + gateway_check + + @activity = activity + @status = status + @streamurl = url + type = url ? 1 : activity_type + + activity_obj = activity || url ? { 'name' => activity, 'url' => url, 'type' => type } : nil + @gateway.send_status_update(status, since, activity_obj, afk) + + # Update the status in the cache + profile.update_presence('status' => status.to_s, 'activities' => [activity_obj].compact) + end + + # Sets the currently playing game to the specified game. + # @param name [String] The name of the game to be played. + # @return [String] The game that is being played now. + def game=(name) + gateway_check + update_status(@status, name, nil) + end + + alias_method :playing=, :game= + + # Sets the current listening status to the specified name. + # @param name [String] The thing to be listened to. + # @return [String] The thing that is now being listened to. + def listening=(name) + gateway_check + update_status(@status, name, nil, nil, nil, 2) + end + + # Sets the current watching status to the specified name. + # @param name [String] The thing to be watched. + # @return [String] The thing that is now being watched. + def watching=(name) + gateway_check + update_status(@status, name, nil, nil, nil, 3) + end + + # Sets the currently online stream to the specified name and Twitch URL. + # @param name [String] The name of the stream to display. + # @param url [String] The url of the current Twitch stream. + # @return [String] The stream name that is being displayed now. + def stream(name, url) + gateway_check + update_status(@status, name, url) + name + end + + # Sets status to online. + def online + gateway_check + update_status(:online, @activity, @streamurl) + end + + alias_method :on, :online + + # Sets status to idle. + def idle + gateway_check + update_status(:idle, @activity, nil) + end + + alias_method :away, :idle + + # Sets the bot's status to DnD (red icon). + def dnd + gateway_check + update_status(:dnd, @activity, nil) + end + + # Sets the bot's status to invisible (appears offline). + def invisible + gateway_check + update_status(:invisible, @activity, nil) + end + + # Sets debug mode. If debug mode is on, many things will be outputted to STDOUT. + def debug=(new_debug) + LOGGER.debug = new_debug + end + + # Sets the logging mode + # @see Logger#mode= + def mode=(new_mode) + LOGGER.mode = new_mode + end + + # Prevents the READY packet from being printed regardless of debug mode. + def suppress_ready_debug + @prevent_ready = true + end + + # Add an await the bot should listen to. For information on awaits, see {Await}. + # @param key [Symbol] The key that uniquely identifies the await for {AwaitEvent}s to listen to (see {#await}). + # @param type [Class] The event class that should be listened for. + # @param attributes [Hash] The attributes the event should check for. The block will only be executed if all attributes match. + # @yield Is executed when the await is triggered. + # @yieldparam event [Event] The event object that was triggered. + # @return [Await] The await that was created. + # @deprecated Will be changed to blocking behavior in v4.0. Use {#add_await!} instead. + def add_await(key, type, attributes = {}, &block) + raise "You can't await an AwaitEvent!" if type == Discordrb::Events::AwaitEvent + + await = Await.new(self, key, type, attributes, block) + @awaits ||= {} + @awaits[key] = await + end + + # Awaits an event, blocking the current thread until a response is received. + # @param type [Class] The event class that should be listened for. + # @option attributes [Numeric] :timeout the amount of time (in seconds) to wait for a response before returning `nil`. Waits forever if omitted. + # @yield Executed when a matching event is received. + # @yieldparam event [Event] The event object that was triggered. + # @yieldreturn [true, false] Whether the event matches extra await criteria described by the block + # @return [Event, nil] The event object that was triggered, or `nil` if a `timeout` was set and no event was raised in time. + # @raise [ArgumentError] if `timeout` is given and is not a positive numeric value + def add_await!(type, attributes = {}) + raise "You can't await an AwaitEvent!" if type == Discordrb::Events::AwaitEvent + + timeout = attributes[:timeout] + raise ArgumentError, 'Timeout must be a number > 0' if timeout.is_a?(Numeric) && !timeout.positive? + + mutex = Mutex.new + cv = ConditionVariable.new + response = nil + block = lambda do |event| + mutex.synchronize do + response = event + if block_given? + result = yield(event) + cv.signal if result.is_a?(TrueClass) + else + cv.signal + end + end + end + + handler = register_event(type, attributes, block) + + if timeout + Thread.new do + sleep timeout + mutex.synchronize { cv.signal } + end + end + + mutex.synchronize { cv.wait(mutex) } + + remove_handler(handler) + raise 'ConditionVariable was signaled without returning an event!' if response.nil? && timeout.nil? + + response + end + + # Add a user to the list of ignored users. Those users will be ignored in message events at event processing level. + # @note Ignoring a user only prevents any message events (including mentions, commands etc.) from them! Typing and + # presence and any other events will still be received. + # @param user [User, String, Integer] The user, or its ID, to be ignored. + def ignore_user(user) + @ignored_ids << user.resolve_id + end + + # Remove a user from the ignore list. + # @param user [User, String, Integer] The user, or its ID, to be unignored. + def unignore_user(user) + @ignored_ids.delete(user.resolve_id) + end + + # Checks whether a user is being ignored. + # @param user [User, String, Integer] The user, or its ID, to check. + # @return [true, false] whether or not the user is ignored. + def ignored?(user) + @ignored_ids.include?(user.resolve_id) + end + + # @see Logger#debug + def debug(message) + LOGGER.debug(message) + end + + # @see Logger#log_exception + def log_exception(e) + LOGGER.log_exception(e) + end + + # Dispatches an event to this bot. Called by the gateway connection handler used internally. + def dispatch(type, data) + handle_dispatch(type, data) + end + + # Raises a heartbeat event. Called by the gateway connection handler used internally. + def raise_heartbeat_event + raise_event(HeartbeatEvent.new(self)) + end + + # Makes the bot leave any groups with no recipients remaining + def prune_empty_groups + @channels.each_value do |channel| + channel.leave_group if channel.group? && channel.recipients.empty? + end + end + + private + + # Throws a useful exception if there's currently no gateway connection. + def gateway_check + raise "A gateway connection is necessary to call this method! You'll have to do it inside any event (e.g. `ready`) or after `bot.run :async`." unless connected? + end + + # Logs a warning if there are servers which are still unavailable. + # e.g. due to a Discord outage or because the servers are large and taking a while to load. + def unavailable_servers_check + # Return unless there are servers that are unavailable. + return unless @unavailable_servers&.positive? + + LOGGER.warn("#{@unavailable_servers} servers haven't been cached yet.") + LOGGER.warn('Servers may be unavailable due to an outage, or your bot is on very large servers that are taking a while to load.') + end + + ### ## ## ######## ######## ######## ## ## ### ## ###### + ## ### ## ## ## ## ## ### ## ## ## ## ## ## + ## #### ## ## ## ## ## #### ## ## ## ## ## + ## ## ## ## ## ###### ######## ## ## ## ## ## ## ###### + ## ## #### ## ## ## ## ## #### ######### ## ## + ## ## ### ## ## ## ## ## ### ## ## ## ## ## + ### ## ## ## ######## ## ## ## ## ## ## ######## ###### + + # Internal handler for PRESENCE_UPDATE + def update_presence(data) + # Friends list presences have no server ID so ignore these to not cause an error + return unless data['guild_id'] + + user_id = data['user']['id'].to_i + server_id = data['guild_id'].to_i + server = server(server_id) + return unless server + + member_is_new = false + + if server.member_cached?(user_id) + member = server.member(user_id) + else + # If the member is not cached yet, it means that it just came online from not being cached at all + # due to large_threshold. Fortunately, Discord sends the entire member object in this case, and + # not just a part of it - we can just cache this member directly + member = Member.new(data, server, self) + debug("Implicitly adding presence-obtained member #{user_id} to #{server_id} cache") + + member_is_new = true + end + + username = data['user']['username'] + if username && !member_is_new # Don't set the username for newly-cached members + debug "Implicitly updating presence-obtained information for member #{user_id}" + member.update_username(username) + end + + member.update_presence(data) + + member.avatar_id = data['user']['avatar'] if data['user']['avatar'] + + server.cache_member(member) + end + + # Internal handler for VOICE_STATE_UPDATE + def update_voice_state(data) + @session_id = data['session_id'] + + server_id = data['guild_id'].to_i + server = server(server_id) + return unless server + + user_id = data['user_id'].to_i + old_voice_state = server.voice_states[user_id] + old_channel_id = old_voice_state.voice_channel&.id if old_voice_state + + server.update_voice_state(data) + + existing_voice = @voices[server_id] + if user_id == @profile.id && existing_voice + new_channel_id = data['channel_id'] + if new_channel_id + new_channel = channel(new_channel_id) + existing_voice.channel = new_channel + else + voice_destroy(server_id) + end + end + + old_channel_id + end + + # Internal handler for VOICE_SERVER_UPDATE + def update_voice_server(data) + server_id = data['guild_id'].to_i + channel = @should_connect_to_voice[server_id] + + debug("Voice server update received! chan: #{channel.inspect}") + return unless channel + + @should_connect_to_voice.delete(server_id) + debug('Updating voice server!') + + token = data['token'] + endpoint = data['endpoint'] + + unless endpoint + debug('VOICE_SERVER_UPDATE sent with nil endpoint! Ignoring') + return + end + + debug('Got data, now creating the bot.') + @voices[server_id] = Discordrb::Voice::VoiceBot.new(channel, self, token, @session_id, endpoint) + end + + # Internal handler for CHANNEL_CREATE + def create_channel(data) + channel = Channel.new(data, self) + server = channel.server + + # Handle normal and private channels separately + if server + server.add_channel(channel) + @channels[channel.id] = channel + elsif channel.pm? + @pm_channels[channel.recipient.id] = channel + elsif channel.group? + @channels[channel.id] = channel + end + end + + # Internal handler for CHANNEL_UPDATE + def update_channel(data) + channel = Channel.new(data, self) + old_channel = @channels[channel.id] + return unless old_channel + + old_channel.update_from(channel) + end + + # Internal handler for CHANNEL_DELETE + def delete_channel(data) + channel = Channel.new(data, self) + server = channel.server + + # Handle normal and private channels separately + if server + @channels.delete(channel.id) + server.delete_channel(channel.id) + elsif channel.pm? + @pm_channels.delete(channel.recipient.id) + elsif channel.group? + @channels.delete(channel.id) + end + end + + # Internal handler for CHANNEL_RECIPIENT_ADD + def add_recipient(data) + channel_id = data['channel_id'].to_i + channel = self.channel(channel_id) + + recipient_user = ensure_user(data['user']) + recipient = Recipient.new(recipient_user, channel, self) + channel.add_recipient(recipient) + end + + # Internal handler for CHANNEL_RECIPIENT_REMOVE + def remove_recipient(data) + channel_id = data['channel_id'].to_i + channel = self.channel(channel_id) + + recipient_user = ensure_user(data['user']) + recipient = Recipient.new(recipient_user, channel, self) + channel.remove_recipient(recipient) + end + + # Internal handler for GUILD_MEMBER_ADD + def add_guild_member(data) + server_id = data['guild_id'].to_i + server = self.server(server_id) + + member = Member.new(data, server, self) + server.add_member(member) + end + + # Internal handler for GUILD_MEMBER_UPDATE + def update_guild_member(data) + server_id = data['guild_id'].to_i + server = self.server(server_id) + + member = server.member(data['user']['id'].to_i) + member.update_roles(data['roles']) + member.update_nick(data['nick']) + member.update_boosting_since(data['premium_since']) + end + + # Internal handler for GUILD_MEMBER_DELETE + def delete_guild_member(data) + server_id = data['guild_id'].to_i + server = self.server(server_id) + return unless server + + user_id = data['user']['id'].to_i + server.delete_member(user_id) + rescue Discordrb::Errors::NoPermission + Discordrb::LOGGER.warn("delete_guild_member attempted to access a server for which the bot doesn't have permission! Not sure what happened here, ignoring") + end + + # Internal handler for GUILD_CREATE + def create_guild(data) + ensure_server(data) + end + + # Internal handler for GUILD_UPDATE + def update_guild(data) + @servers[data['id'].to_i].update_data(data) + end + + # Internal handler for GUILD_DELETE + def delete_guild(data) + id = data['id'].to_i + @servers.delete(id) + end + + # Internal handler for GUILD_ROLE_UPDATE + def update_guild_role(data) + role_data = data['role'] + server_id = data['guild_id'].to_i + server = @servers[server_id] + new_role = Role.new(role_data, self, server) + role_id = role_data['id'].to_i + old_role = server.roles.find { |r| r.id == role_id } + old_role.update_from(new_role) + end + + # Internal handler for GUILD_ROLE_CREATE + def create_guild_role(data) + role_data = data['role'] + server_id = data['guild_id'].to_i + server = @servers[server_id] + new_role = Role.new(role_data, self, server) + existing_role = server.role(new_role.id) + if existing_role + existing_role.update_from(new_role) + else + server.add_role(new_role) + end + end + + # Internal handler for GUILD_ROLE_DELETE + def delete_guild_role(data) + role_id = data['role_id'].to_i + server_id = data['guild_id'].to_i + server = @servers[server_id] + server.delete_role(role_id) + end + + # Internal handler for GUILD_EMOJIS_UPDATE + def update_guild_emoji(data) + server_id = data['guild_id'].to_i + server = @servers[server_id] + server.update_emoji_data(data) + end + + # Internal handler for MESSAGE_CREATE + def create_message(data); end + + # Internal handler for TYPING_START + def start_typing(data); end + + # Internal handler for MESSAGE_UPDATE + def update_message(data); end + + # Internal handler for MESSAGE_DELETE + def delete_message(data); end + + # Internal handler for MESSAGE_REACTION_ADD + def add_message_reaction(data); end + + # Internal handler for MESSAGE_REACTION_REMOVE + def remove_message_reaction(data); end + + # Internal handler for MESSAGE_REACTION_REMOVE_ALL + def remove_all_message_reactions(data); end + + # Internal handler for GUILD_BAN_ADD + def add_user_ban(data); end + + # Internal handler for GUILD_BAN_REMOVE + def remove_user_ban(data); end + + ## ####### ###### #### ## ## + ## ## ## ## ## ## ### ## + ## ## ## ## ## #### ## + ## ## ## ## #### ## ## ## ## + ## ## ## ## ## ## ## #### + ## ## ## ## ## ## ## ### + ######## ####### ###### #### ## ## + + def process_token(type, token) + # Remove the "Bot " prefix if it exists + token = token[4..-1] if token.start_with? 'Bot ' + + token = "Bot #{token}" unless type == :user + token + end + + def handle_dispatch(type, data) + # Check whether there are still unavailable servers and there have been more than 10 seconds since READY + if @unavailable_servers&.positive? && (Time.now - @unavailable_timeout_time) > 10 && !((@intents || 0) & INTENTS[:servers]).zero? + # The server streaming timed out! + LOGGER.debug("Server streaming timed out with #{@unavailable_servers} servers remaining") + LOGGER.debug('Calling ready now because server loading is taking a long time. Servers may be unavailable due to an outage, or your bot is on very large servers.') + + # Unset the unavailable server count so this doesn't get triggered again + @unavailable_servers = 0 + + notify_ready + end + + case type + when :READY + # As READY may be called multiple times over a single process lifetime, we here need to reset the cache entirely + # to prevent possible inconsistencies, like objects referencing old versions of other objects which have been + # replaced. + init_cache + + @profile = Profile.new(data['user'], self) + + # Initialize servers + @servers = {} + + # Count unavailable servers + @unavailable_servers = 0 + + data['guilds'].each do |element| + # Check for true specifically because unavailable=false indicates that a previously unavailable server has + # come online + if element['unavailable'].is_a? TrueClass + @unavailable_servers += 1 + + # Ignore any unavailable servers + next + end + + ensure_server(element) + end + + # Add PM and group channels + data['private_channels'].each do |element| + channel = ensure_channel(element) + if channel.pm? + @pm_channels[channel.recipient.id] = channel + else + @channels[channel.id] = channel + end + end + + # Don't notify yet if there are unavailable servers because they need to get available before the bot truly has + # all the data + if @unavailable_servers.zero? + # No unavailable servers - we're ready! + notify_ready + end + + @ready_time = Time.now + @unavailable_timeout_time = Time.now + when :GUILD_MEMBERS_CHUNK + id = data['guild_id'].to_i + server = server(id) + server.process_chunk(data['members']) + when :INVITE_CREATE + invite = Invite.new(data, self) + raise_event(InviteCreateEvent.new(data, invite, self)) + when :INVITE_DELETE + raise_event(InviteDeleteEvent.new(data, self)) + when :MESSAGE_CREATE + if ignored?(data['author']['id'].to_i) + debug("Ignored author with ID #{data['author']['id']}") + return + end + + if @ignore_bots && data['author']['bot'] + debug("Ignored Bot account with ID #{data['author']['id']}") + return + end + + # If create_message is overwritten with a method that returns the parsed message, use that instead, so we don't + # parse the message twice (which is just thrown away performance) + message = create_message(data) + message = Message.new(data, self) unless message.is_a? Message + + return if message.from_bot? && !should_parse_self + + event = MessageEvent.new(message, self) + raise_event(event) + + if message.mentions.any? { |user| user.id == @profile.id } + event = MentionEvent.new(message, self) + raise_event(event) + end + + if message.channel.private? + event = PrivateMessageEvent.new(message, self) + raise_event(event) + end + when :MESSAGE_UPDATE + update_message(data) + + message = Message.new(data, self) + + event = MessageUpdateEvent.new(message, self) + raise_event(event) + + return if message.from_bot? && !should_parse_self + + unless message.author + LOGGER.debug("Edited a message with nil author! Content: #{message.content.inspect}, channel: #{message.channel.inspect}") + return + end + + event = MessageEditEvent.new(message, self) + raise_event(event) + when :MESSAGE_DELETE + delete_message(data) + + event = MessageDeleteEvent.new(data, self) + raise_event(event) + when :MESSAGE_DELETE_BULK + debug("MESSAGE_DELETE_BULK will raise #{data['ids'].length} events") + + data['ids'].each do |single_id| + # Form a data hash for a single ID so the methods get what they want + single_data = { + 'id' => single_id, + 'channel_id' => data['channel_id'] + } + + # Raise as normal + delete_message(single_data) + + event = MessageDeleteEvent.new(single_data, self) + raise_event(event) + end + when :TYPING_START + start_typing(data) + + begin + event = TypingEvent.new(data, self) + raise_event(event) + rescue Discordrb::Errors::NoPermission + debug 'Typing started in channel the bot has no access to, ignoring' + end + when :MESSAGE_REACTION_ADD + add_message_reaction(data) + + return if profile.id == data['user_id'].to_i && !should_parse_self + + event = ReactionAddEvent.new(data, self) + raise_event(event) + when :MESSAGE_REACTION_REMOVE + remove_message_reaction(data) + + return if profile.id == data['user_id'].to_i && !should_parse_self + + event = ReactionRemoveEvent.new(data, self) + raise_event(event) + when :MESSAGE_REACTION_REMOVE_ALL + remove_all_message_reactions(data) + + event = ReactionRemoveAllEvent.new(data, self) + raise_event(event) + when :PRESENCE_UPDATE + # Ignore friends list presences + return unless data['guild_id'] + + now_playing = data['game'].nil? ? nil : data['game']['name'] + presence_user = @users[data['user']['id'].to_i] + played_before = presence_user.nil? ? nil : presence_user.game + update_presence(data) + + event = if now_playing == played_before + PresenceEvent.new(data, self) + else + PlayingEvent.new(data, self) + end + + raise_event(event) + when :VOICE_STATE_UPDATE + old_channel_id = update_voice_state(data) + + event = VoiceStateUpdateEvent.new(data, old_channel_id, self) + raise_event(event) + when :VOICE_SERVER_UPDATE + update_voice_server(data) + + event = VoiceServerUpdateEvent.new(data, self) + raise_event(event) + when :CHANNEL_CREATE + create_channel(data) + + event = ChannelCreateEvent.new(data, self) + raise_event(event) + when :CHANNEL_UPDATE + update_channel(data) + + event = ChannelUpdateEvent.new(data, self) + raise_event(event) + when :CHANNEL_DELETE + delete_channel(data) + + event = ChannelDeleteEvent.new(data, self) + raise_event(event) + when :CHANNEL_RECIPIENT_ADD + add_recipient(data) + + event = ChannelRecipientAddEvent.new(data, self) + raise_event(event) + when :CHANNEL_RECIPIENT_REMOVE + remove_recipient(data) + + event = ChannelRecipientRemoveEvent.new(data, self) + raise_event(event) + when :GUILD_MEMBER_ADD + add_guild_member(data) + + event = ServerMemberAddEvent.new(data, self) + raise_event(event) + when :GUILD_MEMBER_UPDATE + update_guild_member(data) + + event = ServerMemberUpdateEvent.new(data, self) + raise_event(event) + when :GUILD_MEMBER_REMOVE + delete_guild_member(data) + + event = ServerMemberDeleteEvent.new(data, self) + raise_event(event) + when :GUILD_BAN_ADD + add_user_ban(data) + + event = UserBanEvent.new(data, self) + raise_event(event) + when :GUILD_BAN_REMOVE + remove_user_ban(data) + + event = UserUnbanEvent.new(data, self) + raise_event(event) + when :GUILD_ROLE_UPDATE + update_guild_role(data) + + event = ServerRoleUpdateEvent.new(data, self) + raise_event(event) + when :GUILD_ROLE_CREATE + create_guild_role(data) + + event = ServerRoleCreateEvent.new(data, self) + raise_event(event) + when :GUILD_ROLE_DELETE + delete_guild_role(data) + + event = ServerRoleDeleteEvent.new(data, self) + raise_event(event) + when :GUILD_CREATE + create_guild(data) + + # Check for false specifically (no data means the server has never been unavailable) + if data['unavailable'].is_a? FalseClass + @unavailable_servers -= 1 if @unavailable_servers + @unavailable_timeout_time = Time.now + + notify_ready if @unavailable_servers.zero? + + # Return here so the event doesn't get triggered + return + end + + event = ServerCreateEvent.new(data, self) + raise_event(event) + when :GUILD_UPDATE + update_guild(data) + + event = ServerUpdateEvent.new(data, self) + raise_event(event) + when :GUILD_DELETE + delete_guild(data) + + if data['unavailable'].is_a? TrueClass + LOGGER.warn("Server #{data['id']} is unavailable due to an outage!") + return # Don't raise an event + end + + event = ServerDeleteEvent.new(data, self) + raise_event(event) + when :GUILD_EMOJIS_UPDATE + server_id = data['guild_id'].to_i + server = @servers[server_id] + old_emoji_data = server.emoji.clone + update_guild_emoji(data) + new_emoji_data = server.emoji + + created_ids = new_emoji_data.keys - old_emoji_data.keys + deleted_ids = old_emoji_data.keys - new_emoji_data.keys + updated_ids = old_emoji_data.select do |k, v| + new_emoji_data[k] && (v.name != new_emoji_data[k].name || v.roles != new_emoji_data[k].roles) + end.keys + + event = ServerEmojiChangeEvent.new(server, data, self) + raise_event(event) + + created_ids.each do |e| + event = ServerEmojiCreateEvent.new(server, new_emoji_data[e], self) + raise_event(event) + end + + deleted_ids.each do |e| + event = ServerEmojiDeleteEvent.new(server, old_emoji_data[e], self) + raise_event(event) + end + + updated_ids.each do |e| + event = ServerEmojiUpdateEvent.new(server, old_emoji_data[e], new_emoji_data[e], self) + raise_event(event) + end + when :WEBHOOKS_UPDATE + event = WebhookUpdateEvent.new(data, self) + raise_event(event) + else + # another event that we don't support yet + debug "Event #{type} has been received but is unsupported. Raising UnknownEvent" + + event = UnknownEvent.new(type, data, self) + raise_event(event) + end + + # The existence of this array is checked before for performance reasons, since this has to be done for *every* + # dispatch. + if @event_handlers && @event_handlers[RawEvent] + event = RawEvent.new(type, data, self) + raise_event(event) + end + rescue Exception => e + LOGGER.error('Gateway message error!') + log_exception(e) + end + + # Notifies everything there is to be notified that the connection is now ready + def notify_ready + # Make sure to raise the event + raise_event(ReadyEvent.new(self)) + LOGGER.good 'Ready' + + @gateway.notify_ready + end + + def raise_event(event) + debug("Raised a #{event.class}") + handle_awaits(event) + + @event_handlers ||= {} + handlers = @event_handlers[event.class] + return unless handlers + + handlers.dup.each do |handler| + call_event(handler, event) if handler.matches?(event) + end + end + + def call_event(handler, event) + t = Thread.new do + @event_threads ||= [] + @current_thread ||= 0 + + @event_threads << t + Thread.current[:discordrb_name] = "et-#{@current_thread += 1}" + begin + handler.call(event) + handler.after_call(event) + rescue StandardError => e + log_exception(e) + ensure + @event_threads.delete(t) + end + end + end + + def handle_awaits(event) + @awaits ||= {} + @awaits.each do |_, await| + key, should_delete = await.match(event) + next unless key + + debug("should_delete: #{should_delete}") + @awaits.delete(await.key) if should_delete + + await_event = Discordrb::Events::AwaitEvent.new(await, event, self) + raise_event(await_event) + end + end + + def calculate_intents(intents) + intents.reduce(0) do |sum, intent| + case intent + when Symbol + if INTENTS[intent] + sum | INTENTS[intent] + else + LOGGER.warn("Unknown intent: #{intent}") + sum + end + when Integer + sum | intent + else + LOGGER.warn("Invalid intent: #{intent}") + sum + end + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/cache.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/cache.rb new file mode 100644 index 0000000..8c7b2ab --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/cache.rb @@ -0,0 +1,256 @@ +# frozen_string_literal: true + +require 'discordrb/api' +require 'discordrb/api/server' +require 'discordrb/api/invite' +require 'discordrb/api/user' +require 'discordrb/data' + +module Discordrb + # This mixin module does caching stuff for the library. It conveniently separates the logic behind + # the caching (like, storing the user hashes or making API calls to retrieve things) from the Bot that + # actually uses it. + module Cache + # Initializes this cache + def init_cache + @users = {} + + @voice_regions = {} + + @servers = {} + + @channels = {} + @pm_channels = {} + + @restricted_channels = [] + end + + # Returns or caches the available voice regions + def voice_regions + return @voice_regions unless @voice_regions.empty? + + regions = JSON.parse API.voice_regions(token) + regions.each do |data| + @voice_regions[data['id']] = VoiceRegion.new(data) + end + + @voice_regions + end + + # Gets a channel given its ID. This queries the internal channel cache, and if the channel doesn't + # exist in there, it will get the data from Discord. + # @param id [Integer] The channel ID for which to search for. + # @param server [Server] The server for which to search the channel for. If this isn't specified, it will be + # inferred using the API + # @return [Channel] The channel identified by the ID. + def channel(id, server = nil) + id = id.resolve_id + + raise Discordrb::Errors::NoPermission if @restricted_channels.include? id + + debug("Obtaining data for channel with id #{id}") + return @channels[id] if @channels[id] + + begin + begin + response = API::Channel.resolve(token, id) + rescue RestClient::ResourceNotFound + return nil + end + channel = Channel.new(JSON.parse(response), self, server) + @channels[id] = channel + rescue Discordrb::Errors::NoPermission + debug "Tried to get access to restricted channel #{id}, blacklisting it" + @restricted_channels << id + raise + end + end + + alias_method :group_channel, :channel + + # Gets a user by its ID. + # @note This can only resolve users known by the bot (i.e. that share a server with the bot). + # @param id [Integer] The user ID that should be resolved. + # @return [User, nil] The user identified by the ID, or `nil` if it couldn't be found. + def user(id) + id = id.resolve_id + return @users[id] if @users[id] + + LOGGER.out("Resolving user #{id}") + begin + response = API::User.resolve(token, id) + rescue RestClient::ResourceNotFound + return nil + end + user = User.new(JSON.parse(response), self) + @users[id] = user + end + + # Gets a server by its ID. + # @note This can only resolve servers the bot is currently in. + # @param id [Integer] The server ID that should be resolved. + # @return [Server, nil] The server identified by the ID, or `nil` if it couldn't be found. + def server(id) + id = id.resolve_id + return @servers[id] if @servers[id] + + LOGGER.out("Resolving server #{id}") + begin + response = API::Server.resolve(token, id) + rescue Discordrb::Errors::NoPermission + return nil + end + server = Server.new(JSON.parse(response), self) + @servers[id] = server + end + + # Gets a member by both IDs, or `Server` and user ID. + # @param server_or_id [Server, Integer] The `Server` or server ID for which a member should be resolved + # @param user_id [Integer] The ID of the user that should be resolved + # @return [Member, nil] The member identified by the IDs, or `nil` if none could be found + def member(server_or_id, user_id) + server_id = server_or_id.resolve_id + user_id = user_id.resolve_id + + server = server_or_id.is_a?(Server) ? server_or_id : self.server(server_id) + + return server.member(user_id) if server.member_cached?(user_id) + + LOGGER.out("Resolving member #{server_id} on server #{user_id}") + begin + response = API::Server.resolve_member(token, server_id, user_id) + rescue RestClient::ResourceNotFound + return nil + end + member = Member.new(JSON.parse(response), server, self) + server.cache_member(member) + end + + # Creates a PM channel for the given user ID, or if one exists already, returns that one. + # It is recommended that you use {User#pm} instead, as this is mainly for internal use. However, + # usage of this method may be unavoidable if only the user ID is known. + # @param id [Integer] The user ID to generate a private channel for. + # @return [Channel] A private channel for that user. + def pm_channel(id) + id = id.resolve_id + return @pm_channels[id] if @pm_channels[id] + + debug("Creating pm channel with user id #{id}") + response = API::User.create_pm(token, id) + channel = Channel.new(JSON.parse(response), self) + @pm_channels[id] = channel + end + + alias_method :private_channel, :pm_channel + + # Ensures a given user object is cached and if not, cache it from the given data hash. + # @param data [Hash] A data hash representing a user. + # @return [User] the user represented by the data hash. + def ensure_user(data) + if @users.include?(data['id'].to_i) + @users[data['id'].to_i] + else + @users[data['id'].to_i] = User.new(data, self) + end + end + + # Ensures a given server object is cached and if not, cache it from the given data hash. + # @param data [Hash] A data hash representing a server. + # @return [Server] the server represented by the data hash. + def ensure_server(data) + if @servers.include?(data['id'].to_i) + @servers[data['id'].to_i] + else + @servers[data['id'].to_i] = Server.new(data, self) + end + end + + # Ensures a given channel object is cached and if not, cache it from the given data hash. + # @param data [Hash] A data hash representing a channel. + # @param server [Server, nil] The server the channel is on, if known. + # @return [Channel] the channel represented by the data hash. + def ensure_channel(data, server = nil) + if @channels.include?(data['id'].to_i) + @channels[data['id'].to_i] + else + @channels[data['id'].to_i] = Channel.new(data, self, server) + end + end + + # Requests member chunks for a given server ID. + # @param id [Integer] The server ID to request chunks for. + def request_chunks(id) + @gateway.send_request_members(id, '', 0) + end + + # Gets the code for an invite. + # @param invite [String, Invite] The invite to get the code for. Possible formats are: + # + # * An {Invite} object + # * The code for an invite + # * A fully qualified invite URL (e.g. `https://discord.com/invite/0A37aN7fasF7n83q`) + # * A short invite URL with protocol (e.g. `https://discord.gg/0A37aN7fasF7n83q`) + # * A short invite URL without protocol (e.g. `discord.gg/0A37aN7fasF7n83q`) + # @return [String] Only the code for the invite. + def resolve_invite_code(invite) + invite = invite.code if invite.is_a? Discordrb::Invite + invite = invite[invite.rindex('/') + 1..-1] if invite.start_with?('http', 'discord.gg') + invite + end + + # Gets information about an invite. + # @param invite [String, Invite] The invite to join. For possible formats see {#resolve_invite_code}. + # @return [Invite] The invite with information about the given invite URL. + def invite(invite) + code = resolve_invite_code(invite) + Invite.new(JSON.parse(API::Invite.resolve(token, code)), self) + end + + # Finds a channel given its name and optionally the name of the server it is in. + # @param channel_name [String] The channel to search for. + # @param server_name [String] The server to search for, or `nil` if only the channel should be searched for. + # @param type [Integer, nil] The type of channel to search for (0: text, 1: private, 2: voice, 3: group), or `nil` if any type of + # channel should be searched for + # @return [Array] The array of channels that were found. May be empty if none were found. + def find_channel(channel_name, server_name = nil, type: nil) + results = [] + + if /<#(?\d+)>?/ =~ channel_name + # Check for channel mentions separately + return [channel(id)] + end + + @servers.each_value do |server| + server.channels.each do |channel| + results << channel if channel.name == channel_name && (server_name || server.name) == server.name && (!type || (channel.type == type)) + end + end + + results + end + + # Finds a user given its username or username & discriminator. + # @overload find_user(username) + # Find all cached users with a certain username. + # @param username [String] The username to look for. + # @return [Array] The array of users that were found. May be empty if none were found. + # @overload find_user(username, discrim) + # Find a cached user with a certain username and discriminator. + # Find a user by name and discriminator + # @param username [String] The username to look for. + # @param discrim [String] The user's discriminator + # @return [User, nil] The user that was found, or `nil` if none was found + # @note This method only searches through users that have been cached. Users that have not yet been cached + # by the bot but still share a connection with the user (mutual server) will not be found. + # @example Find users by name + # bot.find_user('z64') #=> Array + # @example Find a user by name and discriminator + # bot.find_user('z64', '2639') #=> User + def find_user(username, discrim = nil) + users = @users.values.find_all { |e| e.username == username } + return users.find { |u| u.discrim == discrim } if discrim + + users + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/colour_rgb.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/colour_rgb.rb new file mode 100644 index 0000000..8b7ed3a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/colour_rgb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Discordrb + # A colour (red, green and blue values). Used for role colours. If you prefer the American spelling, the alias + # {ColorRGB} is also available. + class ColourRGB + # @return [Integer] the red part of this colour (0-255). + attr_reader :red + + # @return [Integer] the green part of this colour (0-255). + attr_reader :green + + # @return [Integer] the blue part of this colour (0-255). + attr_reader :blue + + # @return [Integer] the colour's RGB values combined into one integer. + attr_reader :combined + alias_method :to_i, :combined + + # Make a new colour from the combined value. + # @param combined [String, Integer] The colour's RGB values combined into one integer or a hexadecimal string + # @example Initialize a with a base 10 integer + # ColourRGB.new(7506394) #=> ColourRGB + # ColourRGB.new(0x7289da) #=> ColourRGB + # @example Initialize a with a hexadecimal string + # ColourRGB.new('7289da') #=> ColourRGB + def initialize(combined) + @combined = combined.is_a?(String) ? combined.to_i(16) : combined + @red = (@combined >> 16) & 0xFF + @green = (@combined >> 8) & 0xFF + @blue = @combined & 0xFF + end + + # @return [String] the colour as a hexadecimal. + def hex + @combined.to_s(16) + end + alias_method :hexadecimal, :hex + end + + # Alias for the class {ColourRGB} + ColorRGB = ColourRGB +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/command_bot.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/command_bot.rb new file mode 100644 index 0000000..9d22d9a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/command_bot.rb @@ -0,0 +1,514 @@ +# frozen_string_literal: true + +require 'discordrb/bot' +require 'discordrb/data' +require 'discordrb/commands/parser' +require 'discordrb/commands/events' +require 'discordrb/commands/container' +require 'discordrb/commands/rate_limiter' +require 'time' + +# Specialized bot to run commands + +module Discordrb::Commands + # Bot that supports commands and command chains + class CommandBot < Discordrb::Bot + # @return [Hash] this bot's attributes. + attr_reader :attributes + + # @return [String, Array, #call] the prefix commands are triggered with. + # @see #initialize + attr_reader :prefix + + include CommandContainer + + # Creates a new CommandBot and logs in to Discord. + # @param attributes [Hash] The attributes to initialize the CommandBot with. + # @see Discordrb::Bot#initialize Discordrb::Bot#initialize for other attributes that should be used to create the underlying regular bot. + # @option attributes [String, Array, #call] :prefix The prefix that should trigger this bot's commands. It + # can be: + # + # * Any string (including the empty string). This has the effect that if a message starts with the prefix, the + # prefix will be stripped and the rest of the chain will be parsed as a command chain. Note that it will be + # literal - if the prefix is "hi" then the corresponding trigger string for a command called "test" would be + # "hitest". Don't forget to put spaces in if you need them! + # * An array of prefixes. Those will behave similarly to setting one string as a prefix, but instead of only one + # string, any of the strings in the array can be used. + # * Something Proc-like (responds to :call) that takes a {Message} object as an argument and returns either + # the command chain in raw form or `nil` if the given message shouldn't be parsed. This can be used to make more + # complicated dynamic prefixes (e. g. based on server), or even something else entirely (suffixes, or most + # adventurous, infixes). + # @option attributes [true, false] :advanced_functionality Whether to enable advanced functionality (very powerful + # way to nest commands into chains, see https://github.com/shardlab/discordrb/wiki/Commands#command-chain-syntax + # for info. Default is false. + # @option attributes [Symbol, Array, false] :help_command The name of the command that displays info for + # other commands. Use an array if you want to have aliases. Default is "help". If none should be created, use + # `false` as the value. + # @option attributes [String] :command_doesnt_exist_message The message that should be displayed if a user attempts + # to use a command that does not exist. If none is specified, no message will be displayed. In the message, you + # can use the string '%command%' that will be replaced with the name of the command. + # @option attributes [String] :no_permission_message The message to be displayed when `NoPermission` error is raised. + # @option attributes [true, false] :spaces_allowed Whether spaces are allowed to occur between the prefix and the + # command. Default is false. + # @option attributes [true, false] :webhook_commands Whether messages sent by webhooks are allowed to trigger + # commands. Default is true. + # @option attributes [Array] :channels The channels this command bot accepts commands on. + # Superseded if a command has a 'channels' attribute. + # @option attributes [String] :previous Character that should designate the result of the previous command in + # a command chain (see :advanced_functionality). Default is '~'. Set to an empty string to disable. + # @option attributes [String] :chain_delimiter Character that should designate that a new command begins in the + # command chain (see :advanced_functionality). Default is '>'. Set to an empty string to disable. + # @option attributes [String] :chain_args_delim Character that should separate the command chain arguments from the + # chain itself (see :advanced_functionality). Default is ':'. Set to an empty string to disable. + # @option attributes [String] :sub_chain_start Character that should start a sub-chain (see + # :advanced_functionality). Default is '['. Set to an empty string to disable. + # @option attributes [String] :sub_chain_end Character that should end a sub-chain (see + # :advanced_functionality). Default is ']'. Set to an empty string to disable. + # @option attributes [String] :quote_start Character that should start a quoted string (see + # :advanced_functionality). Default is '"'. Set to an empty string to disable. + # @option attributes [String] :quote_end Character that should end a quoted string (see + # :advanced_functionality). Default is '"' or the same as :quote_start. Set to an empty string to disable. + # @option attributes [true, false] :ignore_bots Whether the bot should ignore bot accounts or not. Default is false. + def initialize(attributes = {}) + super( + log_mode: attributes[:log_mode], + token: attributes[:token], + client_id: attributes[:client_id], + type: attributes[:type], + name: attributes[:name], + fancy_log: attributes[:fancy_log], + suppress_ready: attributes[:suppress_ready], + parse_self: attributes[:parse_self], + shard_id: attributes[:shard_id], + num_shards: attributes[:num_shards], + redact_token: attributes.key?(:redact_token) ? attributes[:redact_token] : true, + ignore_bots: attributes[:ignore_bots], + compress_mode: attributes[:compress_mode], + intents: attributes[:intents] + ) + + @prefix = attributes[:prefix] + @attributes = { + # Whether advanced functionality such as command chains are enabled + advanced_functionality: attributes[:advanced_functionality].nil? ? false : attributes[:advanced_functionality], + + # The name of the help command (that displays information to other commands). False if none should exist + help_command: attributes[:help_command].is_a?(FalseClass) ? nil : (attributes[:help_command] || :help), + + # The message to display for when a command doesn't exist, %command% to get the command name in question and nil for no message + # No default value here because it may not be desired behaviour + command_doesnt_exist_message: attributes[:command_doesnt_exist_message], + + # The message to be displayed when `NoPermission` error is raised. + no_permission_message: attributes[:no_permission_message], + + # Spaces allowed between prefix and command + spaces_allowed: attributes[:spaces_allowed].nil? ? false : attributes[:spaces_allowed], + + # Webhooks allowed to trigger commands + webhook_commands: attributes[:webhook_commands].nil? ? true : attributes[:webhook_commands], + + channels: attributes[:channels] || [], + + # All of the following need to be one character + # String to designate previous result in command chain + previous: attributes[:previous] || '~', + + # Command chain delimiter + chain_delimiter: attributes[:chain_delimiter] || '>', + + # Chain argument delimiter + chain_args_delim: attributes[:chain_args_delim] || ':', + + # Sub-chain starting character + sub_chain_start: attributes[:sub_chain_start] || '[', + + # Sub-chain ending character + sub_chain_end: attributes[:sub_chain_end] || ']', + + # Quoted mode starting character + quote_start: attributes[:quote_start] || '"', + + # Quoted mode ending character + quote_end: attributes[:quote_end] || attributes[:quote_start] || '"', + + # Default block for handling internal exceptions, or a string to respond with + rescue: attributes[:rescue] + } + + @permissions = { + roles: {}, + users: {} + } + + return unless @attributes[:help_command] + + command(@attributes[:help_command], max_args: 1, description: 'Shows a list of all the commands available or displays help for a specific command.', usage: 'help [command name]') do |event, command_name| + if command_name + command = @commands[command_name.to_sym] + if command.is_a?(CommandAlias) + command = command.aliased_command + command_name = command.name + end + return "The command `#{command_name}` does not exist!" unless command + + desc = command.attributes[:description] || '*No description available*' + usage = command.attributes[:usage] + parameters = command.attributes[:parameters] + result = "**`#{command_name}`**: #{desc}" + aliases = command_aliases(command_name.to_sym) + unless aliases.empty? + result += "\nAliases: " + result += aliases.map { |a| "`#{a.name}`" }.join(', ') + end + result += "\nUsage: `#{usage}`" if usage + if parameters + result += "\nAccepted Parameters:\n```" + parameters.each { |p| result += "\n#{p}" } + result += '```' + end + result + else + available_commands = @commands.values.reject do |c| + c.is_a?(CommandAlias) || !c.attributes[:help_available] || !required_roles?(event.user, c.attributes[:required_roles]) || !allowed_roles?(event.user, c.attributes[:allowed_roles]) || !required_permissions?(event.user, c.attributes[:required_permissions], event.channel) + end + case available_commands.length + when 0..5 + available_commands.reduce "**List of commands:**\n" do |memo, c| + memo + "**`#{c.name}`**: #{c.attributes[:description] || '*No description available*'}\n" + end + when 5..50 + (available_commands.reduce "**List of commands:**\n" do |memo, c| + memo + "`#{c.name}`, " + end)[0..-3] + else + event.user.pm(available_commands.reduce("**List of commands:**\n") { |m, e| m + "`#{e.name}`, " }[0..-3]) + event.channel.pm? ? '' : 'Sending list in PM!' + end + end + end + end + + # Returns all aliases for the command with the given name + # @param name [Symbol] the name of the `Command` + # @return [Array] + def command_aliases(name) + commands.values.select do |command| + command.is_a?(CommandAlias) && command.aliased_command.name == name + end + end + + # Executes a particular command on the bot. Mostly useful for internal stuff, but one can never know. + # @param name [Symbol] The command to execute. + # @param event [CommandEvent] The event to pass to the command. + # @param arguments [Array] The arguments to pass to the command. + # @param chained [true, false] Whether or not it should be executed as part of a command chain. If this is false, + # commands that have chain_usable set to false will not work. + # @param check_permissions [true, false] Whether permission parameters such as `required_permission` or + # `permission_level` should be checked. + # @return [String, nil] the command's result, if there is any. + def execute_command(name, event, arguments, chained = false, check_permissions = true) + debug("Executing command #{name} with arguments #{arguments}") + return unless @commands + + command = @commands[name] + command = command.aliased_command if command.is_a?(CommandAlias) + return unless !check_permissions || channels?(event.channel, @attributes[:channels]) || + (command && !command.attributes[:channels].nil?) + + unless command + event.respond @attributes[:command_doesnt_exist_message].gsub('%command%', name.to_s) if @attributes[:command_doesnt_exist_message] + return + end + return unless !check_permissions || channels?(event.channel, command.attributes[:channels]) + + arguments = arg_check(arguments, command.attributes[:arg_types], event.server) if check_permissions + if (check_permissions && + permission?(event.author, command.attributes[:permission_level], event.server) && + required_permissions?(event.author, command.attributes[:required_permissions], event.channel) && + required_roles?(event.author, command.attributes[:required_roles]) && + allowed_roles?(event.author, command.attributes[:allowed_roles])) || + !check_permissions + event.command = command + result = command.call(event, arguments, chained, check_permissions) + stringify(result) + else + event.respond command.attributes[:permission_message].gsub('%name%', name.to_s) if command.attributes[:permission_message] + nil + end + rescue Discordrb::Errors::NoPermission + event.respond @attributes[:no_permission_message] unless @attributes[:no_permission_message].nil? + raise + end + + # Transforms an array of string arguments based on types array. + # For example, `['1', '10..14']` with types `[Integer, Range]` would turn into `[1, 10..14]`. + def arg_check(args, types = nil, server = nil) + return args unless types + + args.each_with_index.map do |arg, i| + next arg if types[i].nil? || types[i] == String + + if types[i] == Integer + begin + Integer(arg, 10) + rescue ArgumentError + nil + end + elsif types[i] == Float + begin + Float(arg) + rescue ArgumentError + nil + end + elsif types[i] == Time + begin + Time.parse arg + rescue ArgumentError + nil + end + elsif types[i] == TrueClass || types[i] == FalseClass + if arg.casecmp('true').zero? || arg.downcase.start_with?('y') + true + elsif arg.casecmp('false').zero? || arg.downcase.start_with?('n') + false + end + elsif types[i] == Symbol + arg.to_sym + elsif types[i] == Encoding + begin + Encoding.find arg + rescue ArgumentError + nil + end + elsif types[i] == Regexp + begin + Regexp.new arg + rescue ArgumentError + nil + end + elsif types[i] == Rational + begin + Rational(arg) + rescue ArgumentError + nil + end + elsif types[i] == Range + begin + if arg.include? '...' + Range.new(*arg.split('...').map(&:to_i), true) + elsif arg.include? '..' + Range.new(*arg.split('..').map(&:to_i)) + end + rescue ArgumentError + nil + end + elsif types[i] == NilClass + nil + elsif [Discordrb::User, Discordrb::Role, Discordrb::Emoji].include? types[i] + result = parse_mention arg, server + result if result.instance_of? types[i] + elsif types[i] == Discordrb::Invite + resolve_invite_code arg + elsif types[i].respond_to?(:from_argument) + begin + types[i].from_argument arg + rescue StandardError + nil + end + else + raise ArgumentError, "#{types[i]} doesn't implement from_argument" + end + end + end + + # Executes a command in a simple manner, without command chains or permissions. + # @param chain [String] The command with its arguments separated by spaces. + # @param event [CommandEvent] The event to pass to the command. + # @return [String, nil] the command's result, if there is any. + def simple_execute(chain, event) + return nil if chain.empty? + + args = chain.split(' ') + execute_command(args[0].to_sym, event, args[1..-1]) + end + + # Sets the permission level of a user + # @param id [Integer] the ID of the user whose level to set + # @param level [Integer] the level to set the permission to + def set_user_permission(id, level) + @permissions[:users][id] = level + end + + # Sets the permission level of a role - this applies to all users in the role + # @param id [Integer] the ID of the role whose level to set + # @param level [Integer] the level to set the permission to + def set_role_permission(id, level) + @permissions[:roles][id] = level + end + + # Check if a user has permission to do something + # @param user [User] The user to check + # @param level [Integer] The minimum permission level the user should have (inclusive) + # @param server [Server] The server on which to check + # @return [true, false] whether or not the user has the given permission + def permission?(user, level, server) + determined_level = if user.webhook? || server.nil? + 0 + else + user.roles.reduce(0) do |memo, role| + [@permissions[:roles][role.id] || 0, memo].max + end + end + + [@permissions[:users][user.id] || 0, determined_level].max >= level + end + + # @see CommandBot#update_channels + def channels=(channels) + update_channels(channels) + end + + # Update the list of channels the bot accepts commands from. + # @param channels [Array] The channels this command bot accepts commands on. + def update_channels(channels = []) + @attributes[:channels] = Array(channels) + end + + # Add a channel to the list of channels the bot accepts commands from. + # @param channel [String, Integer, Channel] The channel name, integer ID, or `Channel` object to be added + def add_channel(channel) + return if @attributes[:channels].find { |c| channel.resolve_id == c.resolve_id } + + @attributes[:channels] << channel + end + + # Remove a channel from the list of channels the bot accepts commands from. + # @param channel [String, Integer, Channel] The channel name, integer ID, or `Channel` object to be removed + def remove_channel(channel) + @attributes[:channels].delete_if { |c| channel.resolve_id == c.resolve_id } + end + + private + + # Internal handler for MESSAGE_CREATE that is overwritten to allow for command handling + def create_message(data) + message = Discordrb::Message.new(data, self) + return message if message.from_bot? && !@should_parse_self + return message if message.webhook? && !@attributes[:webhook_commands] + + unless message.author + Discordrb::LOGGER.warn("Received a message (#{message.inspect}) with nil author! Ignoring, please report this if you can") + return + end + + event = CommandEvent.new(message, self) + + chain = trigger?(message) + return message unless chain + + # Don't allow spaces between the prefix and the command + if chain.start_with?(' ') && !@attributes[:spaces_allowed] + debug('Chain starts with a space') + return message + end + + if chain.strip.empty? + debug('Chain is empty') + return message + end + + execute_chain(chain, event) + + # Return the message so it doesn't get parsed again during the rest of the dispatch handling + message + end + + # Check whether a message should trigger command execution, and if it does, return the raw chain + def trigger?(message) + if @prefix.is_a? String + standard_prefix_trigger(message.content, @prefix) + elsif @prefix.is_a? Array + @prefix.map { |e| standard_prefix_trigger(message.content, e) }.reduce { |m, e| m || e } + elsif @prefix.respond_to? :call + @prefix.call(message) + end + end + + def standard_prefix_trigger(message, prefix) + return nil unless message.start_with? prefix + + message[prefix.length..-1] + end + + def required_permissions?(member, required, channel = nil) + required.reduce(true) do |a, action| + a && !member.webhook? && !member.is_a?(Discordrb::Recipient) && member.permission?(action, channel) + end + end + + def required_roles?(member, required) + return true if member.webhook? || member.is_a?(Discordrb::Recipient) || required.nil? || required.empty? + + required.is_a?(Array) ? check_multiple_roles(member, required) : member.role?(role) + end + + def allowed_roles?(member, required) + return true if member.webhook? || member.is_a?(Discordrb::Recipient) || required.nil? || required.empty? + + required.is_a?(Array) ? check_multiple_roles(member, required, false) : member.role?(role) + end + + def check_multiple_roles(member, required, all_roles = true) + if all_roles + required.all? do |role| + member.role?(role) + end + else + required.any? do |role| + member.role?(role) + end + end + end + + def channels?(channel, channels) + return true if channels.nil? || channels.empty? + + channels.any? do |c| + # if c is string, make sure to remove the "#" from channel names in case it was specified + return true if c.is_a?(String) && c.delete('#') == channel.name + + c.resolve_id == channel.resolve_id + end + end + + def execute_chain(chain, event) + t = Thread.new do + @event_threads << t + Thread.current[:discordrb_name] = "ct-#{@current_thread += 1}" + begin + debug("Parsing command chain #{chain}") + result = @attributes[:advanced_functionality] ? CommandChain.new(chain, self).execute(event) : simple_execute(chain, event) + result = event.drain_into(result) + + if event.file + event.send_file(event.file, caption: result) + else + event.respond result unless result.nil? || result.empty? + end + rescue StandardError => e + log_exception(e) + ensure + @event_threads.delete(t) + end + end + end + + # Turns the object into a string, using to_s by default + def stringify(object) + return '' if object.is_a? Discordrb::Message + + object.to_s + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/container.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/container.rb new file mode 100644 index 0000000..0c2b069 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/container.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +require 'discordrb/container' +require 'discordrb/commands/rate_limiter' + +module Discordrb::Commands + # This module holds a collection of commands that can be easily added to by calling the {CommandContainer#command} + # function. Other containers can be included into it as well. This allows for modularization of command bots. + module CommandContainer + include RateLimiter + + # @return [Hash] hash of command names and commands this container has. + attr_reader :commands + + # Adds a new command to the container. + # @param name [Symbol] The name of the command to add. + # @param attributes [Hash] The attributes to initialize the command with. + # @option attributes [Array] :aliases A list of additional names for this command. This in effect + # creates {CommandAlias} objects in the container ({#commands}) that refer to the newly created command. + # Additionally, the default help command will identify these command names as an alias where applicable. + # @option attributes [Integer] :permission_level The minimum permission level that can use this command, inclusive. + # See {CommandBot#set_user_permission} and {CommandBot#set_role_permission}. + # @option attributes [String, false] :permission_message Message to display when a user does not have sufficient + # permissions to execute a command. %name% in the message will be replaced with the name of the command. Disable + # the message by setting this option to false. + # @option attributes [Array] :required_permissions Discord action permissions (e.g. `:kick_members`) that + # should be required to use this command. See {Discordrb::Permissions::FLAGS} for a list. + # @option attributes [Array, Array] :required_roles Roles, or their IDs, that user must have to use this command + # (user must have all of them). + # @option attributes [Array, Array] :allowed_roles Roles, or their IDs, that user should have to use this command + # (user should have at least one of them). + # @option attributes [Array] :channels The channels that this command can be used on. An + # empty array indicates it can be used on any channel. Supersedes the command bot attribute. + # @option attributes [true, false] :chain_usable Whether this command is able to be used inside of a command chain + # or sub-chain. Typically used for administrative commands that shouldn't be done carelessly. + # @option attributes [true, false] :help_available Whether this command is visible in the help command. See the + # :help_command attribute of {CommandBot#initialize}. + # @option attributes [String] :description A short description of what this command does. Will be shown in the help + # command if the user asks for it. + # @option attributes [String] :usage A short description of how this command should be used. Will be displayed in + # the help command or if the user uses it wrong. + # @option attributes [Array] :arg_types An array of argument classes which will be used for type-checking. + # Hard-coded for some native classes, but can be used with any class that implements static + # method `from_argument`. + # @option attributes [Integer] :min_args The minimum number of arguments this command should have. If a user + # attempts to call the command with fewer arguments, the usage information will be displayed, if it exists. + # @option attributes [Integer] :max_args The maximum number of arguments the command should have. + # @option attributes [String] :rate_limit_message The message that should be displayed if the command hits a rate + # limit. None if unspecified or nil. %time% in the message will be replaced with the time in seconds when the + # command will be available again. + # @option attributes [Symbol] :bucket The rate limit bucket that should be used for rate limiting. No rate limiting + # will be done if unspecified or nil. + # @option attributes [String, #call] :rescue A string to respond with, or a block to be called in the event an exception + # is raised internally. If given a String, `%exception%` will be substituted with the exception's `#message`. If given + # a `Proc`, it will be passed the `CommandEvent` along with the `Exception`. + # @yield The block is executed when the command is executed. + # @yieldparam event [CommandEvent] The event of the message that contained the command. + # @note `LocalJumpError`s are rescued from internally, giving bots the opportunity to use `return` or `break` in + # their blocks without propagating an exception. + # @return [Command] The command that was added. + def command(name, attributes = {}, &block) + @commands ||= {} + + # TODO: Remove in 4.0 + if name.is_a?(Array) + name, *aliases = name + attributes[:aliases] = aliases if attributes[:aliases].nil? + Discordrb::LOGGER.warn("While registering command #{name.inspect}") + Discordrb::LOGGER.warn('Arrays for command aliases is removed. Please use `aliases` argument instead.') + end + + new_command = Command.new(name, attributes, &block) + new_command.attributes[:aliases].each do |aliased_name| + @commands[aliased_name] = CommandAlias.new(aliased_name, new_command) + end + @commands[name] = new_command + end + + # Removes a specific command from this container. + # @param name [Symbol] The command to remove. + def remove_command(name) + @commands ||= {} + @commands.delete name + end + + # Adds all commands from another container into this one. Existing commands will be overwritten. + # @param container [Module] A module that `extend`s {CommandContainer} from which the commands will be added. + def include_commands(container) + handlers = container.instance_variable_get '@commands' + return unless handlers + + @commands ||= {} + @commands.merge! handlers + end + + # Includes another container into this one. + # @param container [Module] An EventContainer or CommandContainer that will be included if it can. + def include!(container) + container_modules = container.singleton_class.included_modules + + # If the container is an EventContainer and we can include it, then do that + include_events(container) if container_modules.include?(Discordrb::EventContainer) && respond_to?(:include_events) + + if container_modules.include? Discordrb::Commands::CommandContainer + include_commands(container) + include_buckets(container) + elsif !container_modules.include? Discordrb::EventContainer + raise "Could not include! this particular container - ancestors: #{container_modules}" + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/events.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/events.rb new file mode 100644 index 0000000..d4900d2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/events.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'discordrb/events/message' + +module Discordrb::Commands + # Extension of MessageEvent for commands that contains the command called and makes the bot readable + class CommandEvent < Discordrb::Events::MessageEvent + attr_reader :bot + attr_accessor :command + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/parser.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/parser.rb new file mode 100644 index 0000000..6d072d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/parser.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +module Discordrb::Commands + # Command that can be called in a chain + class Command + # @return [Hash] the attributes the command was initialized with + attr_reader :attributes + + # @return [Symbol] the name of this command + attr_reader :name + + # @!visibility private + def initialize(name, attributes = {}, &block) + @name = name + @attributes = { + # The lowest permission level that can use the command + permission_level: attributes[:permission_level] || 0, + + # Message to display when a user does not have sufficient permissions to execute a command + permission_message: attributes[:permission_message].is_a?(FalseClass) ? nil : (attributes[:permission_message] || "You don't have permission to execute command %name%!"), + + # Discord action permissions required to use this command + required_permissions: attributes[:required_permissions] || [], + + # Roles required to use this command (all? comparison) + required_roles: attributes[:required_roles] || [], + + # Roles allowed to use this command (any? comparison) + allowed_roles: attributes[:allowed_roles] || [], + + # Channels this command can be used on + channels: attributes[:channels] || nil, + + # Whether this command is usable in a command chain + chain_usable: attributes[:chain_usable].nil? ? true : attributes[:chain_usable], + + # Whether this command should show up in the help command + help_available: attributes[:help_available].nil? ? true : attributes[:help_available], + + # Description (for help command) + description: attributes[:description] || nil, + + # Usage description (for help command and error messages) + usage: attributes[:usage] || nil, + + # Array of arguments (for type-checking) + arg_types: attributes[:arg_types] || nil, + + # Parameter list (for help command and error messages) + parameters: attributes[:parameters] || nil, + + # Minimum number of arguments + min_args: attributes[:min_args] || 0, + + # Maximum number of arguments (-1 for no limit) + max_args: attributes[:max_args] || -1, + + # Message to display upon rate limiting (%time% in the message for the remaining time until the next possible + # request, nil for no message) + rate_limit_message: attributes[:rate_limit_message], + + # Rate limiting bucket (nil for no rate limiting) + bucket: attributes[:bucket], + + # Block for handling internal exceptions, or a string to respond with + rescue: attributes[:rescue], + + # A list of aliases that reference this command + aliases: attributes[:aliases] || [] + } + + @block = block + end + + # Calls this command and executes the code inside. + # @param event [CommandEvent] The event to call the command with. + # @param arguments [Array] The attributes for the command. + # @param chained [true, false] Whether or not this command is part of a command chain. + # @param check_permissions [true, false] Whether the user's permission to execute the command (i.e. rate limits) + # should be checked. + # @return [String] the result of the execution. + def call(event, arguments, chained = false, check_permissions = true) + if arguments.length < @attributes[:min_args] + response = "Too few arguments for command `#{name}`!" + response += "\nUsage: `#{@attributes[:usage]}`" if @attributes[:usage] + event.respond(response) + return + end + if @attributes[:max_args] >= 0 && arguments.length > @attributes[:max_args] + response = "Too many arguments for command `#{name}`!" + response += "\nUsage: `#{@attributes[:usage]}`" if @attributes[:usage] + event.respond(response) + return + end + unless @attributes[:chain_usable] && !chained + event.respond "Command `#{name}` cannot be used in a command chain!" + return + end + + if check_permissions + rate_limited = event.bot.rate_limited?(@attributes[:bucket], event.author) + if @attributes[:bucket] && rate_limited + event.respond @attributes[:rate_limit_message].gsub('%time%', rate_limited.round(2).to_s) if @attributes[:rate_limit_message] + return + end + end + + result = @block.call(event, *arguments) + event.drain_into(result) + rescue LocalJumpError => e # occurs when breaking + result = e.exit_value + event.drain_into(result) + rescue StandardError => e # Something went wrong inside our @block! + rescue_value = @attributes[:rescue] || event.bot.attributes[:rescue] + if rescue_value + event.respond(rescue_value.gsub('%exception%', e.message)) if rescue_value.is_a?(String) + rescue_value.call(event, e) if rescue_value.respond_to?(:call) + end + + raise e + end + end + + # A command that references another command + class CommandAlias + # @return [Symbol] the name of this alias + attr_reader :name + + # @return [Command] the command this alias points to + attr_reader :aliased_command + + def initialize(name, aliased_command) + @name = name + @aliased_command = aliased_command + end + end + + # Command chain, may have multiple commands, nested and commands + class CommandChain + # @param chain [String] The string the chain should be parsed from. + # @param bot [CommandBot] The bot that executes this command chain. + # @param subchain [true, false] Whether this chain is a sub chain of another chain. + def initialize(chain, bot, subchain = false) + @attributes = bot.attributes + @chain = chain + @bot = bot + @subchain = subchain + end + + # Parses the command chain itself, including sub-chains, and executes it. Executes only the command chain, without + # its chain arguments. + # @param event [CommandEvent] The event to execute the chain with. + # @return [String] the result of the execution. + def execute_bare(event) + b_start = -1 + b_level = 0 + result = '' + quoted = false + escaped = false + hacky_delim, hacky_space, hacky_prev, hacky_newline = [0xe001, 0xe002, 0xe003, 0xe004].pack('U*').chars + + @chain.each_char.each_with_index do |char, index| + # Escape character + if char == '\\' && !escaped + escaped = true + next + elsif escaped && b_level <= 0 + result += char + escaped = false + next + end + + if quoted + # Quote end + if char == @attributes[:quote_end] + quoted = false + next + end + + if b_level <= 0 + case char + when @attributes[:chain_delimiter] + result += hacky_delim + next + when @attributes[:previous] + result += hacky_prev + next + when ' ' + result += hacky_space + next + when "\n" + result += hacky_newline + next + end + end + else + case char + when @attributes[:quote_start] # Quote begin + quoted = true + next + when @attributes[:sub_chain_start] + b_start = index if b_level.zero? + b_level += 1 + end + end + + result += char if b_level <= 0 + + next unless char == @attributes[:sub_chain_end] && !quoted + + b_level -= 1 + next unless b_level.zero? + + nested = @chain[b_start + 1..index - 1] + subchain = CommandChain.new(nested, @bot, true) + result += subchain.execute(event) + end + + event.respond("Your subchains are mismatched! Make sure you don't have any extra #{@attributes[:sub_chain_start]}'s or #{@attributes[:sub_chain_end]}'s") unless b_level.zero? + + @chain = result + + @chain_args, @chain = divide_chain(@chain) + + prev = '' + + chain_to_split = @chain + + # Don't break if a command is called the same thing as the chain delimiter + chain_to_split = chain_to_split.slice(1..-1) if !@attributes[:chain_delimiter].empty? && chain_to_split.start_with?(@attributes[:chain_delimiter]) + + first = true + split_chain = if @attributes[:chain_delimiter].empty? + [chain_to_split] + else + chain_to_split.split(@attributes[:chain_delimiter]) + end + split_chain.each do |command| + command = @attributes[:chain_delimiter] + command if first && @chain.start_with?(@attributes[:chain_delimiter]) + first = false + + command = command.strip + + # Replace the hacky delimiter that was used inside quotes with actual delimiters + command = command.gsub hacky_delim, @attributes[:chain_delimiter] + + first_space = command.index ' ' + command_name = first_space ? command[0..first_space - 1] : command + arguments = first_space ? command[first_space + 1..-1] : '' + + # Append a previous sign if none is present + arguments += @attributes[:previous] unless arguments.include? @attributes[:previous] + arguments = arguments.gsub @attributes[:previous], prev + + # Replace hacky previous signs with actual ones + arguments = arguments.gsub hacky_prev, @attributes[:previous] + + arguments = arguments.split ' ' + + # Replace the hacky spaces/newlines with actual ones + arguments.map! do |elem| + elem.gsub(hacky_space, ' ').gsub(hacky_newline, "\n") + end + + # Finally execute the command + prev = @bot.execute_command(command_name.to_sym, event, arguments, split_chain.length > 1 || @subchain) + + # Stop chain if execute_command failed (maybe the command doesn't exist, or permissions failed, etc.) + break unless prev + end + + prev + end + + # Divides the command chain into chain arguments and command chain, then executes them both. + # @param event [CommandEvent] The event to execute the command with. + # @return [String] the result of the command chain execution. + def execute(event) + old_chain = @chain + @bot.debug 'Executing bare chain' + result = execute_bare(event) + + @chain_args ||= [] + + @bot.debug "Found chain args #{@chain_args}, preliminary result #{result}" + + @chain_args.each do |arg| + case arg.first + when 'repeat' + new_result = '' + executed_chain = divide_chain(old_chain).last + + arg[1].to_i.times do + chain_result = CommandChain.new(executed_chain, @bot).execute(event) + new_result += chain_result if chain_result + end + + result = new_result + # TODO: more chain arguments + end + end + + result + end + + private + + def divide_chain(chain) + chain_args_index = chain.index(@attributes[:chain_args_delim]) unless @attributes[:chain_args_delim].empty? + chain_args = [] + + if chain_args_index + chain_args = chain[0..chain_args_index].split ',' + + # Split up the arguments + + chain_args.map! do |arg| + arg.split ' ' + end + + chain = chain[chain_args_index + 1..-1] + end + + [chain_args, chain] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/rate_limiter.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/rate_limiter.rb new file mode 100644 index 0000000..ffdd83c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/commands/rate_limiter.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Discordrb::Commands + # This class represents a bucket for rate limiting - it keeps track of how many requests have been made and when + # exactly the user should be rate limited. + class Bucket + # Makes a new bucket + # @param limit [Integer, nil] How many requests the user may perform in the given time_span, or nil if there should be no limit. + # @param time_span [Integer, nil] The time span after which the request count is reset, in seconds, or nil if the bucket should never be reset. (If this is nil, limit should be nil too) + # @param delay [Integer, nil] The delay for which the user has to wait after performing a request, in seconds, or nil if the user shouldn't have to wait. + def initialize(limit, time_span, delay) + raise ArgumentError, '`limit` and `time_span` have to either both be set or both be nil!' if !limit != !time_span + + @limit = limit + @time_span = time_span + @delay = delay + + @bucket = {} + end + + # Cleans the bucket, removing all elements that aren't necessary anymore + # @param rate_limit_time [Time] The time to base the cleaning on, only useful for testing. + def clean(rate_limit_time = nil) + rate_limit_time ||= Time.now + + @bucket.delete_if do |_, limit_hash| + # Time limit has not run out + return false if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span) + + # Delay has not run out + return false if @delay && rate_limit_time < (limit_hash[:last_time] + @delay) + + true + end + end + + # Performs a rate limiting request + # @param thing [String, Integer, Symbol] The particular thing that should be rate-limited (usually a user/channel, but you can also choose arbitrary integers or symbols) + # @param rate_limit_time [Time] The time to base the rate limiting on, only useful for testing. + # @param increment [Integer] How much to increment the rate-limit counter. Default is 1. + # @return [Integer, false] the waiting time until the next request, in seconds, or false if the request succeeded + def rate_limited?(thing, rate_limit_time = nil, increment: 1) + key = resolve_key thing + limit_hash = @bucket[key] + + # First case: limit_hash doesn't exist yet + unless limit_hash + @bucket[key] = { + last_time: Time.now, + set_time: Time.now, + count: increment + } + + return false + end + + # Define the time at which we're being rate limited once so it doesn't get inaccurate + rate_limit_time ||= Time.now + + if @limit && (limit_hash[:count] + increment) > @limit + # Second case: Count is over the limit and the time has not run out yet + return (limit_hash[:set_time] + @time_span) - rate_limit_time if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span) + + # Third case: Count is over the limit but the time has run out + # Don't return anything here because there may still be delay-based limiting + limit_hash[:set_time] = rate_limit_time + limit_hash[:count] = 0 + end + + if @delay && rate_limit_time < (limit_hash[:last_time] + @delay) + # Fourth case: we're being delayed + (limit_hash[:last_time] + @delay) - rate_limit_time + else + # Fifth case: no rate limiting at all! Increment the count, set the last_time, and return false + limit_hash[:last_time] = rate_limit_time + limit_hash[:count] += increment + false + end + end + + private + + def resolve_key(thing) + return thing.resolve_id if thing.respond_to?(:resolve_id) && !thing.is_a?(String) + return thing if thing.is_a?(Integer) || thing.is_a?(Symbol) + + raise ArgumentError, "Cannot use a #{thing.class} as a rate limiting key!" + end + end + + # Represents a collection of {Bucket}s. + module RateLimiter + # Defines a new bucket for this rate limiter. + # @param key [Symbol] The name for this new bucket. + # @param attributes [Hash] The attributes to initialize the bucket with. + # @option attributes [Integer] :limit The limit of requests to perform in the given time span. + # @option attributes [Integer] :time_span How many seconds until the limit should be reset. + # @option attributes [Integer] :delay How many seconds the user has to wait after each request. + # @see Bucket#initialize + # @return [Bucket] the created bucket. + def bucket(key, attributes) + @buckets ||= {} + @buckets[key] = Bucket.new(attributes[:limit], attributes[:time_span], attributes[:delay]) + end + + # Performs a rate limit request. + # @param key [Symbol] Which bucket to perform the request for. + # @param thing [String, Integer, Symbol] What should be rate-limited. + # @param increment (see Bucket#rate_limited?) + # @see Bucket#rate_limited? + # @return [Integer, false] How much time to wait or false if the request succeeded. + def rate_limited?(key, thing, increment: 1) + # Check whether the bucket actually exists + return false unless @buckets && @buckets[key] + + @buckets[key].rate_limited?(thing, increment: increment) + end + + # Cleans all buckets + # @see Bucket#clean + def clean + @buckets.each(&:clean) + end + + # Adds all the buckets from another RateLimiter onto this one. + # @param limiter [Module] Another {RateLimiter} module + def include_buckets(limiter) + buckets = limiter.instance_variable_get('@buckets') || {} + @buckets ||= {} + @buckets.merge! buckets + end + end + + # This class provides a convenient way to do rate-limiting on non-command events. + # @see RateLimiter + class SimpleRateLimiter + include RateLimiter + + # Makes a new rate limiter + def initialize + @buckets = {} + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/container.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/container.rb new file mode 100644 index 0000000..c060e19 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/container.rb @@ -0,0 +1,626 @@ +# frozen_string_literal: true + +require 'discordrb/events/message' +require 'discordrb/events/typing' +require 'discordrb/events/lifetime' +require 'discordrb/events/presence' +require 'discordrb/events/voice_state_update' +require 'discordrb/events/voice_server_update' +require 'discordrb/events/channels' +require 'discordrb/events/members' +require 'discordrb/events/roles' +require 'discordrb/events/guilds' +require 'discordrb/events/await' +require 'discordrb/events/bans' +require 'discordrb/events/reactions' + +require 'discordrb/await' + +module Discordrb + # This module provides the functionality required for events and awaits. It is separated + # from the {Bot} class so users can make their own container modules and include them. + module EventContainer + # This **event** is raised when a message is sent to a text channel the bot is currently in. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Regexp] :start_with Matches the string the message starts with. + # @option attributes [String, Regexp] :end_with Matches the string the message ends with. + # @option attributes [String, Regexp] :contains Matches a string the message contains. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was sent in. + # @option attributes [String, Integer, User] :from Matches the user that sent the message. + # @option attributes [String] :content Exactly matches the entire content of the message. + # @option attributes [Time] :after Matches a time after the time the message was sent at. + # @option attributes [Time] :before Matches a time before the time the message was sent at. + # @option attributes [Boolean] :private Matches whether or not the channel is private. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageEvent] The event that was raised. + # @return [MessageEventHandler] the event handler that was registered. + def message(attributes = {}, &block) + register_event(MessageEvent, attributes, block) + end + + # This **event** is raised when the READY packet is received, i.e. servers and channels have finished + # initialization. It's the recommended way to do things when the bot has finished starting up. + # @param attributes [Hash] Event attributes, none in this particular case + # @yield The block is executed when the event is raised. + # @yieldparam event [ReadyEvent] The event that was raised. + # @return [ReadyEventHandler] the event handler that was registered. + def ready(attributes = {}, &block) + register_event(ReadyEvent, attributes, block) + end + + # This **event** is raised when the bot has disconnected from the WebSocket, due to the {Bot#stop} method or + # external causes. It's the recommended way to do clean-up tasks. + # @param attributes [Hash] Event attributes, none in this particular case + # @yield The block is executed when the event is raised. + # @yieldparam event [DisconnectEvent] The event that was raised. + # @return [DisconnectEventHandler] the event handler that was registered. + def disconnected(attributes = {}, &block) + register_event(DisconnectEvent, attributes, block) + end + + # This **event** is raised every time the bot sends a heartbeat over the galaxy. This happens roughly every 40 + # seconds, but may happen at a lower rate should Discord change their interval. It may also happen more quickly for + # periods of time, especially for unstable connections, since discordrb rather sends a heartbeat than not if there's + # a choice. (You shouldn't rely on all this to be accurately timed.) + # + # All this makes this event useful to periodically trigger something, like doing some API request every hour, + # setting some kind of uptime variable or whatever else. The only limit is yourself. + # @param attributes [Hash] Event attributes, none in this particular case + # @yield The block is executed when the event is raised. + # @yieldparam event [HeartbeatEvent] The event that was raised. + # @return [HeartbeatEventHandler] the event handler that was registered. + def heartbeat(attributes = {}, &block) + register_event(HeartbeatEvent, attributes, block) + end + + # This **event** is raised when somebody starts typing in a channel the bot is also in. The official Discord + # client would display the typing indicator for five seconds after receiving this event. If the user continues + # typing after five seconds, the event will be re-raised. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Channel] :in Matches the channel where typing was started. + # @option attributes [String, Integer, User] :from Matches the user that started typing. + # @option attributes [Time] :after Matches a time after the time the typing started. + # @option attributes [Time] :before Matches a time before the time the typing started. + # @yield The block is executed when the event is raised. + # @yieldparam event [TypingEvent] The event that was raised. + # @return [TypingEventHandler] the event handler that was registered. + def typing(attributes = {}, &block) + register_event(TypingEvent, attributes, block) + end + + # This **event** is raised when a message is edited in a channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :id Matches the ID of the message that was edited. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was edited in. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageEditEvent] The event that was raised. + # @return [MessageEditEventHandler] the event handler that was registered. + def message_edit(attributes = {}, &block) + register_event(MessageEditEvent, attributes, block) + end + + # This **event** is raised when a message is deleted in a channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :id Matches the ID of the message that was deleted. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was deleted in. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageDeleteEvent] The event that was raised. + # @return [MessageDeleteEventHandler] the event handler that was registered. + def message_delete(attributes = {}, &block) + register_event(MessageDeleteEvent, attributes, block) + end + + # This **event** is raised whenever a message is updated. Message updates can be triggered from + # a user editing their own message, or from Discord automatically attaching embeds to the + # user's message for URLs contained in the message's content. If you only want to listen + # for users editing their own messages, use the {message_edit} handler instead. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :id Matches the ID of the message that was updated. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was updated in. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageUpdateEvent] The event that was raised. + # @return [MessageUpdateEventHandler] the event handler that was registered. + def message_update(attributes = {}, &block) + register_event(MessageUpdateEvent, attributes, block) + end + + # This **event** is raised when somebody reacts to a message. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :emoji Matches the ID of the emoji that was reacted with, or its name. + # @option attributes [String, Integer, User] :from Matches the user who added the reaction. + # @option attributes [String, Integer, Message] :message Matches the message to which the reaction was added. + # @option attributes [String, Integer, Channel] :in Matches the channel the reaction was added in. + # @yield The block is executed when the event is raised. + # @yieldparam event [ReactionAddEvent] The event that was raised. + # @return [ReactionAddEventHandler] The event handler that was registered. + def reaction_add(attributes = {}, &block) + register_event(ReactionAddEvent, attributes, block) + end + + # This **event** is raised when somebody removes a reaction from a message. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :emoji Matches the ID of the emoji that was removed from the reactions, or + # its name. + # @option attributes [String, Integer, User] :from Matches the user who removed the reaction. + # @option attributes [String, Integer, Message] :message Matches the message to which the reaction was removed. + # @option attributes [String, Integer, Channel] :in Matches the channel the reaction was removed in. + # @yield The block is executed when the event is raised. + # @yieldparam event [ReactionRemoveEvent] The event that was raised. + # @return [ReactionRemoveEventHandler] The event handler that was registered. + def reaction_remove(attributes = {}, &block) + register_event(ReactionRemoveEvent, attributes, block) + end + + # This **event** is raised when somebody removes all reactions from a message. + # @param attributes [Hash] The event's attributes. + # @option attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Message] :message Matches the message to which the reactions were removed. + # @option attributes [String, Integer, Channel] :in Matches the channel the reactions were removed in. + # @yield The block is executed when the event is raised. + # @yieldparam event [ReactionRemoveAllEvent] The event that was raised. + # @return [ReactionRemoveAllEventHandler] The event handler that was registered. + def reaction_remove_all(attributes = {}, &block) + register_event(ReactionRemoveAllEvent, attributes, block) + end + + # This **event** is raised when a user's status (online/offline/idle) changes. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :from Matches the user whose status changed. + # @option attributes [:offline, :idle, :online] :status Matches the status the user has now. + # @option attributes [Hash] :client_status Matches the current online status (`:online`, `:idle` or `:dnd`) of the user + # on various device types (`:desktop`, `:mobile`, or `:web`). The value will be `nil` when the user is offline or invisible + # @yield The block is executed when the event is raised. + # @yieldparam event [PresenceEvent] The event that was raised. + # @return [PresenceEventHandler] the event handler that was registered. + def presence(attributes = {}, &block) + register_event(PresenceEvent, attributes, block) + end + + # This **event** is raised when the game a user is playing changes. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :from Matches the user whose playing game changes. + # @option attributes [String] :game Matches the game the user is now playing. + # @option attributes [Integer] :type Matches the type of game object (0 game, 1 Twitch stream) + # @yield The block is executed when the event is raised. + # @yieldparam event [PlayingEvent] The event that was raised. + # @return [PlayingEventHandler] the event handler that was registered. + def playing(attributes = {}, &block) + register_event(PlayingEvent, attributes, block) + end + + # This **event** is raised when the bot is mentioned in a message. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Regexp] :start_with Matches the string the message starts with. + # @option attributes [String, Regexp] :end_with Matches the string the message ends with. + # @option attributes [String, Regexp] :contains Matches a string the message contains. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was sent in. + # @option attributes [String, Integer, User] :from Matches the user that sent the message. + # @option attributes [String] :content Exactly matches the entire content of the message. + # @option attributes [Time] :after Matches a time after the time the message was sent at. + # @option attributes [Time] :before Matches a time before the time the message was sent at. + # @option attributes [Boolean] :private Matches whether or not the channel is private. + # @yield The block is executed when the event is raised. + # @yieldparam event [MentionEvent] The event that was raised. + # @return [MentionEventHandler] the event handler that was registered. + def mention(attributes = {}, &block) + register_event(MentionEvent, attributes, block) + end + + # This **event** is raised when a channel is created. + # @param attributes [Hash] The event's attributes. + # @option attributes [Integer] :type Matches the type of channel that is being created (0: text, 1: private, 2: voice, 3: group) + # @option attributes [String] :name Matches the name of the created channel. + # @yield The block is executed when the event is raised. + # @yieldparam event [ChannelCreateEvent] The event that was raised. + # @return [ChannelCreateEventHandler] the event handler that was registered. + def channel_create(attributes = {}, &block) + register_event(ChannelCreateEvent, attributes, block) + end + + # This **event** is raised when a channel is updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [Integer] :type Matches the type of channel that is being updated (0: text, 1: private, 2: voice, 3: group). + # @option attributes [String] :name Matches the new name of the channel. + # @yield The block is executed when the event is raised. + # @yieldparam event [ChannelUpdateEvent] The event that was raised. + # @return [ChannelUpdateEventHandler] the event handler that was registered. + def channel_update(attributes = {}, &block) + register_event(ChannelUpdateEvent, attributes, block) + end + + # This **event** is raised when a channel is deleted. + # @param attributes [Hash] The event's attributes. + # @option attributes [Integer] :type Matches the type of channel that is being deleted (0: text, 1: private, 2: voice, 3: group). + # @option attributes [String] :name Matches the name of the deleted channel. + # @yield The block is executed when the event is raised. + # @yieldparam event [ChannelDeleteEvent] The event that was raised. + # @return [ChannelDeleteEventHandler] the event handler that was registered. + def channel_delete(attributes = {}, &block) + register_event(ChannelDeleteEvent, attributes, block) + end + + # This **event** is raised when a recipient is added to a group channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :name Matches the name of the group channel that the recipient is added to. + # @option attributes [String, Integer] :owner_id Matches the ID of the group channel's owner. + # @option attributes [String, Integer] :id Matches the ID of the recipient added to the group channel. + # @yield The block is executed when the event is raised. + # @yieldparam event [ChannelRecipientAddEvent] The event that was raised. + # @return [ChannelRecipientAddHandler] the event handler that was registered. + def channel_recipient_add(attributes = {}, &block) + register_event(ChannelRecipientAddEvent, attributes, block) + end + + # This **event** is raised when a recipient is removed from a group channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :name Matches the name of the group channel that the recipient is added to. + # @option attributes [String, Integer] :owner_id Matches the ID of the group channel's owner. + # @option attributes [String, Integer] :id Matches the ID of the recipient removed from the group channel. + # @yield The block is executed when the event is raised. + # @yieldparam event [ChannelRecipientRemoveEvent] The event that was raised. + # @return [ChannelRecipientRemoveHandler] the event handler that was registered. + def channel_recipient_remove(attributes = {}, &block) + register_event(ChannelRecipientRemoveEvent, attributes, block) + end + + # This **event** is raised when a user's voice state changes. This includes when a user joins, leaves, or + # moves between voice channels, as well as their mute and deaf status for themselves and on the server. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :from Matches the user that sent the message. + # @option attributes [String, Integer, Channel] :channel Matches the voice channel the user has joined. + # @option attributes [String, Integer, Channel] :old_channel Matches the voice channel the user was in previously. + # @option attributes [true, false] :mute Matches whether or not the user is muted server-wide. + # @option attributes [true, false] :deaf Matches whether or not the user is deafened server-wide. + # @option attributes [true, false] :self_mute Matches whether or not the user is muted by the bot. + # @option attributes [true, false] :self_deaf Matches whether or not the user is deafened by the bot. + # @yield The block is executed when the event is raised. + # @yieldparam event [VoiceStateUpdateEvent] The event that was raised. + # @return [VoiceStateUpdateEventHandler] the event handler that was registered. + def voice_state_update(attributes = {}, &block) + register_event(VoiceStateUpdateEvent, attributes, block) + end + + # This **event** is raised when first connecting to a server's voice channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :from Matches the server that the update is for. + # @yield The block is executed when the event is raised. + # @yieldparam event [VoiceServerUpdateEvent] The event that was raised. + # @return [VoiceServerUpdateEventHandler] The event handler that was registered. + def voice_server_update(attributes = {}, &block) + register_event(VoiceServerUpdateEvent, attributes, block) + end + + # This **event** is raised when a new user joins a server. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :username Matches the username of the joined user. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerMemberAddEvent] The event that was raised. + # @return [ServerMemberAddEventHandler] the event handler that was registered. + def member_join(attributes = {}, &block) + register_event(ServerMemberAddEvent, attributes, block) + end + + # This **event** is raised when a member update happens. This includes when a members nickname + # or roles are updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :username Matches the username of the updated user. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerMemberUpdateEvent] The event that was raised. + # @return [ServerMemberUpdateEventHandler] the event handler that was registered. + def member_update(attributes = {}, &block) + register_event(ServerMemberUpdateEvent, attributes, block) + end + + # This **event** is raised when a member leaves a server. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :username Matches the username of the member. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerMemberDeleteEvent] The event that was raised. + # @return [ServerMemberDeleteEventHandler] the event handler that was registered. + def member_leave(attributes = {}, &block) + register_event(ServerMemberDeleteEvent, attributes, block) + end + + # This **event** is raised when a user is banned from a server. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :user Matches the user that was banned. + # @option attributes [String, Integer, Server] :server Matches the server from which the user was banned. + # @yield The block is executed when the event is raised. + # @yieldparam event [UserBanEvent] The event that was raised. + # @return [UserBanEventHandler] the event handler that was registered. + def user_ban(attributes = {}, &block) + register_event(UserBanEvent, attributes, block) + end + + # This **event** is raised when a user is unbanned from a server. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :user Matches the user that was unbanned. + # @option attributes [String, Integer, Server] :server Matches the server from which the user was unbanned. + # @yield The block is executed when the event is raised. + # @yieldparam event [UserUnbanEvent] The event that was raised. + # @return [UserUnbanEventHandler] the event handler that was registered. + def user_unban(attributes = {}, &block) + register_event(UserUnbanEvent, attributes, block) + end + + # This **event** is raised when a server is created respective to the bot, i.e. the bot joins a server or creates + # a new one itself. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server that was created. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerCreateEvent] The event that was raised. + # @return [ServerCreateEventHandler] the event handler that was registered. + def server_create(attributes = {}, &block) + register_event(ServerCreateEvent, attributes, block) + end + + # This **event** is raised when a server is updated, for example if the name or region has changed. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server that was updated. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerUpdateEvent] The event that was raised. + # @return [ServerUpdateEventHandler] the event handler that was registered. + def server_update(attributes = {}, &block) + register_event(ServerUpdateEvent, attributes, block) + end + + # This **event** is raised when a server is deleted, or when the bot leaves a server. (These two cases are identical + # to Discord.) + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server that was deleted. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerDeleteEvent] The event that was raised. + # @return [ServerDeleteEventHandler] the event handler that was registered. + def server_delete(attributes = {}, &block) + register_event(ServerDeleteEvent, attributes, block) + end + + # This **event** is raised when an emoji or collection of emojis is created/deleted/updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerEmojiChangeEvent] The event that was raised. + # @return [ServerEmojiChangeEventHandler] the event handler that was registered. + def server_emoji(attributes = {}, &block) + register_event(ServerEmojiChangeEvent, attributes, block) + end + + # This **event** is raised when an emoji is created. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server. + # @option attributes [String, Integer] :id Matches the ID of the emoji. + # @option attributes [String] :name Matches the name of the emoji. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerEmojiCreateEvent] The event that was raised. + # @return [ServerEmojiCreateEventHandler] the event handler that was registered. + def server_emoji_create(attributes = {}, &block) + register_event(ServerEmojiCreateEvent, attributes, block) + end + + # This **event** is raised when an emoji is deleted. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server. + # @option attributes [String, Integer] :id Matches the ID of the emoji. + # @option attributes [String] :name Matches the name of the emoji. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerEmojiDeleteEvent] The event that was raised. + # @return [ServerEmojiDeleteEventHandler] the event handler that was registered. + def server_emoji_delete(attributes = {}, &block) + register_event(ServerEmojiDeleteEvent, attributes, block) + end + + # This **event** is raised when an emoji is updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server. + # @option attributes [String, Integer] :id Matches the ID of the emoji. + # @option attributes [String] :name Matches the name of the emoji. + # @option attributes [String] :old_name Matches the name of the emoji before the update. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerEmojiUpdateEvent] The event that was raised. + # @return [ServerEmojiUpdateEventHandler] the event handler that was registered. + def server_emoji_update(attributes = {}, &block) + register_event(ServerEmojiUpdateEvent, attributes, block) + end + + # This **event** is raised when a role is created. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :name Matches the role name. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerRoleCreateEvent] The event that was raised. + # @return [ServerRoleCreateEventHandler] the event handler that was registered. + def server_role_create(attributes = {}, &block) + register_event(ServerRoleCreateEvent, attributes, block) + end + + # This **event** is raised when a role is deleted. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer] :id Matches the role ID. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerRoleDeleteEvent] The event that was raised. + # @return [ServerRoleDeleteEventHandler] the event handler that was registered. + def server_role_delete(attributes = {}, &block) + register_event(ServerRoleDeleteEvent, attributes, block) + end + + # This **event** is raised when a role is updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [String] :name Matches the role name. + # @yield The block is executed when the event is raised. + # @yieldparam event [ServerRoleUpdateEvent] The event that was raised. + # @return [ServerRoleUpdateEventHandler] the event handler that was registered. + def server_role_update(attributes = {}, &block) + register_event(ServerRoleUpdateEvent, attributes, block) + end + + # This **event** is raised when a webhook is updated. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Server] :server Matches the server by name, ID or instance. + # @option attributes [String, Integer, Channel] :channel Matches the channel by name, ID or instance. + # @option attribute [String, Integer, Webhook] :webhook Matches the webhook by name, ID or instance. + # @yield The block is executed when the event is raised. + # @yieldparam event [WebhookUpdateEvent] The event that was raised. + # @return [WebhookUpdateEventHandler] the event handler that was registered. + def webhook_update(attributes = {}, &block) + register_event(WebhookUpdateEvent, attributes, block) + end + + # This **event** is raised when an {Await} is triggered. It provides an easy way to execute code + # on an await without having to rely on the await's block. + # @param attributes [Hash] The event's attributes. + # @option attributes [Symbol] :key Exactly matches the await's key. + # @option attributes [Class] :type Exactly matches the event's type. + # @yield The block is executed when the event is raised. + # @yieldparam event [AwaitEvent] The event that was raised. + # @return [AwaitEventHandler] the event handler that was registered. + def await(attributes = {}, &block) + register_event(AwaitEvent, attributes, block) + end + + # This **event** is raised when a private message is sent to the bot. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Regexp] :start_with Matches the string the message starts with. + # @option attributes [String, Regexp] :end_with Matches the string the message ends with. + # @option attributes [String, Regexp] :contains Matches a string the message contains. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was sent in. + # @option attributes [String, Integer, User] :from Matches the user that sent the message. + # @option attributes [String] :content Exactly matches the entire content of the message. + # @option attributes [Time] :after Matches a time after the time the message was sent at. + # @option attributes [Time] :before Matches a time before the time the message was sent at. + # @option attributes [Boolean] :private Matches whether or not the channel is private. + # @yield The block is executed when the event is raised. + # @yieldparam event [PrivateMessageEvent] The event that was raised. + # @return [PrivateMessageEventHandler] the event handler that was registered. + def pm(attributes = {}, &block) + register_event(PrivateMessageEvent, attributes, block) + end + + alias_method :private_message, :pm + alias_method :direct_message, :pm + alias_method :dm, :pm + + # This **event** is raised when an invite is created. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, User] :inviter Matches the user that created the invite. + # @option attributes [String, Integer, Channel] :channel Matches the channel the invite was created for. + # @option attributes [String, Integer, Server] :server Matches the server the invite was created for. + # @option attributes [true, false] :temporary Matches whether the invite is temporary or not. + # @yield The block is executed when the event is raised. + # @yieldparam event [InviteCreateEvent] The event that was raised. + # @return [InviteCreateEventHandler] The event handler that was registered. + def invite_create(attributes = {}, &block) + register_event(InviteCreateEvent, attributes, block) + end + + # This **event** is raised when an invite is deleted. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Integer, Channel] :channel Matches the channel the deleted invite was for. + # @option attributes [String, Integer, Server] :server Matches the server the deleted invite was for. + # @yield The block is executed when the event is raised + # @yieldparam event [InviteDeleteEvent] The event that was raised. + # @return [InviteDeleteEventHandler] The event handler that was registered. + def invite_delete(attributes = {}, &block) + register_event(InviteDeleteEvent, attributes, block) + end + + # This **event** is raised for every dispatch received over the gateway, whether supported by discordrb or not. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Symbol, Regexp] :type Matches the event type of the dispatch. + # @yield The block is executed when the event is raised. + # @yieldparam event [RawEvent] The event that was raised. + # @return [RawEventHandler] The event handler that was registered. + def raw(attributes = {}, &block) + register_event(RawEvent, attributes, block) + end + + # This **event** is raised for a dispatch received over the gateway that is not currently handled otherwise by + # discordrb. + # @param attributes [Hash] The event's attributes. + # @option attributes [String, Symbol, Regexp] :type Matches the event type of the dispatch. + # @yield The block is executed when the event is raised. + # @yieldparam event [UnknownEvent] The event that was raised. + # @return [UnknownEventHandler] The event handler that was registered. + def unknown(attributes = {}, &block) + register_event(UnknownEvent, attributes, block) + end + + # Removes an event handler from this container. If you're looking for a way to do temporary events, I recommend + # {Await}s instead of this. + # @param handler [Discordrb::Events::EventHandler] The handler to remove. + def remove_handler(handler) + clazz = EventContainer.event_class(handler.class) + @event_handlers ||= {} + @event_handlers[clazz].delete(handler) + end + + # Removes all events from this event handler. + def clear! + @event_handlers&.clear + end + + # Adds an event handler to this container. Usually, it's more expressive to just use one of the shorthand adder + # methods like {#message}, but if you want to create one manually you can use this. + # @param handler [Discordrb::Events::EventHandler] The handler to add. + def add_handler(handler) + clazz = EventContainer.event_class(handler.class) + @event_handlers ||= {} + @event_handlers[clazz] ||= [] + @event_handlers[clazz] << handler + end + + # Adds all event handlers from another container into this one. Existing event handlers will be overwritten. + # @param container [Module] A module that `extend`s {EventContainer} from which the handlers will be added. + def include_events(container) + handlers = container.instance_variable_get '@event_handlers' + return unless handlers + + @event_handlers ||= {} + @event_handlers.merge!(handlers) { |_, old, new| old + new } + end + + alias_method :include!, :include_events + alias_method :<<, :add_handler + + # Returns the handler class for an event class type + # @see #event_class + # @param event_class [Class] The event type + # @return [Class] the handler type + def self.handler_class(event_class) + class_from_string("#{event_class}Handler") + end + + # Returns the event class for a handler class type + # @see #handler_class + # @param handler_class [Class] The handler type + # @return [Class, nil] the event type, or nil if the handler_class isn't a handler class (i.e. ends with Handler) + def self.event_class(handler_class) + class_name = handler_class.to_s + return nil unless class_name.end_with? 'Handler' + + EventContainer.class_from_string(class_name[0..-8]) + end + + # Utility method to return a class object from a string of its name. Mostly useful for internal stuff + # @param str [String] The name of the class + # @return [Class] the class + def self.class_from_string(str) + str.split('::').inject(Object) do |mod, class_name| + mod.const_get(class_name) + end + end + + private + + include Discordrb::Events + + def register_event(clazz, attributes, block) + handler = EventContainer.handler_class(clazz).new(attributes, block) + + @event_handlers ||= {} + @event_handlers[clazz] ||= [] + @event_handlers[clazz] << handler + + # Return the handler so it can be removed later + handler + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data.rb new file mode 100644 index 0000000..a4e3f2e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require 'discordrb/allowed_mentions' +require 'discordrb/permissions' +require 'discordrb/id_object' +require 'discordrb/colour_rgb' +require 'discordrb/errors' +require 'discordrb/api' +require 'discordrb/api/channel' +require 'discordrb/api/server' +require 'discordrb/api/invite' +require 'discordrb/api/user' +require 'discordrb/api/webhook' +require 'discordrb/webhooks/embeds' +require 'discordrb/paginator' +require 'time' +require 'base64' + +require 'discordrb/data/activity' +require 'discordrb/data/application' +require 'discordrb/data/user' +require 'discordrb/data/voice_state' +require 'discordrb/data/voice_region' +require 'discordrb/data/member' +require 'discordrb/data/recipient' +require 'discordrb/data/profile' +require 'discordrb/data/role' +require 'discordrb/data/invite' +require 'discordrb/data/overwrite' +require 'discordrb/data/channel' +require 'discordrb/data/embed' +require 'discordrb/data/attachment' +require 'discordrb/data/message' +require 'discordrb/data/reaction' +require 'discordrb/data/emoji' +require 'discordrb/data/integration' +require 'discordrb/data/server' +require 'discordrb/data/webhook' +require 'discordrb/data/audit_logs' diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/activity.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/activity.rb new file mode 100644 index 0000000..c665983 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/activity.rb @@ -0,0 +1,264 @@ +# frozen_string_literal: true + +module Discordrb + # Contains information about user activities such as the game they are playing, + # music they are listening to, or their live stream. + class Activity + # Values corresponding to the flags bitmask + FLAGS = { + instance: 1 << 0, # this activity is an instanced game session + join: 1 << 1, # this activity is joinable + spectate: 1 << 2, # this activity can be spectated + join_request: 1 << 3, # this activity allows asking to join + sync: 1 << 4, # this activity is a spotify track + play: 1 << 5 # this game can be played or opened from discord + }.freeze + + # @return [String] the activity's name + attr_reader :name + + # @return [Integer, nil] activity type. Can be {GAME}, {STREAMING}, {LISTENING}, {CUSTOM} + attr_reader :type + + # @return [String, nil] stream URL, when the activity type is {STREAMING} + attr_reader :url + + # @return [String, nil] the application ID for the game + attr_reader :application_id + + # @return [String, nil] details about what the player is currently doing + attr_reader :details + + # @return [String, nil] the user's current party status + attr_reader :state + + # @return [true, false] whether or not the activity is an instanced game session + attr_reader :instance + + # @return [Integer] a bitmask of activity flags + # @see FLAGS + attr_reader :flags + + # @return [Timestamps, nil] times for the start and/or end of the activity + attr_reader :timestamps + + # @return [Secrets, nil] secrets for rich presence, joining, and spectating + attr_reader :secrets + + # @return [Assets, nil] images for the presence and their texts + attr_reader :assets + + # @return [Party, nil] information about the player's current party + attr_reader :party + + # @return [Emoji, nil] emoji data for custom statuses + attr_reader :emoji + + # @return [Time] the time when the activity was added to the user's session + attr_reader :created_at + + # Type indicating the activity is for a game + GAME = 0 + # Type indicating the activity is a stream + STREAMING = 1 + # Type indicating the activity is for music + LISTENING = 2 + # This type is currently unused in the client but can be reported by bots + WATCHING = 3 + # Type indicating the activity is a custom status + CUSTOM = 4 + + # @!visibility private + def initialize(data, bot) + @name = data['name'] + @type = data['type'] + @url = data['url'] + @application_id = data['application_id'] + @details = data['details'] + @state = data['state'] + @instance = data['instance'] + @flags = data['flags'] || 0 + @created_at = Time.at(data['created_at'].to_i) + + @timestamps = Timestamps.new(data['timestamps']) if data['timestamps'] + @secrets = Secret.new(data['secrets']) if data['secrets'] + @assets = Assets.new(data['assets'], @application_id) if data['assets'] + @party = Party.new(data['party']) if data['party'] + @emoji = Emoji.new(data['emoji'], bot, nil) if data['emoji'] + end + + # @return [true, false] Whether or not the `join` flag is set for this activity + def join? + flag_set? :join + end + + # @return [true, false] Whether or not the `spectate` flag is set for this activity + def spectate? + flag_set? :spectate + end + + # @return [true, false] Whether or not the `join_request` flag is set for this activity + def join_request? + flag_set? :join_request + end + + # @return [true, false] Whether or not the `sync` flag is set for this activity + def sync? + flag_set? :sync + end + + # @return [true, false] Whether or not the `play` flag is set for this activity + def play? + flag_set? :play + end + + # @return [true, false] Whether or not the `instance` flag is set for this activity + def instance? + @instance || flag_set?(:instance) + end + + # @!visibility private + def flag_set?(sym) + !(@flags & FLAGS[sym]).zero? + end + + # Timestamps for the start and end of instanced activities + class Timestamps + # @return [Time, nil] + attr_reader :start + + # @return [Time, nil] + attr_reader :end + + # @!visibility private + def initialize(data) + @start = Time.at(data['start'] / 1000) if data['start'] + @end = Time.at(data['end'] / 1000) if data['end'] + end + end + + # Contains secrets used for rich presence + class Secrets + # @return [String, nil] secret for joining a party + attr_reader :join + + # @return [String, nil] secret for spectating + attr_reader :spectate + + # @return [String, nil] secret for a specific instanced match + attr_reader :match + + # @!visibility private + def initialize(data) + @join = data['join'] + @spectate = data['spectate'] + @match = data['match'] + end + end + + # Assets for rich presence images and hover text + class Assets + # @return [String, nil] the asset ID for the large image of this activity + attr_reader :large_image_id + + # @return [String, nil] text displayed when hovering over the large iamge + attr_reader :large_text + + # @return [String, nil] the asset ID for the small image of this activity + attr_reader :small_image_id + + # @return [String, nil] + attr_reader :small_text + + # @return [String, nil] the application ID for these assets. + attr_reader :application_id + + # @!visibility private + def initialize(data, application_id) + @application_id = application_id + @large_image_id = data['large_image'] + @large_text = data['large_text'] + @small_image_id = data['small_image'] + @small_text = data['small_text'] + end + + # Utility function to get an Asset's large image URL. + # @param format [String, nil] If `nil`, the URL will default to `webp`. You can otherwise specify one of `webp`, `jpg`, or `png`. + # @return [String] the URL to the large image asset. + def large_image_url(format = 'webp') + API.asset_url(@application_id, @large_image_id, format) + end + + # Utility function to get an Asset's large image URL. + # @param format [String, nil] If `nil`, the URL will default to `webp`. You can otherwise specify one of `webp`, `jpg`, or `png`. + # @return [String] the URL to the small image asset. + def small_image_url(format = 'webp') + API.asset_url(@application_id, @small_image_id, format) + end + end + + # Contains information about an activity's party + class Party + # @return [String, nil] + attr_reader :id + + # @return [Integer, nil] + attr_reader :current_size + + # @return [Integer, nil] + attr_reader :max_size + + # @!visibility private + def initialize(data) + @id = data['id'] + @current_size, @max_size = data['size'] + end + end + end + + # A collection of the user's activities. + class ActivitySet + include Enumerable + + # @!visibility private + def initialize(activities = []) + @activities = activities + end + + # @!visibility private + # Implement each for Enumerable + def each(&block) + @activities.each(&block) + end + + # @return [Array] all activities + def to_a + @activities + end + + # @return [Array] all activities of type {Activity::GAME} + def games + @activities.select { |act| act.type == Activity::GAME } + end + + # @return [Array] all activities of type {Activity::STREAMING} + def streaming + @activities.select { |act| act.type == Activity::STREAMING } + end + + # @return [Array] all activities of type {Activity::LISTENING} + def listening + @activities.select { |act| act.type == Activity::LISTENING } + end + + # @return [Array] all activities of type {Activity::WATCHING} + def watching + @activities.select { |act| act.type == Activity::WATCHING } + end + + # @return [Array] all activities of type {Activity::CUSTOM} + def custom_status + @activities.select { |act| act.type == Activity::CUSTOM } + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/application.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/application.rb new file mode 100644 index 0000000..438dd2b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/application.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Discordrb + # OAuth Application information + class Application + include IDObject + + # @return [String] the application name + attr_reader :name + + # @return [String] the application description + attr_reader :description + + # @return [Array] the application's origins permitted to use RPC + attr_reader :rpc_origins + + # @return [Integer] + attr_reader :flags + + # Gets the user object of the owner. May be limited to username, discriminator, + # ID, and avatar if the bot cannot reach the owner. + # @return [User] the user object of the owner + attr_reader :owner + + def initialize(data, bot) + @bot = bot + + @name = data['name'] + @id = data['id'].to_i + @description = data['description'] + @icon_id = data['icon'] + @rpc_origins = data['rpc_origins'] + @flags = data['flags'] + @owner = @bot.ensure_user(data['owner']) + end + + # Utility function to get a application's icon URL. + # @return [String, nil] the URL of the icon image (nil if no image is set). + def icon_url + return nil if @icon_id.nil? + + API.app_icon_url(@id, @icon_id) + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/attachment.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/attachment.rb new file mode 100644 index 0000000..f83ddde --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/attachment.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Discordrb + # An attachment to a message + class Attachment + include IDObject + + # @return [Message] the message this attachment belongs to. + attr_reader :message + + # @return [String] the CDN URL this attachment can be downloaded at. + attr_reader :url + + # @return [String] the attachment's proxy URL - I'm not sure what exactly this does, but I think it has something to + # do with CDNs. + attr_reader :proxy_url + + # @return [String] the attachment's filename. + attr_reader :filename + + # @return [Integer] the attachment's file size in bytes. + attr_reader :size + + # @return [Integer, nil] the width of an image file, in pixels, or `nil` if the file is not an image. + attr_reader :width + + # @return [Integer, nil] the height of an image file, in pixels, or `nil` if the file is not an image. + attr_reader :height + + # @!visibility private + def initialize(data, message, bot) + @bot = bot + @message = message + + @id = data['id'].to_i + @url = data['url'] + @proxy_url = data['proxy_url'] + @filename = data['filename'] + + @size = data['size'] + + @width = data['width'] + @height = data['height'] + end + + # @return [true, false] whether this file is an image file. + def image? + !(@width.nil? || @height.nil?) + end + + # @return [true, false] whether this file is tagged as a spoiler. + def spoiler? + @filename.start_with? 'SPOILER_' + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/audit_logs.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/audit_logs.rb new file mode 100644 index 0000000..fa08abc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/audit_logs.rb @@ -0,0 +1,345 @@ +# frozen_string_literal: true + +module Discordrb + # A server's audit logs + class AuditLogs + # The numbers associated with the type of action. + ACTIONS = { + 1 => :server_update, + 10 => :channel_create, + 11 => :channel_update, + 12 => :channel_delete, + 13 => :channel_overwrite_create, + 14 => :channel_overwrite_update, + 15 => :channel_overwrite_delete, + 20 => :member_kick, + 21 => :member_prune, + 22 => :member_ban_add, + 23 => :member_ban_remove, + 24 => :member_update, + 25 => :member_role_update, + 26 => :member_move, + 27 => :member_disconnect, + 28 => :bot_add, + 30 => :role_create, + 31 => :role_update, + 32 => :role_delete, + 40 => :invite_create, + 41 => :invite_update, + 42 => :invite_delete, + 50 => :webhook_create, + 51 => :webhook_update, + 52 => :webhook_delete, + 60 => :emoji_create, + 61 => :emoji_update, + 62 => :emoji_delete, + # 70 + # 71 + 72 => :message_delete, + 73 => :message_bulk_delete, + 74 => :message_pin, + 75 => :message_unpin, + 80 => :integration_create, + 81 => :integration_update, + 82 => :integration_delete + }.freeze + + # @!visibility private + CREATE_ACTIONS = %i[ + channel_create channel_overwrite_create member_ban_add role_create + invite_create webhook_create emoji_create integration_create + ].freeze + + # @!visibility private + DELETE_ACTIONS = %i[ + channel_delete channel_overwrite_delete member_kick member_prune + member_ban_remove role_delete invite_delete webhook_delete + emoji_delete message_delete message_bulk_delete integration_delete + ].freeze + + # @!visibility private + UPDATE_ACTIONS = %i[ + server_update channel_update channel_overwrite_update member_update + member_role_update role_update invite_update webhook_update + emoji_update integration_update + ].freeze + + # @return [Hash User>] the users included in the audit logs. + attr_reader :users + + # @return [Hash Webhook>] the webhooks included in the audit logs. + attr_reader :webhooks + + # @return [Array] the entries listed in the audit logs. + attr_reader :entries + + # @!visibility private + def initialize(server, bot, data) + @bot = bot + @server = server + @users = {} + @webhooks = {} + @entries = data['audit_log_entries'].map { |entry| Entry.new(self, @server, @bot, entry) } + + process_users(data['users']) + process_webhooks(data['webhooks']) + end + + # An entry in a server's audit logs. + class Entry + include IDObject + + # @return [Symbol] the action that was performed. + attr_reader :action + + # @return [Symbol] the type action that was performed. (:create, :delete, :update, :unknown) + attr_reader :action_type + + # @return [Symbol] the type of target being performed on. (:server, :channel, :user, :role, :invite, :webhook, :emoji, :unknown) + attr_reader :target_type + + # @return [Integer, nil] the amount of messages deleted. Only present if the action is `:message_delete`. + attr_reader :count + alias_method :amount, :count + + # @return [Integer, nil] the amount of days the members were inactive for. Only present if the action is `:member_prune`. + attr_reader :days + + # @return [Integer, nil] the amount of members removed. Only present if the action is `:member_prune`. + attr_reader :members_removed + + # @return [String, nil] the reason for this action occurring. + attr_reader :reason + + # @return [Hash Change>, RoleChange, nil] the changes from this log, listing the key as the key changed. Will be a RoleChange object if the action is `:member_role_update`. Will be nil if the action is either `:message_delete` or `:member_prune`. + attr_reader :changes + + # @!visibility private + def initialize(logs, server, bot, data) + @bot = bot + @id = data['id'].resolve_id + @logs = logs + @server = server + @data = data + @action = ACTIONS[data['action_type']] + @reason = data['reason'] + @action_type = AuditLogs.action_type_for(data['action_type']) + @target_type = AuditLogs.target_type_for(data['action_type']) + + # Sets the 'changes' variable to a empty hash if there are no special actions. + @changes = {} unless @action == :message_delete || @action == :member_prune || @action == :member_role_update + + # Sets the 'changes' variable to a RoleChange class if there's a role update. + @changes = RoleChange.new(data['changes'][0], @server) if @action == :member_role_update + + process_changes(data['changes']) unless @action == :member_role_update + return unless data.include?('options') + + # Checks and sets variables for special action options. + @count = data['options']['count'].to_i unless data['options']['count'].nil? + @channel_id = data['options']['channel'].to_i unless data['options']['channel'].nil? + @days = data['options']['delete_member_days'].to_i unless data['options']['delete_member_days'].nil? + @members_removed = data['options']['members_removed'].to_i unless data['options']['members_removed'].nil? + end + + # @return [Server, Channel, Member, User, Role, Invite, Webhook, Emoji, nil] the target being performed on. + def target + @target ||= process_target(@data['target_id'], @target_type) + end + + # @return [Member, User] the user that authored this action. Can be a User object if the user no longer exists in the server. + def user + @user ||= @server.member(@data['user_id'].to_i) || @bot.user(@data['user_id'].to_i) || @logs.user(@data['user_id'].to_i) + end + alias_method :author, :user + + # @return [Channel, nil] the amount of messages deleted. Won't be nil if the action is `:message_delete`. + def channel + return nil unless @channel_id + + @channel ||= @bot.channel(@channel_id, @server, bot, self) + end + + # @!visibility private + def process_target(id, type) + id = id.resolve_id unless id.nil? + case type + when :server then @server # Since it won't be anything else + when :channel then @bot.channel(id, @server) + when :user, :message then @server.member(id) || @bot.user(id) || @logs.user(id) + when :role then @server.role(id) + when :invite then @bot.invite(@data['changes'].find { |change| change['key'] == 'code' }.values.delete_if { |v| v == 'code' }.first) + when :webhook then @server.webhooks.find { |webhook| webhook.id == id } || @logs.webhook(id) + when :emoji then @server.emoji[id] + when :integration then @server.integrations.find { |integration| integration.id == id } + end + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + # Process action changes + # @note For internal use only + # @!visibility private + def process_changes(changes) + return unless changes + + changes.each do |element| + change = Change.new(element, @server, @bot, self) + @changes[change.key] = change + end + end + end + + # A change in a audit log entry. + class Change + # @return [String] the key that was changed. + # @note You should check with the Discord API Documentation on what key gives out what value. + attr_reader :key + + # @return [String, Integer, true, false, Permissions, Overwrite, nil] the value that was changed from. + attr_reader :old + alias_method :old_value, :old + + # @return [String, Integer, true, false, Permissions, Overwrite, nil] the value that was changed to. + attr_reader :new + alias_method :new_value, :new + + # @!visibility private + def initialize(data, server, bot, logs) + @key = data['key'] + @old = data['old_value'] + @new = data['new_value'] + @server = server + @bot = bot + @logs = logs + + @old = Permissions.new(@old) if @old && @key == 'permissions' + @new = Permissions.new(@new) if @new && @key == 'permissions' + + @old = @old.map { |o| Overwrite.new(o['id'], type: o['type'].to_sym, allow: o['allow'], deny: o['deny']) } if @old && @key == 'permission_overwrites' + @new = @new.map { |o| Overwrite.new(o['id'], type: o['type'].to_sym, allow: o['allow'], deny: o['deny']) } if @new && @key == 'permission_overwrites' + end + + # @return [Channel, nil] the channel that was previously used in the server widget. Only present if the key for this change is `widget_channel_id`. + def old_widget_channel + @bot.channel(@old, @server) if @old && @key == 'widget_channel_id' + end + + # @return [Channel, nil] the channel that is used in the server widget prior to this change. Only present if the key for this change is `widget_channel_id`. + def new_widget_channel + @bot.channel(@new, @server) if @new && @key == 'widget_channel_id' + end + + # @return [Channel, nil] the channel that was previously used in the server as an AFK channel. Only present if the key for this change is `afk_channel_id`. + def old_afk_channel + @bot.channel(@old, @server) if @old && @key == 'afk_channel_id' + end + + # @return [Channel, nil] the channel that is used in the server as an AFK channel prior to this change. Only present if the key for this change is `afk_channel_id`. + def new_afk_channel + @bot.channel(@new, @server) if @new && @key == 'afk_channel_id' + end + + # @return [Member, User, nil] the member that used to be the owner of the server. Only present if the for key for this change is `owner_id`. + def old_owner + @server.member(@old) || @bot.user(@old) || @logs.user(@old) if @old && @key == 'owner_id' + end + + # @return [Member, User, nil] the member that is now the owner of the server prior to this change. Only present if the key for this change is `owner_id`. + def new_owner + @server.member(@new) || @bot.user(@new) || @logs.user(@new) if @new && @key == 'owner_id' + end + end + + # A change that includes roles. + class RoleChange + # @return [Symbol] what type of change this is: (:add, :remove) + attr_reader :type + + # @!visibility private + def initialize(data, server) + @type = data['key'].delete('$').to_sym + @role_id = data['new_value'][0]['id'].to_i + @server = server + end + + # @return [Role] the role being used. + def role + @role ||= @server.role(@role_id) + end + end + + # @return [Entry] the latest entry in the audit logs. + def latest + @entries.first + end + alias_method :first, :latest + + # Gets a user in the audit logs data based on user ID + # @note This only uses data given by the audit logs request + # @param id [String, Integer] The user ID to look for + def user(id) + @users[id.resolve_id] + end + + # Gets a webhook in the audit logs data based on webhook ID + # @note This only uses data given by the audit logs request + # @param id [String, Integer] The webhook ID to look for + def webhook(id) + @webhooks[id.resolve_id] + end + + # Process user objects given by the request + # @note For internal use only + # @!visibility private + def process_users(users) + users.each do |element| + user = User.new(element, @bot) + @users[user.id] = user + end + end + + # Process webhook objects given by the request + # @note For internal use only + # @!visibility private + def process_webhooks(webhooks) + webhooks.each do |element| + webhook = Webhook.new(element, @bot) + @webhooks[webhook.id] = webhook + end + end + + # Find the type of target by it's action number + # @note For internal use only + # @!visibility private + def self.target_type_for(action) + case action + when 1..9 then :server + when 10..19 then :channel + when 20..29 then :user + when 30..39 then :role + when 40..49 then :invite + when 50..59 then :webhook + when 60..69 then :emoji + when 70..79 then :message + when 80..89 then :integration + else :unknown + end + end + + # Find the type of action by its action number + # @note For internal use only + # @!visibility private + def self.action_type_for(action) + action = ACTIONS[action] + return :create if CREATE_ACTIONS.include?(action) + return :delete if DELETE_ACTIONS.include?(action) + return :update if UPDATE_ACTIONS.include?(action) + + :unknown + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/channel.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/channel.rb new file mode 100644 index 0000000..01a1045 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/channel.rb @@ -0,0 +1,849 @@ +# frozen_string_literal: true + +module Discordrb + # A Discord channel, including data like the topic + class Channel + include IDObject + + # Map of channel types + TYPES = { + text: 0, + dm: 1, + voice: 2, + group: 3, + category: 4, + news: 5, + store: 6 + }.freeze + + # @return [String] this channel's name. + attr_reader :name + + # @return [Server, nil] the server this channel is on. If this channel is a PM channel, it will be nil. + attr_reader :server + + # @return [Integer, nil] the ID of the parent channel, if this channel is inside a category + attr_reader :parent_id + + # @return [Integer] the type of this channel + # @see TYPES + attr_reader :type + + # @return [Integer, nil] the ID of the owner of the group channel or nil if this is not a group channel. + attr_reader :owner_id + + # @return [Array, nil] the array of recipients of the private messages, or nil if this is not a Private channel + attr_reader :recipients + + # @return [String] the channel's topic + attr_reader :topic + + # @return [Integer] the bitrate (in bps) of the channel + attr_reader :bitrate + + # @return [Integer] the amount of users that can be in the channel. `0` means it is unlimited. + attr_reader :user_limit + alias_method :limit, :user_limit + + # @return [Integer] the channel's position on the channel list + attr_reader :position + + # @return [true, false] if this channel is marked as nsfw + attr_reader :nsfw + alias_method :nsfw?, :nsfw + + # @return [Integer] the amount of time (in seconds) users need to wait to send in between messages. + attr_reader :rate_limit_per_user + alias_method :slowmode_rate, :rate_limit_per_user + + # @return [true, false] whether or not this channel is a PM or group channel. + def private? + pm? || group? + end + + # @return [String] a string that will mention the channel as a clickable link on Discord. + def mention + "<##{@id}>" + end + + # @return [Recipient, nil] the recipient of the private messages, or nil if this is not a PM channel + def recipient + @recipients.first if pm? + end + + # @!visibility private + def initialize(data, bot, server = nil) + @bot = bot + # data is sometimes a Hash and other times an array of Hashes, you only want the last one if it's an array + data = data[-1] if data.is_a?(Array) + + @id = data['id'].to_i + @type = data['type'] || 0 + @topic = data['topic'] + @bitrate = data['bitrate'] + @user_limit = data['user_limit'] + @position = data['position'] + @parent_id = data['parent_id'].to_i if data['parent_id'] + + if private? + @recipients = [] + data['recipients']&.each do |recipient| + recipient_user = bot.ensure_user(recipient) + @recipients << Recipient.new(recipient_user, self, bot) + end + if pm? + @name = @recipients.first.username + else + @name = data['name'] + @owner_id = data['owner_id'] + end + else + @name = data['name'] + @server = server || bot.server(data['guild_id'].to_i) + end + + @nsfw = data['nsfw'] || false + @rate_limit_per_user = data['rate_limit_per_user'] || 0 + + process_permission_overwrites(data['permission_overwrites']) + end + + # @return [true, false] whether or not this channel is a text channel + def text? + @type.zero? + end + + # @return [true, false] whether or not this channel is a PM channel. + def pm? + @type == 1 + end + + # @return [true, false] whether or not this channel is a voice channel. + def voice? + @type == 2 + end + + # @return [true, false] whether or not this channel is a group channel. + def group? + @type == 3 + end + + # @return [true, false] whether or not this channel is a category channel. + def category? + @type == 4 + end + + # @return [true, false] whether or not this channel is a news channel. + def news? + @type == 5 + end + + # @return [true, false] whether or not this channel is a store channel. + def store? + @type == 6 + end + + # @return [Channel, nil] the category channel, if this channel is in a category + def category + @bot.channel(@parent_id) if @parent_id + end + + alias_method :parent, :category + + # Sets this channels parent category + # @param channel [Channel, String, Integer] the target category channel, or its ID + # @raise [ArgumentError] if the target channel isn't a category + def category=(channel) + channel = @bot.channel(channel) + raise ArgumentError, 'Cannot set parent category to a channel that isn\'t a category' unless channel.category? + + update_channel_data(parent_id: channel.id) + end + + alias_method :parent=, :category= + + # Sorts this channel's position to follow another channel. + # @param other [Channel, String, Integer, nil] The channel, or its ID, below which this channel should be sorted. If the given + # channel is a category, this channel will be sorted at the top of that category. If it is `nil`, the channel will + # be sorted at the top of the channel list. + # @param lock_permissions [true, false] Whether the channel's permissions should be synced to the category's + def sort_after(other = nil, lock_permissions = false) + raise TypeError, 'other must be one of Channel, NilClass, String, or Integer' unless other.is_a?(Channel) || other.nil? || other.respond_to?(:resolve_id) + + other = @bot.channel(other.resolve_id) if other + + # Container for the API request payload + move_argument = [] + + if other + raise ArgumentError, 'Can only sort a channel after a channel of the same type!' unless other.category? || (@type == other.type) + + raise ArgumentError, 'Can only sort a channel after a channel in the same server!' unless other.server == server + + # Store `others` parent (or if `other` is a category itself) + parent = if category? && other.category? + # If we're sorting two categories, there is no new parent + nil + elsif other.category? + # `other` is the category this channel will be moved into + other + else + # `other`'s parent is the category this channel will be + # moved into (if it exists) + other.parent + end + end + + # Collect and sort the IDs within the context (category or not) that we + # need to form our payload with + ids = if parent + parent.children + else + @server.channels.reject(&:parent_id).select { |c| c.type == @type } + end.sort_by(&:position).map(&:id) + + # Move our channel ID after the target ID by deleting it, + # getting the index of `other`, and inserting it after. + ids.delete(@id) if ids.include?(@id) + index = other ? (ids.index { |c| c == other.id } || -1) + 1 : 0 + ids.insert(index, @id) + + # Generate `move_argument`, making the positions in order from how + # we have sorted them in the above logic + ids.each_with_index do |id, pos| + # These keys are present in each element + hash = { id: id, position: pos } + + # Conditionally add `lock_permissions` and `parent_id` if we're + # iterating past ourselves + if id == @id + hash[:lock_permissions] = true if lock_permissions + hash[:parent_id] = parent.nil? ? nil : parent.id + end + + # Add it to the stack + move_argument << hash + end + + API::Server.update_channel_positions(@bot.token, @server.id, move_argument) + end + + # Sets whether this channel is NSFW + # @param nsfw [true, false] + # @raise [ArgumentError] if value isn't one of true, false + def nsfw=(nsfw) + raise ArgumentError, 'nsfw value must be true or false' unless nsfw.is_a?(TrueClass) || nsfw.is_a?(FalseClass) + + update_channel_data(nsfw: nsfw) + end + + # This channel's permission overwrites + # @overload permission_overwrites + # The overwrites represented as a hash of role/user ID + # to an Overwrite object + # @return [Hash Overwrite>] the channel's permission overwrites + # @overload permission_overwrites(type) + # Return an array of a certain type of overwrite + # @param type [Symbol] the kind of overwrite to return + # @return [Array] + def permission_overwrites(type = nil) + return @permission_overwrites unless type + + @permission_overwrites.values.select { |e| e.type == type } + end + + alias_method :overwrites, :permission_overwrites + + # Bulk sets this channels permission overwrites + # @param overwrites [Array] + def permission_overwrites=(overwrites) + update_channel_data(permission_overwrites: overwrites) + end + + # Sets the amount of time (in seconds) users have to wait in between sending messages. + # @param rate [Integer] + # @raise [ArgumentError] if value isn't between 0 and 120 + def rate_limit_per_user=(rate) + raise ArgumentError, 'rate_limit_per_user must be between 0 and 120' unless rate.between?(0, 120) + + update_channel_data(rate_limit_per_user: rate) + end + + alias_method :slowmode_rate=, :rate_limit_per_user= + + # Syncs this channels overwrites with its parent category + # @raise [RuntimeError] if this channel is not in a category + def sync_overwrites + raise 'Cannot sync overwrites on a channel with no parent category' unless parent + + self.permission_overwrites = parent.permission_overwrites + end + + alias_method :sync, :sync_overwrites + + # @return [true, false, nil] whether this channels permissions match the permission overwrites of the category that it's in, or nil if it is not in a category + def synchronized? + return unless parent + + permission_overwrites == parent.permission_overwrites + end + + alias_method :synced?, :synchronized? + + # Returns the children of this channel, if it is a category. Otherwise returns an empty array. + # @return [Array] + def children + return [] unless category? + + server.channels.select { |c| c.parent_id == id } + end + + alias_method :channels, :children + + # Returns the text channels in this category, if it is a category channel. Otherwise returns an empty array. + # @return [Array] + def text_channels + children.select(&:text?) + end + + # Returns the voice channels in this category, if it is a category channel. Otherwise returns an empty array. + # @return [Array] + def voice_channels + children.select(&:voice?) + end + + # @return [Overwrite] any member-type permission overwrites on this channel + def member_overwrites + permission_overwrites :member + end + + # @return [Overwrite] any role-type permission overwrites on this channel + def role_overwrites + permission_overwrites :role + end + + # @return [true, false] whether or not this channel is the default channel + def default_channel? + server.default_channel == self + end + + alias_method :default?, :default_channel? + + # @return [true, false] whether or not this channel has slowmode enabled + def slowmode? + @rate_limit_per_user != 0 + end + + # Sends a message to this channel. + # @param content [String] The content to send. Should not be longer than 2000 characters or it will result in an error. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + # @return [Message] the message that was sent. + def send_message(content, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + @bot.send_message(@id, content, tts, embed, attachments, allowed_mentions, message_reference) + end + + alias_method :send, :send_message + + # Sends a temporary message to this channel. + # @param content [String] The content to send. Should not be longer than 2000 characters or it will result in an error. + # @param timeout [Float] The amount of time in seconds after which the message sent will be deleted. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + def send_temporary_message(content, timeout, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + @bot.send_temporary_message(@id, content, timeout, tts, embed, attachments, allowed_mentions, message_reference) + end + + # Convenience method to send a message with an embed. + # @example Send a message with an embed + # channel.send_embed do |embed| + # embed.title = 'The Ruby logo' + # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://www.ruby-lang.org/images/header-ruby-logo.png') + # end + # @param message [String] The message that should be sent along with the embed. If this is the empty string, only the embed will be shown. + # @param embed [Discordrb::Webhooks::Embed, nil] The embed to start the building process with, or nil if one should be created anew. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + # @yield [embed] Yields the embed to allow for easy building inside a block. + # @yieldparam embed [Discordrb::Webhooks::Embed] The embed from the parameters, or a new one. + # @return [Message] The resulting message. + def send_embed(message = '', embed = nil, attachments = nil, tts = false, allowed_mentions = nil, message_reference = nil) + embed ||= Discordrb::Webhooks::Embed.new + yield(embed) if block_given? + send_message(message, tts, embed, attachments, allowed_mentions, message_reference) + end + + # Sends multiple messages to a channel + # @param content [Array] The messages to send. + def send_multiple(content) + content.each { |e| send_message(e) } + end + + # Splits a message into chunks whose length is at most the Discord character limit, then sends them individually. + # Useful for sending long messages, but be wary of rate limits! + def split_send(content) + send_multiple(Discordrb.split_message(content)) + nil + end + + # Sends a file to this channel. If it is an image, it will be embedded. + # @param file [File] The file to send. There's no clear size limit for this, you'll have to attempt it for yourself (most non-image files are fine, large images may fail to embed) + # @param caption [string] The caption for the file. + # @param tts [true, false] Whether or not this file's caption should be sent using Discord text-to-speech. + # @param filename [String] Overrides the filename of the uploaded file + # @param spoiler [true, false] Whether or not this file should appear as a spoiler. + # @example Send a file from disk + # channel.send_file(File.open('rubytaco.png', 'r')) + def send_file(file, caption: nil, tts: false, filename: nil, spoiler: nil) + @bot.send_file(@id, file, caption: caption, tts: tts, filename: filename, spoiler: spoiler) + end + + # Deletes a message on this channel. Mostly useful in case a message needs to be deleted when only the ID is known + # @param message [Message, String, Integer, String, Integer] The message, or its ID, that should be deleted. + def delete_message(message) + API::Channel.delete_message(@bot.token, @id, message.resolve_id) + end + + # Permanently deletes this channel + # @param reason [String] The reason the for the channel deletion. + def delete(reason = nil) + API::Channel.delete(@bot.token, @id, reason) + end + + # Sets this channel's name. The name must be alphanumeric with dashes, unless this is a voice channel (then there are no limitations) + # @param name [String] The new name. + def name=(name) + update_channel_data(name: name) + end + + # Sets this channel's topic. + # @param topic [String] The new topic. + def topic=(topic) + raise 'Tried to set topic on voice channel' if voice? + + update_channel_data(topic: topic) + end + + # Sets this channel's bitrate. + # @param bitrate [Integer] The new bitrate (in bps). Number has to be between 8000-96000 (128000 for VIP servers) + def bitrate=(bitrate) + raise 'Tried to set bitrate on text channel' if text? + + update_channel_data(bitrate: bitrate) + end + + # Sets this channel's user limit. + # @param limit [Integer] The new user limit. `0` for unlimited, has to be a number between 0-99 + def user_limit=(limit) + raise 'Tried to set user_limit on text channel' if text? + + update_channel_data(user_limit: limit) + end + + alias_method :limit=, :user_limit= + + # Sets this channel's position in the list. + # @param position [Integer] The new position. + def position=(position) + update_channel_data(position: position) + end + + # Defines a permission overwrite for this channel that sets the specified thing to the specified allow and deny + # permission sets, or change an existing one. + # @overload define_overwrite(overwrite) + # @param thing [Overwrite] an Overwrite object to apply to this channel + # @param reason [String] The reason the for defining the overwrite. + # @overload define_overwrite(thing, allow, deny) + # @param thing [User, Role] What to define an overwrite for. + # @param allow [#bits, Permissions, Integer] The permission sets that should receive an `allow` override (i.e. a + # green checkmark on Discord) + # @param deny [#bits, Permissions, Integer] The permission sets that should receive a `deny` override (i.e. a red + # cross on Discord) + # @param reason [String] The reason the for defining the overwrite. + # @example Define a permission overwrite for a user that can then mention everyone and use TTS, but not create any invites + # allow = Discordrb::Permissions.new + # allow.can_mention_everyone = true + # allow.can_send_tts_messages = true + # + # deny = Discordrb::Permissions.new + # deny.can_create_instant_invite = true + # + # channel.define_overwrite(user, allow, deny) + def define_overwrite(thing, allow = 0, deny = 0, reason: nil) + unless thing.is_a? Overwrite + allow_bits = allow.respond_to?(:bits) ? allow.bits : allow + deny_bits = deny.respond_to?(:bits) ? deny.bits : deny + + thing = Overwrite.new thing, allow: allow_bits, deny: deny_bits + end + + API::Channel.update_permission(@bot.token, @id, thing.id, thing.allow.bits, thing.deny.bits, thing.type, reason) + end + + # Deletes a permission overwrite for this channel + # @param target [Member, User, Role, Profile, Recipient, String, Integer] What permission overwrite to delete + # @param reason [String] The reason the for the overwrite deletion. + def delete_overwrite(target, reason = nil) + raise 'Tried deleting a overwrite for an invalid target' unless target.is_a?(Member) || target.is_a?(User) || target.is_a?(Role) || target.is_a?(Profile) || target.is_a?(Recipient) || target.respond_to?(:resolve_id) + + API::Channel.delete_permission(@bot.token, @id, target.resolve_id, reason) + end + + # Updates the cached data from another channel. + # @note For internal use only + # @!visibility private + def update_from(other) + @name = other.name + @position = other.position + @topic = other.topic + @recipients = other.recipients + @bitrate = other.bitrate + @user_limit = other.user_limit + @permission_overwrites = other.permission_overwrites + @nsfw = other.nsfw + @parent_id = other.parent_id + @rate_limit_per_user = other.rate_limit_per_user + end + + # The list of users currently in this channel. For a voice channel, it will return all the members currently + # in that channel. For a text channel, it will return all online members that have permission to read it. + # @return [Array] the users in this channel + def users + if text? + @server.online_members(include_idle: true).select { |u| u.can_read_messages? self } + elsif voice? + @server.voice_states.map { |id, voice_state| @server.member(id) if !voice_state.voice_channel.nil? && voice_state.voice_channel.id == @id }.compact + end + end + + # Retrieves some of this channel's message history. + # @param amount [Integer] How many messages to retrieve. This must be less than or equal to 100, if it is higher + # than 100 it will be treated as 100 on Discord's side. + # @param before_id [Integer] The ID of the most recent message the retrieval should start at, or nil if it should + # start at the current message. + # @param after_id [Integer] The ID of the oldest message the retrieval should start at, or nil if it should start + # as soon as possible with the specified amount. + # @param around_id [Integer] The ID of the message retrieval should start from, reading in both directions + # @example Count the number of messages in the last 50 messages that contain the letter 'e'. + # message_count = channel.history(50).count {|message| message.content.include? "e"} + # @example Get the last 10 messages before the provided message. + # last_ten_messages = channel.history(10, message.id) + # @return [Array] the retrieved messages. + def history(amount, before_id = nil, after_id = nil, around_id = nil) + logs = API::Channel.messages(@bot.token, @id, amount, before_id, after_id, around_id) + JSON.parse(logs).map { |message| Message.new(message, @bot) } + end + + # Retrieves message history, but only message IDs for use with prune. + # @note For internal use only + # @!visibility private + def history_ids(amount, before_id = nil, after_id = nil, around_id = nil) + logs = API::Channel.messages(@bot.token, @id, amount, before_id, after_id, around_id) + JSON.parse(logs).map { |message| message['id'].to_i } + end + + # Returns a single message from this channel's history by ID. + # @param message_id [Integer] The ID of the message to retrieve. + # @return [Message, nil] the retrieved message, or `nil` if it couldn't be found. + def load_message(message_id) + response = API::Channel.message(@bot.token, @id, message_id) + Message.new(JSON.parse(response), @bot) + rescue RestClient::ResourceNotFound + nil + end + + alias_method :message, :load_message + + # Requests all pinned messages in a channel. + # @return [Array] the received messages. + def pins + msgs = API::Channel.pinned_messages(@bot.token, @id) + JSON.parse(msgs).map { |msg| Message.new(msg, @bot) } + end + + # Delete the last N messages on this channel. + # @param amount [Integer] The amount of message history to consider for pruning. Must be a value between 2 and 100 (Discord limitation) + # @param strict [true, false] Whether an error should be raised when a message is reached that is too old to be bulk + # deleted. If this is false only a warning message will be output to the console. + # @param reason [String, nil] The reason for pruning + # @raise [ArgumentError] if the amount of messages is not a value between 2 and 100 + # @yield [message] Yields each message in this channels history for filtering the messages to delete + # @example Pruning messages from a specific user ID + # channel.prune(100) { |m| m.author.id == 83283213010599936 } + # @return [Integer] The amount of messages that were successfully deleted + def prune(amount, strict = false, reason = nil, &block) + raise ArgumentError, 'Can only delete between 1 and 100 messages!' unless amount.between?(1, 100) + + messages = + if block + history(amount).select(&block).map(&:id) + else + history_ids(amount) + end + + case messages.size + when 0 + 0 + when 1 + API::Channel.delete_message(@bot.token, @id, messages.first, reason) + 1 + else + bulk_delete(messages, strict, reason) + end + end + + # Deletes a collection of messages + # @param messages [Array] the messages (or message IDs) to delete. Total must be an amount between 2 and 100 (Discord limitation) + # @param strict [true, false] Whether an error should be raised when a message is reached that is too old to be bulk + # deleted. If this is false only a warning message will be output to the console. + # @param reason [String, nil] The reason for deleting the messages + # @raise [ArgumentError] if the amount of messages is not a value between 2 and 100 + # @return [Integer] The amount of messages that were successfully deleted + def delete_messages(messages, strict = false, reason = nil) + raise ArgumentError, 'Can only delete between 2 and 100 messages!' unless messages.count.between?(2, 100) + + messages.map!(&:resolve_id) + bulk_delete(messages, strict, reason) + end + + # Updates the cached permission overwrites + # @note For internal use only + # @!visibility private + def update_overwrites(overwrites) + @permission_overwrites = overwrites + end + + # Add an {Await} for a message in this channel. This is identical in functionality to adding a + # {Discordrb::Events::MessageEvent} await with the `in` attribute as this channel. + # @see Bot#add_await + # @deprecated Will be changed to blocking behavior in v4.0. Use {#await!} instead. + def await(key, attributes = {}, &block) + @bot.add_await(key, Discordrb::Events::MessageEvent, { in: @id }.merge(attributes), &block) + end + + # Add a blocking {Await} for a message in this channel. This is identical in functionality to adding a + # {Discordrb::Events::MessageEvent} await with the `in` attribute as this channel. + # @see Bot#add_await! + def await!(attributes = {}, &block) + @bot.add_await!(Discordrb::Events::MessageEvent, { in: @id }.merge(attributes), &block) + end + + # Creates a new invite to this channel. + # @param max_age [Integer] How many seconds this invite should last. + # @param max_uses [Integer] How many times this invite should be able to be used. + # @param temporary [true, false] Whether membership should be temporary (kicked after going offline). + # @param unique [true, false] If true, Discord will always send a unique invite instead of possibly re-using a similar one + # @param reason [String] The reason the for the creation of this invite. + # @return [Invite] the created invite. + def make_invite(max_age = 0, max_uses = 0, temporary = false, unique = false, reason = nil) + response = API::Channel.create_invite(@bot.token, @id, max_age, max_uses, temporary, unique, reason) + Invite.new(JSON.parse(response), @bot) + end + + alias_method :invite, :make_invite + + # Starts typing, which displays the typing indicator on the client for five seconds. + # If you want to keep typing you'll have to resend this every five seconds. (An abstraction + # for this will eventually be coming) + # @example Send a typing indicator for the bot in a given channel. + # channel.start_typing() + def start_typing + API::Channel.start_typing(@bot.token, @id) + end + + # Creates a Group channel + # @param user_ids [Array] Array of user IDs to add to the new group channel (Excluding + # the recipient of the PM channel). + # @return [Channel] the created channel. + def create_group(user_ids) + raise 'Attempted to create group channel on a non-pm channel!' unless pm? + + response = API::Channel.create_group(@bot.token, @id, user_ids.shift) + channel = Channel.new(JSON.parse(response), @bot) + channel.add_group_users(user_ids) + end + + # Adds a user to a group channel. + # @param user_ids [Array, String, Integer] User ID or array of user IDs to add to the group channel. + # @return [Channel] the group channel. + def add_group_users(user_ids) + raise 'Attempted to add a user to a non-group channel!' unless group? + + user_ids = [user_ids] unless user_ids.is_a? Array + user_ids.each do |user_id| + API::Channel.add_group_user(@bot.token, @id, user_id.resolve_id) + end + self + end + + alias_method :add_group_user, :add_group_users + + # Removes a user from a group channel. + # @param user_ids [Array, String, Integer] User ID or array of user IDs to remove from the group channel. + # @return [Channel] the group channel. + def remove_group_users(user_ids) + raise 'Attempted to remove a user from a non-group channel!' unless group? + + user_ids = [user_ids] unless user_ids.is_a? Array + user_ids.each do |user_id| + API::Channel.remove_group_user(@bot.token, @id, user_id.resolve_id) + end + self + end + + alias_method :remove_group_user, :remove_group_users + + # Leaves the group. + def leave_group + raise 'Attempted to leave a non-group channel!' unless group? + + API::Channel.leave_group(@bot.token, @id) + end + + alias_method :leave, :leave_group + + # Creates a webhook in this channel + # @param name [String] the default name of this webhook. + # @param avatar [String] the default avatar URL to give this webhook. + # @param reason [String] the reason for the webhook creation. + # @raise [ArgumentError] if the channel isn't a text channel in a server. + # @return [Webhook] the created webhook. + def create_webhook(name, avatar = nil, reason = nil) + raise ArgumentError, 'Tried to create a webhook in a non-server channel' unless server + raise ArgumentError, 'Tried to create a webhook in a non-text channel' unless text? + + response = API::Channel.create_webhook(@bot.token, @id, name, avatar, reason) + Webhook.new(JSON.parse(response), @bot) + end + + # Requests a list of Webhooks on the channel. + # @return [Array] webhooks on the channel. + def webhooks + raise 'Tried to request webhooks from a non-server channel' unless server + + webhooks = JSON.parse(API::Channel.webhooks(@bot.token, @id)) + webhooks.map { |webhook_data| Webhook.new(webhook_data, @bot) } + end + + # Requests a list of Invites to the channel. + # @return [Array] invites to the channel. + def invites + raise 'Tried to request invites from a non-server channel' unless server + + invites = JSON.parse(API::Channel.invites(@bot.token, @id)) + invites.map { |invite_data| Invite.new(invite_data, @bot) } + end + + # The default `inspect` method is overwritten to give more useful output. + def inspect + "" + end + + # Adds a recipient to a group channel. + # @param recipient [Recipient] the recipient to add to the group + # @raise [ArgumentError] if tried to add a non-recipient + # @note For internal use only + # @!visibility private + def add_recipient(recipient) + raise 'Tried to add recipient to a non-group channel' unless group? + raise ArgumentError, 'Tried to add a non-recipient to a group' unless recipient.is_a?(Recipient) + + @recipients << recipient + end + + # Removes a recipient from a group channel. + # @param recipient [Recipient] the recipient to remove from the group + # @raise [ArgumentError] if tried to remove a non-recipient + # @note For internal use only + # @!visibility private + def remove_recipient(recipient) + raise 'Tried to remove recipient from a non-group channel' unless group? + raise ArgumentError, 'Tried to remove a non-recipient from a group' unless recipient.is_a?(Recipient) + + @recipients.delete(recipient) + end + + # Updates the cached data with new data + # @note For internal use only + # @!visibility private + def update_data(new_data = nil) + new_data ||= JSON.parse(API::Channel.resolve(@bot.token, @id)) + @name = new_data[:name] || new_data['name'] || @name + @topic = new_data[:topic] || new_data['topic'] || @topic + @position = new_data[:position] || new_data['position'] || @position + @bitrate = new_data[:bitrate] || new_data['bitrate'] || @bitrate + @user_limit = new_data[:user_limit] || new_data['user_limit'] || @user_limit + new_nsfw = new_data.key?(:nsfw) ? new_data[:nsfw] : new_data['nsfw'] + @nsfw = new_nsfw.nil? ? @nsfw : new_nsfw + @parent_id = new_data[:parent_id] || new_data['parent_id'] || @parent_id + process_permission_overwrites(new_data[:permission_overwrites] || new_data['permission_overwrites']) + @rate_limit_per_user = new_data[:rate_limit_per_user] || new_data['rate_limit_per_user'] || @rate_limit_per_user + end + + # @return [String] a URL that a user can use to navigate to this channel in the client + def link + "https://discord.com/channels/#{@server&.id || '@me'}/#{@channel.id}" + end + + alias_method :jump_link, :link + + private + + # For bulk_delete checking + TWO_WEEKS = 86_400 * 14 + + # Deletes a list of messages on this channel using bulk delete. + def bulk_delete(ids, strict = false, reason = nil) + min_snowflake = IDObject.synthesise(Time.now - TWO_WEEKS) + + ids.reject! do |e| + next unless e < min_snowflake + + message = "Attempted to bulk_delete message #{e} which is too old (min = #{min_snowflake})" + raise ArgumentError, message if strict + + Discordrb::LOGGER.warn(message) + true + end + + API::Channel.bulk_delete_messages(@bot.token, @id, ids, reason) + ids.size + end + + def update_channel_data(new_data) + new_nsfw = new_data[:nsfw].is_a?(TrueClass) || new_data[:nsfw].is_a?(FalseClass) ? new_data[:nsfw] : @nsfw + # send permission_overwrite only when explicitly set + overwrites = new_data[:permission_overwrites] ? new_data[:permission_overwrites].map { |_, v| v.to_hash } : nil + response = JSON.parse(API::Channel.update(@bot.token, @id, + new_data[:name] || @name, + new_data[:topic] || @topic, + new_data[:position] || @position, + new_data[:bitrate] || @bitrate, + new_data[:user_limit] || @user_limit, + new_nsfw, + overwrites, + new_data[:parent_id] || @parent_id, + new_data[:rate_limit_per_user] || @rate_limit_per_user)) + update_data(response) + end + + def process_permission_overwrites(overwrites) + # Populate permission overwrites + @permission_overwrites = {} + return unless overwrites + + overwrites.each do |element| + id = element['id'].to_i + @permission_overwrites[id] = Overwrite.from_hash(element) + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/embed.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/embed.rb new file mode 100644 index 0000000..546c57b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/embed.rb @@ -0,0 +1,251 @@ +# frozen_string_literal: true + +module Discordrb + # An Embed object that is contained in a message + # A freshly generated embed object will not appear in a message object + # unless grabbed from its ID in a channel. + class Embed + # @return [Message] the message this embed object is contained in. + attr_reader :message + + # @return [String] the URL this embed object is based on. + attr_reader :url + + # @return [String, nil] the title of the embed object. `nil` if there is not a title + attr_reader :title + + # @return [String, nil] the description of the embed object. `nil` if there is not a description + attr_reader :description + + # @return [Symbol] the type of the embed object. Possible types are: + # + # * `:link` + # * `:video` + # * `:image` + attr_reader :type + + # @return [Time, nil] the timestamp of the embed object. `nil` if there is not a timestamp + attr_reader :timestamp + + # @return [String, nil] the color of the embed object. `nil` if there is not a color + attr_reader :color + alias_method :colour, :color + + # @return [EmbedFooter, nil] the footer of the embed object. `nil` if there is not a footer + attr_reader :footer + + # @return [EmbedProvider, nil] the provider of the embed object. `nil` if there is not a provider + attr_reader :provider + + # @return [EmbedImage, nil] the image of the embed object. `nil` if there is not an image + attr_reader :image + + # @return [EmbedThumbnail, nil] the thumbnail of the embed object. `nil` if there is not a thumbnail + attr_reader :thumbnail + + # @return [EmbedVideo, nil] the video of the embed object. `nil` if there is not a video + attr_reader :video + + # @return [EmbedAuthor, nil] the author of the embed object. `nil` if there is not an author + attr_reader :author + + # @return [Array, nil] the fields of the embed object. `nil` if there are no fields + attr_reader :fields + + # @!visibility private + def initialize(data, message) + @message = message + + @url = data['url'] + @title = data['title'] + @type = data['type'].to_sym + @description = data['description'] + @timestamp = data['timestamp'].nil? ? nil : Time.parse(data['timestamp']) + @color = data['color'] + @footer = data['footer'].nil? ? nil : EmbedFooter.new(data['footer'], self) + @image = data['image'].nil? ? nil : EmbedImage.new(data['image'], self) + @video = data['video'].nil? ? nil : EmbedVideo.new(data['video'], self) + @provider = data['provider'].nil? ? nil : EmbedProvider.new(data['provider'], self) + @thumbnail = data['thumbnail'].nil? ? nil : EmbedThumbnail.new(data['thumbnail'], self) + @author = data['author'].nil? ? nil : EmbedAuthor.new(data['author'], self) + @fields = data['fields'].nil? ? nil : data['fields'].map { |field| EmbedField.new(field, self) } + end + end + + # An Embed footer for the embed object. + class EmbedFooter + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the footer text. + attr_reader :text + + # @return [String] the URL of the footer icon. + attr_reader :icon_url + + # @return [String] the proxied URL of the footer icon. + attr_reader :proxy_icon_url + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @text = data['text'] + @icon_url = data['icon_url'] + @proxy_icon_url = data['proxy_icon_url'] + end + end + + # An Embed image for the embed object. + class EmbedImage + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the source URL of the image. + attr_reader :url + + # @return [String] the proxy URL of the image. + attr_reader :proxy_url + + # @return [Integer] the width of the image, in pixels. + attr_reader :width + + # @return [Integer] the height of the image, in pixels. + attr_reader :height + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @url = data['url'] + @proxy_url = data['proxy_url'] + @width = data['width'] + @height = data['height'] + end + end + + # An Embed video for the embed object + class EmbedVideo + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the source URL of the video. + attr_reader :url + + # @return [Integer] the width of the video, in pixels. + attr_reader :width + + # @return [Integer] the height of the video, in pixels. + attr_reader :height + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @url = data['url'] + @width = data['width'] + @height = data['height'] + end + end + + # An Embed thumbnail for the embed object + class EmbedThumbnail + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the CDN URL this thumbnail can be downloaded at. + attr_reader :url + + # @return [String] the thumbnail's proxy URL - I'm not sure what exactly this does, but I think it has something to + # do with CDNs. + attr_reader :proxy_url + + # @return [Integer] the width of this thumbnail file, in pixels. + attr_reader :width + + # @return [Integer] the height of this thumbnail file, in pixels. + attr_reader :height + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @url = data['url'] + @proxy_url = data['proxy_url'] + @width = data['width'] + @height = data['height'] + end + end + + # An Embed provider for the embed object + class EmbedProvider + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the provider's name. + attr_reader :name + + # @return [String, nil] the URL of the provider, or `nil` if there is no URL. + attr_reader :url + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @name = data['name'] + @url = data['url'] + end + end + + # An Embed author for the embed object + class EmbedAuthor + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the author's name. + attr_reader :name + + # @return [String, nil] the URL of the author's website, or `nil` if there is no URL. + attr_reader :url + + # @return [String, nil] the icon of the author, or `nil` if there is no icon. + attr_reader :icon_url + + # @return [String, nil] the Discord proxy URL, or `nil` if there is no `icon_url`. + attr_reader :proxy_icon_url + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @name = data['name'] + @url = data['url'] + @icon_url = data['icon_url'] + @proxy_icon_url = data['proxy_icon_url'] + end + end + + # An Embed field for the embed object + class EmbedField + # @return [Embed] the embed object this is based on. + attr_reader :embed + + # @return [String] the field's name. + attr_reader :name + + # @return [String] the field's value. + attr_reader :value + + # @return [true, false] whether this field is inline. + attr_reader :inline + + # @!visibility private + def initialize(data, embed) + @embed = embed + + @name = data['name'] + @value = data['value'] + @inline = data['inline'] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/emoji.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/emoji.rb new file mode 100644 index 0000000..dc26aee --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/emoji.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Discordrb + # Server emoji + class Emoji + include IDObject + + # @return [String] the emoji name + attr_reader :name + + # @return [Server, nil] the server of this emoji + attr_reader :server + + # @return [Array, nil] roles this emoji is active for, or nil if the emoji's server is unknown + attr_reader :roles + + # @return [true, false] if the emoji is animated + attr_reader :animated + alias_method :animated?, :animated + + # @!visibility private + def initialize(data, bot, server = nil) + @bot = bot + @roles = nil + + @name = data['name'] + @server = server + @id = data['id'].nil? ? nil : data['id'].to_i + @animated = data['animated'] + + process_roles(data['roles']) if server + end + + # ID or name based comparison + def ==(other) + return false unless other.is_a? Emoji + return Discordrb.id_compare(@id, other) if @id + + name == other.name + end + + alias_method :eql?, :== + + # @return [String] the layout to mention it (or have it used) in a message + def mention + return name if id.nil? + + "<#{'a' if animated}:#{name}:#{id}>" + end + + alias_method :use, :mention + alias_method :to_s, :mention + + # @return [String] the layout to use this emoji in a reaction + def to_reaction + return name if id.nil? + + "#{name}:#{id}" + end + + # @return [String] the icon URL of the emoji + def icon_url + API.emoji_icon_url(id) + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + # @!visibility private + def process_roles(roles) + @roles = [] + return unless roles + + roles.each do |role_id| + role = server.role(role_id) + @roles << role + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/integration.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/integration.rb new file mode 100644 index 0000000..265d2a5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/integration.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Discordrb + # Integration Account + class IntegrationAccount + # @return [String] this account's name. + attr_reader :name + + # @return [Integer] this account's ID. + attr_reader :id + + def initialize(data) + @name = data['name'] + @id = data['id'].to_i + end + end + + # Server integration + class Integration + include IDObject + + # @return [String] the integration name + attr_reader :name + + # @return [Server] the server the integration is linked to + attr_reader :server + + # @return [User] the user the integration is linked to + attr_reader :user + + # @return [Role, nil] the role that this integration uses for "subscribers" + attr_reader :role + + # @return [true, false] whether emoticons are enabled + attr_reader :emoticon + alias_method :emoticon?, :emoticon + + # @return [String] the integration type (YouTube, Twitch, etc.) + attr_reader :type + + # @return [true, false] whether the integration is enabled + attr_reader :enabled + + # @return [true, false] whether the integration is syncing + attr_reader :syncing + + # @return [IntegrationAccount] the integration account information + attr_reader :account + + # @return [Time] the time the integration was synced at + attr_reader :synced_at + + # @return [Symbol] the behaviour of expiring subscribers (:remove = Remove User from role; :kick = Kick User from server) + attr_reader :expire_behaviour + alias_method :expire_behavior, :expire_behaviour + + # @return [Integer] the grace period before subscribers expire (in days) + attr_reader :expire_grace_period + + def initialize(data, bot, server) + @bot = bot + + @name = data['name'] + @server = server + @id = data['id'].to_i + @enabled = data['enabled'] + @syncing = data['syncing'] + @type = data['type'] + @account = IntegrationAccount.new(data['account']) + @synced_at = Time.parse(data['synced_at']) + @expire_behaviour = %i[remove kick][data['expire_behavior']] + @expire_grace_period = data['expire_grace_period'] + @user = @bot.ensure_user(data['user']) + @role = server.role(data['role_id']) || nil + @emoticon = data['enable_emoticons'] + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/invite.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/invite.rb new file mode 100644 index 0000000..5debfb0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/invite.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Discordrb + # A channel referenced by an invite. It has less data than regular channels, so it's a separate class + class InviteChannel + include IDObject + + # @return [String] this channel's name. + attr_reader :name + + # @return [Integer] this channel's type (0: text, 1: private, 2: voice, 3: group). + attr_reader :type + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @id = data['id'].to_i + @name = data['name'] + @type = data['type'] + end + end + + # A server referenced to by an invite + class InviteServer + include IDObject + + # @return [String] this server's name. + attr_reader :name + + # @return [String, nil] the hash of the server's invite splash screen (for partnered servers) or nil if none is + # present + attr_reader :splash_hash + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @id = data['id'].to_i + @name = data['name'] + @splash_hash = data['splash_hash'] + end + end + + # A Discord invite to a channel + class Invite + # @return [InviteChannel, Channel] the channel this invite references. + attr_reader :channel + + # @return [InviteServer, Server] the server this invite references. + attr_reader :server + + # @return [Integer] the amount of uses left on this invite. + attr_reader :uses + alias_method :max_uses, :uses + + # @return [User, nil] the user that made this invite. May also be nil if the user can't be determined. + attr_reader :inviter + alias_method :user, :inviter + + # @return [true, false] whether or not this invite grants temporary membership. If someone joins a server with this invite, they will be removed from the server when they go offline unless they've received a role. + attr_reader :temporary + alias_method :temporary?, :temporary + + # @return [true, false] whether this invite is still valid. + attr_reader :revoked + alias_method :revoked?, :revoked + + # @return [String] this invite's code + attr_reader :code + + # @return [Integer, nil] the amount of members in the server. Will be nil if it has not been resolved. + attr_reader :member_count + alias_method :user_count, :member_count + + # @return [Integer, nil] the amount of online members in the server. Will be nil if it has not been resolved. + attr_reader :online_member_count + alias_method :online_user_count, :online_member_count + + # @return [Integer, nil] the invites max age before it expires, or nil if it's unknown. If the max age is 0, the invite will never expire unless it's deleted. + attr_reader :max_age + + # @return [Time, nil] when this invite was created, or nil if it's unknown + attr_reader :created_at + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @channel = if data['channel_id'] || bot.channel + bot.channel(data['channel_id']) + else + InviteChannel.new(data['channel'], bot) + end + + @server = if data['guild_id'] + bot.server(data['guild_id']) + else + InviteServer.new(data['guild'], bot) + end + + @uses = data['uses'] + @inviter = data['inviter'] ? (@bot.user(data['inviter']['id'].to_i) || User.new(data['inviter'], bot)) : nil + @temporary = data['temporary'] + @revoked = data['revoked'] + @online_member_count = data['approximate_presence_count'] + @member_count = data['approximate_member_count'] + @max_age = data['max_age'] + @created_at = data['created_at'] + + @code = data['code'] + end + + # Code based comparison + def ==(other) + other.respond_to?(:code) ? (@code == other.code) : (@code == other) + end + + # Deletes this invite + # @param reason [String] The reason the invite is being deleted. + def delete(reason = nil) + API::Invite.delete(@bot.token, @code, reason) + end + + alias_method :revoke, :delete + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + # Creates an invite URL. + def url + "https://discord.gg/#{@code}" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/member.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/member.rb new file mode 100644 index 0000000..232201d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/member.rb @@ -0,0 +1,297 @@ +# frozen_string_literal: true + +module Discordrb + # Mixin for the attributes members and private members should have + module MemberAttributes + # @return [Time] when this member joined the server. + attr_reader :joined_at + + # @return [Time, nil] when this member boosted this server, `nil` if they haven't. + attr_reader :boosting_since + + # @return [String, nil] the nickname this member has, or `nil` if it has none. + attr_reader :nick + alias_method :nickname, :nick + + # @return [Array] the roles this member has. + attr_reader :roles + + # @return [Server] the server this member is on. + attr_reader :server + end + + # A member is a user on a server. It differs from regular users in that it has roles, voice statuses and things like + # that. + class Member < DelegateClass(User) + # @return [true, false] whether this member is muted server-wide. + def mute + voice_state_attribute(:mute) + end + + # @return [true, false] whether this member is deafened server-wide. + def deaf + voice_state_attribute(:deaf) + end + + # @return [true, false] whether this member has muted themselves. + def self_mute + voice_state_attribute(:self_mute) + end + + # @return [true, false] whether this member has deafened themselves. + def self_deaf + voice_state_attribute(:self_deaf) + end + + # @return [Channel] the voice channel this member is in. + def voice_channel + voice_state_attribute(:voice_channel) + end + + alias_method :muted?, :mute + alias_method :deafened?, :deaf + alias_method :self_muted?, :self_mute + alias_method :self_deafened?, :self_deaf + + include MemberAttributes + + # @!visibility private + def initialize(data, server, bot) + @bot = bot + + @user = bot.ensure_user(data['user']) + super @user # Initialize the delegate class + + # Somehow, Discord doesn't send the server ID in the standard member format... + raise ArgumentError, 'Cannot create a member without any information about the server!' if server.nil? && data['guild_id'].nil? + + @server = server || bot.server(data['guild_id'].to_i) + + # Initialize the roles by getting the roles from the server one-by-one + update_roles(data['roles']) + + @nick = data['nick'] + @joined_at = data['joined_at'] ? Time.parse(data['joined_at']) : nil + @boosting_since = data['premium_since'] ? Time.parse(data['premium_since']) : nil + end + + # @return [true, false] if this user is a Nitro Booster of this server. + def boosting? + !@boosting_since.nil? + end + + # @return [true, false] whether this member is the server owner. + def owner? + @server.owner == self + end + + # @param role [Role, String, Integer] the role to check or its ID. + # @return [true, false] whether this member has the specified role. + def role?(role) + role = role.resolve_id + @roles.any? { |e| e.id == role } + end + + # @see Member#set_roles + def roles=(role) + set_roles(role) + end + + # Bulk sets a member's roles. + # @param role [Role, Array] The role(s) to set. + # @param reason [String] The reason the user's roles are being changed. + def set_roles(role, reason = nil) + role_ids = role_id_array(role) + API::Server.update_member(@bot.token, @server.id, @user.id, roles: role_ids, reason: reason) + end + + # Adds and removes roles from a member. + # @param add [Role, Array] The role(s) to add. + # @param remove [Role, Array] The role(s) to remove. + # @param reason [String] The reason the user's roles are being changed. + # @example Remove the 'Member' role from a user, and add the 'Muted' role to them. + # to_add = server.roles.find {|role| role.name == 'Muted'} + # to_remove = server.roles.find {|role| role.name == 'Member'} + # member.modify_roles(to_add, to_remove) + def modify_roles(add, remove, reason = nil) + add_role_ids = role_id_array(add) + remove_role_ids = role_id_array(remove) + old_role_ids = @roles.map(&:id) + new_role_ids = (old_role_ids - remove_role_ids + add_role_ids).uniq + + API::Server.update_member(@bot.token, @server.id, @user.id, roles: new_role_ids, reason: reason) + end + + # Adds one or more roles to this member. + # @param role [Role, Array, String, Integer] The role(s), or their ID(s), to add. + # @param reason [String] The reason the user's roles are being changed. + def add_role(role, reason = nil) + role_ids = role_id_array(role) + + if role_ids.count == 1 + API::Server.add_member_role(@bot.token, @server.id, @user.id, role_ids[0], reason) + else + old_role_ids = @roles.map(&:id) + new_role_ids = (old_role_ids + role_ids).uniq + API::Server.update_member(@bot.token, @server.id, @user.id, roles: new_role_ids, reason: reason) + end + end + + # Removes one or more roles from this member. + # @param role [Role, Array] The role(s) to remove. + # @param reason [String] The reason the user's roles are being changed. + def remove_role(role, reason = nil) + role_ids = role_id_array(role) + + if role_ids.count == 1 + API::Server.remove_member_role(@bot.token, @server.id, @user.id, role_ids[0], reason) + else + old_role_ids = @roles.map(&:id) + new_role_ids = old_role_ids.reject { |i| role_ids.include?(i) } + API::Server.update_member(@bot.token, @server.id, @user.id, roles: new_role_ids, reason: reason) + end + end + + # @return [Role] the highest role this member has. + def highest_role + @roles.max_by(&:position) + end + + # @return [Role, nil] the role this member is being hoisted with. + def hoist_role + hoisted_roles = @roles.select(&:hoist) + return nil if hoisted_roles.empty? + + hoisted_roles.max_by(&:position) + end + + # @return [Role, nil] the role this member is basing their colour on. + def colour_role + coloured_roles = @roles.select { |v| v.colour.combined.nonzero? } + return nil if coloured_roles.empty? + + coloured_roles.max_by(&:position) + end + alias_method :color_role, :colour_role + + # @return [ColourRGB, nil] the colour this member has. + def colour + return nil unless colour_role + + colour_role.color + end + alias_method :color, :colour + + # Server deafens this member. + def server_deafen + API::Server.update_member(@bot.token, @server.id, @user.id, deaf: true) + end + + # Server undeafens this member. + def server_undeafen + API::Server.update_member(@bot.token, @server.id, @user.id, deaf: false) + end + + # Server mutes this member. + def server_mute + API::Server.update_member(@bot.token, @server.id, @user.id, mute: true) + end + + # Server unmutes this member. + def server_unmute + API::Server.update_member(@bot.token, @server.id, @user.id, mute: false) + end + + # @see Member#set_nick + def nick=(nick) + set_nick(nick) + end + + alias_method :nickname=, :nick= + + # Sets or resets this member's nickname. Requires the Change Nickname permission for the bot itself and Manage + # Nicknames for other users. + # @param nick [String, nil] The string to set the nickname to, or nil if it should be reset. + # @param reason [String] The reason the user's nickname is being changed. + def set_nick(nick, reason = nil) + # Discord uses the empty string to signify 'no nickname' so we convert nil into that + nick ||= '' + + if @user.current_bot? + API::User.change_own_nickname(@bot.token, @server.id, nick, reason) + else + API::Server.update_member(@bot.token, @server.id, @user.id, nick: nick, reason: nil) + end + end + + alias_method :set_nickname, :set_nick + + # @return [String] the name the user displays as (nickname if they have one, username otherwise) + def display_name + nickname || username + end + + # Update this member's roles + # @note For internal use only. + # @!visibility private + def update_roles(role_ids) + @roles = [@server.role(@server.id)] + role_ids.each do |id| + # It is possible for members to have roles that do not exist + # on the server any longer. See https://github.com/shardlab/discordrb/issues/371 + role = @server.role(id) + @roles << role if role + end + end + + # Update this member's nick + # @note For internal use only. + # @!visibility private + def update_nick(nick) + @nick = nick + end + + # Update this member's boosting timestamp + # @note For internal user only. + # @!visibility private + def update_boosting_since(time) + @boosting_since = time + end + + # Update this member + # @note For internal use only. + # @!visibility private + def update_data(data) + update_roles(data['roles']) if data['roles'] + update_nick(data['nick']) if data.key?('nick') + @mute = data['mute'] if data.key?('mute') + @deaf = data['deaf'] if data.key?('deaf') + + @joined_at = Time.parse(data['joined_at']) if data['joined_at'] + end + + include PermissionCalculator + + # Overwriting inspect for debug purposes + def inspect + "" + end + + private + + # Utility method to get a list of role IDs from one role or an array of roles + def role_id_array(role) + if role.is_a? Array + role.map(&:resolve_id) + else + [role.resolve_id] + end + end + + # Utility method to get data out of this member's voice state + def voice_state_attribute(name) + voice_state = @server.voice_states[@user.id] + voice_state&.send name + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/message.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/message.rb new file mode 100644 index 0000000..9112711 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/message.rb @@ -0,0 +1,334 @@ +# frozen_string_literal: true + +module Discordrb + # A message on Discord that was sent to a text channel + class Message + include IDObject + + # @return [String] the content of this message. + attr_reader :content + alias_method :text, :content + alias_method :to_s, :content + + # @return [Member, User] the user that sent this message. (Will be a {Member} most of the time, it should only be a + # {User} for old messages when the author has left the server since then) + attr_reader :author + alias_method :user, :author + alias_method :writer, :author + + # @return [Channel] the channel in which this message was sent. + attr_reader :channel + + # @return [Time] the timestamp at which this message was sent. + attr_reader :timestamp + + # @return [Time] the timestamp at which this message was edited. `nil` if the message was never edited. + attr_reader :edited_timestamp + alias_method :edit_timestamp, :edited_timestamp + + # @return [Array] the users that were mentioned in this message. + attr_reader :mentions + + # @return [Array] the roles that were mentioned in this message. + attr_reader :role_mentions + + # @return [Array] the files attached to this message. + attr_reader :attachments + + # @return [Array] the embed objects contained in this message. + attr_reader :embeds + + # @return [Array] the reaction objects contained in this message. + attr_reader :reactions + + # @return [true, false] whether the message used Text-To-Speech (TTS) or not. + attr_reader :tts + alias_method :tts?, :tts + + # @return [String] used for validating a message was sent. + attr_reader :nonce + + # @return [true, false] whether the message was edited or not. + attr_reader :edited + alias_method :edited?, :edited + + # @return [true, false] whether the message mentioned everyone or not. + attr_reader :mention_everyone + alias_method :mention_everyone?, :mention_everyone + alias_method :mentions_everyone?, :mention_everyone + + # @return [true, false] whether the message is pinned or not. + attr_reader :pinned + alias_method :pinned?, :pinned + + # @return [Server, nil] the server in which this message was sent. + attr_reader :server + + # @return [Integer, nil] the webhook ID that sent this message, or `nil` if it wasn't sent through a webhook. + attr_reader :webhook_id + + # The discriminator that webhook user accounts have. + ZERO_DISCRIM = '0000' + + # @!visibility private + def initialize(data, bot) + @bot = bot + @content = data['content'] + @channel = bot.channel(data['channel_id'].to_i) + @pinned = data['pinned'] + @tts = data['tts'] + @nonce = data['nonce'] + @mention_everyone = data['mention_everyone'] + + @referenced_message = Message.new(data['referenced_message'], bot) if data['referenced_message'] + @message_reference = data['message_reference'] + + @server = bot.server(data['guild_id'].to_i) if data['guild_id'] + + @author = if data['author'] + if data['author']['discriminator'] == ZERO_DISCRIM + # This is a webhook user! It would be pointless to try to resolve a member here, so we just create + # a User and return that instead. + Discordrb::LOGGER.debug("Webhook user: #{data['author']['id']}") + User.new(data['author'], @bot) + elsif @channel.private? + # Turn the message user into a recipient - we can't use the channel recipient + # directly because the bot may also send messages to the channel + Recipient.new(bot.user(data['author']['id'].to_i), @channel, bot) + else + member = @channel.server.member(data['author']['id'].to_i) + + if member + member.update_data(data['member']) if data['member'] + else + Discordrb::LOGGER.debug("Member with ID #{data['author']['id']} not cached (possibly left the server).") + member = if data['member'] + member_data = data['author'].merge(data['member']) + Member.new(member_data, bot) + else + @bot.ensure_user(data['author']) + end + end + + member + end + end + + @webhook_id = data['webhook_id'].to_i if data['webhook_id'] + + @timestamp = Time.parse(data['timestamp']) if data['timestamp'] + @edited_timestamp = data['edited_timestamp'].nil? ? nil : Time.parse(data['edited_timestamp']) + @edited = !@edited_timestamp.nil? + @id = data['id'].to_i + + @emoji = [] + + @reactions = [] + + data['reactions']&.each do |element| + @reactions << Reaction.new(element) + end + + @mentions = [] + + data['mentions']&.each do |element| + @mentions << bot.ensure_user(element) + end + + @role_mentions = [] + + # Role mentions can only happen on public servers so make sure we only parse them there + if @channel.text? + data['mention_roles']&.each do |element| + @role_mentions << @channel.server.role(element.to_i) + end + end + + @attachments = [] + @attachments = data['attachments'].map { |e| Attachment.new(e, self, @bot) } if data['attachments'] + + @embeds = [] + @embeds = data['embeds'].map { |e| Embed.new(e, self) } if data['embeds'] + end + + # Replies to this message with the specified content. + # @deprecated Please use {#respond}. + # @see Channel#send_message + def reply(content) + @channel.send_message(content) + end + + # Sends a message to this channel. + # @param content [String] The content to send. Should not be longer than 2000 characters or it will result in an error. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param mention_user [true, false] Whether the user that is being replied to should be pinged by the reply. + # @return [Message] the message that was sent. + def reply!(content, tts: false, embed: nil, attachments: nil, allowed_mentions: {}, mention_user: false) + allowed_mentions = { parse: [] } if allowed_mentions == false + allowed_mentions = allowed_mentions.to_hash.transform_keys(&:to_sym) + allowed_mentions[:replied_user] = mention_user + + respond(content, tts, embed, attachments, allowed_mentions, self) + end + + # (see Channel#send_message) + def respond(content, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + @channel.send_message(content, tts, embed, attachments, allowed_mentions, message_reference) + end + + # Edits this message to have the specified content instead. + # You can only edit your own messages. + # @param new_content [String] the new content the message should have. + # @param new_embed [Hash, Discordrb::Webhooks::Embed, nil] The new embed the message should have. If `nil` the message will be changed to have no embed. + # @return [Message] the resulting message. + def edit(new_content, new_embed = nil) + response = API::Channel.edit_message(@bot.token, @channel.id, @id, new_content, [], new_embed ? new_embed.to_hash : nil) + Message.new(JSON.parse(response), @bot) + end + + # Deletes this message. + def delete(reason = nil) + API::Channel.delete_message(@bot.token, @channel.id, @id, reason) + nil + end + + # Pins this message + def pin(reason = nil) + API::Channel.pin_message(@bot.token, @channel.id, @id, reason) + @pinned = true + nil + end + + # Unpins this message + def unpin(reason = nil) + API::Channel.unpin_message(@bot.token, @channel.id, @id, reason) + @pinned = false + nil + end + + # Add an {Await} for a message with the same user and channel. + # @see Bot#add_await + # @deprecated Will be changed to blocking behavior in v4.0. Use {#await!} instead. + def await(key, attributes = {}, &block) + @bot.add_await(key, Discordrb::Events::MessageEvent, { from: @author.id, in: @channel.id }.merge(attributes), &block) + end + + # Add a blocking {Await} for a message with the same user and channel. + # @see Bot#add_await! + def await!(attributes = {}, &block) + @bot.add_await!(Discordrb::Events::MessageEvent, { from: @author.id, in: @channel.id }.merge(attributes), &block) + end + + # @return [true, false] whether this message was sent by the current {Bot}. + def from_bot? + @author&.current_bot? + end + + # @return [true, false] whether this message has been sent over a webhook. + def webhook? + !@webhook_id.nil? + end + + # @return [Array] the emotes that were used/mentioned in this message. + def emoji + return if @content.nil? + return @emoji unless @emoji.empty? + + @emoji = @bot.parse_mentions(@content).select { |el| el.is_a? Discordrb::Emoji } + end + + # Check if any emoji were used in this message. + # @return [true, false] whether or not any emoji were used + def emoji? + emoji&.empty? + end + + # Check if any reactions were used in this message. + # @return [true, false] whether or not this message has reactions + def reactions? + !@reactions.empty? + end + + # Returns the reactions made by the current bot or user. + # @return [Array] the reactions + def my_reactions + @reactions.select(&:me) + end + + # Reacts to a message. + # @param reaction [String, #to_reaction] the unicode emoji or {Emoji} + def create_reaction(reaction) + reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction) + API::Channel.create_reaction(@bot.token, @channel.id, @id, reaction) + nil + end + + alias_method :react, :create_reaction + + # Returns the list of users who reacted with a certain reaction. + # @param reaction [String, #to_reaction] the unicode emoji or {Emoji} + # @param limit [Integer] the limit of how many users to retrieve. `nil` will return all users + # @example Get all the users that reacted with a thumbs up. + # thumbs_up_reactions = message.reacted_with("\u{1F44D}") + # @return [Array] the users who used this reaction + def reacted_with(reaction, limit: 100) + reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction) + paginator = Paginator.new(limit, :down) do |last_page| + after_id = last_page.last.id if last_page + last_page = JSON.parse(API::Channel.get_reactions(@bot.token, @channel.id, @id, reaction, nil, after_id, limit)) + last_page.map { |d| User.new(d, @bot) } + end + paginator.to_a + end + + # Deletes a reaction made by a user on this message. + # @param user [User, String, Integer] the user or user ID who used this reaction + # @param reaction [String, #to_reaction] the reaction to remove + def delete_reaction(user, reaction) + reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction) + API::Channel.delete_user_reaction(@bot.token, @channel.id, @id, reaction, user.resolve_id) + end + + # Deletes this client's reaction on this message. + # @param reaction [String, #to_reaction] the reaction to remove + def delete_own_reaction(reaction) + reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction) + API::Channel.delete_own_reaction(@bot.token, @channel.id, @id, reaction) + end + + # Removes all reactions from this message. + def delete_all_reactions + API::Channel.delete_all_reactions(@bot.token, @channel.id, @id) + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + # @return [String] a URL that a user can use to navigate to this message in the client + def link + "https://discord.com/channels/#{@server&.id || '@me'}/#{@channel.id}/#{@id}" + end + + alias_method :jump_link, :link + + # Whether or not this message was sent in reply to another message + # @return [true, false] + def reply? + !@referenced_message.nil? + end + + # @return [Message, nil] the Message this Message was sent in reply to. + def referenced_message + return @referenced_message if @referenced_message + return nil unless @message_reference + + referenced_channel = @bot.channel(@message_reference['channel_id']) + @referenced_message = referenced_channel.message(@message_reference['message_id']) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/overwrite.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/overwrite.rb new file mode 100644 index 0000000..8e86cc3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/overwrite.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Discordrb + # A permissions overwrite, when applied to channels describes additional + # permissions a member needs to perform certain actions in context. + class Overwrite + # @return [Integer] ID of the thing associated with this overwrite type + attr_accessor :id + + # @return [Symbol] either :role or :member + attr_accessor :type + + # @return [Permissions] allowed permissions for this overwrite type + attr_accessor :allow + + # @return [Permissions] denied permissions for this overwrite type + attr_accessor :deny + + # Creates a new Overwrite object + # @example Create an overwrite for a role that can mention everyone, send TTS messages, but can't create instant invites + # allow = Discordrb::Permissions.new + # allow.can_mention_everyone = true + # allow.can_send_tts_messages = true + # + # deny = Discordrb::Permissions.new + # deny.can_create_instant_invite = true + # + # # Find some role by name + # role = server.roles.find { |r| r.name == 'some role' } + # + # Overwrite.new(role, allow: allow, deny: deny) + # @example Create an overwrite by ID and permissions bits + # Overwrite.new(120571255635181568, type: 'member', allow: 1024, deny: 0) + # @param object [Integer, #id] the ID or object this overwrite is for + # @param type [String] the type of object this overwrite is for (only required if object is an Integer) + # @param allow [Integer, Permissions] allowed permissions for this overwrite, by bits or a Permissions object + # @param deny [Integer, Permissions] denied permissions for this overwrite, by bits or a Permissions object + # @raise [ArgumentError] if type is not :member or :role + def initialize(object = nil, type: nil, allow: 0, deny: 0) + if type + type = type.to_sym + raise ArgumentError, 'Overwrite type must be :member or :role' unless (type != :member) || (type != :role) + end + + @id = object.respond_to?(:id) ? object.id : object + + @type = case object + when User, Member, Recipient, Profile + :member + when Role + :role + else + type + end + + @allow = allow.is_a?(Permissions) ? allow : Permissions.new(allow) + @deny = deny.is_a?(Permissions) ? deny : Permissions.new(deny) + end + + # Comparison by attributes [:id, :type, :allow, :deny] + def ==(other) + false unless other.is_a? Discordrb::Overwrite + id == other.id && + type == other.type && + allow == other.allow && + deny == other.deny + end + + # @return [Overwrite] create an overwrite from a hash payload + # @!visibility private + def self.from_hash(data) + new( + data['id'].to_i, + type: data['type'], + allow: Permissions.new(data['allow']), + deny: Permissions.new(data['deny']) + ) + end + + # @return [Overwrite] copies an overwrite from another Overwrite + # @!visibility private + def self.from_other(other) + new( + other.id, + type: other.type, + allow: Permissions.new(other.allow.bits), + deny: Permissions.new(other.deny.bits) + ) + end + + # @return [Hash] hash representation of an overwrite + # @!visibility private + def to_hash + { + id: id, + type: type, + allow: allow.bits, + deny: deny.bits + } + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/profile.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/profile.rb new file mode 100644 index 0000000..91f98c8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/profile.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Discordrb + # This class is a special variant of User that represents the bot's user profile (things like own username and the avatar). + # It can be accessed using {Bot#profile}. + class Profile < User + # Whether or not the user is the bot. The Profile can only ever be the bot user, so this always returns true. + # @return [true] + def current_bot? + true + end + + # Sets the bot's username. + # @param username [String] The new username. + def username=(username) + update_profile_data(username: username) + end + + alias_method :name=, :username= + + # Changes the bot's avatar. + # @param avatar [String, #read] A JPG file to be used as the avatar, either + # something readable (e.g. File Object) or as a data URL. + def avatar=(avatar) + if avatar.respond_to? :read + # Set the file to binary mode if supported, so we don't get problems with Windows + avatar.binmode if avatar.respond_to?(:binmode) + + avatar_string = 'data:image/jpg;base64,' + avatar_string += Base64.strict_encode64(avatar.read) + update_profile_data(avatar: avatar_string) + else + update_profile_data(avatar: avatar) + end + end + + # Updates the cached profile data with the new one. + # @note For internal use only. + # @!visibility private + def update_data(new_data) + @username = new_data[:username] || @username + @avatar_id = new_data[:avatar_id] || @avatar_id + end + + # Sets the user status setting to Online. + # @note Only usable on User accounts. + def online + update_profile_status_setting('online') + end + + # Sets the user status setting to Idle. + # @note Only usable on User accounts. + def idle + update_profile_status_setting('idle') + end + + # Sets the user status setting to Do Not Disturb. + # @note Only usable on User accounts. + def dnd + update_profile_status_setting('dnd') + end + + alias_method(:busy, :dnd) + + # Sets the user status setting to Invisible. + # @note Only usable on User accounts. + def invisible + update_profile_status_setting('invisible') + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + private + + # Internal handler for updating the user's status setting + def update_profile_status_setting(status) + API::User.change_status_setting(@bot.token, status) + end + + def update_profile_data(new_data) + API::User.update_profile(@bot.token, + nil, nil, + new_data[:username] || @username, + new_data.key?(:avatar) ? new_data[:avatar] : @avatar_id) + update_data(new_data) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/reaction.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/reaction.rb new file mode 100644 index 0000000..202d579 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/reaction.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Discordrb + # A reaction to a message. + class Reaction + # @return [Integer] the amount of users who have reacted with this reaction + attr_reader :count + + # @return [true, false] whether the current bot or user used this reaction + attr_reader :me + alias_method :me?, :me + + # @return [Integer] the ID of the emoji, if it was custom + attr_reader :id + + # @return [String] the name or unicode representation of the emoji + attr_reader :name + + def initialize(data) + @count = data['count'] + @me = data['me'] + @id = data['emoji']['id'].nil? ? nil : data['emoji']['id'].to_i + @name = data['emoji']['name'] + end + + # Converts this Reaction into a string that can be sent back to Discord in other reaction endpoints. + # If ID is present, it will be rendered into the form of `name:id`. + # @return [String] the name of this reaction, including the ID if it is a custom emoji + def to_s + id.nil? ? name : "#{name}:#{id}" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/recipient.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/recipient.rb new file mode 100644 index 0000000..600c735 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/recipient.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Discordrb + # Recipients are members on private channels - they exist for completeness purposes, but all + # the attributes will be empty. + class Recipient < DelegateClass(User) + include MemberAttributes + + # @return [Channel] the private channel this recipient is the recipient of. + attr_reader :channel + + # @!visibility private + def initialize(user, channel, bot) + @bot = bot + @channel = channel + raise ArgumentError, 'Tried to create a recipient for a public channel!' unless @channel.private? + + @user = user + super @user + + # Member attributes + @mute = @deaf = @self_mute = @self_deaf = false + @voice_channel = nil + @server = nil + @roles = [] + @joined_at = @channel.creation_time + end + + # Overwriting inspect for debug purposes + def inspect + "" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/role.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/role.rb new file mode 100644 index 0000000..a2addd2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/role.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module Discordrb + # A Discord role that contains permissions and applies to certain users + class Role + include IDObject + + # @return [Permissions] this role's permissions. + attr_reader :permissions + + # @return [String] this role's name ("new role" if it hasn't been changed) + attr_reader :name + + # @return [Server] the server this role belongs to + attr_reader :server + + # @return [true, false] whether or not this role should be displayed separately from other users + attr_reader :hoist + + # @return [true, false] whether or not this role is managed by an integration or a bot + attr_reader :managed + alias_method :managed?, :managed + + # @return [true, false] whether this role can be mentioned using a role mention + attr_reader :mentionable + alias_method :mentionable?, :mentionable + + # @return [ColourRGB] the role colour + attr_reader :colour + alias_method :color, :colour + + # @return [Integer] the position of this role in the hierarchy + attr_reader :position + + # This class is used internally as a wrapper to a Role object that allows easy writing of permission data. + class RoleWriter + # @!visibility private + def initialize(role, token) + @role = role + @token = token + end + + # Write the specified permission data to the role, without updating the permission cache + # @param bits [Integer] The packed permissions to write. + def write(bits) + @role.send(:packed=, bits, false) + end + + # The inspect method is overridden, in this case to prevent the token being leaked + def inspect + "" + end + end + + # @!visibility private + def initialize(data, bot, server = nil) + @bot = bot + @server = server + @permissions = Permissions.new(data['permissions'], RoleWriter.new(self, @bot.token)) + @name = data['name'] + @id = data['id'].to_i + + @position = data['position'] + + @hoist = data['hoist'] + @mentionable = data['mentionable'] + @managed = data['managed'] + + @colour = ColourRGB.new(data['color']) + end + + # @return [String] a string that will mention this role, if it is mentionable. + def mention + "<@&#{@id}>" + end + + # @return [Array] an array of members who have this role. + # @note This requests a member chunk if it hasn't for the server before, which may be slow initially + def members + @server.members.select { |m| m.role? self } + end + + alias_method :users, :members + + # Updates the data cache from another Role object + # @note For internal use only + # @!visibility private + def update_from(other) + @permissions = other.permissions + @name = other.name + @hoist = other.hoist + @colour = other.colour + @position = other.position + @managed = other.managed + end + + # Updates the data cache from a hash containing data + # @note For internal use only + # @!visibility private + def update_data(new_data) + @name = new_data[:name] || new_data['name'] || @name + @hoist = new_data['hoist'] unless new_data['hoist'].nil? + @hoist = new_data[:hoist] unless new_data[:hoist].nil? + @colour = new_data[:colour] || (new_data['color'] ? ColourRGB.new(new_data['color']) : @colour) + end + + # Sets the role name to something new + # @param name [String] The name that should be set + def name=(name) + update_role_data(name: name) + end + + # Changes whether or not this role is displayed at the top of the user list + # @param hoist [true, false] The value it should be changed to + def hoist=(hoist) + update_role_data(hoist: hoist) + end + + # Changes whether or not this role can be mentioned + # @param mentionable [true, false] The value it should be changed to + def mentionable=(mentionable) + update_role_data(mentionable: mentionable) + end + + # Sets the role colour to something new + # @param colour [ColourRGB] The new colour + def colour=(colour) + update_role_data(colour: colour) + end + + alias_method :color=, :colour= + + # Changes this role's permissions to a fixed bitfield. This allows setting multiple permissions at once with just + # one API call. + # + # Information on how this bitfield is structured can be found at + # https://discord.com/developers/docs/topics/permissions. + # @example Remove all permissions from a role + # role.packed = 0 + # @param packed [Integer] A bitfield with the desired permissions value. + # @param update_perms [true, false] Whether the internal data should also be updated. This should always be true + # when calling externally. + def packed=(packed, update_perms = true) + update_role_data(permissions: packed) + @permissions.bits = packed if update_perms + end + + # Moves this role above another role in the list. + # @param other [Role, String, Integer, nil] The role, or its ID, above which this role should be moved. If it is `nil`, + # the role will be moved above the @everyone role. + # @return [Integer] the new position of this role + def sort_above(other = nil) + other = @server.role(other.resolve_id) if other + roles = @server.roles.sort_by(&:position) + roles.delete_at(@position) + + index = other ? roles.index { |role| role.id == other.id } + 1 : 1 + roles.insert(index, self) + + updated_roles = roles.map.with_index { |role, position| { id: role.id, position: position } } + @server.update_role_positions(updated_roles) + index + end + + alias_method :move_above, :sort_above + + # Deletes this role. This cannot be undone without recreating the role! + # @param reason [String] the reason for this role's deletion + def delete(reason = nil) + API::Server.delete_role(@bot.token, @server.id, @id, reason) + @server.delete_role(@id) + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + private + + def update_role_data(new_data) + API::Server.update_role(@bot.token, @server.id, @id, + new_data[:name] || @name, + (new_data[:colour] || @colour).combined, + new_data[:hoist].nil? ? @hoist : new_data[:hoist], + new_data[:mentionable].nil? ? @mentionable : new_data[:mentionable], + new_data[:permissions] || @permissions.bits) + update_data(new_data) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/server.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/server.rb new file mode 100644 index 0000000..05c380d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/server.rb @@ -0,0 +1,1002 @@ +# frozen_string_literal: true + +module Discordrb + # Basic attributes a server should have + module ServerAttributes + # @return [String] this server's name. + attr_reader :name + + # @return [String] the hexadecimal ID used to identify this server's icon. + attr_reader :icon_id + + # Utility function to get the URL for the icon image + # @return [String] the URL to the icon image + def icon_url + return nil unless @icon_id + + API.icon_url(@id, @icon_id) + end + end + + # A server on Discord + class Server + include IDObject + include ServerAttributes + + # @return [String] the ID of the region the server is on (e.g. `amsterdam`). + attr_reader :region_id + + # @return [Array] an array of all the channels (text and voice) on this server. + attr_reader :channels + + # @return [Array] an array of all the roles created on this server. + attr_reader :roles + + # @return [Hash Emoji>] a hash of all the emoji available on this server. + attr_reader :emoji + alias_method :emojis, :emoji + + # @return [true, false] whether or not this server is large (members > 100). If it is, + # it means the members list may be inaccurate for a couple seconds after starting up the bot. + attr_reader :large + alias_method :large?, :large + + # @return [Array] the features of the server (eg. "INVITE_SPLASH") + attr_reader :features + + # @return [Integer] the absolute number of members on this server, offline or not. + attr_reader :member_count + + # @return [Integer] the amount of time after which a voice user gets moved into the AFK channel, in seconds. + attr_reader :afk_timeout + + # @return [Hash VoiceState>] the hash (user ID => voice state) of voice states of members on this server + attr_reader :voice_states + + # The server's amount of Nitro boosters. + # @return [Integer] the amount of boosters, 0 if no one has boosted. + attr_reader :booster_count + + # The server's Nitro boost level. + # @return [Integer] the boost level, 0 if no level. + attr_reader :boost_level + + # @!visibility private + def initialize(data, bot) + @bot = bot + @owner_id = data['owner_id'].to_i + @id = data['id'].to_i + + process_channels(data['channels']) + update_data(data) + + @large = data['large'] + @member_count = data['member_count'] + @splash_id = nil + @banner_id = nil + @features = data['features'].map { |element| element.downcase.to_sym } + @members = {} + @voice_states = {} + @emoji = {} + + process_roles(data['roles']) + process_emoji(data['emojis']) + process_members(data['members']) + process_presences(data['presences']) + process_voice_states(data['voice_states']) + + # Whether this server's members have been chunked (resolved using op 8 and GUILD_MEMBERS_CHUNK) yet + @chunked = false + @processed_chunk_members = 0 + + @booster_count = data['premium_subscription_count'] || 0 + @boost_level = data['premium_tier'] + end + + # @return [Member] The server owner. + def owner + @owner ||= member(@owner_id) + end + + # The default channel is the text channel on this server with the highest position + # that the bot has Read Messages permission on. + # @param send_messages [true, false] whether to additionally consider if the bot has Send Messages permission + # @return [Channel, nil] The default channel on this server, or `nil` if there are no channels that the bot can read. + def default_channel(send_messages = false) + bot_member = member(@bot.profile) + text_channels.sort_by { |e| [e.position, e.id] }.find do |e| + if send_messages + bot_member.can_read_messages?(e) && bot_member.can_send_messages?(e) + else + bot_member.can_read_messages?(e) + end + end + end + + alias_method :general_channel, :default_channel + + # @return [Role] The @everyone role on this server + def everyone_role + role(@id) + end + + # Gets a role on this server based on its ID. + # @param id [String, Integer] The role ID to look for. + # @return [Role, nil] The role identified by the ID, or `nil` if it couldn't be found. + def role(id) + id = id.resolve_id + @roles.find { |e| e.id == id } + end + + # Gets a member on this server based on user ID + # @param id [Integer] The user ID to look for + # @param request [true, false] Whether the member should be requested from Discord if it's not cached + def member(id, request = true) + id = id.resolve_id + return @members[id] if member_cached?(id) + return nil unless request + + member = @bot.member(self, id) + @members[id] = member unless member.nil? + rescue StandardError + nil + end + + # @return [Array] an array of all the members on this server. + def members + return @members.values if @chunked + + @bot.debug("Members for server #{@id} not chunked yet - initiating") + @bot.request_chunks(@id) + sleep 0.05 until @chunked + @members.values + end + + alias_method :users, :members + + # @return [Array] an array of all the bot members on this server. + def bot_members + members.select(&:bot_account?) + end + + # @return [Array] an array of all the non bot members on this server. + def non_bot_members + members.reject(&:bot_account?) + end + + # @return [Member] the bot's own `Member` on this server + def bot + member(@bot.profile) + end + + # @return [Array] an array of all the integrations connected to this server. + def integrations + integration = JSON.parse(API::Server.integrations(@bot.token, @id)) + integration.map { |element| Integration.new(element, @bot, self) } + end + + # @param action [Symbol] The action to only include. + # @param user [User, String, Integer] The user, or their ID, to filter entries to. + # @param limit [Integer] The amount of entries to limit it to. + # @param before [Entry, String, Integer] The entry, or its ID, to use to not include all entries after it. + # @return [AuditLogs] The server's audit logs. + def audit_logs(action: nil, user: nil, limit: 50, before: nil) + raise 'Invalid audit log action!' if action && AuditLogs::ACTIONS.key(action).nil? + + action = AuditLogs::ACTIONS.key(action) + user = user.resolve_id if user + before = before.resolve_id if before + AuditLogs.new(self, @bot, JSON.parse(API::Server.audit_logs(@bot.token, @id, limit, user, action, before))) + end + + # Cache @embed + # @note For internal use only + # @!visibility private + def cache_embed_data + data = JSON.parse(API::Server.embed(@bot.token, @id)) + @embed_enabled = data['enabled'] + @embed_channel_id = data['channel_id'] + end + + # @return [true, false] whether or not the server has widget enabled + def embed_enabled? + cache_embed_data if @embed_enabled.nil? + @embed_enabled + end + alias_method :widget_enabled, :embed_enabled? + alias_method :widget?, :embed_enabled? + alias_method :embed?, :embed_enabled? + + # @return [Channel, nil] the channel the server embed will make an invite for. + def embed_channel + cache_embed_data if @embed_enabled.nil? + @bot.channel(@embed_channel_id) if @embed_channel_id + end + alias_method :widget_channel, :embed_channel + + # Sets whether this server's embed (widget) is enabled + # @param value [true, false] + def embed_enabled=(value) + modify_embed(value, embed_channel) + end + + alias_method :widget_enabled=, :embed_enabled= + + # Sets whether this server's embed (widget) is enabled + # @param value [true, false] + # @param reason [String, nil] the reason to be shown in the audit log for this action + def set_embed_enabled(value, reason = nil) + modify_embed(value, embed_channel, reason) + end + + alias_method :set_widget_enabled, :set_embed_enabled + + # Changes the channel on the server's embed (widget) + # @param channel [Channel, String, Integer] the channel, or its ID, to be referenced by the embed + def embed_channel=(channel) + modify_embed(embed?, channel) + end + + alias_method :widget_channel=, :embed_channel= + + # Changes the channel on the server's embed (widget) + # @param channel [Channel, String, Integer] the channel, or its ID, to be referenced by the embed + # @param reason [String, nil] the reason to be shown in the audit log for this action + def set_embed_channel(channel, reason = nil) + modify_embed(embed?, channel, reason) + end + + alias_method :set_widget_channel, :set_embed_channel + + # Changes the channel on the server's embed (widget), and sets whether it is enabled. + # @param enabled [true, false] whether the embed (widget) is enabled + # @param channel [Channel, String, Integer] the channel, or its ID, to be referenced by the embed + # @param reason [String, nil] the reason to be shown in the audit log for this action + def modify_embed(enabled, channel, reason = nil) + cache_embed_data if @embed_enabled.nil? + channel_id = channel ? channel.resolve_id : @embed_channel_id + response = JSON.parse(API::Server.modify_embed(@bot.token, @id, enabled, channel_id, reason)) + @embed_enabled = response['enabled'] + @embed_channel_id = response['channel_id'] + end + + alias_method :modify_widget, :modify_embed + + # @param include_idle [true, false] Whether to count idle members as online. + # @param include_bots [true, false] Whether to include bot accounts in the count. + # @return [Array] an array of online members on this server. + def online_members(include_idle: false, include_bots: true) + @members.values.select do |e| + ((include_idle ? e.idle? : false) || e.online?) && (include_bots ? true : !e.bot_account?) + end + end + + alias_method :online_users, :online_members + + # Adds a member to this guild that has granted this bot's application an OAuth2 access token + # with the `guilds.join` scope. + # For more information about Discord's OAuth2 implementation, see: https://discord.com/developers/docs/topics/oauth2 + # @note Your bot must be present in this server, and have permission to create instant invites for this to work. + # @param user [User, String, Integer] the user, or ID of the user to add to this server + # @param access_token [String] the OAuth2 Bearer token that has been granted the `guilds.join` scope + # @param nick [String] the nickname to give this member upon joining + # @param roles [Role, Array] the role (or roles) to give this member upon joining + # @param deaf [true, false] whether this member will be server deafened upon joining + # @param mute [true, false] whether this member will be server muted upon joining + # @return [Member, nil] the created member, or `nil` if the user is already a member of this server. + def add_member_using_token(user, access_token, nick: nil, roles: [], deaf: false, mute: false) + user_id = user.resolve_id + roles = roles.is_a?(Array) ? roles.map(&:resolve_id) : [roles.resolve_id] + response = API::Server.add_member(@bot.token, @id, user_id, access_token, nick, roles, deaf, mute) + return nil if response.empty? + + add_member Member.new(JSON.parse(response), self, @bot) + end + + # Returns the amount of members that are candidates for pruning + # @param days [Integer] the number of days to consider for inactivity + # @return [Integer] number of members to be removed + # @raise [ArgumentError] if days is not between 1 and 30 (inclusive) + def prune_count(days) + raise ArgumentError, 'Days must be between 1 and 30' unless days.between?(1, 30) + + response = JSON.parse API::Server.prune_count(@bot.token, @id, days) + response['pruned'] + end + + # Prunes (kicks) an amount of members for inactivity + # @param days [Integer] the number of days to consider for inactivity (between 1 and 30) + # @param reason [String] The reason the for the prune. + # @return [Integer] the number of members removed at the end of the operation + # @raise [ArgumentError] if days is not between 1 and 30 (inclusive) + def begin_prune(days, reason = nil) + raise ArgumentError, 'Days must be between 1 and 30' unless days.between?(1, 30) + + response = JSON.parse API::Server.begin_prune(@bot.token, @id, days, reason) + response['pruned'] + end + + alias_method :prune, :begin_prune + + # @return [Array] an array of text channels on this server + def text_channels + @channels.select(&:text?) + end + + # @return [Array] an array of voice channels on this server + def voice_channels + @channels.select(&:voice?) + end + + # @return [Array] an array of category channels on this server + def categories + @channels.select(&:category?) + end + + # @return [Array] an array of channels on this server that are not in a category + def orphan_channels + @channels.reject { |c| c.parent || c.category? } + end + + # @return [String, nil] the widget URL to the server that displays the amount of online members in a + # stylish way. `nil` if the widget is not enabled. + def widget_url + update_data if @embed_enabled.nil? + return unless @embed_enabled + + API.widget_url(@id) + end + + # @param style [Symbol] The style the picture should have. Possible styles are: + # * `:banner1` creates a rectangular image with the server name, member count and icon, a "Powered by Discord" message on the bottom and an arrow on the right. + # * `:banner2` creates a less tall rectangular image that has the same information as `banner1`, but the Discord logo on the right - together with the arrow and separated by a diagonal separator. + # * `:banner3` creates an image similar in size to `banner1`, but it has the arrow in the bottom part, next to the Discord logo and with a "Chat now" text. + # * `:banner4` creates a tall, almost square, image that prominently features the Discord logo at the top and has a "Join my server" in a pill-style button on the bottom. The information about the server is in the same format as the other three `banner` styles. + # * `:shield` creates a very small, long rectangle, of the style you'd find at the top of GitHub `README.md` files. It features a small version of the Discord logo at the left and the member count at the right. + # @return [String, nil] the widget banner URL to the server that displays the amount of online members, + # server icon and server name in a stylish way. `nil` if the widget is not enabled. + def widget_banner_url(style) + update_data if @embed_enabled.nil? + return unless @embed_enabled + + API.widget_url(@id, style) + end + + # @return [String] the hexadecimal ID used to identify this server's splash image for their VIP invite page. + def splash_id + @splash_id ||= JSON.parse(API::Server.resolve(@bot.token, @id))['splash'] + end + alias splash_hash splash_id + + # @return [String, nil] the splash image URL for the server's VIP invite page. + # `nil` if there is no splash image. + def splash_url + splash_id if @splash_id.nil? + return nil unless @splash_id + + API.splash_url(@id, @splash_id) + end + + # @return [String] the hexadecimal ID used to identify this server's banner image, shown by the server name. + def banner_id + @banner_id ||= JSON.parse(API::Server.resolve(@bot.token, @id))['banner'] + end + + # @return [String, nil] the banner image URL for the server's banner image, or + # `nil` if there is no banner image. + def banner_url + banner_id if @banner_id.nil? + return unless banner_id + + API.banner_url(@id, @banner_id) + end + + # @return [String] a URL that a user can use to navigate to this server in the client + def link + "https://discord.com/channels/#{@id}" + end + + alias_method :jump_link, :link + + # Adds a role to the role cache + # @note For internal use only + # @!visibility private + def add_role(role) + @roles << role + end + + # Removes a role from the role cache + # @note For internal use only + # @!visibility private + def delete_role(role_id) + @roles.reject! { |r| r.id == role_id } + @members.each do |_, member| + new_roles = member.roles.reject { |r| r.id == role_id } + member.update_roles(new_roles) + end + @channels.each do |channel| + overwrites = channel.permission_overwrites.reject { |id, _| id == role_id } + channel.update_overwrites(overwrites) + end + end + + # Updates the positions of all roles on the server + # @note For internal use only + # @!visibility private + def update_role_positions(role_positions) + response = JSON.parse(API::Server.update_role_positions(@bot.token, @id, role_positions)) + response.each do |data| + updated_role = Role.new(data, @bot, self) + role(updated_role.id).update_from(updated_role) + end + end + + # Adds a member to the member cache. + # @note For internal use only + # @!visibility private + def add_member(member) + @member_count += 1 + @members[member.id] = member + end + + # Removes a member from the member cache. + # @note For internal use only + # @!visibility private + def delete_member(user_id) + @members.delete(user_id) + @member_count -= 1 + end + + # Checks whether a member is cached + # @note For internal use only + # @!visibility private + def member_cached?(user_id) + @members.include?(user_id) + end + + # Adds a member to the cache + # @note For internal use only + # @!visibility private + def cache_member(member) + @members[member.id] = member + end + + # Updates a member's voice state + # @note For internal use only + # @!visibility private + def update_voice_state(data) + user_id = data['user_id'].to_i + + if data['channel_id'] + unless @voice_states[user_id] + # Create a new voice state for the user + @voice_states[user_id] = VoiceState.new(user_id) + end + + # Update the existing voice state (or the one we just created) + channel = @channels_by_id[data['channel_id'].to_i] + @voice_states[user_id].update( + channel, + data['mute'], + data['deaf'], + data['self_mute'], + data['self_deaf'] + ) + else + # The user is not in a voice channel anymore, so delete its voice state + @voice_states.delete(user_id) + end + end + + # Creates a channel on this server with the given name. + # @note If parent is provided, permission overwrites have the follow behavior: + # + # 1. If overwrites is null, the new channel inherits the parent's permissions. + # 2. If overwrites is [], the new channel inherits the parent's permissions. + # 3. If you supply one or more overwrites, the channel will be created with those permissions and ignore the parents. + # + # @param name [String] Name of the channel to create + # @param type [Integer, Symbol] Type of channel to create (0: text, 2: voice, 4: category, 5: news, 6: store) + # @param topic [String] the topic of this channel, if it will be a text channel + # @param bitrate [Integer] the bitrate of this channel, if it will be a voice channel + # @param user_limit [Integer] the user limit of this channel, if it will be a voice channel + # @param permission_overwrites [Array, Array] permission overwrites for this channel + # @param parent [Channel, String, Integer] parent category, or its ID, for this channel to be created in. + # @param nsfw [true, false] whether this channel should be created as nsfw + # @param rate_limit_per_user [Integer] how many seconds users need to wait in between messages. + # @param reason [String] The reason the for the creation of this channel. + # @return [Channel] the created channel. + # @raise [ArgumentError] if type is not 0 (text), 2 (voice), 4 (category), 5 (news), or 6 (store) + def create_channel(name, type = 0, topic: nil, bitrate: nil, user_limit: nil, permission_overwrites: nil, parent: nil, nsfw: false, rate_limit_per_user: nil, position: nil, reason: nil) + type = Channel::TYPES[type] if type.is_a?(Symbol) + raise ArgumentError, 'Channel type must be either 0 (text), 2 (voice), 4 (category), news (5), or store (6)!' unless [0, 2, 4, 5, 6].include?(type) + + permission_overwrites.map! { |e| e.is_a?(Overwrite) ? e.to_hash : e } if permission_overwrites.is_a?(Array) + parent_id = parent.respond_to?(:resolve_id) ? parent.resolve_id : nil + response = API::Server.create_channel(@bot.token, @id, name, type, topic, bitrate, user_limit, permission_overwrites, parent_id, nsfw, rate_limit_per_user, position, reason) + Channel.new(JSON.parse(response), @bot) + end + + # Creates a role on this server which can then be modified. It will be initialized + # with the regular role defaults the client uses unless specified, i.e. name is "new role", + # permissions are the default, colour is the default etc. + # @param name [String] Name of the role to create + # @param colour [Integer, ColourRGB, #combined] The roles colour + # @param hoist [true, false] + # @param mentionable [true, false] + # @param permissions [Integer, Array, Permissions, #bits] The permissions to write to the new role. + # @param reason [String] The reason the for the creation of this role. + # @return [Role] the created role. + def create_role(name: 'new role', colour: 0, hoist: false, mentionable: false, permissions: 104_324_161, reason: nil) + colour = colour.respond_to?(:combined) ? colour.combined : colour + + permissions = if permissions.is_a?(Array) + Permissions.bits(permissions) + elsif permissions.respond_to?(:bits) + permissions.bits + else + permissions + end + + response = API::Server.create_role(@bot.token, @id, name, colour, hoist, mentionable, permissions, reason) + + role = Role.new(JSON.parse(response), @bot, self) + @roles << role + role + end + + # Adds a new custom emoji on this server. + # @param name [String] The name of emoji to create. + # @param image [String, #read] A base64 encoded string with the image data, or an object that responds to `#read`, such as `File`. + # @param roles [Array] An array of roles, or role IDs to be whitelisted for this emoji. + # @param reason [String] The reason the for the creation of this emoji. + # @return [Emoji] The emoji that has been added. + def add_emoji(name, image, roles = [], reason: nil) + image_string = image + if image.respond_to? :read + image_string = 'data:image/jpg;base64,' + image_string += Base64.strict_encode64(image.read) + end + + data = JSON.parse(API::Server.add_emoji(@bot.token, @id, image_string, name, roles.map(&:resolve_id), reason)) + new_emoji = Emoji.new(data, @bot, self) + @emoji[new_emoji.id] = new_emoji + end + + # Delete a custom emoji on this server + # @param emoji [Emoji, String, Integer] The emoji or emoji ID to be deleted. + # @param reason [String] The reason the for the deletion of this emoji. + def delete_emoji(emoji, reason: nil) + API::Server.delete_emoji(@bot.token, @id, emoji.resolve_id, reason) + end + + # Changes the name and/or role whitelist of an emoji on this server. + # @param emoji [Emoji, String, Integer] The emoji or emoji ID to edit. + # @param name [String] The new name for the emoji. + # @param roles [Array] A new array of roles, or role IDs, to whitelist. + # @param reason [String] The reason for the editing of this emoji. + # @return [Emoji] The edited emoji. + def edit_emoji(emoji, name: nil, roles: nil, reason: nil) + emoji = @emoji[emoji.resolve_id] + data = JSON.parse(API::Server.edit_emoji(@bot.token, @id, emoji.resolve_id, name || emoji.name, (roles || emoji.roles).map(&:resolve_id), reason)) + new_emoji = Emoji.new(data, @bot, self) + @emoji[new_emoji.id] = new_emoji + end + + # The amount of emoji the server can have, based on its current Nitro Boost Level. + # @return [Integer] the max amount of emoji + def max_emoji + case @level + when 1 + 100 + when 2 + 150 + when 3 + 250 + else + 50 + end + end + + # @return [Array] a list of banned users on this server and the reason they were banned. + def bans + response = JSON.parse(API::Server.bans(@bot.token, @id)) + response.map do |e| + ServerBan.new(self, User.new(e['user'], @bot), e['reason']) + end + end + + # Bans a user from this server. + # @param user [User, String, Integer] The user to ban. + # @param message_days [Integer] How many days worth of messages sent by the user should be deleted. + # @param reason [String] The reason the user is being banned. + def ban(user, message_days = 0, reason: nil) + API::Server.ban_user(@bot.token, @id, user.resolve_id, message_days, reason) + end + + # Unbans a previously banned user from this server. + # @param user [User, String, Integer] The user to unban. + # @param reason [String] The reason the user is being unbanned. + def unban(user, reason = nil) + API::Server.unban_user(@bot.token, @id, user.resolve_id, reason) + end + + # Kicks a user from this server. + # @param user [User, String, Integer] The user to kick. + # @param reason [String] The reason the user is being kicked. + def kick(user, reason = nil) + API::Server.remove_member(@bot.token, @id, user.resolve_id, reason) + end + + # Forcibly moves a user into a different voice channel. Only works if the bot has the permission needed. + # @param user [User, String, Integer] The user to move. + # @param channel [Channel, String, Integer] The voice channel to move into. + def move(user, channel) + API::Server.update_member(@bot.token, @id, user.resolve_id, channel_id: channel.resolve_id) + end + + # Deletes this server. Be aware that this is permanent and impossible to undo, so be careful! + def delete + API::Server.delete(@bot.token, @id) + end + + # Leave the server. + def leave + API::User.leave_server(@bot.token, @id) + end + + # Transfers server ownership to another user. + # @param user [User, String, Integer] The user who should become the new owner. + def owner=(user) + API::Server.transfer_ownership(@bot.token, @id, user.resolve_id) + end + + # Sets the server's name. + # @param name [String] The new server name. + def name=(name) + update_server_data(name: name) + end + + # @return [Array] collection of available voice regions to this guild + def available_voice_regions + return @available_voice_regions if @available_voice_regions + + @available_voice_regions = {} + + data = JSON.parse API::Server.regions(@bot.token, @id) + @available_voice_regions = data.map { |e| VoiceRegion.new e } + end + + # @return [VoiceRegion, nil] voice region data for this server's region + # @note This may return `nil` if this server's voice region is deprecated. + def region + available_voice_regions.find { |e| e.id == @region_id } + end + + # Moves the server to another region. This will cause a voice interruption of at most a second. + # @param region [String] The new region the server should be in. + def region=(region) + update_server_data(region: region.to_s) + end + + # Sets the server's icon. + # @param icon [String, #read] The new icon, in base64-encoded JPG format. + def icon=(icon) + if icon.respond_to? :read + icon_string = 'data:image/jpg;base64,' + icon_string += Base64.strict_encode64(icon.read) + update_server_data(icon_id: icon_string) + else + update_server_data(icon_id: icon) + end + end + + # Sets the server's AFK channel. + # @param afk_channel [Channel, nil] The new AFK channel, or `nil` if there should be none set. + def afk_channel=(afk_channel) + update_server_data(afk_channel_id: afk_channel.resolve_id) + end + + # Sets the server's system channel. + # @param system_channel [Channel, String, Integer, nil] The new system channel, or `nil` should it be disabled. + def system_channel=(system_channel) + update_server_data(system_channel_id: system_channel.resolve_id) + end + + # Sets the amount of time after which a user gets moved into the AFK channel. + # @param afk_timeout [Integer] The AFK timeout, in seconds. + def afk_timeout=(afk_timeout) + update_server_data(afk_timeout: afk_timeout) + end + + # A map of possible server verification levels to symbol names + VERIFICATION_LEVELS = { + none: 0, + low: 1, + medium: 2, + high: 3, + very_high: 4 + }.freeze + + # @return [Symbol] the verification level of the server (:none = none, :low = 'Must have a verified email on their Discord account', :medium = 'Has to be registered with Discord for at least 5 minutes', :high = 'Has to be a member of this server for at least 10 minutes', :very_high = 'Must have a verified phone on their Discord account'). + def verification_level + VERIFICATION_LEVELS.key @verification_level + end + + # Sets the verification level of the server + # @param level [Integer, Symbol] The verification level from 0-4 or Symbol (see {VERIFICATION_LEVELS}) + def verification_level=(level) + level = VERIFICATION_LEVELS[level] if level.is_a?(Symbol) + + update_server_data(verification_level: level) + end + + # A map of possible message notification levels to symbol names + NOTIFICATION_LEVELS = { + all_messages: 0, + only_mentions: 1 + }.freeze + + # @return [Symbol] the default message notifications settings of the server (:all = 'All messages', :mentions = 'Only @mentions'). + def default_message_notifications + NOTIFICATION_LEVELS.key @default_message_notifications + end + + # Sets the default message notification level + # @param notification_level [Integer, Symbol] The default message notification 0-1 or Symbol (see {NOTIFICATION_LEVELS}) + def default_message_notifications=(notification_level) + notification_level = NOTIFICATION_LEVELS[notification_level] if notification_level.is_a?(Symbol) + + update_server_data(default_message_notifications: notification_level) + end + + alias_method :notification_level=, :default_message_notifications= + + # Sets the server splash + # @param splash_hash [String] The splash hash + def splash=(splash_hash) + update_server_data(splash: splash_hash) + end + + # A map of possible content filter levels to symbol names + FILTER_LEVELS = { + disabled: 0, + members_without_roles: 1, + all_members: 2 + }.freeze + + # @return [Symbol] the explicit content filter level of the server (:none = 'Don't scan any messages.', :exclude_roles = 'Scan messages for members without a role.', :all = 'Scan messages sent by all members.'). + def explicit_content_filter + FILTER_LEVELS.key @explicit_content_filter + end + + alias_method :content_filter_level, :explicit_content_filter + + # Sets the server content filter. + # @param filter_level [Integer, Symbol] The content filter from 0-2 or Symbol (see {FILTER_LEVELS}) + def explicit_content_filter=(filter_level) + filter_level = FILTER_LEVELS[filter_level] if filter_level.is_a?(Symbol) + + update_server_data(explicit_content_filter: filter_level) + end + + # @return [true, false] whether this server has any emoji or not. + def any_emoji? + @emoji.any? + end + + alias_method :has_emoji?, :any_emoji? + alias_method :emoji?, :any_emoji? + + # Requests a list of Webhooks on the server. + # @return [Array] webhooks on the server. + def webhooks + webhooks = JSON.parse(API::Server.webhooks(@bot.token, @id)) + webhooks.map { |webhook| Webhook.new(webhook, @bot) } + end + + # Requests a list of Invites to the server. + # @return [Array] invites to the server. + def invites + invites = JSON.parse(API::Server.invites(@bot.token, @id)) + invites.map { |invite| Invite.new(invite, @bot) } + end + + # Processes a GUILD_MEMBERS_CHUNK packet, specifically the members field + # @note For internal use only + # @!visibility private + def process_chunk(members) + process_members(members) + @processed_chunk_members += members.length + LOGGER.debug("Processed one chunk on server #{@id} - length #{members.length}") + + # Don't bother with the rest of the method if it's not truly the last packet + return unless @processed_chunk_members == @member_count + + LOGGER.debug("Finished chunking server #{@id}") + + # Reset everything to normal + @chunked = true + @processed_chunk_members = 0 + end + + # @return [Channel, nil] the AFK voice channel of this server, or `nil` if none is set. + def afk_channel + @bot.channel(@afk_channel_id) if @afk_channel_id + end + + # @return [Channel, nil] the system channel (used for automatic welcome messages) of a server, or `nil` if none is set. + def system_channel + @bot.channel(@system_channel_id) if @system_channel_id + end + + # Updates the cached data with new data + # @note For internal use only + # @!visibility private + def update_data(new_data = nil) + new_data ||= JSON.parse(API::Server.resolve(@bot.token, @id)) + @name = new_data[:name] || new_data['name'] || @name + @region_id = new_data[:region] || new_data['region'] || @region_id + @icon_id = new_data[:icon] || new_data['icon'] || @icon_id + @afk_timeout = new_data[:afk_timeout] || new_data['afk_timeout'] || @afk_timeout + + afk_channel_id = new_data[:afk_channel_id] || new_data['afk_channel_id'] || @afk_channel + @afk_channel_id = afk_channel_id.nil? ? nil : afk_channel_id.resolve_id + embed_channel_id = new_data[:embed_channel_id] || new_data['embed_channel_id'] || @embed_channel + @embed_channel_id = embed_channel_id.nil? ? nil : embed_channel_id.resolve_id + system_channel_id = new_data[:system_channel_id] || new_data['system_channel_id'] || @system_channel + @system_channel_id = system_channel_id.nil? ? nil : system_channel_id.resolve_id + + @embed_enabled = new_data[:embed_enabled] || new_data['embed_enabled'] + @splash = new_data[:splash_id] || new_data['splash_id'] || @splash_id + + @verification_level = new_data[:verification_level] || new_data['verification_level'] || @verification_level + @explicit_content_filter = new_data[:explicit_content_filter] || new_data['explicit_content_filter'] || @explicit_content_filter + @default_message_notifications = new_data[:default_message_notifications] || new_data['default_message_notifications'] || @default_message_notifications + end + + # Adds a channel to this server's cache + # @note For internal use only + # @!visibility private + def add_channel(channel) + @channels << channel + @channels_by_id[channel.id] = channel + end + + # Deletes a channel from this server's cache + # @note For internal use only + # @!visibility private + def delete_channel(id) + @channels.reject! { |e| e.id == id } + @channels_by_id.delete(id) + end + + # Updates the cached emoji data with new data + # @note For internal use only + # @!visibility private + def update_emoji_data(new_data) + @emoji = {} + process_emoji(new_data['emojis']) + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + + private + + def update_server_data(new_data) + response = JSON.parse(API::Server.update(@bot.token, @id, + new_data[:name] || @name, + new_data[:region] || @region_id, + new_data[:icon_id] || @icon_id, + new_data[:afk_channel_id] || @afk_channel_id, + new_data[:afk_timeout] || @afk_timeout, + new_data[:splash] || @splash, + new_data[:default_message_notifications] || @default_message_notifications, + new_data[:verification_level] || @verification_level, + new_data[:explicit_content_filter] || @explicit_content_filter, + new_data[:system_channel_id] || @system_channel_id)) + update_data(response) + end + + def process_roles(roles) + # Create roles + @roles = [] + @roles_by_id = {} + + return unless roles + + roles.each do |element| + role = Role.new(element, @bot, self) + @roles << role + @roles_by_id[role.id] = role + end + end + + def process_emoji(emoji) + return if emoji.empty? + + emoji.each do |element| + new_emoji = Emoji.new(element, @bot, self) + @emoji[new_emoji.id] = new_emoji + end + end + + def process_members(members) + return unless members + + members.each do |element| + member = Member.new(element, self, @bot) + @members[member.id] = member + end + end + + def process_presences(presences) + # Update user statuses with presence info + return unless presences + + presences.each do |element| + next unless element['user'] + + user_id = element['user']['id'].to_i + user = @members[user_id] + if user + user.update_presence(element) + else + LOGGER.warn "Rogue presence update! #{element['user']['id']} on #{@id}" + end + end + end + + def process_channels(channels) + @channels = [] + @channels_by_id = {} + + return unless channels + + channels.each do |element| + channel = @bot.ensure_channel(element, self) + @channels << channel + @channels_by_id[channel.id] = channel + end + end + + def process_voice_states(voice_states) + return unless voice_states + + voice_states.each do |element| + update_voice_state(element) + end + end + end + + # A ban entry on a server + class ServerBan + # @return [String, nil] the reason the user was banned, if provided + attr_reader :reason + + # @return [User] the user that was banned + attr_reader :user + + # @return [Server] the server this ban belongs to + attr_reader :server + + # @!visibility private + def initialize(server, user, reason) + @server = server + @user = user + @reason = reason + end + + # Removes this ban on the associated user in the server + # @param reason [String] the reason for removing the ban + def remove(reason = nil) + @server.unban(user, reason) + end + + alias_method :unban, :remove + alias_method :lift, :remove + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/user.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/user.rb new file mode 100644 index 0000000..8548d93 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/user.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +module Discordrb + # Mixin for the attributes users should have + module UserAttributes + # @return [String] this user's username + attr_reader :username + alias_method :name, :username + + # @return [String] this user's discriminator which is used internally to identify users with identical usernames. + attr_reader :discriminator + alias_method :discrim, :discriminator + alias_method :tag, :discriminator + alias_method :discord_tag, :discriminator + + # @return [true, false] whether this user is a Discord bot account + attr_reader :bot_account + alias_method :bot_account?, :bot_account + + # @return [String] the ID of this user's current avatar, can be used to generate an avatar URL. + # @see #avatar_url + attr_accessor :avatar_id + + # Utility function to mention users in messages + # @return [String] the mention code in the form of <@id> + def mention + "<@#{@id}>" + end + + # Utility function to get Discord's distinct representation of a user, i.e. username + discriminator + # @return [String] distinct representation of user + def distinct + "#{@username}##{@discriminator}" + end + + # Utility function to get a user's avatar URL. + # @param format [String, nil] If `nil`, the URL will default to `webp` for static avatars, and will detect if the user has a `gif` avatar. You can otherwise specify one of `webp`, `jpg`, `png`, or `gif` to override this. Will always be PNG for default avatars. + # @return [String] the URL to the avatar image. + def avatar_url(format = nil) + return API::User.default_avatar(@discriminator) unless @avatar_id + + API::User.avatar_url(@id, @avatar_id, format) + end + end + + # User on Discord, including internal data like discriminators + class User + include IDObject + include UserAttributes + + # @return [Symbol] the current online status of the user (`:online`, `:offline` or `:idle`) + attr_reader :status + + # @return [ActivitySet] the activities of the user + attr_reader :activities + + # @return [Hash] the current online status (`:online`, `:idle` or `:dnd`) of the user + # on various device types (`:desktop`, `:mobile`, or `:web`). The value will be `nil` if the user is offline or invisible. + attr_reader :client_status + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @username = data['username'] + @id = data['id'].to_i + @discriminator = data['discriminator'] + @avatar_id = data['avatar'] + @roles = {} + @activities = Discordrb::ActivitySet.new + + @bot_account = false + @bot_account = true if data['bot'] + + @status = :offline + @client_status = process_client_status(data['client_status']) + end + + # Get a user's PM channel or send them a PM + # @overload pm + # Creates a private message channel for this user or returns an existing one if it already exists + # @return [Channel] the PM channel to this user. + # @overload pm(content) + # Sends a private to this user. + # @param content [String] The content to send. + # @return [Message] the message sent to this user. + def pm(content = nil) + if content + # Recursively call pm to get the channel, then send a message to it + channel = pm + channel.send_message(content) + else + # If no message was specified, return the PM channel + @bot.pm_channel(@id) + end + end + + alias_method :dm, :pm + + # Send the user a file. + # @param file [File] The file to send to the user + # @param caption [String] The caption of the file being sent + # @param filename [String] Overrides the filename of the uploaded file + # @param spoiler [true, false] Whether or not this file should appear as a spoiler. + # @return [Message] the message sent to this user. + # @example Send a file from disk + # user.send_file(File.open('rubytaco.png', 'r')) + def send_file(file, caption = nil, filename: nil, spoiler: nil) + pm.send_file(file, caption: caption, filename: filename, spoiler: spoiler) + end + + # Set the user's name + # @note for internal use only + # @!visibility private + def update_username(username) + @username = username + end + + # Set the user's presence data + # @note for internal use only + # @!visibility private + def update_presence(data) + @status = data['status'].to_sym + @client_status = process_client_status(data['client_status']) + + @activities = Discordrb::ActivitySet.new(data['activities'].map { |act| Activity.new(act, @bot) }) + end + + # Add an await for a message from this user. Specifically, this adds a global await for a MessageEvent with this + # user's ID as a :from attribute. + # @see Bot#add_await + def await(key, attributes = {}, &block) + @bot.add_await(key, Discordrb::Events::MessageEvent, { from: @id }.merge(attributes), &block) + end + + # Add a blocking await for a message from this user. Specifically, this adds a global await for a MessageEvent with this + # user's ID as a :from attribute. + # @see Bot#add_await! + def await!(attributes = {}, &block) + @bot.add_await!(Discordrb::Events::MessageEvent, { from: @id }.merge(attributes), &block) + end + + # Gets the member this user is on a server + # @param server [Server] The server to get the member for + # @return [Member] this user as a member on a particular server + def on(server) + id = server.resolve_id + @bot.server(id).member(@id) + end + + # Is the user the bot? + # @return [true, false] whether this user is the bot + def current_bot? + @bot.profile.id == @id + end + + # @return [true, false] whether this user is a fake user for a webhook message + def webhook? + @discriminator == Message::ZERO_DISCRIM + end + + # @!visibility private + def process_client_status(client_status) + (client_status || {}).map { |k, v| [k.to_sym, v.to_sym] }.to_h + end + + # @!method offline? + # @return [true, false] whether this user is offline. + # @!method idle? + # @return [true, false] whether this user is idle. + # @!method online? + # @return [true, false] whether this user is online. + # @!method dnd? + # @return [true, false] whether this user is set to do not disturb. + %i[offline idle online dnd].each do |e| + define_method("#{e}?") do + @status.to_sym == e + end + end + + # @return [String, nil] the game the user is currently playing, or `nil` if nothing is being played. + # @deprecated Please use {ActivitySet#games} for information about the user's game activity + def game + @activities.games.first&.name + end + + # @return [Integer] returns 1 for twitch streams, or 0 for no stream. + # @deprecated Please use {ActivitySet#streaming} for information about the user's stream activity + def stream_type + @activities.streaming ? 1 : 0 + end + + # @return [String, nil] the URL to the stream, if the user is currently streaming something + # @deprecated Please use {ActivitySet#streaming} for information about the user's stream activity + def stream_url + @activities.streaming.first&.url + end + + # The inspect method is overwritten to give more useful output + def inspect + "" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_region.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_region.rb new file mode 100644 index 0000000..4fe022b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_region.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Discordrb + # Voice regions are the locations of servers that handle voice communication in Discord + class VoiceRegion + # @return [String] unique ID for the region + attr_reader :id + alias_method :to_s, :id + + # @return [String] name of the region + attr_reader :name + + # @return [String] an example hostname for the region + attr_reader :sample_hostname + + # @return [Integer] an example port for the region + attr_reader :sample_port + + # @return [true, false] if this is a VIP-only server + attr_reader :vip + + # @return [true, false] if this voice server is the closest to the client + attr_reader :optimal + + # @return [true, false] whether this is a deprecated voice region (avoid switching to these) + attr_reader :deprecated + + # @return [true, false] whether this is a custom voice region (used for events/etc) + attr_reader :custom + + def initialize(data) + @id = data['id'] + + @name = data['name'] + + @sample_hostname = data['sample_hostname'] + @sample_port = data['sample_port'] + + @vip = data['vip'] + @optimal = data['optimal'] + @deprecated = data['deprecated'] + @custom = data['custom'] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_state.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_state.rb new file mode 100644 index 0000000..57a3a3e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/voice_state.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Discordrb + # A voice state represents the state of a member's connection to a voice channel. It includes data like the voice + # channel the member is connected to and mute/deaf flags. + class VoiceState + # @return [Integer] the ID of the user whose voice state is represented by this object. + attr_reader :user_id + + # @return [true, false] whether this voice state's member is muted server-wide. + attr_reader :mute + + # @return [true, false] whether this voice state's member is deafened server-wide. + attr_reader :deaf + + # @return [true, false] whether this voice state's member has muted themselves. + attr_reader :self_mute + + # @return [true, false] whether this voice state's member has deafened themselves. + attr_reader :self_deaf + + # @return [Channel] the voice channel this voice state's member is in. + attr_reader :voice_channel + + # @!visibility private + def initialize(user_id) + @user_id = user_id + end + + # Update this voice state with new data from Discord + # @note For internal use only. + # @!visibility private + def update(channel, mute, deaf, self_mute, self_deaf) + @voice_channel = channel + @mute = mute + @deaf = deaf + @self_mute = self_mute + @self_deaf = self_deaf + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/webhook.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/webhook.rb new file mode 100644 index 0000000..2070eb6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/data/webhook.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Discordrb + # A webhook on a server channel + class Webhook + include IDObject + + # @return [String] the webhook name. + attr_reader :name + + # @return [Channel] the channel that the webhook is currently connected to. + attr_reader :channel + + # @return [Server] the server that the webhook is currently connected to. + attr_reader :server + + # @return [String, nil] the webhook's token, if this is an Incoming Webhook. + attr_reader :token + + # @return [String] the webhook's avatar id. + attr_reader :avatar + + # @return [Integer] the webhook's type (1: Incoming, 2: Channel Follower) + attr_reader :type + + # Gets the user object of the creator of the webhook. May be limited to username, discriminator, + # ID and avatar if the bot cannot reach the owner + # @return [Member, User, nil] the user object of the owner or nil if the webhook was requested using the token. + attr_reader :owner + + def initialize(data, bot) + @bot = bot + + @name = data['name'] + @id = data['id'].to_i + @channel = bot.channel(data['channel_id']) + @server = @channel.server + @token = data['token'] + @avatar = data['avatar'] + @type = data['type'] + + # Will not exist if the data was requested through a webhook token + return unless data['user'] + + @owner = @server.member(data['user']['id'].to_i) + return if @owner + + Discordrb::LOGGER.debug("Member with ID #{data['user']['id']} not cached (possibly left the server).") + @owner = @bot.ensure_user(data['user']) + end + + # Sets the webhook's avatar. + # @param avatar [String, #read] The new avatar, in base64-encoded JPG format. + def avatar=(avatar) + update_webhook(avatar: avatarise(avatar)) + end + + # Deletes the webhook's avatar. + def delete_avatar + update_webhook(avatar: nil) + end + + # Sets the webhook's channel + # @param channel [Channel, String, Integer] The channel the webhook should use. + def channel=(channel) + update_webhook(channel_id: channel.resolve_id) + end + + # Sets the webhook's name. + # @param name [String] The webhook's new name. + def name=(name) + update_webhook(name: name) + end + + # Updates the webhook if you need to edit more than 1 attribute. + # @param data [Hash] the data to update. + # @option data [String, #read, nil] :avatar The new avatar, in base64-encoded JPG format, or nil to delete the avatar. + # @option data [Channel, String, Integer] :channel The channel the webhook should use. + # @option data [String] :name The webhook's new name. + # @option data [String] :reason The reason for the webhook changes. + def update(data) + # Only pass a value for avatar if the key is defined as sending nil will delete the + data[:avatar] = avatarise(data[:avatar]) if data.key?(:avatar) + data[:channel_id] = data[:channel].resolve_id + data.delete(:channel) + update_webhook(data) + end + + # Deletes the webhook. + # @param reason [String] The reason the invite is being deleted. + def delete(reason = nil) + if token? + API::Webhook.token_delete_webhook(@token, @id, reason) + else + API::Webhook.delete_webhook(@bot.token, @id, reason) + end + end + + # Utility function to get a webhook's avatar URL. + # @return [String] the URL to the avatar image + def avatar_url + return API::User.default_avatar unless @avatar + + API::User.avatar_url(@id, @avatar) + end + + # The `inspect` method is overwritten to give more useful output. + def inspect + "" + end + + # Utility function to know if the webhook was requested through a webhook token, rather than auth. + # @return [true, false] whether the webhook was requested by token or not. + def token? + @owner.nil? + end + + private + + def avatarise(avatar) + if avatar.respond_to? :read + "data:image/jpg;base64,#{Base64.strict_encode64(avatar.read)}" + else + avatar + end + end + + def update_internal(data) + @name = data['name'] + @avatar_id = data['avatar'] + @channel = @bot.channel(data['channel_id']) + end + + def update_webhook(new_data) + reason = new_data.delete(:reason) + data = JSON.parse(if token? + API::Webhook.token_update_webhook(@token, @id, new_data, reason) + else + API::Webhook.update_webhook(@bot.token, @id, new_data, reason) + end) + # Only update cache if API call worked + update_internal(data) if data['name'] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/errors.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/errors.rb new file mode 100644 index 0000000..330a8d5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/errors.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +module Discordrb + # Custom errors raised in various places + module Errors + # Raised when authentication data is invalid or incorrect. + class InvalidAuthenticationError < RuntimeError + # Default message for this exception + def message + 'User login failed due to an invalid email or password!' + end + end + + # Raised when a message is over the character limit + class MessageTooLong < RuntimeError; end + + # Raised when the bot can't do something because its permissions on the server are insufficient + class NoPermission < RuntimeError; end + + # Raised when the bot gets a HTTP 502 error, which is usually caused by Cloudflare. + class CloudflareError < RuntimeError; end + + # Generic class for errors denoted by API error codes + class CodeError < RuntimeError + class << self + # @return [Integer] The error code represented by this error class. + attr_reader :code + end + + # Create a new error with a particular message (the code should be defined by the class instance variable) + # @param message [String] the message to use + def initialize(message) + @message = message + end + + # @return [Integer] The error code represented by this error. + def code + self.class.code + end + + # @return [String] This error's represented message + attr_reader :message + end + + # Create a new code error class + # rubocop:disable Naming/MethodName + def self.Code(code) + classy = Class.new(CodeError) + classy.instance_variable_set('@code', code) + + @code_classes ||= {} + @code_classes[code] = classy + + classy + end + # rubocop:enable Naming/MethodName + + # @param code [Integer] The code to check + # @return [Class] the error class for the given code + def self.error_class_for(code) + @code_classes[code] + end + + # Used when Discord doesn't provide a more specific code + UnknownError = Code(0) + + # Unknown Account + UnknownAccount = Code(10_001) + + # Unknown Application + UnknownApplication = Code(10_002) + + # Unknown Channel + UnknownChannel = Code(10_003) + + # Unknown Server + UnknownServer = Code(10_004) + + # Unknown Integration + UnknownIntegration = Code(10_005) + + # Unknown Invite + UnknownInvite = Code(10_006) + + # Unknown Member + UnknownMember = Code(10_007) + + # Unknown Message + UnknownMessage = Code(10_008) + + # Unknown Overwrite + UnknownOverwrite = Code(10_009) + + # Unknown Provider + UnknownProvider = Code(10_010) + + # Unknown Role + UnknownRole = Code(10_011) + + # Unknown Token + UnknownToken = Code(10_012) + + # Unknown User + UnknownUser = Code(10_013) + + # Unknown Emoji + UnknownEmoji = Code(10_014) + + # Bots cannot use this endpoint + EndpointNotForBots = Code(20_001) + + # Only bots can use this endpoint + EndpointOnlyForBots = Code(20_002) + + # Maximum number of servers reached (100) + ServerLimitReached = Code(30_001) + + # Maximum number of friends reached (1000) + FriendLimitReached = Code(30_002) + + # Maximum number of pins reached (50) + PinLimitReached = Code(30_003) + + # Maximum number of guild roles reached (250) + RoleLimitReached = Code(30_005) + + # Too many reactions + ReactionLimitReached = Code(30_010) + + # Maximum number of guild channels reached (500) + ChannelLimitReached = Code(30_013) + + # Unauthorized + Unauthorized = Unauthorised = Code(40_001) + + # Missing Access + MissingAccess = Code(50_001) + + # Invalid Account Type + InvalidAccountType = Code(50_002) + + # Cannot execute action on a DM channel + InvalidActionForDM = Code(50_003) + + # Embed Disabled + EmbedDisabled = Code(50_004) + + # Cannot edit a message authored by another user + MessageAuthoredByOtherUser = Code(50_005) + + # Cannot send an empty message + MessageEmpty = Code(50_006) + + # Cannot send messages to this user + NoMessagesToUser = Code(50_007) + + # Cannot send messages in a voice channel + NoMessagesInVoiceChannel = Code(50_008) + + # Channel verification level is too high + VerificationLevelTooHigh = Code(50_009) + + # OAuth2 application does not have a bot + NoBotForApplication = Code(50_010) + + # OAuth2 application limit reached + ApplicationLimitReached = Code(50_011) + + # Invalid OAuth State + InvalidOAuthState = Code(50_012) + + # Missing Permissions + MissingPermissions = Code(50_013) + + # Invalid authentication token + InvalidAuthToken = Code(50_014) + + # Note is too long + NoteTooLong = Code(50_015) + + # Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete. + InvalidBulkDeleteCount = Code(50_016) + + # A message can only be pinned to the channel it was sent in + CannotPinInDifferentChannel = Code(50_019) + + # Cannot execute action on a system message + InvalidActionForSystemMessage = Code(50_021) + + # A message provided was too old to bulk delete + MessageTooOld = Code(50_034) + + # Invalid Form Body + InvalidFormBody = Code(50_035) + + # An invite was accepted to a guild the application's bot is not in + MissingBotMember = Code(50_036) + + # Reaction Blocked + ReactionBlocked = Code(90_001) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/await.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/await.rb new file mode 100644 index 0000000..af4f9d8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/await.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/await' + +module Discordrb::Events + # @see Bot#await + class AwaitEvent < Event + # The await that was triggered. + # @return [Await] The await + attr_reader :await + + # The event that triggered the await. + # @return [Event] The event + attr_reader :event + + # @!attribute [r] key + # @return [Symbol] the await's key. + # @see Await#key + # @!attribute [r] type + # @return [Class] the await's event class. + # @see Await#type + # @!attribute [r] attributes + # @return [Hash] a hash of attributes defined on the await. + # @see Await#attributes + delegate :key, :type, :attributes, to: :await + + # For internal use only + def initialize(await, event, bot) + @await = await + @event = event + @bot = bot + end + end + + # Event handler for {AwaitEvent} + class AwaitEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? AwaitEvent + + [ + matches_all(@attributes[:key], event.key) { |a, e| a == e }, + matches_all(@attributes[:type], event.type) { |a, e| a == e } + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/bans.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/bans.rb new file mode 100644 index 0000000..f3fc826 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/bans.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' + +module Discordrb::Events + # Raised when a user is banned + class UserBanEvent < Event + # @return [User] the user that was banned + attr_reader :user + + # @return [Server] the server from which the user was banned + attr_reader :server + + # @!visibility private + def initialize(data, bot) + @user = bot.user(data['user']['id'].to_i) + @server = bot.server(data['guild_id'].to_i) + @bot = bot + end + end + + # Event handler for {UserBanEvent} + class UserBanEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? UserBanEvent + + [ + matches_all(@attributes[:user], event.user) do |a, e| + case a + when String + a == e.name + when Integer + a == e.id + when :bot + e.current_bot? + else + a == e + end + end, + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end + ].reduce(true, &:&) + end + end + + # Raised when a user is unbanned from a server + class UserUnbanEvent < UserBanEvent; end + + # Event handler for {UserUnbanEvent} + class UserUnbanEventHandler < UserBanEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/channels.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/channels.rb new file mode 100644 index 0000000..bfaa67a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/channels.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Raised when a channel is created + class ChannelCreateEvent < Event + # @return [Channel] the channel in question. + attr_reader :channel + + # @!attribute [r] type + # @return [Integer] the channel's type (0: text, 1: private, 2: voice, 3: group). + # @see Channel#type + # @!attribute [r] topic + # @return [String] the channel's topic. + # @see Channel#topic + # @!attribute [r] position + # @return [Integer] the position of the channel in the channels list. + # @see Channel#position + # @!attribute [r] name + # @return [String] the channel's name + # @see Channel#name + # @!attribute [r] id + # @return [Integer] the channel's unique ID. + # @see Channel#id + # @!attribute [r] server + # @return [Server] the server the channel belongs to. + # @see Channel#server + delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel + + def initialize(data, bot) + @bot = bot + @channel = bot.channel(data['id'].to_i) + end + end + + # Event handler for ChannelCreateEvent + class ChannelCreateEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ChannelCreateEvent + + [ + matches_all(@attributes[:type], event.type) do |a, e| + a == if a.is_a? String + e.name + else + e + end + end, + matches_all(@attributes[:name], event.name) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ].reduce(true, &:&) + end + end + + # Raised when a channel is deleted + class ChannelDeleteEvent < Event + # @return [Integer] the channel's type (0: text, 1: private, 2: voice, 3: group). + attr_reader :type + + # @return [String] the channel's topic + attr_reader :topic + + # @return [Integer] the position of the channel on the list + attr_reader :position + + # @return [String] the channel's name + attr_reader :name + + # @return [Integer] the channel's ID + attr_reader :id + + # @return [Server] the channel's server + attr_reader :server + + # @return [Integer, nil] the channel's owner ID if this is a group channel + attr_reader :owner_id + + def initialize(data, bot) + @bot = bot + + @type = data['type'] + @topic = data['topic'] + @position = data['position'] + @name = data['name'] + @is_private = data['is_private'] + @id = data['id'].to_i + @server = bot.server(data['guild_id'].to_i) if data['guild_id'] + @owner_id = bot.user(data['owner_id']) if @type == 3 + end + end + + # Event handler for ChannelDeleteEvent + class ChannelDeleteEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ChannelDeleteEvent + + [ + matches_all(@attributes[:type], event.type) do |a, e| + a == if a.is_a? String + e.name + else + e + end + end, + matches_all(@attributes[:name], event.name) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ].reduce(true, &:&) + end + end + + # Generic subclass for recipient events (add/remove) + class ChannelRecipientEvent < Event + # @return [Channel] the channel in question. + attr_reader :channel + + delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel + + # @return [Recipient] the recipient that was added/removed from the group + attr_reader :recipient + + delegate :id, to: :recipient + + def initialize(data, bot) + @bot = bot + + @channel = bot.channel(data['channel_id'].to_i) + recipient = data['user'] + recipient_user = bot.ensure_user(recipient) + @recipient = Discordrb::Recipient.new(recipient_user, @channel, bot) + end + end + + # Generic event handler for channel recipient events + class ChannelRecipientEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ChannelRecipientEvent + + [ + matches_all(@attributes[:owner_id], event.owner_id) do |a, e| + a.resolve_id == e.resolve_id + end, + matches_all(@attributes[:id], event.id) do |a, e| + a.resolve_id == e.resolve_id + end, + matches_all(@attributes[:name], event.name) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ] + end + end + + # Raised when a user is added to a private channel + class ChannelRecipientAddEvent < ChannelRecipientEvent; end + + # Event handler for ChannelRecipientAddEvent + class ChannelRecipientAddEventHandler < ChannelRecipientEventHandler; end + + # Raised when a recipient that isn't the bot leaves or is kicked from a group channel + class ChannelRecipientRemoveEvent < ChannelRecipientEvent; end + + # Event handler for ChannelRecipientRemoveEvent + class ChannelRecipientRemoveEventHandler < ChannelRecipientEventHandler; end + + # Raised when a channel is updated (e.g. topic changes) + class ChannelUpdateEvent < ChannelCreateEvent; end + + # Event handler for ChannelUpdateEvent + class ChannelUpdateEventHandler < ChannelCreateEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/generic.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/generic.rb new file mode 100644 index 0000000..9c71bb7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/generic.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Events used by discordrb +module Discordrb::Events + # A negated object, used to not match something in event parameters. + # @see Discordrb::Events.matches_all + class Negated + attr_reader :object + + def initialize(object) + @object = object + end + end + + # Attempts to match possible formats of event attributes to a set comparison value, using a comparison block. + # It allows five kinds of attribute formats: + # 0. nil -> always returns true + # 1. A single attribute, not negated + # 2. A single attribute, negated + # 3. An array of attributes, not negated + # 4. An array of attributes, not negated + # Note that it doesn't allow an array of negated attributes. For info on negation stuff, see {::#not!} + # @param attributes [Object, Array, Negated, Negated>, nil] One or more attributes to + # compare to the to_check value. + # @param to_check [Object] What to compare the attributes to. + # @yield [a, e] The block will be called when a comparison happens. + # @yieldparam [Object] a The attribute to compare to the value to check. Will always be a single not-negated object, + # all the negation and array handling is done by the method + # @yieldparam [Object] e The value to compare the attribute to. Will always be the value passed to the function as + # to_check. + # @yieldreturn [true, false] Whether or not the attribute a matches the given comparison value e. + # @return [true, false] whether the attributes match the comparison value in at least one way. + def self.matches_all(attributes, to_check, &block) + # "Zeroth" case: attributes is nil + return true if attributes.nil? + + # First case: there's a single negated attribute + if attributes.is_a? Negated + # The contained object might also be an array, so recursively call matches_all (and negate the result) + return !matches_all(attributes.object, to_check, &block) + end + + # Second case: there's a single, not-negated attribute + return yield(attributes, to_check) unless attributes.is_a? Array + + # Third case: it's an array of attributes + attributes.reduce(false) do |result, element| + result || yield(element, to_check) + end + end + + # Generic event class that can be extended + class Event + # @return [Bot] the bot used to initialize this event. + attr_reader :bot + + class << self + protected + + # Delegates a list of methods to a particular object. This is essentially a reimplementation of ActiveSupport's + # `#delegate`, but without the overhead provided by the rest. Used in subclasses of `Event` to delegate properties + # on events to properties on data objects. + # @param methods [Array] The methods to delegate. + # @param hash [Hash Symbol>] A hash with one `:to` key and the value the method to be delegated to. + def delegate(*methods, hash) + methods.each do |e| + define_method(e) do + object = __send__(hash[:to]) + object.__send__(e) + end + end + end + end + end + + # Generic event handler that can be extended + class EventHandler + def initialize(attributes, block) + @attributes = attributes + @block = block + end + + # Whether or not this event handler matches the given event with its attributes. + # @raise [RuntimeError] if this method is called - overwrite it in your event handler! + def matches?(_) + raise 'Attempted to call matches?() from a generic EventHandler' + end + + # Checks whether this handler matches the given event, and then calls it. + # @param event [Object] The event object to match and call the handler with + def match(event) + call(event) if matches? event + end + + # Calls this handler + # @param event [Object] The event object to call this handler with + def call(event) + @block.call(event) + end + + # to be overwritten by extending event handlers + def after_call(event); end + + # @see Discordrb::Events::matches_all + def matches_all(attributes, to_check, &block) + Discordrb::Events.matches_all(attributes, to_check, &block) + end + end + + # Event handler that matches all events. Only useful for making an event that has no attributes, such as {ReadyEvent}. + class TrueEventHandler < EventHandler + # Always returns true. + # @return [true] + def matches?(_) + true + end + end +end + +# Utility function that creates a negated object for {Discordrb::Events.matches_all} +# @param [Object] object The object to negate +# @see Discordrb::Events::Negated +# @see Discordrb::Events.matches_all +# @return [Negated] the object, negated, as an attribute to pass to matches_all +def not!(object) + Discordrb::Events::Negated.new(object) +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/guilds.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/guilds.rb new file mode 100644 index 0000000..6e63aa0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/guilds.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Generic subclass for server events (create/update/delete) + class ServerEvent < Event + # @return [Server] the server in question. + attr_reader :server + + def initialize(data, bot) + @bot = bot + + init_server(data, bot) + end + + # Initializes this event with server data. Should be overwritten in case the server doesn't exist at the time + # of event creation (e. g. {ServerDeleteEvent}) + def init_server(data, bot) + @server = bot.server(data['id'].to_i) + end + end + + # Generic event handler for member events + class ServerEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end + ].reduce(true, &:&) + end + end + + # Server is created + # @see Discordrb::EventContainer#server_create + class ServerCreateEvent < ServerEvent; end + + # Event handler for {ServerCreateEvent} + class ServerCreateEventHandler < ServerEventHandler; end + + # Server is updated (e.g. name changed) + # @see Discordrb::EventContainer#server_update + class ServerUpdateEvent < ServerEvent; end + + # Event handler for {ServerUpdateEvent} + class ServerUpdateEventHandler < ServerEventHandler; end + + # Server is deleted, the server was left because the bot was kicked, or the + # bot made itself leave the server. + # @see Discordrb::EventContainer#server_delete + class ServerDeleteEvent < ServerEvent + # @return [Integer] The ID of the server that was left. + attr_reader :server + + # Override init_server to account for the deleted server + def init_server(data, _bot) + @server = data['id'].to_i + end + end + + # Event handler for {ServerDeleteEvent} + class ServerDeleteEventHandler < ServerEventHandler; end + + # Emoji is created/deleted/updated + class ServerEmojiChangeEvent < ServerEvent + # @return [Server] the server in question. + attr_reader :server + + # @return [Array] array of emojis. + attr_reader :emoji + + def initialize(server, data, bot) + @bot = bot + @server = server + process_emoji(data) + end + + # @!visibility private + def process_emoji(data) + @emoji = data['emojis'].map do |e| + @server.emoji[e['id']] + end + end + end + + # Generic event helper for when an emoji is either created or deleted + class ServerEmojiCDEvent < ServerEvent + # @return [Server] the server in question. + attr_reader :server + + # @return [Emoji] the emoji data. + attr_reader :emoji + + def initialize(server, emoji, bot) + @bot = bot + @emoji = emoji + @server = server + end + end + + # Emoji is created + class ServerEmojiCreateEvent < ServerEmojiCDEvent; end + + # Emoji is deleted + class ServerEmojiDeleteEvent < ServerEmojiCDEvent; end + + # Emoji is updated + class ServerEmojiUpdateEvent < ServerEvent + # @return [Server] the server in question. + attr_reader :server + + # @return [Emoji, nil] the emoji data before the event. + attr_reader :old_emoji + + # @return [Emoji, nil] the updated emoji data. + attr_reader :emoji + + def initialize(server, old_emoji, emoji, bot) + @bot = bot + @old_emoji = old_emoji + @emoji = emoji + @server = server + end + end + + # Event handler for {ServerEmojiChangeEvent} + class ServerEmojiChangeEventHandler < ServerEventHandler; end + + # Generic handler for emoji create and delete + class ServerEmojiCDEventHandler < ServerEventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerEmojiCDEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:id], event.emoji.id) { |a, e| a.resolve_id == e.resolve_id }, + matches_all(@attributes[:name], event.emoji.name) { |a, e| a == e } + ].reduce(true, &:&) + end + end + + # Event handler for {ServerEmojiCreateEvent} + class ServerEmojiCreateEventHandler < ServerEmojiCDEventHandler; end + + # Event handler for {ServerEmojiDeleteEvent} + class ServerEmojiDeleteEventHandler < ServerEmojiCDEventHandler; end + + # Event handler for {ServerEmojiUpdateEvent} + class ServerEmojiUpdateEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerEmojiUpdateEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:id], event.old_emoji.id) { |a, e| a.resolve_id == e.resolve_id }, + matches_all(@attributes[:old_name], event.old_emoji.name) { |a, e| a == e }, + matches_all(@attributes[:name], event.emoji.name) { |a, e| a == e } + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/invites.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/invites.rb new file mode 100644 index 0000000..f8de6f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/invites.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module Discordrb::Events + # Raised when an invite is created. + class InviteCreateEvent < Event + # @return [Invite] The invite that was created. + attr_reader :invite + + # @return [Server, nil] The server the invite was created for. + attr_reader :server + + # @return [Channel] The channel the invite was created for. + attr_reader :channel + + # @!attribute [r] code + # @return [String] The code for the created invite. + # @see Invite#code + # @!attribute [r] created_at + # @return [Time] The time the invite was created at. + # @see Invite#created_at + # @!attribute [r] max_age + # @return [Integer] The maximum age of the created invite. + # @see Invite#max_age + # @!attribute [r] max_uses + # @return [Integer] The maximum number of uses before the invite expires. + # @see Invite#max_uses + # @!attribute [r] temporary + # @return [true, false] Whether or not this invite grants temporary membership. + # @see Invite#temporary + # @!attribute [r] inviter + # @return [User] The user that created the invite. + # @see Invite#inviter + delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite + + alias temporary? temporary + + def initialize(data, invite, bot) + @bot = bot + @invite = invite + @channel = bot.channel(data['channel_id']) + @server = bot.server(data['guild_id']) if data['guild_id'] + end + end + + # Raised when an invite is deleted. + class InviteDeleteEvent < Event + # @return [Channel] The channel the deleted invite was for. + attr_reader :channel + + # @return [Server, nil] The server the deleted invite was for. + attr_reader :server + + # @return [String] The code of the deleted invite. + attr_reader :code + + def initialize(data, bot) + @bot = bot + @channel = bot.channel(data['channel_id']) + @server = bot.server(data['guild_id']) if data['guild_id'] + @code = data['code'] + end + end + + # Event handler for InviteCreateEvent. + class InviteCreateEventHandler < EventHandler + def matches?(event) + return false unless event.is_a? InviteCreateEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:channel], event.channel) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:temporary], event.temporary?, &:==), + matches_all(@attributes[:inviter], event.inviter, &:==) + ].reduce(true, &:&) + end + end + + # Event handler for InviteDeleteEvent + class InviteDeleteEventHandler < EventHandler + def matches?(event) + return false unless event.is_a? InviteDeleteEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:channel], event.channel) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/lifetime.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/lifetime.rb new file mode 100644 index 0000000..a5a2080 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/lifetime.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' + +module Discordrb::Events + # Common superclass for all lifetime events + class LifetimeEvent < Event + # @!visibility private + def initialize(bot) + @bot = bot + end + end + + # @see Discordrb::EventContainer#ready + class ReadyEvent < LifetimeEvent; end + + # Event handler for {ReadyEvent} + class ReadyEventHandler < TrueEventHandler; end + + # @see Discordrb::EventContainer#disconnected + class DisconnectEvent < LifetimeEvent; end + + # Event handler for {DisconnectEvent} + class DisconnectEventHandler < TrueEventHandler; end + + # @see Discordrb::EventContainer#heartbeat + class HeartbeatEvent < LifetimeEvent; end + + # Event handler for {HeartbeatEvent} + class HeartbeatEventHandler < TrueEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/members.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/members.rb new file mode 100644 index 0000000..171213e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/members.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Generic subclass for server member events (add/update/delete) + class ServerMemberEvent < Event + # @return [Member] the member in question. + attr_reader :user + alias_method :member, :user + + # @return [Array] the member's roles. + attr_reader :roles + + # @return [Server] the server on which the event happened. + attr_reader :server + + def initialize(data, bot) + @bot = bot + + @server = bot.server(data['guild_id'].to_i) + return unless @server + + init_user(data, bot) + init_roles(data, bot) + end + + private + + def init_user(data, _) + user_id = data['user']['id'].to_i + @user = @server.member(user_id) + end + + def init_roles(data, _) + @roles = [@server.role(@server.id)] + return unless data['roles'] + + data['roles'].each do |element| + role_id = element.to_i + @roles << @server.roles.find { |r| r.id == role_id } + end + end + end + + # Generic event handler for member events + class ServerMemberEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerMemberEvent + + [ + matches_all(@attributes[:username], event.user.name) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ].reduce(true, &:&) + end + end + + # Member joins + # @see Discordrb::EventContainer#member_join + class ServerMemberAddEvent < ServerMemberEvent; end + + # Event handler for {ServerMemberAddEvent} + class ServerMemberAddEventHandler < ServerMemberEventHandler; end + + # Member is updated (roles added or deleted) + # @see Discordrb::EventContainer#member_update + class ServerMemberUpdateEvent < ServerMemberEvent; end + + # Event handler for {ServerMemberUpdateEvent} + class ServerMemberUpdateEventHandler < ServerMemberEventHandler; end + + # Member leaves + # @see Discordrb::EventContainer#member_leave + class ServerMemberDeleteEvent < ServerMemberEvent + # Override init_user to account for the deleted user on the server + def init_user(data, bot) + @user = Discordrb::User.new(data['user'], bot) + end + + # @return [User] the user in question. + attr_reader :user + end + + # Event handler for {ServerMemberDeleteEvent} + class ServerMemberDeleteEventHandler < ServerMemberEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/message.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/message.rb new file mode 100644 index 0000000..b5156f0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/message.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Module to make sending messages easier with the presence of a text channel in an event + module Respondable + # @return [Channel] the channel in which this event occurred + attr_reader :channel + + # Sends a message to the channel this message was sent in, right now. It is usually preferable to use {#<<} instead + # because it avoids rate limiting problems + # @param content [String] The message to send to the channel + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + # @return [Discordrb::Message] the message that was sent + def send_message(content, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil) + channel.send_message(content, tts, embed, attachments, allowed_mentions, message_reference) + end + + # The same as {#send_message}, but yields a {Webhooks::Embed} for easy building of embedded content inside a block. + # @see Channel#send_embed + # @param message [String] The message that should be sent along with the embed. If this is the empty string, only the embed will be shown. + # @param embed [Discordrb::Webhooks::Embed, nil] The embed to start the building process with, or nil if one should be created anew. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. + # @yield [embed] Yields the embed to allow for easy building inside a block. + # @yieldparam embed [Discordrb::Webhooks::Embed] The embed from the parameters, or a new one. + # @return [Message] The resulting message. + def send_embed(message = '', embed = nil, attachments = nil, tts = false, allowed_mentions = nil, message_reference = nil, &block) + channel.send_embed(message, embed, attachments, tts, allowed_mentions, message_reference, &block) + end + + # Sends a temporary message to the channel this message was sent in, right now. + # @param content [String] The content to send. Should not be longer than 2000 characters or it will result in an error. + # @param timeout [Float] The amount of time in seconds after which the message sent will be deleted. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. + # @param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message. + # @param attachments [Array] Files that can be referenced in embeds via `attachment://file.png` + # @param allowed_mentions [Hash, Discordrb::AllowedMentions, false, nil] Mentions that are allowed to ping on this message. `false` disables all pings + def send_temporary_message(content, timeout, tts = false, embed = nil, attachments = nil, allowed_mentions = nil) + channel.send_temporary_message(content, timeout, tts, embed, attachments, allowed_mentions) + end + + # Adds a string to be sent after the event has finished execution. Avoids problems with rate limiting because only + # one message is ever sent. If it is used multiple times, the strings will bunch up into one message (separated by + # newlines) + # @param message [String] The message to send to the channel + def <<(message) + addition = "#{message}\n" + @saved_message = @saved_message ? @saved_message + addition : addition + nil + end + + # Drains the currently saved message, which clears it out, resulting in everything being saved before being + # thrown away and nothing being sent to the channel (unless there is something saved after this). + # @see #<< + def drain + @saved_message = '' + nil + end + + # Drains the currently saved message into a result string. This prepends it before that string, clears the saved + # message and returns the concatenation. + # @param result [String] The result string to drain into. + # @return [String] a string formed by concatenating the saved message and the argument. + def drain_into(result) + return if result.is_a?(Discordrb::Message) + + result = (@saved_message.nil? ? '' : @saved_message.to_s) + (result.nil? ? '' : result.to_s) + drain + result + end + + alias_method :send, :send_message + alias_method :respond, :send_message + alias_method :send_temp, :send_temporary_message + end + + # Event raised when a text message is sent to a channel + class MessageEvent < Event + include Respondable + + # @return [Message] the message which triggered this event. + attr_reader :message + + # @return [String] the message that has been saved by calls to {#<<} and will be sent to Discord upon completion. + attr_reader :saved_message + + # @return [File] the file that has been saved by a call to {#attach_file} and will be sent to Discord upon completion. + attr_reader :file + + # @return [String] the filename set in {#attach_file} that will override the original filename when sent. + attr_reader :filename + + # @return [true, false] Whether or not this file should appear as a spoiler. Set by {#attach_file} + attr_reader :file_spoiler + + # @!attribute [r] author + # @return [Member, User] who sent this message. + # @see Message#author + # @!attribute [r] channel + # @return [Channel] the channel in which this message was sent. + # @see Message#channel + # @!attribute [r] content + # @return [String] the message's content. + # @see Message#content + # @!attribute [r] timestamp + # @return [Time] the time at which the message was sent. + # @see Message#timestamp + delegate :author, :channel, :content, :timestamp, to: :message + + # @!attribute [r] server + # @return [Server, nil] the server where this message was sent, or nil if it was sent in PM. + # @see Channel#server + delegate :server, to: :channel + + def initialize(message, bot) + @bot = bot + @message = message + @channel = message.channel + @saved_message = '' + @file = nil + @filename = nil + @file_spoiler = nil + end + + # Sends file with a caption to the channel this message was sent in, right now. + # It is usually preferable to use {#<<} and {#attach_file} instead + # because it avoids rate limiting problems + # @param file [File] The file to send to the channel + # @param caption [String] The caption attached to the file + # @param filename [String] Overrides the filename of the uploaded file + # @param spoiler [true, false] Whether or not this file should appear as a spoiler. + # @return [Discordrb::Message] the message that was sent + # @example Send a file from disk + # event.send_file(File.open('rubytaco.png', 'r')) + def send_file(file, caption: nil, filename: nil, spoiler: nil) + @message.channel.send_file(file, caption: caption, filename: filename, spoiler: spoiler) + end + + # Attaches a file to the message event and converts the message into + # a caption. + # @param file [File] The file to be attached + # @param filename [String] Overrides the filename of the uploaded file + # @param spoiler [true, false] Whether or not this file should appear as a spoiler. + def attach_file(file, filename: nil, spoiler: nil) + raise ArgumentError, 'Argument is not a file!' unless file.is_a?(File) + + @file = file + @filename = filename + @file_spoiler = spoiler + nil + end + + # Detaches a file from the message event. + def detach_file + @file = nil + @filename = nil + @file_spoiler = nil + end + + # @return [true, false] whether or not this message was sent by the bot itself + def from_bot? + @message.user.id == @bot.profile.id + end + + # Utility method to get the voice bot for the current server + # @return [VoiceBot, nil] the voice bot connected to this message's server, or nil if there is none connected + def voice + @bot.voice(@message.channel.server.id) + end + + alias_method :user, :author + alias_method :text, :content + end + + # Event handler for MessageEvent + class MessageEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? MessageEvent + + [ + matches_all(@attributes[:starting_with] || @attributes[:start_with], event.content) do |a, e| + case a + when String + e.start_with? a + when Regexp + (e =~ a)&.zero? + end + end, + matches_all(@attributes[:ending_with] || @attributes[:end_with], event.content) do |a, e| + case a + when String + e.end_with? a + when Regexp + !(e =~ Regexp.new("#{a}$")).nil? + end + end, + matches_all(@attributes[:containing] || @attributes[:contains], event.content) do |a, e| + case a + when String + e.include? a + when Regexp + (e =~ a) + end + end, + matches_all(@attributes[:in], event.channel) do |a, e| + case a + when String + # Make sure to remove the "#" from channel names in case it was specified + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end, + matches_all(@attributes[:from], event.author) do |a, e| + case a + when String + a == e.name + when Integer + a == e.id + when :bot + e.current_bot? + else + a == e + end + end, + matches_all(@attributes[:with_text] || @attributes[:content] || @attributes[:exact_text], event.content) do |a, e| + case a + when String + e == a + when Regexp + match = a.match(e) + match ? (e == match[0]) : false + end + end, + matches_all(@attributes[:after], event.timestamp) { |a, e| a > e }, + matches_all(@attributes[:before], event.timestamp) { |a, e| a < e }, + matches_all(@attributes[:private], event.channel.private?) { |a, e| !e == !a } + ].reduce(true, &:&) + end + + # @see EventHandler#after_call + def after_call(event) + if event.file.nil? + event.send_message(event.saved_message) unless event.saved_message.empty? + else + event.send_file(event.file, caption: event.saved_message, filename: event.filename, spoiler: event.file_spoiler) + end + end + end + + # @see Discordrb::EventContainer#mention + class MentionEvent < MessageEvent; end + + # Event handler for {MentionEvent} + class MentionEventHandler < MessageEventHandler; end + + # @see Discordrb::EventContainer#pm + class PrivateMessageEvent < MessageEvent; end + + # Event handler for {PrivateMessageEvent} + class PrivateMessageEventHandler < MessageEventHandler; end + + # A subset of MessageEvent that only contains a message ID and a channel + class MessageIDEvent < Event + include Respondable + + # @return [Integer] the ID associated with this event + attr_reader :id + + # @!visibility private + def initialize(data, bot) + @id = data['id'].to_i + @channel = bot.channel(data['channel_id'].to_i) + @saved_message = '' + @bot = bot + end + end + + # Event handler for {MessageIDEvent} + class MessageIDEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? MessageIDEvent + + [ + matches_all(@attributes[:id], event.id) do |a, e| + a.resolve_id == e.resolve_id + end, + matches_all(@attributes[:in], event.channel) do |a, e| + case a + when String + # Make sure to remove the "#" from channel names in case it was specified + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end + ].reduce(true, &:&) + end + end + + # Raised when a message is edited + # @see Discordrb::EventContainer#message_edit + class MessageEditEvent < MessageEvent; end + + # Event handler for {MessageEditEvent} + class MessageEditEventHandler < MessageEventHandler; end + + # Raised when a message is deleted + # @see Discordrb::EventContainer#message_delete + class MessageDeleteEvent < MessageIDEvent; end + + # Event handler for {MessageDeleteEvent} + class MessageDeleteEventHandler < MessageIDEventHandler; end + + # Raised whenever a MESSAGE_UPDATE is received + # @see Discordrb::EventContainer#message_update + class MessageUpdateEvent < MessageEvent; end + + # Event handler for {MessageUpdateEvent} + class MessageUpdateEventHandler < MessageEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/presence.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/presence.rb new file mode 100644 index 0000000..15bb085 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/presence.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Event raised when a user's presence state updates (idle or online) + class PresenceEvent < Event + # @return [Server] the server on which the presence update happened. + attr_reader :server + + # @return [User] the user whose status got updated. + attr_reader :user + + # @return [Symbol] the new status. + attr_reader :status + + # @return [Hash] the current online status (`:online`, `:idle` or `:dnd`) of the user + # on various device types (`:desktop`, `:mobile`, or `:web`). The value will be `nil` if the user is offline or invisible. + attr_reader :client_status + + def initialize(data, bot) + @bot = bot + + @user = bot.user(data['user']['id'].to_i) + @status = data['status'].to_sym + @client_status = user.client_status + @server = bot.server(data['guild_id'].to_i) + end + end + + # Event handler for PresenceEvent + class PresenceEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? PresenceEvent + + [ + matches_all(@attributes[:from], event.user) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:status], event.status) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ].reduce(true, &:&) + end + end + + # Event raised when a user starts or stops playing a game + class PlayingEvent < Event + # @return [Server] the server on which the presence update happened. + attr_reader :server + + # @return [User] the user whose status got updated. + attr_reader :user + + # @return [String] the new game the user is playing. + attr_reader :game + + # @return [String] the URL to the stream + attr_reader :url + + # @return [String] what the player is currently doing (ex. game being streamed) + attr_reader :details + + # @return [Integer] the type of play. 0 = game, 1 = Twitch + attr_reader :type + + def initialize(data, bot) + @bot = bot + + @server = bot.server(data['guild_id'].to_i) + @user = bot.user(data['user']['id'].to_i) + @game = data['game'] ? data['game']['name'] : nil + @type = data['game'] ? data['game']['type'].to_i : nil + # Handle optional 'game' fields safely + @url = data['game'] && data['game']['url'] ? data['game']['url'] : nil + @details = data['game'] && data['game']['details'] ? data['game']['details'] : nil + end + end + + # Event handler for PlayingEvent + class PlayingEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? PlayingEvent + + [ + matches_all(@attributes[:from], event.user) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:game], event.game) do |a, e| + a == e + end, + matches_all(@attributes[:type], event.type) do |a, e| + a == e + end, + matches_all(@attributes[:client_status], event.client_status) do |a, e| + e.slice(a.keys) == a + end + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/raw.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/raw.rb new file mode 100644 index 0000000..abf3fa3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/raw.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' + +# Event classes and handlers +module Discordrb::Events + # Event raised when any dispatch is received + class RawEvent < Event + # @return [Symbol] the type of this dispatch. + attr_reader :type + alias_method :t, :type + + # @return [Hash] the data of this dispatch. + attr_reader :data + alias_method :d, :data + + def initialize(type, data, bot) + @type = type + @data = data + @bot = bot + end + end + + # Event handler for {RawEvent} + class RawEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? RawEvent + + [ + matches_all(@attributes[:type] || @attributes[:t], event.type) do |a, e| + if a.is_a? Regexp + a.match?(e) + else + e.to_s.casecmp(a.to_s).zero? + end + end + ].reduce(true, &:&) + end + end + + # Event raised when an unknown dispatch is received + class UnknownEvent < RawEvent; end + + # Event handler for {UnknownEvent} + class UnknownEventHandler < RawEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/reactions.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/reactions.rb new file mode 100644 index 0000000..fd3fb38 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/reactions.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Generic superclass for events about adding and removing reactions + class ReactionEvent < Event + include Respondable + + # @return [Emoji] the emoji that was reacted with. + attr_reader :emoji + + # @!visibility private + attr_reader :message_id + + def initialize(data, bot) + @bot = bot + + @emoji = Discordrb::Emoji.new(data['emoji'], bot, nil) + @user_id = data['user_id'].to_i + @message_id = data['message_id'].to_i + @channel_id = data['channel_id'].to_i + end + + # @return [User, Member] the user that reacted to this message, or member if a server exists. + def user + # Cache the user so we don't do requests all the time + @user ||= if server + @server.member(@user_id) + else + @bot.user(@user_id) + end + end + + # @return [Message] the message that was reacted to. + def message + @message ||= channel.load_message(@message_id) + end + + # @return [Channel] the channel that was reacted in. + def channel + @channel ||= @bot.channel(@channel_id) + end + + # @return [Server, nil] the server that was reacted in. If reacted in a PM channel, it will be nil. + def server + @server ||= channel.server + end + end + + # Generic superclass for event handlers pertaining to adding and removing reactions + class ReactionEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ReactionEvent + + [ + matches_all(@attributes[:emoji], event.emoji) do |a, e| + case a + when Integer + e.id == a + when String + e.name == a || e.name == a.delete(':') || e.id == a.resolve_id + else + e == a + end + end, + matches_all(@attributes[:message], event.message_id) do |a, e| + a == e + end, + matches_all(@attributes[:in], event.channel) do |a, e| + case a + when String + # Make sure to remove the "#" from channel names in case it was specified + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end, + matches_all(@attributes[:from], event.user) do |a, e| + case a + when String + a == e.name + when :bot + e.current_bot? + else + a == e + end + end + ].reduce(true, &:&) + end + end + + # Event raised when somebody reacts to a message + class ReactionAddEvent < ReactionEvent; end + + # Event handler for {ReactionAddEvent} + class ReactionAddEventHandler < ReactionEventHandler; end + + # Event raised when somebody removes a reaction to a message + class ReactionRemoveEvent < ReactionEvent; end + + # Event handler for {ReactionRemoveEvent} + class ReactionRemoveEventHandler < ReactionEventHandler; end + + # Event raised when somebody removes all reactions from a message + class ReactionRemoveAllEvent < Event + include Respondable + + # @!visibility private + attr_reader :message_id + + def initialize(data, bot) + @bot = bot + + @message_id = data['message_id'].to_i + @channel_id = data['channel_id'].to_i + end + + # @return [Channel] the channel where the removal occurred. + def channel + @channel ||= @bot.channel(@channel_id) + end + + # @return [Message] the message all reactions were removed from. + def message + @message ||= channel.load_message(@message_id) + end + end + + # Event handler for {ReactionRemoveAllEvent} + class ReactionRemoveAllEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ReactionRemoveAllEvent + + # No attributes yet as there is no property available on the event that doesn't involve doing a resolution request + [ + matches_all(@attributes[:message], event.message_id) do |a, e| + a == e + end, + matches_all(@attributes[:in], event.channel) do |a, e| + case a + when String + # Make sure to remove the "#" from channel names in case it was specified + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/roles.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/roles.rb new file mode 100644 index 0000000..5cc3c79 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/roles.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Raised when a role is created on a server + class ServerRoleCreateEvent < Event + # @return [Role] the role that got created + attr_reader :role + + # @return [Server] the server on which a role got created + attr_reader :server + + # @!attribute [r] name + # @return [String] this role's name + # @see Role#name + delegate :name, to: :role + + def initialize(data, bot) + @bot = bot + + @server = bot.server(data['guild_id'].to_i) + return unless @server + + role_id = data['role']['id'].to_i + @role = @server.roles.find { |r| r.id == role_id } + end + end + + # Event handler for ServerRoleCreateEvent + class ServerRoleCreateEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerRoleCreateEvent + + [ + matches_all(@attributes[:name], event.name) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end + ].reduce(true, &:&) + end + end + + # Raised when a role is deleted from a server + class ServerRoleDeleteEvent < Event + # @return [Integer] the ID of the role that got deleted. + attr_reader :id + + # @return [Server] the server on which a role got deleted. + attr_reader :server + + def initialize(data, bot) + @bot = bot + + # The role should already be deleted from the server's list + # by the time we create this event, so we'll create a temporary + # role object for event consumers to use. + @id = data['role_id'].to_i + server_id = data['guild_id'].to_i + @server = bot.server(server_id) + end + end + + # EventHandler for ServerRoleDeleteEvent + class ServerRoleDeleteEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? ServerRoleDeleteEvent + + [ + matches_all(@attributes[:id], event.id) do |a, e| + a.resolve_id == e.resolve_id + end + ].reduce(true, &:&) + end + end + + # Event raised when a role updates on a server + class ServerRoleUpdateEvent < ServerRoleCreateEvent; end + + # Event handler for ServerRoleUpdateEvent + class ServerRoleUpdateEventHandler < ServerRoleCreateEventHandler; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/typing.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/typing.rb new file mode 100644 index 0000000..7bffc2c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/typing.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' + +module Discordrb::Events + # Event raised when a user starts typing + class TypingEvent < Event + include Respondable + + # @return [Channel] the channel on which a user started typing. + attr_reader :channel + + # @return [User, Member, Recipient] the user that started typing. + attr_reader :user + alias_method :member, :user + + # @return [Time] when the typing happened. + attr_reader :timestamp + + def initialize(data, bot) + @bot = bot + + @user_id = data['user_id'].to_i + + @channel_id = data['channel_id'].to_i + @channel = bot.channel(@channel_id) + + @user = if channel.pm? + channel.recipient + elsif channel.group? + bot.user(@user_id) + else + bot.member(@channel.server.id, @user_id) + end + + @timestamp = Time.at(data['timestamp'].to_i) + end + end + + # Event handler for TypingEvent + class TypingEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? TypingEvent + + [ + matches_all(@attributes[:in], event.channel) do |a, e| + case a + when String + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end, + matches_all(@attributes[:from], event.user) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:after], event.timestamp) { |a, e| a > e }, + matches_all(@attributes[:before], event.timestamp) { |a, e| a < e } + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_server_update.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_server_update.rb new file mode 100644 index 0000000..d66d74e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_server_update.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Event raised when a server's voice server is updating. + # Sent when initially connecting to voice and when a voice instance fails + # over to a new server. + # This event is exposed for use with library agnostic interfaces like telecom and + # lavalink. + class VoiceServerUpdateEvent < Event + # @return [String] The voice connection token + attr_reader :token + + # @return [Server] The server this update is for. + attr_reader :server + + # @return [String] The voice server host. + attr_reader :endpoint + + def initialize(data, bot) + @bot = bot + + @token = data['token'] + @endpoint = data['endpoint'] + @server = bot.server(data['guild_id']) + end + end + + # Event handler for VoiceServerUpdateEvent + class VoiceServerUpdateEventHandler < EventHandler + def matches?(event) + return false unless event.is_a? VoiceServerUpdateEvent + + [ + matches_all(@attributes[:from], event.server) do |a, e| + a == if a.is_a? String + e.name + else + e + end + end + ] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_state_update.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_state_update.rb new file mode 100644 index 0000000..b1d29a9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/voice_state_update.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Event raised when a user's voice state updates + class VoiceStateUpdateEvent < Event + attr_reader :user, :token, :suppress, :session_id, :self_mute, :self_deaf, :mute, :deaf, :server, :channel + + # @return [Channel, nil] the old channel this user was on, or nil if the user is newly joining voice. + attr_reader :old_channel + + def initialize(data, old_channel_id, bot) + @bot = bot + + @token = data['token'] + @suppress = data['suppress'] + @session_id = data['session_id'] + @self_mute = data['self_mute'] + @self_deaf = data['self_deaf'] + @mute = data['mute'] + @deaf = data['deaf'] + @server = bot.server(data['guild_id'].to_i) + return unless @server + + @channel = bot.channel(data['channel_id'].to_i) if data['channel_id'] + @old_channel = bot.channel(old_channel_id) if old_channel_id + @user = bot.user(data['user_id'].to_i) + end + end + + # Event handler for VoiceStateUpdateEvent + class VoiceStateUpdateEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? VoiceStateUpdateEvent + + [ + matches_all(@attributes[:from], event.user) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:mute], event.mute) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end, + matches_all(@attributes[:deaf], event.deaf) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end, + matches_all(@attributes[:self_mute], event.self_mute) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end, + matches_all(@attributes[:self_deaf], event.self_deaf) do |a, e| + a == if a.is_a? String + e.to_s + else + e + end + end, + matches_all(@attributes[:channel], event.channel) do |a, e| + next unless e # Don't bother if the channel is nil + + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:old_channel], event.old_channel) do |a, e| + next unless e # Don't bother if the channel is nil + + a == case a + when String + e.name + when Integer + e.id + else + e + end + end + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/webhooks.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/webhooks.rb new file mode 100644 index 0000000..15ce48d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/events/webhooks.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require 'discordrb/events/generic' +require 'discordrb/data' + +module Discordrb::Events + # Event raised when a webhook is updated + class WebhookUpdateEvent < Event + # @return [Server] the server where the webhook updated + attr_reader :server + + # @return [Channel] the channel the webhook is associated to + attr_reader :channel + + def initialize(data, bot) + @bot = bot + + @server = bot.server(data['guild_id'].to_i) + @channel = bot.channel(data['channel_id'].to_i) + end + end + + # Event handler for {WebhookUpdateEvent} + class WebhookUpdateEventHandler < EventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? WebhookUpdateEvent + + [ + matches_all(@attributes[:server], event.server) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end, + matches_all(@attributes[:channel], event.channel) do |a, e| + case a + when String + # Make sure to remove the "#" from channel names in case it was specified + a.delete('#') == e.name + when Integer + a == e.id + else + a == e + end + end, + matches_all(@attributes[:webhook], event) do |a, e| + a == case a + when String + e.name + when Integer + e.id + else + e + end + end + ].reduce(true, &:&) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/gateway.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/gateway.rb new file mode 100644 index 0000000..129c7ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/gateway.rb @@ -0,0 +1,855 @@ +# frozen_string_literal: true + +# This file uses code from Websocket::Client::Simple, licensed under the following license: +# +# Copyright (c) 2013-2014 Sho Hashimoto +# +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +module Discordrb + # Gateway packet opcodes + module Opcodes + # **Received** when Discord dispatches an event to the gateway (like MESSAGE_CREATE, PRESENCE_UPDATE or whatever). + # The vast majority of received packets will have this opcode. + DISPATCH = 0 + + # **Two-way**: The client has to send a packet with this opcode every ~40 seconds (actual interval specified in + # READY or RESUMED) and the current sequence number, otherwise it will be disconnected from the gateway. In certain + # cases Discord may also send one, specifically if two clients are connected at once. + HEARTBEAT = 1 + + # **Sent**: This is one of the two possible ways to initiate a session after connecting to the gateway. It + # should contain the authentication token along with other stuff the server has to know right from the start, such + # as large_threshold and, for older gateway versions, the desired version. + IDENTIFY = 2 + + # **Sent**: Packets with this opcode are used to change the user's status and played game. (Sending this is never + # necessary for a gateway client to behave correctly) + PRESENCE = 3 + + # **Sent**: Packets with this opcode are used to change a user's voice state (mute/deaf/unmute/undeaf/etc.). It is + # also used to connect to a voice server in the first place. (Sending this is never necessary for a gateway client + # to behave correctly) + VOICE_STATE = 4 + + # **Sent**: This opcode is used to ping a voice server, whatever that means. The functionality of this opcode isn't + # known well but non-user clients should never send it. + VOICE_PING = 5 + + # **Sent**: This is the other of two possible ways to initiate a gateway session (other than {IDENTIFY}). Rather + # than starting an entirely new session, it resumes an existing session by replaying all events from a given + # sequence number. It should be used to recover from a connection error or anything like that when the session is + # still valid - sending this with an invalid session will cause an error to occur. + RESUME = 6 + + # **Received**: Discord sends this opcode to indicate that the client should reconnect to a different gateway + # server because the old one is currently being decommissioned. Counterintuitively, this opcode also invalidates the + # session - the client has to create an entirely new session with the new gateway instead of resuming the old one. + RECONNECT = 7 + + # **Sent**: This opcode identifies packets used to retrieve a list of members from a particular server. There is + # also a REST endpoint available for this, but it is inconvenient to use because the client has to implement + # pagination itself, whereas sending this opcode lets Discord handle the pagination and the client can just add + # members when it receives them. (Sending this is never necessary for a gateway client to behave correctly) + REQUEST_MEMBERS = 8 + + # **Received**: Sent by Discord when the session becomes invalid for any reason. This may include improperly + # resuming existing sessions, attempting to start sessions with invalid data, or something else entirely. The client + # should handle this by simply starting a new session. + INVALIDATE_SESSION = 9 + + # **Received**: Sent immediately for any opened connection; tells the client to start heartbeating early on, so the + # server can safely search for a session server to handle the connection without the connection being terminated. + # As a side-effect, large bots are less likely to disconnect because of very large READY parse times. + HELLO = 10 + + # **Received**: Returned after a heartbeat was sent to the server. This allows clients to identify and deal with + # zombie connections that don't dispatch any events anymore. + HEARTBEAT_ACK = 11 + end + + # This class stores the data of an active gateway session. Note that this is different from a websocket connection - + # there may be multiple sessions per connection or one session may persist over multiple connections. + class Session + attr_reader :session_id + attr_accessor :sequence + + def initialize(session_id) + @session_id = session_id + @sequence = 0 + @suspended = false + @invalid = false + end + + # Flags this session as suspended, so we know not to try and send heartbeats, etc. to the gateway until we've reconnected + def suspend + @suspended = true + end + + def suspended? + @suspended + end + + # Flags this session as no longer being suspended, so we can resume + def resume + @suspended = false + end + + # Flags this session as being invalid + def invalidate + @invalid = true + end + + def invalid? + @invalid + end + + def should_resume? + suspended? && !invalid? + end + end + + # Client for the Discord gateway protocol + class Gateway + # How many members there need to be in a server for it to count as "large" + LARGE_THRESHOLD = 100 + + # The version of the gateway that's supposed to be used. + GATEWAY_VERSION = 6 + + # Heartbeat ACKs are Discord's way of verifying on the client side whether the connection is still alive. If this is + # set to true (default value) the gateway client will use that functionality to detect zombie connections and + # reconnect in such a case; however it may lead to instability if there's some problem with the ACKs. If this occurs + # it can simply be set to false. + # @return [true, false] whether or not this gateway should check for heartbeat ACKs. + attr_accessor :check_heartbeat_acks + + def initialize(bot, token, shard_key = nil, compress_mode = :stream, intents = nil) + @token = token + @bot = bot + + @shard_key = shard_key + + # Whether the connection to the gateway has succeeded yet + @ws_success = false + + @check_heartbeat_acks = true + + @compress_mode = compress_mode + @intents = intents + end + + # Connect to the gateway server in a separate thread + def run_async + @ws_thread = Thread.new do + Thread.current[:discordrb_name] = 'websocket' + connect_loop + LOGGER.warn('The WS loop exited! Not sure if this is a good thing') + end + + LOGGER.debug('WS thread created! Now waiting for confirmation that everything worked') + loop do + sleep(0.5) + + if @ws_success + LOGGER.debug('Confirmation received! Exiting run.') + break + end + + if @should_reconnect == false + LOGGER.debug('Reconnection flag was unset. Exiting run.') + break + end + end + end + + # Prevents all further execution until the websocket thread stops (e.g. through a closed connection). + def sync + @ws_thread.join + end + + # Whether the WebSocket connection to the gateway is currently open + def open? + @handshake&.finished? && !@closed + end + + # Stops the bot gracefully, disconnecting the websocket without immediately killing the thread. This means that + # Discord is immediately aware of the closed connection and makes the bot appear offline instantly. + # + # If this method doesn't work or you're looking for something more drastic, use {#kill} instead. + def stop + @should_reconnect = false + close + + # Return nil so command bots don't send a message + nil + end + + # Kills the websocket thread, stopping all connections to Discord. + def kill + @ws_thread.kill + end + + # Notifies the {#run_async} method that everything is ready and the caller can now continue (i.e. with syncing, + # or with doing processing and then syncing) + def notify_ready + @ws_success = true + end + + # Injects a reconnect event (op 7) into the event processor, causing Discord to reconnect to the given gateway URL. + # If the URL is set to nil, it will reconnect and get an entirely new gateway URL. This method has not much use + # outside of testing and implementing highly custom reconnect logic. + # @param url [String, nil] the URL to connect to or nil if one should be obtained from Discord. + def inject_reconnect(url = nil) + # When no URL is specified, the data should be nil, as is the case with Discord-sent packets. + data = url ? { url: url } : nil + + handle_message({ + op: Opcodes::RECONNECT, + d: data + }.to_json) + end + + # Injects a resume packet (op 6) into the gateway. If this is done with a running connection, it will cause an + # error. It has no use outside of testing stuff that I know of, but if you want to use it anyway for some reason, + # here it is. + # @param seq [Integer, nil] The sequence ID to inject, or nil if the currently tracked one should be used. + def inject_resume(seq) + send_resume(raw_token, @session_id, seq || @sequence) + end + + # Injects a terminal gateway error into the handler. Useful for testing the reconnect logic. + # @param e [Exception] The exception object to inject. + def inject_error(e) + handle_internal_close(e) + end + + # Sends a heartbeat with the last received packet's seq (to acknowledge that we have received it and all packets + # before it), or if none have been received yet, with 0. + # @see #send_heartbeat + def heartbeat + if check_heartbeat_acks + unless @last_heartbeat_acked + # We're in a bad situation - apparently the last heartbeat wasn't ACK'd, which means the connection is likely + # a zombie. Reconnect + LOGGER.warn('Last heartbeat was not acked, so this is a zombie connection! Reconnecting') + + # We can't send anything on zombie connections + @pipe_broken = true + reconnect + return + end + + @last_heartbeat_acked = false + end + + send_heartbeat(@session ? @session.sequence : 0) + end + + # Sends a heartbeat packet (op 1). This tells Discord that the current connection is still active and that the last + # packets until the given sequence have been processed (in case of a resume). + # @param sequence [Integer] The sequence number for which to send a heartbeat. + def send_heartbeat(sequence) + send_packet(Opcodes::HEARTBEAT, sequence) + end + + # Identifies to Discord with the default parameters. + # @see #send_identify + def identify + compress = @compress_mode == :large + send_identify(@token, { + '$os': RUBY_PLATFORM, + '$browser': 'discordrb', + '$device': 'discordrb', + '$referrer': '', + '$referring_domain': '' + }, compress, 100, @shard_key) + end + + # Sends an identify packet (op 2). This starts a new session on the current connection and tells Discord who we are. + # This can only be done once a connection. + # @param token [String] The token with which to authorise the session. If it belongs to a bot account, it must be + # prefixed with "Bot ". + # @param properties [Hash String>] A list of properties for Discord to use in analytics. The following + # keys are recognised: + # + # - "$os" (recommended value: the operating system the bot is running on) + # - "$browser" (recommended value: library name) + # - "$device" (recommended value: library name) + # - "$referrer" (recommended value: empty) + # - "$referring_domain" (recommended value: empty) + # + # @param compress [true, false] Whether certain large packets should be compressed using zlib. + # @param large_threshold [Integer] The member threshold after which a server counts as large and will have to have + # its member list chunked. + # @param shard_key [Array(Integer, Integer), nil] The shard key to use for sharding, represented as + # [shard_id, num_shards], or nil if the bot should not be sharded. + def send_identify(token, properties, compress, large_threshold, shard_key = nil) + data = { + # Don't send a v anymore as it's entirely determined by the URL now + token: token, + properties: properties, + compress: compress, + large_threshold: large_threshold + } + data[:intents] = @intents unless @intents.nil? + + # Don't include the shard key at all if it is nil as Discord checks for its mere existence + data[:shard] = shard_key if shard_key + + send_packet(Opcodes::IDENTIFY, data) + end + + # Sends a status update packet (op 3). This sets the bot user's status (online/idle/...) and game playing/streaming. + # @param status [String] The status that should be set (`online`, `idle`, `dnd`, `invisible`). + # @param since [Integer] The Unix timestamp in milliseconds when the status was set. Should only be provided when + # `afk` is true. + # @param game [Hash Object>, nil] `nil` if no game should be played, or a hash of `:game => "name"` if a + # game should be played. The hash can also contain additional attributes for streaming statuses. + # @param afk [true, false] Whether the status was set due to inactivity on the user's part. + def send_status_update(status, since, game, afk) + data = { + status: status, + since: since, + game: game, + afk: afk + } + + send_packet(Opcodes::PRESENCE, data) + end + + # Sends a voice state update packet (op 4). This packet can connect a user to a voice channel, update self mute/deaf + # status in an existing voice connection, move the user to a new voice channel on the same server or disconnect an + # existing voice connection. + # @param server_id [Integer] The ID of the server on which this action should occur. + # @param channel_id [Integer, nil] The channel ID to connect/move to, or `nil` to disconnect. + # @param self_mute [true, false] Whether the user should itself be muted to everyone else. + # @param self_deaf [true, false] Whether the user should be deaf towards other users. + def send_voice_state_update(server_id, channel_id, self_mute, self_deaf) + data = { + guild_id: server_id, + channel_id: channel_id, + self_mute: self_mute, + self_deaf: self_deaf + } + + send_packet(Opcodes::VOICE_STATE, data) + end + + # Resumes the session from the last recorded point. + # @see #send_resume + def resume + send_resume(@token, @session.session_id, @session.sequence) + end + + # Reconnects the gateway connection in a controlled manner. + # @param attempt_resume [true, false] Whether a resume should be attempted after the reconnection. + def reconnect(attempt_resume = true) + @session.suspend if @session && attempt_resume + + @instant_reconnect = true + @should_reconnect = true + + close(4000) + end + + # Sends a resume packet (op 6). This replays all events from a previous point specified by its packet sequence. This + # will not work if the packet to resume from has already been acknowledged using a heartbeat, or if the session ID + # belongs to a now invalid session. + # + # If this packet is sent at the beginning of a connection, it will act similarly to an {#identify} in that it + # creates a session on the current connection. Unlike identify however, this packet can also be sent in an existing + # session and will just replay some of the events. + # @param token [String] The token that was used to identify the session to resume. + # @param session_id [String] The session ID of the session to resume. + # @param seq [Integer] The packet sequence of the packet after which the events should be replayed. + def send_resume(token, session_id, seq) + data = { + token: token, + session_id: session_id, + seq: seq + } + + send_packet(Opcodes::RESUME, data) + end + + # Sends a request members packet (op 8). This will order Discord to gradually sent all requested members as dispatch + # events with type `GUILD_MEMBERS_CHUNK`. It is necessary to use this method in order to get all members of a large + # server (see `large_threshold` in {#send_identify}), however it can also be used for other purposes. + # @param server_id [Integer] The ID of the server whose members to query. + # @param query [String] If this string is not empty, only members whose username starts with this string will be + # returned. + # @param limit [Integer] How many members to send at maximum, or `0` to send all members. + def send_request_members(server_id, query, limit) + data = { + guild_id: server_id, + query: query, + limit: limit + } + + send_packet(Opcodes::REQUEST_MEMBERS, data) + end + + # Sends a custom packet over the connection. This can be useful to implement future yet unimplemented functionality + # or for testing. You probably shouldn't use this unless you know what you're doing. + # @param opcode [Integer] The opcode the packet should be sent as. Can be one of {Opcodes} or a custom value if + # necessary. + # @param packet [Object] Some arbitrary JSON-serializable data that should be sent as the `d` field. + def send_packet(opcode, packet) + data = { + op: opcode, + d: packet + } + + send(data.to_json) + end + + # Sends custom raw data over the connection. Only useful for testing; even if you know what you're doing you + # probably want to use {#send_packet} instead. + # @param data [String] The data to send. + # @param type [Symbol] The type the WebSocket frame should have; either `:text`, `:binary`, `:ping`, `:pong`, or + # `:close`. + def send_raw(data, type = :text) + send(data, type) + end + + private + + def setup_heartbeats(interval) + # Make sure to reset ACK handling, so we don't keep reconnecting + @last_heartbeat_acked = true + + # We don't want to have redundant heartbeat threads, so if one already exists, don't start a new one + return if @heartbeat_thread + + @heartbeat_interval = interval + @heartbeat_thread = Thread.new do + Thread.current[:discordrb_name] = 'heartbeat' + loop do + # Send a heartbeat if heartbeats are active and either no session exists yet, or an existing session is + # suspended (e.g. after op7) + if (@session && !@session.suspended?) || !@session + sleep @heartbeat_interval + @bot.raise_heartbeat_event + heartbeat + else + sleep 1 + end + rescue StandardError => e + LOGGER.error('An error occurred while heartbeating!') + LOGGER.log_exception(e) + end + end + end + + def connect_loop + # Initialize falloff so we wait for more time before reconnecting each time + @falloff = 1.0 + + @should_reconnect = true + loop do + connect + + break unless @should_reconnect + + if @instant_reconnect + LOGGER.info('Instant reconnection flag was set - reconnecting right away') + @instant_reconnect = false + else + wait_for_reconnect + end + + # Restart the loop, i.e. reconnect + end + end + + # Separate method to wait an ever-increasing amount of time before reconnecting after being disconnected in an + # unexpected way + def wait_for_reconnect + # We disconnected in an unexpected way! Wait before reconnecting so we don't spam Discord's servers. + LOGGER.debug("Attempting to reconnect in #{@falloff} seconds.") + sleep @falloff + + # Calculate new falloff + @falloff *= 1.5 + @falloff = 115 + (rand * 10) if @falloff > 120 # Cap the falloff at 120 seconds and then add some random jitter + end + + # Create and connect a socket using a URI + def obtain_socket(uri) + socket = TCPSocket.new(uri.host, uri.port || socket_port(uri)) + + if secure_uri?(uri) + ctx = OpenSSL::SSL::SSLContext.new + + if ENV['DISCORDRB_SSL_VERIFY_NONE'] + ctx.ssl_version = 'SSLv23' + ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE # use VERIFY_PEER for verification + + cert_store = OpenSSL::X509::Store.new + cert_store.set_default_paths + ctx.cert_store = cert_store + else + ctx.set_params ssl_version: :TLSv1_2 # rubocop:disable Naming/VariableNumber + end + + socket = OpenSSL::SSL::SSLSocket.new(socket, ctx) + socket.connect + end + + socket + end + + # Whether the URI is secure (connection should be encrypted) + def secure_uri?(uri) + %w[https wss].include? uri.scheme + end + + # The port we should connect to, if the URI doesn't have one set. + def socket_port(uri) + secure_uri?(uri) ? 443 : 80 + end + + def find_gateway + response = API.gateway(@token) + JSON.parse(response)['url'] + end + + def process_gateway + raw_url = find_gateway + + # Append a slash in case it's not there (I'm not sure how well WSCS handles it otherwise) + raw_url += '/' unless raw_url.end_with? '/' + + query = if @compress_mode == :stream + "?encoding=json&v=#{GATEWAY_VERSION}&compress=zlib-stream" + else + "?encoding=json&v=#{GATEWAY_VERSION}" + end + + raw_url + query + end + + def connect + LOGGER.debug('Connecting') + + # Get the URI we should connect to + url = process_gateway + LOGGER.debug("Gateway URL: #{url}") + + # Parse it + gateway_uri = URI.parse(url) + + # Zlib context for this gateway connection + @zlib_reader = Zlib::Inflate.new + + # Connect to the obtained URI with a socket + @socket = obtain_socket(gateway_uri) + LOGGER.debug('Obtained socket') + + # Initialise some properties + @handshake = ::WebSocket::Handshake::Client.new(url: url) # Represents the handshake between us and the server + @handshaked = false # Whether the handshake has finished yet + @pipe_broken = false # Whether we've received an EPIPE at any time + @closed = false # Whether the websocket is currently closed + + # We're done! Delegate to the websocket loop + websocket_loop + rescue StandardError => e + LOGGER.error('An error occurred while connecting to the websocket!') + LOGGER.log_exception(e) + end + + def websocket_loop + # Send the handshake data that we have so far + @socket.write(@handshake.to_s) + + # Create a frame to handle received data + frame = ::WebSocket::Frame::Incoming::Client.new + + until @closed + begin + unless @socket + LOGGER.warn('Socket is nil in websocket_loop! Reconnecting') + handle_internal_close('Socket is nil in websocket_loop') + next + end + + # Get some data from the socket + begin + recv_data = @socket.readpartial(4096) + rescue EOFError + @pipe_broken = true + handle_internal_close('Socket EOF in websocket_loop') + next + end + + # Check if we actually got data + unless recv_data + # If we didn't, wait + sleep 1 + next + end + + # Check whether the handshake has finished yet + if @handshaked + # If it hasn't, add the received data to the current frame + frame << recv_data + + # Try to parse a message from the frame + msg = frame.next + while msg + # Check whether the message is a close frame, and if it is, handle accordingly + if msg.respond_to?(:code) && msg.code + handle_internal_close(msg) + break + end + + # If there is one, handle it and try again + handle_message(msg.data) + msg = frame.next + end + else + # If the handshake hasn't finished, handle it + handle_handshake_data(recv_data) + end + rescue StandardError => e + handle_error(e) + end + end + end + + def handle_handshake_data(recv_data) + @handshake << recv_data + return unless @handshake.finished? + + @handshaked = true + handle_open + end + + def handle_open; end + + def handle_error(e) + LOGGER.error('An error occurred in the main websocket loop!') + LOGGER.log_exception(e) + end + + ZLIB_SUFFIX = "\x00\x00\xFF\xFF".b.freeze + + def handle_message(msg) + case @compress_mode + when :large + if msg.byteslice(0) == 'x' + # The message is compressed, inflate it + msg = Zlib::Inflate.inflate(msg) + end + when :stream + # Write deflated string to buffer + @zlib_reader << msg + + # Check if message ends in `ZLIB_SUFFIX` + return if msg.bytesize < 4 || msg.byteslice(-4, 4) != ZLIB_SUFFIX + + # Inflate the deflated buffer + msg = @zlib_reader.inflate('') + end + + # Parse packet + packet = JSON.parse(msg) + op = packet['op'].to_i + + LOGGER.in(packet) + + # If the packet has a sequence defined (all dispatch packets have one), make sure to update that in the + # session so it will be acknowledged next heartbeat. + # Only do this, of course, if a session has been created already; for a READY dispatch (which has s=0 set but is + # the packet that starts the session in the first place) we need not do any handling since initialising the + # session will set it to 0 by default. + @session.sequence = packet['s'] if packet['s'] && @session + + case op + when Opcodes::DISPATCH + handle_dispatch(packet) + when Opcodes::HELLO + handle_hello(packet) + when Opcodes::RECONNECT + handle_reconnect + when Opcodes::INVALIDATE_SESSION + handle_invalidate_session + when Opcodes::HEARTBEAT_ACK + handle_heartbeat_ack(packet) + when Opcodes::HEARTBEAT + handle_heartbeat(packet) + else + LOGGER.warn("Received invalid opcode #{op} - please report with this information: #{msg}") + end + end + + # Op 0 + def handle_dispatch(packet) + data = packet['d'] + type = packet['t'].intern + + case type + when :READY + LOGGER.info("Discord using gateway protocol version: #{data['v']}, requested: #{GATEWAY_VERSION}") + + @session = Session.new(data['session_id']) + @session.sequence = 0 + @bot.__send__(:notify_ready) if @intents && (@intents & INTENTS[:servers]).zero? + when :RESUMED + # The RESUMED event is received after a successful op 6 (resume). It does nothing except tell the bot the + # connection is initiated (like READY would). Starting with v5, it doesn't set a new heartbeat interval anymore + # since that is handled by op 10 (HELLO). + LOGGER.info 'Resumed' + return + end + + @bot.dispatch(type, data) + end + + # Op 1 + def handle_heartbeat(packet) + # If we receive a heartbeat, we have to resend one with the same sequence + send_heartbeat(packet['s']) + end + + # Op 7 + def handle_reconnect + LOGGER.debug('Received op 7, reconnecting and attempting resume') + reconnect + end + + # Op 9 + def handle_invalidate_session + LOGGER.debug('Received op 9, invalidating session and re-identifying.') + + if @session + @session.invalidate + else + LOGGER.warn('Received op 9 without a running session! Not invalidating, we *should* be fine though.') + end + + identify + end + + # Op 10 + def handle_hello(packet) + LOGGER.debug('Hello!') + + # The heartbeat interval is given in ms, so divide it by 1000 to get seconds + interval = packet['d']['heartbeat_interval'].to_f / 1000.0 + setup_heartbeats(interval) + + LOGGER.debug("Trace: #{packet['d']['_trace']}") + LOGGER.debug("Session: #{@session.inspect}") + + if @session&.should_resume? + # Make sure we're sending heartbeats again + @session.resume + + # Send the actual resume packet to get the missing events + resume + else + identify + end + end + + # Op 11 + def handle_heartbeat_ack(packet) + LOGGER.debug("Received heartbeat ack for packet: #{packet.inspect}") + @last_heartbeat_acked = true if @check_heartbeat_acks + end + + # Called when the websocket has been disconnected in some way - say due to a pipe error while sending + def handle_internal_close(e) + close + handle_close(e) + end + + # Close codes that are unrecoverable, after which we should not try to reconnect. + # - 4003: Not authenticated. How did this happen? + # - 4004: Authentication failed. Token was wrong, nothing we can do. + # - 4011: Sharding required. Currently requires developer intervention. + FATAL_CLOSE_CODES = [4003, 4004, 4011].freeze + + def handle_close(e) + @bot.__send__(:raise_event, Events::DisconnectEvent.new(@bot)) + + if e.respond_to? :code + # It is a proper close frame we're dealing with, print reason and message to console + LOGGER.error('Websocket close frame received!') + LOGGER.error("Code: #{e.code}") + LOGGER.error("Message: #{e.data}") + @should_reconnect = false if FATAL_CLOSE_CODES.include?(e.code) + elsif e.is_a? Exception + # Log the exception + LOGGER.error('The websocket connection has closed due to an error!') + LOGGER.log_exception(e) + else + LOGGER.error("The websocket connection has closed: #{e&.inspect || '(no information)'}") + end + end + + def send(data, type = :text, code = nil) + LOGGER.out(data) + + unless @handshaked && !@closed + # If we're not handshaked or closed, it means there's no connection to send anything to + raise 'Tried to send something to the websocket while not being connected!' + end + + # Create the frame we're going to send + frame = ::WebSocket::Frame::Outgoing::Client.new(data: data, type: type, version: @handshake.version, code: code) + + # Try to send it + begin + @socket.write frame.to_s + rescue StandardError => e + # There has been an error! + @pipe_broken = true + handle_internal_close(e) + end + end + + def close(code = 1000) + # If we're already closed, there's no need to do anything - return + return if @closed + + # Suspend the session so we don't send heartbeats + @session&.suspend + + # Send a close frame (if we can) + send nil, :close, code unless @pipe_broken + + # We're officially closed, notify the main loop. + @closed = true + + # Close the socket if possible + @socket&.close + @socket = nil + + # Make sure we do necessary things as soon as we're closed + handle_close(nil) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/id_object.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/id_object.rb new file mode 100644 index 0000000..1627ac3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/id_object.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Discordrb + # Mixin for objects that have IDs + module IDObject + # @return [Integer] the ID which uniquely identifies this object across Discord. + attr_reader :id + alias_method :resolve_id, :id + alias_method :hash, :id + + # ID based comparison + def ==(other) + Discordrb.id_compare(@id, other) + end + + alias_method :eql?, :== + + # Estimates the time this object was generated on based on the beginning of the ID. This is fairly accurate but + # shouldn't be relied on as Discord might change its algorithm at any time + # @return [Time] when this object was created at + def creation_time + # Milliseconds + ms = (@id >> 22) + DISCORD_EPOCH + Time.at(ms / 1000.0) + end + + # Creates an artificial snowflake at the given point in time. Useful for comparing against. + # @param time [Time] The time the snowflake should represent. + # @return [Integer] a snowflake with the timestamp data as the given time + def self.synthesise(time) + ms = (time.to_f * 1000).to_i + (ms - DISCORD_EPOCH) << 22 + end + + class << self + alias_method :synthesize, :synthesise + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light.rb new file mode 100644 index 0000000..4e93cfb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'discordrb/light/light_bot' + +# This module contains classes to allow connections to bots without a connection to the gateway socket, i.e. bots +# that only use the REST part of the API. +module Discordrb::Light +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/data.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/data.rb new file mode 100644 index 0000000..d957674 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/data.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +require 'discordrb/data' + +module Discordrb::Light + # Represents the bot account used for the light bot, but without any methods to change anything. + class LightProfile + include Discordrb::IDObject + include Discordrb::UserAttributes + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @username = data['username'] + @id = data['id'].to_i + @discriminator = data['discriminator'] + @avatar_id = data['avatar'] + + @bot_account = false + @bot_account = true if data['bot'] + + @verified = data['verified'] + + @email = data['email'] + end + end + + # A server that only has an icon, a name, and an ID associated with it, like for example an integration's server. + class UltraLightServer + include Discordrb::IDObject + include Discordrb::ServerAttributes + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @id = data['id'].to_i + + @name = data['name'] + @icon_id = data['icon'] + end + end + + # Represents a light server which only has a fraction of the properties of any other server. + class LightServer < UltraLightServer + # @return [true, false] whether or not the LightBot this server belongs to is the owner of the server. + attr_reader :bot_is_owner + alias_method :bot_is_owner?, :bot_is_owner + + # @return [Discordrb::Permissions] the permissions the LightBot has on this server + attr_reader :bot_permissions + + # @!visibility private + def initialize(data, bot) + super(data, bot) + + @bot_is_owner = data['owner'] + @bot_permissions = Discordrb::Permissions.new(data['permissions']) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/integrations.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/integrations.rb new file mode 100644 index 0000000..d37ca62 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/integrations.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +require 'discordrb/data' +require 'discordrb/light/data' + +module Discordrb::Light + # A connection of your Discord account to a particular other service (currently, Twitch and YouTube) + class Connection + # @return [Symbol] what type of connection this is (either :twitch or :youtube currently) + attr_reader :type + + # @return [true, false] whether this connection is revoked + attr_reader :revoked + alias_method :revoked?, :revoked + + # @return [String] the name of the connected account + attr_reader :name + + # @return [String] the ID of the connected account + attr_reader :id + + # @return [Array] the integrations associated with this connection + attr_reader :integrations + + # @!visibility private + def initialize(data, bot) + @bot = bot + + @revoked = data['revoked'] + @type = data['type'].to_sym + @name = data['name'] + @id = data['id'] + + @integrations = data['integrations'].map { |e| Integration.new(e, self, bot) } + end + end + + # An integration of a connection into a particular server, for example being a member of a subscriber-only Twitch + # server. + class Integration + include Discordrb::IDObject + + # @return [UltraLightServer] the server associated with this integration + attr_reader :server + + # @note The connection returned by this method will have no integrations itself, as Discord doesn't provide that + # data. Also, it will always be considered not revoked. + # @return [Connection] the server's underlying connection (for a Twitch subscriber-only server, it would be the + # Twitch account connection of the server owner). + attr_reader :server_connection + + # @return [Connection] the connection integrated with the server (i.e. your connection) + attr_reader :integrated_connection + + # @!visibility private + def initialize(data, integrated, bot) + @bot = bot + @integrated_connection = integrated + + @server = UltraLightServer.new(data['guild'], bot) + + # Restructure the given data so we can reuse the Connection initializer + restructured = {} + + restructured['type'] = data['type'] + restructured['id'] = data['account']['id'] + restructured['name'] = data['account']['name'] + restructured['integrations'] = [] + + @server_connection = Connection.new(restructured, bot) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/light_bot.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/light_bot.rb new file mode 100644 index 0000000..d87d3c3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/light/light_bot.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require 'discordrb/api' +require 'discordrb/api/invite' +require 'discordrb/api/user' +require 'discordrb/light/data' +require 'discordrb/light/integrations' + +# This module contains classes to allow connections to bots without a connection to the gateway socket, i.e. bots +# that only use the REST part of the API. +module Discordrb::Light + # A bot that only uses the REST part of the API. Hierarchically unrelated to the regular {Discordrb::Bot}. Useful to + # make applications integrated to Discord over OAuth, for example. + class LightBot + # Create a new LightBot. This does no networking yet, all networking is done by the methods on this class. + # @param token [String] The token that should be used to authenticate to Discord. Can be an OAuth token or a regular + # user account token. + def initialize(token) + if token.respond_to? :token + # Parse AccessTokens from the OAuth2 gem + token = token.token + end + + unless token.include? '.' + # Discord user/bot tokens always contain two dots, so if there's none we can assume it's an OAuth token. + token = "Bearer #{token}" # OAuth tokens have to be prefixed with 'Bearer' for Discord to be able to use them + end + + @token = token + end + + # @return [LightProfile] the details of the user this bot is connected to. + def profile + response = Discordrb::API::User.profile(@token) + LightProfile.new(JSON.parse(response), self) + end + + # @return [Array] the servers this bot is connected to. + def servers + response = Discordrb::API::User.servers(@token) + JSON.parse(response).map { |e| LightServer.new(e, self) } + end + + # Joins a server using an instant invite. + # @param code [String] The code part of the invite (for example 0cDvIgU2voWn4BaD if the invite URL is + # https://discord.gg/0cDvIgU2voWn4BaD) + def join(code) + Discordrb::API::Invite.accept(@token, code) + end + + # Gets the connections associated with this account. + # @return [Array] this account's connections. + def connections + response = Discordrb::API::User.connections(@token) + JSON.parse(response).map { |e| Connection.new(e, self) } + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/logger.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/logger.rb new file mode 100644 index 0000000..6e5d764 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/logger.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Discordrb + # The format log timestamps should be in, in strftime format + LOG_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S.%L' + + # Logs debug messages + class Logger + # @return [true, false] whether this logger is in extra-fancy mode! + attr_writer :fancy + + # @return [String, nil] The bot token to be redacted or nil if it shouldn't. + attr_writer :token + + # @return [Array, Array<#puts & #flush>] the streams the logger should write to. + attr_accessor :streams + + # Creates a new logger. + # @param fancy [true, false] Whether this logger uses fancy mode (ANSI escape codes to make the output colourful) + # @param streams [Array, Array<#puts & #flush>] the streams the logger should write to. + def initialize(fancy = false, streams = [$stdout]) + @fancy = fancy + self.mode = :normal + + @streams = streams + end + + # The modes this logger can have. This is probably useless unless you want to write your own Logger + MODES = { + debug: { long: 'DEBUG', short: 'D', format_code: '' }, + good: { long: 'GOOD', short: '✓', format_code: "\u001B[32m" }, # green + info: { long: 'INFO', short: 'i', format_code: '' }, + warn: { long: 'WARN', short: '!', format_code: "\u001B[33m" }, # yellow + error: { long: 'ERROR', short: '✗', format_code: "\u001B[31m" }, # red + out: { long: 'OUT', short: '→', format_code: "\u001B[36m" }, # cyan + in: { long: 'IN', short: '←', format_code: "\u001B[35m" }, # purple + ratelimit: { long: 'RATELIMIT', short: 'R', format_code: "\u001B[41m" } # red background + }.freeze + + # The ANSI format code that resets formatting + FORMAT_RESET = "\u001B[0m" + + # The ANSI format code that makes something bold + FORMAT_BOLD = "\u001B[1m" + + MODES.each do |mode, hash| + define_method(mode) do |message| + write(message.to_s, hash) if @enabled_modes.include? mode + end + end + + # Sets the logging mode to :debug + # @param value [true, false] Whether debug mode should be on. If it is off the mode will be set to :normal. + def debug=(value) + self.mode = value ? :debug : :normal + end + + # Sets the logging mode + # Possible modes are: + # * :debug logs everything + # * :verbose logs everything except for debug messages + # * :normal logs useful information, warnings and errors + # * :quiet only logs warnings and errors + # * :silent logs nothing + # @param value [Symbol] What logging mode to use + def mode=(value) + case value + when :debug + @enabled_modes = %i[debug good info warn error out in ratelimit] + when :verbose + @enabled_modes = %i[good info warn error out in ratelimit] + when :normal + @enabled_modes = %i[info warn error ratelimit] + when :quiet + @enabled_modes = %i[warn error] + when :silent + @enabled_modes = %i[] + end + end + + # Logs an exception to the console. + # @param e [Exception] The exception to log. + def log_exception(e) + error("Exception: #{e.inspect}") + e.backtrace.each { |line| error(line) } + end + + private + + def write(message, mode) + thread_name = Thread.current[:discordrb_name] + timestamp = Time.now.strftime(LOG_TIMESTAMP_FORMAT) + + # Redact token if set + log = if @token && @token != '' + message.to_s.gsub(@token, 'REDACTED_TOKEN') + else + message.to_s + end + + @streams.each do |stream| + if @fancy && !stream.is_a?(File) + fancy_write(stream, log, mode, thread_name, timestamp) + else + simple_write(stream, log, mode, thread_name, timestamp) + end + end + end + + def fancy_write(stream, message, mode, thread_name, timestamp) + stream.puts "#{timestamp} #{FORMAT_BOLD}#{thread_name.ljust(16)}#{FORMAT_RESET} #{mode[:format_code]}#{mode[:short]}#{FORMAT_RESET} #{message}" + stream.flush + end + + def simple_write(stream, message, mode, thread_name, timestamp) + stream.puts "[#{mode[:long]} : #{thread_name} @ #{timestamp}] #{message}" + stream.flush + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/paginator.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/paginator.rb new file mode 100644 index 0000000..d27ef61 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/paginator.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Discordrb + # Utility class for wrapping paginated endpoints. It is [Enumerable](https://ruby-doc.org/core-2.5.1/Enumerable.html), + # similar to an `Array`, so most of the same methods can be used to filter the results of the request + # that it wraps. If you simply want an array of all of the results, `#to_a` can be called. + class Paginator + include Enumerable + + # Creates a new {Paginator} + # @param limit [Integer] the maximum number of items to request before stopping + # @param direction [:up, :down] the order in which results are returned in + # @yield [Array, nil] the last page of results, or nil if this is the first iteration. + # This should be used to request the next page of results. + # @yieldreturn [Array] the next page of results + def initialize(limit, direction, &block) + @count = 0 + @limit = limit + @direction = direction + @block = block + end + + # Yields every item produced by the wrapped request, until it returns + # no more results or the configured `limit` is reached. + def each + last_page = nil + until limit_check + page = @block.call(last_page) + return if page.empty? + + enumerator = case @direction + when :down + page.each + when :up + page.reverse_each + end + + enumerator.each do |item| + yield item + @count += 1 + break if limit_check + end + + last_page = page + end + end + + private + + # Whether the paginator limit has been exceeded + def limit_check + return false if @limit.nil? + + @count >= @limit + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/permissions.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/permissions.rb new file mode 100644 index 0000000..c75ff32 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/permissions.rb @@ -0,0 +1,219 @@ +# frozen_string_literal: true + +module Discordrb + # List of permissions Discord uses + class Permissions + # This hash maps bit positions to logical permissions. + FLAGS = { + # Bit => Permission # Value + 0 => :create_instant_invite, # 1 + 1 => :kick_members, # 2 + 2 => :ban_members, # 4 + 3 => :administrator, # 8 + 4 => :manage_channels, # 16 + 5 => :manage_server, # 32 + 6 => :add_reactions, # 64 + 7 => :view_audit_log, # 128 + 8 => :priority_speaker, # 256 + 9 => :stream, # 512 + 10 => :read_messages, # 1024 + 11 => :send_messages, # 2048 + 12 => :send_tts_messages, # 4096 + 13 => :manage_messages, # 8192 + 14 => :embed_links, # 16384 + 15 => :attach_files, # 32768 + 16 => :read_message_history, # 65536 + 17 => :mention_everyone, # 131072 + 18 => :use_external_emoji, # 262144 + 19 => :view_server_insights, # 524288 + 20 => :connect, # 1048576 + 21 => :speak, # 2097152 + 22 => :mute_members, # 4194304 + 23 => :deafen_members, # 8388608 + 24 => :move_members, # 16777216 + 25 => :use_voice_activity, # 33554432 + 26 => :change_nickname, # 67108864 + 27 => :manage_nicknames, # 134217728 + 28 => :manage_roles, # 268435456, also Manage Permissions + 29 => :manage_webhooks, # 536870912 + 30 => :manage_emojis # 1073741824 + }.freeze + + FLAGS.each do |position, flag| + attr_reader flag + + define_method "can_#{flag}=" do |value| + new_bits = @bits + if value + new_bits |= (1 << position) + else + new_bits &= ~(1 << position) + end + @writer&.write(new_bits) + @bits = new_bits + init_vars + end + end + + alias_method :can_administrate=, :can_administrator= + alias_method :administrate, :administrator + + attr_reader :bits + + # Set the raw bitset of this permission object + # @param bits [Integer] A number whose binary representation is the desired bitset. + def bits=(bits) + @bits = bits + init_vars + end + + # Initialize the instance variables based on the bitset. + def init_vars + FLAGS.each do |position, flag| + flag_set = ((@bits >> position) & 0x1) == 1 + instance_variable_set "@#{flag}", flag_set + end + end + + # Return the corresponding bits for an array of permission flag symbols. + # This is a class method that can be used to calculate bits instead + # of instancing a new Permissions object. + # @example Get the bits for permissions that could allow/deny read messages, connect, and speak + # Permissions.bits [:read_messages, :connect, :speak] #=> 3146752 + # @param list [Array] + # @return [Integer] the computed permissions integer + def self.bits(list) + value = 0 + + FLAGS.each do |position, flag| + value += 2**position if list.include? flag + end + + value + end + + # Create a new Permissions object either as a blank slate to add permissions to (for example for + # {Channel#define_overwrite}) or from existing bit data to read out. + # @example Create a permissions object that could allow/deny read messages, connect, and speak by setting flags + # permission = Permissions.new + # permission.can_read_messages = true + # permission.can_connect = true + # permission.can_speak = true + # @example Create a permissions object that could allow/deny read messages, connect, and speak by an array of symbols + # Permissions.new [:read_messages, :connect, :speak] + # @param bits [Integer, Array] The permission bits that should be set from the beginning, or an array of permission flag symbols + # @param writer [RoleWriter] The writer that should be used to update data when a permission is set. + def initialize(bits = 0, writer = nil) + @writer = writer + + @bits = if bits.is_a? Array + self.class.bits(bits) + else + bits + end + + init_vars + end + + # Comparison based on permission bits + def ==(other) + false unless other.is_a? Discordrb::Permissions + bits == other.bits + end + end + + # Mixin to calculate resulting permissions from overrides etc. + module PermissionCalculator + # Checks whether this user can do the particular action, regardless of whether it has the permission defined, + # through for example being the server owner or having the Manage Roles permission + # @param action [Symbol] The permission that should be checked. See also {Permissions::FLAGS} for a list. + # @param channel [Channel, nil] If channel overrides should be checked too, this channel specifies where the overrides should be checked. + # @example Check if the bot can send messages to a specific channel in a server. + # bot_profile = bot.profile.on(event.server) + # can_send_messages = bot_profile.permission?(:send_messages, channel) + # @return [true, false] whether or not this user has the permission. + def permission?(action, channel = nil) + # If the member is the server owner, it irrevocably has all permissions. + return true if owner? + + # First, check whether the user has Manage Roles defined. + # (Coincidentally, Manage Permissions is the same permission as Manage Roles, and a + # Manage Permissions deny overwrite will override Manage Roles, so we can just check for + # Manage Roles once and call it a day.) + return true if defined_permission?(:administrator, channel) + + # Otherwise, defer to defined_permission + defined_permission?(action, channel) + end + + # Checks whether this user has a particular permission defined (i.e. not implicit, through for example + # Manage Roles) + # @param action [Symbol] The permission that should be checked. See also {Permissions::FLAGS} for a list. + # @param channel [Channel, nil] If channel overrides should be checked too, this channel specifies where the overrides should be checked. + # @example Check if a member has the Manage Channels permission defined in the server. + # has_manage_channels = member.defined_permission?(:manage_channels) + # @return [true, false] whether or not this user has the permission defined. + def defined_permission?(action, channel = nil) + # Get the permission the user's roles have + role_permission = defined_role_permission?(action, channel) + + # Once we have checked the role permission, we have to check the channel overrides for the + # specific user + user_specific_override = permission_overwrite(action, channel, id) # Use the ID reader as members have no ID instance variable + + # Merge the two permissions - if an override is defined, it has to be allow, otherwise we only care about the role + return role_permission unless user_specific_override + + user_specific_override == :allow + end + + # Define methods for querying permissions + Discordrb::Permissions::FLAGS.each_value do |flag| + define_method "can_#{flag}?" do |channel = nil| + permission? flag, channel + end + end + + alias_method :can_administrate?, :can_administrator? + + private + + def defined_role_permission?(action, channel) + roles_to_check = [@server.everyone_role] + @roles + + # For each role, check if + # (1) the channel explicitly allows or permits an action for the role and + # (2) if the user is allowed to do the action if the channel doesn't specify + roles_to_check.sort_by(&:position).reduce(false) do |can_act, role| + # Get the override defined for the role on the channel + channel_allow = permission_overwrite(action, channel, role.id) + if channel_allow + # If the channel has an override, check whether it is an allow - if yes, + # the user can act, if not, it can't + break true if channel_allow == :allow + + false + else + # Otherwise defer to the role + role.permissions.instance_variable_get("@#{action}") || can_act + end + end + end + + def permission_overwrite(action, channel, id) + # If no overwrites are defined, or no channel is set, no overwrite will be present + return nil unless channel && channel.permission_overwrites[id] + + # Otherwise, check the allow and deny objects + allow = channel.permission_overwrites[id].allow + deny = channel.permission_overwrites[id].deny + if allow.instance_variable_get("@#{action}") + :allow + elsif deny.instance_variable_get("@#{action}") + :deny + end + + # If there's no variable defined, nil will implicitly be returned + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/version.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/version.rb new file mode 100644 index 0000000..f748781 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Discordrb and all its functionality, in this case only the version. +module Discordrb + # The current version of discordrb. + VERSION = '3.4.0' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/encoder.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/encoder.rb new file mode 100644 index 0000000..807f158 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/encoder.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# This makes opus an optional dependency +begin + require 'opus-ruby' + OPUS_AVAILABLE = true +rescue LoadError + OPUS_AVAILABLE = false +end + +# Discord voice chat support +module Discordrb::Voice + # This class conveniently abstracts opus and ffmpeg/avconv, for easy implementation of voice sending. It's not very + # useful for most users, but I guess it can be useful sometimes. + class Encoder + # Whether or not avconv should be used instead of ffmpeg. If possible, it is recommended to use ffmpeg instead, + # as it is better supported. + # @return [true, false] whether avconv should be used instead of ffmpeg. + attr_accessor :use_avconv + + # @see VoiceBot#filter_volume= + # @return [Integer] the volume used as a filter to ffmpeg/avconv. + attr_accessor :filter_volume + + # Create a new encoder + def initialize + sample_rate = 48_000 + frame_size = 960 + channels = 2 + @filter_volume = 1 + + raise LoadError, 'Opus unavailable - voice not supported! Please install opus for voice support to work.' unless OPUS_AVAILABLE + + @opus = Opus::Encoder.new(sample_rate, frame_size, channels) + end + + # Set the opus encoding bitrate + # @param value [Integer] The new bitrate to use, in bits per second (so 64000 if you want 64 kbps) + def bitrate=(value) + @opus.bitrate = value + end + + # Encodes the given buffer using opus. + # @param buffer [String] An unencoded PCM (s16le) buffer. + # @return [String] A buffer encoded using opus. + def encode(buffer) + @opus.encode(buffer, 1920) + end + + # One frame of complete silence Opus encoded + OPUS_SILENCE = [0xF8, 0xFF, 0xFE].pack('C*').freeze + + # Adjusts the volume of a given buffer of s16le PCM data. + # @param buf [String] An unencoded PCM (s16le) buffer. + # @param mult [Float] The volume multiplier, 1 for same volume. + # @return [String] The buffer with adjusted volume, s16le again + def adjust_volume(buf, mult) + # We don't need to adjust anything if the buf is nil so just return in that case + return unless buf + + # buf is s16le so use 's<' for signed, 16 bit, LE + result = buf.unpack('s<*').map do |sample| + sample *= mult + + # clamp to s16 range + [32_767, [-32_768, sample].max].min + end + + # After modification, make it s16le again + result.pack('s<*') + end + + # Encodes a given file (or rather, decodes it) using ffmpeg. This accepts pretty much any format, even videos with + # an audio track. For a list of supported formats, see https://ffmpeg.org/general.html#Audio-Codecs. It even accepts + # URLs, though encoding them is pretty slow - I recommend to make a stream of it and then use {#encode_io} instead. + # @param file [String] The path or URL to encode. + # @param options [String] ffmpeg options to pass after the -i flag + # @return [IO] the audio, encoded as s16le PCM + def encode_file(file, options = '') + command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" + IO.popen(command) + end + + # Encodes an arbitrary IO audio stream using ffmpeg. Accepts pretty much any media format, even videos with audio + # tracks. For a list of supported audio formats, see https://ffmpeg.org/general.html#Audio-Codecs. + # @param io [IO] The stream to encode. + # @param options [String] ffmpeg options to pass after the -i flag + # @return [IO] the audio, encoded as s16le PCM + def encode_io(io, options = '') + command = "#{ffmpeg_command} -loglevel 0 -i - #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" + IO.popen(command, in: io) + end + + private + + def ffmpeg_command + @use_avconv ? 'avconv' : 'ffmpeg' + end + + def filter_volume_argument + return '' if @filter_volume == 1 + + @use_avconv ? "-vol #{(@filter_volume * 256).ceil}" : "-af volume=#{@filter_volume}" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/network.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/network.rb new file mode 100644 index 0000000..f728b65 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/network.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +require 'websocket-client-simple' +require 'socket' +require 'json' + +require 'discordrb/websocket' + +begin + LIBSODIUM_AVAILABLE = if ENV['DISCORDRB_NONACL'] + false + else + require 'discordrb/voice/sodium' + end +rescue LoadError + puts "libsodium not available! You can continue to use discordrb as normal but voice support won't work. + Read https://github.com/shardlab/discordrb/wiki/Installing-libsodium for more details." + LIBSODIUM_AVAILABLE = false +end + +module Discordrb::Voice + # Signifies to Discord that encryption should be used + # @deprecated Discord now supports multiple encryption options. + # TODO: Resolve replacement for this constant. + ENCRYPTED_MODE = 'xsalsa20_poly1305' + + # Signifies to Discord that no encryption should be used + # @deprecated Discord no longer supports unencrypted voice communication. + PLAIN_MODE = 'plain' + + # Encryption modes supported by Discord + ENCRYPTION_MODES = %w[xsalsa20_poly1305_lite xsalsa20_poly1305_suffix xsalsa20_poly1305].freeze + + # Represents a UDP connection to a voice server. This connection is used to send the actual audio data. + class VoiceUDP + # @return [true, false] whether or not UDP communications are encrypted. + # @deprecated Discord no longer supports unencrypted voice communication. + attr_accessor :encrypted + alias_method :encrypted?, :encrypted + + # Sets the secret key used for encryption + attr_writer :secret_key + + # The UDP encryption mode + attr_reader :mode # rubocop:disable Style/BisectedAttrAccessor + + # @!visibility private + attr_writer :mode # rubocop:disable Style/BisectedAttrAccessor + + # Creates a new UDP connection. Only creates a socket as the discovery reply may come before the data is + # initialized. + def initialize + @socket = UDPSocket.new + @encrypted = true + end + + # Initializes the UDP socket with data obtained from opcode 2. + # @param ip [String] The IP address to connect to. + # @param port [Integer] The port to connect to. + # @param ssrc [Integer] The Super Secret Relay Code (SSRC). Discord uses this to identify different voice users + # on the same endpoint. + def connect(ip, port, ssrc) + @ip = ip + @port = port + @ssrc = ssrc + end + + # Waits for a UDP discovery reply, and returns the sent data. + # @return [Array(String, Integer)] the IP and port received from the discovery reply. + def receive_discovery_reply + # Wait for a UDP message + message = @socket.recv(70) + ip = message[4..-3].delete("\0") + port = message[-2..-1].unpack1('n') + [ip, port] + end + + # Makes an audio packet from a buffer and sends it to Discord. + # @param buf [String] The audio data to send, must be exactly one Opus frame + # @param sequence [Integer] The packet sequence number, incremented by one for subsequent packets + # @param time [Integer] When this packet should be played back, in no particular unit (essentially just the + # sequence number multiplied by 960) + def send_audio(buf, sequence, time) + # Header of the audio packet + header = [0x80, 0x78, sequence, time, @ssrc].pack('CCnNN') + + nonce = generate_nonce(header) + buf = encrypt_audio(buf, nonce) + + data = header + buf + + # xsalsa20_poly1305 does not require an appended nonce + data += nonce unless @mode == 'xsalsa20_poly1305' + + send_packet(data) + end + + # Sends the UDP discovery packet with the internally stored SSRC. Discord will send a reply afterwards which can + # be received using {#receive_discovery_reply} + def send_discovery + discovery_packet = [@ssrc].pack('N') + + # Add 66 zeroes so the packet is 70 bytes long + discovery_packet += "\0" * 66 + send_packet(discovery_packet) + end + + private + + # Encrypts audio data using libsodium + # @param buf [String] The encoded audio data to be encrypted + # @param nonce [String] The nonce to be used to encrypt the data + # @return [String] the audio data, encrypted + def encrypt_audio(buf, nonce) + raise 'No secret key found, despite encryption being enabled!' unless @secret_key + + secret_box = Discordrb::Voice::SecretBox.new(@secret_key) + + # Nonces must be 24 bytes in length. We right pad with null bytes for poly1305 and poly1305_lite + secret_box.box(nonce.ljust(24, "\0"), buf) + end + + def send_packet(packet) + @socket.send(packet, 0, @ip, @port) + end + + # @param header [String] The header of the packet, to be used as the nonce + # @return [String] + # @note + # The nonce generated depends on the encryption mode. + # In xsalsa20_poly1305 the nonce is the header plus twelve null bytes for padding. + # In xsalsa20_poly1305_suffix, the nonce is 24 random bytes + # In xsalsa20_poly1305_lite, the nonce is an incremental 4 byte int. + def generate_nonce(header) + case @mode + when 'xsalsa20_poly1305' + header + when 'xsalsa20_poly1305_suffix' + Random.urandom(24) + when 'xsalsa20_poly1305_lite' + case @lite_nonce + when nil, 0xff_ff_ff_ff + @lite_nonce = 0 + else + @lite_nonce += 1 + end + [@lite_nonce].pack('N') + else + raise "`#{@mode}' is not a supported encryption mode" + end + end + end + + # Represents a websocket client connection to the voice server. The websocket connection (sometimes called vWS) is + # used to manage general data about the connection, such as sending the speaking packet, which determines the green + # circle around users on Discord, and obtaining UDP connection info. + class VoiceWS + # The version of the voice gateway that's supposed to be used. + VOICE_GATEWAY_VERSION = 4 + + # @return [VoiceUDP] the UDP voice connection over which the actual audio data is sent. + attr_reader :udp + + # Makes a new voice websocket client, but doesn't connect it (see {#connect} for that) + # @param channel [Channel] The voice channel to connect to + # @param bot [Bot] The regular bot to which this vWS is bound + # @param token [String] The authentication token which is also used for REST requests + # @param session [String] The voice session ID Discord sends over the regular websocket + # @param endpoint [String] The endpoint URL to connect to + def initialize(channel, bot, token, session, endpoint) + raise 'libsodium is unavailable - unable to create voice bot! Please read https://github.com/shardlab/discordrb/wiki/Installing-libsodium' unless LIBSODIUM_AVAILABLE + + @channel = channel + @bot = bot + @token = token + @session = session + + @endpoint = endpoint.split(':').first + + @udp = VoiceUDP.new + end + + # Send a connection init packet (op 0) + # @param server_id [Integer] The ID of the server to connect to + # @param bot_user_id [Integer] The ID of the bot that is connecting + # @param session_id [String] The voice session ID + # @param token [String] The Discord authentication token + def send_init(server_id, bot_user_id, session_id, token) + @client.send({ + op: 0, + d: { + server_id: server_id, + user_id: bot_user_id, + session_id: session_id, + token: token + } + }.to_json) + end + + # Sends the UDP connection packet (op 1) + # @param ip [String] The IP to bind UDP to + # @param port [Integer] The port to bind UDP to + # @param mode [Object] Which mode to use for the voice connection + def send_udp_connection(ip, port, mode) + @client.send({ + op: 1, + d: { + protocol: 'udp', + data: { + address: ip, + port: port, + mode: mode + } + } + }.to_json) + end + + # Send a heartbeat (op 3), has to be done every @heartbeat_interval seconds or the connection will terminate + def send_heartbeat + millis = Time.now.strftime('%s%L').to_i + @bot.debug("Sending voice heartbeat at #{millis}") + + @client.send({ + op: 3, + d: millis + }.to_json) + end + + # Send a speaking packet (op 5). This determines the green circle around the avatar in the voice channel + # @param value [true, false, Integer] Whether or not the bot should be speaking, can also be a bitmask denoting audio type. + def send_speaking(value) + @bot.debug("Speaking: #{value}") + @client.send({ + op: 5, + d: { + speaking: value, + delay: 0 + } + }.to_json) + end + + # Event handlers; public for websocket-simple to work correctly + # @!visibility private + def websocket_open + # Give the current thread a name ('Voice Web Socket Internal') + Thread.current[:discordrb_name] = 'vws-i' + + # Send the init packet + send_init(@channel.server.id, @bot.profile.id, @session, @token) + end + + # @!visibility private + def websocket_message(msg) + @bot.debug("Received VWS message! #{msg}") + packet = JSON.parse(msg) + + case packet['op'] + when 2 + # Opcode 2 contains data to initialize the UDP connection + @ws_data = packet['d'] + + @ssrc = @ws_data['ssrc'] + @port = @ws_data['port'] + + @udp_mode = (ENCRYPTION_MODES & @ws_data['modes']).first + + @udp.connect(@ws_data['ip'], @port, @ssrc) + @udp.send_discovery + when 4 + # Opcode 4 sends the secret key used for encryption + @ws_data = packet['d'] + + @ready = true + @udp.secret_key = @ws_data['secret_key'].pack('C*') + @udp.mode = @ws_data['mode'] + when 8 + # Opcode 8 contains the heartbeat interval. + @heartbeat_interval = packet['d']['heartbeat_interval'] + end + end + + # Communication goes like this: + # me discord + # | | + # websocket connect -> | + # | | + # | <- websocket opcode 2 + # | | + # UDP discovery -> | + # | | + # | <- UDP reply packet + # | | + # websocket opcode 1 -> | + # | | + # ... + def connect + # Connect websocket + @thread = Thread.new do + Thread.current[:discordrb_name] = 'vws' + init_ws + end + + @bot.debug('Started websocket initialization, now waiting for UDP discovery reply') + + # Now wait for opcode 2 and the resulting UDP reply packet + ip, port = @udp.receive_discovery_reply + @bot.debug("UDP discovery reply received! #{ip} #{port}") + + # Send UDP init packet with received UDP data + send_udp_connection(ip, port, @udp_mode) + + @bot.debug('Waiting for op 4 now') + + # Wait for op 4, then finish + sleep 0.05 until @ready + end + + # Disconnects the websocket and kills the thread + def destroy + @heartbeat_running = false + end + + private + + def heartbeat_loop + @heartbeat_running = true + while @heartbeat_running + if @heartbeat_interval + sleep @heartbeat_interval / 1000.0 + send_heartbeat + else + # If no interval has been set yet, sleep a second and check again + sleep 1 + end + end + end + + def init_ws + host = "wss://#{@endpoint}:443/?v=#{VOICE_GATEWAY_VERSION}" + @bot.debug("Connecting VWS to host: #{host}") + + # Connect the WS + @client = Discordrb::WebSocket.new( + host, + method(:websocket_open), + method(:websocket_message), + proc { |e| Discordrb::LOGGER.error "VWS error: #{e}" }, + proc { |e| Discordrb::LOGGER.warn "VWS close: #{e}" } + ) + + @bot.debug('VWS connected') + + # Block any further execution + heartbeat_loop + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/sodium.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/sodium.rb new file mode 100644 index 0000000..5311e87 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/sodium.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Discordrb::Voice + # @!visibility private + module Sodium + extend FFI::Library + + ffi_lib(['sodium', 'libsodium.so.18', 'libsodium.so.23']) + + # Encryption & decryption + attach_function(:crypto_secretbox_xsalsa20poly1305, %i[pointer pointer ulong_long pointer pointer], :int) + attach_function(:crypto_secretbox_xsalsa20poly1305_open, %i[pointer pointer ulong_long pointer pointer], :int) + + # Constants + attach_function(:crypto_secretbox_xsalsa20poly1305_keybytes, [], :size_t) + attach_function(:crypto_secretbox_xsalsa20poly1305_noncebytes, [], :size_t) + attach_function(:crypto_secretbox_xsalsa20poly1305_zerobytes, [], :size_t) + attach_function(:crypto_secretbox_xsalsa20poly1305_boxzerobytes, [], :size_t) + end + + # Utility class for interacting with required `xsalsa20poly1305` functions for voice transmission + # @!visibility private + class SecretBox + # Exception raised when a key or nonce with invalid length is used + class LengthError < RuntimeError + end + + # Exception raised when encryption or decryption fails + class CryptoError < RuntimeError + end + + # Required key length + KEY_LENGTH = Sodium.crypto_secretbox_xsalsa20poly1305_keybytes + + # Required nonce length + NONCE_BYTES = Sodium.crypto_secretbox_xsalsa20poly1305_noncebytes + + # Zero byte padding for encryption + ZERO_BYTES = Sodium.crypto_secretbox_xsalsa20poly1305_zerobytes + + # Zero byte padding for decryption + BOX_ZERO_BYTES = Sodium.crypto_secretbox_xsalsa20poly1305_boxzerobytes + + # @param key [String] Crypto key of length {KEY_LENGTH} + def initialize(key) + raise(LengthError, 'Key length') if key.bytesize != KEY_LENGTH + + @key = key + end + + # Encrypts a message using this box's key + # @param nonce [String] encryption nonce for this message + # @param message [String] message to be encrypted + def box(nonce, message) + raise(LengthError, 'Nonce length') if nonce.bytesize != NONCE_BYTES + + message_padded = prepend_zeroes(ZERO_BYTES, message) + buffer = zero_string(message_padded.bytesize) + + success = Sodium.crypto_secretbox_xsalsa20poly1305(buffer, message_padded, message_padded.bytesize, nonce, @key) + raise(CryptoError, "Encryption failed (#{success})") unless success.zero? + + remove_zeroes(BOX_ZERO_BYTES, buffer) + end + + # Decrypts the given ciphertext using this box's key + # @param nonce [String] encryption nonce for this ciphertext + # @param ciphertext [String] ciphertext to decrypt + def open(nonce, ciphertext) + raise(LengthError, 'Nonce length') if nonce.bytesize != NONCE_BYTES + + ct_padded = prepend_zeroes(BOX_ZERO_BYTES, ciphertext) + buffer = zero_string(ct_padded.bytesize) + + success = Sodium.crypto_secretbox_xsalsa20poly1305_open(buffer, ct_padded, ct_padded.bytesize, nonce, @key) + raise(CryptoError, "Decryption failed (#{success})") unless success.zero? + + remove_zeroes(ZERO_BYTES, buffer) + end + + private + + def zero_string(size) + str = "\0" * size + str.force_encoding('ASCII-8BIT') if str.respond_to?(:force_encoding) + end + + def prepend_zeroes(size, string) + zero_string(size) + string + end + + def remove_zeroes(size, string) + string.slice!(size, string.bytesize - size) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/voice_bot.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/voice_bot.rb new file mode 100644 index 0000000..0fcbb6e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/voice/voice_bot.rb @@ -0,0 +1,408 @@ +# frozen_string_literal: true + +require 'discordrb/voice/encoder' +require 'discordrb/voice/network' +require 'discordrb/logger' + +# Voice support +module Discordrb::Voice + # How long one voice packet should ideally be (20ms as defined by Discord) + IDEAL_LENGTH = 20.0 + + # How many bytes of data to read (1920 bytes * 2 channels) from audio PCM data + DATA_LENGTH = 1920 * 2 + + # This class represents a connection to a Discord voice server and channel. It can be used to play audio files and + # streams and to control playback on currently playing tracks. The method {Bot#voice_connect} can be used to connect + # to a voice channel. + # + # discordrb does latency adjustments every now and then to improve playback quality. I made sure to put useful + # defaults for the adjustment parameters, but if the sound is patchy or too fast (or the speed varies a lot) you + # should check the parameters and adjust them to your connection: {VoiceBot#adjust_interval}, + # {VoiceBot#adjust_offset}, and {VoiceBot#adjust_average}. + class VoiceBot + # @return [Channel] the current voice channel + attr_reader :channel # rubocop:disable Style/BisectedAttrAccessor + + # @!visibility private + attr_writer :channel # rubocop:disable Style/BisectedAttrAccessor + + # @return [Integer, nil] the amount of time the stream has been playing, or `nil` if nothing has been played yet. + attr_reader :stream_time + + # @return [Encoder] the encoder used to encode audio files into the format required by Discord. + attr_reader :encoder + + # discordrb will occasionally measure the time it takes to send a packet, and adjust future delay times based + # on that data. This makes voice playback more smooth, because if packets are sent too slowly, the audio will + # sound patchy, and if they're sent too quickly, packets will "pile up" and occasionally skip some data or + # play parts back too fast. How often these measurements should be done depends a lot on the system, and if it's + # done too quickly, especially on slow connections, the playback speed will vary wildly; if it's done too slowly + # however, small errors will cause quality problems for a longer time. + # @return [Integer] how frequently audio length adjustments should be done, in ideal packets (20ms). + attr_accessor :adjust_interval + + # This particular value is also important because ffmpeg may take longer to process the first few packets. It is + # recommended to set this to 10 at maximum, otherwise it will take too long to make the first adjustment, but it + # shouldn't be any higher than {#adjust_interval}, otherwise no adjustments will take place. If {#adjust_interval} + # is at a value higher than 10, this value should not be changed at all. + # @see #adjust_interval + # @return [Integer] the packet number (1 packet = 20ms) at which length adjustments should start. + attr_accessor :adjust_offset + + # This value determines whether or not the adjustment length should be averaged with the previous value. This may + # be useful on slower connections where latencies vary a lot. In general, it will make adjustments more smooth, + # but whether that is desired behaviour should be tried on a case-by-case basis. + # @see #adjust_interval + # @return [true, false] whether adjustment lengths should be averaged with the respective previous value. + attr_accessor :adjust_average + + # Disable the debug message for length adjustment specifically, as it can get quite spammy with very low intervals + # @see #adjust_interval + # @return [true, false] whether length adjustment debug messages should be printed + attr_accessor :adjust_debug + + # If this value is set, no length adjustments will ever be done and this value will always be used as the length + # (i.e. packets will be sent every N seconds). Be careful not to set it too low as to not spam Discord's servers. + # The ideal length is 20ms (accessible by the {Discordrb::Voice::IDEAL_LENGTH} constant), this value should be + # slightly lower than that because encoding + sending takes time. Note that sending DCA files is significantly + # faster than sending regular audio files (usually about four times as fast), so you might want to set this value + # to something else if you're sending a DCA file. + # @return [Float] the packet length that should be used instead of calculating it during the adjustments, in ms. + attr_accessor :length_override + + # The factor the audio's volume should be multiplied with. `1` is no change in volume, `0` is completely silent, + # `0.5` is half the default volume and `2` is twice the default. + # @return [Float] the volume for audio playback, `1.0` by default. + attr_accessor :volume + + # @!visibility private + def initialize(channel, bot, token, session, endpoint) + @bot = bot + @channel = channel + + @ws = VoiceWS.new(channel, bot, token, session, endpoint) + @udp = @ws.udp + + @sequence = @time = 0 + @skips = 0 + + @adjust_interval = 100 + @adjust_offset = 10 + @adjust_average = false + @adjust_debug = true + + @volume = 1.0 + @playing = false + + @encoder = Encoder.new + @ws.connect + rescue StandardError => e + Discordrb::LOGGER.log_exception(e) + raise + end + + # @return [true, false] whether audio data sent will be encrypted. + # @deprecated Discord no longer supports unencrypted voice communication. + def encrypted? + true + end + + # Set the filter volume. This volume is applied as a filter for decoded audio data. It has the advantage that using + # it is much faster than regular volume, but it can only be changed before starting to play something. + # @param value [Integer] The value to set the volume to. For possible values, see {#volume} + def filter_volume=(value) + @encoder.filter_volume = value + end + + # @see #filter_volume= + # @return [Integer] the volume used as a filter for ffmpeg/avconv. + def filter_volume + @encoder.filter_volume + end + + # Pause playback. This is not instant; it may take up to 20 ms for this change to take effect. (This is usually + # negligible.) + def pause + @paused = true + end + + # @see #play + # @return [true, false] Whether it is playing sound or not. + def playing? + @playing + end + + alias_method :isplaying?, :playing? + + # Continue playback. This change may take up to 100ms to take effect, which is usually negligible. + def continue + @paused = false + end + + # Skips to a later time in the song. It's impossible to go back without replaying the song. + # @param secs [Float] How many seconds to skip forwards. Skipping will always be done in discrete intervals of + # 0.05 seconds, so if the given amount is smaller than that, it will be rounded up. + def skip(secs) + @skips += (secs * (1000 / IDEAL_LENGTH)).ceil + end + + # Sets whether or not the bot is speaking (green circle around user). + # @param value [true, false, Integer] whether or not the bot should be speaking, or a bitmask denoting the audio type + # @note https://discordapp.com/developers/docs/topics/voice-connections#speaking for information on the speaking bitmask + def speaking=(value) + @playing = value + @ws.send_speaking(value) + end + + # Stops the current playback entirely. + # @param wait_for_confirmation [true, false] Whether the method should wait for confirmation from the playback + # method that the playback has actually stopped. + def stop_playing(wait_for_confirmation = false) + @was_playing_before = @playing + @speaking = false + @playing = false + sleep IDEAL_LENGTH / 1000.0 if @was_playing_before + + return unless wait_for_confirmation + + @has_stopped_playing = false + sleep IDEAL_LENGTH / 1000.0 until @has_stopped_playing + @has_stopped_playing = false + end + + # Permanently disconnects from the voice channel; to reconnect you will have to call {Bot#voice_connect} again. + def destroy + stop_playing + @bot.voice_destroy(@channel.server.id, false) + @ws.destroy + end + + # Plays a stream of raw data to the channel. All playback methods are blocking, i.e. they wait for the playback to + # finish before exiting the method. This doesn't cause a problem if you just use discordrb events/commands to + # play stuff, as these are fully threaded, but if you don't want this behaviour anyway, be sure to call these + # methods in separate threads. + # @param encoded_io [IO] A stream of raw PCM data (s16le) + def play(encoded_io) + stop_playing(true) if @playing + @retry_attempts = 3 + @first_packet = true + + play_internal do + buf = nil + + # Read some data from the buffer + begin + buf = encoded_io.readpartial(DATA_LENGTH) if encoded_io + rescue EOFError + raise IOError, 'File or stream not found!' if @first_packet + + @bot.debug('EOF while reading, breaking immediately') + next :stop + end + + # Check whether the buffer has enough data + if !buf || buf.length != DATA_LENGTH + @bot.debug("No data is available! Retrying #{@retry_attempts} more times") + next :stop if @retry_attempts.zero? + + @retry_attempts -= 1 + next + end + + # Adjust volume + buf = @encoder.adjust_volume(buf, @volume) if @volume != 1.0 # rubocop:disable Lint/FloatComparison + + @first_packet = false + + # Encode data + @encoder.encode(buf) + end + + # If the stream is a process, kill it + if encoded_io&.pid + Discordrb::LOGGER.debug("Killing ffmpeg process with pid #{encoded_io.pid.inspect}") + + begin + pid = encoded_io.pid + # Windows does not support TERM as a kill signal, so we use KILL. `Process.waitpid` verifies that our + # child process has not already completed. + Process.kill(Gem.win_platform? ? 'KILL' : 'TERM', pid) if Process.waitpid(pid, Process::WNOHANG).nil? + rescue StandardError => e + Discordrb::LOGGER.warn('Failed to kill ffmpeg process! You *might* have a process leak now.') + Discordrb::LOGGER.warn("Reason: #{e}") + end + end + + # Close the stream + encoded_io.close + end + + # Plays an encoded audio file of arbitrary format to the channel. + # @see Encoder#encode_file + # @see #play + def play_file(file, options = '') + play @encoder.encode_file(file, options) + end + + # Plays a stream of encoded audio data of arbitrary format to the channel. + # @see Encoder#encode_io + # @see #play + def play_io(io, options = '') + play @encoder.encode_io(io, options) + end + + # Plays a stream of audio data in the DCA format. This format has the advantage that no recoding has to be + # done - the file contains the data exactly as Discord needs it. + # @note DCA playback will not be affected by the volume modifier ({#volume}) because the modifier operates on raw + # PCM, not opus data. Modifying the volume of DCA data would involve decoding it, multiplying the samples and + # re-encoding it, which defeats its entire purpose (no recoding). + # @see https://github.com/bwmarrin/dca + # @see #play + def play_dca(file) + stop_playing(true) if @playing + + @bot.debug "Reading DCA file #{file}" + input_stream = File.open(file) + + magic = input_stream.read(4) + raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1' + + # Read the metadata header, then read the metadata and discard it as we don't care about it + metadata_header = input_stream.read(4).unpack1('l<') + input_stream.read(metadata_header) + + # Play the data, without re-encoding it to opus + play_internal do + begin + # Read header + header_str = input_stream.read(2) + + unless header_str + @bot.debug 'Finished DCA parsing (header is nil)' + next :stop + end + + header = header_str.unpack1('s<') + + raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative? + rescue EOFError + @bot.debug 'Finished DCA parsing (EOFError)' + next :stop + end + + # Read bytes + input_stream.read(header) + end + end + + alias_method :play_stream, :play_io + + private + + # Plays the data from the IO stream as Discord requires it + def play_internal + count = 0 + @playing = true + + # Default play length (ms), will be adjusted later + @length = IDEAL_LENGTH + + self.speaking = true + loop do + # Starting from the tenth packet, perform length adjustment every 100 packets (2 seconds) + should_adjust_this_packet = (count % @adjust_interval == @adjust_offset) + + # If we should adjust, start now + @length_adjust = Time.now.nsec if should_adjust_this_packet + + break unless @playing + + # If we should skip, get some data, discard it and go to the next iteration + if @skips.positive? + @skips -= 1 + yield + next + end + + # Track packet count, sequence and time (Discord requires this) + count += 1 + increment_packet_headers + + # Get packet data + buf = yield + + # Stop doing anything if the stop signal was sent + break if buf == :stop + + # Proceed to the next packet if we got nil + next unless buf + + # Track intermediate adjustment so we can measure how much encoding contributes to the total time + @intermediate_adjust = Time.now.nsec if should_adjust_this_packet + + # Send the packet + @udp.send_audio(buf, @sequence, @time) + + # Set the stream time (for tracking how long we've been playing) + @stream_time = count * @length / 1000 + + if @length_override # Don't do adjustment because the user has manually specified an override value + @length = @length_override + elsif @length_adjust # Perform length adjustment + # Define the time once so it doesn't get inaccurate + now = Time.now.nsec + + # Difference between length_adjust and now in ms + ms_diff = (now - @length_adjust) / 1_000_000.0 + if ms_diff >= 0 + @length = if @adjust_average + (IDEAL_LENGTH - ms_diff + @length) / 2.0 + else + IDEAL_LENGTH - ms_diff + end + + # Track the time it took to encode + encode_ms = (@intermediate_adjust - @length_adjust) / 1_000_000.0 + @bot.debug("Length adjustment: new length #{@length} (measured #{ms_diff}, #{(100 * encode_ms) / ms_diff}% encoding)") if @adjust_debug + end + @length_adjust = nil + end + + # If paused, wait + sleep 0.1 while @paused + + if @length.positive? + # Wait `length` ms, then send the next packet + sleep @length / 1000.0 + else + Discordrb::LOGGER.warn('Audio encoding and sending together took longer than Discord expects one packet to be (20 ms)! This may be indicative of network problems.') + end + end + + @bot.debug('Sending five silent frames to clear out buffers') + + 5.times do + increment_packet_headers + @udp.send_audio(Encoder::OPUS_SILENCE, @sequence, @time) + + # Length adjustments don't matter here, we can just wait 20ms since nobody is going to hear it anyway + sleep IDEAL_LENGTH / 1000.0 + end + + @bot.debug('Performing final cleanup after stream ended') + + # Final clean-up + stop_playing + + # Notify any stop_playing methods running right now that we have actually stopped + @has_stopped_playing = true + end + + # Increment sequence and time + def increment_packet_headers + @sequence + 10 < 65_535 ? @sequence += 1 : @sequence = 0 + @time + 9600 < 4_294_967_295 ? @time += 960 : @time = 0 + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/webhooks.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/webhooks.rb new file mode 100644 index 0000000..01aef09 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/webhooks.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'discordrb/webhooks/version' +require 'discordrb/webhooks/embeds' +require 'discordrb/webhooks/client' +require 'discordrb/webhooks/builder' + +module Discordrb + # Webhook client + module Webhooks + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/websocket.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/websocket.rb new file mode 100644 index 0000000..6ea89e9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-3.4.0/lib/discordrb/websocket.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +require 'websocket-client-simple' + +# The WSCS module which we're hooking +# @see Websocket::Client::Simple::Client +module WebSocket::Client::Simple + # Patch to the WSCS class to allow reading the internal thread + class Client + # @return [Thread] the internal thread this client is using for the event loop. + attr_reader :thread + end +end + +module Discordrb + # Utility wrapper class that abstracts an instance of WSCS. Useful should we decide that WSCS isn't good either - + # in that case we can just switch to something else + class WebSocket + attr_reader :open_handler, :message_handler, :close_handler, :error_handler + + # Create a new WebSocket and connect to the given endpoint. + # @param endpoint [String] Where to connect to. + # @param open_handler [#call] The handler that should be called when the websocket has opened successfully. + # @param message_handler [#call] The handler that should be called when the websocket receives a message. The + # handler can take one parameter which will have a `data` attribute for normal messages and `code` and `data` for + # close frames. + # @param close_handler [#call] The handler that should be called when the websocket is closed due to an internal + # error. The error will be passed as the first parameter to the handler. + # @param error_handler [#call] The handler that should be called when an error occurs in another handler. The error + # will be passed as the first parameter to the handler. + def initialize(endpoint, open_handler, message_handler, close_handler, error_handler) + Discordrb::LOGGER.debug "Using WSCS version: #{::WebSocket::Client::Simple::VERSION}" + + @open_handler = open_handler + @message_handler = message_handler + @close_handler = close_handler + @error_handler = error_handler + + instance = self # to work around WSCS's weird way of handling blocks + + @client = ::WebSocket::Client::Simple.connect(endpoint) do |ws| + ws.on(:open) { instance.open_handler.call } + ws.on(:message) do |msg| + # If the message has a code attribute, it is in reality a close message + if msg.code + instance.close_handler.call(msg) + else + instance.message_handler.call(msg.data) + end + end + ws.on(:close) { |err| instance.close_handler.call(err) } + ws.on(:error) { |err| instance.error_handler.call(err) } + end + end + + # Send data over this WebSocket + # @param data [String] What to send + def send(data) + @client.send(data) + end + + # Close the WebSocket connection + def close + @client.close + end + + # @return [Thread] the internal WSCS thread + def thread + @client.thread + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks.rb new file mode 100644 index 0000000..01aef09 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'discordrb/webhooks/version' +require 'discordrb/webhooks/embeds' +require 'discordrb/webhooks/client' +require 'discordrb/webhooks/builder' + +module Discordrb + # Webhook client + module Webhooks + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/builder.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/builder.rb new file mode 100644 index 0000000..e1046db --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/builder.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +require 'discordrb/webhooks/embeds' + +module Discordrb::Webhooks + # A class that acts as a builder for a webhook message object. + class Builder + def initialize(content: '', username: nil, avatar_url: nil, tts: false, file: nil, embeds: []) + @content = content + @username = username + @avatar_url = avatar_url + @tts = tts + @file = file + @embeds = embeds + end + + # The content of the message. May be 2000 characters long at most. + # @return [String] the content of the message. + attr_accessor :content + + # The username the webhook will display as. If this is not set, the default username set in the webhook's settings + # will be used instead. + # @return [String] the username. + attr_accessor :username + + # The URL of an image file to be used as an avatar. If this is not set, the default avatar from the webhook's + # settings will be used instead. + # @return [String] the avatar URL. + attr_accessor :avatar_url + + # Whether this message should use TTS or not. By default, it doesn't. + # @return [true, false] the TTS status. + attr_accessor :tts + + # Sets a file to be sent together with the message. Mutually exclusive with embeds; a webhook message can contain + # either a file to be sent or an embed. + # @param file [File] A file to be sent. + def file=(file) + raise ArgumentError, 'Embeds and files are mutually exclusive!' unless @embeds.empty? + @file = file + end + + # Adds an embed to this message. + # @param embed [Embed] The embed to add. + def <<(embed) + raise ArgumentError, 'Embeds and files are mutually exclusive!' if @file + @embeds << embed + end + + # Convenience method to add an embed using a block-style builder pattern + # @example Add an embed to a message + # builder.add_embed do |embed| + # embed.title = 'Testing' + # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://i.imgur.com/PcMltU7.jpg') + # end + # @param embed [Embed, nil] The embed to start the building process with, or nil if one should be created anew. + # @return [Embed] The created embed. + def add_embed(embed = nil) + embed ||= Embed.new + yield(embed) + self << embed + embed + end + + # @return [File, nil] the file attached to this message. + attr_reader :file + + # @return [Array] the embeds attached to this message. + attr_reader :embeds + + # @return [Hash] a hash representation of the created message, for JSON format. + def to_json_hash + { + content: @content, + username: @username, + avatar_url: @avatar_url, + tts: @tts, + embeds: @embeds.map(&:to_hash) + } + end + + # @return [Hash] a hash representation of the created message, for multipart format. + def to_multipart_hash + { + content: @content, + username: @username, + avatar_url: @avatar_url, + tts: @tts, + file: @file + } + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/client.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/client.rb new file mode 100644 index 0000000..294cd0d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/client.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require 'rest-client' +require 'json' + +require 'discordrb/webhooks/builder' + +module Discordrb::Webhooks + # A client for a particular webhook added to a Discord channel. + class Client + # Create a new webhook + # @param url [String] The URL to post messages to. + # @param id [Integer] The webhook's ID. Will only be used if `url` is not + # set. + # @param token [String] The webhook's authorisation token. Will only be used + # if `url` is not set. + def initialize(url: nil, id: nil, token: nil) + @url = if url + url + else + generate_url(id, token) + end + end + + # Executes the webhook this client points to with the given data. + # @param builder [Builder, nil] The builder to start out with, or nil if one should be created anew. + # @param wait [true, false] Whether Discord should wait for the message to be successfully received by clients, or + # whether it should return immediately after sending the message. + # @yield [builder] Gives the builder to the block to add additional steps, or to do the entire building process. + # @yieldparam builder [Builder] The builder given as a parameter which is used as the initial step to start from. + # @example Execute the webhook with an already existing builder + # builder = Discordrb::Webhooks::Builder.new # ... + # client.execute(builder) + # @example Execute the webhook by building a new message + # client.execute do |builder| + # builder.content = 'Testing' + # builder.username = 'discordrb' + # builder.add_embed do |embed| + # embed.timestamp = Time.now + # embed.title = 'Testing' + # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://i.imgur.com/PcMltU7.jpg') + # end + # end + # @return [RestClient::Response] the response returned by Discord. + def execute(builder = nil, wait = false) + raise TypeError, 'builder needs to be nil or like a Discordrb::Webhooks::Builder!' unless + builder.respond_to?(:file) && builder.respond_to?(:to_multipart_hash) || builder.respond_to?(:to_json_hash) || builder.nil? + + builder ||= Builder.new + + yield builder if block_given? + + if builder.file + post_multipart(builder, wait) + else + post_json(builder, wait) + end + end + + private + + def post_json(builder, wait) + RestClient.post(@url + (wait ? '?wait=true' : ''), builder.to_json_hash.to_json, content_type: :json) + end + + def post_multipart(builder, wait) + RestClient.post(@url + (wait ? '?wait=true' : ''), builder.to_multipart_hash) + end + + def generate_url(id, token) + "https://discordapp.com/api/v6/webhooks/#{id}/#{token}" + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/embeds.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/embeds.rb new file mode 100644 index 0000000..858df08 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/embeds.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +module Discordrb::Webhooks + # An embed is a multipart-style attachment to a webhook message that can have a variety of different purposes and + # appearances. + class Embed + def initialize(title: nil, description: nil, url: nil, timestamp: nil, colour: nil, color: nil, footer: nil, + image: nil, thumbnail: nil, video: nil, provider: nil, author: nil, fields: []) + @title = title + @description = description + @url = url + @timestamp = timestamp + self.colour = colour || color + @footer = footer + @image = image + @thumbnail = thumbnail + @video = video + @provider = provider + @author = author + @fields = fields + end + + # @return [String, nil] title of the embed that will be displayed above everything else. + attr_accessor :title + + # @return [String, nil] description for this embed + attr_accessor :description + + # @return [String, nil] URL the title should point to + attr_accessor :url + + # @return [Time, nil] timestamp for this embed. Will be displayed just below the title. + attr_accessor :timestamp + + # @return [Integer, nil] the colour of the bar to the side, in decimal form + attr_reader :colour + alias_method :color, :colour + + # Sets the colour of the bar to the side of the embed to something new. + # @param value [Integer, String, {Integer, Integer, Integer}, #to_i, nil] The colour in decimal, hexadecimal, R/G/B decimal, or nil to clear the embeds colour + # form. + def colour=(value) + if value.nil? + @colour = nil + elsif value.is_a? Integer + raise ArgumentError, 'Embed colour must be 24-bit!' if value >= 16_777_216 + @colour = value + elsif value.is_a? String + self.colour = value.delete('#').to_i(16) + elsif value.is_a? Array + raise ArgumentError, 'Colour tuple must have three values!' if value.length != 3 + self.colour = value[0] << 16 | value[1] << 8 | value[2] + else + self.colour = value.to_i + end + end + + alias_method :color=, :colour= + + # @example Add a footer to an embed + # embed.footer = Discordrb::Webhooks::EmbedFooter.new(text: 'Hello', icon_url: 'https://i.imgur.com/j69wMDu.jpg') + # @return [EmbedFooter, nil] footer for this embed + attr_accessor :footer + + # @see EmbedImage + # @example Add a image to an embed + # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://i.imgur.com/PcMltU7.jpg') + # @return [EmbedImage, nil] image for this embed + attr_accessor :image + + # @see EmbedThumbnail + # @example Add a thumbnail to an embed + # embed.thumbnail = Discordrb::Webhooks::EmbedThumbnail.new(url: 'https://i.imgur.com/xTG3a1I.jpg') + # @return [EmbedThumbnail, nil] thumbnail for this embed + attr_accessor :thumbnail + + # @see EmbedAuthor + # @example Add a author to an embed + # embed.author = Discordrb::Webhooks::EmbedAuthor.new(name: 'meew0', url: 'https://github.com/meew0', icon_url: 'https://avatars2.githubusercontent.com/u/3662915?v=3&s=466') + # @return [EmbedAuthor, nil] author for this embed + attr_accessor :author + + # Add a field object to this embed. + # @param field [EmbedField] The field to add. + def <<(field) + @fields << field + end + + # Convenience method to add a field to the embed without having to create one manually. + # @see EmbedField + # @example Add a field to an embed, conveniently + # embed.add_field(name: 'A field', value: "The field's content") + # @param name [String] The field's name + # @param value [String] The field's value + # @param inline [true, false] Whether the field should be inlined + def add_field(name: nil, value: nil, inline: nil) + self << EmbedField.new(name: name, value: value, inline: inline) + end + + # @return [Array] the fields attached to this embed. + attr_accessor :fields + + # @return [Hash] a hash representation of this embed, to be converted to JSON. + def to_hash + { + title: @title, + description: @description, + url: @url, + timestamp: @timestamp && @timestamp.utc.iso8601, + color: @colour, + footer: @footer && @footer.to_hash, + image: @image && @image.to_hash, + thumbnail: @thumbnail && @thumbnail.to_hash, + video: @video && @video.to_hash, + provider: @provider && @provider.to_hash, + author: @author && @author.to_hash, + fields: @fields.map(&:to_hash) + } + end + end + + # An embed's footer will be displayed at the very bottom of an embed, together with the timestamp. An icon URL can be + # set together with some text to be displayed. + class EmbedFooter + # @return [String, nil] text to be displayed in the footer + attr_accessor :text + + # @return [String, nil] URL to an icon to be showed alongside the text + attr_accessor :icon_url + + # Creates a new footer object. + # @param text [String, nil] The text to be displayed in the footer. + # @param icon_url [String, nil] The URL to an icon to be showed alongside the text. + def initialize(text: nil, icon_url: nil) + @text = text + @icon_url = icon_url + end + + # @return [Hash] a hash representation of this embed footer, to be converted to JSON. + def to_hash + { + text: @text, + icon_url: @icon_url + } + end + end + + # An embed's image will be displayed at the bottom, in large format. It will replace a footer icon URL if one is set. + class EmbedImage + # @return [String, nil] URL of the image + attr_accessor :url + + # Creates a new image object. + # @param url [String, nil] The URL of the image. + def initialize(url: nil) + @url = url + end + + # @return [Hash] a hash representation of this embed image, to be converted to JSON. + def to_hash + { + url: @url + } + end + end + + # An embed's thumbnail will be displayed at the right of the message, next to the description and fields. When clicked + # it will point to the embed URL. + class EmbedThumbnail + # @return [String, nil] URL of the thumbnail + attr_accessor :url + + # Creates a new thumbnail object. + # @param url [String, nil] The URL of the thumbnail. + def initialize(url: nil) + @url = url + end + + # @return [Hash] a hash representation of this embed thumbnail, to be converted to JSON. + def to_hash + { + url: @url + } + end + end + + # An embed's author will be shown at the top to indicate who "authored" the particular event the webhook was sent for. + class EmbedAuthor + # @return [String, nil] name of the author + attr_accessor :name + + # @return [String, nil] URL the name should link to + attr_accessor :url + + # @return [String, nil] URL of the icon to be displayed next to the author + attr_accessor :icon_url + + # Creates a new author object. + # @param name [String, nil] The name of the author. + # @param url [String, nil] The URL the name should link to. + # @param icon_url [String, nil] The URL of the icon to be displayed next to the author. + def initialize(name: nil, url: nil, icon_url: nil) + @name = name + @url = url + @icon_url = icon_url + end + + # @return [Hash] a hash representation of this embed author, to be converted to JSON. + def to_hash + { + name: @name, + url: @url, + icon_url: @icon_url + } + end + end + + # A field is a small block of text with a header that can be relatively freely layouted with other fields. + class EmbedField + # @return [String, nil] name of the field, displayed in bold at the top of the field. + attr_accessor :name + + # @return [String, nil] value of the field, displayed in normal text below the name. + attr_accessor :value + + # @return [true, false] whether the field should be displayed inline with other fields. + attr_accessor :inline + + # Creates a new field object. + # @param name [String, nil] The name of the field, displayed in bold at the top of the field. + # @param value [String, nil] The value of the field, displayed in normal text below the name. + # @param inline [true, false] Whether the field should be displayed inline with other fields. + def initialize(name: nil, value: nil, inline: false) + @name = name + @value = value + @inline = inline + end + + # @return [Hash] a hash representation of this embed field, to be converted to JSON. + def to_hash + { + name: @name, + value: @value, + inline: @inline + } + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/version.rb b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/version.rb new file mode 100644 index 0000000..3420f38 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/discordrb-webhooks-3.3.0/lib/discordrb/webhooks/version.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# Webhook support for discordrb +module Discordrb + module Webhooks + # The current version of discordrb-webhooks. + VERSION = '3.3.0'.freeze + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.document b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.document new file mode 100644 index 0000000..3d618dd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.document @@ -0,0 +1,5 @@ +lib/**/*.rb +bin/* +- +features/**/*.feature +LICENSE.txt diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.gitignore b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.gitignore new file mode 100644 index 0000000..d87d4be --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.gitignore @@ -0,0 +1,17 @@ +*.gem +*.rbc +.bundle +.config +.yardoc +Gemfile.lock +InstalledFiles +_yardoc +coverage +doc/ +lib/bundler/man +pkg +rdoc +spec/reports +test/tmp +test/version_tmp +tmp diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.travis.yml new file mode 100644 index 0000000..e120c4c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/.travis.yml @@ -0,0 +1,21 @@ +language: ruby +rvm: + - 1.8.7 + - ree + - 1.9.3 + - 2.0.0 + - 2.1.9 + - 2.2.5 + - 2.3.1 + - ruby-head + - jruby-1.7.20 + - jruby-9.0.5.0 + - jruby-head + - rbx-2 +matrix: + allow_failures: + - rvm: ruby-head + - rvm: jruby-head + - rvm: rbx-2 +before_install: + - gem update bundler diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/CHANGELOG.md new file mode 100644 index 0000000..0c564b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/CHANGELOG.md @@ -0,0 +1,219 @@ +# Change Log + +## [v0.5.20190701](https://github.com/knu/ruby-domain_name/tree/v0.5.20190701) (2019-07-05) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20180417...v0.5.20190701) + +- Update the eTLD database to 2019-07-01 18:45:50 UTC + +## [v0.5.20180417](https://github.com/knu/ruby-domain_name/tree/v0.5.20180417) (2018-04-17) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20170404...v0.5.20180417) + +- Update the eTLD database to 2018-04-17T23:50:25Z + +## [v0.5.20170404](https://github.com/knu/ruby-domain_name/tree/v0.5.20170404) (2017-04-04) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20170223...v0.5.20170404) + +- Update the eTLD database to 2017-04-04T20:20:25Z + +## [v0.5.20170223](https://github.com/knu/ruby-domain_name/tree/v0.5.20170223) (2017-02-23) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20161129...v0.5.20170223) + +- Update the eTLD database to 2017-02-23T00:52:11Z + +## [v0.5.20161129](https://github.com/knu/ruby-domain_name/tree/v0.5.20161129) (2016-11-29) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160826...v0.5.20161129) + +- Update the eTLD database to 2016-11-29T01:22:03Z + +## [v0.5.20161021](https://github.com/knu/ruby-domain_name/tree/v0.5.20161021) (2016-10-27) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160826...v0.5.20161021) + +- Update the eTLD database to 2016-10-21T20:52:10Z + +## [v0.5.20160826](https://github.com/knu/ruby-domain_name/tree/v0.5.20160826) (2016-09-01) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160615...v0.5.20160826) + +- Update the license for the eTLD database +- Update the eTLD database to 2016-08-26T16:52:03Z + +## [v0.5.20160615](https://github.com/knu/ruby-domain_name/tree/v0.5.20160615) (2016-06-16) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160310...v0.5.20160615) + +- Always set `@domain` to avoid a warning when `$VERBOSE` is on +- Update the eTLD database to 2016-06-15T16:22:11Z + +## [v0.5.20160310](https://github.com/knu/ruby-domain_name/tree/v0.5.20160310) (2016-03-17) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160309...v0.5.20160310) + +- Update development dependencies for obsolete rubies +- Update the eTLD database to 2016-03-10T21:22:02Z + +## [v0.5.20160309](https://github.com/knu/ruby-domain_name/tree/v0.5.20160309) (2016-03-09) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160216...v0.5.20160309) + +- Fix support for Ruby 1.8 +- Update the eTLD database to 2016-03-09T09:52:02Z + +## [v0.5.20160216](https://github.com/knu/ruby-domain_name/tree/v0.5.20160216) (2016-02-24) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160128...v0.5.20160216) + +- Update the eTLD database to 2016-02-16T19:22:02Z + +## [v0.5.20160128](https://github.com/knu/ruby-domain_name/tree/v0.5.20160128) (2016-01-29) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.25...v0.5.20160128) + +- Use the date as part of VERSION +- Update the eTLD database to 2016-01-28T23:22:02Z + +## [v0.5.25](https://github.com/knu/ruby-domain_name/tree/v0.5.25) (2015-10-06) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.24...v0.5.25) + +- Restrict i18n < 0.7.0 on ruby 1.8. +- Update the eTLD database to 2015-09-29T17:22:03Z + +## [v0.5.24](https://github.com/knu/ruby-domain_name/tree/v0.5.24) (2015-04-16) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.23...v0.5.24) + +- Update the eTLD database to 2015-04-07T20:26:05Z + +## [v0.5.23](https://github.com/knu/ruby-domain_name/tree/v0.5.23) (2014-12-19) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.22...v0.5.23) + +- Update the eTLD database to 2014-12-18T02:26:03Z + +## [v0.5.22](https://github.com/knu/ruby-domain_name/tree/v0.5.22) (2014-10-28) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.21...v0.5.22) + +- Update the eTLD database to 2014-10-27T15:26:07Z + +## [v0.5.21](https://github.com/knu/ruby-domain_name/tree/v0.5.21) (2014-09-09) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20...v0.5.21) + +- Update the eTLD database to 2014-09-05T01:56:10Z + +## [v0.5.20](https://github.com/knu/ruby-domain_name/tree/v0.5.20) (2014-08-18) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.19...v0.5.20) + +- Update the eTLD database to 2014-08-14T00:56:09Z + +## [v0.5.19](https://github.com/knu/ruby-domain_name/tree/v0.5.19) (2014-06-12) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.18...v0.5.19) + +- Update the eTLD database to 2014-06-11T15:26:13Z + +## [v0.5.18](https://github.com/knu/ruby-domain_name/tree/v0.5.18) (2014-03-27) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.17...v0.5.18) + +- Update the eTLD database to 2014-03-27T03:00:59Z + +## [v0.5.17](https://github.com/knu/ruby-domain_name/tree/v0.5.17) (2014-03-21) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.16...v0.5.17) + +- Update the eTLD database to 2014-03-20T15:01:09Z + +## [v0.5.16](https://github.com/knu/ruby-domain_name/tree/v0.5.16) (2014-02-12) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.15...v0.5.16) + +- Update the eTLD database to 2014-02-11T16:01:07Z + +## [v0.5.15](https://github.com/knu/ruby-domain_name/tree/v0.5.15) (2013-11-15) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.14...v0.5.15) + +- Update the eTLD database to 2013-11-15T16:01:28Z +- Merge IDN tests from mozilla-central/netwerk/test/unit/data/test_psl.txt + +## [v0.5.14](https://github.com/knu/ruby-domain_name/tree/v0.5.14) (2013-10-16) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.13...v0.5.14) + +- Update the eTLD database to 2013-10-16T07:01:24Z + +## [v0.5.13](https://github.com/knu/ruby-domain_name/tree/v0.5.13) (2013-08-18) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.12...v0.5.13) + +- Update the eTLD database to 2013-08-15T11:01:26Z +- Adjust dependencies for Ruby 1.8 + +## [v0.5.12](https://github.com/knu/ruby-domain_name/tree/v0.5.12) (2013-06-07) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.11...v0.5.12) + +- Update the eTLD database to 2013-06-06T23:00:56Z +- Add *_idn methods that do ToUnicode conversion + +## [v0.5.11](https://github.com/knu/ruby-domain_name/tree/v0.5.11) (2013-04-12) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.10...v0.5.11) + +- Add DomainName#superdomain +- Update the database to 2013-04-05T23:00:49Z + +## [v0.5.10](https://github.com/knu/ruby-domain_name/tree/v0.5.10) (2013-04-01) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.9...v0.5.10) + +- Update the eTLD database to that of 2013-03-31T03:02:39Z + +## [v0.5.9](https://github.com/knu/ruby-domain_name/tree/v0.5.9) (2013-03-17) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.8...v0.5.9) + +- Support unf 0.1.0 + +## [v0.5.8](https://github.com/knu/ruby-domain_name/tree/v0.5.8) (2013-03-14) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.7...v0.5.8) + +- Update the eTLD database to the version as of 2013-02-18T20:02:07Z + +## [v0.5.7](https://github.com/knu/ruby-domain_name/tree/v0.5.7) (2013-01-07) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.6...v0.5.7) + +- Update the eTLD list + +## [v0.5.6](https://github.com/knu/ruby-domain_name/tree/v0.5.6) (2012-12-06) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.5...v0.5.6) + +- Update the eTLD list + +## [v0.5.5](https://github.com/knu/ruby-domain_name/tree/v0.5.5) (2012-12-06) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.4...v0.5.5) + +- Add an optional host_only flag to DomainName#cookie_domain? +- Migrate from jeweler to bundle gem + +## [v0.5.4](https://github.com/knu/ruby-domain_name/tree/v0.5.4) (2012-09-18) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.3...v0.5.4) + +- Update the eTLD list +- Import updated test cases suggested by Mozilla developers + +## [v0.5.3](https://github.com/knu/ruby-domain_name/tree/v0.5.3) (2012-04-06) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.2...v0.5.3) + +- Implement Punycode decoder + +**Closed issues:** + +- Running DomainName multi-threaded leads to Stack Errors [\#2](https://github.com/knu/ruby-domain_name/issues/2) + +## [v0.5.2](https://github.com/knu/ruby-domain_name/tree/v0.5.2) (2012-01-18) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.1...v0.5.2) + +- Update the eTLD list + +## [v0.5.1](https://github.com/knu/ruby-domain_name/tree/v0.5.1) (2011-11-09) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.0...v0.5.1) + +- DomainName.new calls #to_str if a non-string object is given +- Fix support for IPv6 addresses enclosed in square brackets + +**Merged pull requests:** + +- Fixed DomainName\#\<=\> for use with Ruby 1.8.7 [\#1](https://github.com/knu/ruby-domain_name/pull/1) ([drbrain](https://github.com/drbrain)) + +## [v0.5.0](https://github.com/knu/ruby-domain_name/tree/v0.5.0) (2011-11-04) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.0.0...v0.5.0) + +- Implement DomainName comparison and fix cookie_domain?() +- Avoid warnings about uninitialized instance variables + +## [v0.0.0](https://github.com/knu/ruby-domain_name/tree/v0.0.0) (2011-10-29) + +- Initial release + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Gemfile b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Gemfile new file mode 100644 index 0000000..4beebeb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in domain_name.gemspec +gemspec diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/LICENSE.txt new file mode 100644 index 0000000..67cec17 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/LICENSE.txt @@ -0,0 +1,78 @@ +Copyright (c) 2011-2017 Akinori MUSHA + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +* lib/domain_name/punycode.rb + +This file is derived from the implementation of punycode available at +here: + +https://www.verisign.com/en_US/channel-resources/domain-registry-products/idn-sdks/index.xhtml + +Copyright (C) 2000-2002 Verisign Inc., All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + + 1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3) Neither the name of the VeriSign Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +This software is licensed under the BSD open source license. For more +information visit www.opensource.org. + +Authors: + John Colosi (VeriSign) + Srikanth Veeramachaneni (VeriSign) + Nagesh Chigurupati (Verisign) + Praveen Srinivasan(Verisign) + +* lib/domain_name/etld_data.rb + +This file is generated from the Public Suffix List +(https://publicsuffix.org/), which is licensed under MPL 2.0: + +https://mozilla.org/MPL/2.0/ diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/README.md b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/README.md new file mode 100644 index 0000000..50aadcd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/README.md @@ -0,0 +1,67 @@ +domain_name +=========== + +Synopsis +-------- + +Domain Name manipulation library for Ruby + +Description +----------- + +* Parses a domain name ready for extracting the registered domain and + TLD. + + require "domain_name" + + host = DomainName("a.b.example.co.uk") + host.domain #=> "example.co.uk" + host.tld #=> "uk" + host.cookie_domain?("example.co.uk") #=> true + host.cookie_domain?("co.uk") #=> false + + host = DomainName("[::1]") # IP addresses like "192.168.1.1" and "::1" are also acceptable + host.ipaddr? #=> true + host.cookie_domain?("0:0:0:0:0:0:0:1") #=> true + +* Implements rudimental IDNA support. + +To-do's +------- + +* Implement IDNA 2008 (and/or 2003) including the domain label + validation and mapping defined in RFC 5891-5895 and UTS #46. + (work in progress) + +* Define a compact YAML serialization format. + +Installation +------------ + + gem install domain_name + +References +---------- + +* [RFC 3492](http://tools.ietf.org/html/rfc3492) (Obsolete; just for test cases) + +* [RFC 5890](http://tools.ietf.org/html/rfc5890) + +* [RFC 5891](http://tools.ietf.org/html/rfc5891) + +* [RFC 5892](http://tools.ietf.org/html/rfc5892) + +* [RFC 5893](http://tools.ietf.org/html/rfc5892) + +* [Public Suffix List](https://publicsuffix.org/list/) + +License +------- + +Copyright (c) 2011-2017 Akinori MUSHA + +Licensed under the 2-clause BSD license. + +Some portion of this library is copyrighted by third parties and +licensed under MPL 2.0 or 3-clause BSD license, +See `LICENSE.txt` for details. diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Rakefile b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Rakefile new file mode 100644 index 0000000..0c2d3c7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/Rakefile @@ -0,0 +1,111 @@ +require 'bundler/gem_tasks' +require 'uri' +ETLD_DATA_URI = URI('https://publicsuffix.org/list/public_suffix_list.dat') +ETLD_DATA_FILE = 'data/public_suffix_list.dat' +ETLD_DATA_RB = 'lib/domain_name/etld_data.rb' +VERSION_RB = 'lib/domain_name/version.rb' + +task :default => :test + +task :test => ETLD_DATA_RB + +task :import => :etld_data + +# +# eTLD Database +# + +task :etld_data do + require 'open-uri' + require 'time' + + begin + begin + load File.join('.', ETLD_DATA_RB) + data = ETLD_DATA_URI.read( + 'If-Modified-Since' => Time.parse(DomainName::ETLD_DATA_DATE).rfc2822 + ) + rescue LoadError, NameError + data = ETLD_DATA_URI.read + end + puts 'eTLD database is modified.' + date = data.last_modified + File.write(ETLD_DATA_FILE, data) + File.utime Time.now, date, ETLD_DATA_FILE + if new_version = DomainName::VERSION.dup.sub!(/\b\d{8}\b/, date.strftime('%Y%m%d')) + File.open(VERSION_RB, 'r+') { |rb| + content = rb.read + rb.rewind + rb.write(content.sub(/(?<=^ VERSION = ')#{Regexp.quote(DomainName::VERSION)}(?='$)/, new_version)) + rb.truncate(rb.tell) + } + end + Rake::Task[ETLD_DATA_RB].execute + rescue OpenURI::HTTPError => e + if e.io.status.first == '304' # Not Modified + puts 'eTLD database is up-to-date.' + else + raise + end + end +end + +namespace :etld_data do + task :commit do + if system(*%W[git diff --exit-code --quiet], ETLD_DATA_FILE) + warn "Nothing to commit." + exit + end + + prev = `ruby -e "$(git cat-file -p @:lib/domain_name/version.rb); puts DomainName::VERSION"`.chomp + curr = `ruby -e "load 'lib/domain_name/version.rb'; puts DomainName::VERSION"`.chomp + timestamp = File.mtime(ETLD_DATA_FILE).utc + + File.open('CHANGELOG.md', 'r+') do |f| + lines = f.readlines + lines.insert(2, <<~EOF) +## [v#{curr}](https://github.com/knu/ruby-domain_name/tree/v#{curr}) (#{Time.now.strftime('%F')}) +[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v#{prev}...v#{curr}) + +- Update the eTLD database to #{timestamp} + + EOF + f.rewind + f.puts lines + end + + sh 'git', 'commit', + 'CHANGELOG.md', + ETLD_DATA_FILE, + ETLD_DATA_RB, + VERSION_RB, + '-m', 'Update the eTLD database to %s.' % timestamp + + sh 'git', 'tag', "v#{curr}" + end +end + +file ETLD_DATA_RB => [ + ETLD_DATA_FILE, + ETLD_DATA_RB + '.erb', + 'tool/gen_etld_data.rb' +] do + ruby 'tool/gen_etld_data.rb' +end + +require 'rake/testtask' +Rake::TestTask.new(:test) do |test| + test.libs << 'test' + test.pattern = 'test/**/test_*.rb' + test.verbose = true +end + +require 'rdoc/task' +Rake::RDocTask.new do |rdoc| + version = DomainName::VERSION + + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "domain_name #{version}" + rdoc.rdoc_files.include('lib/**/*.rb') + rdoc.rdoc_files.include(Bundler::GemHelper.gemspec.extra_rdoc_files) +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/data/public_suffix_list.dat b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/data/public_suffix_list.dat new file mode 100644 index 0000000..b162596 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/data/public_suffix_list.dat @@ -0,0 +1,12985 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat, +// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported. + +// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/. + +// ===BEGIN ICANN DOMAINS=== + +// ac : https://en.wikipedia.org/wiki/.ac +ac +com.ac +edu.ac +gov.ac +net.ac +mil.ac +org.ac + +// ad : https://en.wikipedia.org/wiki/.ad +ad +nom.ad + +// ae : https://en.wikipedia.org/wiki/.ae +// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php +ae +co.ae +net.ae +org.ae +sch.ae +ac.ae +gov.ae +mil.ae + +// aero : see https://www.information.aero/index.php?id=66 +aero +accident-investigation.aero +accident-prevention.aero +aerobatic.aero +aeroclub.aero +aerodrome.aero +agents.aero +aircraft.aero +airline.aero +airport.aero +air-surveillance.aero +airtraffic.aero +air-traffic-control.aero +ambulance.aero +amusement.aero +association.aero +author.aero +ballooning.aero +broker.aero +caa.aero +cargo.aero +catering.aero +certification.aero +championship.aero +charter.aero +civilaviation.aero +club.aero +conference.aero +consultant.aero +consulting.aero +control.aero +council.aero +crew.aero +design.aero +dgca.aero +educator.aero +emergency.aero +engine.aero +engineer.aero +entertainment.aero +equipment.aero +exchange.aero +express.aero +federation.aero +flight.aero +freight.aero +fuel.aero +gliding.aero +government.aero +groundhandling.aero +group.aero +hanggliding.aero +homebuilt.aero +insurance.aero +journal.aero +journalist.aero +leasing.aero +logistics.aero +magazine.aero +maintenance.aero +media.aero +microlight.aero +modelling.aero +navigation.aero +parachuting.aero +paragliding.aero +passenger-association.aero +pilot.aero +press.aero +production.aero +recreation.aero +repbody.aero +res.aero +research.aero +rotorcraft.aero +safety.aero +scientist.aero +services.aero +show.aero +skydiving.aero +software.aero +student.aero +trader.aero +trading.aero +trainer.aero +union.aero +workinggroup.aero +works.aero + +// af : http://www.nic.af/help.jsp +af +gov.af +com.af +org.af +net.af +edu.af + +// ag : http://www.nic.ag/prices.htm +ag +com.ag +org.ag +net.ag +co.ag +nom.ag + +// ai : http://nic.com.ai/ +ai +off.ai +com.ai +net.ai +org.ai + +// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31 +al +com.al +edu.al +gov.al +mil.al +net.al +org.al + +// am : https://www.amnic.net/policy/en/Policy_EN.pdf +am +co.am +com.am +commune.am +net.am +org.am + +// ao : https://en.wikipedia.org/wiki/.ao +// http://www.dns.ao/REGISTR.DOC +ao +ed.ao +gv.ao +og.ao +co.ao +pb.ao +it.ao + +// aq : https://en.wikipedia.org/wiki/.aq +aq + +// ar : https://nic.ar/nic-argentina/normativa-vigente +ar +com.ar +edu.ar +gob.ar +gov.ar +int.ar +mil.ar +musica.ar +net.ar +org.ar +tur.ar + +// arpa : https://en.wikipedia.org/wiki/.arpa +// Confirmed by registry 2008-06-18 +arpa +e164.arpa +in-addr.arpa +ip6.arpa +iris.arpa +uri.arpa +urn.arpa + +// as : https://en.wikipedia.org/wiki/.as +as +gov.as + +// asia : https://en.wikipedia.org/wiki/.asia +asia + +// at : https://en.wikipedia.org/wiki/.at +// Confirmed by registry 2008-06-17 +at +ac.at +co.at +gv.at +or.at + +// au : https://en.wikipedia.org/wiki/.au +// http://www.auda.org.au/ +au +// 2LDs +com.au +net.au +org.au +edu.au +gov.au +asn.au +id.au +// Historic 2LDs (closed to new registration, but sites still exist) +info.au +conf.au +oz.au +// CGDNs - http://www.cgdn.org.au/ +act.au +nsw.au +nt.au +qld.au +sa.au +tas.au +vic.au +wa.au +// 3LDs +act.edu.au +nsw.edu.au +nt.edu.au +qld.edu.au +sa.edu.au +tas.edu.au +vic.edu.au +wa.edu.au +// act.gov.au Bug 984824 - Removed at request of Greg Tankard +// nsw.gov.au Bug 547985 - Removed at request of +// nt.gov.au Bug 940478 - Removed at request of Greg Connors +qld.gov.au +sa.gov.au +tas.gov.au +vic.gov.au +wa.gov.au + +// aw : https://en.wikipedia.org/wiki/.aw +aw +com.aw + +// ax : https://en.wikipedia.org/wiki/.ax +ax + +// az : https://en.wikipedia.org/wiki/.az +az +com.az +net.az +int.az +gov.az +org.az +edu.az +info.az +pp.az +mil.az +name.az +pro.az +biz.az + +// ba : http://nic.ba/users_data/files/pravilnik_o_registraciji.pdf +ba +com.ba +edu.ba +gov.ba +mil.ba +net.ba +org.ba + +// bb : https://en.wikipedia.org/wiki/.bb +bb +biz.bb +co.bb +com.bb +edu.bb +gov.bb +info.bb +net.bb +org.bb +store.bb +tv.bb + +// bd : https://en.wikipedia.org/wiki/.bd +*.bd + +// be : https://en.wikipedia.org/wiki/.be +// Confirmed by registry 2008-06-08 +be +ac.be + +// bf : https://en.wikipedia.org/wiki/.bf +bf +gov.bf + +// bg : https://en.wikipedia.org/wiki/.bg +// https://www.register.bg/user/static/rules/en/index.html +bg +a.bg +b.bg +c.bg +d.bg +e.bg +f.bg +g.bg +h.bg +i.bg +j.bg +k.bg +l.bg +m.bg +n.bg +o.bg +p.bg +q.bg +r.bg +s.bg +t.bg +u.bg +v.bg +w.bg +x.bg +y.bg +z.bg +0.bg +1.bg +2.bg +3.bg +4.bg +5.bg +6.bg +7.bg +8.bg +9.bg + +// bh : https://en.wikipedia.org/wiki/.bh +bh +com.bh +edu.bh +net.bh +org.bh +gov.bh + +// bi : https://en.wikipedia.org/wiki/.bi +// http://whois.nic.bi/ +bi +co.bi +com.bi +edu.bi +or.bi +org.bi + +// biz : https://en.wikipedia.org/wiki/.biz +biz + +// bj : https://en.wikipedia.org/wiki/.bj +bj +asso.bj +barreau.bj +gouv.bj + +// bm : http://www.bermudanic.bm/dnr-text.txt +bm +com.bm +edu.bm +gov.bm +net.bm +org.bm + +// bn : http://www.bnnic.bn/faqs +bn +com.bn +edu.bn +gov.bn +net.bn +org.bn + +// bo : https://nic.bo/delegacion2015.php#h-1.10 +bo +com.bo +edu.bo +gob.bo +int.bo +org.bo +net.bo +mil.bo +tv.bo +web.bo +// Social Domains +academia.bo +agro.bo +arte.bo +blog.bo +bolivia.bo +ciencia.bo +cooperativa.bo +democracia.bo +deporte.bo +ecologia.bo +economia.bo +empresa.bo +indigena.bo +industria.bo +info.bo +medicina.bo +movimiento.bo +musica.bo +natural.bo +nombre.bo +noticias.bo +patria.bo +politica.bo +profesional.bo +plurinacional.bo +pueblo.bo +revista.bo +salud.bo +tecnologia.bo +tksat.bo +transporte.bo +wiki.bo + +// br : http://registro.br/dominio/categoria.html +// Submitted by registry +br +9guacu.br +abc.br +adm.br +adv.br +agr.br +aju.br +am.br +anani.br +aparecida.br +arq.br +art.br +ato.br +b.br +barueri.br +belem.br +bhz.br +bio.br +blog.br +bmd.br +boavista.br +bsb.br +campinagrande.br +campinas.br +caxias.br +cim.br +cng.br +cnt.br +com.br +contagem.br +coop.br +cri.br +cuiaba.br +curitiba.br +def.br +ecn.br +eco.br +edu.br +emp.br +eng.br +esp.br +etc.br +eti.br +far.br +feira.br +flog.br +floripa.br +fm.br +fnd.br +fortal.br +fot.br +foz.br +fst.br +g12.br +ggf.br +goiania.br +gov.br +// gov.br 26 states + df https://en.wikipedia.org/wiki/States_of_Brazil +ac.gov.br +al.gov.br +am.gov.br +ap.gov.br +ba.gov.br +ce.gov.br +df.gov.br +es.gov.br +go.gov.br +ma.gov.br +mg.gov.br +ms.gov.br +mt.gov.br +pa.gov.br +pb.gov.br +pe.gov.br +pi.gov.br +pr.gov.br +rj.gov.br +rn.gov.br +ro.gov.br +rr.gov.br +rs.gov.br +sc.gov.br +se.gov.br +sp.gov.br +to.gov.br +gru.br +imb.br +ind.br +inf.br +jab.br +jampa.br +jdf.br +joinville.br +jor.br +jus.br +leg.br +lel.br +londrina.br +macapa.br +maceio.br +manaus.br +maringa.br +mat.br +med.br +mil.br +morena.br +mp.br +mus.br +natal.br +net.br +niteroi.br +*.nom.br +not.br +ntr.br +odo.br +ong.br +org.br +osasco.br +palmas.br +poa.br +ppg.br +pro.br +psc.br +psi.br +pvh.br +qsl.br +radio.br +rec.br +recife.br +ribeirao.br +rio.br +riobranco.br +riopreto.br +salvador.br +sampa.br +santamaria.br +santoandre.br +saobernardo.br +saogonca.br +sjc.br +slg.br +slz.br +sorocaba.br +srv.br +taxi.br +tc.br +teo.br +the.br +tmp.br +trd.br +tur.br +tv.br +udi.br +vet.br +vix.br +vlog.br +wiki.br +zlg.br + +// bs : http://www.nic.bs/rules.html +bs +com.bs +net.bs +org.bs +edu.bs +gov.bs + +// bt : https://en.wikipedia.org/wiki/.bt +bt +com.bt +edu.bt +gov.bt +net.bt +org.bt + +// bv : No registrations at this time. +// Submitted by registry +bv + +// bw : https://en.wikipedia.org/wiki/.bw +// http://www.gobin.info/domainname/bw.doc +// list of other 2nd level tlds ? +bw +co.bw +org.bw + +// by : https://en.wikipedia.org/wiki/.by +// http://tld.by/rules_2006_en.html +// list of other 2nd level tlds ? +by +gov.by +mil.by +// Official information does not indicate that com.by is a reserved +// second-level domain, but it's being used as one (see www.google.com.by and +// www.yahoo.com.by, for example), so we list it here for safety's sake. +com.by + +// http://hoster.by/ +of.by + +// bz : https://en.wikipedia.org/wiki/.bz +// http://www.belizenic.bz/ +bz +com.bz +net.bz +org.bz +edu.bz +gov.bz + +// ca : https://en.wikipedia.org/wiki/.ca +ca +// ca geographical names +ab.ca +bc.ca +mb.ca +nb.ca +nf.ca +nl.ca +ns.ca +nt.ca +nu.ca +on.ca +pe.ca +qc.ca +sk.ca +yk.ca +// gc.ca: https://en.wikipedia.org/wiki/.gc.ca +// see also: http://registry.gc.ca/en/SubdomainFAQ +gc.ca + +// cat : https://en.wikipedia.org/wiki/.cat +cat + +// cc : https://en.wikipedia.org/wiki/.cc +cc + +// cd : https://en.wikipedia.org/wiki/.cd +// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1 +cd +gov.cd + +// cf : https://en.wikipedia.org/wiki/.cf +cf + +// cg : https://en.wikipedia.org/wiki/.cg +cg + +// ch : https://en.wikipedia.org/wiki/.ch +ch + +// ci : https://en.wikipedia.org/wiki/.ci +// http://www.nic.ci/index.php?page=charte +ci +org.ci +or.ci +com.ci +co.ci +edu.ci +ed.ci +ac.ci +net.ci +go.ci +asso.ci +aéroport.ci +int.ci +presse.ci +md.ci +gouv.ci + +// ck : https://en.wikipedia.org/wiki/.ck +*.ck +!www.ck + +// cl : https://en.wikipedia.org/wiki/.cl +cl +gov.cl +gob.cl +co.cl +mil.cl + +// cm : https://en.wikipedia.org/wiki/.cm plus bug 981927 +cm +co.cm +com.cm +gov.cm +net.cm + +// cn : https://en.wikipedia.org/wiki/.cn +// Submitted by registry +cn +ac.cn +com.cn +edu.cn +gov.cn +net.cn +org.cn +mil.cn +公司.cn +网络.cn +網絡.cn +// cn geographic names +ah.cn +bj.cn +cq.cn +fj.cn +gd.cn +gs.cn +gz.cn +gx.cn +ha.cn +hb.cn +he.cn +hi.cn +hl.cn +hn.cn +jl.cn +js.cn +jx.cn +ln.cn +nm.cn +nx.cn +qh.cn +sc.cn +sd.cn +sh.cn +sn.cn +sx.cn +tj.cn +xj.cn +xz.cn +yn.cn +zj.cn +hk.cn +mo.cn +tw.cn + +// co : https://en.wikipedia.org/wiki/.co +// Submitted by registry +co +arts.co +com.co +edu.co +firm.co +gov.co +info.co +int.co +mil.co +net.co +nom.co +org.co +rec.co +web.co + +// com : https://en.wikipedia.org/wiki/.com +com + +// coop : https://en.wikipedia.org/wiki/.coop +coop + +// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do +cr +ac.cr +co.cr +ed.cr +fi.cr +go.cr +or.cr +sa.cr + +// cu : https://en.wikipedia.org/wiki/.cu +cu +com.cu +edu.cu +org.cu +net.cu +gov.cu +inf.cu + +// cv : https://en.wikipedia.org/wiki/.cv +cv + +// cw : http://www.una.cw/cw_registry/ +// Confirmed by registry 2013-03-26 +cw +com.cw +edu.cw +net.cw +org.cw + +// cx : https://en.wikipedia.org/wiki/.cx +// list of other 2nd level tlds ? +cx +gov.cx + +// cy : http://www.nic.cy/ +// Submitted by registry Panayiotou Fotia +cy +ac.cy +biz.cy +com.cy +ekloges.cy +gov.cy +ltd.cy +name.cy +net.cy +org.cy +parliament.cy +press.cy +pro.cy +tm.cy + +// cz : https://en.wikipedia.org/wiki/.cz +cz + +// de : https://en.wikipedia.org/wiki/.de +// Confirmed by registry (with technical +// reservations) 2008-07-01 +de + +// dj : https://en.wikipedia.org/wiki/.dj +dj + +// dk : https://en.wikipedia.org/wiki/.dk +// Confirmed by registry 2008-06-17 +dk + +// dm : https://en.wikipedia.org/wiki/.dm +dm +com.dm +net.dm +org.dm +edu.dm +gov.dm + +// do : https://en.wikipedia.org/wiki/.do +do +art.do +com.do +edu.do +gob.do +gov.do +mil.do +net.do +org.do +sld.do +web.do + +// dz : https://en.wikipedia.org/wiki/.dz +dz +com.dz +org.dz +net.dz +gov.dz +edu.dz +asso.dz +pol.dz +art.dz + +// ec : http://www.nic.ec/reg/paso1.asp +// Submitted by registry +ec +com.ec +info.ec +net.ec +fin.ec +k12.ec +med.ec +pro.ec +org.ec +edu.ec +gov.ec +gob.ec +mil.ec + +// edu : https://en.wikipedia.org/wiki/.edu +edu + +// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B +ee +edu.ee +gov.ee +riik.ee +lib.ee +med.ee +com.ee +pri.ee +aip.ee +org.ee +fie.ee + +// eg : https://en.wikipedia.org/wiki/.eg +eg +com.eg +edu.eg +eun.eg +gov.eg +mil.eg +name.eg +net.eg +org.eg +sci.eg + +// er : https://en.wikipedia.org/wiki/.er +*.er + +// es : https://www.nic.es/site_ingles/ingles/dominios/index.html +es +com.es +nom.es +org.es +gob.es +edu.es + +// et : https://en.wikipedia.org/wiki/.et +et +com.et +gov.et +org.et +edu.et +biz.et +name.et +info.et +net.et + +// eu : https://en.wikipedia.org/wiki/.eu +eu + +// fi : https://en.wikipedia.org/wiki/.fi +fi +// aland.fi : https://en.wikipedia.org/wiki/.ax +// This domain is being phased out in favor of .ax. As there are still many +// domains under aland.fi, we still keep it on the list until aland.fi is +// completely removed. +// TODO: Check for updates (expected to be phased out around Q1/2009) +aland.fi + +// fj : https://en.wikipedia.org/wiki/.fj +*.fj + +// fk : https://en.wikipedia.org/wiki/.fk +*.fk + +// fm : https://en.wikipedia.org/wiki/.fm +fm + +// fo : https://en.wikipedia.org/wiki/.fo +fo + +// fr : http://www.afnic.fr/ +// domaines descriptifs : https://www.afnic.fr/medias/documents/Cadre_legal/Afnic_Naming_Policy_12122016_VEN.pdf +fr +asso.fr +com.fr +gouv.fr +nom.fr +prd.fr +tm.fr +// domaines sectoriels : https://www.afnic.fr/en/products-and-services/the-fr-tld/sector-based-fr-domains-4.html +aeroport.fr +avocat.fr +avoues.fr +cci.fr +chambagri.fr +chirurgiens-dentistes.fr +experts-comptables.fr +geometre-expert.fr +greta.fr +huissier-justice.fr +medecin.fr +notaires.fr +pharmacien.fr +port.fr +veterinaire.fr + +// ga : https://en.wikipedia.org/wiki/.ga +ga + +// gb : This registry is effectively dormant +// Submitted by registry +gb + +// gd : https://en.wikipedia.org/wiki/.gd +gd + +// ge : http://www.nic.net.ge/policy_en.pdf +ge +com.ge +edu.ge +gov.ge +org.ge +mil.ge +net.ge +pvt.ge + +// gf : https://en.wikipedia.org/wiki/.gf +gf + +// gg : http://www.channelisles.net/register-domains/ +// Confirmed by registry 2013-11-28 +gg +co.gg +net.gg +org.gg + +// gh : https://en.wikipedia.org/wiki/.gh +// see also: http://www.nic.gh/reg_now.php +// Although domains directly at second level are not possible at the moment, +// they have been possible for some time and may come back. +gh +com.gh +edu.gh +gov.gh +org.gh +mil.gh + +// gi : http://www.nic.gi/rules.html +gi +com.gi +ltd.gi +gov.gi +mod.gi +edu.gi +org.gi + +// gl : https://en.wikipedia.org/wiki/.gl +// http://nic.gl +gl +co.gl +com.gl +edu.gl +net.gl +org.gl + +// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm +gm + +// gn : http://psg.com/dns/gn/gn.txt +// Submitted by registry +gn +ac.gn +com.gn +edu.gn +gov.gn +org.gn +net.gn + +// gov : https://en.wikipedia.org/wiki/.gov +gov + +// gp : http://www.nic.gp/index.php?lang=en +gp +com.gp +net.gp +mobi.gp +edu.gp +org.gp +asso.gp + +// gq : https://en.wikipedia.org/wiki/.gq +gq + +// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html +// Submitted by registry +gr +com.gr +edu.gr +net.gr +org.gr +gov.gr + +// gs : https://en.wikipedia.org/wiki/.gs +gs + +// gt : http://www.gt/politicas_de_registro.html +gt +com.gt +edu.gt +gob.gt +ind.gt +mil.gt +net.gt +org.gt + +// gu : http://gadao.gov.gu/register.html +// University of Guam : https://www.uog.edu +// Submitted by uognoc@triton.uog.edu +gu +com.gu +edu.gu +gov.gu +guam.gu +info.gu +net.gu +org.gu +web.gu + +// gw : https://en.wikipedia.org/wiki/.gw +gw + +// gy : https://en.wikipedia.org/wiki/.gy +// http://registry.gy/ +gy +co.gy +com.gy +edu.gy +gov.gy +net.gy +org.gy + +// hk : https://www.hkirc.hk +// Submitted by registry +hk +com.hk +edu.hk +gov.hk +idv.hk +net.hk +org.hk +公司.hk +教育.hk +敎育.hk +政府.hk +個人.hk +个人.hk +箇人.hk +網络.hk +网络.hk +组織.hk +網絡.hk +网絡.hk +组织.hk +組織.hk +組织.hk + +// hm : https://en.wikipedia.org/wiki/.hm +hm + +// hn : http://www.nic.hn/politicas/ps02,,05.html +hn +com.hn +edu.hn +org.hn +net.hn +mil.hn +gob.hn + +// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf +hr +iz.hr +from.hr +name.hr +com.hr + +// ht : http://www.nic.ht/info/charte.cfm +ht +com.ht +shop.ht +firm.ht +info.ht +adult.ht +net.ht +pro.ht +org.ht +med.ht +art.ht +coop.ht +pol.ht +asso.ht +edu.ht +rel.ht +gouv.ht +perso.ht + +// hu : http://www.domain.hu/domain/English/sld.html +// Confirmed by registry 2008-06-12 +hu +co.hu +info.hu +org.hu +priv.hu +sport.hu +tm.hu +2000.hu +agrar.hu +bolt.hu +casino.hu +city.hu +erotica.hu +erotika.hu +film.hu +forum.hu +games.hu +hotel.hu +ingatlan.hu +jogasz.hu +konyvelo.hu +lakas.hu +media.hu +news.hu +reklam.hu +sex.hu +shop.hu +suli.hu +szex.hu +tozsde.hu +utazas.hu +video.hu + +// id : https://pandi.id/en/domain/registration-requirements/ +id +ac.id +biz.id +co.id +desa.id +go.id +mil.id +my.id +net.id +or.id +ponpes.id +sch.id +web.id + +// ie : https://en.wikipedia.org/wiki/.ie +ie +gov.ie + +// il : http://www.isoc.org.il/domains/ +il +ac.il +co.il +gov.il +idf.il +k12.il +muni.il +net.il +org.il + +// im : https://www.nic.im/ +// Submitted by registry +im +ac.im +co.im +com.im +ltd.co.im +net.im +org.im +plc.co.im +tt.im +tv.im + +// in : https://en.wikipedia.org/wiki/.in +// see also: https://registry.in/Policies +// Please note, that nic.in is not an official eTLD, but used by most +// government institutions. +in +co.in +firm.in +net.in +org.in +gen.in +ind.in +nic.in +ac.in +edu.in +res.in +gov.in +mil.in + +// info : https://en.wikipedia.org/wiki/.info +info + +// int : https://en.wikipedia.org/wiki/.int +// Confirmed by registry 2008-06-18 +int +eu.int + +// io : http://www.nic.io/rules.html +// list of other 2nd level tlds ? +io +com.io + +// iq : http://www.cmc.iq/english/iq/iqregister1.htm +iq +gov.iq +edu.iq +mil.iq +com.iq +org.iq +net.iq + +// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules +// Also see http://www.nic.ir/Internationalized_Domain_Names +// Two .ir entries added at request of , 2010-04-16 +ir +ac.ir +co.ir +gov.ir +id.ir +net.ir +org.ir +sch.ir +// xn--mgba3a4f16a.ir (.ir, Persian YEH) +ایران.ir +// xn--mgba3a4fra.ir (.ir, Arabic YEH) +ايران.ir + +// is : http://www.isnic.is/domain/rules.php +// Confirmed by registry 2008-12-06 +is +net.is +com.is +edu.is +gov.is +org.is +int.is + +// it : https://en.wikipedia.org/wiki/.it +it +gov.it +edu.it +// Reserved geo-names (regions and provinces): +// http://www.nic.it/sites/default/files/docs/Regulation_assignation_v7.1.pdf +// Regions +abr.it +abruzzo.it +aosta-valley.it +aostavalley.it +bas.it +basilicata.it +cal.it +calabria.it +cam.it +campania.it +emilia-romagna.it +emiliaromagna.it +emr.it +friuli-v-giulia.it +friuli-ve-giulia.it +friuli-vegiulia.it +friuli-venezia-giulia.it +friuli-veneziagiulia.it +friuli-vgiulia.it +friuliv-giulia.it +friulive-giulia.it +friulivegiulia.it +friulivenezia-giulia.it +friuliveneziagiulia.it +friulivgiulia.it +fvg.it +laz.it +lazio.it +lig.it +liguria.it +lom.it +lombardia.it +lombardy.it +lucania.it +mar.it +marche.it +mol.it +molise.it +piedmont.it +piemonte.it +pmn.it +pug.it +puglia.it +sar.it +sardegna.it +sardinia.it +sic.it +sicilia.it +sicily.it +taa.it +tos.it +toscana.it +trentin-sud-tirol.it +trentin-süd-tirol.it +trentin-sudtirol.it +trentin-südtirol.it +trentin-sued-tirol.it +trentin-suedtirol.it +trentino-a-adige.it +trentino-aadige.it +trentino-alto-adige.it +trentino-altoadige.it +trentino-s-tirol.it +trentino-stirol.it +trentino-sud-tirol.it +trentino-süd-tirol.it +trentino-sudtirol.it +trentino-südtirol.it +trentino-sued-tirol.it +trentino-suedtirol.it +trentino.it +trentinoa-adige.it +trentinoaadige.it +trentinoalto-adige.it +trentinoaltoadige.it +trentinos-tirol.it +trentinostirol.it +trentinosud-tirol.it +trentinosüd-tirol.it +trentinosudtirol.it +trentinosüdtirol.it +trentinosued-tirol.it +trentinosuedtirol.it +trentinsud-tirol.it +trentinsüd-tirol.it +trentinsudtirol.it +trentinsüdtirol.it +trentinsued-tirol.it +trentinsuedtirol.it +tuscany.it +umb.it +umbria.it +val-d-aosta.it +val-daosta.it +vald-aosta.it +valdaosta.it +valle-aosta.it +valle-d-aosta.it +valle-daosta.it +valleaosta.it +valled-aosta.it +valledaosta.it +vallee-aoste.it +vallée-aoste.it +vallee-d-aoste.it +vallée-d-aoste.it +valleeaoste.it +valléeaoste.it +valleedaoste.it +valléedaoste.it +vao.it +vda.it +ven.it +veneto.it +// Provinces +ag.it +agrigento.it +al.it +alessandria.it +alto-adige.it +altoadige.it +an.it +ancona.it +andria-barletta-trani.it +andria-trani-barletta.it +andriabarlettatrani.it +andriatranibarletta.it +ao.it +aosta.it +aoste.it +ap.it +aq.it +aquila.it +ar.it +arezzo.it +ascoli-piceno.it +ascolipiceno.it +asti.it +at.it +av.it +avellino.it +ba.it +balsan-sudtirol.it +balsan-südtirol.it +balsan-suedtirol.it +balsan.it +bari.it +barletta-trani-andria.it +barlettatraniandria.it +belluno.it +benevento.it +bergamo.it +bg.it +bi.it +biella.it +bl.it +bn.it +bo.it +bologna.it +bolzano-altoadige.it +bolzano.it +bozen-sudtirol.it +bozen-südtirol.it +bozen-suedtirol.it +bozen.it +br.it +brescia.it +brindisi.it +bs.it +bt.it +bulsan-sudtirol.it +bulsan-südtirol.it +bulsan-suedtirol.it +bulsan.it +bz.it +ca.it +cagliari.it +caltanissetta.it +campidano-medio.it +campidanomedio.it +campobasso.it +carbonia-iglesias.it +carboniaiglesias.it +carrara-massa.it +carraramassa.it +caserta.it +catania.it +catanzaro.it +cb.it +ce.it +cesena-forli.it +cesena-forlì.it +cesenaforli.it +cesenaforlì.it +ch.it +chieti.it +ci.it +cl.it +cn.it +co.it +como.it +cosenza.it +cr.it +cremona.it +crotone.it +cs.it +ct.it +cuneo.it +cz.it +dell-ogliastra.it +dellogliastra.it +en.it +enna.it +fc.it +fe.it +fermo.it +ferrara.it +fg.it +fi.it +firenze.it +florence.it +fm.it +foggia.it +forli-cesena.it +forlì-cesena.it +forlicesena.it +forlìcesena.it +fr.it +frosinone.it +ge.it +genoa.it +genova.it +go.it +gorizia.it +gr.it +grosseto.it +iglesias-carbonia.it +iglesiascarbonia.it +im.it +imperia.it +is.it +isernia.it +kr.it +la-spezia.it +laquila.it +laspezia.it +latina.it +lc.it +le.it +lecce.it +lecco.it +li.it +livorno.it +lo.it +lodi.it +lt.it +lu.it +lucca.it +macerata.it +mantova.it +massa-carrara.it +massacarrara.it +matera.it +mb.it +mc.it +me.it +medio-campidano.it +mediocampidano.it +messina.it +mi.it +milan.it +milano.it +mn.it +mo.it +modena.it +monza-brianza.it +monza-e-della-brianza.it +monza.it +monzabrianza.it +monzaebrianza.it +monzaedellabrianza.it +ms.it +mt.it +na.it +naples.it +napoli.it +no.it +novara.it +nu.it +nuoro.it +og.it +ogliastra.it +olbia-tempio.it +olbiatempio.it +or.it +oristano.it +ot.it +pa.it +padova.it +padua.it +palermo.it +parma.it +pavia.it +pc.it +pd.it +pe.it +perugia.it +pesaro-urbino.it +pesarourbino.it +pescara.it +pg.it +pi.it +piacenza.it +pisa.it +pistoia.it +pn.it +po.it +pordenone.it +potenza.it +pr.it +prato.it +pt.it +pu.it +pv.it +pz.it +ra.it +ragusa.it +ravenna.it +rc.it +re.it +reggio-calabria.it +reggio-emilia.it +reggiocalabria.it +reggioemilia.it +rg.it +ri.it +rieti.it +rimini.it +rm.it +rn.it +ro.it +roma.it +rome.it +rovigo.it +sa.it +salerno.it +sassari.it +savona.it +si.it +siena.it +siracusa.it +so.it +sondrio.it +sp.it +sr.it +ss.it +suedtirol.it +südtirol.it +sv.it +ta.it +taranto.it +te.it +tempio-olbia.it +tempioolbia.it +teramo.it +terni.it +tn.it +to.it +torino.it +tp.it +tr.it +trani-andria-barletta.it +trani-barletta-andria.it +traniandriabarletta.it +tranibarlettaandria.it +trapani.it +trento.it +treviso.it +trieste.it +ts.it +turin.it +tv.it +ud.it +udine.it +urbino-pesaro.it +urbinopesaro.it +va.it +varese.it +vb.it +vc.it +ve.it +venezia.it +venice.it +verbania.it +vercelli.it +verona.it +vi.it +vibo-valentia.it +vibovalentia.it +vicenza.it +viterbo.it +vr.it +vs.it +vt.it +vv.it + +// je : http://www.channelisles.net/register-domains/ +// Confirmed by registry 2013-11-28 +je +co.je +net.je +org.je + +// jm : http://www.com.jm/register.html +*.jm + +// jo : http://www.dns.jo/Registration_policy.aspx +jo +com.jo +org.jo +net.jo +edu.jo +sch.jo +gov.jo +mil.jo +name.jo + +// jobs : https://en.wikipedia.org/wiki/.jobs +jobs + +// jp : https://en.wikipedia.org/wiki/.jp +// http://jprs.co.jp/en/jpdomain.html +// Submitted by registry +jp +// jp organizational type names +ac.jp +ad.jp +co.jp +ed.jp +go.jp +gr.jp +lg.jp +ne.jp +or.jp +// jp prefecture type names +aichi.jp +akita.jp +aomori.jp +chiba.jp +ehime.jp +fukui.jp +fukuoka.jp +fukushima.jp +gifu.jp +gunma.jp +hiroshima.jp +hokkaido.jp +hyogo.jp +ibaraki.jp +ishikawa.jp +iwate.jp +kagawa.jp +kagoshima.jp +kanagawa.jp +kochi.jp +kumamoto.jp +kyoto.jp +mie.jp +miyagi.jp +miyazaki.jp +nagano.jp +nagasaki.jp +nara.jp +niigata.jp +oita.jp +okayama.jp +okinawa.jp +osaka.jp +saga.jp +saitama.jp +shiga.jp +shimane.jp +shizuoka.jp +tochigi.jp +tokushima.jp +tokyo.jp +tottori.jp +toyama.jp +wakayama.jp +yamagata.jp +yamaguchi.jp +yamanashi.jp +栃木.jp +愛知.jp +愛媛.jp +兵庫.jp +熊本.jp +茨城.jp +北海道.jp +千葉.jp +和歌山.jp +長崎.jp +長野.jp +新潟.jp +青森.jp +静岡.jp +東京.jp +石川.jp +埼玉.jp +三重.jp +京都.jp +佐賀.jp +大分.jp +大阪.jp +奈良.jp +宮城.jp +宮崎.jp +富山.jp +山口.jp +山形.jp +山梨.jp +岩手.jp +岐阜.jp +岡山.jp +島根.jp +広島.jp +徳島.jp +沖縄.jp +滋賀.jp +神奈川.jp +福井.jp +福岡.jp +福島.jp +秋田.jp +群馬.jp +香川.jp +高知.jp +鳥取.jp +鹿児島.jp +// jp geographic type names +// http://jprs.jp/doc/rule/saisoku-1.html +*.kawasaki.jp +*.kitakyushu.jp +*.kobe.jp +*.nagoya.jp +*.sapporo.jp +*.sendai.jp +*.yokohama.jp +!city.kawasaki.jp +!city.kitakyushu.jp +!city.kobe.jp +!city.nagoya.jp +!city.sapporo.jp +!city.sendai.jp +!city.yokohama.jp +// 4th level registration +aisai.aichi.jp +ama.aichi.jp +anjo.aichi.jp +asuke.aichi.jp +chiryu.aichi.jp +chita.aichi.jp +fuso.aichi.jp +gamagori.aichi.jp +handa.aichi.jp +hazu.aichi.jp +hekinan.aichi.jp +higashiura.aichi.jp +ichinomiya.aichi.jp +inazawa.aichi.jp +inuyama.aichi.jp +isshiki.aichi.jp +iwakura.aichi.jp +kanie.aichi.jp +kariya.aichi.jp +kasugai.aichi.jp +kira.aichi.jp +kiyosu.aichi.jp +komaki.aichi.jp +konan.aichi.jp +kota.aichi.jp +mihama.aichi.jp +miyoshi.aichi.jp +nishio.aichi.jp +nisshin.aichi.jp +obu.aichi.jp +oguchi.aichi.jp +oharu.aichi.jp +okazaki.aichi.jp +owariasahi.aichi.jp +seto.aichi.jp +shikatsu.aichi.jp +shinshiro.aichi.jp +shitara.aichi.jp +tahara.aichi.jp +takahama.aichi.jp +tobishima.aichi.jp +toei.aichi.jp +togo.aichi.jp +tokai.aichi.jp +tokoname.aichi.jp +toyoake.aichi.jp +toyohashi.aichi.jp +toyokawa.aichi.jp +toyone.aichi.jp +toyota.aichi.jp +tsushima.aichi.jp +yatomi.aichi.jp +akita.akita.jp +daisen.akita.jp +fujisato.akita.jp +gojome.akita.jp +hachirogata.akita.jp +happou.akita.jp +higashinaruse.akita.jp +honjo.akita.jp +honjyo.akita.jp +ikawa.akita.jp +kamikoani.akita.jp +kamioka.akita.jp +katagami.akita.jp +kazuno.akita.jp +kitaakita.akita.jp +kosaka.akita.jp +kyowa.akita.jp +misato.akita.jp +mitane.akita.jp +moriyoshi.akita.jp +nikaho.akita.jp +noshiro.akita.jp +odate.akita.jp +oga.akita.jp +ogata.akita.jp +semboku.akita.jp +yokote.akita.jp +yurihonjo.akita.jp +aomori.aomori.jp +gonohe.aomori.jp +hachinohe.aomori.jp +hashikami.aomori.jp +hiranai.aomori.jp +hirosaki.aomori.jp +itayanagi.aomori.jp +kuroishi.aomori.jp +misawa.aomori.jp +mutsu.aomori.jp +nakadomari.aomori.jp +noheji.aomori.jp +oirase.aomori.jp +owani.aomori.jp +rokunohe.aomori.jp +sannohe.aomori.jp +shichinohe.aomori.jp +shingo.aomori.jp +takko.aomori.jp +towada.aomori.jp +tsugaru.aomori.jp +tsuruta.aomori.jp +abiko.chiba.jp +asahi.chiba.jp +chonan.chiba.jp +chosei.chiba.jp +choshi.chiba.jp +chuo.chiba.jp +funabashi.chiba.jp +futtsu.chiba.jp +hanamigawa.chiba.jp +ichihara.chiba.jp +ichikawa.chiba.jp +ichinomiya.chiba.jp +inzai.chiba.jp +isumi.chiba.jp +kamagaya.chiba.jp +kamogawa.chiba.jp +kashiwa.chiba.jp +katori.chiba.jp +katsuura.chiba.jp +kimitsu.chiba.jp +kisarazu.chiba.jp +kozaki.chiba.jp +kujukuri.chiba.jp +kyonan.chiba.jp +matsudo.chiba.jp +midori.chiba.jp +mihama.chiba.jp +minamiboso.chiba.jp +mobara.chiba.jp +mutsuzawa.chiba.jp +nagara.chiba.jp +nagareyama.chiba.jp +narashino.chiba.jp +narita.chiba.jp +noda.chiba.jp +oamishirasato.chiba.jp +omigawa.chiba.jp +onjuku.chiba.jp +otaki.chiba.jp +sakae.chiba.jp +sakura.chiba.jp +shimofusa.chiba.jp +shirako.chiba.jp +shiroi.chiba.jp +shisui.chiba.jp +sodegaura.chiba.jp +sosa.chiba.jp +tako.chiba.jp +tateyama.chiba.jp +togane.chiba.jp +tohnosho.chiba.jp +tomisato.chiba.jp +urayasu.chiba.jp +yachimata.chiba.jp +yachiyo.chiba.jp +yokaichiba.chiba.jp +yokoshibahikari.chiba.jp +yotsukaido.chiba.jp +ainan.ehime.jp +honai.ehime.jp +ikata.ehime.jp +imabari.ehime.jp +iyo.ehime.jp +kamijima.ehime.jp +kihoku.ehime.jp +kumakogen.ehime.jp +masaki.ehime.jp +matsuno.ehime.jp +matsuyama.ehime.jp +namikata.ehime.jp +niihama.ehime.jp +ozu.ehime.jp +saijo.ehime.jp +seiyo.ehime.jp +shikokuchuo.ehime.jp +tobe.ehime.jp +toon.ehime.jp +uchiko.ehime.jp +uwajima.ehime.jp +yawatahama.ehime.jp +echizen.fukui.jp +eiheiji.fukui.jp +fukui.fukui.jp +ikeda.fukui.jp +katsuyama.fukui.jp +mihama.fukui.jp +minamiechizen.fukui.jp +obama.fukui.jp +ohi.fukui.jp +ono.fukui.jp +sabae.fukui.jp +sakai.fukui.jp +takahama.fukui.jp +tsuruga.fukui.jp +wakasa.fukui.jp +ashiya.fukuoka.jp +buzen.fukuoka.jp +chikugo.fukuoka.jp +chikuho.fukuoka.jp +chikujo.fukuoka.jp +chikushino.fukuoka.jp +chikuzen.fukuoka.jp +chuo.fukuoka.jp +dazaifu.fukuoka.jp +fukuchi.fukuoka.jp +hakata.fukuoka.jp +higashi.fukuoka.jp +hirokawa.fukuoka.jp +hisayama.fukuoka.jp +iizuka.fukuoka.jp +inatsuki.fukuoka.jp +kaho.fukuoka.jp +kasuga.fukuoka.jp +kasuya.fukuoka.jp +kawara.fukuoka.jp +keisen.fukuoka.jp +koga.fukuoka.jp +kurate.fukuoka.jp +kurogi.fukuoka.jp +kurume.fukuoka.jp +minami.fukuoka.jp +miyako.fukuoka.jp +miyama.fukuoka.jp +miyawaka.fukuoka.jp +mizumaki.fukuoka.jp +munakata.fukuoka.jp +nakagawa.fukuoka.jp +nakama.fukuoka.jp +nishi.fukuoka.jp +nogata.fukuoka.jp +ogori.fukuoka.jp +okagaki.fukuoka.jp +okawa.fukuoka.jp +oki.fukuoka.jp +omuta.fukuoka.jp +onga.fukuoka.jp +onojo.fukuoka.jp +oto.fukuoka.jp +saigawa.fukuoka.jp +sasaguri.fukuoka.jp +shingu.fukuoka.jp +shinyoshitomi.fukuoka.jp +shonai.fukuoka.jp +soeda.fukuoka.jp +sue.fukuoka.jp +tachiarai.fukuoka.jp +tagawa.fukuoka.jp +takata.fukuoka.jp +toho.fukuoka.jp +toyotsu.fukuoka.jp +tsuiki.fukuoka.jp +ukiha.fukuoka.jp +umi.fukuoka.jp +usui.fukuoka.jp +yamada.fukuoka.jp +yame.fukuoka.jp +yanagawa.fukuoka.jp +yukuhashi.fukuoka.jp +aizubange.fukushima.jp +aizumisato.fukushima.jp +aizuwakamatsu.fukushima.jp +asakawa.fukushima.jp +bandai.fukushima.jp +date.fukushima.jp +fukushima.fukushima.jp +furudono.fukushima.jp +futaba.fukushima.jp +hanawa.fukushima.jp +higashi.fukushima.jp +hirata.fukushima.jp +hirono.fukushima.jp +iitate.fukushima.jp +inawashiro.fukushima.jp +ishikawa.fukushima.jp +iwaki.fukushima.jp +izumizaki.fukushima.jp +kagamiishi.fukushima.jp +kaneyama.fukushima.jp +kawamata.fukushima.jp +kitakata.fukushima.jp +kitashiobara.fukushima.jp +koori.fukushima.jp +koriyama.fukushima.jp +kunimi.fukushima.jp +miharu.fukushima.jp +mishima.fukushima.jp +namie.fukushima.jp +nango.fukushima.jp +nishiaizu.fukushima.jp +nishigo.fukushima.jp +okuma.fukushima.jp +omotego.fukushima.jp +ono.fukushima.jp +otama.fukushima.jp +samegawa.fukushima.jp +shimogo.fukushima.jp +shirakawa.fukushima.jp +showa.fukushima.jp +soma.fukushima.jp +sukagawa.fukushima.jp +taishin.fukushima.jp +tamakawa.fukushima.jp +tanagura.fukushima.jp +tenei.fukushima.jp +yabuki.fukushima.jp +yamato.fukushima.jp +yamatsuri.fukushima.jp +yanaizu.fukushima.jp +yugawa.fukushima.jp +anpachi.gifu.jp +ena.gifu.jp +gifu.gifu.jp +ginan.gifu.jp +godo.gifu.jp +gujo.gifu.jp +hashima.gifu.jp +hichiso.gifu.jp +hida.gifu.jp +higashishirakawa.gifu.jp +ibigawa.gifu.jp +ikeda.gifu.jp +kakamigahara.gifu.jp +kani.gifu.jp +kasahara.gifu.jp +kasamatsu.gifu.jp +kawaue.gifu.jp +kitagata.gifu.jp +mino.gifu.jp +minokamo.gifu.jp +mitake.gifu.jp +mizunami.gifu.jp +motosu.gifu.jp +nakatsugawa.gifu.jp +ogaki.gifu.jp +sakahogi.gifu.jp +seki.gifu.jp +sekigahara.gifu.jp +shirakawa.gifu.jp +tajimi.gifu.jp +takayama.gifu.jp +tarui.gifu.jp +toki.gifu.jp +tomika.gifu.jp +wanouchi.gifu.jp +yamagata.gifu.jp +yaotsu.gifu.jp +yoro.gifu.jp +annaka.gunma.jp +chiyoda.gunma.jp +fujioka.gunma.jp +higashiagatsuma.gunma.jp +isesaki.gunma.jp +itakura.gunma.jp +kanna.gunma.jp +kanra.gunma.jp +katashina.gunma.jp +kawaba.gunma.jp +kiryu.gunma.jp +kusatsu.gunma.jp +maebashi.gunma.jp +meiwa.gunma.jp +midori.gunma.jp +minakami.gunma.jp +naganohara.gunma.jp +nakanojo.gunma.jp +nanmoku.gunma.jp +numata.gunma.jp +oizumi.gunma.jp +ora.gunma.jp +ota.gunma.jp +shibukawa.gunma.jp +shimonita.gunma.jp +shinto.gunma.jp +showa.gunma.jp +takasaki.gunma.jp +takayama.gunma.jp +tamamura.gunma.jp +tatebayashi.gunma.jp +tomioka.gunma.jp +tsukiyono.gunma.jp +tsumagoi.gunma.jp +ueno.gunma.jp +yoshioka.gunma.jp +asaminami.hiroshima.jp +daiwa.hiroshima.jp +etajima.hiroshima.jp +fuchu.hiroshima.jp +fukuyama.hiroshima.jp +hatsukaichi.hiroshima.jp +higashihiroshima.hiroshima.jp +hongo.hiroshima.jp +jinsekikogen.hiroshima.jp +kaita.hiroshima.jp +kui.hiroshima.jp +kumano.hiroshima.jp +kure.hiroshima.jp +mihara.hiroshima.jp +miyoshi.hiroshima.jp +naka.hiroshima.jp +onomichi.hiroshima.jp +osakikamijima.hiroshima.jp +otake.hiroshima.jp +saka.hiroshima.jp +sera.hiroshima.jp +seranishi.hiroshima.jp +shinichi.hiroshima.jp +shobara.hiroshima.jp +takehara.hiroshima.jp +abashiri.hokkaido.jp +abira.hokkaido.jp +aibetsu.hokkaido.jp +akabira.hokkaido.jp +akkeshi.hokkaido.jp +asahikawa.hokkaido.jp +ashibetsu.hokkaido.jp +ashoro.hokkaido.jp +assabu.hokkaido.jp +atsuma.hokkaido.jp +bibai.hokkaido.jp +biei.hokkaido.jp +bifuka.hokkaido.jp +bihoro.hokkaido.jp +biratori.hokkaido.jp +chippubetsu.hokkaido.jp +chitose.hokkaido.jp +date.hokkaido.jp +ebetsu.hokkaido.jp +embetsu.hokkaido.jp +eniwa.hokkaido.jp +erimo.hokkaido.jp +esan.hokkaido.jp +esashi.hokkaido.jp +fukagawa.hokkaido.jp +fukushima.hokkaido.jp +furano.hokkaido.jp +furubira.hokkaido.jp +haboro.hokkaido.jp +hakodate.hokkaido.jp +hamatonbetsu.hokkaido.jp +hidaka.hokkaido.jp +higashikagura.hokkaido.jp +higashikawa.hokkaido.jp +hiroo.hokkaido.jp +hokuryu.hokkaido.jp +hokuto.hokkaido.jp +honbetsu.hokkaido.jp +horokanai.hokkaido.jp +horonobe.hokkaido.jp +ikeda.hokkaido.jp +imakane.hokkaido.jp +ishikari.hokkaido.jp +iwamizawa.hokkaido.jp +iwanai.hokkaido.jp +kamifurano.hokkaido.jp +kamikawa.hokkaido.jp +kamishihoro.hokkaido.jp +kamisunagawa.hokkaido.jp +kamoenai.hokkaido.jp +kayabe.hokkaido.jp +kembuchi.hokkaido.jp +kikonai.hokkaido.jp +kimobetsu.hokkaido.jp +kitahiroshima.hokkaido.jp +kitami.hokkaido.jp +kiyosato.hokkaido.jp +koshimizu.hokkaido.jp +kunneppu.hokkaido.jp +kuriyama.hokkaido.jp +kuromatsunai.hokkaido.jp +kushiro.hokkaido.jp +kutchan.hokkaido.jp +kyowa.hokkaido.jp +mashike.hokkaido.jp +matsumae.hokkaido.jp +mikasa.hokkaido.jp +minamifurano.hokkaido.jp +mombetsu.hokkaido.jp +moseushi.hokkaido.jp +mukawa.hokkaido.jp +muroran.hokkaido.jp +naie.hokkaido.jp +nakagawa.hokkaido.jp +nakasatsunai.hokkaido.jp +nakatombetsu.hokkaido.jp +nanae.hokkaido.jp +nanporo.hokkaido.jp +nayoro.hokkaido.jp +nemuro.hokkaido.jp +niikappu.hokkaido.jp +niki.hokkaido.jp +nishiokoppe.hokkaido.jp +noboribetsu.hokkaido.jp +numata.hokkaido.jp +obihiro.hokkaido.jp +obira.hokkaido.jp +oketo.hokkaido.jp +okoppe.hokkaido.jp +otaru.hokkaido.jp +otobe.hokkaido.jp +otofuke.hokkaido.jp +otoineppu.hokkaido.jp +oumu.hokkaido.jp +ozora.hokkaido.jp +pippu.hokkaido.jp +rankoshi.hokkaido.jp +rebun.hokkaido.jp +rikubetsu.hokkaido.jp +rishiri.hokkaido.jp +rishirifuji.hokkaido.jp +saroma.hokkaido.jp +sarufutsu.hokkaido.jp +shakotan.hokkaido.jp +shari.hokkaido.jp +shibecha.hokkaido.jp +shibetsu.hokkaido.jp +shikabe.hokkaido.jp +shikaoi.hokkaido.jp +shimamaki.hokkaido.jp +shimizu.hokkaido.jp +shimokawa.hokkaido.jp +shinshinotsu.hokkaido.jp +shintoku.hokkaido.jp +shiranuka.hokkaido.jp +shiraoi.hokkaido.jp +shiriuchi.hokkaido.jp +sobetsu.hokkaido.jp +sunagawa.hokkaido.jp +taiki.hokkaido.jp +takasu.hokkaido.jp +takikawa.hokkaido.jp +takinoue.hokkaido.jp +teshikaga.hokkaido.jp +tobetsu.hokkaido.jp +tohma.hokkaido.jp +tomakomai.hokkaido.jp +tomari.hokkaido.jp +toya.hokkaido.jp +toyako.hokkaido.jp +toyotomi.hokkaido.jp +toyoura.hokkaido.jp +tsubetsu.hokkaido.jp +tsukigata.hokkaido.jp +urakawa.hokkaido.jp +urausu.hokkaido.jp +uryu.hokkaido.jp +utashinai.hokkaido.jp +wakkanai.hokkaido.jp +wassamu.hokkaido.jp +yakumo.hokkaido.jp +yoichi.hokkaido.jp +aioi.hyogo.jp +akashi.hyogo.jp +ako.hyogo.jp +amagasaki.hyogo.jp +aogaki.hyogo.jp +asago.hyogo.jp +ashiya.hyogo.jp +awaji.hyogo.jp +fukusaki.hyogo.jp +goshiki.hyogo.jp +harima.hyogo.jp +himeji.hyogo.jp +ichikawa.hyogo.jp +inagawa.hyogo.jp +itami.hyogo.jp +kakogawa.hyogo.jp +kamigori.hyogo.jp +kamikawa.hyogo.jp +kasai.hyogo.jp +kasuga.hyogo.jp +kawanishi.hyogo.jp +miki.hyogo.jp +minamiawaji.hyogo.jp +nishinomiya.hyogo.jp +nishiwaki.hyogo.jp +ono.hyogo.jp +sanda.hyogo.jp +sannan.hyogo.jp +sasayama.hyogo.jp +sayo.hyogo.jp +shingu.hyogo.jp +shinonsen.hyogo.jp +shiso.hyogo.jp +sumoto.hyogo.jp +taishi.hyogo.jp +taka.hyogo.jp +takarazuka.hyogo.jp +takasago.hyogo.jp +takino.hyogo.jp +tamba.hyogo.jp +tatsuno.hyogo.jp +toyooka.hyogo.jp +yabu.hyogo.jp +yashiro.hyogo.jp +yoka.hyogo.jp +yokawa.hyogo.jp +ami.ibaraki.jp +asahi.ibaraki.jp +bando.ibaraki.jp +chikusei.ibaraki.jp +daigo.ibaraki.jp +fujishiro.ibaraki.jp +hitachi.ibaraki.jp +hitachinaka.ibaraki.jp +hitachiomiya.ibaraki.jp +hitachiota.ibaraki.jp +ibaraki.ibaraki.jp +ina.ibaraki.jp +inashiki.ibaraki.jp +itako.ibaraki.jp +iwama.ibaraki.jp +joso.ibaraki.jp +kamisu.ibaraki.jp +kasama.ibaraki.jp +kashima.ibaraki.jp +kasumigaura.ibaraki.jp +koga.ibaraki.jp +miho.ibaraki.jp +mito.ibaraki.jp +moriya.ibaraki.jp +naka.ibaraki.jp +namegata.ibaraki.jp +oarai.ibaraki.jp +ogawa.ibaraki.jp +omitama.ibaraki.jp +ryugasaki.ibaraki.jp +sakai.ibaraki.jp +sakuragawa.ibaraki.jp +shimodate.ibaraki.jp +shimotsuma.ibaraki.jp +shirosato.ibaraki.jp +sowa.ibaraki.jp +suifu.ibaraki.jp +takahagi.ibaraki.jp +tamatsukuri.ibaraki.jp +tokai.ibaraki.jp +tomobe.ibaraki.jp +tone.ibaraki.jp +toride.ibaraki.jp +tsuchiura.ibaraki.jp +tsukuba.ibaraki.jp +uchihara.ibaraki.jp +ushiku.ibaraki.jp +yachiyo.ibaraki.jp +yamagata.ibaraki.jp +yawara.ibaraki.jp +yuki.ibaraki.jp +anamizu.ishikawa.jp +hakui.ishikawa.jp +hakusan.ishikawa.jp +kaga.ishikawa.jp +kahoku.ishikawa.jp +kanazawa.ishikawa.jp +kawakita.ishikawa.jp +komatsu.ishikawa.jp +nakanoto.ishikawa.jp +nanao.ishikawa.jp +nomi.ishikawa.jp +nonoichi.ishikawa.jp +noto.ishikawa.jp +shika.ishikawa.jp +suzu.ishikawa.jp +tsubata.ishikawa.jp +tsurugi.ishikawa.jp +uchinada.ishikawa.jp +wajima.ishikawa.jp +fudai.iwate.jp +fujisawa.iwate.jp +hanamaki.iwate.jp +hiraizumi.iwate.jp +hirono.iwate.jp +ichinohe.iwate.jp +ichinoseki.iwate.jp +iwaizumi.iwate.jp +iwate.iwate.jp +joboji.iwate.jp +kamaishi.iwate.jp +kanegasaki.iwate.jp +karumai.iwate.jp +kawai.iwate.jp +kitakami.iwate.jp +kuji.iwate.jp +kunohe.iwate.jp +kuzumaki.iwate.jp +miyako.iwate.jp +mizusawa.iwate.jp +morioka.iwate.jp +ninohe.iwate.jp +noda.iwate.jp +ofunato.iwate.jp +oshu.iwate.jp +otsuchi.iwate.jp +rikuzentakata.iwate.jp +shiwa.iwate.jp +shizukuishi.iwate.jp +sumita.iwate.jp +tanohata.iwate.jp +tono.iwate.jp +yahaba.iwate.jp +yamada.iwate.jp +ayagawa.kagawa.jp +higashikagawa.kagawa.jp +kanonji.kagawa.jp +kotohira.kagawa.jp +manno.kagawa.jp +marugame.kagawa.jp +mitoyo.kagawa.jp +naoshima.kagawa.jp +sanuki.kagawa.jp +tadotsu.kagawa.jp +takamatsu.kagawa.jp +tonosho.kagawa.jp +uchinomi.kagawa.jp +utazu.kagawa.jp +zentsuji.kagawa.jp +akune.kagoshima.jp +amami.kagoshima.jp +hioki.kagoshima.jp +isa.kagoshima.jp +isen.kagoshima.jp +izumi.kagoshima.jp +kagoshima.kagoshima.jp +kanoya.kagoshima.jp +kawanabe.kagoshima.jp +kinko.kagoshima.jp +kouyama.kagoshima.jp +makurazaki.kagoshima.jp +matsumoto.kagoshima.jp +minamitane.kagoshima.jp +nakatane.kagoshima.jp +nishinoomote.kagoshima.jp +satsumasendai.kagoshima.jp +soo.kagoshima.jp +tarumizu.kagoshima.jp +yusui.kagoshima.jp +aikawa.kanagawa.jp +atsugi.kanagawa.jp +ayase.kanagawa.jp +chigasaki.kanagawa.jp +ebina.kanagawa.jp +fujisawa.kanagawa.jp +hadano.kanagawa.jp +hakone.kanagawa.jp +hiratsuka.kanagawa.jp +isehara.kanagawa.jp +kaisei.kanagawa.jp +kamakura.kanagawa.jp +kiyokawa.kanagawa.jp +matsuda.kanagawa.jp +minamiashigara.kanagawa.jp +miura.kanagawa.jp +nakai.kanagawa.jp +ninomiya.kanagawa.jp +odawara.kanagawa.jp +oi.kanagawa.jp +oiso.kanagawa.jp +sagamihara.kanagawa.jp +samukawa.kanagawa.jp +tsukui.kanagawa.jp +yamakita.kanagawa.jp +yamato.kanagawa.jp +yokosuka.kanagawa.jp +yugawara.kanagawa.jp +zama.kanagawa.jp +zushi.kanagawa.jp +aki.kochi.jp +geisei.kochi.jp +hidaka.kochi.jp +higashitsuno.kochi.jp +ino.kochi.jp +kagami.kochi.jp +kami.kochi.jp +kitagawa.kochi.jp +kochi.kochi.jp +mihara.kochi.jp +motoyama.kochi.jp +muroto.kochi.jp +nahari.kochi.jp +nakamura.kochi.jp +nankoku.kochi.jp +nishitosa.kochi.jp +niyodogawa.kochi.jp +ochi.kochi.jp +okawa.kochi.jp +otoyo.kochi.jp +otsuki.kochi.jp +sakawa.kochi.jp +sukumo.kochi.jp +susaki.kochi.jp +tosa.kochi.jp +tosashimizu.kochi.jp +toyo.kochi.jp +tsuno.kochi.jp +umaji.kochi.jp +yasuda.kochi.jp +yusuhara.kochi.jp +amakusa.kumamoto.jp +arao.kumamoto.jp +aso.kumamoto.jp +choyo.kumamoto.jp +gyokuto.kumamoto.jp +kamiamakusa.kumamoto.jp +kikuchi.kumamoto.jp +kumamoto.kumamoto.jp +mashiki.kumamoto.jp +mifune.kumamoto.jp +minamata.kumamoto.jp +minamioguni.kumamoto.jp +nagasu.kumamoto.jp +nishihara.kumamoto.jp +oguni.kumamoto.jp +ozu.kumamoto.jp +sumoto.kumamoto.jp +takamori.kumamoto.jp +uki.kumamoto.jp +uto.kumamoto.jp +yamaga.kumamoto.jp +yamato.kumamoto.jp +yatsushiro.kumamoto.jp +ayabe.kyoto.jp +fukuchiyama.kyoto.jp +higashiyama.kyoto.jp +ide.kyoto.jp +ine.kyoto.jp +joyo.kyoto.jp +kameoka.kyoto.jp +kamo.kyoto.jp +kita.kyoto.jp +kizu.kyoto.jp +kumiyama.kyoto.jp +kyotamba.kyoto.jp +kyotanabe.kyoto.jp +kyotango.kyoto.jp +maizuru.kyoto.jp +minami.kyoto.jp +minamiyamashiro.kyoto.jp +miyazu.kyoto.jp +muko.kyoto.jp +nagaokakyo.kyoto.jp +nakagyo.kyoto.jp +nantan.kyoto.jp +oyamazaki.kyoto.jp +sakyo.kyoto.jp +seika.kyoto.jp +tanabe.kyoto.jp +uji.kyoto.jp +ujitawara.kyoto.jp +wazuka.kyoto.jp +yamashina.kyoto.jp +yawata.kyoto.jp +asahi.mie.jp +inabe.mie.jp +ise.mie.jp +kameyama.mie.jp +kawagoe.mie.jp +kiho.mie.jp +kisosaki.mie.jp +kiwa.mie.jp +komono.mie.jp +kumano.mie.jp +kuwana.mie.jp +matsusaka.mie.jp +meiwa.mie.jp +mihama.mie.jp +minamiise.mie.jp +misugi.mie.jp +miyama.mie.jp +nabari.mie.jp +shima.mie.jp +suzuka.mie.jp +tado.mie.jp +taiki.mie.jp +taki.mie.jp +tamaki.mie.jp +toba.mie.jp +tsu.mie.jp +udono.mie.jp +ureshino.mie.jp +watarai.mie.jp +yokkaichi.mie.jp +furukawa.miyagi.jp +higashimatsushima.miyagi.jp +ishinomaki.miyagi.jp +iwanuma.miyagi.jp +kakuda.miyagi.jp +kami.miyagi.jp +kawasaki.miyagi.jp +marumori.miyagi.jp +matsushima.miyagi.jp +minamisanriku.miyagi.jp +misato.miyagi.jp +murata.miyagi.jp +natori.miyagi.jp +ogawara.miyagi.jp +ohira.miyagi.jp +onagawa.miyagi.jp +osaki.miyagi.jp +rifu.miyagi.jp +semine.miyagi.jp +shibata.miyagi.jp +shichikashuku.miyagi.jp +shikama.miyagi.jp +shiogama.miyagi.jp +shiroishi.miyagi.jp +tagajo.miyagi.jp +taiwa.miyagi.jp +tome.miyagi.jp +tomiya.miyagi.jp +wakuya.miyagi.jp +watari.miyagi.jp +yamamoto.miyagi.jp +zao.miyagi.jp +aya.miyazaki.jp +ebino.miyazaki.jp +gokase.miyazaki.jp +hyuga.miyazaki.jp +kadogawa.miyazaki.jp +kawaminami.miyazaki.jp +kijo.miyazaki.jp +kitagawa.miyazaki.jp +kitakata.miyazaki.jp +kitaura.miyazaki.jp +kobayashi.miyazaki.jp +kunitomi.miyazaki.jp +kushima.miyazaki.jp +mimata.miyazaki.jp +miyakonojo.miyazaki.jp +miyazaki.miyazaki.jp +morotsuka.miyazaki.jp +nichinan.miyazaki.jp +nishimera.miyazaki.jp +nobeoka.miyazaki.jp +saito.miyazaki.jp +shiiba.miyazaki.jp +shintomi.miyazaki.jp +takaharu.miyazaki.jp +takanabe.miyazaki.jp +takazaki.miyazaki.jp +tsuno.miyazaki.jp +achi.nagano.jp +agematsu.nagano.jp +anan.nagano.jp +aoki.nagano.jp +asahi.nagano.jp +azumino.nagano.jp +chikuhoku.nagano.jp +chikuma.nagano.jp +chino.nagano.jp +fujimi.nagano.jp +hakuba.nagano.jp +hara.nagano.jp +hiraya.nagano.jp +iida.nagano.jp +iijima.nagano.jp +iiyama.nagano.jp +iizuna.nagano.jp +ikeda.nagano.jp +ikusaka.nagano.jp +ina.nagano.jp +karuizawa.nagano.jp +kawakami.nagano.jp +kiso.nagano.jp +kisofukushima.nagano.jp +kitaaiki.nagano.jp +komagane.nagano.jp +komoro.nagano.jp +matsukawa.nagano.jp +matsumoto.nagano.jp +miasa.nagano.jp +minamiaiki.nagano.jp +minamimaki.nagano.jp +minamiminowa.nagano.jp +minowa.nagano.jp +miyada.nagano.jp +miyota.nagano.jp +mochizuki.nagano.jp +nagano.nagano.jp +nagawa.nagano.jp +nagiso.nagano.jp +nakagawa.nagano.jp +nakano.nagano.jp +nozawaonsen.nagano.jp +obuse.nagano.jp +ogawa.nagano.jp +okaya.nagano.jp +omachi.nagano.jp +omi.nagano.jp +ookuwa.nagano.jp +ooshika.nagano.jp +otaki.nagano.jp +otari.nagano.jp +sakae.nagano.jp +sakaki.nagano.jp +saku.nagano.jp +sakuho.nagano.jp +shimosuwa.nagano.jp +shinanomachi.nagano.jp +shiojiri.nagano.jp +suwa.nagano.jp +suzaka.nagano.jp +takagi.nagano.jp +takamori.nagano.jp +takayama.nagano.jp +tateshina.nagano.jp +tatsuno.nagano.jp +togakushi.nagano.jp +togura.nagano.jp +tomi.nagano.jp +ueda.nagano.jp +wada.nagano.jp +yamagata.nagano.jp +yamanouchi.nagano.jp +yasaka.nagano.jp +yasuoka.nagano.jp +chijiwa.nagasaki.jp +futsu.nagasaki.jp +goto.nagasaki.jp +hasami.nagasaki.jp +hirado.nagasaki.jp +iki.nagasaki.jp +isahaya.nagasaki.jp +kawatana.nagasaki.jp +kuchinotsu.nagasaki.jp +matsuura.nagasaki.jp +nagasaki.nagasaki.jp +obama.nagasaki.jp +omura.nagasaki.jp +oseto.nagasaki.jp +saikai.nagasaki.jp +sasebo.nagasaki.jp +seihi.nagasaki.jp +shimabara.nagasaki.jp +shinkamigoto.nagasaki.jp +togitsu.nagasaki.jp +tsushima.nagasaki.jp +unzen.nagasaki.jp +ando.nara.jp +gose.nara.jp +heguri.nara.jp +higashiyoshino.nara.jp +ikaruga.nara.jp +ikoma.nara.jp +kamikitayama.nara.jp +kanmaki.nara.jp +kashiba.nara.jp +kashihara.nara.jp +katsuragi.nara.jp +kawai.nara.jp +kawakami.nara.jp +kawanishi.nara.jp +koryo.nara.jp +kurotaki.nara.jp +mitsue.nara.jp +miyake.nara.jp +nara.nara.jp +nosegawa.nara.jp +oji.nara.jp +ouda.nara.jp +oyodo.nara.jp +sakurai.nara.jp +sango.nara.jp +shimoichi.nara.jp +shimokitayama.nara.jp +shinjo.nara.jp +soni.nara.jp +takatori.nara.jp +tawaramoto.nara.jp +tenkawa.nara.jp +tenri.nara.jp +uda.nara.jp +yamatokoriyama.nara.jp +yamatotakada.nara.jp +yamazoe.nara.jp +yoshino.nara.jp +aga.niigata.jp +agano.niigata.jp +gosen.niigata.jp +itoigawa.niigata.jp +izumozaki.niigata.jp +joetsu.niigata.jp +kamo.niigata.jp +kariwa.niigata.jp +kashiwazaki.niigata.jp +minamiuonuma.niigata.jp +mitsuke.niigata.jp +muika.niigata.jp +murakami.niigata.jp +myoko.niigata.jp +nagaoka.niigata.jp +niigata.niigata.jp +ojiya.niigata.jp +omi.niigata.jp +sado.niigata.jp +sanjo.niigata.jp +seiro.niigata.jp +seirou.niigata.jp +sekikawa.niigata.jp +shibata.niigata.jp +tagami.niigata.jp +tainai.niigata.jp +tochio.niigata.jp +tokamachi.niigata.jp +tsubame.niigata.jp +tsunan.niigata.jp +uonuma.niigata.jp +yahiko.niigata.jp +yoita.niigata.jp +yuzawa.niigata.jp +beppu.oita.jp +bungoono.oita.jp +bungotakada.oita.jp +hasama.oita.jp +hiji.oita.jp +himeshima.oita.jp +hita.oita.jp +kamitsue.oita.jp +kokonoe.oita.jp +kuju.oita.jp +kunisaki.oita.jp +kusu.oita.jp +oita.oita.jp +saiki.oita.jp +taketa.oita.jp +tsukumi.oita.jp +usa.oita.jp +usuki.oita.jp +yufu.oita.jp +akaiwa.okayama.jp +asakuchi.okayama.jp +bizen.okayama.jp +hayashima.okayama.jp +ibara.okayama.jp +kagamino.okayama.jp +kasaoka.okayama.jp +kibichuo.okayama.jp +kumenan.okayama.jp +kurashiki.okayama.jp +maniwa.okayama.jp +misaki.okayama.jp +nagi.okayama.jp +niimi.okayama.jp +nishiawakura.okayama.jp +okayama.okayama.jp +satosho.okayama.jp +setouchi.okayama.jp +shinjo.okayama.jp +shoo.okayama.jp +soja.okayama.jp +takahashi.okayama.jp +tamano.okayama.jp +tsuyama.okayama.jp +wake.okayama.jp +yakage.okayama.jp +aguni.okinawa.jp +ginowan.okinawa.jp +ginoza.okinawa.jp +gushikami.okinawa.jp +haebaru.okinawa.jp +higashi.okinawa.jp +hirara.okinawa.jp +iheya.okinawa.jp +ishigaki.okinawa.jp +ishikawa.okinawa.jp +itoman.okinawa.jp +izena.okinawa.jp +kadena.okinawa.jp +kin.okinawa.jp +kitadaito.okinawa.jp +kitanakagusuku.okinawa.jp +kumejima.okinawa.jp +kunigami.okinawa.jp +minamidaito.okinawa.jp +motobu.okinawa.jp +nago.okinawa.jp +naha.okinawa.jp +nakagusuku.okinawa.jp +nakijin.okinawa.jp +nanjo.okinawa.jp +nishihara.okinawa.jp +ogimi.okinawa.jp +okinawa.okinawa.jp +onna.okinawa.jp +shimoji.okinawa.jp +taketomi.okinawa.jp +tarama.okinawa.jp +tokashiki.okinawa.jp +tomigusuku.okinawa.jp +tonaki.okinawa.jp +urasoe.okinawa.jp +uruma.okinawa.jp +yaese.okinawa.jp +yomitan.okinawa.jp +yonabaru.okinawa.jp +yonaguni.okinawa.jp +zamami.okinawa.jp +abeno.osaka.jp +chihayaakasaka.osaka.jp +chuo.osaka.jp +daito.osaka.jp +fujiidera.osaka.jp +habikino.osaka.jp +hannan.osaka.jp +higashiosaka.osaka.jp +higashisumiyoshi.osaka.jp +higashiyodogawa.osaka.jp +hirakata.osaka.jp +ibaraki.osaka.jp +ikeda.osaka.jp +izumi.osaka.jp +izumiotsu.osaka.jp +izumisano.osaka.jp +kadoma.osaka.jp +kaizuka.osaka.jp +kanan.osaka.jp +kashiwara.osaka.jp +katano.osaka.jp +kawachinagano.osaka.jp +kishiwada.osaka.jp +kita.osaka.jp +kumatori.osaka.jp +matsubara.osaka.jp +minato.osaka.jp +minoh.osaka.jp +misaki.osaka.jp +moriguchi.osaka.jp +neyagawa.osaka.jp +nishi.osaka.jp +nose.osaka.jp +osakasayama.osaka.jp +sakai.osaka.jp +sayama.osaka.jp +sennan.osaka.jp +settsu.osaka.jp +shijonawate.osaka.jp +shimamoto.osaka.jp +suita.osaka.jp +tadaoka.osaka.jp +taishi.osaka.jp +tajiri.osaka.jp +takaishi.osaka.jp +takatsuki.osaka.jp +tondabayashi.osaka.jp +toyonaka.osaka.jp +toyono.osaka.jp +yao.osaka.jp +ariake.saga.jp +arita.saga.jp +fukudomi.saga.jp +genkai.saga.jp +hamatama.saga.jp +hizen.saga.jp +imari.saga.jp +kamimine.saga.jp +kanzaki.saga.jp +karatsu.saga.jp +kashima.saga.jp +kitagata.saga.jp +kitahata.saga.jp +kiyama.saga.jp +kouhoku.saga.jp +kyuragi.saga.jp +nishiarita.saga.jp +ogi.saga.jp +omachi.saga.jp +ouchi.saga.jp +saga.saga.jp +shiroishi.saga.jp +taku.saga.jp +tara.saga.jp +tosu.saga.jp +yoshinogari.saga.jp +arakawa.saitama.jp +asaka.saitama.jp +chichibu.saitama.jp +fujimi.saitama.jp +fujimino.saitama.jp +fukaya.saitama.jp +hanno.saitama.jp +hanyu.saitama.jp +hasuda.saitama.jp +hatogaya.saitama.jp +hatoyama.saitama.jp +hidaka.saitama.jp +higashichichibu.saitama.jp +higashimatsuyama.saitama.jp +honjo.saitama.jp +ina.saitama.jp +iruma.saitama.jp +iwatsuki.saitama.jp +kamiizumi.saitama.jp +kamikawa.saitama.jp +kamisato.saitama.jp +kasukabe.saitama.jp +kawagoe.saitama.jp +kawaguchi.saitama.jp +kawajima.saitama.jp +kazo.saitama.jp +kitamoto.saitama.jp +koshigaya.saitama.jp +kounosu.saitama.jp +kuki.saitama.jp +kumagaya.saitama.jp +matsubushi.saitama.jp +minano.saitama.jp +misato.saitama.jp +miyashiro.saitama.jp +miyoshi.saitama.jp +moroyama.saitama.jp +nagatoro.saitama.jp +namegawa.saitama.jp +niiza.saitama.jp +ogano.saitama.jp +ogawa.saitama.jp +ogose.saitama.jp +okegawa.saitama.jp +omiya.saitama.jp +otaki.saitama.jp +ranzan.saitama.jp +ryokami.saitama.jp +saitama.saitama.jp +sakado.saitama.jp +satte.saitama.jp +sayama.saitama.jp +shiki.saitama.jp +shiraoka.saitama.jp +soka.saitama.jp +sugito.saitama.jp +toda.saitama.jp +tokigawa.saitama.jp +tokorozawa.saitama.jp +tsurugashima.saitama.jp +urawa.saitama.jp +warabi.saitama.jp +yashio.saitama.jp +yokoze.saitama.jp +yono.saitama.jp +yorii.saitama.jp +yoshida.saitama.jp +yoshikawa.saitama.jp +yoshimi.saitama.jp +aisho.shiga.jp +gamo.shiga.jp +higashiomi.shiga.jp +hikone.shiga.jp +koka.shiga.jp +konan.shiga.jp +kosei.shiga.jp +koto.shiga.jp +kusatsu.shiga.jp +maibara.shiga.jp +moriyama.shiga.jp +nagahama.shiga.jp +nishiazai.shiga.jp +notogawa.shiga.jp +omihachiman.shiga.jp +otsu.shiga.jp +ritto.shiga.jp +ryuoh.shiga.jp +takashima.shiga.jp +takatsuki.shiga.jp +torahime.shiga.jp +toyosato.shiga.jp +yasu.shiga.jp +akagi.shimane.jp +ama.shimane.jp +gotsu.shimane.jp +hamada.shimane.jp +higashiizumo.shimane.jp +hikawa.shimane.jp +hikimi.shimane.jp +izumo.shimane.jp +kakinoki.shimane.jp +masuda.shimane.jp +matsue.shimane.jp +misato.shimane.jp +nishinoshima.shimane.jp +ohda.shimane.jp +okinoshima.shimane.jp +okuizumo.shimane.jp +shimane.shimane.jp +tamayu.shimane.jp +tsuwano.shimane.jp +unnan.shimane.jp +yakumo.shimane.jp +yasugi.shimane.jp +yatsuka.shimane.jp +arai.shizuoka.jp +atami.shizuoka.jp +fuji.shizuoka.jp +fujieda.shizuoka.jp +fujikawa.shizuoka.jp +fujinomiya.shizuoka.jp +fukuroi.shizuoka.jp +gotemba.shizuoka.jp +haibara.shizuoka.jp +hamamatsu.shizuoka.jp +higashiizu.shizuoka.jp +ito.shizuoka.jp +iwata.shizuoka.jp +izu.shizuoka.jp +izunokuni.shizuoka.jp +kakegawa.shizuoka.jp +kannami.shizuoka.jp +kawanehon.shizuoka.jp +kawazu.shizuoka.jp +kikugawa.shizuoka.jp +kosai.shizuoka.jp +makinohara.shizuoka.jp +matsuzaki.shizuoka.jp +minamiizu.shizuoka.jp +mishima.shizuoka.jp +morimachi.shizuoka.jp +nishiizu.shizuoka.jp +numazu.shizuoka.jp +omaezaki.shizuoka.jp +shimada.shizuoka.jp +shimizu.shizuoka.jp +shimoda.shizuoka.jp +shizuoka.shizuoka.jp +susono.shizuoka.jp +yaizu.shizuoka.jp +yoshida.shizuoka.jp +ashikaga.tochigi.jp +bato.tochigi.jp +haga.tochigi.jp +ichikai.tochigi.jp +iwafune.tochigi.jp +kaminokawa.tochigi.jp +kanuma.tochigi.jp +karasuyama.tochigi.jp +kuroiso.tochigi.jp +mashiko.tochigi.jp +mibu.tochigi.jp +moka.tochigi.jp +motegi.tochigi.jp +nasu.tochigi.jp +nasushiobara.tochigi.jp +nikko.tochigi.jp +nishikata.tochigi.jp +nogi.tochigi.jp +ohira.tochigi.jp +ohtawara.tochigi.jp +oyama.tochigi.jp +sakura.tochigi.jp +sano.tochigi.jp +shimotsuke.tochigi.jp +shioya.tochigi.jp +takanezawa.tochigi.jp +tochigi.tochigi.jp +tsuga.tochigi.jp +ujiie.tochigi.jp +utsunomiya.tochigi.jp +yaita.tochigi.jp +aizumi.tokushima.jp +anan.tokushima.jp +ichiba.tokushima.jp +itano.tokushima.jp +kainan.tokushima.jp +komatsushima.tokushima.jp +matsushige.tokushima.jp +mima.tokushima.jp +minami.tokushima.jp +miyoshi.tokushima.jp +mugi.tokushima.jp +nakagawa.tokushima.jp +naruto.tokushima.jp +sanagochi.tokushima.jp +shishikui.tokushima.jp +tokushima.tokushima.jp +wajiki.tokushima.jp +adachi.tokyo.jp +akiruno.tokyo.jp +akishima.tokyo.jp +aogashima.tokyo.jp +arakawa.tokyo.jp +bunkyo.tokyo.jp +chiyoda.tokyo.jp +chofu.tokyo.jp +chuo.tokyo.jp +edogawa.tokyo.jp +fuchu.tokyo.jp +fussa.tokyo.jp +hachijo.tokyo.jp +hachioji.tokyo.jp +hamura.tokyo.jp +higashikurume.tokyo.jp +higashimurayama.tokyo.jp +higashiyamato.tokyo.jp +hino.tokyo.jp +hinode.tokyo.jp +hinohara.tokyo.jp +inagi.tokyo.jp +itabashi.tokyo.jp +katsushika.tokyo.jp +kita.tokyo.jp +kiyose.tokyo.jp +kodaira.tokyo.jp +koganei.tokyo.jp +kokubunji.tokyo.jp +komae.tokyo.jp +koto.tokyo.jp +kouzushima.tokyo.jp +kunitachi.tokyo.jp +machida.tokyo.jp +meguro.tokyo.jp +minato.tokyo.jp +mitaka.tokyo.jp +mizuho.tokyo.jp +musashimurayama.tokyo.jp +musashino.tokyo.jp +nakano.tokyo.jp +nerima.tokyo.jp +ogasawara.tokyo.jp +okutama.tokyo.jp +ome.tokyo.jp +oshima.tokyo.jp +ota.tokyo.jp +setagaya.tokyo.jp +shibuya.tokyo.jp +shinagawa.tokyo.jp +shinjuku.tokyo.jp +suginami.tokyo.jp +sumida.tokyo.jp +tachikawa.tokyo.jp +taito.tokyo.jp +tama.tokyo.jp +toshima.tokyo.jp +chizu.tottori.jp +hino.tottori.jp +kawahara.tottori.jp +koge.tottori.jp +kotoura.tottori.jp +misasa.tottori.jp +nanbu.tottori.jp +nichinan.tottori.jp +sakaiminato.tottori.jp +tottori.tottori.jp +wakasa.tottori.jp +yazu.tottori.jp +yonago.tottori.jp +asahi.toyama.jp +fuchu.toyama.jp +fukumitsu.toyama.jp +funahashi.toyama.jp +himi.toyama.jp +imizu.toyama.jp +inami.toyama.jp +johana.toyama.jp +kamiichi.toyama.jp +kurobe.toyama.jp +nakaniikawa.toyama.jp +namerikawa.toyama.jp +nanto.toyama.jp +nyuzen.toyama.jp +oyabe.toyama.jp +taira.toyama.jp +takaoka.toyama.jp +tateyama.toyama.jp +toga.toyama.jp +tonami.toyama.jp +toyama.toyama.jp +unazuki.toyama.jp +uozu.toyama.jp +yamada.toyama.jp +arida.wakayama.jp +aridagawa.wakayama.jp +gobo.wakayama.jp +hashimoto.wakayama.jp +hidaka.wakayama.jp +hirogawa.wakayama.jp +inami.wakayama.jp +iwade.wakayama.jp +kainan.wakayama.jp +kamitonda.wakayama.jp +katsuragi.wakayama.jp +kimino.wakayama.jp +kinokawa.wakayama.jp +kitayama.wakayama.jp +koya.wakayama.jp +koza.wakayama.jp +kozagawa.wakayama.jp +kudoyama.wakayama.jp +kushimoto.wakayama.jp +mihama.wakayama.jp +misato.wakayama.jp +nachikatsuura.wakayama.jp +shingu.wakayama.jp +shirahama.wakayama.jp +taiji.wakayama.jp +tanabe.wakayama.jp +wakayama.wakayama.jp +yuasa.wakayama.jp +yura.wakayama.jp +asahi.yamagata.jp +funagata.yamagata.jp +higashine.yamagata.jp +iide.yamagata.jp +kahoku.yamagata.jp +kaminoyama.yamagata.jp +kaneyama.yamagata.jp +kawanishi.yamagata.jp +mamurogawa.yamagata.jp +mikawa.yamagata.jp +murayama.yamagata.jp +nagai.yamagata.jp +nakayama.yamagata.jp +nanyo.yamagata.jp +nishikawa.yamagata.jp +obanazawa.yamagata.jp +oe.yamagata.jp +oguni.yamagata.jp +ohkura.yamagata.jp +oishida.yamagata.jp +sagae.yamagata.jp +sakata.yamagata.jp +sakegawa.yamagata.jp +shinjo.yamagata.jp +shirataka.yamagata.jp +shonai.yamagata.jp +takahata.yamagata.jp +tendo.yamagata.jp +tozawa.yamagata.jp +tsuruoka.yamagata.jp +yamagata.yamagata.jp +yamanobe.yamagata.jp +yonezawa.yamagata.jp +yuza.yamagata.jp +abu.yamaguchi.jp +hagi.yamaguchi.jp +hikari.yamaguchi.jp +hofu.yamaguchi.jp +iwakuni.yamaguchi.jp +kudamatsu.yamaguchi.jp +mitou.yamaguchi.jp +nagato.yamaguchi.jp +oshima.yamaguchi.jp +shimonoseki.yamaguchi.jp +shunan.yamaguchi.jp +tabuse.yamaguchi.jp +tokuyama.yamaguchi.jp +toyota.yamaguchi.jp +ube.yamaguchi.jp +yuu.yamaguchi.jp +chuo.yamanashi.jp +doshi.yamanashi.jp +fuefuki.yamanashi.jp +fujikawa.yamanashi.jp +fujikawaguchiko.yamanashi.jp +fujiyoshida.yamanashi.jp +hayakawa.yamanashi.jp +hokuto.yamanashi.jp +ichikawamisato.yamanashi.jp +kai.yamanashi.jp +kofu.yamanashi.jp +koshu.yamanashi.jp +kosuge.yamanashi.jp +minami-alps.yamanashi.jp +minobu.yamanashi.jp +nakamichi.yamanashi.jp +nanbu.yamanashi.jp +narusawa.yamanashi.jp +nirasaki.yamanashi.jp +nishikatsura.yamanashi.jp +oshino.yamanashi.jp +otsuki.yamanashi.jp +showa.yamanashi.jp +tabayama.yamanashi.jp +tsuru.yamanashi.jp +uenohara.yamanashi.jp +yamanakako.yamanashi.jp +yamanashi.yamanashi.jp + +// ke : http://www.kenic.or.ke/index.php/en/ke-domains/ke-domains +ke +ac.ke +co.ke +go.ke +info.ke +me.ke +mobi.ke +ne.ke +or.ke +sc.ke + +// kg : http://www.domain.kg/dmn_n.html +kg +org.kg +net.kg +com.kg +edu.kg +gov.kg +mil.kg + +// kh : http://www.mptc.gov.kh/dns_registration.htm +*.kh + +// ki : http://www.ki/dns/index.html +ki +edu.ki +biz.ki +net.ki +org.ki +gov.ki +info.ki +com.ki + +// km : https://en.wikipedia.org/wiki/.km +// http://www.domaine.km/documents/charte.doc +km +org.km +nom.km +gov.km +prd.km +tm.km +edu.km +mil.km +ass.km +com.km +// These are only mentioned as proposed suggestions at domaine.km, but +// https://en.wikipedia.org/wiki/.km says they're available for registration: +coop.km +asso.km +presse.km +medecin.km +notaires.km +pharmaciens.km +veterinaire.km +gouv.km + +// kn : https://en.wikipedia.org/wiki/.kn +// http://www.dot.kn/domainRules.html +kn +net.kn +org.kn +edu.kn +gov.kn + +// kp : http://www.kcce.kp/en_index.php +kp +com.kp +edu.kp +gov.kp +org.kp +rep.kp +tra.kp + +// kr : https://en.wikipedia.org/wiki/.kr +// see also: http://domain.nida.or.kr/eng/registration.jsp +kr +ac.kr +co.kr +es.kr +go.kr +hs.kr +kg.kr +mil.kr +ms.kr +ne.kr +or.kr +pe.kr +re.kr +sc.kr +// kr geographical names +busan.kr +chungbuk.kr +chungnam.kr +daegu.kr +daejeon.kr +gangwon.kr +gwangju.kr +gyeongbuk.kr +gyeonggi.kr +gyeongnam.kr +incheon.kr +jeju.kr +jeonbuk.kr +jeonnam.kr +seoul.kr +ulsan.kr + +// kw : https://www.nic.kw/policies/ +// Confirmed by registry +kw +com.kw +edu.kw +emb.kw +gov.kw +ind.kw +net.kw +org.kw + +// ky : http://www.icta.ky/da_ky_reg_dom.php +// Confirmed by registry 2008-06-17 +ky +edu.ky +gov.ky +com.ky +org.ky +net.ky + +// kz : https://en.wikipedia.org/wiki/.kz +// see also: http://www.nic.kz/rules/index.jsp +kz +org.kz +edu.kz +net.kz +gov.kz +mil.kz +com.kz + +// la : https://en.wikipedia.org/wiki/.la +// Submitted by registry +la +int.la +net.la +info.la +edu.la +gov.la +per.la +com.la +org.la + +// lb : https://en.wikipedia.org/wiki/.lb +// Submitted by registry +lb +com.lb +edu.lb +gov.lb +net.lb +org.lb + +// lc : https://en.wikipedia.org/wiki/.lc +// see also: http://www.nic.lc/rules.htm +lc +com.lc +net.lc +co.lc +org.lc +edu.lc +gov.lc + +// li : https://en.wikipedia.org/wiki/.li +li + +// lk : http://www.nic.lk/seclevpr.html +lk +gov.lk +sch.lk +net.lk +int.lk +com.lk +org.lk +edu.lk +ngo.lk +soc.lk +web.lk +ltd.lk +assn.lk +grp.lk +hotel.lk +ac.lk + +// lr : http://psg.com/dns/lr/lr.txt +// Submitted by registry +lr +com.lr +edu.lr +gov.lr +org.lr +net.lr + +// ls : http://www.nic.ls/ +// Confirmed by registry +ls +ac.ls +biz.ls +co.ls +edu.ls +gov.ls +info.ls +net.ls +org.ls +sc.ls + +// lt : https://en.wikipedia.org/wiki/.lt +lt +// gov.lt : http://www.gov.lt/index_en.php +gov.lt + +// lu : http://www.dns.lu/en/ +lu + +// lv : http://www.nic.lv/DNS/En/generic.php +lv +com.lv +edu.lv +gov.lv +org.lv +mil.lv +id.lv +net.lv +asn.lv +conf.lv + +// ly : http://www.nic.ly/regulations.php +ly +com.ly +net.ly +gov.ly +plc.ly +edu.ly +sch.ly +med.ly +org.ly +id.ly + +// ma : https://en.wikipedia.org/wiki/.ma +// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf +ma +co.ma +net.ma +gov.ma +org.ma +ac.ma +press.ma + +// mc : http://www.nic.mc/ +mc +tm.mc +asso.mc + +// md : https://en.wikipedia.org/wiki/.md +md + +// me : https://en.wikipedia.org/wiki/.me +me +co.me +net.me +org.me +edu.me +ac.me +gov.me +its.me +priv.me + +// mg : http://nic.mg/nicmg/?page_id=39 +mg +org.mg +nom.mg +gov.mg +prd.mg +tm.mg +edu.mg +mil.mg +com.mg +co.mg + +// mh : https://en.wikipedia.org/wiki/.mh +mh + +// mil : https://en.wikipedia.org/wiki/.mil +mil + +// mk : https://en.wikipedia.org/wiki/.mk +// see also: http://dns.marnet.net.mk/postapka.php +mk +com.mk +org.mk +net.mk +edu.mk +gov.mk +inf.mk +name.mk + +// ml : http://www.gobin.info/domainname/ml-template.doc +// see also: https://en.wikipedia.org/wiki/.ml +ml +com.ml +edu.ml +gouv.ml +gov.ml +net.ml +org.ml +presse.ml + +// mm : https://en.wikipedia.org/wiki/.mm +*.mm + +// mn : https://en.wikipedia.org/wiki/.mn +mn +gov.mn +edu.mn +org.mn + +// mo : http://www.monic.net.mo/ +mo +com.mo +net.mo +org.mo +edu.mo +gov.mo + +// mobi : https://en.wikipedia.org/wiki/.mobi +mobi + +// mp : http://www.dot.mp/ +// Confirmed by registry 2008-06-17 +mp + +// mq : https://en.wikipedia.org/wiki/.mq +mq + +// mr : https://en.wikipedia.org/wiki/.mr +mr +gov.mr + +// ms : http://www.nic.ms/pdf/MS_Domain_Name_Rules.pdf +ms +com.ms +edu.ms +gov.ms +net.ms +org.ms + +// mt : https://www.nic.org.mt/go/policy +// Submitted by registry +mt +com.mt +edu.mt +net.mt +org.mt + +// mu : https://en.wikipedia.org/wiki/.mu +mu +com.mu +net.mu +org.mu +gov.mu +ac.mu +co.mu +or.mu + +// museum : http://about.museum/naming/ +// http://index.museum/ +museum +academy.museum +agriculture.museum +air.museum +airguard.museum +alabama.museum +alaska.museum +amber.museum +ambulance.museum +american.museum +americana.museum +americanantiques.museum +americanart.museum +amsterdam.museum +and.museum +annefrank.museum +anthro.museum +anthropology.museum +antiques.museum +aquarium.museum +arboretum.museum +archaeological.museum +archaeology.museum +architecture.museum +art.museum +artanddesign.museum +artcenter.museum +artdeco.museum +arteducation.museum +artgallery.museum +arts.museum +artsandcrafts.museum +asmatart.museum +assassination.museum +assisi.museum +association.museum +astronomy.museum +atlanta.museum +austin.museum +australia.museum +automotive.museum +aviation.museum +axis.museum +badajoz.museum +baghdad.museum +bahn.museum +bale.museum +baltimore.museum +barcelona.museum +baseball.museum +basel.museum +baths.museum +bauern.museum +beauxarts.museum +beeldengeluid.museum +bellevue.museum +bergbau.museum +berkeley.museum +berlin.museum +bern.museum +bible.museum +bilbao.museum +bill.museum +birdart.museum +birthplace.museum +bonn.museum +boston.museum +botanical.museum +botanicalgarden.museum +botanicgarden.museum +botany.museum +brandywinevalley.museum +brasil.museum +bristol.museum +british.museum +britishcolumbia.museum +broadcast.museum +brunel.museum +brussel.museum +brussels.museum +bruxelles.museum +building.museum +burghof.museum +bus.museum +bushey.museum +cadaques.museum +california.museum +cambridge.museum +can.museum +canada.museum +capebreton.museum +carrier.museum +cartoonart.museum +casadelamoneda.museum +castle.museum +castres.museum +celtic.museum +center.museum +chattanooga.museum +cheltenham.museum +chesapeakebay.museum +chicago.museum +children.museum +childrens.museum +childrensgarden.museum +chiropractic.museum +chocolate.museum +christiansburg.museum +cincinnati.museum +cinema.museum +circus.museum +civilisation.museum +civilization.museum +civilwar.museum +clinton.museum +clock.museum +coal.museum +coastaldefence.museum +cody.museum +coldwar.museum +collection.museum +colonialwilliamsburg.museum +coloradoplateau.museum +columbia.museum +columbus.museum +communication.museum +communications.museum +community.museum +computer.museum +computerhistory.museum +comunicações.museum +contemporary.museum +contemporaryart.museum +convent.museum +copenhagen.museum +corporation.museum +correios-e-telecomunicações.museum +corvette.museum +costume.museum +countryestate.museum +county.museum +crafts.museum +cranbrook.museum +creation.museum +cultural.museum +culturalcenter.museum +culture.museum +cyber.museum +cymru.museum +dali.museum +dallas.museum +database.museum +ddr.museum +decorativearts.museum +delaware.museum +delmenhorst.museum +denmark.museum +depot.museum +design.museum +detroit.museum +dinosaur.museum +discovery.museum +dolls.museum +donostia.museum +durham.museum +eastafrica.museum +eastcoast.museum +education.museum +educational.museum +egyptian.museum +eisenbahn.museum +elburg.museum +elvendrell.museum +embroidery.museum +encyclopedic.museum +england.museum +entomology.museum +environment.museum +environmentalconservation.museum +epilepsy.museum +essex.museum +estate.museum +ethnology.museum +exeter.museum +exhibition.museum +family.museum +farm.museum +farmequipment.museum +farmers.museum +farmstead.museum +field.museum +figueres.museum +filatelia.museum +film.museum +fineart.museum +finearts.museum +finland.museum +flanders.museum +florida.museum +force.museum +fortmissoula.museum +fortworth.museum +foundation.museum +francaise.museum +frankfurt.museum +franziskaner.museum +freemasonry.museum +freiburg.museum +fribourg.museum +frog.museum +fundacio.museum +furniture.museum +gallery.museum +garden.museum +gateway.museum +geelvinck.museum +gemological.museum +geology.museum +georgia.museum +giessen.museum +glas.museum +glass.museum +gorge.museum +grandrapids.museum +graz.museum +guernsey.museum +halloffame.museum +hamburg.museum +handson.museum +harvestcelebration.museum +hawaii.museum +health.museum +heimatunduhren.museum +hellas.museum +helsinki.museum +hembygdsforbund.museum +heritage.museum +histoire.museum +historical.museum +historicalsociety.museum +historichouses.museum +historisch.museum +historisches.museum +history.museum +historyofscience.museum +horology.museum +house.museum +humanities.museum +illustration.museum +imageandsound.museum +indian.museum +indiana.museum +indianapolis.museum +indianmarket.museum +intelligence.museum +interactive.museum +iraq.museum +iron.museum +isleofman.museum +jamison.museum +jefferson.museum +jerusalem.museum +jewelry.museum +jewish.museum +jewishart.museum +jfk.museum +journalism.museum +judaica.museum +judygarland.museum +juedisches.museum +juif.museum +karate.museum +karikatur.museum +kids.museum +koebenhavn.museum +koeln.museum +kunst.museum +kunstsammlung.museum +kunstunddesign.museum +labor.museum +labour.museum +lajolla.museum +lancashire.museum +landes.museum +lans.museum +läns.museum +larsson.museum +lewismiller.museum +lincoln.museum +linz.museum +living.museum +livinghistory.museum +localhistory.museum +london.museum +losangeles.museum +louvre.museum +loyalist.museum +lucerne.museum +luxembourg.museum +luzern.museum +mad.museum +madrid.museum +mallorca.museum +manchester.museum +mansion.museum +mansions.museum +manx.museum +marburg.museum +maritime.museum +maritimo.museum +maryland.museum +marylhurst.museum +media.museum +medical.museum +medizinhistorisches.museum +meeres.museum +memorial.museum +mesaverde.museum +michigan.museum +midatlantic.museum +military.museum +mill.museum +miners.museum +mining.museum +minnesota.museum +missile.museum +missoula.museum +modern.museum +moma.museum +money.museum +monmouth.museum +monticello.museum +montreal.museum +moscow.museum +motorcycle.museum +muenchen.museum +muenster.museum +mulhouse.museum +muncie.museum +museet.museum +museumcenter.museum +museumvereniging.museum +music.museum +national.museum +nationalfirearms.museum +nationalheritage.museum +nativeamerican.museum +naturalhistory.museum +naturalhistorymuseum.museum +naturalsciences.museum +nature.museum +naturhistorisches.museum +natuurwetenschappen.museum +naumburg.museum +naval.museum +nebraska.museum +neues.museum +newhampshire.museum +newjersey.museum +newmexico.museum +newport.museum +newspaper.museum +newyork.museum +niepce.museum +norfolk.museum +north.museum +nrw.museum +nuernberg.museum +nuremberg.museum +nyc.museum +nyny.museum +oceanographic.museum +oceanographique.museum +omaha.museum +online.museum +ontario.museum +openair.museum +oregon.museum +oregontrail.museum +otago.museum +oxford.museum +pacific.museum +paderborn.museum +palace.museum +paleo.museum +palmsprings.museum +panama.museum +paris.museum +pasadena.museum +pharmacy.museum +philadelphia.museum +philadelphiaarea.museum +philately.museum +phoenix.museum +photography.museum +pilots.museum +pittsburgh.museum +planetarium.museum +plantation.museum +plants.museum +plaza.museum +portal.museum +portland.museum +portlligat.museum +posts-and-telecommunications.museum +preservation.museum +presidio.museum +press.museum +project.museum +public.museum +pubol.museum +quebec.museum +railroad.museum +railway.museum +research.museum +resistance.museum +riodejaneiro.museum +rochester.museum +rockart.museum +roma.museum +russia.museum +saintlouis.museum +salem.museum +salvadordali.museum +salzburg.museum +sandiego.museum +sanfrancisco.museum +santabarbara.museum +santacruz.museum +santafe.museum +saskatchewan.museum +satx.museum +savannahga.museum +schlesisches.museum +schoenbrunn.museum +schokoladen.museum +school.museum +schweiz.museum +science.museum +scienceandhistory.museum +scienceandindustry.museum +sciencecenter.museum +sciencecenters.museum +science-fiction.museum +sciencehistory.museum +sciences.museum +sciencesnaturelles.museum +scotland.museum +seaport.museum +settlement.museum +settlers.museum +shell.museum +sherbrooke.museum +sibenik.museum +silk.museum +ski.museum +skole.museum +society.museum +sologne.museum +soundandvision.museum +southcarolina.museum +southwest.museum +space.museum +spy.museum +square.museum +stadt.museum +stalbans.museum +starnberg.museum +state.museum +stateofdelaware.museum +station.museum +steam.museum +steiermark.museum +stjohn.museum +stockholm.museum +stpetersburg.museum +stuttgart.museum +suisse.museum +surgeonshall.museum +surrey.museum +svizzera.museum +sweden.museum +sydney.museum +tank.museum +tcm.museum +technology.museum +telekommunikation.museum +television.museum +texas.museum +textile.museum +theater.museum +time.museum +timekeeping.museum +topology.museum +torino.museum +touch.museum +town.museum +transport.museum +tree.museum +trolley.museum +trust.museum +trustee.museum +uhren.museum +ulm.museum +undersea.museum +university.museum +usa.museum +usantiques.museum +usarts.museum +uscountryestate.museum +usculture.museum +usdecorativearts.museum +usgarden.museum +ushistory.museum +ushuaia.museum +uslivinghistory.museum +utah.museum +uvic.museum +valley.museum +vantaa.museum +versailles.museum +viking.museum +village.museum +virginia.museum +virtual.museum +virtuel.museum +vlaanderen.museum +volkenkunde.museum +wales.museum +wallonie.museum +war.museum +washingtondc.museum +watchandclock.museum +watch-and-clock.museum +western.museum +westfalen.museum +whaling.museum +wildlife.museum +williamsburg.museum +windmill.museum +workshop.museum +york.museum +yorkshire.museum +yosemite.museum +youth.museum +zoological.museum +zoology.museum +ירושלים.museum +иком.museum + +// mv : https://en.wikipedia.org/wiki/.mv +// "mv" included because, contra Wikipedia, google.mv exists. +mv +aero.mv +biz.mv +com.mv +coop.mv +edu.mv +gov.mv +info.mv +int.mv +mil.mv +museum.mv +name.mv +net.mv +org.mv +pro.mv + +// mw : http://www.registrar.mw/ +mw +ac.mw +biz.mw +co.mw +com.mw +coop.mw +edu.mw +gov.mw +int.mw +museum.mw +net.mw +org.mw + +// mx : http://www.nic.mx/ +// Submitted by registry +mx +com.mx +org.mx +gob.mx +edu.mx +net.mx + +// my : http://www.mynic.net.my/ +my +com.my +net.my +org.my +gov.my +edu.my +mil.my +name.my + +// mz : http://www.uem.mz/ +// Submitted by registry +mz +ac.mz +adv.mz +co.mz +edu.mz +gov.mz +mil.mz +net.mz +org.mz + +// na : http://www.na-nic.com.na/ +// http://www.info.na/domain/ +na +info.na +pro.na +name.na +school.na +or.na +dr.na +us.na +mx.na +ca.na +in.na +cc.na +tv.na +ws.na +mobi.na +co.na +com.na +org.na + +// name : has 2nd-level tlds, but there's no list of them +name + +// nc : http://www.cctld.nc/ +nc +asso.nc +nom.nc + +// ne : https://en.wikipedia.org/wiki/.ne +ne + +// net : https://en.wikipedia.org/wiki/.net +net + +// nf : https://en.wikipedia.org/wiki/.nf +nf +com.nf +net.nf +per.nf +rec.nf +web.nf +arts.nf +firm.nf +info.nf +other.nf +store.nf + +// ng : http://www.nira.org.ng/index.php/join-us/register-ng-domain/189-nira-slds +ng +com.ng +edu.ng +gov.ng +i.ng +mil.ng +mobi.ng +name.ng +net.ng +org.ng +sch.ng + +// ni : http://www.nic.ni/ +ni +ac.ni +biz.ni +co.ni +com.ni +edu.ni +gob.ni +in.ni +info.ni +int.ni +mil.ni +net.ni +nom.ni +org.ni +web.ni + +// nl : https://en.wikipedia.org/wiki/.nl +// https://www.sidn.nl/ +// ccTLD for the Netherlands +nl + +// no : http://www.norid.no/regelverk/index.en.html +// The Norwegian registry has declined to notify us of updates. The web pages +// referenced below are the official source of the data. There is also an +// announce mailing list: +// https://postlister.uninett.no/sympa/info/norid-diskusjon +no +// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html +fhs.no +vgs.no +fylkesbibl.no +folkebibl.no +museum.no +idrett.no +priv.no +// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html +mil.no +stat.no +dep.no +kommune.no +herad.no +// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html +// counties +aa.no +ah.no +bu.no +fm.no +hl.no +hm.no +jan-mayen.no +mr.no +nl.no +nt.no +of.no +ol.no +oslo.no +rl.no +sf.no +st.no +svalbard.no +tm.no +tr.no +va.no +vf.no +// primary and lower secondary schools per county +gs.aa.no +gs.ah.no +gs.bu.no +gs.fm.no +gs.hl.no +gs.hm.no +gs.jan-mayen.no +gs.mr.no +gs.nl.no +gs.nt.no +gs.of.no +gs.ol.no +gs.oslo.no +gs.rl.no +gs.sf.no +gs.st.no +gs.svalbard.no +gs.tm.no +gs.tr.no +gs.va.no +gs.vf.no +// cities +akrehamn.no +åkrehamn.no +algard.no +ålgård.no +arna.no +brumunddal.no +bryne.no +bronnoysund.no +brønnøysund.no +drobak.no +drøbak.no +egersund.no +fetsund.no +floro.no +florø.no +fredrikstad.no +hokksund.no +honefoss.no +hønefoss.no +jessheim.no +jorpeland.no +jørpeland.no +kirkenes.no +kopervik.no +krokstadelva.no +langevag.no +langevåg.no +leirvik.no +mjondalen.no +mjøndalen.no +mo-i-rana.no +mosjoen.no +mosjøen.no +nesoddtangen.no +orkanger.no +osoyro.no +osøyro.no +raholt.no +råholt.no +sandnessjoen.no +sandnessjøen.no +skedsmokorset.no +slattum.no +spjelkavik.no +stathelle.no +stavern.no +stjordalshalsen.no +stjørdalshalsen.no +tananger.no +tranby.no +vossevangen.no +// communities +afjord.no +åfjord.no +agdenes.no +al.no +ål.no +alesund.no +ålesund.no +alstahaug.no +alta.no +áltá.no +alaheadju.no +álaheadju.no +alvdal.no +amli.no +åmli.no +amot.no +åmot.no +andebu.no +andoy.no +andøy.no +andasuolo.no +ardal.no +årdal.no +aremark.no +arendal.no +ås.no +aseral.no +åseral.no +asker.no +askim.no +askvoll.no +askoy.no +askøy.no +asnes.no +åsnes.no +audnedaln.no +aukra.no +aure.no +aurland.no +aurskog-holand.no +aurskog-høland.no +austevoll.no +austrheim.no +averoy.no +averøy.no +balestrand.no +ballangen.no +balat.no +bálát.no +balsfjord.no +bahccavuotna.no +báhccavuotna.no +bamble.no +bardu.no +beardu.no +beiarn.no +bajddar.no +bájddar.no +baidar.no +báidár.no +berg.no +bergen.no +berlevag.no +berlevåg.no +bearalvahki.no +bearalváhki.no +bindal.no +birkenes.no +bjarkoy.no +bjarkøy.no +bjerkreim.no +bjugn.no +bodo.no +bodø.no +badaddja.no +bådåddjå.no +budejju.no +bokn.no +bremanger.no +bronnoy.no +brønnøy.no +bygland.no +bykle.no +barum.no +bærum.no +bo.telemark.no +bø.telemark.no +bo.nordland.no +bø.nordland.no +bievat.no +bievát.no +bomlo.no +bømlo.no +batsfjord.no +båtsfjord.no +bahcavuotna.no +báhcavuotna.no +dovre.no +drammen.no +drangedal.no +dyroy.no +dyrøy.no +donna.no +dønna.no +eid.no +eidfjord.no +eidsberg.no +eidskog.no +eidsvoll.no +eigersund.no +elverum.no +enebakk.no +engerdal.no +etne.no +etnedal.no +evenes.no +evenassi.no +evenášši.no +evje-og-hornnes.no +farsund.no +fauske.no +fuossko.no +fuoisku.no +fedje.no +fet.no +finnoy.no +finnøy.no +fitjar.no +fjaler.no +fjell.no +flakstad.no +flatanger.no +flekkefjord.no +flesberg.no +flora.no +fla.no +flå.no +folldal.no +forsand.no +fosnes.no +frei.no +frogn.no +froland.no +frosta.no +frana.no +fræna.no +froya.no +frøya.no +fusa.no +fyresdal.no +forde.no +førde.no +gamvik.no +gangaviika.no +gáŋgaviika.no +gaular.no +gausdal.no +gildeskal.no +gildeskål.no +giske.no +gjemnes.no +gjerdrum.no +gjerstad.no +gjesdal.no +gjovik.no +gjøvik.no +gloppen.no +gol.no +gran.no +grane.no +granvin.no +gratangen.no +grimstad.no +grong.no +kraanghke.no +kråanghke.no +grue.no +gulen.no +hadsel.no +halden.no +halsa.no +hamar.no +hamaroy.no +habmer.no +hábmer.no +hapmir.no +hápmir.no +hammerfest.no +hammarfeasta.no +hámmárfeasta.no +haram.no +hareid.no +harstad.no +hasvik.no +aknoluokta.no +ákŋoluokta.no +hattfjelldal.no +aarborte.no +haugesund.no +hemne.no +hemnes.no +hemsedal.no +heroy.more-og-romsdal.no +herøy.møre-og-romsdal.no +heroy.nordland.no +herøy.nordland.no +hitra.no +hjartdal.no +hjelmeland.no +hobol.no +hobøl.no +hof.no +hol.no +hole.no +holmestrand.no +holtalen.no +holtålen.no +hornindal.no +horten.no +hurdal.no +hurum.no +hvaler.no +hyllestad.no +hagebostad.no +hægebostad.no +hoyanger.no +høyanger.no +hoylandet.no +høylandet.no +ha.no +hå.no +ibestad.no +inderoy.no +inderøy.no +iveland.no +jevnaker.no +jondal.no +jolster.no +jølster.no +karasjok.no +karasjohka.no +kárášjohka.no +karlsoy.no +galsa.no +gálsá.no +karmoy.no +karmøy.no +kautokeino.no +guovdageaidnu.no +klepp.no +klabu.no +klæbu.no +kongsberg.no +kongsvinger.no +kragero.no +kragerø.no +kristiansand.no +kristiansund.no +krodsherad.no +krødsherad.no +kvalsund.no +rahkkeravju.no +ráhkkerávju.no +kvam.no +kvinesdal.no +kvinnherad.no +kviteseid.no +kvitsoy.no +kvitsøy.no +kvafjord.no +kvæfjord.no +giehtavuoatna.no +kvanangen.no +kvænangen.no +navuotna.no +návuotna.no +kafjord.no +kåfjord.no +gaivuotna.no +gáivuotna.no +larvik.no +lavangen.no +lavagis.no +loabat.no +loabát.no +lebesby.no +davvesiida.no +leikanger.no +leirfjord.no +leka.no +leksvik.no +lenvik.no +leangaviika.no +leaŋgaviika.no +lesja.no +levanger.no +lier.no +lierne.no +lillehammer.no +lillesand.no +lindesnes.no +lindas.no +lindås.no +lom.no +loppa.no +lahppi.no +láhppi.no +lund.no +lunner.no +luroy.no +lurøy.no +luster.no +lyngdal.no +lyngen.no +ivgu.no +lardal.no +lerdal.no +lærdal.no +lodingen.no +lødingen.no +lorenskog.no +lørenskog.no +loten.no +løten.no +malvik.no +masoy.no +måsøy.no +muosat.no +muosát.no +mandal.no +marker.no +marnardal.no +masfjorden.no +meland.no +meldal.no +melhus.no +meloy.no +meløy.no +meraker.no +meråker.no +moareke.no +moåreke.no +midsund.no +midtre-gauldal.no +modalen.no +modum.no +molde.no +moskenes.no +moss.no +mosvik.no +malselv.no +målselv.no +malatvuopmi.no +málatvuopmi.no +namdalseid.no +aejrie.no +namsos.no +namsskogan.no +naamesjevuemie.no +nååmesjevuemie.no +laakesvuemie.no +nannestad.no +narvik.no +narviika.no +naustdal.no +nedre-eiker.no +nes.akershus.no +nes.buskerud.no +nesna.no +nesodden.no +nesseby.no +unjarga.no +unjárga.no +nesset.no +nissedal.no +nittedal.no +nord-aurdal.no +nord-fron.no +nord-odal.no +norddal.no +nordkapp.no +davvenjarga.no +davvenjárga.no +nordre-land.no +nordreisa.no +raisa.no +ráisa.no +nore-og-uvdal.no +notodden.no +naroy.no +nærøy.no +notteroy.no +nøtterøy.no +odda.no +oksnes.no +øksnes.no +oppdal.no +oppegard.no +oppegård.no +orkdal.no +orland.no +ørland.no +orskog.no +ørskog.no +orsta.no +ørsta.no +os.hedmark.no +os.hordaland.no +osen.no +osteroy.no +osterøy.no +ostre-toten.no +østre-toten.no +overhalla.no +ovre-eiker.no +øvre-eiker.no +oyer.no +øyer.no +oygarden.no +øygarden.no +oystre-slidre.no +øystre-slidre.no +porsanger.no +porsangu.no +porsáŋgu.no +porsgrunn.no +radoy.no +radøy.no +rakkestad.no +rana.no +ruovat.no +randaberg.no +rauma.no +rendalen.no +rennebu.no +rennesoy.no +rennesøy.no +rindal.no +ringebu.no +ringerike.no +ringsaker.no +rissa.no +risor.no +risør.no +roan.no +rollag.no +rygge.no +ralingen.no +rælingen.no +rodoy.no +rødøy.no +romskog.no +rømskog.no +roros.no +røros.no +rost.no +røst.no +royken.no +røyken.no +royrvik.no +røyrvik.no +rade.no +råde.no +salangen.no +siellak.no +saltdal.no +salat.no +sálát.no +sálat.no +samnanger.no +sande.more-og-romsdal.no +sande.møre-og-romsdal.no +sande.vestfold.no +sandefjord.no +sandnes.no +sandoy.no +sandøy.no +sarpsborg.no +sauda.no +sauherad.no +sel.no +selbu.no +selje.no +seljord.no +sigdal.no +siljan.no +sirdal.no +skaun.no +skedsmo.no +ski.no +skien.no +skiptvet.no +skjervoy.no +skjervøy.no +skierva.no +skiervá.no +skjak.no +skjåk.no +skodje.no +skanland.no +skånland.no +skanit.no +skánit.no +smola.no +smøla.no +snillfjord.no +snasa.no +snåsa.no +snoasa.no +snaase.no +snåase.no +sogndal.no +sokndal.no +sola.no +solund.no +songdalen.no +sortland.no +spydeberg.no +stange.no +stavanger.no +steigen.no +steinkjer.no +stjordal.no +stjørdal.no +stokke.no +stor-elvdal.no +stord.no +stordal.no +storfjord.no +omasvuotna.no +strand.no +stranda.no +stryn.no +sula.no +suldal.no +sund.no +sunndal.no +surnadal.no +sveio.no +svelvik.no +sykkylven.no +sogne.no +søgne.no +somna.no +sømna.no +sondre-land.no +søndre-land.no +sor-aurdal.no +sør-aurdal.no +sor-fron.no +sør-fron.no +sor-odal.no +sør-odal.no +sor-varanger.no +sør-varanger.no +matta-varjjat.no +mátta-várjjat.no +sorfold.no +sørfold.no +sorreisa.no +sørreisa.no +sorum.no +sørum.no +tana.no +deatnu.no +time.no +tingvoll.no +tinn.no +tjeldsund.no +dielddanuorri.no +tjome.no +tjøme.no +tokke.no +tolga.no +torsken.no +tranoy.no +tranøy.no +tromso.no +tromsø.no +tromsa.no +romsa.no +trondheim.no +troandin.no +trysil.no +trana.no +træna.no +trogstad.no +trøgstad.no +tvedestrand.no +tydal.no +tynset.no +tysfjord.no +divtasvuodna.no +divttasvuotna.no +tysnes.no +tysvar.no +tysvær.no +tonsberg.no +tønsberg.no +ullensaker.no +ullensvang.no +ulvik.no +utsira.no +vadso.no +vadsø.no +cahcesuolo.no +čáhcesuolo.no +vaksdal.no +valle.no +vang.no +vanylven.no +vardo.no +vardø.no +varggat.no +várggát.no +vefsn.no +vaapste.no +vega.no +vegarshei.no +vegårshei.no +vennesla.no +verdal.no +verran.no +vestby.no +vestnes.no +vestre-slidre.no +vestre-toten.no +vestvagoy.no +vestvågøy.no +vevelstad.no +vik.no +vikna.no +vindafjord.no +volda.no +voss.no +varoy.no +værøy.no +vagan.no +vågan.no +voagat.no +vagsoy.no +vågsøy.no +vaga.no +vågå.no +valer.ostfold.no +våler.østfold.no +valer.hedmark.no +våler.hedmark.no + +// np : http://www.mos.com.np/register.html +*.np + +// nr : http://cenpac.net.nr/dns/index.html +// Submitted by registry +nr +biz.nr +info.nr +gov.nr +edu.nr +org.nr +net.nr +com.nr + +// nu : https://en.wikipedia.org/wiki/.nu +nu + +// nz : https://en.wikipedia.org/wiki/.nz +// Submitted by registry +nz +ac.nz +co.nz +cri.nz +geek.nz +gen.nz +govt.nz +health.nz +iwi.nz +kiwi.nz +maori.nz +mil.nz +māori.nz +net.nz +org.nz +parliament.nz +school.nz + +// om : https://en.wikipedia.org/wiki/.om +om +co.om +com.om +edu.om +gov.om +med.om +museum.om +net.om +org.om +pro.om + +// onion : https://tools.ietf.org/html/rfc7686 +onion + +// org : https://en.wikipedia.org/wiki/.org +org + +// pa : http://www.nic.pa/ +// Some additional second level "domains" resolve directly as hostnames, such as +// pannet.pa, so we add a rule for "pa". +pa +ac.pa +gob.pa +com.pa +org.pa +sld.pa +edu.pa +net.pa +ing.pa +abo.pa +med.pa +nom.pa + +// pe : https://www.nic.pe/InformeFinalComision.pdf +pe +edu.pe +gob.pe +nom.pe +mil.pe +org.pe +com.pe +net.pe + +// pf : http://www.gobin.info/domainname/formulaire-pf.pdf +pf +com.pf +org.pf +edu.pf + +// pg : https://en.wikipedia.org/wiki/.pg +*.pg + +// ph : http://www.domains.ph/FAQ2.asp +// Submitted by registry +ph +com.ph +net.ph +org.ph +gov.ph +edu.ph +ngo.ph +mil.ph +i.ph + +// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK +pk +com.pk +net.pk +edu.pk +org.pk +fam.pk +biz.pk +web.pk +gov.pk +gob.pk +gok.pk +gon.pk +gop.pk +gos.pk +info.pk + +// pl http://www.dns.pl/english/index.html +// Submitted by registry +pl +com.pl +net.pl +org.pl +// pl functional domains (http://www.dns.pl/english/index.html) +aid.pl +agro.pl +atm.pl +auto.pl +biz.pl +edu.pl +gmina.pl +gsm.pl +info.pl +mail.pl +miasta.pl +media.pl +mil.pl +nieruchomosci.pl +nom.pl +pc.pl +powiat.pl +priv.pl +realestate.pl +rel.pl +sex.pl +shop.pl +sklep.pl +sos.pl +szkola.pl +targi.pl +tm.pl +tourism.pl +travel.pl +turystyka.pl +// Government domains +gov.pl +ap.gov.pl +ic.gov.pl +is.gov.pl +us.gov.pl +kmpsp.gov.pl +kppsp.gov.pl +kwpsp.gov.pl +psp.gov.pl +wskr.gov.pl +kwp.gov.pl +mw.gov.pl +ug.gov.pl +um.gov.pl +umig.gov.pl +ugim.gov.pl +upow.gov.pl +uw.gov.pl +starostwo.gov.pl +pa.gov.pl +po.gov.pl +psse.gov.pl +pup.gov.pl +rzgw.gov.pl +sa.gov.pl +so.gov.pl +sr.gov.pl +wsa.gov.pl +sko.gov.pl +uzs.gov.pl +wiih.gov.pl +winb.gov.pl +pinb.gov.pl +wios.gov.pl +witd.gov.pl +wzmiuw.gov.pl +piw.gov.pl +wiw.gov.pl +griw.gov.pl +wif.gov.pl +oum.gov.pl +sdn.gov.pl +zp.gov.pl +uppo.gov.pl +mup.gov.pl +wuoz.gov.pl +konsulat.gov.pl +oirm.gov.pl +// pl regional domains (http://www.dns.pl/english/index.html) +augustow.pl +babia-gora.pl +bedzin.pl +beskidy.pl +bialowieza.pl +bialystok.pl +bielawa.pl +bieszczady.pl +boleslawiec.pl +bydgoszcz.pl +bytom.pl +cieszyn.pl +czeladz.pl +czest.pl +dlugoleka.pl +elblag.pl +elk.pl +glogow.pl +gniezno.pl +gorlice.pl +grajewo.pl +ilawa.pl +jaworzno.pl +jelenia-gora.pl +jgora.pl +kalisz.pl +kazimierz-dolny.pl +karpacz.pl +kartuzy.pl +kaszuby.pl +katowice.pl +kepno.pl +ketrzyn.pl +klodzko.pl +kobierzyce.pl +kolobrzeg.pl +konin.pl +konskowola.pl +kutno.pl +lapy.pl +lebork.pl +legnica.pl +lezajsk.pl +limanowa.pl +lomza.pl +lowicz.pl +lubin.pl +lukow.pl +malbork.pl +malopolska.pl +mazowsze.pl +mazury.pl +mielec.pl +mielno.pl +mragowo.pl +naklo.pl +nowaruda.pl +nysa.pl +olawa.pl +olecko.pl +olkusz.pl +olsztyn.pl +opoczno.pl +opole.pl +ostroda.pl +ostroleka.pl +ostrowiec.pl +ostrowwlkp.pl +pila.pl +pisz.pl +podhale.pl +podlasie.pl +polkowice.pl +pomorze.pl +pomorskie.pl +prochowice.pl +pruszkow.pl +przeworsk.pl +pulawy.pl +radom.pl +rawa-maz.pl +rybnik.pl +rzeszow.pl +sanok.pl +sejny.pl +slask.pl +slupsk.pl +sosnowiec.pl +stalowa-wola.pl +skoczow.pl +starachowice.pl +stargard.pl +suwalki.pl +swidnica.pl +swiebodzin.pl +swinoujscie.pl +szczecin.pl +szczytno.pl +tarnobrzeg.pl +tgory.pl +turek.pl +tychy.pl +ustka.pl +walbrzych.pl +warmia.pl +warszawa.pl +waw.pl +wegrow.pl +wielun.pl +wlocl.pl +wloclawek.pl +wodzislaw.pl +wolomin.pl +wroclaw.pl +zachpomor.pl +zagan.pl +zarow.pl +zgora.pl +zgorzelec.pl + +// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +pm + +// pn : http://www.government.pn/PnRegistry/policies.htm +pn +gov.pn +co.pn +org.pn +edu.pn +net.pn + +// post : https://en.wikipedia.org/wiki/.post +post + +// pr : http://www.nic.pr/index.asp?f=1 +pr +com.pr +net.pr +org.pr +gov.pr +edu.pr +isla.pr +pro.pr +biz.pr +info.pr +name.pr +// these aren't mentioned on nic.pr, but on https://en.wikipedia.org/wiki/.pr +est.pr +prof.pr +ac.pr + +// pro : http://registry.pro/get-pro +pro +aaa.pro +aca.pro +acct.pro +avocat.pro +bar.pro +cpa.pro +eng.pro +jur.pro +law.pro +med.pro +recht.pro + +// ps : https://en.wikipedia.org/wiki/.ps +// http://www.nic.ps/registration/policy.html#reg +ps +edu.ps +gov.ps +sec.ps +plo.ps +com.ps +org.ps +net.ps + +// pt : http://online.dns.pt/dns/start_dns +pt +net.pt +gov.pt +org.pt +edu.pt +int.pt +publ.pt +com.pt +nome.pt + +// pw : https://en.wikipedia.org/wiki/.pw +pw +co.pw +ne.pw +or.pw +ed.pw +go.pw +belau.pw + +// py : http://www.nic.py/pautas.html#seccion_9 +// Submitted by registry +py +com.py +coop.py +edu.py +gov.py +mil.py +net.py +org.py + +// qa : http://domains.qa/en/ +qa +com.qa +edu.qa +gov.qa +mil.qa +name.qa +net.qa +org.qa +sch.qa + +// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs +re +asso.re +com.re +nom.re + +// ro : http://www.rotld.ro/ +ro +arts.ro +com.ro +firm.ro +info.ro +nom.ro +nt.ro +org.ro +rec.ro +store.ro +tm.ro +www.ro + +// rs : https://www.rnids.rs/en/domains/national-domains +rs +ac.rs +co.rs +edu.rs +gov.rs +in.rs +org.rs + +// ru : https://cctld.ru/en/domains/domens_ru/reserved/ +ru +ac.ru +edu.ru +gov.ru +int.ru +mil.ru +test.ru + +// rw : https://www.ricta.org.rw/sites/default/files/resources/registry_registrar_contract_0.pdf +rw +ac.rw +co.rw +coop.rw +gov.rw +mil.rw +net.rw +org.rw + +// sa : http://www.nic.net.sa/ +sa +com.sa +net.sa +org.sa +gov.sa +med.sa +pub.sa +edu.sa +sch.sa + +// sb : http://www.sbnic.net.sb/ +// Submitted by registry +sb +com.sb +edu.sb +gov.sb +net.sb +org.sb + +// sc : http://www.nic.sc/ +sc +com.sc +gov.sc +net.sc +org.sc +edu.sc + +// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm +// Submitted by registry +sd +com.sd +net.sd +org.sd +edu.sd +med.sd +tv.sd +gov.sd +info.sd + +// se : https://en.wikipedia.org/wiki/.se +// Submitted by registry +se +a.se +ac.se +b.se +bd.se +brand.se +c.se +d.se +e.se +f.se +fh.se +fhsk.se +fhv.se +g.se +h.se +i.se +k.se +komforb.se +kommunalforbund.se +komvux.se +l.se +lanbib.se +m.se +n.se +naturbruksgymn.se +o.se +org.se +p.se +parti.se +pp.se +press.se +r.se +s.se +t.se +tm.se +u.se +w.se +x.se +y.se +z.se + +// sg : http://www.nic.net.sg/page/registration-policies-procedures-and-guidelines +sg +com.sg +net.sg +org.sg +gov.sg +edu.sg +per.sg + +// sh : http://www.nic.sh/registrar.html +sh +com.sh +net.sh +gov.sh +org.sh +mil.sh + +// si : https://en.wikipedia.org/wiki/.si +si + +// sj : No registrations at this time. +// Submitted by registry +sj + +// sk : https://en.wikipedia.org/wiki/.sk +// list of 2nd level domains ? +sk + +// sl : http://www.nic.sl +// Submitted by registry +sl +com.sl +net.sl +edu.sl +gov.sl +org.sl + +// sm : https://en.wikipedia.org/wiki/.sm +sm + +// sn : https://en.wikipedia.org/wiki/.sn +sn +art.sn +com.sn +edu.sn +gouv.sn +org.sn +perso.sn +univ.sn + +// so : http://www.soregistry.com/ +so +com.so +net.so +org.so + +// sr : https://en.wikipedia.org/wiki/.sr +sr + +// st : http://www.nic.st/html/policyrules/ +st +co.st +com.st +consulado.st +edu.st +embaixada.st +gov.st +mil.st +net.st +org.st +principe.st +saotome.st +store.st + +// su : https://en.wikipedia.org/wiki/.su +su + +// sv : http://www.svnet.org.sv/niveldos.pdf +sv +com.sv +edu.sv +gob.sv +org.sv +red.sv + +// sx : https://en.wikipedia.org/wiki/.sx +// Submitted by registry +sx +gov.sx + +// sy : https://en.wikipedia.org/wiki/.sy +// see also: http://www.gobin.info/domainname/sy.doc +sy +edu.sy +gov.sy +net.sy +mil.sy +com.sy +org.sy + +// sz : https://en.wikipedia.org/wiki/.sz +// http://www.sispa.org.sz/ +sz +co.sz +ac.sz +org.sz + +// tc : https://en.wikipedia.org/wiki/.tc +tc + +// td : https://en.wikipedia.org/wiki/.td +td + +// tel: https://en.wikipedia.org/wiki/.tel +// http://www.telnic.org/ +tel + +// tf : https://en.wikipedia.org/wiki/.tf +tf + +// tg : https://en.wikipedia.org/wiki/.tg +// http://www.nic.tg/ +tg + +// th : https://en.wikipedia.org/wiki/.th +// Submitted by registry +th +ac.th +co.th +go.th +in.th +mi.th +net.th +or.th + +// tj : http://www.nic.tj/policy.html +tj +ac.tj +biz.tj +co.tj +com.tj +edu.tj +go.tj +gov.tj +int.tj +mil.tj +name.tj +net.tj +nic.tj +org.tj +test.tj +web.tj + +// tk : https://en.wikipedia.org/wiki/.tk +tk + +// tl : https://en.wikipedia.org/wiki/.tl +tl +gov.tl + +// tm : http://www.nic.tm/local.html +tm +com.tm +co.tm +org.tm +net.tm +nom.tm +gov.tm +mil.tm +edu.tm + +// tn : https://en.wikipedia.org/wiki/.tn +// http://whois.ati.tn/ +tn +com.tn +ens.tn +fin.tn +gov.tn +ind.tn +intl.tn +nat.tn +net.tn +org.tn +info.tn +perso.tn +tourism.tn +edunet.tn +rnrt.tn +rns.tn +rnu.tn +mincom.tn +agrinet.tn +defense.tn +turen.tn + +// to : https://en.wikipedia.org/wiki/.to +// Submitted by registry +to +com.to +gov.to +net.to +org.to +edu.to +mil.to + +// tr : https://nic.tr/ +// https://nic.tr/forms/eng/policies.pdf +// https://nic.tr/index.php?USRACTN=PRICELST +tr +av.tr +bbs.tr +bel.tr +biz.tr +com.tr +dr.tr +edu.tr +gen.tr +gov.tr +info.tr +mil.tr +k12.tr +kep.tr +name.tr +net.tr +org.tr +pol.tr +tel.tr +tsk.tr +tv.tr +web.tr +// Used by Northern Cyprus +nc.tr +// Used by government agencies of Northern Cyprus +gov.nc.tr + +// tt : http://www.nic.tt/ +tt +co.tt +com.tt +org.tt +net.tt +biz.tt +info.tt +pro.tt +int.tt +coop.tt +jobs.tt +mobi.tt +travel.tt +museum.tt +aero.tt +name.tt +gov.tt +edu.tt + +// tv : https://en.wikipedia.org/wiki/.tv +// Not listing any 2LDs as reserved since none seem to exist in practice, +// Wikipedia notwithstanding. +tv + +// tw : https://en.wikipedia.org/wiki/.tw +tw +edu.tw +gov.tw +mil.tw +com.tw +net.tw +org.tw +idv.tw +game.tw +ebiz.tw +club.tw +網路.tw +組織.tw +商業.tw + +// tz : http://www.tznic.or.tz/index.php/domains +// Submitted by registry +tz +ac.tz +co.tz +go.tz +hotel.tz +info.tz +me.tz +mil.tz +mobi.tz +ne.tz +or.tz +sc.tz +tv.tz + +// ua : https://hostmaster.ua/policy/?ua +// Submitted by registry +ua +// ua 2LD +com.ua +edu.ua +gov.ua +in.ua +net.ua +org.ua +// ua geographic names +// https://hostmaster.ua/2ld/ +cherkassy.ua +cherkasy.ua +chernigov.ua +chernihiv.ua +chernivtsi.ua +chernovtsy.ua +ck.ua +cn.ua +cr.ua +crimea.ua +cv.ua +dn.ua +dnepropetrovsk.ua +dnipropetrovsk.ua +dominic.ua +donetsk.ua +dp.ua +if.ua +ivano-frankivsk.ua +kh.ua +kharkiv.ua +kharkov.ua +kherson.ua +khmelnitskiy.ua +khmelnytskyi.ua +kiev.ua +kirovograd.ua +km.ua +kr.ua +krym.ua +ks.ua +kv.ua +kyiv.ua +lg.ua +lt.ua +lugansk.ua +lutsk.ua +lv.ua +lviv.ua +mk.ua +mykolaiv.ua +nikolaev.ua +od.ua +odesa.ua +odessa.ua +pl.ua +poltava.ua +rivne.ua +rovno.ua +rv.ua +sb.ua +sebastopol.ua +sevastopol.ua +sm.ua +sumy.ua +te.ua +ternopil.ua +uz.ua +uzhgorod.ua +vinnica.ua +vinnytsia.ua +vn.ua +volyn.ua +yalta.ua +zaporizhzhe.ua +zaporizhzhia.ua +zhitomir.ua +zhytomyr.ua +zp.ua +zt.ua + +// ug : https://www.registry.co.ug/ +ug +co.ug +or.ug +ac.ug +sc.ug +go.ug +ne.ug +com.ug +org.ug + +// uk : https://en.wikipedia.org/wiki/.uk +// Submitted by registry +uk +ac.uk +co.uk +gov.uk +ltd.uk +me.uk +net.uk +nhs.uk +org.uk +plc.uk +police.uk +*.sch.uk + +// us : https://en.wikipedia.org/wiki/.us +us +dni.us +fed.us +isa.us +kids.us +nsn.us +// us geographic names +ak.us +al.us +ar.us +as.us +az.us +ca.us +co.us +ct.us +dc.us +de.us +fl.us +ga.us +gu.us +hi.us +ia.us +id.us +il.us +in.us +ks.us +ky.us +la.us +ma.us +md.us +me.us +mi.us +mn.us +mo.us +ms.us +mt.us +nc.us +nd.us +ne.us +nh.us +nj.us +nm.us +nv.us +ny.us +oh.us +ok.us +or.us +pa.us +pr.us +ri.us +sc.us +sd.us +tn.us +tx.us +ut.us +vi.us +vt.us +va.us +wa.us +wi.us +wv.us +wy.us +// The registrar notes several more specific domains available in each state, +// such as state.*.us, dst.*.us, etc., but resolution of these is somewhat +// haphazard; in some states these domains resolve as addresses, while in others +// only subdomains are available, or even nothing at all. We include the +// most common ones where it's clear that different sites are different +// entities. +k12.ak.us +k12.al.us +k12.ar.us +k12.as.us +k12.az.us +k12.ca.us +k12.co.us +k12.ct.us +k12.dc.us +k12.de.us +k12.fl.us +k12.ga.us +k12.gu.us +// k12.hi.us Bug 614565 - Hawaii has a state-wide DOE login +k12.ia.us +k12.id.us +k12.il.us +k12.in.us +k12.ks.us +k12.ky.us +k12.la.us +k12.ma.us +k12.md.us +k12.me.us +k12.mi.us +k12.mn.us +k12.mo.us +k12.ms.us +k12.mt.us +k12.nc.us +// k12.nd.us Bug 1028347 - Removed at request of Travis Rosso +k12.ne.us +k12.nh.us +k12.nj.us +k12.nm.us +k12.nv.us +k12.ny.us +k12.oh.us +k12.ok.us +k12.or.us +k12.pa.us +k12.pr.us +k12.ri.us +k12.sc.us +// k12.sd.us Bug 934131 - Removed at request of James Booze +k12.tn.us +k12.tx.us +k12.ut.us +k12.vi.us +k12.vt.us +k12.va.us +k12.wa.us +k12.wi.us +// k12.wv.us Bug 947705 - Removed at request of Verne Britton +k12.wy.us +cc.ak.us +cc.al.us +cc.ar.us +cc.as.us +cc.az.us +cc.ca.us +cc.co.us +cc.ct.us +cc.dc.us +cc.de.us +cc.fl.us +cc.ga.us +cc.gu.us +cc.hi.us +cc.ia.us +cc.id.us +cc.il.us +cc.in.us +cc.ks.us +cc.ky.us +cc.la.us +cc.ma.us +cc.md.us +cc.me.us +cc.mi.us +cc.mn.us +cc.mo.us +cc.ms.us +cc.mt.us +cc.nc.us +cc.nd.us +cc.ne.us +cc.nh.us +cc.nj.us +cc.nm.us +cc.nv.us +cc.ny.us +cc.oh.us +cc.ok.us +cc.or.us +cc.pa.us +cc.pr.us +cc.ri.us +cc.sc.us +cc.sd.us +cc.tn.us +cc.tx.us +cc.ut.us +cc.vi.us +cc.vt.us +cc.va.us +cc.wa.us +cc.wi.us +cc.wv.us +cc.wy.us +lib.ak.us +lib.al.us +lib.ar.us +lib.as.us +lib.az.us +lib.ca.us +lib.co.us +lib.ct.us +lib.dc.us +// lib.de.us Issue #243 - Moved to Private section at request of Ed Moore +lib.fl.us +lib.ga.us +lib.gu.us +lib.hi.us +lib.ia.us +lib.id.us +lib.il.us +lib.in.us +lib.ks.us +lib.ky.us +lib.la.us +lib.ma.us +lib.md.us +lib.me.us +lib.mi.us +lib.mn.us +lib.mo.us +lib.ms.us +lib.mt.us +lib.nc.us +lib.nd.us +lib.ne.us +lib.nh.us +lib.nj.us +lib.nm.us +lib.nv.us +lib.ny.us +lib.oh.us +lib.ok.us +lib.or.us +lib.pa.us +lib.pr.us +lib.ri.us +lib.sc.us +lib.sd.us +lib.tn.us +lib.tx.us +lib.ut.us +lib.vi.us +lib.vt.us +lib.va.us +lib.wa.us +lib.wi.us +// lib.wv.us Bug 941670 - Removed at request of Larry W Arnold +lib.wy.us +// k12.ma.us contains school districts in Massachusetts. The 4LDs are +// managed independently except for private (PVT), charter (CHTR) and +// parochial (PAROCH) schools. Those are delegated directly to the +// 5LD operators. +pvt.k12.ma.us +chtr.k12.ma.us +paroch.k12.ma.us +// Merit Network, Inc. maintains the registry for =~ /(k12|cc|lib).mi.us/ and the following +// see also: http://domreg.merit.edu +// see also: whois -h whois.domreg.merit.edu help +ann-arbor.mi.us +cog.mi.us +dst.mi.us +eaton.mi.us +gen.mi.us +mus.mi.us +tec.mi.us +washtenaw.mi.us + +// uy : http://www.nic.org.uy/ +uy +com.uy +edu.uy +gub.uy +mil.uy +net.uy +org.uy + +// uz : http://www.reg.uz/ +uz +co.uz +com.uz +net.uz +org.uz + +// va : https://en.wikipedia.org/wiki/.va +va + +// vc : https://en.wikipedia.org/wiki/.vc +// Submitted by registry +vc +com.vc +net.vc +org.vc +gov.vc +mil.vc +edu.vc + +// ve : https://registro.nic.ve/ +// Submitted by registry +ve +arts.ve +co.ve +com.ve +e12.ve +edu.ve +firm.ve +gob.ve +gov.ve +info.ve +int.ve +mil.ve +net.ve +org.ve +rec.ve +store.ve +tec.ve +web.ve + +// vg : https://en.wikipedia.org/wiki/.vg +vg + +// vi : http://www.nic.vi/newdomainform.htm +// http://www.nic.vi/Domain_Rules/body_domain_rules.html indicates some other +// TLDs are "reserved", such as edu.vi and gov.vi, but doesn't actually say they +// are available for registration (which they do not seem to be). +vi +co.vi +com.vi +k12.vi +net.vi +org.vi + +// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp +vn +com.vn +net.vn +org.vn +edu.vn +gov.vn +int.vn +ac.vn +biz.vn +info.vn +name.vn +pro.vn +health.vn + +// vu : https://en.wikipedia.org/wiki/.vu +// http://www.vunic.vu/ +vu +com.vu +edu.vu +net.vu +org.vu + +// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +wf + +// ws : https://en.wikipedia.org/wiki/.ws +// http://samoanic.ws/index.dhtml +ws +com.ws +net.ws +org.ws +gov.ws +edu.ws + +// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +yt + +// IDN ccTLDs +// When submitting patches, please maintain a sort by ISO 3166 ccTLD, then +// U-label, and follow this format: +// // A-Label ("", [, variant info]) : +// // [sponsoring org] +// U-Label + +// xn--mgbaam7a8h ("Emerat", Arabic) : AE +// http://nic.ae/english/arabicdomain/rules.jsp +امارات + +// xn--y9a3aq ("hye", Armenian) : AM +// ISOC AM (operated by .am Registry) +հայ + +// xn--54b7fta0cc ("Bangla", Bangla) : BD +বাংলা + +// xn--90ae ("bg", Bulgarian) : BG +бг + +// xn--90ais ("bel", Belarusian/Russian Cyrillic) : BY +// Operated by .by registry +бел + +// xn--fiqs8s ("Zhongguo/China", Chinese, Simplified) : CN +// CNNIC +// http://cnnic.cn/html/Dir/2005/10/11/3218.htm +中国 + +// xn--fiqz9s ("Zhongguo/China", Chinese, Traditional) : CN +// CNNIC +// http://cnnic.cn/html/Dir/2005/10/11/3218.htm +中國 + +// xn--lgbbat1ad8j ("Algeria/Al Jazair", Arabic) : DZ +الجزائر + +// xn--wgbh1c ("Egypt/Masr", Arabic) : EG +// http://www.dotmasr.eg/ +مصر + +// xn--e1a4c ("eu", Cyrillic) : EU +ею + +// xn--node ("ge", Georgian Mkhedruli) : GE +გე + +// xn--qxam ("el", Greek) : GR +// Hellenic Ministry of Infrastructure, Transport, and Networks +ελ + +// xn--j6w193g ("Hong Kong", Chinese) : HK +// https://www.hkirc.hk +// Submitted by registry +// https://www.hkirc.hk/content.jsp?id=30#!/34 +香港 +公司.香港 +教育.香港 +政府.香港 +個人.香港 +網絡.香港 +組織.香港 + +// xn--2scrj9c ("Bharat", Kannada) : IN +// India +ಭಾರತ + +// xn--3hcrj9c ("Bharat", Oriya) : IN +// India +ଭାରତ + +// xn--45br5cyl ("Bharatam", Assamese) : IN +// India +ভাৰত + +// xn--h2breg3eve ("Bharatam", Sanskrit) : IN +// India +भारतम् + +// xn--h2brj9c8c ("Bharot", Santali) : IN +// India +भारोत + +// xn--mgbgu82a ("Bharat", Sindhi) : IN +// India +ڀارت + +// xn--rvc1e0am3e ("Bharatam", Malayalam) : IN +// India +ഭാരതം + +// xn--h2brj9c ("Bharat", Devanagari) : IN +// India +भारत + +// xn--mgbbh1a ("Bharat", Kashmiri) : IN +// India +بارت + +// xn--mgbbh1a71e ("Bharat", Arabic) : IN +// India +بھارت + +// xn--fpcrj9c3d ("Bharat", Telugu) : IN +// India +భారత్ + +// xn--gecrj9c ("Bharat", Gujarati) : IN +// India +ભારત + +// xn--s9brj9c ("Bharat", Gurmukhi) : IN +// India +ਭਾਰਤ + +// xn--45brj9c ("Bharat", Bengali) : IN +// India +ভারত + +// xn--xkc2dl3a5ee0h ("India", Tamil) : IN +// India +இந்தியா + +// xn--mgba3a4f16a ("Iran", Persian) : IR +ایران + +// xn--mgba3a4fra ("Iran", Arabic) : IR +ايران + +// xn--mgbtx2b ("Iraq", Arabic) : IQ +// Communications and Media Commission +عراق + +// xn--mgbayh7gpa ("al-Ordon", Arabic) : JO +// National Information Technology Center (NITC) +// Royal Scientific Society, Al-Jubeiha +الاردن + +// xn--3e0b707e ("Republic of Korea", Hangul) : KR +한국 + +// xn--80ao21a ("Kaz", Kazakh) : KZ +қаз + +// xn--fzc2c9e2c ("Lanka", Sinhalese-Sinhala) : LK +// http://nic.lk +ලංකා + +// xn--xkc2al3hye2a ("Ilangai", Tamil) : LK +// http://nic.lk +இலங்கை + +// xn--mgbc0a9azcg ("Morocco/al-Maghrib", Arabic) : MA +المغرب + +// xn--d1alf ("mkd", Macedonian) : MK +// MARnet +мкд + +// xn--l1acc ("mon", Mongolian) : MN +мон + +// xn--mix891f ("Macao", Chinese, Traditional) : MO +// MONIC / HNET Asia (Registry Operator for .mo) +澳門 + +// xn--mix082f ("Macao", Chinese, Simplified) : MO +澳门 + +// xn--mgbx4cd0ab ("Malaysia", Malay) : MY +مليسيا + +// xn--mgb9awbf ("Oman", Arabic) : OM +عمان + +// xn--mgbai9azgqp6j ("Pakistan", Urdu/Arabic) : PK +پاکستان + +// xn--mgbai9a5eva00b ("Pakistan", Urdu/Arabic, variant) : PK +پاكستان + +// xn--ygbi2ammx ("Falasteen", Arabic) : PS +// The Palestinian National Internet Naming Authority (PNINA) +// http://www.pnina.ps +فلسطين + +// xn--90a3ac ("srb", Cyrillic) : RS +// https://www.rnids.rs/en/domains/national-domains +срб +пр.срб +орг.срб +обр.срб +од.срб +упр.срб +ак.срб + +// xn--p1ai ("rf", Russian-Cyrillic) : RU +// http://www.cctld.ru/en/docs/rulesrf.php +рф + +// xn--wgbl6a ("Qatar", Arabic) : QA +// http://www.ict.gov.qa/ +قطر + +// xn--mgberp4a5d4ar ("AlSaudiah", Arabic) : SA +// http://www.nic.net.sa/ +السعودية + +// xn--mgberp4a5d4a87g ("AlSaudiah", Arabic, variant) : SA +السعودیة + +// xn--mgbqly7c0a67fbc ("AlSaudiah", Arabic, variant) : SA +السعودیۃ + +// xn--mgbqly7cvafr ("AlSaudiah", Arabic, variant) : SA +السعوديه + +// xn--mgbpl2fh ("sudan", Arabic) : SD +// Operated by .sd registry +سودان + +// xn--yfro4i67o Singapore ("Singapore", Chinese) : SG +新加坡 + +// xn--clchc0ea0b2g2a9gcd ("Singapore", Tamil) : SG +சிங்கப்பூர் + +// xn--ogbpf8fl ("Syria", Arabic) : SY +سورية + +// xn--mgbtf8fl ("Syria", Arabic, variant) : SY +سوريا + +// xn--o3cw4h ("Thai", Thai) : TH +// http://www.thnic.co.th +ไทย +ศึกษา.ไทย +ธุรกิจ.ไทย +รัฐบาล.ไทย +ทหาร.ไทย +เน็ต.ไทย +องค์กร.ไทย + +// xn--pgbs0dh ("Tunisia", Arabic) : TN +// http://nic.tn +تونس + +// xn--kpry57d ("Taiwan", Chinese, Traditional) : TW +// http://www.twnic.net/english/dn/dn_07a.htm +台灣 + +// xn--kprw13d ("Taiwan", Chinese, Simplified) : TW +// http://www.twnic.net/english/dn/dn_07a.htm +台湾 + +// xn--nnx388a ("Taiwan", Chinese, variant) : TW +臺灣 + +// xn--j1amh ("ukr", Cyrillic) : UA +укр + +// xn--mgb2ddes ("AlYemen", Arabic) : YE +اليمن + +// xxx : http://icmregistry.com +xxx + +// ye : http://www.y.net.ye/services/domain_name.htm +*.ye + +// za : http://www.zadna.org.za/content/page/domain-information +ac.za +agric.za +alt.za +co.za +edu.za +gov.za +grondar.za +law.za +mil.za +net.za +ngo.za +nis.za +nom.za +org.za +school.za +tm.za +web.za + +// zm : https://zicta.zm/ +// Submitted by registry +zm +ac.zm +biz.zm +co.zm +com.zm +edu.zm +gov.zm +info.zm +mil.zm +net.zm +org.zm +sch.zm + +// zw : https://www.potraz.gov.zw/ +// Confirmed by registry 2017-01-25 +zw +ac.zw +co.zw +gov.zw +mil.zw +org.zw + + +// newGTLDs + +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2019-06-14T10:00:50-04:00 +// This list is auto-generated, don't edit it manually. +// aaa : 2015-02-26 American Automobile Association, Inc. +aaa + +// aarp : 2015-05-21 AARP +aarp + +// abarth : 2015-07-30 Fiat Chrysler Automobiles N.V. +abarth + +// abb : 2014-10-24 ABB Ltd +abb + +// abbott : 2014-07-24 Abbott Laboratories, Inc. +abbott + +// abbvie : 2015-07-30 AbbVie Inc. +abbvie + +// abc : 2015-07-30 Disney Enterprises, Inc. +abc + +// able : 2015-06-25 Able Inc. +able + +// abogado : 2014-04-24 Minds + Machines Group Limited +abogado + +// abudhabi : 2015-07-30 Abu Dhabi Systems and Information Centre +abudhabi + +// academy : 2013-11-07 Binky Moon, LLC +academy + +// accenture : 2014-08-15 Accenture plc +accenture + +// accountant : 2014-11-20 dot Accountant Limited +accountant + +// accountants : 2014-03-20 Binky Moon, LLC +accountants + +// aco : 2015-01-08 ACO Severin Ahlmann GmbH & Co. KG +aco + +// actor : 2013-12-12 Dog Beach, LLC +actor + +// adac : 2015-07-16 Allgemeiner Deutscher Automobil-Club e.V. (ADAC) +adac + +// ads : 2014-12-04 Charleston Road Registry Inc. +ads + +// adult : 2014-10-16 ICM Registry AD LLC +adult + +// aeg : 2015-03-19 Aktiebolaget Electrolux +aeg + +// aetna : 2015-05-21 Aetna Life Insurance Company +aetna + +// afamilycompany : 2015-07-23 Johnson Shareholdings, Inc. +afamilycompany + +// afl : 2014-10-02 Australian Football League +afl + +// africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa +africa + +// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) +agakhan + +// agency : 2013-11-14 Binky Moon, LLC +agency + +// aig : 2014-12-18 American International Group, Inc. +aig + +// aigo : 2015-08-06 aigo Digital Technology Co,Ltd. +aigo + +// airbus : 2015-07-30 Airbus S.A.S. +airbus + +// airforce : 2014-03-06 Dog Beach, LLC +airforce + +// airtel : 2014-10-24 Bharti Airtel Limited +airtel + +// akdn : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) +akdn + +// alfaromeo : 2015-07-31 Fiat Chrysler Automobiles N.V. +alfaromeo + +// alibaba : 2015-01-15 Alibaba Group Holding Limited +alibaba + +// alipay : 2015-01-15 Alibaba Group Holding Limited +alipay + +// allfinanz : 2014-07-03 Allfinanz Deutsche Vermögensberatung Aktiengesellschaft +allfinanz + +// allstate : 2015-07-31 Allstate Fire and Casualty Insurance Company +allstate + +// ally : 2015-06-18 Ally Financial Inc. +ally + +// alsace : 2014-07-02 Region Grand Est +alsace + +// alstom : 2015-07-30 ALSTOM +alstom + +// americanexpress : 2015-07-31 American Express Travel Related Services Company, Inc. +americanexpress + +// americanfamily : 2015-07-23 AmFam, Inc. +americanfamily + +// amex : 2015-07-31 American Express Travel Related Services Company, Inc. +amex + +// amfam : 2015-07-23 AmFam, Inc. +amfam + +// amica : 2015-05-28 Amica Mutual Insurance Company +amica + +// amsterdam : 2014-07-24 Gemeente Amsterdam +amsterdam + +// analytics : 2014-12-18 Campus IP LLC +analytics + +// android : 2014-08-07 Charleston Road Registry Inc. +android + +// anquan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +anquan + +// anz : 2015-07-31 Australia and New Zealand Banking Group Limited +anz + +// aol : 2015-09-17 Oath Inc. +aol + +// apartments : 2014-12-11 Binky Moon, LLC +apartments + +// app : 2015-05-14 Charleston Road Registry Inc. +app + +// apple : 2015-05-14 Apple Inc. +apple + +// aquarelle : 2014-07-24 Aquarelle.com +aquarelle + +// arab : 2015-11-12 League of Arab States +arab + +// aramco : 2014-11-20 Aramco Services Company +aramco + +// archi : 2014-02-06 Afilias Limited +archi + +// army : 2014-03-06 Dog Beach, LLC +army + +// art : 2016-03-24 UK Creative Ideas Limited +art + +// arte : 2014-12-11 Association Relative à la Télévision Européenne G.E.I.E. +arte + +// asda : 2015-07-31 Wal-Mart Stores, Inc. +asda + +// associates : 2014-03-06 Binky Moon, LLC +associates + +// athleta : 2015-07-30 The Gap, Inc. +athleta + +// attorney : 2014-03-20 Dog Beach, LLC +attorney + +// auction : 2014-03-20 Dog Beach, LLC +auction + +// audi : 2015-05-21 AUDI Aktiengesellschaft +audi + +// audible : 2015-06-25 Amazon Registry Services, Inc. +audible + +// audio : 2014-03-20 Uniregistry, Corp. +audio + +// auspost : 2015-08-13 Australian Postal Corporation +auspost + +// author : 2014-12-18 Amazon Registry Services, Inc. +author + +// auto : 2014-11-13 Cars Registry Limited +auto + +// autos : 2014-01-09 DERAutos, LLC +autos + +// avianca : 2015-01-08 Aerovias del Continente Americano S.A. Avianca +avianca + +// aws : 2015-06-25 Amazon Registry Services, Inc. +aws + +// axa : 2013-12-19 AXA SA +axa + +// azure : 2014-12-18 Microsoft Corporation +azure + +// baby : 2015-04-09 XYZ.COM LLC +baby + +// baidu : 2015-01-08 Baidu, Inc. +baidu + +// banamex : 2015-07-30 Citigroup Inc. +banamex + +// bananarepublic : 2015-07-31 The Gap, Inc. +bananarepublic + +// band : 2014-06-12 Dog Beach, LLC +band + +// bank : 2014-09-25 fTLD Registry Services LLC +bank + +// bar : 2013-12-12 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +bar + +// barcelona : 2014-07-24 Municipi de Barcelona +barcelona + +// barclaycard : 2014-11-20 Barclays Bank PLC +barclaycard + +// barclays : 2014-11-20 Barclays Bank PLC +barclays + +// barefoot : 2015-06-11 Gallo Vineyards, Inc. +barefoot + +// bargains : 2013-11-14 Binky Moon, LLC +bargains + +// baseball : 2015-10-29 MLB Advanced Media DH, LLC +baseball + +// basketball : 2015-08-20 Fédération Internationale de Basketball (FIBA) +basketball + +// bauhaus : 2014-04-17 Werkhaus GmbH +bauhaus + +// bayern : 2014-01-23 Bayern Connect GmbH +bayern + +// bbc : 2014-12-18 British Broadcasting Corporation +bbc + +// bbt : 2015-07-23 BB&T Corporation +bbt + +// bbva : 2014-10-02 BANCO BILBAO VIZCAYA ARGENTARIA, S.A. +bbva + +// bcg : 2015-04-02 The Boston Consulting Group, Inc. +bcg + +// bcn : 2014-07-24 Municipi de Barcelona +bcn + +// beats : 2015-05-14 Beats Electronics, LLC +beats + +// beauty : 2015-12-03 L'Oréal +beauty + +// beer : 2014-01-09 Minds + Machines Group Limited +beer + +// bentley : 2014-12-18 Bentley Motors Limited +bentley + +// berlin : 2013-10-31 dotBERLIN GmbH & Co. KG +berlin + +// best : 2013-12-19 BestTLD Pty Ltd +best + +// bestbuy : 2015-07-31 BBY Solutions, Inc. +bestbuy + +// bet : 2015-05-07 Afilias Limited +bet + +// bharti : 2014-01-09 Bharti Enterprises (Holding) Private Limited +bharti + +// bible : 2014-06-19 American Bible Society +bible + +// bid : 2013-12-19 dot Bid Limited +bid + +// bike : 2013-08-27 Binky Moon, LLC +bike + +// bing : 2014-12-18 Microsoft Corporation +bing + +// bingo : 2014-12-04 Binky Moon, LLC +bingo + +// bio : 2014-03-06 Afilias Limited +bio + +// black : 2014-01-16 Afilias Limited +black + +// blackfriday : 2014-01-16 Uniregistry, Corp. +blackfriday + +// blockbuster : 2015-07-30 Dish DBS Corporation +blockbuster + +// blog : 2015-05-14 Knock Knock WHOIS There, LLC +blog + +// bloomberg : 2014-07-17 Bloomberg IP Holdings LLC +bloomberg + +// blue : 2013-11-07 Afilias Limited +blue + +// bms : 2014-10-30 Bristol-Myers Squibb Company +bms + +// bmw : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft +bmw + +// bnl : 2014-07-24 Banca Nazionale del Lavoro +bnl + +// bnpparibas : 2014-05-29 BNP Paribas +bnpparibas + +// boats : 2014-12-04 DERBoats, LLC +boats + +// boehringer : 2015-07-09 Boehringer Ingelheim International GmbH +boehringer + +// bofa : 2015-07-31 Bank of America Corporation +bofa + +// bom : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br +bom + +// bond : 2014-06-05 ShortDot SA +bond + +// boo : 2014-01-30 Charleston Road Registry Inc. +boo + +// book : 2015-08-27 Amazon Registry Services, Inc. +book + +// booking : 2015-07-16 Booking.com B.V. +booking + +// bosch : 2015-06-18 Robert Bosch GMBH +bosch + +// bostik : 2015-05-28 Bostik SA +bostik + +// boston : 2015-12-10 Boston TLD Management, LLC +boston + +// bot : 2014-12-18 Amazon Registry Services, Inc. +bot + +// boutique : 2013-11-14 Binky Moon, LLC +boutique + +// box : 2015-11-12 .BOX INC. +box + +// bradesco : 2014-12-18 Banco Bradesco S.A. +bradesco + +// bridgestone : 2014-12-18 Bridgestone Corporation +bridgestone + +// broadway : 2014-12-22 Celebrate Broadway, Inc. +broadway + +// broker : 2014-12-11 Dotbroker Registry Limited +broker + +// brother : 2015-01-29 Brother Industries, Ltd. +brother + +// brussels : 2014-02-06 DNS.be vzw +brussels + +// budapest : 2013-11-21 Minds + Machines Group Limited +budapest + +// bugatti : 2015-07-23 Bugatti International SA +bugatti + +// build : 2013-11-07 Plan Bee LLC +build + +// builders : 2013-11-07 Binky Moon, LLC +builders + +// business : 2013-11-07 Binky Moon, LLC +business + +// buy : 2014-12-18 Amazon Registry Services, Inc. +buy + +// buzz : 2013-10-02 DOTSTRATEGY CO. +buzz + +// bzh : 2014-02-27 Association www.bzh +bzh + +// cab : 2013-10-24 Binky Moon, LLC +cab + +// cafe : 2015-02-11 Binky Moon, LLC +cafe + +// cal : 2014-07-24 Charleston Road Registry Inc. +cal + +// call : 2014-12-18 Amazon Registry Services, Inc. +call + +// calvinklein : 2015-07-30 PVH gTLD Holdings LLC +calvinklein + +// cam : 2016-04-21 AC Webconnecting Holding B.V. +cam + +// camera : 2013-08-27 Binky Moon, LLC +camera + +// camp : 2013-11-07 Binky Moon, LLC +camp + +// cancerresearch : 2014-05-15 Australian Cancer Research Foundation +cancerresearch + +// canon : 2014-09-12 Canon Inc. +canon + +// capetown : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +capetown + +// capital : 2014-03-06 Binky Moon, LLC +capital + +// capitalone : 2015-08-06 Capital One Financial Corporation +capitalone + +// car : 2015-01-22 Cars Registry Limited +car + +// caravan : 2013-12-12 Caravan International, Inc. +caravan + +// cards : 2013-12-05 Binky Moon, LLC +cards + +// care : 2014-03-06 Binky Moon, LLC +care + +// career : 2013-10-09 dotCareer LLC +career + +// careers : 2013-10-02 Binky Moon, LLC +careers + +// cars : 2014-11-13 Cars Registry Limited +cars + +// cartier : 2014-06-23 Richemont DNS Inc. +cartier + +// casa : 2013-11-21 Minds + Machines Group Limited +casa + +// case : 2015-09-03 CNH Industrial N.V. +case + +// caseih : 2015-09-03 CNH Industrial N.V. +caseih + +// cash : 2014-03-06 Binky Moon, LLC +cash + +// casino : 2014-12-18 Binky Moon, LLC +casino + +// catering : 2013-12-05 Binky Moon, LLC +catering + +// catholic : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +catholic + +// cba : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +cba + +// cbn : 2014-08-22 The Christian Broadcasting Network, Inc. +cbn + +// cbre : 2015-07-02 CBRE, Inc. +cbre + +// cbs : 2015-08-06 CBS Domains Inc. +cbs + +// ceb : 2015-04-09 The Corporate Executive Board Company +ceb + +// center : 2013-11-07 Binky Moon, LLC +center + +// ceo : 2013-11-07 CEOTLD Pty Ltd +ceo + +// cern : 2014-06-05 European Organization for Nuclear Research ("CERN") +cern + +// cfa : 2014-08-28 CFA Institute +cfa + +// cfd : 2014-12-11 DotCFD Registry Limited +cfd + +// chanel : 2015-04-09 Chanel International B.V. +chanel + +// channel : 2014-05-08 Charleston Road Registry Inc. +channel + +// charity : 2018-04-11 Binky Moon, LLC +charity + +// chase : 2015-04-30 JPMorgan Chase Bank, National Association +chase + +// chat : 2014-12-04 Binky Moon, LLC +chat + +// cheap : 2013-11-14 Binky Moon, LLC +cheap + +// chintai : 2015-06-11 CHINTAI Corporation +chintai + +// christmas : 2013-11-21 Uniregistry, Corp. +christmas + +// chrome : 2014-07-24 Charleston Road Registry Inc. +chrome + +// chrysler : 2015-07-30 FCA US LLC. +chrysler + +// church : 2014-02-06 Binky Moon, LLC +church + +// cipriani : 2015-02-19 Hotel Cipriani Srl +cipriani + +// circle : 2014-12-18 Amazon Registry Services, Inc. +circle + +// cisco : 2014-12-22 Cisco Technology, Inc. +cisco + +// citadel : 2015-07-23 Citadel Domain LLC +citadel + +// citi : 2015-07-30 Citigroup Inc. +citi + +// citic : 2014-01-09 CITIC Group Corporation +citic + +// city : 2014-05-29 Binky Moon, LLC +city + +// cityeats : 2014-12-11 Lifestyle Domain Holdings, Inc. +cityeats + +// claims : 2014-03-20 Binky Moon, LLC +claims + +// cleaning : 2013-12-05 Binky Moon, LLC +cleaning + +// click : 2014-06-05 Uniregistry, Corp. +click + +// clinic : 2014-03-20 Binky Moon, LLC +clinic + +// clinique : 2015-10-01 The Estée Lauder Companies Inc. +clinique + +// clothing : 2013-08-27 Binky Moon, LLC +clothing + +// cloud : 2015-04-16 Aruba PEC S.p.A. +cloud + +// club : 2013-11-08 .CLUB DOMAINS, LLC +club + +// clubmed : 2015-06-25 Club Méditerranée S.A. +clubmed + +// coach : 2014-10-09 Binky Moon, LLC +coach + +// codes : 2013-10-31 Binky Moon, LLC +codes + +// coffee : 2013-10-17 Binky Moon, LLC +coffee + +// college : 2014-01-16 XYZ.COM LLC +college + +// cologne : 2014-02-05 dotKoeln GmbH +cologne + +// comcast : 2015-07-23 Comcast IP Holdings I, LLC +comcast + +// commbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +commbank + +// community : 2013-12-05 Binky Moon, LLC +community + +// company : 2013-11-07 Binky Moon, LLC +company + +// compare : 2015-10-08 iSelect Ltd +compare + +// computer : 2013-10-24 Binky Moon, LLC +computer + +// comsec : 2015-01-08 VeriSign, Inc. +comsec + +// condos : 2013-12-05 Binky Moon, LLC +condos + +// construction : 2013-09-16 Binky Moon, LLC +construction + +// consulting : 2013-12-05 Dog Beach, LLC +consulting + +// contact : 2015-01-08 Dog Beach, LLC +contact + +// contractors : 2013-09-10 Binky Moon, LLC +contractors + +// cooking : 2013-11-21 Minds + Machines Group Limited +cooking + +// cookingchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. +cookingchannel + +// cool : 2013-11-14 Binky Moon, LLC +cool + +// corsica : 2014-09-25 Collectivité de Corse +corsica + +// country : 2013-12-19 DotCountry LLC +country + +// coupon : 2015-02-26 Amazon Registry Services, Inc. +coupon + +// coupons : 2015-03-26 Binky Moon, LLC +coupons + +// courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD +courses + +// cpa : 2019-06-10 American Institute of Certified Public Accountants +cpa + +// credit : 2014-03-20 Binky Moon, LLC +credit + +// creditcard : 2014-03-20 Binky Moon, LLC +creditcard + +// creditunion : 2015-01-22 CUNA Performance Resources, LLC +creditunion + +// cricket : 2014-10-09 dot Cricket Limited +cricket + +// crown : 2014-10-24 Crown Equipment Corporation +crown + +// crs : 2014-04-03 Federated Co-operatives Limited +crs + +// cruise : 2015-12-10 Viking River Cruises (Bermuda) Ltd. +cruise + +// cruises : 2013-12-05 Binky Moon, LLC +cruises + +// csc : 2014-09-25 Alliance-One Services, Inc. +csc + +// cuisinella : 2014-04-03 SCHMIDT GROUPE S.A.S. +cuisinella + +// cymru : 2014-05-08 Nominet UK +cymru + +// cyou : 2015-01-22 Beijing Gamease Age Digital Technology Co., Ltd. +cyou + +// dabur : 2014-02-06 Dabur India Limited +dabur + +// dad : 2014-01-23 Charleston Road Registry Inc. +dad + +// dance : 2013-10-24 Dog Beach, LLC +dance + +// data : 2016-06-02 Dish DBS Corporation +data + +// date : 2014-11-20 dot Date Limited +date + +// dating : 2013-12-05 Binky Moon, LLC +dating + +// datsun : 2014-03-27 NISSAN MOTOR CO., LTD. +datsun + +// day : 2014-01-30 Charleston Road Registry Inc. +day + +// dclk : 2014-11-20 Charleston Road Registry Inc. +dclk + +// dds : 2015-05-07 Minds + Machines Group Limited +dds + +// deal : 2015-06-25 Amazon Registry Services, Inc. +deal + +// dealer : 2014-12-22 Intercap Registry Inc. +dealer + +// deals : 2014-05-22 Binky Moon, LLC +deals + +// degree : 2014-03-06 Dog Beach, LLC +degree + +// delivery : 2014-09-11 Binky Moon, LLC +delivery + +// dell : 2014-10-24 Dell Inc. +dell + +// deloitte : 2015-07-31 Deloitte Touche Tohmatsu +deloitte + +// delta : 2015-02-19 Delta Air Lines, Inc. +delta + +// democrat : 2013-10-24 Dog Beach, LLC +democrat + +// dental : 2014-03-20 Binky Moon, LLC +dental + +// dentist : 2014-03-20 Dog Beach, LLC +dentist + +// desi : 2013-11-14 Desi Networks LLC +desi + +// design : 2014-11-07 Top Level Design, LLC +design + +// dev : 2014-10-16 Charleston Road Registry Inc. +dev + +// dhl : 2015-07-23 Deutsche Post AG +dhl + +// diamonds : 2013-09-22 Binky Moon, LLC +diamonds + +// diet : 2014-06-26 Uniregistry, Corp. +diet + +// digital : 2014-03-06 Binky Moon, LLC +digital + +// direct : 2014-04-10 Binky Moon, LLC +direct + +// directory : 2013-09-20 Binky Moon, LLC +directory + +// discount : 2014-03-06 Binky Moon, LLC +discount + +// discover : 2015-07-23 Discover Financial Services +discover + +// dish : 2015-07-30 Dish DBS Corporation +dish + +// diy : 2015-11-05 Lifestyle Domain Holdings, Inc. +diy + +// dnp : 2013-12-13 Dai Nippon Printing Co., Ltd. +dnp + +// docs : 2014-10-16 Charleston Road Registry Inc. +docs + +// doctor : 2016-06-02 Binky Moon, LLC +doctor + +// dodge : 2015-07-30 FCA US LLC. +dodge + +// dog : 2014-12-04 Binky Moon, LLC +dog + +// domains : 2013-10-17 Binky Moon, LLC +domains + +// dot : 2015-05-21 Dish DBS Corporation +dot + +// download : 2014-11-20 dot Support Limited +download + +// drive : 2015-03-05 Charleston Road Registry Inc. +drive + +// dtv : 2015-06-04 Dish DBS Corporation +dtv + +// dubai : 2015-01-01 Dubai Smart Government Department +dubai + +// duck : 2015-07-23 Johnson Shareholdings, Inc. +duck + +// dunlop : 2015-07-02 The Goodyear Tire & Rubber Company +dunlop + +// duns : 2015-08-06 The Dun & Bradstreet Corporation +duns + +// dupont : 2015-06-25 E. I. du Pont de Nemours and Company +dupont + +// durban : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +durban + +// dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +dvag + +// dvr : 2016-05-26 DISH Technologies L.L.C. +dvr + +// earth : 2014-12-04 Interlink Co., Ltd. +earth + +// eat : 2014-01-23 Charleston Road Registry Inc. +eat + +// eco : 2016-07-08 Big Room Inc. +eco + +// edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V. +edeka + +// education : 2013-11-07 Binky Moon, LLC +education + +// email : 2013-10-31 Binky Moon, LLC +email + +// emerck : 2014-04-03 Merck KGaA +emerck + +// energy : 2014-09-11 Binky Moon, LLC +energy + +// engineer : 2014-03-06 Dog Beach, LLC +engineer + +// engineering : 2014-03-06 Binky Moon, LLC +engineering + +// enterprises : 2013-09-20 Binky Moon, LLC +enterprises + +// epson : 2014-12-04 Seiko Epson Corporation +epson + +// equipment : 2013-08-27 Binky Moon, LLC +equipment + +// ericsson : 2015-07-09 Telefonaktiebolaget L M Ericsson +ericsson + +// erni : 2014-04-03 ERNI Group Holding AG +erni + +// esq : 2014-05-08 Charleston Road Registry Inc. +esq + +// estate : 2013-08-27 Binky Moon, LLC +estate + +// esurance : 2015-07-23 Esurance Insurance Company +esurance + +// etisalat : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat) +etisalat + +// eurovision : 2014-04-24 European Broadcasting Union (EBU) +eurovision + +// eus : 2013-12-12 Puntueus Fundazioa +eus + +// events : 2013-12-05 Binky Moon, LLC +events + +// everbank : 2014-05-15 EverBank +everbank + +// exchange : 2014-03-06 Binky Moon, LLC +exchange + +// expert : 2013-11-21 Binky Moon, LLC +expert + +// exposed : 2013-12-05 Binky Moon, LLC +exposed + +// express : 2015-02-11 Binky Moon, LLC +express + +// extraspace : 2015-05-14 Extra Space Storage LLC +extraspace + +// fage : 2014-12-18 Fage International S.A. +fage + +// fail : 2014-03-06 Binky Moon, LLC +fail + +// fairwinds : 2014-11-13 FairWinds Partners, LLC +fairwinds + +// faith : 2014-11-20 dot Faith Limited +faith + +// family : 2015-04-02 Dog Beach, LLC +family + +// fan : 2014-03-06 Dog Beach, LLC +fan + +// fans : 2014-11-07 Fans TLD Limited +fans + +// farm : 2013-11-07 Binky Moon, LLC +farm + +// farmers : 2015-07-09 Farmers Insurance Exchange +farmers + +// fashion : 2014-07-03 Minds + Machines Group Limited +fashion + +// fast : 2014-12-18 Amazon Registry Services, Inc. +fast + +// fedex : 2015-08-06 Federal Express Corporation +fedex + +// feedback : 2013-12-19 Top Level Spectrum, Inc. +feedback + +// ferrari : 2015-07-31 Fiat Chrysler Automobiles N.V. +ferrari + +// ferrero : 2014-12-18 Ferrero Trading Lux S.A. +ferrero + +// fiat : 2015-07-31 Fiat Chrysler Automobiles N.V. +fiat + +// fidelity : 2015-07-30 Fidelity Brokerage Services LLC +fidelity + +// fido : 2015-08-06 Rogers Communications Canada Inc. +fido + +// film : 2015-01-08 Motion Picture Domain Registry Pty Ltd +film + +// final : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br +final + +// finance : 2014-03-20 Binky Moon, LLC +finance + +// financial : 2014-03-06 Binky Moon, LLC +financial + +// fire : 2015-06-25 Amazon Registry Services, Inc. +fire + +// firestone : 2014-12-18 Bridgestone Licensing Services, Inc +firestone + +// firmdale : 2014-03-27 Firmdale Holdings Limited +firmdale + +// fish : 2013-12-12 Binky Moon, LLC +fish + +// fishing : 2013-11-21 Minds + Machines Group Limited +fishing + +// fit : 2014-11-07 Minds + Machines Group Limited +fit + +// fitness : 2014-03-06 Binky Moon, LLC +fitness + +// flickr : 2015-04-02 Yahoo! Domain Services Inc. +flickr + +// flights : 2013-12-05 Binky Moon, LLC +flights + +// flir : 2015-07-23 FLIR Systems, Inc. +flir + +// florist : 2013-11-07 Binky Moon, LLC +florist + +// flowers : 2014-10-09 Uniregistry, Corp. +flowers + +// fly : 2014-05-08 Charleston Road Registry Inc. +fly + +// foo : 2014-01-23 Charleston Road Registry Inc. +foo + +// food : 2016-04-21 Lifestyle Domain Holdings, Inc. +food + +// foodnetwork : 2015-07-02 Lifestyle Domain Holdings, Inc. +foodnetwork + +// football : 2014-12-18 Binky Moon, LLC +football + +// ford : 2014-11-13 Ford Motor Company +ford + +// forex : 2014-12-11 Dotforex Registry Limited +forex + +// forsale : 2014-05-22 Dog Beach, LLC +forsale + +// forum : 2015-04-02 Fegistry, LLC +forum + +// foundation : 2013-12-05 Binky Moon, LLC +foundation + +// fox : 2015-09-11 FOX Registry, LLC +fox + +// free : 2015-12-10 Amazon Registry Services, Inc. +free + +// fresenius : 2015-07-30 Fresenius Immobilien-Verwaltungs-GmbH +fresenius + +// frl : 2014-05-15 FRLregistry B.V. +frl + +// frogans : 2013-12-19 OP3FT +frogans + +// frontdoor : 2015-07-02 Lifestyle Domain Holdings, Inc. +frontdoor + +// frontier : 2015-02-05 Frontier Communications Corporation +frontier + +// ftr : 2015-07-16 Frontier Communications Corporation +ftr + +// fujitsu : 2015-07-30 Fujitsu Limited +fujitsu + +// fujixerox : 2015-07-23 Xerox DNHC LLC +fujixerox + +// fun : 2016-01-14 DotSpace Inc. +fun + +// fund : 2014-03-20 Binky Moon, LLC +fund + +// furniture : 2014-03-20 Binky Moon, LLC +furniture + +// futbol : 2013-09-20 Dog Beach, LLC +futbol + +// fyi : 2015-04-02 Binky Moon, LLC +fyi + +// gal : 2013-11-07 Asociación puntoGAL +gal + +// gallery : 2013-09-13 Binky Moon, LLC +gallery + +// gallo : 2015-06-11 Gallo Vineyards, Inc. +gallo + +// gallup : 2015-02-19 Gallup, Inc. +gallup + +// game : 2015-05-28 Uniregistry, Corp. +game + +// games : 2015-05-28 Dog Beach, LLC +games + +// gap : 2015-07-31 The Gap, Inc. +gap + +// garden : 2014-06-26 Minds + Machines Group Limited +garden + +// gay : 2019-05-23 Top Level Design, LLC +gay + +// gbiz : 2014-07-17 Charleston Road Registry Inc. +gbiz + +// gdn : 2014-07-31 Joint Stock Company "Navigation-information systems" +gdn + +// gea : 2014-12-04 GEA Group Aktiengesellschaft +gea + +// gent : 2014-01-23 COMBELL NV +gent + +// genting : 2015-03-12 Resorts World Inc Pte. Ltd. +genting + +// george : 2015-07-31 Wal-Mart Stores, Inc. +george + +// ggee : 2014-01-09 GMO Internet, Inc. +ggee + +// gift : 2013-10-17 DotGift, LLC +gift + +// gifts : 2014-07-03 Binky Moon, LLC +gifts + +// gives : 2014-03-06 Dog Beach, LLC +gives + +// giving : 2014-11-13 Giving Limited +giving + +// glade : 2015-07-23 Johnson Shareholdings, Inc. +glade + +// glass : 2013-11-07 Binky Moon, LLC +glass + +// gle : 2014-07-24 Charleston Road Registry Inc. +gle + +// global : 2014-04-17 Dot Global Domain Registry Limited +global + +// globo : 2013-12-19 Globo Comunicação e Participações S.A +globo + +// gmail : 2014-05-01 Charleston Road Registry Inc. +gmail + +// gmbh : 2016-01-29 Binky Moon, LLC +gmbh + +// gmo : 2014-01-09 GMO Internet Pte. Ltd. +gmo + +// gmx : 2014-04-24 1&1 Mail & Media GmbH +gmx + +// godaddy : 2015-07-23 Go Daddy East, LLC +godaddy + +// gold : 2015-01-22 Binky Moon, LLC +gold + +// goldpoint : 2014-11-20 YODOBASHI CAMERA CO.,LTD. +goldpoint + +// golf : 2014-12-18 Binky Moon, LLC +golf + +// goo : 2014-12-18 NTT Resonant Inc. +goo + +// goodyear : 2015-07-02 The Goodyear Tire & Rubber Company +goodyear + +// goog : 2014-11-20 Charleston Road Registry Inc. +goog + +// google : 2014-07-24 Charleston Road Registry Inc. +google + +// gop : 2014-01-16 Republican State Leadership Committee, Inc. +gop + +// got : 2014-12-18 Amazon Registry Services, Inc. +got + +// grainger : 2015-05-07 Grainger Registry Services, LLC +grainger + +// graphics : 2013-09-13 Binky Moon, LLC +graphics + +// gratis : 2014-03-20 Binky Moon, LLC +gratis + +// green : 2014-05-08 Afilias Limited +green + +// gripe : 2014-03-06 Binky Moon, LLC +gripe + +// grocery : 2016-06-16 Wal-Mart Stores, Inc. +grocery + +// group : 2014-08-15 Binky Moon, LLC +group + +// guardian : 2015-07-30 The Guardian Life Insurance Company of America +guardian + +// gucci : 2014-11-13 Guccio Gucci S.p.a. +gucci + +// guge : 2014-08-28 Charleston Road Registry Inc. +guge + +// guide : 2013-09-13 Binky Moon, LLC +guide + +// guitars : 2013-11-14 Uniregistry, Corp. +guitars + +// guru : 2013-08-27 Binky Moon, LLC +guru + +// hair : 2015-12-03 L'Oréal +hair + +// hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH +hamburg + +// hangout : 2014-11-13 Charleston Road Registry Inc. +hangout + +// haus : 2013-12-05 Dog Beach, LLC +haus + +// hbo : 2015-07-30 HBO Registry Services, Inc. +hbo + +// hdfc : 2015-07-30 HOUSING DEVELOPMENT FINANCE CORPORATION LIMITED +hdfc + +// hdfcbank : 2015-02-12 HDFC Bank Limited +hdfcbank + +// health : 2015-02-11 DotHealth, LLC +health + +// healthcare : 2014-06-12 Binky Moon, LLC +healthcare + +// help : 2014-06-26 Uniregistry, Corp. +help + +// helsinki : 2015-02-05 City of Helsinki +helsinki + +// here : 2014-02-06 Charleston Road Registry Inc. +here + +// hermes : 2014-07-10 HERMES INTERNATIONAL +hermes + +// hgtv : 2015-07-02 Lifestyle Domain Holdings, Inc. +hgtv + +// hiphop : 2014-03-06 Uniregistry, Corp. +hiphop + +// hisamitsu : 2015-07-16 Hisamitsu Pharmaceutical Co.,Inc. +hisamitsu + +// hitachi : 2014-10-31 Hitachi, Ltd. +hitachi + +// hiv : 2014-03-13 Uniregistry, Corp. +hiv + +// hkt : 2015-05-14 PCCW-HKT DataCom Services Limited +hkt + +// hockey : 2015-03-19 Binky Moon, LLC +hockey + +// holdings : 2013-08-27 Binky Moon, LLC +holdings + +// holiday : 2013-11-07 Binky Moon, LLC +holiday + +// homedepot : 2015-04-02 Home Depot Product Authority, LLC +homedepot + +// homegoods : 2015-07-16 The TJX Companies, Inc. +homegoods + +// homes : 2014-01-09 DERHomes, LLC +homes + +// homesense : 2015-07-16 The TJX Companies, Inc. +homesense + +// honda : 2014-12-18 Honda Motor Co., Ltd. +honda + +// honeywell : 2015-07-23 Honeywell GTLD LLC +honeywell + +// horse : 2013-11-21 Minds + Machines Group Limited +horse + +// hospital : 2016-10-20 Binky Moon, LLC +hospital + +// host : 2014-04-17 DotHost Inc. +host + +// hosting : 2014-05-29 Uniregistry, Corp. +hosting + +// hot : 2015-08-27 Amazon Registry Services, Inc. +hot + +// hoteles : 2015-03-05 Travel Reservations SRL +hoteles + +// hotels : 2016-04-07 Booking.com B.V. +hotels + +// hotmail : 2014-12-18 Microsoft Corporation +hotmail + +// house : 2013-11-07 Binky Moon, LLC +house + +// how : 2014-01-23 Charleston Road Registry Inc. +how + +// hsbc : 2014-10-24 HSBC Global Services (UK) Limited +hsbc + +// hughes : 2015-07-30 Hughes Satellite Systems Corporation +hughes + +// hyatt : 2015-07-30 Hyatt GTLD, L.L.C. +hyatt + +// hyundai : 2015-07-09 Hyundai Motor Company +hyundai + +// ibm : 2014-07-31 International Business Machines Corporation +ibm + +// icbc : 2015-02-19 Industrial and Commercial Bank of China Limited +icbc + +// ice : 2014-10-30 IntercontinentalExchange, Inc. +ice + +// icu : 2015-01-08 ShortDot SA +icu + +// ieee : 2015-07-23 IEEE Global LLC +ieee + +// ifm : 2014-01-30 ifm electronic gmbh +ifm + +// ikano : 2015-07-09 Ikano S.A. +ikano + +// imamat : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) +imamat + +// imdb : 2015-06-25 Amazon Registry Services, Inc. +imdb + +// immo : 2014-07-10 Binky Moon, LLC +immo + +// immobilien : 2013-11-07 Dog Beach, LLC +immobilien + +// inc : 2018-03-10 Intercap Registry Inc. +inc + +// industries : 2013-12-05 Binky Moon, LLC +industries + +// infiniti : 2014-03-27 NISSAN MOTOR CO., LTD. +infiniti + +// ing : 2014-01-23 Charleston Road Registry Inc. +ing + +// ink : 2013-12-05 Top Level Design, LLC +ink + +// institute : 2013-11-07 Binky Moon, LLC +institute + +// insurance : 2015-02-19 fTLD Registry Services LLC +insurance + +// insure : 2014-03-20 Binky Moon, LLC +insure + +// intel : 2015-08-06 Intel Corporation +intel + +// international : 2013-11-07 Binky Moon, LLC +international + +// intuit : 2015-07-30 Intuit Administrative Services, Inc. +intuit + +// investments : 2014-03-20 Binky Moon, LLC +investments + +// ipiranga : 2014-08-28 Ipiranga Produtos de Petroleo S.A. +ipiranga + +// irish : 2014-08-07 Binky Moon, LLC +irish + +// iselect : 2015-02-11 iSelect Ltd +iselect + +// ismaili : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) +ismaili + +// ist : 2014-08-28 Istanbul Metropolitan Municipality +ist + +// istanbul : 2014-08-28 Istanbul Metropolitan Municipality +istanbul + +// itau : 2014-10-02 Itau Unibanco Holding S.A. +itau + +// itv : 2015-07-09 ITV Services Limited +itv + +// iveco : 2015-09-03 CNH Industrial N.V. +iveco + +// jaguar : 2014-11-13 Jaguar Land Rover Ltd +jaguar + +// java : 2014-06-19 Oracle Corporation +java + +// jcb : 2014-11-20 JCB Co., Ltd. +jcb + +// jcp : 2015-04-23 JCP Media, Inc. +jcp + +// jeep : 2015-07-30 FCA US LLC. +jeep + +// jetzt : 2014-01-09 Binky Moon, LLC +jetzt + +// jewelry : 2015-03-05 Binky Moon, LLC +jewelry + +// jio : 2015-04-02 Reliance Industries Limited +jio + +// jll : 2015-04-02 Jones Lang LaSalle Incorporated +jll + +// jmp : 2015-03-26 Matrix IP LLC +jmp + +// jnj : 2015-06-18 Johnson & Johnson Services, Inc. +jnj + +// joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry +joburg + +// jot : 2014-12-18 Amazon Registry Services, Inc. +jot + +// joy : 2014-12-18 Amazon Registry Services, Inc. +joy + +// jpmorgan : 2015-04-30 JPMorgan Chase Bank, National Association +jpmorgan + +// jprs : 2014-09-18 Japan Registry Services Co., Ltd. +jprs + +// juegos : 2014-03-20 Uniregistry, Corp. +juegos + +// juniper : 2015-07-30 JUNIPER NETWORKS, INC. +juniper + +// kaufen : 2013-11-07 Dog Beach, LLC +kaufen + +// kddi : 2014-09-12 KDDI CORPORATION +kddi + +// kerryhotels : 2015-04-30 Kerry Trading Co. Limited +kerryhotels + +// kerrylogistics : 2015-04-09 Kerry Trading Co. Limited +kerrylogistics + +// kerryproperties : 2015-04-09 Kerry Trading Co. Limited +kerryproperties + +// kfh : 2014-12-04 Kuwait Finance House +kfh + +// kia : 2015-07-09 KIA MOTORS CORPORATION +kia + +// kim : 2013-09-23 Afilias Limited +kim + +// kinder : 2014-11-07 Ferrero Trading Lux S.A. +kinder + +// kindle : 2015-06-25 Amazon Registry Services, Inc. +kindle + +// kitchen : 2013-09-20 Binky Moon, LLC +kitchen + +// kiwi : 2013-09-20 DOT KIWI LIMITED +kiwi + +// koeln : 2014-01-09 dotKoeln GmbH +koeln + +// komatsu : 2015-01-08 Komatsu Ltd. +komatsu + +// kosher : 2015-08-20 Kosher Marketing Assets LLC +kosher + +// kpmg : 2015-04-23 KPMG International Cooperative (KPMG International Genossenschaft) +kpmg + +// kpn : 2015-01-08 Koninklijke KPN N.V. +kpn + +// krd : 2013-12-05 KRG Department of Information Technology +krd + +// kred : 2013-12-19 KredTLD Pty Ltd +kred + +// kuokgroup : 2015-04-09 Kerry Trading Co. Limited +kuokgroup + +// kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen +kyoto + +// lacaixa : 2014-01-09 Fundación Bancaria Caixa d’Estalvis i Pensions de Barcelona, “la Caixa” +lacaixa + +// ladbrokes : 2015-08-06 LADBROKES INTERNATIONAL PLC +ladbrokes + +// lamborghini : 2015-06-04 Automobili Lamborghini S.p.A. +lamborghini + +// lamer : 2015-10-01 The Estée Lauder Companies Inc. +lamer + +// lancaster : 2015-02-12 LANCASTER +lancaster + +// lancia : 2015-07-31 Fiat Chrysler Automobiles N.V. +lancia + +// lancome : 2015-07-23 L'Oréal +lancome + +// land : 2013-09-10 Binky Moon, LLC +land + +// landrover : 2014-11-13 Jaguar Land Rover Ltd +landrover + +// lanxess : 2015-07-30 LANXESS Corporation +lanxess + +// lasalle : 2015-04-02 Jones Lang LaSalle Incorporated +lasalle + +// lat : 2014-10-16 ECOM-LAC Federaciòn de Latinoamèrica y el Caribe para Internet y el Comercio Electrònico +lat + +// latino : 2015-07-30 Dish DBS Corporation +latino + +// latrobe : 2014-06-16 La Trobe University +latrobe + +// law : 2015-01-22 LW TLD Limited +law + +// lawyer : 2014-03-20 Dog Beach, LLC +lawyer + +// lds : 2014-03-20 IRI Domain Management, LLC ("Applicant") +lds + +// lease : 2014-03-06 Binky Moon, LLC +lease + +// leclerc : 2014-08-07 A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc +leclerc + +// lefrak : 2015-07-16 LeFrak Organization, Inc. +lefrak + +// legal : 2014-10-16 Binky Moon, LLC +legal + +// lego : 2015-07-16 LEGO Juris A/S +lego + +// lexus : 2015-04-23 TOYOTA MOTOR CORPORATION +lexus + +// lgbt : 2014-05-08 Afilias Limited +lgbt + +// liaison : 2014-10-02 Liaison Technologies, Incorporated +liaison + +// lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG +lidl + +// life : 2014-02-06 Binky Moon, LLC +life + +// lifeinsurance : 2015-01-15 American Council of Life Insurers +lifeinsurance + +// lifestyle : 2014-12-11 Lifestyle Domain Holdings, Inc. +lifestyle + +// lighting : 2013-08-27 Binky Moon, LLC +lighting + +// like : 2014-12-18 Amazon Registry Services, Inc. +like + +// lilly : 2015-07-31 Eli Lilly and Company +lilly + +// limited : 2014-03-06 Binky Moon, LLC +limited + +// limo : 2013-10-17 Binky Moon, LLC +limo + +// lincoln : 2014-11-13 Ford Motor Company +lincoln + +// linde : 2014-12-04 Linde Aktiengesellschaft +linde + +// link : 2013-11-14 Uniregistry, Corp. +link + +// lipsy : 2015-06-25 Lipsy Ltd +lipsy + +// live : 2014-12-04 Dog Beach, LLC +live + +// living : 2015-07-30 Lifestyle Domain Holdings, Inc. +living + +// lixil : 2015-03-19 LIXIL Group Corporation +lixil + +// llc : 2017-12-14 Afilias Limited +llc + +// loan : 2014-11-20 dot Loan Limited +loan + +// loans : 2014-03-20 Binky Moon, LLC +loans + +// locker : 2015-06-04 Dish DBS Corporation +locker + +// locus : 2015-06-25 Locus Analytics LLC +locus + +// loft : 2015-07-30 Annco, Inc. +loft + +// lol : 2015-01-30 Uniregistry, Corp. +lol + +// london : 2013-11-14 Dot London Domains Limited +london + +// lotte : 2014-11-07 Lotte Holdings Co., Ltd. +lotte + +// lotto : 2014-04-10 Afilias Limited +lotto + +// love : 2014-12-22 Merchant Law Group LLP +love + +// lpl : 2015-07-30 LPL Holdings, Inc. +lpl + +// lplfinancial : 2015-07-30 LPL Holdings, Inc. +lplfinancial + +// ltd : 2014-09-25 Binky Moon, LLC +ltd + +// ltda : 2014-04-17 InterNetX, Corp +ltda + +// lundbeck : 2015-08-06 H. Lundbeck A/S +lundbeck + +// lupin : 2014-11-07 LUPIN LIMITED +lupin + +// luxe : 2014-01-09 Minds + Machines Group Limited +luxe + +// luxury : 2013-10-17 Luxury Partners, LLC +luxury + +// macys : 2015-07-31 Macys, Inc. +macys + +// madrid : 2014-05-01 Comunidad de Madrid +madrid + +// maif : 2014-10-02 Mutuelle Assurance Instituteur France (MAIF) +maif + +// maison : 2013-12-05 Binky Moon, LLC +maison + +// makeup : 2015-01-15 L'Oréal +makeup + +// man : 2014-12-04 MAN SE +man + +// management : 2013-11-07 Binky Moon, LLC +management + +// mango : 2013-10-24 PUNTO FA S.L. +mango + +// map : 2016-06-09 Charleston Road Registry Inc. +map + +// market : 2014-03-06 Dog Beach, LLC +market + +// marketing : 2013-11-07 Binky Moon, LLC +marketing + +// markets : 2014-12-11 Dotmarkets Registry Limited +markets + +// marriott : 2014-10-09 Marriott Worldwide Corporation +marriott + +// marshalls : 2015-07-16 The TJX Companies, Inc. +marshalls + +// maserati : 2015-07-31 Fiat Chrysler Automobiles N.V. +maserati + +// mattel : 2015-08-06 Mattel Sites, Inc. +mattel + +// mba : 2015-04-02 Binky Moon, LLC +mba + +// mckinsey : 2015-07-31 McKinsey Holdings, Inc. +mckinsey + +// med : 2015-08-06 Medistry LLC +med + +// media : 2014-03-06 Binky Moon, LLC +media + +// meet : 2014-01-16 Charleston Road Registry Inc. +meet + +// melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation +melbourne + +// meme : 2014-01-30 Charleston Road Registry Inc. +meme + +// memorial : 2014-10-16 Dog Beach, LLC +memorial + +// men : 2015-02-26 Exclusive Registry Limited +men + +// menu : 2013-09-11 Dot Menu Registry, LLC +menu + +// merckmsd : 2016-07-14 MSD Registry Holdings, Inc. +merckmsd + +// metlife : 2015-05-07 MetLife Services and Solutions, LLC +metlife + +// miami : 2013-12-19 Minds + Machines Group Limited +miami + +// microsoft : 2014-12-18 Microsoft Corporation +microsoft + +// mini : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft +mini + +// mint : 2015-07-30 Intuit Administrative Services, Inc. +mint + +// mit : 2015-07-02 Massachusetts Institute of Technology +mit + +// mitsubishi : 2015-07-23 Mitsubishi Corporation +mitsubishi + +// mlb : 2015-05-21 MLB Advanced Media DH, LLC +mlb + +// mls : 2015-04-23 The Canadian Real Estate Association +mls + +// mma : 2014-11-07 MMA IARD +mma + +// mobile : 2016-06-02 Dish DBS Corporation +mobile + +// mobily : 2014-12-18 GreenTech Consultancy Company W.L.L. +mobily + +// moda : 2013-11-07 Dog Beach, LLC +moda + +// moe : 2013-11-13 Interlink Co., Ltd. +moe + +// moi : 2014-12-18 Amazon Registry Services, Inc. +moi + +// mom : 2015-04-16 Uniregistry, Corp. +mom + +// monash : 2013-09-30 Monash University +monash + +// money : 2014-10-16 Binky Moon, LLC +money + +// monster : 2015-09-11 XYZ.COM LLC +monster + +// mopar : 2015-07-30 FCA US LLC. +mopar + +// mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant") +mormon + +// mortgage : 2014-03-20 Dog Beach, LLC +mortgage + +// moscow : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +moscow + +// moto : 2015-06-04 Motorola Trademark Holdings, LLC +moto + +// motorcycles : 2014-01-09 DERMotorcycles, LLC +motorcycles + +// mov : 2014-01-30 Charleston Road Registry Inc. +mov + +// movie : 2015-02-05 Binky Moon, LLC +movie + +// movistar : 2014-10-16 Telefónica S.A. +movistar + +// msd : 2015-07-23 MSD Registry Holdings, Inc. +msd + +// mtn : 2014-12-04 MTN Dubai Limited +mtn + +// mtr : 2015-03-12 MTR Corporation Limited +mtr + +// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC +mutual + +// nab : 2015-08-20 National Australia Bank Limited +nab + +// nadex : 2014-12-11 Nadex Domains, Inc. +nadex + +// nagoya : 2013-10-24 GMO Registry, Inc. +nagoya + +// nationwide : 2015-07-23 Nationwide Mutual Insurance Company +nationwide + +// natura : 2015-03-12 NATURA COSMÉTICOS S.A. +natura + +// navy : 2014-03-06 Dog Beach, LLC +navy + +// nba : 2015-07-31 NBA REGISTRY, LLC +nba + +// nec : 2015-01-08 NEC Corporation +nec + +// netbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA +netbank + +// netflix : 2015-06-18 Netflix, Inc. +netflix + +// network : 2013-11-14 Binky Moon, LLC +network + +// neustar : 2013-12-05 Registry Services, LLC +neustar + +// new : 2014-01-30 Charleston Road Registry Inc. +new + +// newholland : 2015-09-03 CNH Industrial N.V. +newholland + +// news : 2014-12-18 Dog Beach, LLC +news + +// next : 2015-06-18 Next plc +next + +// nextdirect : 2015-06-18 Next plc +nextdirect + +// nexus : 2014-07-24 Charleston Road Registry Inc. +nexus + +// nfl : 2015-07-23 NFL Reg Ops LLC +nfl + +// ngo : 2014-03-06 Public Interest Registry +ngo + +// nhk : 2014-02-13 Japan Broadcasting Corporation (NHK) +nhk + +// nico : 2014-12-04 DWANGO Co., Ltd. +nico + +// nike : 2015-07-23 NIKE, Inc. +nike + +// nikon : 2015-05-21 NIKON CORPORATION +nikon + +// ninja : 2013-11-07 Dog Beach, LLC +ninja + +// nissan : 2014-03-27 NISSAN MOTOR CO., LTD. +nissan + +// nissay : 2015-10-29 Nippon Life Insurance Company +nissay + +// nokia : 2015-01-08 Nokia Corporation +nokia + +// northwesternmutual : 2015-06-18 Northwestern Mutual Registry, LLC +northwesternmutual + +// norton : 2014-12-04 Symantec Corporation +norton + +// now : 2015-06-25 Amazon Registry Services, Inc. +now + +// nowruz : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +nowruz + +// nowtv : 2015-05-14 Starbucks (HK) Limited +nowtv + +// nra : 2014-05-22 NRA Holdings Company, INC. +nra + +// nrw : 2013-11-21 Minds + Machines GmbH +nrw + +// ntt : 2014-10-31 NIPPON TELEGRAPH AND TELEPHONE CORPORATION +ntt + +// nyc : 2014-01-23 The City of New York by and through the New York City Department of Information Technology & Telecommunications +nyc + +// obi : 2014-09-25 OBI Group Holding SE & Co. KGaA +obi + +// observer : 2015-04-30 Top Level Spectrum, Inc. +observer + +// off : 2015-07-23 Johnson Shareholdings, Inc. +off + +// office : 2015-03-12 Microsoft Corporation +office + +// okinawa : 2013-12-05 BRregistry, Inc. +okinawa + +// olayan : 2015-05-14 Crescent Holding GmbH +olayan + +// olayangroup : 2015-05-14 Crescent Holding GmbH +olayangroup + +// oldnavy : 2015-07-31 The Gap, Inc. +oldnavy + +// ollo : 2015-06-04 Dish DBS Corporation +ollo + +// omega : 2015-01-08 The Swatch Group Ltd +omega + +// one : 2014-11-07 One.com A/S +one + +// ong : 2014-03-06 Public Interest Registry +ong + +// onl : 2013-09-16 I-Registry Ltd. +onl + +// online : 2015-01-15 DotOnline Inc. +online + +// onyourside : 2015-07-23 Nationwide Mutual Insurance Company +onyourside + +// ooo : 2014-01-09 INFIBEAM AVENUES LIMITED +ooo + +// open : 2015-07-31 American Express Travel Related Services Company, Inc. +open + +// oracle : 2014-06-19 Oracle Corporation +oracle + +// orange : 2015-03-12 Orange Brand Services Limited +orange + +// organic : 2014-03-27 Afilias Limited +organic + +// origins : 2015-10-01 The Estée Lauder Companies Inc. +origins + +// osaka : 2014-09-04 Osaka Registry Co., Ltd. +osaka + +// otsuka : 2013-10-11 Otsuka Holdings Co., Ltd. +otsuka + +// ott : 2015-06-04 Dish DBS Corporation +ott + +// ovh : 2014-01-16 MédiaBC +ovh + +// page : 2014-12-04 Charleston Road Registry Inc. +page + +// panasonic : 2015-07-30 Panasonic Corporation +panasonic + +// paris : 2014-01-30 City of Paris +paris + +// pars : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +pars + +// partners : 2013-12-05 Binky Moon, LLC +partners + +// parts : 2013-12-05 Binky Moon, LLC +parts + +// party : 2014-09-11 Blue Sky Registry Limited +party + +// passagens : 2015-03-05 Travel Reservations SRL +passagens + +// pay : 2015-08-27 Amazon Registry Services, Inc. +pay + +// pccw : 2015-05-14 PCCW Enterprises Limited +pccw + +// pet : 2015-05-07 Afilias Limited +pet + +// pfizer : 2015-09-11 Pfizer Inc. +pfizer + +// pharmacy : 2014-06-19 National Association of Boards of Pharmacy +pharmacy + +// phd : 2016-07-28 Charleston Road Registry Inc. +phd + +// philips : 2014-11-07 Koninklijke Philips N.V. +philips + +// phone : 2016-06-02 Dish DBS Corporation +phone + +// photo : 2013-11-14 Uniregistry, Corp. +photo + +// photography : 2013-09-20 Binky Moon, LLC +photography + +// photos : 2013-10-17 Binky Moon, LLC +photos + +// physio : 2014-05-01 PhysBiz Pty Ltd +physio + +// piaget : 2014-10-16 Richemont DNS Inc. +piaget + +// pics : 2013-11-14 Uniregistry, Corp. +pics + +// pictet : 2014-06-26 Pictet Europe S.A. +pictet + +// pictures : 2014-03-06 Binky Moon, LLC +pictures + +// pid : 2015-01-08 Top Level Spectrum, Inc. +pid + +// pin : 2014-12-18 Amazon Registry Services, Inc. +pin + +// ping : 2015-06-11 Ping Registry Provider, Inc. +ping + +// pink : 2013-10-01 Afilias Limited +pink + +// pioneer : 2015-07-16 Pioneer Corporation +pioneer + +// pizza : 2014-06-26 Binky Moon, LLC +pizza + +// place : 2014-04-24 Binky Moon, LLC +place + +// play : 2015-03-05 Charleston Road Registry Inc. +play + +// playstation : 2015-07-02 Sony Interactive Entertainment Inc. +playstation + +// plumbing : 2013-09-10 Binky Moon, LLC +plumbing + +// plus : 2015-02-05 Binky Moon, LLC +plus + +// pnc : 2015-07-02 PNC Domain Co., LLC +pnc + +// pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +pohl + +// poker : 2014-07-03 Afilias Limited +poker + +// politie : 2015-08-20 Politie Nederland +politie + +// porn : 2014-10-16 ICM Registry PN LLC +porn + +// pramerica : 2015-07-30 Prudential Financial, Inc. +pramerica + +// praxi : 2013-12-05 Praxi S.p.A. +praxi + +// press : 2014-04-03 DotPress Inc. +press + +// prime : 2015-06-25 Amazon Registry Services, Inc. +prime + +// prod : 2014-01-23 Charleston Road Registry Inc. +prod + +// productions : 2013-12-05 Binky Moon, LLC +productions + +// prof : 2014-07-24 Charleston Road Registry Inc. +prof + +// progressive : 2015-07-23 Progressive Casualty Insurance Company +progressive + +// promo : 2014-12-18 Afilias Limited +promo + +// properties : 2013-12-05 Binky Moon, LLC +properties + +// property : 2014-05-22 Uniregistry, Corp. +property + +// protection : 2015-04-23 XYZ.COM LLC +protection + +// pru : 2015-07-30 Prudential Financial, Inc. +pru + +// prudential : 2015-07-30 Prudential Financial, Inc. +prudential + +// pub : 2013-12-12 Dog Beach, LLC +pub + +// pwc : 2015-10-29 PricewaterhouseCoopers LLP +pwc + +// qpon : 2013-11-14 dotCOOL, Inc. +qpon + +// quebec : 2013-12-19 PointQuébec Inc +quebec + +// quest : 2015-03-26 Quest ION Limited +quest + +// qvc : 2015-07-30 QVC, Inc. +qvc + +// racing : 2014-12-04 Premier Registry Limited +racing + +// radio : 2016-07-21 European Broadcasting Union (EBU) +radio + +// raid : 2015-07-23 Johnson Shareholdings, Inc. +raid + +// read : 2014-12-18 Amazon Registry Services, Inc. +read + +// realestate : 2015-09-11 dotRealEstate LLC +realestate + +// realtor : 2014-05-29 Real Estate Domains LLC +realtor + +// realty : 2015-03-19 Fegistry, LLC +realty + +// recipes : 2013-10-17 Binky Moon, LLC +recipes + +// red : 2013-11-07 Afilias Limited +red + +// redstone : 2014-10-31 Redstone Haute Couture Co., Ltd. +redstone + +// redumbrella : 2015-03-26 Travelers TLD, LLC +redumbrella + +// rehab : 2014-03-06 Dog Beach, LLC +rehab + +// reise : 2014-03-13 Binky Moon, LLC +reise + +// reisen : 2014-03-06 Binky Moon, LLC +reisen + +// reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc. +reit + +// reliance : 2015-04-02 Reliance Industries Limited +reliance + +// ren : 2013-12-12 Beijing Qianxiang Wangjing Technology Development Co., Ltd. +ren + +// rent : 2014-12-04 XYZ.COM LLC +rent + +// rentals : 2013-12-05 Binky Moon, LLC +rentals + +// repair : 2013-11-07 Binky Moon, LLC +repair + +// report : 2013-12-05 Binky Moon, LLC +report + +// republican : 2014-03-20 Dog Beach, LLC +republican + +// rest : 2013-12-19 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable +rest + +// restaurant : 2014-07-03 Binky Moon, LLC +restaurant + +// review : 2014-11-20 dot Review Limited +review + +// reviews : 2013-09-13 Dog Beach, LLC +reviews + +// rexroth : 2015-06-18 Robert Bosch GMBH +rexroth + +// rich : 2013-11-21 I-Registry Ltd. +rich + +// richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited +richardli + +// ricoh : 2014-11-20 Ricoh Company, Ltd. +ricoh + +// rightathome : 2015-07-23 Johnson Shareholdings, Inc. +rightathome + +// ril : 2015-04-02 Reliance Industries Limited +ril + +// rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO +rio + +// rip : 2014-07-10 Dog Beach, LLC +rip + +// rmit : 2015-11-19 Royal Melbourne Institute of Technology +rmit + +// rocher : 2014-12-18 Ferrero Trading Lux S.A. +rocher + +// rocks : 2013-11-14 Dog Beach, LLC +rocks + +// rodeo : 2013-12-19 Minds + Machines Group Limited +rodeo + +// rogers : 2015-08-06 Rogers Communications Canada Inc. +rogers + +// room : 2014-12-18 Amazon Registry Services, Inc. +room + +// rsvp : 2014-05-08 Charleston Road Registry Inc. +rsvp + +// rugby : 2016-12-15 World Rugby Strategic Developments Limited +rugby + +// ruhr : 2013-10-02 regiodot GmbH & Co. KG +ruhr + +// run : 2015-03-19 Binky Moon, LLC +run + +// rwe : 2015-04-02 RWE AG +rwe + +// ryukyu : 2014-01-09 BRregistry, Inc. +ryukyu + +// saarland : 2013-12-12 dotSaarland GmbH +saarland + +// safe : 2014-12-18 Amazon Registry Services, Inc. +safe + +// safety : 2015-01-08 Safety Registry Services, LLC. +safety + +// sakura : 2014-12-18 SAKURA Internet Inc. +sakura + +// sale : 2014-10-16 Dog Beach, LLC +sale + +// salon : 2014-12-11 Binky Moon, LLC +salon + +// samsclub : 2015-07-31 Wal-Mart Stores, Inc. +samsclub + +// samsung : 2014-04-03 SAMSUNG SDS CO., LTD +samsung + +// sandvik : 2014-11-13 Sandvik AB +sandvik + +// sandvikcoromant : 2014-11-07 Sandvik AB +sandvikcoromant + +// sanofi : 2014-10-09 Sanofi +sanofi + +// sap : 2014-03-27 SAP AG +sap + +// sarl : 2014-07-03 Binky Moon, LLC +sarl + +// sas : 2015-04-02 Research IP LLC +sas + +// save : 2015-06-25 Amazon Registry Services, Inc. +save + +// saxo : 2014-10-31 Saxo Bank A/S +saxo + +// sbi : 2015-03-12 STATE BANK OF INDIA +sbi + +// sbs : 2014-11-07 SPECIAL BROADCASTING SERVICE CORPORATION +sbs + +// sca : 2014-03-13 SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ) +sca + +// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited ("SCB") +scb + +// schaeffler : 2015-08-06 Schaeffler Technologies AG & Co. KG +schaeffler + +// schmidt : 2014-04-03 SCHMIDT GROUPE S.A.S. +schmidt + +// scholarships : 2014-04-24 Scholarships.com, LLC +scholarships + +// school : 2014-12-18 Binky Moon, LLC +school + +// schule : 2014-03-06 Binky Moon, LLC +schule + +// schwarz : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG +schwarz + +// science : 2014-09-11 dot Science Limited +science + +// scjohnson : 2015-07-23 Johnson Shareholdings, Inc. +scjohnson + +// scor : 2014-10-31 SCOR SE +scor + +// scot : 2014-01-23 Dot Scot Registry Limited +scot + +// search : 2016-06-09 Charleston Road Registry Inc. +search + +// seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal) +seat + +// secure : 2015-08-27 Amazon Registry Services, Inc. +secure + +// security : 2015-05-14 XYZ.COM LLC +security + +// seek : 2014-12-04 Seek Limited +seek + +// select : 2015-10-08 iSelect Ltd +select + +// sener : 2014-10-24 Sener Ingeniería y Sistemas, S.A. +sener + +// services : 2014-02-27 Binky Moon, LLC +services + +// ses : 2015-07-23 SES +ses + +// seven : 2015-08-06 Seven West Media Ltd +seven + +// sew : 2014-07-17 SEW-EURODRIVE GmbH & Co KG +sew + +// sex : 2014-11-13 ICM Registry SX LLC +sex + +// sexy : 2013-09-11 Uniregistry, Corp. +sexy + +// sfr : 2015-08-13 Societe Francaise du Radiotelephone - SFR +sfr + +// shangrila : 2015-09-03 Shangri‐La International Hotel Management Limited +shangrila + +// sharp : 2014-05-01 Sharp Corporation +sharp + +// shaw : 2015-04-23 Shaw Cablesystems G.P. +shaw + +// shell : 2015-07-30 Shell Information Technology International Inc +shell + +// shia : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +shia + +// shiksha : 2013-11-14 Afilias Limited +shiksha + +// shoes : 2013-10-02 Binky Moon, LLC +shoes + +// shop : 2016-04-08 GMO Registry, Inc. +shop + +// shopping : 2016-03-31 Binky Moon, LLC +shopping + +// shouji : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +shouji + +// show : 2015-03-05 Binky Moon, LLC +show + +// showtime : 2015-08-06 CBS Domains Inc. +showtime + +// shriram : 2014-01-23 Shriram Capital Ltd. +shriram + +// silk : 2015-06-25 Amazon Registry Services, Inc. +silk + +// sina : 2015-03-12 Sina Corporation +sina + +// singles : 2013-08-27 Binky Moon, LLC +singles + +// site : 2015-01-15 DotSite Inc. +site + +// ski : 2015-04-09 Afilias Limited +ski + +// skin : 2015-01-15 L'Oréal +skin + +// sky : 2014-06-19 Sky International AG +sky + +// skype : 2014-12-18 Microsoft Corporation +skype + +// sling : 2015-07-30 DISH Technologies L.L.C. +sling + +// smart : 2015-07-09 Smart Communications, Inc. (SMART) +smart + +// smile : 2014-12-18 Amazon Registry Services, Inc. +smile + +// sncf : 2015-02-19 Société Nationale des Chemins de fer Francais S N C F +sncf + +// soccer : 2015-03-26 Binky Moon, LLC +soccer + +// social : 2013-11-07 Dog Beach, LLC +social + +// softbank : 2015-07-02 SoftBank Group Corp. +softbank + +// software : 2014-03-20 Dog Beach, LLC +software + +// sohu : 2013-12-19 Sohu.com Limited +sohu + +// solar : 2013-11-07 Binky Moon, LLC +solar + +// solutions : 2013-11-07 Binky Moon, LLC +solutions + +// song : 2015-02-26 Amazon Registry Services, Inc. +song + +// sony : 2015-01-08 Sony Corporation +sony + +// soy : 2014-01-23 Charleston Road Registry Inc. +soy + +// space : 2014-04-03 DotSpace Inc. +space + +// sport : 2017-11-16 Global Association of International Sports Federations (GAISF) +sport + +// spot : 2015-02-26 Amazon Registry Services, Inc. +spot + +// spreadbetting : 2014-12-11 Dotspreadbetting Registry Limited +spreadbetting + +// srl : 2015-05-07 InterNetX, Corp +srl + +// srt : 2015-07-30 FCA US LLC. +srt + +// stada : 2014-11-13 STADA Arzneimittel AG +stada + +// staples : 2015-07-30 Staples, Inc. +staples + +// star : 2015-01-08 Star India Private Limited +star + +// starhub : 2015-02-05 StarHub Ltd +starhub + +// statebank : 2015-03-12 STATE BANK OF INDIA +statebank + +// statefarm : 2015-07-30 State Farm Mutual Automobile Insurance Company +statefarm + +// stc : 2014-10-09 Saudi Telecom Company +stc + +// stcgroup : 2014-10-09 Saudi Telecom Company +stcgroup + +// stockholm : 2014-12-18 Stockholms kommun +stockholm + +// storage : 2014-12-22 XYZ.COM LLC +storage + +// store : 2015-04-09 DotStore Inc. +store + +// stream : 2016-01-08 dot Stream Limited +stream + +// studio : 2015-02-11 Dog Beach, LLC +studio + +// study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD +study + +// style : 2014-12-04 Binky Moon, LLC +style + +// sucks : 2014-12-22 Vox Populi Registry Ltd. +sucks + +// supplies : 2013-12-19 Binky Moon, LLC +supplies + +// supply : 2013-12-19 Binky Moon, LLC +supply + +// support : 2013-10-24 Binky Moon, LLC +support + +// surf : 2014-01-09 Minds + Machines Group Limited +surf + +// surgery : 2014-03-20 Binky Moon, LLC +surgery + +// suzuki : 2014-02-20 SUZUKI MOTOR CORPORATION +suzuki + +// swatch : 2015-01-08 The Swatch Group Ltd +swatch + +// swiftcover : 2015-07-23 Swiftcover Insurance Services Limited +swiftcover + +// swiss : 2014-10-16 Swiss Confederation +swiss + +// sydney : 2014-09-18 State of New South Wales, Department of Premier and Cabinet +sydney + +// symantec : 2014-12-04 Symantec Corporation +symantec + +// systems : 2013-11-07 Binky Moon, LLC +systems + +// tab : 2014-12-04 Tabcorp Holdings Limited +tab + +// taipei : 2014-07-10 Taipei City Government +taipei + +// talk : 2015-04-09 Amazon Registry Services, Inc. +talk + +// taobao : 2015-01-15 Alibaba Group Holding Limited +taobao + +// target : 2015-07-31 Target Domain Holdings, LLC +target + +// tatamotors : 2015-03-12 Tata Motors Ltd +tatamotors + +// tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" +tatar + +// tattoo : 2013-08-30 Uniregistry, Corp. +tattoo + +// tax : 2014-03-20 Binky Moon, LLC +tax + +// taxi : 2015-03-19 Binky Moon, LLC +taxi + +// tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +tci + +// tdk : 2015-06-11 TDK Corporation +tdk + +// team : 2015-03-05 Binky Moon, LLC +team + +// tech : 2015-01-30 Personals TLD Inc. +tech + +// technology : 2013-09-13 Binky Moon, LLC +technology + +// telefonica : 2014-10-16 Telefónica S.A. +telefonica + +// temasek : 2014-08-07 Temasek Holdings (Private) Limited +temasek + +// tennis : 2014-12-04 Binky Moon, LLC +tennis + +// teva : 2015-07-02 Teva Pharmaceutical Industries Limited +teva + +// thd : 2015-04-02 Home Depot Product Authority, LLC +thd + +// theater : 2015-03-19 Binky Moon, LLC +theater + +// theatre : 2015-05-07 XYZ.COM LLC +theatre + +// tiaa : 2015-07-23 Teachers Insurance and Annuity Association of America +tiaa + +// tickets : 2015-02-05 Accent Media Limited +tickets + +// tienda : 2013-11-14 Binky Moon, LLC +tienda + +// tiffany : 2015-01-30 Tiffany and Company +tiffany + +// tips : 2013-09-20 Binky Moon, LLC +tips + +// tires : 2014-11-07 Binky Moon, LLC +tires + +// tirol : 2014-04-24 punkt Tirol GmbH +tirol + +// tjmaxx : 2015-07-16 The TJX Companies, Inc. +tjmaxx + +// tjx : 2015-07-16 The TJX Companies, Inc. +tjx + +// tkmaxx : 2015-07-16 The TJX Companies, Inc. +tkmaxx + +// tmall : 2015-01-15 Alibaba Group Holding Limited +tmall + +// today : 2013-09-20 Binky Moon, LLC +today + +// tokyo : 2013-11-13 GMO Registry, Inc. +tokyo + +// tools : 2013-11-21 Binky Moon, LLC +tools + +// top : 2014-03-20 .TOP Registry +top + +// toray : 2014-12-18 Toray Industries, Inc. +toray + +// toshiba : 2014-04-10 TOSHIBA Corporation +toshiba + +// total : 2015-08-06 Total SA +total + +// tours : 2015-01-22 Binky Moon, LLC +tours + +// town : 2014-03-06 Binky Moon, LLC +town + +// toyota : 2015-04-23 TOYOTA MOTOR CORPORATION +toyota + +// toys : 2014-03-06 Binky Moon, LLC +toys + +// trade : 2014-01-23 Elite Registry Limited +trade + +// trading : 2014-12-11 Dottrading Registry Limited +trading + +// training : 2013-11-07 Binky Moon, LLC +training + +// travel : Dog Beach, LLC +travel + +// travelchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. +travelchannel + +// travelers : 2015-03-26 Travelers TLD, LLC +travelers + +// travelersinsurance : 2015-03-26 Travelers TLD, LLC +travelersinsurance + +// trust : 2014-10-16 NCC Group Inc. +trust + +// trv : 2015-03-26 Travelers TLD, LLC +trv + +// tube : 2015-06-11 Latin American Telecom LLC +tube + +// tui : 2014-07-03 TUI AG +tui + +// tunes : 2015-02-26 Amazon Registry Services, Inc. +tunes + +// tushu : 2014-12-18 Amazon Registry Services, Inc. +tushu + +// tvs : 2015-02-19 T V SUNDRAM IYENGAR & SONS LIMITED +tvs + +// ubank : 2015-08-20 National Australia Bank Limited +ubank + +// ubs : 2014-12-11 UBS AG +ubs + +// uconnect : 2015-07-30 FCA US LLC. +uconnect + +// unicom : 2015-10-15 China United Network Communications Corporation Limited +unicom + +// university : 2014-03-06 Binky Moon, LLC +university + +// uno : 2013-09-11 Dot Latin LLC +uno + +// uol : 2014-05-01 UBN INTERNET LTDA. +uol + +// ups : 2015-06-25 UPS Market Driver, Inc. +ups + +// vacations : 2013-12-05 Binky Moon, LLC +vacations + +// vana : 2014-12-11 Lifestyle Domain Holdings, Inc. +vana + +// vanguard : 2015-09-03 The Vanguard Group, Inc. +vanguard + +// vegas : 2014-01-16 Dot Vegas, Inc. +vegas + +// ventures : 2013-08-27 Binky Moon, LLC +ventures + +// verisign : 2015-08-13 VeriSign, Inc. +verisign + +// versicherung : 2014-03-20 tldbox GmbH +versicherung + +// vet : 2014-03-06 Dog Beach, LLC +vet + +// viajes : 2013-10-17 Binky Moon, LLC +viajes + +// video : 2014-10-16 Dog Beach, LLC +video + +// vig : 2015-05-14 VIENNA INSURANCE GROUP AG Wiener Versicherung Gruppe +vig + +// viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd. +viking + +// villas : 2013-12-05 Binky Moon, LLC +villas + +// vin : 2015-06-18 Binky Moon, LLC +vin + +// vip : 2015-01-22 Minds + Machines Group Limited +vip + +// virgin : 2014-09-25 Virgin Enterprises Limited +virgin + +// visa : 2015-07-30 Visa Worldwide Pte. Limited +visa + +// vision : 2013-12-05 Binky Moon, LLC +vision + +// vistaprint : 2014-09-18 Vistaprint Limited +vistaprint + +// viva : 2014-11-07 Saudi Telecom Company +viva + +// vivo : 2015-07-31 Telefonica Brasil S.A. +vivo + +// vlaanderen : 2014-02-06 DNS.be vzw +vlaanderen + +// vodka : 2013-12-19 Minds + Machines Group Limited +vodka + +// volkswagen : 2015-05-14 Volkswagen Group of America Inc. +volkswagen + +// volvo : 2015-11-12 Volvo Holding Sverige Aktiebolag +volvo + +// vote : 2013-11-21 Monolith Registry LLC +vote + +// voting : 2013-11-13 Valuetainment Corp. +voting + +// voto : 2013-11-21 Monolith Registry LLC +voto + +// voyage : 2013-08-27 Binky Moon, LLC +voyage + +// vuelos : 2015-03-05 Travel Reservations SRL +vuelos + +// wales : 2014-05-08 Nominet UK +wales + +// walmart : 2015-07-31 Wal-Mart Stores, Inc. +walmart + +// walter : 2014-11-13 Sandvik AB +walter + +// wang : 2013-10-24 Zodiac Wang Limited +wang + +// wanggou : 2014-12-18 Amazon Registry Services, Inc. +wanggou + +// warman : 2015-06-18 Weir Group IP Limited +warman + +// watch : 2013-11-14 Binky Moon, LLC +watch + +// watches : 2014-12-22 Richemont DNS Inc. +watches + +// weather : 2015-01-08 International Business Machines Corporation +weather + +// weatherchannel : 2015-03-12 International Business Machines Corporation +weatherchannel + +// webcam : 2014-01-23 dot Webcam Limited +webcam + +// weber : 2015-06-04 Saint-Gobain Weber SA +weber + +// website : 2014-04-03 DotWebsite Inc. +website + +// wed : 2013-10-01 Atgron, Inc. +wed + +// wedding : 2014-04-24 Minds + Machines Group Limited +wedding + +// weibo : 2015-03-05 Sina Corporation +weibo + +// weir : 2015-01-29 Weir Group IP Limited +weir + +// whoswho : 2014-02-20 Who's Who Registry +whoswho + +// wien : 2013-10-28 punkt.wien GmbH +wien + +// wiki : 2013-11-07 Top Level Design, LLC +wiki + +// williamhill : 2014-03-13 William Hill Organization Limited +williamhill + +// win : 2014-11-20 First Registry Limited +win + +// windows : 2014-12-18 Microsoft Corporation +windows + +// wine : 2015-06-18 Binky Moon, LLC +wine + +// winners : 2015-07-16 The TJX Companies, Inc. +winners + +// wme : 2014-02-13 William Morris Endeavor Entertainment, LLC +wme + +// wolterskluwer : 2015-08-06 Wolters Kluwer N.V. +wolterskluwer + +// woodside : 2015-07-09 Woodside Petroleum Limited +woodside + +// work : 2013-12-19 Minds + Machines Group Limited +work + +// works : 2013-11-14 Binky Moon, LLC +works + +// world : 2014-06-12 Binky Moon, LLC +world + +// wow : 2015-10-08 Amazon Registry Services, Inc. +wow + +// wtc : 2013-12-19 World Trade Centers Association, Inc. +wtc + +// wtf : 2014-03-06 Binky Moon, LLC +wtf + +// xbox : 2014-12-18 Microsoft Corporation +xbox + +// xerox : 2014-10-24 Xerox DNHC LLC +xerox + +// xfinity : 2015-07-09 Comcast IP Holdings I, LLC +xfinity + +// xihuan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +xihuan + +// xin : 2014-12-11 Elegant Leader Limited +xin + +// xn--11b4c3d : 2015-01-15 VeriSign Sarl +कॉम + +// xn--1ck2e1b : 2015-02-26 Amazon Registry Services, Inc. +セール + +// xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd. +佛山 + +// xn--30rr7y : 2014-06-12 Excellent First Limited +慈善 + +// xn--3bst00m : 2013-09-13 Eagle Horizon Limited +集团 + +// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED +在线 + +// xn--3oq18vl8pn36a : 2015-07-02 Volkswagen (China) Investment Co., Ltd. +大众汽车 + +// xn--3pxu8k : 2015-01-15 VeriSign Sarl +点看 + +// xn--42c2d9a : 2015-01-15 VeriSign Sarl +คอม + +// xn--45q11c : 2013-11-21 Zodiac Gemini Ltd +八卦 + +// xn--4gbrim : 2013-10-04 Suhub Electronic Establishment +موقع + +// xn--55qw42g : 2013-11-08 China Organizational Name Administration Center +公益 + +// xn--55qx5d : 2013-11-14 China Internet Network Information Center (CNNIC) +公司 + +// xn--5su34j936bgsg : 2015-09-03 Shangri‐La International Hotel Management Limited +香格里拉 + +// xn--5tzm5g : 2014-12-22 Global Website TLD Asia Limited +网站 + +// xn--6frz82g : 2013-09-23 Afilias Limited +移动 + +// xn--6qq986b3xl : 2013-09-13 Tycoon Treasure Limited +我爱你 + +// xn--80adxhks : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) +москва + +// xn--80aqecdr1a : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +католик + +// xn--80asehdb : 2013-07-14 CORE Association +онлайн + +// xn--80aswg : 2013-07-14 CORE Association +сайт + +// xn--8y0a063a : 2015-03-26 China United Network Communications Corporation Limited +联通 + +// xn--9dbq2a : 2015-01-15 VeriSign Sarl +קום + +// xn--9et52u : 2014-06-12 RISE VICTORY LIMITED +时尚 + +// xn--9krt00a : 2015-03-12 Sina Corporation +微博 + +// xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited +淡马锡 + +// xn--bck1b9a5dre4c : 2015-02-26 Amazon Registry Services, Inc. +ファッション + +// xn--c1avg : 2013-11-14 Public Interest Registry +орг + +// xn--c2br7g : 2015-01-15 VeriSign Sarl +नेट + +// xn--cck2b3b : 2015-02-26 Amazon Registry Services, Inc. +ストア + +// xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD +삼성 + +// xn--czr694b : 2014-01-16 Dot Trademark TLD Holding Company Limited +商标 + +// xn--czrs0t : 2013-12-19 Binky Moon, LLC +商店 + +// xn--czru2d : 2013-11-21 Zodiac Aquarius Limited +商城 + +// xn--d1acj3b : 2013-11-20 The Foundation for Network Initiatives “The Smart Internet” +дети + +// xn--eckvdtc9d : 2014-12-18 Amazon Registry Services, Inc. +ポイント + +// xn--efvy88h : 2014-08-22 Guangzhou YU Wei Information Technology Co., Ltd. +新闻 + +// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited +工行 + +// xn--fct429k : 2015-04-09 Amazon Registry Services, Inc. +家電 + +// xn--fhbei : 2015-01-15 VeriSign Sarl +كوم + +// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED +中文网 + +// xn--fiq64b : 2013-10-14 CITIC Group Corporation +中信 + +// xn--fjq720a : 2014-05-22 Binky Moon, LLC +娱乐 + +// xn--flw351e : 2014-07-31 Charleston Road Registry Inc. +谷歌 + +// xn--fzys8d69uvgm : 2015-05-14 PCCW Enterprises Limited +電訊盈科 + +// xn--g2xx48c : 2015-01-30 Minds + Machines Group Limited +购物 + +// xn--gckr3f0f : 2015-02-26 Amazon Registry Services, Inc. +クラウド + +// xn--gk3at1e : 2015-10-08 Amazon Registry Services, Inc. +通販 + +// xn--hxt814e : 2014-05-15 Zodiac Taurus Limited +网店 + +// xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry +संगठन + +// xn--imr513n : 2014-12-11 Dot Trademark TLD Holding Company Limited +餐厅 + +// xn--io0a7i : 2013-11-14 China Internet Network Information Center (CNNIC) +网络 + +// xn--j1aef : 2015-01-15 VeriSign Sarl +ком + +// xn--jlq61u9w7b : 2015-01-08 Nokia Corporation +诺基亚 + +// xn--jvr189m : 2015-02-26 Amazon Registry Services, Inc. +食品 + +// xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V. +飞利浦 + +// xn--kpu716f : 2014-12-22 Richemont DNS Inc. +手表 + +// xn--kput3i : 2014-02-13 Beijing RITT-Net Technology Development Co., Ltd +手机 + +// xn--mgba3a3ejt : 2014-11-20 Aramco Services Company +ارامكو + +// xn--mgba7c0bbn0a : 2015-05-14 Crescent Holding GmbH +العليان + +// xn--mgbaakc7dvf : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat) +اتصالات + +// xn--mgbab2bd : 2013-10-31 CORE Association +بازار + +// xn--mgbb9fbpob : 2014-12-18 GreenTech Consultancy Company W.L.L. +موبايلي + +// xn--mgbca7dzdo : 2015-07-30 Abu Dhabi Systems and Information Centre +ابوظبي + +// xn--mgbi4ecexp : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +كاثوليك + +// xn--mgbt3dhd : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. +همراه + +// xn--mk1bu44c : 2015-01-15 VeriSign Sarl +닷컴 + +// xn--mxtq1m : 2014-03-06 Net-Chinese Co., Ltd. +政府 + +// xn--ngbc5azd : 2013-07-13 International Domain Registry Pty. Ltd. +شبكة + +// xn--ngbe9e0a : 2014-12-04 Kuwait Finance House +بيتك + +// xn--ngbrx : 2015-11-12 League of Arab States +عرب + +// xn--nqv7f : 2013-11-14 Public Interest Registry +机构 + +// xn--nqv7fs00ema : 2013-11-14 Public Interest Registry +组织机构 + +// xn--nyqy26a : 2014-11-07 Stable Tone Limited +健康 + +// xn--otu796d : 2017-08-06 Dot Trademark TLD Holding Company Limited +招聘 + +// xn--p1acf : 2013-12-12 Rusnames Limited +рус + +// xn--pbt977c : 2014-12-22 Richemont DNS Inc. +珠宝 + +// xn--pssy2u : 2015-01-15 VeriSign Sarl +大拿 + +// xn--q9jyb4c : 2013-09-17 Charleston Road Registry Inc. +みんな + +// xn--qcka1pmc : 2014-07-31 Charleston Road Registry Inc. +グーグル + +// xn--rhqv96g : 2013-09-11 Stable Tone Limited +世界 + +// xn--rovu88b : 2015-02-26 Amazon Registry Services, Inc. +書籍 + +// xn--ses554g : 2014-01-16 KNET Co., Ltd. +网址 + +// xn--t60b56a : 2015-01-15 VeriSign Sarl +닷넷 + +// xn--tckwe : 2015-01-15 VeriSign Sarl +コム + +// xn--tiq49xqyj : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) +天主教 + +// xn--unup4y : 2013-07-14 Binky Moon, LLC +游戏 + +// xn--vermgensberater-ctb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +vermögensberater + +// xn--vermgensberatung-pwb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG +vermögensberatung + +// xn--vhquv : 2013-08-27 Binky Moon, LLC +企业 + +// xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd. +信息 + +// xn--w4r85el8fhu5dnra : 2015-04-30 Kerry Trading Co. Limited +嘉里大酒店 + +// xn--w4rs40l : 2015-07-30 Kerry Trading Co. Limited +嘉里 + +// xn--xhq521b : 2013-11-14 Guangzhou YU Wei Information Technology Co., Ltd. +广东 + +// xn--zfr164b : 2013-11-08 China Organizational Name Administration Center +政务 + +// xyz : 2013-12-05 XYZ.COM LLC +xyz + +// yachts : 2014-01-09 DERYachts, LLC +yachts + +// yahoo : 2015-04-02 Yahoo! Domain Services Inc. +yahoo + +// yamaxun : 2014-12-18 Amazon Registry Services, Inc. +yamaxun + +// yandex : 2014-04-10 YANDEX, LLC +yandex + +// yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD. +yodobashi + +// yoga : 2014-05-29 Minds + Machines Group Limited +yoga + +// yokohama : 2013-12-12 GMO Registry, Inc. +yokohama + +// you : 2015-04-09 Amazon Registry Services, Inc. +you + +// youtube : 2014-05-01 Charleston Road Registry Inc. +youtube + +// yun : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +yun + +// zappos : 2015-06-25 Amazon Registry Services, Inc. +zappos + +// zara : 2014-11-07 Industria de Diseño Textil, S.A. (INDITEX, S.A.) +zara + +// zero : 2014-12-18 Amazon Registry Services, Inc. +zero + +// zip : 2014-05-08 Charleston Road Registry Inc. +zip + +// zone : 2013-11-14 Binky Moon, LLC +zone + +// zuerich : 2014-11-07 Kanton Zürich (Canton of Zurich) +zuerich + + +// ===END ICANN DOMAINS=== +// ===BEGIN PRIVATE DOMAINS=== +// (Note: these are in alphabetical order by company name) + +// 1GB LLC : https://www.1gb.ua/ +// Submitted by 1GB LLC +cc.ua +inf.ua +ltd.ua + +// Agnat sp. z o.o. : https://domena.pl +// Submitted by Przemyslaw Plewa +beep.pl + +// alboto.ca : http://alboto.ca +// Submitted by Anton Avramov +barsy.ca + +// Alces Software Ltd : http://alces-software.com +// Submitted by Mark J. Titorenko +*.compute.estate +*.alces.network + +// alwaysdata : https://www.alwaysdata.com +// Submitted by Cyril +alwaysdata.net + +// Amazon CloudFront : https://aws.amazon.com/cloudfront/ +// Submitted by Donavan Miller +cloudfront.net + +// Amazon Elastic Compute Cloud : https://aws.amazon.com/ec2/ +// Submitted by Luke Wells +*.compute.amazonaws.com +*.compute-1.amazonaws.com +*.compute.amazonaws.com.cn +us-east-1.amazonaws.com + +// Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/ +// Submitted by Luke Wells +cn-north-1.eb.amazonaws.com.cn +cn-northwest-1.eb.amazonaws.com.cn +elasticbeanstalk.com +ap-northeast-1.elasticbeanstalk.com +ap-northeast-2.elasticbeanstalk.com +ap-northeast-3.elasticbeanstalk.com +ap-south-1.elasticbeanstalk.com +ap-southeast-1.elasticbeanstalk.com +ap-southeast-2.elasticbeanstalk.com +ca-central-1.elasticbeanstalk.com +eu-central-1.elasticbeanstalk.com +eu-west-1.elasticbeanstalk.com +eu-west-2.elasticbeanstalk.com +eu-west-3.elasticbeanstalk.com +sa-east-1.elasticbeanstalk.com +us-east-1.elasticbeanstalk.com +us-east-2.elasticbeanstalk.com +us-gov-west-1.elasticbeanstalk.com +us-west-1.elasticbeanstalk.com +us-west-2.elasticbeanstalk.com + +// Amazon Elastic Load Balancing : https://aws.amazon.com/elasticloadbalancing/ +// Submitted by Luke Wells +*.elb.amazonaws.com +*.elb.amazonaws.com.cn + +// Amazon S3 : https://aws.amazon.com/s3/ +// Submitted by Luke Wells +s3.amazonaws.com +s3-ap-northeast-1.amazonaws.com +s3-ap-northeast-2.amazonaws.com +s3-ap-south-1.amazonaws.com +s3-ap-southeast-1.amazonaws.com +s3-ap-southeast-2.amazonaws.com +s3-ca-central-1.amazonaws.com +s3-eu-central-1.amazonaws.com +s3-eu-west-1.amazonaws.com +s3-eu-west-2.amazonaws.com +s3-eu-west-3.amazonaws.com +s3-external-1.amazonaws.com +s3-fips-us-gov-west-1.amazonaws.com +s3-sa-east-1.amazonaws.com +s3-us-gov-west-1.amazonaws.com +s3-us-east-2.amazonaws.com +s3-us-west-1.amazonaws.com +s3-us-west-2.amazonaws.com +s3.ap-northeast-2.amazonaws.com +s3.ap-south-1.amazonaws.com +s3.cn-north-1.amazonaws.com.cn +s3.ca-central-1.amazonaws.com +s3.eu-central-1.amazonaws.com +s3.eu-west-2.amazonaws.com +s3.eu-west-3.amazonaws.com +s3.us-east-2.amazonaws.com +s3.dualstack.ap-northeast-1.amazonaws.com +s3.dualstack.ap-northeast-2.amazonaws.com +s3.dualstack.ap-south-1.amazonaws.com +s3.dualstack.ap-southeast-1.amazonaws.com +s3.dualstack.ap-southeast-2.amazonaws.com +s3.dualstack.ca-central-1.amazonaws.com +s3.dualstack.eu-central-1.amazonaws.com +s3.dualstack.eu-west-1.amazonaws.com +s3.dualstack.eu-west-2.amazonaws.com +s3.dualstack.eu-west-3.amazonaws.com +s3.dualstack.sa-east-1.amazonaws.com +s3.dualstack.us-east-1.amazonaws.com +s3.dualstack.us-east-2.amazonaws.com +s3-website-us-east-1.amazonaws.com +s3-website-us-west-1.amazonaws.com +s3-website-us-west-2.amazonaws.com +s3-website-ap-northeast-1.amazonaws.com +s3-website-ap-southeast-1.amazonaws.com +s3-website-ap-southeast-2.amazonaws.com +s3-website-eu-west-1.amazonaws.com +s3-website-sa-east-1.amazonaws.com +s3-website.ap-northeast-2.amazonaws.com +s3-website.ap-south-1.amazonaws.com +s3-website.ca-central-1.amazonaws.com +s3-website.eu-central-1.amazonaws.com +s3-website.eu-west-2.amazonaws.com +s3-website.eu-west-3.amazonaws.com +s3-website.us-east-2.amazonaws.com + +// Amune : https://amune.org/ +// Submitted by Team Amune +t3l3p0rt.net +tele.amune.org + +// Apigee : https://apigee.com/ +// Submitted by Apigee Security Team +apigee.io + +// Aptible : https://www.aptible.com/ +// Submitted by Thomas Orozco +on-aptible.com + +// Asociación Amigos de la Informática "Euskalamiga" : http://encounter.eus/ +// Submitted by Hector Martin +user.party.eus + +// Association potager.org : https://potager.org/ +// Submitted by Lunar +pimienta.org +poivron.org +potager.org +sweetpepper.org + +// ASUSTOR Inc. : http://www.asustor.com +// Submitted by Vincent Tseng +myasustor.com + +// Automattic Inc. : https://automattic.com/ +// Submitted by Alex Concha +go-vip.co +go-vip.net +wpcomstaging.com + +// AVM : https://avm.de +// Submitted by Andreas Weise +myfritz.net + +// AW AdvisorWebsites.com Software Inc : https://advisorwebsites.com +// Submitted by James Kennedy +*.awdev.ca +*.advisor.ws + +// b-data GmbH : https://www.b-data.io +// Submitted by Olivier Benz +b-data.io + +// backplane : https://www.backplane.io +// Submitted by Anthony Voutas +backplaneapp.io + +// Balena : https://www.balena.io +// Submitted by Petros Angelatos +balena-devices.com + +// Banzai Cloud +// Submitted by Gabor Kozma +app.banzaicloud.io + +// BetaInABox +// Submitted by Adrian +betainabox.com + +// BinaryLane : http://www.binarylane.com +// Submitted by Nathan O'Sullivan +bnr.la + +// Blackbaud, Inc. : https://www.blackbaud.com +// Submitted by Paul Crowder +blackbaudcdn.net + +// Boomla : https://boomla.com +// Submitted by Tibor Halter +boomla.net + +// Boxfuse : https://boxfuse.com +// Submitted by Axel Fontaine +boxfuse.io + +// bplaced : https://www.bplaced.net/ +// Submitted by Miroslav Bozic +square7.ch +bplaced.com +bplaced.de +square7.de +bplaced.net +square7.net + +// BrowserSafetyMark +// Submitted by Dave Tharp +browsersafetymark.io + +// Bytemark Hosting : https://www.bytemark.co.uk +// Submitted by Paul Cammish +uk0.bigv.io +dh.bytemark.co.uk +vm.bytemark.co.uk + +// callidomus : https://www.callidomus.com/ +// Submitted by Marcus Popp +mycd.eu + +// Carrd : https://carrd.co +// Submitted by AJ +carrd.co +crd.co +uwu.ai + +// CentralNic : http://www.centralnic.com/names/domains +// Submitted by registry +ae.org +ar.com +br.com +cn.com +com.de +com.se +de.com +eu.com +gb.com +gb.net +hu.com +hu.net +jp.net +jpn.com +kr.com +mex.com +no.com +qc.com +ru.com +sa.com +se.net +uk.com +uk.net +us.com +uy.com +za.bz +za.com + +// Africa.com Web Solutions Ltd : https://registry.africa.com +// Submitted by Gavin Brown +africa.com + +// iDOT Services Limited : http://www.domain.gr.com +// Submitted by Gavin Brown +gr.com + +// Radix FZC : http://domains.in.net +// Submitted by Gavin Brown +in.net + +// US REGISTRY LLC : http://us.org +// Submitted by Gavin Brown +us.org + +// co.com Registry, LLC : https://registry.co.com +// Submitted by Gavin Brown +co.com + +// c.la : http://www.c.la/ +c.la + +// certmgr.org : https://certmgr.org +// Submitted by B. Blechschmidt +certmgr.org + +// Citrix : https://citrix.com +// Submitted by Alex Stoddard +xenapponazure.com + +// Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/ +// Submitted by Rishabh Nambiar +discourse.group + +// ClearVox : http://www.clearvox.nl/ +// Submitted by Leon Rowland +virtueeldomein.nl + +// Clever Cloud : https://www.clever-cloud.com/ +// Submitted by Quentin Adam +cleverapps.io + +// Clerk : https://www.clerk.dev +// Submitted by Colin Sidoti +*.lcl.dev +*.stg.dev + +// Cloud66 : https://www.cloud66.com/ +// Submitted by Khash Sajadi +c66.me +cloud66.ws +cloud66.zone + +// CloudAccess.net : https://www.cloudaccess.net/ +// Submitted by Pawel Panek +jdevcloud.com +wpdevcloud.com +cloudaccess.host +freesite.host +cloudaccess.net + +// cloudControl : https://www.cloudcontrol.com/ +// Submitted by Tobias Wilken +cloudcontrolled.com +cloudcontrolapp.com + +// Cloudera, Inc. : https://www.cloudera.com/ +// Submitted by Philip Langdale +cloudera.site + +// Cloudflare, Inc. : https://www.cloudflare.com/ +// Submitted by Jake Riesterer +trycloudflare.com +workers.dev + +// Clovyr : https://clovyr.io +// Submitted by Patrick Nielsen +wnext.app + +// co.ca : http://registry.co.ca/ +co.ca + +// Co & Co : https://co-co.nl/ +// Submitted by Govert Versluis +*.otap.co + +// i-registry s.r.o. : http://www.i-registry.cz/ +// Submitted by Martin Semrad +co.cz + +// CDN77.com : http://www.cdn77.com +// Submitted by Jan Krpes +c.cdn77.org +cdn77-ssl.net +r.cdn77.net +rsc.cdn77.org +ssl.origin.cdn77-secure.org + +// Cloud DNS Ltd : http://www.cloudns.net +// Submitted by Aleksander Hristov +cloudns.asia +cloudns.biz +cloudns.club +cloudns.cc +cloudns.eu +cloudns.in +cloudns.info +cloudns.org +cloudns.pro +cloudns.pw +cloudns.us + +// Cloudeity Inc : https://cloudeity.com +// Submitted by Stefan Dimitrov +cloudeity.net + +// CNPY : https://cnpy.gdn +// Submitted by Angelo Gladding +cnpy.gdn + +// CoDNS B.V. +co.nl +co.no + +// Combell.com : https://www.combell.com +// Submitted by Thomas Wouters +webhosting.be +hosting-cluster.nl + +// COSIMO GmbH : http://www.cosimo.de +// Submitted by Rene Marticke +dyn.cosidns.de +dynamisches-dns.de +dnsupdater.de +internet-dns.de +l-o-g-i-n.de +dynamic-dns.info +feste-ip.net +knx-server.net +static-access.net + +// Craynic, s.r.o. : http://www.craynic.com/ +// Submitted by Ales Krajnik +realm.cz + +// Cryptonomic : https://cryptonomic.net/ +// Submitted by Andrew Cady +*.cryptonomic.net + +// Cupcake : https://cupcake.io/ +// Submitted by Jonathan Rudenberg +cupcake.is + +// cyon GmbH : https://www.cyon.ch/ +// Submitted by Dominic Luechinger +cyon.link +cyon.site + +// Daplie, Inc : https://daplie.com +// Submitted by AJ ONeal +daplie.me +localhost.daplie.me + +// Datto, Inc. : https://www.datto.com/ +// Submitted by Philipp Heckel +dattolocal.com +dattorelay.com +dattoweb.com +mydatto.com +dattolocal.net +mydatto.net + +// Dansk.net : http://www.dansk.net/ +// Submitted by Anani Voule +biz.dk +co.dk +firm.dk +reg.dk +store.dk + +// dapps.earth : https://dapps.earth/ +// Submitted by Daniil Burdakov +*.dapps.earth +*.bzz.dapps.earth + +// Debian : https://www.debian.org/ +// Submitted by Peter Palfrader / Debian Sysadmin Team +debian.net + +// deSEC : https://desec.io/ +// Submitted by Peter Thomassen +dedyn.io + +// DNShome : https://www.dnshome.de/ +// Submitted by Norbert Auler +dnshome.de + +// DotArai : https://www.dotarai.com/ +// Submitted by Atsadawat Netcharadsang +online.th +shop.th + +// DrayTek Corp. : https://www.draytek.com/ +// Submitted by Paul Fang +drayddns.com + +// DreamHost : http://www.dreamhost.com/ +// Submitted by Andrew Farmer +dreamhosters.com + +// Drobo : http://www.drobo.com/ +// Submitted by Ricardo Padilha +mydrobo.com + +// Drud Holdings, LLC. : https://www.drud.com/ +// Submitted by Kevin Bridges +drud.io +drud.us + +// DuckDNS : http://www.duckdns.org/ +// Submitted by Richard Harper +duckdns.org + +// dy.fi : http://dy.fi/ +// Submitted by Heikki Hannikainen +dy.fi +tunk.org + +// DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ +dyndns-at-home.com +dyndns-at-work.com +dyndns-blog.com +dyndns-free.com +dyndns-home.com +dyndns-ip.com +dyndns-mail.com +dyndns-office.com +dyndns-pics.com +dyndns-remote.com +dyndns-server.com +dyndns-web.com +dyndns-wiki.com +dyndns-work.com +dyndns.biz +dyndns.info +dyndns.org +dyndns.tv +at-band-camp.net +ath.cx +barrel-of-knowledge.info +barrell-of-knowledge.info +better-than.tv +blogdns.com +blogdns.net +blogdns.org +blogsite.org +boldlygoingnowhere.org +broke-it.net +buyshouses.net +cechire.com +dnsalias.com +dnsalias.net +dnsalias.org +dnsdojo.com +dnsdojo.net +dnsdojo.org +does-it.net +doesntexist.com +doesntexist.org +dontexist.com +dontexist.net +dontexist.org +doomdns.com +doomdns.org +dvrdns.org +dyn-o-saur.com +dynalias.com +dynalias.net +dynalias.org +dynathome.net +dyndns.ws +endofinternet.net +endofinternet.org +endoftheinternet.org +est-a-la-maison.com +est-a-la-masion.com +est-le-patron.com +est-mon-blogueur.com +for-better.biz +for-more.biz +for-our.info +for-some.biz +for-the.biz +forgot.her.name +forgot.his.name +from-ak.com +from-al.com +from-ar.com +from-az.net +from-ca.com +from-co.net +from-ct.com +from-dc.com +from-de.com +from-fl.com +from-ga.com +from-hi.com +from-ia.com +from-id.com +from-il.com +from-in.com +from-ks.com +from-ky.com +from-la.net +from-ma.com +from-md.com +from-me.org +from-mi.com +from-mn.com +from-mo.com +from-ms.com +from-mt.com +from-nc.com +from-nd.com +from-ne.com +from-nh.com +from-nj.com +from-nm.com +from-nv.com +from-ny.net +from-oh.com +from-ok.com +from-or.com +from-pa.com +from-pr.com +from-ri.com +from-sc.com +from-sd.com +from-tn.com +from-tx.com +from-ut.com +from-va.com +from-vt.com +from-wa.com +from-wi.com +from-wv.com +from-wy.com +ftpaccess.cc +fuettertdasnetz.de +game-host.org +game-server.cc +getmyip.com +gets-it.net +go.dyndns.org +gotdns.com +gotdns.org +groks-the.info +groks-this.info +ham-radio-op.net +here-for-more.info +hobby-site.com +hobby-site.org +home.dyndns.org +homedns.org +homeftp.net +homeftp.org +homeip.net +homelinux.com +homelinux.net +homelinux.org +homeunix.com +homeunix.net +homeunix.org +iamallama.com +in-the-band.net +is-a-anarchist.com +is-a-blogger.com +is-a-bookkeeper.com +is-a-bruinsfan.org +is-a-bulls-fan.com +is-a-candidate.org +is-a-caterer.com +is-a-celticsfan.org +is-a-chef.com +is-a-chef.net +is-a-chef.org +is-a-conservative.com +is-a-cpa.com +is-a-cubicle-slave.com +is-a-democrat.com +is-a-designer.com +is-a-doctor.com +is-a-financialadvisor.com +is-a-geek.com +is-a-geek.net +is-a-geek.org +is-a-green.com +is-a-guru.com +is-a-hard-worker.com +is-a-hunter.com +is-a-knight.org +is-a-landscaper.com +is-a-lawyer.com +is-a-liberal.com +is-a-libertarian.com +is-a-linux-user.org +is-a-llama.com +is-a-musician.com +is-a-nascarfan.com +is-a-nurse.com +is-a-painter.com +is-a-patsfan.org +is-a-personaltrainer.com +is-a-photographer.com +is-a-player.com +is-a-republican.com +is-a-rockstar.com +is-a-socialist.com +is-a-soxfan.org +is-a-student.com +is-a-teacher.com +is-a-techie.com +is-a-therapist.com +is-an-accountant.com +is-an-actor.com +is-an-actress.com +is-an-anarchist.com +is-an-artist.com +is-an-engineer.com +is-an-entertainer.com +is-by.us +is-certified.com +is-found.org +is-gone.com +is-into-anime.com +is-into-cars.com +is-into-cartoons.com +is-into-games.com +is-leet.com +is-lost.org +is-not-certified.com +is-saved.org +is-slick.com +is-uberleet.com +is-very-bad.org +is-very-evil.org +is-very-good.org +is-very-nice.org +is-very-sweet.org +is-with-theband.com +isa-geek.com +isa-geek.net +isa-geek.org +isa-hockeynut.com +issmarterthanyou.com +isteingeek.de +istmein.de +kicks-ass.net +kicks-ass.org +knowsitall.info +land-4-sale.us +lebtimnetz.de +leitungsen.de +likes-pie.com +likescandy.com +merseine.nu +mine.nu +misconfused.org +mypets.ws +myphotos.cc +neat-url.com +office-on-the.net +on-the-web.tv +podzone.net +podzone.org +readmyblog.org +saves-the-whales.com +scrapper-site.net +scrapping.cc +selfip.biz +selfip.com +selfip.info +selfip.net +selfip.org +sells-for-less.com +sells-for-u.com +sells-it.net +sellsyourhome.org +servebbs.com +servebbs.net +servebbs.org +serveftp.net +serveftp.org +servegame.org +shacknet.nu +simple-url.com +space-to-rent.com +stuff-4-sale.org +stuff-4-sale.us +teaches-yoga.com +thruhere.net +traeumtgerade.de +webhop.biz +webhop.info +webhop.net +webhop.org +worse-than.tv +writesthisblog.com + +// ddnss.de : https://www.ddnss.de/ +// Submitted by Robert Niedziela +ddnss.de +dyn.ddnss.de +dyndns.ddnss.de +dyndns1.de +dyn-ip24.de +home-webserver.de +dyn.home-webserver.de +myhome-server.de +ddnss.org + +// Definima : http://www.definima.com/ +// Submitted by Maxence Bitterli +definima.net +definima.io + +// dnstrace.pro : https://dnstrace.pro/ +// Submitted by Chris Partridge +bci.dnstrace.pro + +// Dynu.com : https://www.dynu.com/ +// Submitted by Sue Ye +ddnsfree.com +ddnsgeek.com +giize.com +gleeze.com +kozow.com +loseyourip.com +ooguy.com +theworkpc.com +casacam.net +dynu.net +accesscam.org +camdvr.org +freeddns.org +mywire.org +webredirect.org +myddns.rocks +blogsite.xyz + +// dynv6 : https://dynv6.com +// Submitted by Dominik Menke +dynv6.net + +// E4YOU spol. s.r.o. : https://e4you.cz/ +// Submitted by Vladimir Dudr +e4.cz + +// Enalean SAS: https://www.enalean.com +// Submitted by Thomas Cottier +mytuleap.com + +// ECG Robotics, Inc: https://ecgrobotics.org +// Submitted by +onred.one +staging.onred.one + +// Enonic : http://enonic.com/ +// Submitted by Erik Kaareng-Sunde +enonic.io +customer.enonic.io + +// EU.org https://eu.org/ +// Submitted by Pierre Beyssac +eu.org +al.eu.org +asso.eu.org +at.eu.org +au.eu.org +be.eu.org +bg.eu.org +ca.eu.org +cd.eu.org +ch.eu.org +cn.eu.org +cy.eu.org +cz.eu.org +de.eu.org +dk.eu.org +edu.eu.org +ee.eu.org +es.eu.org +fi.eu.org +fr.eu.org +gr.eu.org +hr.eu.org +hu.eu.org +ie.eu.org +il.eu.org +in.eu.org +int.eu.org +is.eu.org +it.eu.org +jp.eu.org +kr.eu.org +lt.eu.org +lu.eu.org +lv.eu.org +mc.eu.org +me.eu.org +mk.eu.org +mt.eu.org +my.eu.org +net.eu.org +ng.eu.org +nl.eu.org +no.eu.org +nz.eu.org +paris.eu.org +pl.eu.org +pt.eu.org +q-a.eu.org +ro.eu.org +ru.eu.org +se.eu.org +si.eu.org +sk.eu.org +tr.eu.org +uk.eu.org +us.eu.org + +// Evennode : http://www.evennode.com/ +// Submitted by Michal Kralik +eu-1.evennode.com +eu-2.evennode.com +eu-3.evennode.com +eu-4.evennode.com +us-1.evennode.com +us-2.evennode.com +us-3.evennode.com +us-4.evennode.com + +// eDirect Corp. : https://hosting.url.com.tw/ +// Submitted by C.S. chang +twmail.cc +twmail.net +twmail.org +mymailer.com.tw +url.tw + +// Facebook, Inc. +// Submitted by Peter Ruibal +apps.fbsbx.com + +// FAITID : https://faitid.org/ +// Submitted by Maxim Alzoba +// https://www.flexireg.net/stat_info +ru.net +adygeya.ru +bashkiria.ru +bir.ru +cbg.ru +com.ru +dagestan.ru +grozny.ru +kalmykia.ru +kustanai.ru +marine.ru +mordovia.ru +msk.ru +mytis.ru +nalchik.ru +nov.ru +pyatigorsk.ru +spb.ru +vladikavkaz.ru +vladimir.ru +abkhazia.su +adygeya.su +aktyubinsk.su +arkhangelsk.su +armenia.su +ashgabad.su +azerbaijan.su +balashov.su +bashkiria.su +bryansk.su +bukhara.su +chimkent.su +dagestan.su +east-kazakhstan.su +exnet.su +georgia.su +grozny.su +ivanovo.su +jambyl.su +kalmykia.su +kaluga.su +karacol.su +karaganda.su +karelia.su +khakassia.su +krasnodar.su +kurgan.su +kustanai.su +lenug.su +mangyshlak.su +mordovia.su +msk.su +murmansk.su +nalchik.su +navoi.su +north-kazakhstan.su +nov.su +obninsk.su +penza.su +pokrovsk.su +sochi.su +spb.su +tashkent.su +termez.su +togliatti.su +troitsk.su +tselinograd.su +tula.su +tuva.su +vladikavkaz.su +vladimir.su +vologda.su + +// Fancy Bits, LLC : http://getchannels.com +// Submitted by Aman Gupta +channelsdvr.net + +// Fastly Inc. : http://www.fastly.com/ +// Submitted by Fastly Security +fastly-terrarium.com +fastlylb.net +map.fastlylb.net +freetls.fastly.net +map.fastly.net +a.prod.fastly.net +global.prod.fastly.net +a.ssl.fastly.net +b.ssl.fastly.net +global.ssl.fastly.net + +// FASTVPS EESTI OU : https://fastvps.ru/ +// Submitted by Likhachev Vasiliy +fastpanel.direct +fastvps-server.com + +// Featherhead : https://featherhead.xyz/ +// Submitted by Simon Menke +fhapp.xyz + +// Fedora : https://fedoraproject.org/ +// submitted by Patrick Uiterwijk +fedorainfracloud.org +fedorapeople.org +cloud.fedoraproject.org +app.os.fedoraproject.org +app.os.stg.fedoraproject.org + +// Fermax : https://fermax.com/ +// submitted by Koen Van Isterdael +mydobiss.com + +// Filegear Inc. : https://www.filegear.com +// Submitted by Jason Zhu +filegear.me +filegear-au.me +filegear-de.me +filegear-gb.me +filegear-ie.me +filegear-jp.me +filegear-sg.me + +// Firebase, Inc. +// Submitted by Chris Raynor +firebaseapp.com + +// Flynn : https://flynn.io +// Submitted by Jonathan Rudenberg +flynnhub.com +flynnhosting.net + +// Freebox : http://www.freebox.fr +// Submitted by Romain Fliedel +freebox-os.com +freeboxos.com +fbx-os.fr +fbxos.fr +freebox-os.fr +freeboxos.fr + +// freedesktop.org : https://www.freedesktop.org +// Submitted by Daniel Stone +freedesktop.org + +// Futureweb OG : http://www.futureweb.at +// Submitted by Andreas Schnederle-Wagner +*.futurecms.at +*.ex.futurecms.at +*.in.futurecms.at +futurehosting.at +futuremailing.at +*.ex.ortsinfo.at +*.kunden.ortsinfo.at +*.statics.cloud + +// GDS : https://www.gov.uk/service-manual/operations/operating-servicegovuk-subdomains +// Submitted by David Illsley +service.gov.uk + +// Gehirn Inc. : https://www.gehirn.co.jp/ +// Submitted by Kohei YOSHIDA +gehirn.ne.jp +usercontent.jp + +// Gentlent, Limited : https://www.gentlent.com +// Submitted by Tom Klein +lab.ms + +// GitHub, Inc. +// Submitted by Patrick Toomey +github.io +githubusercontent.com + +// GitLab, Inc. +// Submitted by Alex Hanselka +gitlab.io + +// Glitch, Inc : https://glitch.com +// Submitted by Mads Hartmann +glitch.me + +// GOV.UK Platform as a Service : https://www.cloud.service.gov.uk/ +// Submitted by Tom Whitwell +cloudapps.digital +london.cloudapps.digital + +// UKHomeOffice : https://www.gov.uk/government/organisations/home-office +// Submitted by Jon Shanks +homeoffice.gov.uk + +// GlobeHosting, Inc. +// Submitted by Zoltan Egresi +ro.im +shop.ro + +// GoIP DNS Services : http://www.goip.de +// Submitted by Christian Poulter +goip.de + +// Google, Inc. +// Submitted by Eduardo Vela +run.app +a.run.app +web.app +*.0emm.com +appspot.com +blogspot.ae +blogspot.al +blogspot.am +blogspot.ba +blogspot.be +blogspot.bg +blogspot.bj +blogspot.ca +blogspot.cf +blogspot.ch +blogspot.cl +blogspot.co.at +blogspot.co.id +blogspot.co.il +blogspot.co.ke +blogspot.co.nz +blogspot.co.uk +blogspot.co.za +blogspot.com +blogspot.com.ar +blogspot.com.au +blogspot.com.br +blogspot.com.by +blogspot.com.co +blogspot.com.cy +blogspot.com.ee +blogspot.com.eg +blogspot.com.es +blogspot.com.mt +blogspot.com.ng +blogspot.com.tr +blogspot.com.uy +blogspot.cv +blogspot.cz +blogspot.de +blogspot.dk +blogspot.fi +blogspot.fr +blogspot.gr +blogspot.hk +blogspot.hr +blogspot.hu +blogspot.ie +blogspot.in +blogspot.is +blogspot.it +blogspot.jp +blogspot.kr +blogspot.li +blogspot.lt +blogspot.lu +blogspot.md +blogspot.mk +blogspot.mr +blogspot.mx +blogspot.my +blogspot.nl +blogspot.no +blogspot.pe +blogspot.pt +blogspot.qa +blogspot.re +blogspot.ro +blogspot.rs +blogspot.ru +blogspot.se +blogspot.sg +blogspot.si +blogspot.sk +blogspot.sn +blogspot.td +blogspot.tw +blogspot.ug +blogspot.vn +cloudfunctions.net +cloud.goog +codespot.com +googleapis.com +googlecode.com +pagespeedmobilizer.com +publishproxy.com +withgoogle.com +withyoutube.com + +// Hakaran group: http://hakaran.cz +// Submited by Arseniy Sokolov +fin.ci +free.hr +caa.li +ua.rs +conf.se + +// Handshake : https://handshake.org +// Submitted by Mike Damm +hs.zone +hs.run + +// Hashbang : https://hashbang.sh +hashbang.sh + +// Hasura : https://hasura.io +// Submitted by Shahidh K Muhammed +hasura.app +hasura-app.io + +// Hepforge : https://www.hepforge.org +// Submitted by David Grellscheid +hepforge.org + +// Heroku : https://www.heroku.com/ +// Submitted by Tom Maher +herokuapp.com +herokussl.com + +// Hibernating Rhinos +// Submitted by Oren Eini +myravendb.com +ravendb.community +ravendb.me +development.run +ravendb.run + +// HOSTBIP REGISTRY : https://www.hostbip.com/ +// Submitted by Atanunu Igbunuroghene +bpl.biz +orx.biz +ng.city +ng.ink +biz.gl +col.ng +gen.ng +ltd.ng +sch.so + +// Häkkinen.fi +// Submitted by Eero Häkkinen +häkkinen.fi + +// Ici la Lune : http://www.icilalune.com/ +// Submitted by Simon Morvan +*.moonscale.io +moonscale.net + +// iki.fi +// Submitted by Hannu Aronsson +iki.fi + +// Individual Network Berlin e.V. : https://www.in-berlin.de/ +// Submitted by Christian Seitz +dyn-berlin.de +in-berlin.de +in-brb.de +in-butter.de +in-dsl.de +in-dsl.net +in-dsl.org +in-vpn.de +in-vpn.net +in-vpn.org + +// info.at : http://www.info.at/ +biz.at +info.at + +// info.cx : http://info.cx +// Submitted by Jacob Slater +info.cx + +// Interlegis : http://www.interlegis.leg.br +// Submitted by Gabriel Ferreira +ac.leg.br +al.leg.br +am.leg.br +ap.leg.br +ba.leg.br +ce.leg.br +df.leg.br +es.leg.br +go.leg.br +ma.leg.br +mg.leg.br +ms.leg.br +mt.leg.br +pa.leg.br +pb.leg.br +pe.leg.br +pi.leg.br +pr.leg.br +rj.leg.br +rn.leg.br +ro.leg.br +rr.leg.br +rs.leg.br +sc.leg.br +se.leg.br +sp.leg.br +to.leg.br + +// intermetrics GmbH : https://pixolino.com/ +// Submitted by Wolfgang Schwarz +pixolino.com + +// IPiFony Systems, Inc. : https://www.ipifony.com/ +// Submitted by Matthew Hardeman +ipifony.net + +// IServ GmbH : https://iserv.eu +// Submitted by Kim-Alexander Brodowski +mein-iserv.de +test-iserv.de +iserv.dev + +// I-O DATA DEVICE, INC. : http://www.iodata.com/ +// Submitted by Yuji Minagawa +iobb.net + +// Jino : https://www.jino.ru +// Submitted by Sergey Ulyashin +myjino.ru +*.hosting.myjino.ru +*.landing.myjino.ru +*.spectrum.myjino.ru +*.vps.myjino.ru + +// Joyent : https://www.joyent.com/ +// Submitted by Brian Bennett +*.triton.zone +*.cns.joyent.com + +// JS.ORG : http://dns.js.org +// Submitted by Stefan Keim +js.org + +// KaasHosting : http://www.kaashosting.nl/ +// Submitted by Wouter Bakker +kaas.gg +khplay.nl + +// Keyweb AG : https://www.keyweb.de +// Submitted by Martin Dannehl +keymachine.de + +// KingHost : https://king.host +// Submitted by Felipe Keller Braz +kinghost.net +uni5.net + +// KnightPoint Systems, LLC : http://www.knightpoint.com/ +// Submitted by Roy Keene +knightpoint.systems + +// .KRD : http://nic.krd/data/krd/Registration%20Policy.pdf +co.krd +edu.krd + +// LCube - Professional hosting e.K. : https://www.lcube-webhosting.de +// Submitted by Lars Laehn +git-repos.de +lcube-server.de +svn-repos.de + +// Leadpages : https://www.leadpages.net +// Submitted by Greg Dallavalle +leadpages.co +lpages.co +lpusercontent.com + +// Lifetime Hosting : https://Lifetime.Hosting/ +// Submitted by Mike Fillator +co.business +co.education +co.events +co.financial +co.network +co.place +co.technology + +// Lightmaker Property Manager, Inc. : https://app.lmpm.com/ +// Submitted by Greg Holland +app.lmpm.com + +// Linki Tools UG : https://linki.tools +// Submitted by Paulo Matos +linkitools.space + +// linkyard ldt: https://www.linkyard.ch/ +// Submitted by Mario Siegenthaler +linkyard.cloud +linkyard-cloud.ch + +// Linode : https://linode.com +// Submitted by +members.linode.com +nodebalancer.linode.com + +// LiquidNet Ltd : http://www.liquidnetlimited.com/ +// Submitted by Victor Velchev +we.bs + +// Log'in Line : https://www.loginline.com/ +// Submitted by Rémi Mach +loginline.app +loginline.dev +loginline.io +loginline.services +loginline.site + +// LubMAN UMCS Sp. z o.o : https://lubman.pl/ +// Submitted by Ireneusz Maliszewski +krasnik.pl +leczna.pl +lubartow.pl +lublin.pl +poniatowa.pl +swidnik.pl + +// Lug.org.uk : https://lug.org.uk +// Submitted by Jon Spriggs +uklugs.org +glug.org.uk +lug.org.uk +lugs.org.uk + +// Lukanet Ltd : https://lukanet.com +// Submitted by Anton Avramov +barsy.bg +barsy.co.uk +barsyonline.co.uk +barsycenter.com +barsyonline.com +barsy.club +barsy.de +barsy.eu +barsy.in +barsy.info +barsy.io +barsy.me +barsy.menu +barsy.mobi +barsy.net +barsy.online +barsy.org +barsy.pro +barsy.pub +barsy.shop +barsy.site +barsy.support +barsy.uk + +// Magento Commerce +// Submitted by Damien Tournoud +*.magentosite.cloud + +// May First - People Link : https://mayfirst.org/ +// Submitted by Jamie McClelland +mayfirst.info +mayfirst.org + +// Mail.Ru Group : https://hb.cldmail.ru +// Submitted by Ilya Zaretskiy +hb.cldmail.ru + +// Memset hosting : https://www.memset.com +// Submitted by Tom Whitwell +miniserver.com +memset.net + +// MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/ +// Submitted by Zdeněk Šustr +cloud.metacentrum.cz +custom.metacentrum.cz + +// MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/ +// Submitted by Radim Janča +flt.cloud.muni.cz +usr.cloud.muni.cz + +// Meteor Development Group : https://www.meteor.com/hosting +// Submitted by Pierre Carrier +meteorapp.com +eu.meteorapp.com + +// Michau Enterprises Limited : http://www.co.pl/ +co.pl + +// Microsoft Corporation : http://microsoft.com +// Submitted by Justin Luk +azurecontainer.io +azurewebsites.net +azure-mobile.net +cloudapp.net + +// Mozilla Corporation : https://mozilla.com +// Submitted by Ben Francis +mozilla-iot.org + +// Mozilla Foundation : https://mozilla.org/ +// Submitted by glob +bmoattachments.org + +// MSK-IX : https://www.msk-ix.ru/ +// Submitted by Khannanov Roman +net.ru +org.ru +pp.ru + +// Nabu Casa : https://www.nabucasa.com +// Submitted by Paulus Schoutsen +ui.nabu.casa + +// Names.of.London : https://names.of.london/ +// Submitted by James Stevens or +pony.club +of.fashion +on.fashion +of.football +in.london +of.london +for.men +and.mom +for.mom +for.one +for.sale +of.work +to.work + +// NCTU.ME : https://nctu.me/ +// Submitted by Tocknicsu +nctu.me + +// Netlify : https://www.netlify.com +// Submitted by Jessica Parsons +bitballoon.com +netlify.com + +// Neustar Inc. +// Submitted by Trung Tran +4u.com + +// ngrok : https://ngrok.com/ +// Submitted by Alan Shreve +ngrok.io + +// Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ +// Submitted by Nicholas Ford +nh-serv.co.uk + +// NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ +// Submitted by Jeff Wheelhouse +nfshost.com + +// Now-DNS : https://now-dns.com +// Submitted by Steve Russell +dnsking.ch +mypi.co +n4t.co +001www.com +ddnslive.com +myiphost.com +forumz.info +16-b.it +32-b.it +64-b.it +soundcast.me +tcp4.me +dnsup.net +hicam.net +now-dns.net +ownip.net +vpndns.net +dynserv.org +now-dns.org +x443.pw +now-dns.top +ntdll.top +freeddns.us +crafting.xyz +zapto.xyz + +// nsupdate.info : https://www.nsupdate.info/ +// Submitted by Thomas Waldmann +nsupdate.info +nerdpol.ovh + +// No-IP.com : https://noip.com/ +// Submitted by Deven Reza +blogsyte.com +brasilia.me +cable-modem.org +ciscofreak.com +collegefan.org +couchpotatofries.org +damnserver.com +ddns.me +ditchyourip.com +dnsfor.me +dnsiskinky.com +dvrcam.info +dynns.com +eating-organic.net +fantasyleague.cc +geekgalaxy.com +golffan.us +health-carereform.com +homesecuritymac.com +homesecuritypc.com +hopto.me +ilovecollege.info +loginto.me +mlbfan.org +mmafan.biz +myactivedirectory.com +mydissent.net +myeffect.net +mymediapc.net +mypsx.net +mysecuritycamera.com +mysecuritycamera.net +mysecuritycamera.org +net-freaks.com +nflfan.org +nhlfan.net +no-ip.ca +no-ip.co.uk +no-ip.net +noip.us +onthewifi.com +pgafan.net +point2this.com +pointto.us +privatizehealthinsurance.net +quicksytes.com +read-books.org +securitytactics.com +serveexchange.com +servehumour.com +servep2p.com +servesarcasm.com +stufftoread.com +ufcfan.org +unusualperson.com +workisboring.com +3utilities.com +bounceme.net +ddns.net +ddnsking.com +gotdns.ch +hopto.org +myftp.biz +myftp.org +myvnc.com +no-ip.biz +no-ip.info +no-ip.org +noip.me +redirectme.net +servebeer.com +serveblog.net +servecounterstrike.com +serveftp.com +servegame.com +servehalflife.com +servehttp.com +serveirc.com +serveminecraft.net +servemp3.com +servepics.com +servequake.com +sytes.net +webhop.me +zapto.org + +// NodeArt : https://nodeart.io +// Submitted by Konstantin Nosov +stage.nodeart.io + +// Nodum B.V. : https://nodum.io/ +// Submitted by Wietse Wind +nodum.co +nodum.io + +// Nucleos Inc. : https://nucleos.com +// Submitted by Piotr Zduniak +pcloud.host + +// NYC.mn : http://www.information.nyc.mn +// Submitted by Matthew Brown +nyc.mn + +// NymNom : https://nymnom.com/ +// Submitted by Dave McCormack +nom.ae +nom.af +nom.ai +nom.al +nym.by +nym.bz +nom.cl +nom.gd +nom.ge +nom.gl +nym.gr +nom.gt +nym.gy +nom.hn +nym.ie +nom.im +nom.ke +nym.kz +nym.la +nym.lc +nom.li +nym.li +nym.lt +nym.lu +nym.me +nom.mk +nym.mn +nym.mx +nom.nu +nym.nz +nym.pe +nym.pt +nom.pw +nom.qa +nym.ro +nom.rs +nom.si +nym.sk +nom.st +nym.su +nym.sx +nom.tj +nym.tw +nom.ug +nom.uy +nom.vc +nom.vg + +// Octopodal Solutions, LLC. : https://ulterius.io/ +// Submitted by Andrew Sampson +cya.gg + +// Omnibond Systems, LLC. : https://www.omnibond.com +// Submitted by Cole Estep +cloudycluster.net + +// One Fold Media : http://www.onefoldmedia.com/ +// Submitted by Eddie Jones +nid.io + +// OpenCraft GmbH : http://opencraft.com/ +// Submitted by Sven Marnach +opencraft.hosting + +// Opera Software, A.S.A. +// Submitted by Yngve Pettersen +operaunite.com + +// OutSystems +// Submitted by Duarte Santos +outsystemscloud.com + +// OwnProvider GmbH: http://www.ownprovider.com +// Submitted by Jan Moennich +ownprovider.com +own.pm + +// OX : http://www.ox.rs +// Submitted by Adam Grand +ox.rs + +// oy.lc +// Submitted by Charly Coste +oy.lc + +// Pagefog : https://pagefog.com/ +// Submitted by Derek Myers +pgfog.com + +// Pagefront : https://www.pagefronthq.com/ +// Submitted by Jason Kriss +pagefrontapp.com + +// .pl domains (grandfathered) +art.pl +gliwice.pl +krakow.pl +poznan.pl +wroc.pl +zakopane.pl + +// Pantheon Systems, Inc. : https://pantheon.io/ +// Submitted by Gary Dylina +pantheonsite.io +gotpantheon.com + +// Peplink | Pepwave : http://peplink.com/ +// Submitted by Steve Leung +mypep.link + +// Planet-Work : https://www.planet-work.com/ +// Submitted by Frédéric VANNIÈRE +on-web.fr + +// Platform.sh : https://platform.sh +// Submitted by Nikola Kotur +*.platform.sh +*.platformsh.site + +// Port53 : https://port53.io/ +// Submitted by Maximilian Schieder +dyn53.io + +// Positive Codes Technology Company : http://co.bn/faq.html +// Submitted by Zulfais +co.bn + +// prgmr.com : https://prgmr.com/ +// Submitted by Sarah Newman +xen.prgmr.com + +// priv.at : http://www.nic.priv.at/ +// Submitted by registry +priv.at + +// privacytools.io : https://www.privacytools.io/ +// Submitted by Jonah Aragon +prvcy.page + +// Protocol Labs : https://protocol.ai/ +// Submitted by Michael Burns +*.dweb.link + +// Protonet GmbH : http://protonet.io +// Submitted by Martin Meier +protonet.io + +// Publication Presse Communication SARL : https://ppcom.fr +// Submitted by Yaacov Akiba Slama +chirurgiens-dentistes-en-france.fr +byen.site + +// pubtls.org: https://www.pubtls.org +// Submitted by Kor Nielsen +pubtls.org + +// Qualifio : https://qualifio.com/ +// Submitted by Xavier De Cock +qualifioapp.com + +// Redstar Consultants : https://www.redstarconsultants.com/ +// Submitted by Jons Slemmer +instantcloud.cn + +// Russian Academy of Sciences +// Submitted by Tech Support +ras.ru + +// QA2 +// Submitted by Daniel Dent (https://www.danieldent.com/) +qa2.com + +// QNAP System Inc : https://www.qnap.com +// Submitted by Nick Chang +dev-myqnapcloud.com +alpha-myqnapcloud.com +myqnapcloud.com + +// Quip : https://quip.com +// Submitted by Patrick Linehan +*.quipelements.com + +// Qutheory LLC : http://qutheory.io +// Submitted by Jonas Schwartz +vapor.cloud +vaporcloud.io + +// Rackmaze LLC : https://www.rackmaze.com +// Submitted by Kirill Pertsev +rackmaze.com +rackmaze.net + +// Rancher Labs, Inc : https://rancher.com +// Submitted by Vincent Fiduccia +*.on-rancher.cloud +*.on-rio.io + +// Read The Docs, Inc : https://www.readthedocs.org +// Submitted by David Fischer +readthedocs.io + +// Red Hat, Inc. OpenShift : https://openshift.redhat.com/ +// Submitted by Tim Kramer +rhcloud.com + +// Render : https://render.com +// Submitted by Anurag Goel +app.render.com +onrender.com + +// Repl.it : https://repl.it +// Submitted by Mason Clayton +repl.co +repl.run + +// Resin.io : https://resin.io +// Submitted by Tim Perry +resindevice.io +devices.resinstaging.io + +// RethinkDB : https://www.rethinkdb.com/ +// Submitted by Chris Kastorff +hzc.io + +// Revitalised Limited : http://www.revitalised.co.uk +// Submitted by Jack Price +wellbeingzone.eu +ptplus.fit +wellbeingzone.co.uk + +// Rochester Institute of Technology : http://www.rit.edu/ +// Submitted by Jennifer Herting +git-pages.rit.edu + +// Sandstorm Development Group, Inc. : https://sandcats.io/ +// Submitted by Asheesh Laroia +sandcats.io + +// SBE network solutions GmbH : https://www.sbe.de/ +// Submitted by Norman Meilick +logoip.de +logoip.com + +// schokokeks.org GbR : https://schokokeks.org/ +// Submitted by Hanno Böck +schokokeks.net + +// Scry Security : http://www.scrysec.com +// Submitted by Shante Adam +scrysec.com + +// Securepoint GmbH : https://www.securepoint.de +// Submitted by Erik Anders +firewall-gateway.com +firewall-gateway.de +my-gateway.de +my-router.de +spdns.de +spdns.eu +firewall-gateway.net +my-firewall.org +myfirewall.org +spdns.org + +// SensioLabs, SAS : https://sensiolabs.com/ +// Submitted by Fabien Potencier +*.s5y.io +*.sensiosite.cloud + +// Service Online LLC : http://drs.ua/ +// Submitted by Serhii Bulakh +biz.ua +co.ua +pp.ua + +// ShiftEdit : https://shiftedit.net/ +// Submitted by Adam Jimenez +shiftedit.io + +// Shopblocks : http://www.shopblocks.com/ +// Submitted by Alex Bowers +myshopblocks.com + +// Shopit : https://www.shopitcommerce.com/ +// Submitted by Craig McMahon +shopitsite.com + +// Siemens Mobility GmbH +// Submitted by Oliver Graebner +mo-siemens.io + +// SinaAppEngine : http://sae.sina.com.cn/ +// Submitted by SinaAppEngine +1kapp.com +appchizi.com +applinzi.com +sinaapp.com +vipsinaapp.com + +// Siteleaf : https://www.siteleaf.com/ +// Submitted by Skylar Challand +siteleaf.net + +// Skyhat : http://www.skyhat.io +// Submitted by Shante Adam +bounty-full.com +alpha.bounty-full.com +beta.bounty-full.com + +// Stackhero : https://www.stackhero.io +// Submitted by Adrien Gillon +stackhero-network.com + +// staticland : https://static.land +// Submitted by Seth Vincent +static.land +dev.static.land +sites.static.land + +// SourceLair PC : https://www.sourcelair.com +// Submitted by Antonis Kalipetis +apps.lair.io +*.stolos.io + +// SpaceKit : https://www.spacekit.io/ +// Submitted by Reza Akhavan +spacekit.io + +// SpeedPartner GmbH: https://www.speedpartner.de/ +// Submitted by Stefan Neufeind +customer.speedpartner.de + +// Standard Library : https://stdlib.com +// Submitted by Jacob Lee +api.stdlib.com + +// Storj Labs Inc. : https://storj.io/ +// Submitted by Philip Hutchins +storj.farm + +// Studenten Net Twente : http://www.snt.utwente.nl/ +// Submitted by Silke Hofstra +utwente.io + +// Student-Run Computing Facility : https://www.srcf.net/ +// Submitted by Edwin Balani +soc.srcf.net +user.srcf.net + +// Sub 6 Limited: http://www.sub6.com +// Submitted by Dan Miller +temp-dns.com + +// Swisscom Application Cloud: https://developer.swisscom.com +// Submitted by Matthias.Winzeler +applicationcloud.io +scapp.io + +// Syncloud : https://syncloud.org +// Submitted by Boris Rybalkin +syncloud.it + +// Synology, Inc. : https://www.synology.com/ +// Submitted by Rony Weng +diskstation.me +dscloud.biz +dscloud.me +dscloud.mobi +dsmynas.com +dsmynas.net +dsmynas.org +familyds.com +familyds.net +familyds.org +i234.me +myds.me +synology.me +vpnplus.to + +// TAIFUN Software AG : http://taifun-software.de +// Submitted by Bjoern Henke +taifun-dns.de + +// TASK geographical domains (www.task.gda.pl/uslugi/dns) +gda.pl +gdansk.pl +gdynia.pl +med.pl +sopot.pl + +// Teckids e.V. : https://www.teckids.org +// Submitted by Dominik George +edugit.org + +// Telebit : https://telebit.cloud +// Submitted by AJ ONeal +telebit.app +telebit.io +*.telebit.xyz + +// The Gwiddle Foundation : https://gwiddlefoundation.org.uk +// Submitted by Joshua Bayfield +gwiddle.co.uk + +// Thingdust AG : https://thingdust.com/ +// Submitted by Adrian Imboden +thingdustdata.com +cust.dev.thingdust.io +cust.disrec.thingdust.io +cust.prod.thingdust.io +cust.testing.thingdust.io + +// Tlon.io : https://tlon.io +// Submitted by Mark Staarink +arvo.network +azimuth.network + +// TownNews.com : http://www.townnews.com +// Submitted by Dustin Ward +bloxcms.com +townnews-staging.com + +// TrafficPlex GmbH : https://www.trafficplex.de/ +// Submitted by Phillipp Röll +12hp.at +2ix.at +4lima.at +lima-city.at +12hp.ch +2ix.ch +4lima.ch +lima-city.ch +trafficplex.cloud +de.cool +12hp.de +2ix.de +4lima.de +lima-city.de +1337.pictures +clan.rip +lima-city.rocks +webspace.rocks +lima.zone + +// TransIP : https://www.transip.nl +// Submitted by Rory Breuk +*.transurl.be +*.transurl.eu +*.transurl.nl + +// TuxFamily : http://tuxfamily.org +// Submitted by TuxFamily administrators +tuxfamily.org + +// TwoDNS : https://www.twodns.de/ +// Submitted by TwoDNS-Support +dd-dns.de +diskstation.eu +diskstation.org +dray-dns.de +draydns.de +dyn-vpn.de +dynvpn.de +mein-vigor.de +my-vigor.de +my-wan.de +syno-ds.de +synology-diskstation.de +synology-ds.de + +// Uberspace : https://uberspace.de +// Submitted by Moritz Werner +uber.space +*.uberspace.de + +// UDR Limited : http://www.udr.hk.com +// Submitted by registry +hk.com +hk.org +ltd.hk +inc.hk + +// United Gameserver GmbH : https://united-gameserver.de +// Submitted by Stefan Schwarz +virtualuser.de +virtual-user.de + +// .US +// Submitted by Ed Moore +lib.de.us + +// VeryPositive SIA : http://very.lv +// Submitted by Danko Aleksejevs +2038.io + +// Viprinet Europe GmbH : http://www.viprinet.com +// Submitted by Simon Kissel +router.management + +// Virtual-Info : https://www.virtual-info.info/ +// Submitted by Adnan RIHAN +v-info.info + +// Voorloper.com: https://voorloper.com +// Submitted by Nathan van Bakel +voorloper.cloud + +// Waffle Computer Inc., Ltd. : https://docs.waffleinfo.com +// Submitted by Masayuki Note +wafflecell.com + +// WeDeploy by Liferay, Inc. : https://www.wedeploy.com +// Submitted by Henrique Vicente +wedeploy.io +wedeploy.me +wedeploy.sh + +// Western Digital Technologies, Inc : https://www.wdc.com +// Submitted by Jung Jin +remotewd.com + +// Wikimedia Labs : https://wikitech.wikimedia.org +// Submitted by Yuvi Panda +wmflabs.org + +// XenonCloud GbR: https://xenoncloud.net +// Submitted by Julian Uphoff +half.host + +// XnBay Technology : http://www.xnbay.com/ +// Submitted by XnBay Developer +xnbay.com +u2.xnbay.com +u2-local.xnbay.com + +// XS4ALL Internet bv : https://www.xs4all.nl/ +// Submitted by Daniel Mostertman +cistron.nl +demon.nl +xs4all.space + +// YesCourse Pty Ltd : https://yescourse.com +// Submitted by Atul Bhouraskar +official.academy + +// Yola : https://www.yola.com/ +// Submitted by Stefano Rivera +yolasite.com + +// Yombo : https://yombo.net +// Submitted by Mitch Schwenk +ybo.faith +yombo.me +homelink.one +ybo.party +ybo.review +ybo.science +ybo.trade + +// Yunohost : https://yunohost.org +// Submitted by Valentin Grimaud +nohost.me +noho.st + +// ZaNiC : http://www.za.net/ +// Submitted by registry +za.net +za.org + +// Zeit, Inc. : https://zeit.domains/ +// Submitted by Olli Vanhoja +now.sh + +// Zine EOOD : https://zine.bg/ +// Submitted by Martin Angelov +bss.design + +// Zitcom A/S : https://www.zitcom.dk +// Submitted by Emil Stahl +basicserver.io +virtualserver.io +site.builder.nu +enterprisecloud.nu + +// Zone.id : https://zone.id/ +// Submitted by Su Hendro +zone.id + +// ===END PRIVATE DOMAINS=== diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/domain_name.gemspec b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/domain_name.gemspec new file mode 100644 index 0000000..7ac4c82 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/domain_name.gemspec @@ -0,0 +1,36 @@ +# -*- encoding: utf-8 -*- +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'domain_name/version' + +Gem::Specification.new do |gem| + gem.name = "domain_name" + gem.version = DomainName::VERSION + gem.authors = ["Akinori MUSHA"] + gem.email = ["knu@idaemons.org"] + gem.description = <<-'EOS' +This is a Domain Name manipulation library for Ruby. + +It can also be used for cookie domain validation based on the Public +Suffix List. + EOS + gem.summary = %q{Domain Name manipulation library for Ruby} + gem.homepage = "https://github.com/knu/ruby-domain_name" + gem.licenses = ["BSD-2-Clause", "BSD-3-Clause", "MPL-2.0"] + + gem.files = `git ls-files`.split($/) + gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.require_paths = ["lib"] + + gem.extra_rdoc_files = [ + "LICENSE.txt", + "README.md" + ] + + gem.add_runtime_dependency("unf", ["< 1.0.0", ">= 0.0.5"]) + gem.add_development_dependency("test-unit", "~> 2.5.5") + gem.add_development_dependency("bundler", [">= 1.2.0"]) + gem.add_development_dependency("rake", [">= 0.9.2.2", *("< 11" if RUBY_VERSION < "1.9")]) + gem.add_development_dependency("rdoc", [">= 2.4.2"]) +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name.rb new file mode 100644 index 0000000..739570b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name.rb @@ -0,0 +1,297 @@ +# -*- coding: utf-8 -*- +# +# domain_name.rb - Domain Name manipulation library for Ruby +# +# Copyright (C) 2011-2017 Akinori MUSHA, All rights reserved. +# + +require 'domain_name/version' +require 'domain_name/punycode' +require 'domain_name/etld_data' +require 'unf' +require 'ipaddr' + +# Represents a domain name ready for extracting its registered domain +# and TLD. +class DomainName + # The full host name normalized, ASCII-ized and downcased using the + # Unicode NFC rules and the Punycode algorithm. If initialized with + # an IP address, the string representation of the IP address + # suitable for opening a connection to. + attr_reader :hostname + + # The Unicode representation of the #hostname property. + # + # :attr_reader: hostname_idn + + # The least "universally original" domain part of this domain name. + # For example, "example.co.uk" for "www.sub.example.co.uk". This + # may be nil if the hostname does not have one, like when it is an + # IP address, an effective TLD or higher itself, or of a + # non-canonical domain. + attr_reader :domain + + # The Unicode representation of the #domain property. + # + # :attr_reader: domain_idn + + # The TLD part of this domain name. For example, if the hostname is + # "www.sub.example.co.uk", the TLD part is "uk". This property is + # nil only if +ipaddr?+ is true. This may be nil if the hostname + # does not have one, like when it is an IP address or of a + # non-canonical domain. + attr_reader :tld + + # The Unicode representation of the #tld property. + # + # :attr_reader: tld_idn + + # Returns an IPAddr object if this is an IP address. + attr_reader :ipaddr + + # Returns true if this is an IP address, such as "192.168.0.1" and + # "[::1]". + def ipaddr? + @ipaddr ? true : false + end + + # Returns a host name representation suitable for use in the host + # name part of a URI. A host name, an IPv4 address, or a IPv6 + # address enclosed in square brackets. + attr_reader :uri_host + + # Returns true if this domain name has a canonical TLD. + def canonical_tld? + @canonical_tld_p + end + + # Returns true if this domain name has a canonical registered + # domain. + def canonical? + @canonical_tld_p && (@domain ? true : false) + end + + DOT = '.'.freeze # :nodoc: + + # Parses _hostname_ into a DomainName object. An IP address is also + # accepted. An IPv6 address may be enclosed in square brackets. + def initialize(hostname) + hostname.is_a?(String) or + (hostname.respond_to?(:to_str) && (hostname = hostname.to_str).is_a?(String)) or + raise TypeError, "#{hostname.class} is not a String" + if hostname.start_with?(DOT) + raise ArgumentError, "domain name must not start with a dot: #{hostname}" + end + case hostname + when /\A([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\z/ + @ipaddr = IPAddr.new($1) + @uri_host = @hostname = @ipaddr.to_s + @domain = @tld = nil + return + when /\A([0-9A-Fa-f:]*:[0-9A-Fa-f:]*:[0-9A-Fa-f:]*)\z/, + /\A\[([0-9A-Fa-f:]*:[0-9A-Fa-f:]*:[0-9A-Fa-f:]*)\]\z/ + @ipaddr = IPAddr.new($1) + @hostname = @ipaddr.to_s + @uri_host = "[#{@hostname}]" + @domain = @tld = nil + return + end + @ipaddr = nil + @hostname = DomainName.normalize(hostname) + @uri_host = @hostname + if last_dot = @hostname.rindex(DOT) + @tld = @hostname[(last_dot + 1)..-1] + else + @tld = @hostname + end + etld_data = DomainName.etld_data + if @canonical_tld_p = etld_data.key?(@tld) + subdomain = domain = nil + parent = @hostname + loop { + case etld_data[parent] + when 0 + @domain = domain + return + when -1 + @domain = subdomain + return + when 1 + @domain = parent + return + end + subdomain = domain + domain = parent + pos = @hostname.index(DOT, -domain.length) or break + parent = @hostname[(pos + 1)..-1] + } + else + # unknown/local TLD + if last_dot + # fallback - accept cookies down to second level + # cf. http://www.dkim-reputation.org/regdom-libs/ + if penultimate_dot = @hostname.rindex(DOT, last_dot - 1) + @domain = @hostname[(penultimate_dot + 1)..-1] + else + @domain = @hostname + end + else + # no domain part - must be a local hostname + @domain = @tld + end + end + end + + # Checks if the server represented by this domain is qualified to + # send and receive cookies with a domain attribute value of + # _domain_. A true value given as the second argument represents + # cookies without a domain attribute value, in which case only + # hostname equality is checked. + def cookie_domain?(domain, host_only = false) + # RFC 6265 #5.3 + # When the user agent "receives a cookie": + return self == domain if host_only + + domain = DomainName.new(domain) unless DomainName === domain + if ipaddr? + # RFC 6265 #5.1.3 + # Do not perform subdomain matching against IP addresses. + @hostname == domain.hostname + else + # RFC 6265 #4.1.1 + # Domain-value must be a subdomain. + @domain && self <= domain && domain <= @domain ? true : false + end + end + + # Returns the superdomain of this domain name. + def superdomain + return nil if ipaddr? + pos = @hostname.index(DOT) or return nil + self.class.new(@hostname[(pos + 1)..-1]) + end + + def ==(other) + other = DomainName.new(other) unless DomainName === other + other.hostname == @hostname + end + + def <=>(other) + other = DomainName.new(other) unless DomainName === other + othername = other.hostname + if othername == @hostname + 0 + elsif @hostname.end_with?(othername) && @hostname[-othername.size - 1, 1] == DOT + # The other is higher + -1 + elsif othername.end_with?(@hostname) && othername[-@hostname.size - 1, 1] == DOT + # The other is lower + 1 + else + nil + end + end + + def <(other) + case self <=> other + when -1 + true + when nil + nil + else + false + end + end + + def >(other) + case self <=> other + when 1 + true + when nil + nil + else + false + end + end + + def <=(other) + case self <=> other + when -1, 0 + true + when nil + nil + else + false + end + end + + def >=(other) + case self <=> other + when 1, 0 + true + when nil + nil + else + false + end + end + + def to_s + @hostname + end + + alias to_str to_s + + def hostname_idn + @hostname_idn ||= + if @ipaddr + @hostname + else + DomainName::Punycode.decode_hostname(@hostname) + end + end + + alias idn hostname_idn + + def domain_idn + @domain_idn ||= + if @ipaddr + @domain + else + DomainName::Punycode.decode_hostname(@domain) + end + end + + def tld_idn + @tld_idn ||= + if @ipaddr + @tld + else + DomainName::Punycode.decode_hostname(@tld) + end + end + + def inspect + str = '#<%s:%s' % [self.class.name, @hostname] + if @ipaddr + str << ' (ipaddr)' + else + str << ' domain=' << @domain if @domain + str << ' tld=' << @tld if @tld + end + str << '>' + end + + class << self + # Normalizes a _domain_ using the Punycode algorithm as necessary. + # The result will be a downcased, ASCII-only string. + def normalize(domain) + DomainName::Punycode.encode_hostname(domain.chomp(DOT).to_nfc).downcase + end + end +end + +# Short hand for DomainName.new(). +def DomainName(hostname) + DomainName.new(hostname) +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb new file mode 100644 index 0000000..9525d84 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb @@ -0,0 +1,8787 @@ +class DomainName + ETLD_DATA_DATE = '2019-07-01T18:45:50Z' + + ETLD_DATA = { + "ac" => 0, + "com.ac" => 0, + "edu.ac" => 0, + "gov.ac" => 0, + "net.ac" => 0, + "mil.ac" => 0, + "org.ac" => 0, + "ad" => 0, + "nom.ad" => 0, + "ae" => 0, + "co.ae" => 0, + "net.ae" => 0, + "org.ae" => 0, + "sch.ae" => 0, + "ac.ae" => 0, + "gov.ae" => 0, + "mil.ae" => 0, + "aero" => 0, + "accident-investigation.aero" => 0, + "accident-prevention.aero" => 0, + "aerobatic.aero" => 0, + "aeroclub.aero" => 0, + "aerodrome.aero" => 0, + "agents.aero" => 0, + "aircraft.aero" => 0, + "airline.aero" => 0, + "airport.aero" => 0, + "air-surveillance.aero" => 0, + "airtraffic.aero" => 0, + "air-traffic-control.aero" => 0, + "ambulance.aero" => 0, + "amusement.aero" => 0, + "association.aero" => 0, + "author.aero" => 0, + "ballooning.aero" => 0, + "broker.aero" => 0, + "caa.aero" => 0, + "cargo.aero" => 0, + "catering.aero" => 0, + "certification.aero" => 0, + "championship.aero" => 0, + "charter.aero" => 0, + "civilaviation.aero" => 0, + "club.aero" => 0, + "conference.aero" => 0, + "consultant.aero" => 0, + "consulting.aero" => 0, + "control.aero" => 0, + "council.aero" => 0, + "crew.aero" => 0, + "design.aero" => 0, + "dgca.aero" => 0, + "educator.aero" => 0, + "emergency.aero" => 0, + "engine.aero" => 0, + "engineer.aero" => 0, + "entertainment.aero" => 0, + "equipment.aero" => 0, + "exchange.aero" => 0, + "express.aero" => 0, + "federation.aero" => 0, + "flight.aero" => 0, + "freight.aero" => 0, + "fuel.aero" => 0, + "gliding.aero" => 0, + "government.aero" => 0, + "groundhandling.aero" => 0, + "group.aero" => 0, + "hanggliding.aero" => 0, + "homebuilt.aero" => 0, + "insurance.aero" => 0, + "journal.aero" => 0, + "journalist.aero" => 0, + "leasing.aero" => 0, + "logistics.aero" => 0, + "magazine.aero" => 0, + "maintenance.aero" => 0, + "media.aero" => 0, + "microlight.aero" => 0, + "modelling.aero" => 0, + "navigation.aero" => 0, + "parachuting.aero" => 0, + "paragliding.aero" => 0, + "passenger-association.aero" => 0, + "pilot.aero" => 0, + "press.aero" => 0, + "production.aero" => 0, + "recreation.aero" => 0, + "repbody.aero" => 0, + "res.aero" => 0, + "research.aero" => 0, + "rotorcraft.aero" => 0, + "safety.aero" => 0, + "scientist.aero" => 0, + "services.aero" => 0, + "show.aero" => 0, + "skydiving.aero" => 0, + "software.aero" => 0, + "student.aero" => 0, + "trader.aero" => 0, + "trading.aero" => 0, + "trainer.aero" => 0, + "union.aero" => 0, + "workinggroup.aero" => 0, + "works.aero" => 0, + "af" => 0, + "gov.af" => 0, + "com.af" => 0, + "org.af" => 0, + "net.af" => 0, + "edu.af" => 0, + "ag" => 0, + "com.ag" => 0, + "org.ag" => 0, + "net.ag" => 0, + "co.ag" => 0, + "nom.ag" => 0, + "ai" => 0, + "off.ai" => 0, + "com.ai" => 0, + "net.ai" => 0, + "org.ai" => 0, + "al" => 0, + "com.al" => 0, + "edu.al" => 0, + "gov.al" => 0, + "mil.al" => 0, + "net.al" => 0, + "org.al" => 0, + "am" => 0, + "co.am" => 0, + "com.am" => 0, + "commune.am" => 0, + "net.am" => 0, + "org.am" => 0, + "ao" => 0, + "ed.ao" => 0, + "gv.ao" => 0, + "og.ao" => 0, + "co.ao" => 0, + "pb.ao" => 0, + "it.ao" => 0, + "aq" => 0, + "ar" => 0, + "com.ar" => 0, + "edu.ar" => 0, + "gob.ar" => 0, + "gov.ar" => 0, + "int.ar" => 0, + "mil.ar" => 0, + "musica.ar" => 0, + "net.ar" => 0, + "org.ar" => 0, + "tur.ar" => 0, + "arpa" => 0, + "e164.arpa" => 0, + "in-addr.arpa" => 0, + "ip6.arpa" => 0, + "iris.arpa" => 0, + "uri.arpa" => 0, + "urn.arpa" => 0, + "as" => 0, + "gov.as" => 0, + "asia" => 0, + "at" => 0, + "ac.at" => 0, + "co.at" => 0, + "gv.at" => 0, + "or.at" => 0, + "au" => 0, + "com.au" => 0, + "net.au" => 0, + "org.au" => 0, + "edu.au" => 0, + "gov.au" => 0, + "asn.au" => 0, + "id.au" => 0, + "info.au" => 0, + "conf.au" => 0, + "oz.au" => 0, + "act.au" => 0, + "nsw.au" => 0, + "nt.au" => 0, + "qld.au" => 0, + "sa.au" => 0, + "tas.au" => 0, + "vic.au" => 0, + "wa.au" => 0, + "act.edu.au" => 0, + "nsw.edu.au" => 0, + "nt.edu.au" => 0, + "qld.edu.au" => 0, + "sa.edu.au" => 0, + "tas.edu.au" => 0, + "vic.edu.au" => 0, + "wa.edu.au" => 0, + "qld.gov.au" => 0, + "sa.gov.au" => 0, + "tas.gov.au" => 0, + "vic.gov.au" => 0, + "wa.gov.au" => 0, + "aw" => 0, + "com.aw" => 0, + "ax" => 0, + "az" => 0, + "com.az" => 0, + "net.az" => 0, + "int.az" => 0, + "gov.az" => 0, + "org.az" => 0, + "edu.az" => 0, + "info.az" => 0, + "pp.az" => 0, + "mil.az" => 0, + "name.az" => 0, + "pro.az" => 0, + "biz.az" => 0, + "ba" => 0, + "com.ba" => 0, + "edu.ba" => 0, + "gov.ba" => 0, + "mil.ba" => 0, + "net.ba" => 0, + "org.ba" => 0, + "bb" => 0, + "biz.bb" => 0, + "co.bb" => 0, + "com.bb" => 0, + "edu.bb" => 0, + "gov.bb" => 0, + "info.bb" => 0, + "net.bb" => 0, + "org.bb" => 0, + "store.bb" => 0, + "tv.bb" => 0, + "bd" => -1, + "be" => 0, + "ac.be" => 0, + "bf" => 0, + "gov.bf" => 0, + "bg" => 0, + "a.bg" => 0, + "b.bg" => 0, + "c.bg" => 0, + "d.bg" => 0, + "e.bg" => 0, + "f.bg" => 0, + "g.bg" => 0, + "h.bg" => 0, + "i.bg" => 0, + "j.bg" => 0, + "k.bg" => 0, + "l.bg" => 0, + "m.bg" => 0, + "n.bg" => 0, + "o.bg" => 0, + "p.bg" => 0, + "q.bg" => 0, + "r.bg" => 0, + "s.bg" => 0, + "t.bg" => 0, + "u.bg" => 0, + "v.bg" => 0, + "w.bg" => 0, + "x.bg" => 0, + "y.bg" => 0, + "z.bg" => 0, + "0.bg" => 0, + "1.bg" => 0, + "2.bg" => 0, + "3.bg" => 0, + "4.bg" => 0, + "5.bg" => 0, + "6.bg" => 0, + "7.bg" => 0, + "8.bg" => 0, + "9.bg" => 0, + "bh" => 0, + "com.bh" => 0, + "edu.bh" => 0, + "net.bh" => 0, + "org.bh" => 0, + "gov.bh" => 0, + "bi" => 0, + "co.bi" => 0, + "com.bi" => 0, + "edu.bi" => 0, + "or.bi" => 0, + "org.bi" => 0, + "biz" => 0, + "bj" => 0, + "asso.bj" => 0, + "barreau.bj" => 0, + "gouv.bj" => 0, + "bm" => 0, + "com.bm" => 0, + "edu.bm" => 0, + "gov.bm" => 0, + "net.bm" => 0, + "org.bm" => 0, + "bn" => 0, + "com.bn" => 0, + "edu.bn" => 0, + "gov.bn" => 0, + "net.bn" => 0, + "org.bn" => 0, + "bo" => 0, + "com.bo" => 0, + "edu.bo" => 0, + "gob.bo" => 0, + "int.bo" => 0, + "org.bo" => 0, + "net.bo" => 0, + "mil.bo" => 0, + "tv.bo" => 0, + "web.bo" => 0, + "academia.bo" => 0, + "agro.bo" => 0, + "arte.bo" => 0, + "blog.bo" => 0, + "bolivia.bo" => 0, + "ciencia.bo" => 0, + "cooperativa.bo" => 0, + "democracia.bo" => 0, + "deporte.bo" => 0, + "ecologia.bo" => 0, + "economia.bo" => 0, + "empresa.bo" => 0, + "indigena.bo" => 0, + "industria.bo" => 0, + "info.bo" => 0, + "medicina.bo" => 0, + "movimiento.bo" => 0, + "musica.bo" => 0, + "natural.bo" => 0, + "nombre.bo" => 0, + "noticias.bo" => 0, + "patria.bo" => 0, + "politica.bo" => 0, + "profesional.bo" => 0, + "plurinacional.bo" => 0, + "pueblo.bo" => 0, + "revista.bo" => 0, + "salud.bo" => 0, + "tecnologia.bo" => 0, + "tksat.bo" => 0, + "transporte.bo" => 0, + "wiki.bo" => 0, + "br" => 0, + "9guacu.br" => 0, + "abc.br" => 0, + "adm.br" => 0, + "adv.br" => 0, + "agr.br" => 0, + "aju.br" => 0, + "am.br" => 0, + "anani.br" => 0, + "aparecida.br" => 0, + "arq.br" => 0, + "art.br" => 0, + "ato.br" => 0, + "b.br" => 0, + "barueri.br" => 0, + "belem.br" => 0, + "bhz.br" => 0, + "bio.br" => 0, + "blog.br" => 0, + "bmd.br" => 0, + "boavista.br" => 0, + "bsb.br" => 0, + "campinagrande.br" => 0, + "campinas.br" => 0, + "caxias.br" => 0, + "cim.br" => 0, + "cng.br" => 0, + "cnt.br" => 0, + "com.br" => 0, + "contagem.br" => 0, + "coop.br" => 0, + "cri.br" => 0, + "cuiaba.br" => 0, + "curitiba.br" => 0, + "def.br" => 0, + "ecn.br" => 0, + "eco.br" => 0, + "edu.br" => 0, + "emp.br" => 0, + "eng.br" => 0, + "esp.br" => 0, + "etc.br" => 0, + "eti.br" => 0, + "far.br" => 0, + "feira.br" => 0, + "flog.br" => 0, + "floripa.br" => 0, + "fm.br" => 0, + "fnd.br" => 0, + "fortal.br" => 0, + "fot.br" => 0, + "foz.br" => 0, + "fst.br" => 0, + "g12.br" => 0, + "ggf.br" => 0, + "goiania.br" => 0, + "gov.br" => 0, + "ac.gov.br" => 0, + "al.gov.br" => 0, + "am.gov.br" => 0, + "ap.gov.br" => 0, + "ba.gov.br" => 0, + "ce.gov.br" => 0, + "df.gov.br" => 0, + "es.gov.br" => 0, + "go.gov.br" => 0, + "ma.gov.br" => 0, + "mg.gov.br" => 0, + "ms.gov.br" => 0, + "mt.gov.br" => 0, + "pa.gov.br" => 0, + "pb.gov.br" => 0, + "pe.gov.br" => 0, + "pi.gov.br" => 0, + "pr.gov.br" => 0, + "rj.gov.br" => 0, + "rn.gov.br" => 0, + "ro.gov.br" => 0, + "rr.gov.br" => 0, + "rs.gov.br" => 0, + "sc.gov.br" => 0, + "se.gov.br" => 0, + "sp.gov.br" => 0, + "to.gov.br" => 0, + "gru.br" => 0, + "imb.br" => 0, + "ind.br" => 0, + "inf.br" => 0, + "jab.br" => 0, + "jampa.br" => 0, + "jdf.br" => 0, + "joinville.br" => 0, + "jor.br" => 0, + "jus.br" => 0, + "leg.br" => 0, + "lel.br" => 0, + "londrina.br" => 0, + "macapa.br" => 0, + "maceio.br" => 0, + "manaus.br" => 0, + "maringa.br" => 0, + "mat.br" => 0, + "med.br" => 0, + "mil.br" => 0, + "morena.br" => 0, + "mp.br" => 0, + "mus.br" => 0, + "natal.br" => 0, + "net.br" => 0, + "niteroi.br" => 0, + "nom.br" => -1, + "not.br" => 0, + "ntr.br" => 0, + "odo.br" => 0, + "ong.br" => 0, + "org.br" => 0, + "osasco.br" => 0, + "palmas.br" => 0, + "poa.br" => 0, + "ppg.br" => 0, + "pro.br" => 0, + "psc.br" => 0, + "psi.br" => 0, + "pvh.br" => 0, + "qsl.br" => 0, + "radio.br" => 0, + "rec.br" => 0, + "recife.br" => 0, + "ribeirao.br" => 0, + "rio.br" => 0, + "riobranco.br" => 0, + "riopreto.br" => 0, + "salvador.br" => 0, + "sampa.br" => 0, + "santamaria.br" => 0, + "santoandre.br" => 0, + "saobernardo.br" => 0, + "saogonca.br" => 0, + "sjc.br" => 0, + "slg.br" => 0, + "slz.br" => 0, + "sorocaba.br" => 0, + "srv.br" => 0, + "taxi.br" => 0, + "tc.br" => 0, + "teo.br" => 0, + "the.br" => 0, + "tmp.br" => 0, + "trd.br" => 0, + "tur.br" => 0, + "tv.br" => 0, + "udi.br" => 0, + "vet.br" => 0, + "vix.br" => 0, + "vlog.br" => 0, + "wiki.br" => 0, + "zlg.br" => 0, + "bs" => 0, + "com.bs" => 0, + "net.bs" => 0, + "org.bs" => 0, + "edu.bs" => 0, + "gov.bs" => 0, + "bt" => 0, + "com.bt" => 0, + "edu.bt" => 0, + "gov.bt" => 0, + "net.bt" => 0, + "org.bt" => 0, + "bv" => 0, + "bw" => 0, + "co.bw" => 0, + "org.bw" => 0, + "by" => 0, + "gov.by" => 0, + "mil.by" => 0, + "com.by" => 0, + "of.by" => 0, + "bz" => 0, + "com.bz" => 0, + "net.bz" => 0, + "org.bz" => 0, + "edu.bz" => 0, + "gov.bz" => 0, + "ca" => 0, + "ab.ca" => 0, + "bc.ca" => 0, + "mb.ca" => 0, + "nb.ca" => 0, + "nf.ca" => 0, + "nl.ca" => 0, + "ns.ca" => 0, + "nt.ca" => 0, + "nu.ca" => 0, + "on.ca" => 0, + "pe.ca" => 0, + "qc.ca" => 0, + "sk.ca" => 0, + "yk.ca" => 0, + "gc.ca" => 0, + "cat" => 0, + "cc" => 0, + "cd" => 0, + "gov.cd" => 0, + "cf" => 0, + "cg" => 0, + "ch" => 0, + "ci" => 0, + "org.ci" => 0, + "or.ci" => 0, + "com.ci" => 0, + "co.ci" => 0, + "edu.ci" => 0, + "ed.ci" => 0, + "ac.ci" => 0, + "net.ci" => 0, + "go.ci" => 0, + "asso.ci" => 0, + "xn--aroport-bya.ci" => 0, + "int.ci" => 0, + "presse.ci" => 0, + "md.ci" => 0, + "gouv.ci" => 0, + "ck" => -1, + "www.ck" => 1, + "cl" => 0, + "gov.cl" => 0, + "gob.cl" => 0, + "co.cl" => 0, + "mil.cl" => 0, + "cm" => 0, + "co.cm" => 0, + "com.cm" => 0, + "gov.cm" => 0, + "net.cm" => 0, + "cn" => 0, + "ac.cn" => 0, + "com.cn" => 0, + "edu.cn" => 0, + "gov.cn" => 0, + "net.cn" => 0, + "org.cn" => 0, + "mil.cn" => 0, + "xn--55qx5d.cn" => 0, + "xn--io0a7i.cn" => 0, + "xn--od0alg.cn" => 0, + "ah.cn" => 0, + "bj.cn" => 0, + "cq.cn" => 0, + "fj.cn" => 0, + "gd.cn" => 0, + "gs.cn" => 0, + "gz.cn" => 0, + "gx.cn" => 0, + "ha.cn" => 0, + "hb.cn" => 0, + "he.cn" => 0, + "hi.cn" => 0, + "hl.cn" => 0, + "hn.cn" => 0, + "jl.cn" => 0, + "js.cn" => 0, + "jx.cn" => 0, + "ln.cn" => 0, + "nm.cn" => 0, + "nx.cn" => 0, + "qh.cn" => 0, + "sc.cn" => 0, + "sd.cn" => 0, + "sh.cn" => 0, + "sn.cn" => 0, + "sx.cn" => 0, + "tj.cn" => 0, + "xj.cn" => 0, + "xz.cn" => 0, + "yn.cn" => 0, + "zj.cn" => 0, + "hk.cn" => 0, + "mo.cn" => 0, + "tw.cn" => 0, + "co" => 0, + "arts.co" => 0, + "com.co" => 0, + "edu.co" => 0, + "firm.co" => 0, + "gov.co" => 0, + "info.co" => 0, + "int.co" => 0, + "mil.co" => 0, + "net.co" => 0, + "nom.co" => 0, + "org.co" => 0, + "rec.co" => 0, + "web.co" => 0, + "com" => 0, + "coop" => 0, + "cr" => 0, + "ac.cr" => 0, + "co.cr" => 0, + "ed.cr" => 0, + "fi.cr" => 0, + "go.cr" => 0, + "or.cr" => 0, + "sa.cr" => 0, + "cu" => 0, + "com.cu" => 0, + "edu.cu" => 0, + "org.cu" => 0, + "net.cu" => 0, + "gov.cu" => 0, + "inf.cu" => 0, + "cv" => 0, + "cw" => 0, + "com.cw" => 0, + "edu.cw" => 0, + "net.cw" => 0, + "org.cw" => 0, + "cx" => 0, + "gov.cx" => 0, + "cy" => 0, + "ac.cy" => 0, + "biz.cy" => 0, + "com.cy" => 0, + "ekloges.cy" => 0, + "gov.cy" => 0, + "ltd.cy" => 0, + "name.cy" => 0, + "net.cy" => 0, + "org.cy" => 0, + "parliament.cy" => 0, + "press.cy" => 0, + "pro.cy" => 0, + "tm.cy" => 0, + "cz" => 0, + "de" => 0, + "dj" => 0, + "dk" => 0, + "dm" => 0, + "com.dm" => 0, + "net.dm" => 0, + "org.dm" => 0, + "edu.dm" => 0, + "gov.dm" => 0, + "do" => 0, + "art.do" => 0, + "com.do" => 0, + "edu.do" => 0, + "gob.do" => 0, + "gov.do" => 0, + "mil.do" => 0, + "net.do" => 0, + "org.do" => 0, + "sld.do" => 0, + "web.do" => 0, + "dz" => 0, + "com.dz" => 0, + "org.dz" => 0, + "net.dz" => 0, + "gov.dz" => 0, + "edu.dz" => 0, + "asso.dz" => 0, + "pol.dz" => 0, + "art.dz" => 0, + "ec" => 0, + "com.ec" => 0, + "info.ec" => 0, + "net.ec" => 0, + "fin.ec" => 0, + "k12.ec" => 0, + "med.ec" => 0, + "pro.ec" => 0, + "org.ec" => 0, + "edu.ec" => 0, + "gov.ec" => 0, + "gob.ec" => 0, + "mil.ec" => 0, + "edu" => 0, + "ee" => 0, + "edu.ee" => 0, + "gov.ee" => 0, + "riik.ee" => 0, + "lib.ee" => 0, + "med.ee" => 0, + "com.ee" => 0, + "pri.ee" => 0, + "aip.ee" => 0, + "org.ee" => 0, + "fie.ee" => 0, + "eg" => 0, + "com.eg" => 0, + "edu.eg" => 0, + "eun.eg" => 0, + "gov.eg" => 0, + "mil.eg" => 0, + "name.eg" => 0, + "net.eg" => 0, + "org.eg" => 0, + "sci.eg" => 0, + "er" => -1, + "es" => 0, + "com.es" => 0, + "nom.es" => 0, + "org.es" => 0, + "gob.es" => 0, + "edu.es" => 0, + "et" => 0, + "com.et" => 0, + "gov.et" => 0, + "org.et" => 0, + "edu.et" => 0, + "biz.et" => 0, + "name.et" => 0, + "info.et" => 0, + "net.et" => 0, + "eu" => 0, + "fi" => 0, + "aland.fi" => 0, + "fj" => -1, + "fk" => -1, + "fm" => 0, + "fo" => 0, + "fr" => 0, + "asso.fr" => 0, + "com.fr" => 0, + "gouv.fr" => 0, + "nom.fr" => 0, + "prd.fr" => 0, + "tm.fr" => 0, + "aeroport.fr" => 0, + "avocat.fr" => 0, + "avoues.fr" => 0, + "cci.fr" => 0, + "chambagri.fr" => 0, + "chirurgiens-dentistes.fr" => 0, + "experts-comptables.fr" => 0, + "geometre-expert.fr" => 0, + "greta.fr" => 0, + "huissier-justice.fr" => 0, + "medecin.fr" => 0, + "notaires.fr" => 0, + "pharmacien.fr" => 0, + "port.fr" => 0, + "veterinaire.fr" => 0, + "ga" => 0, + "gb" => 0, + "gd" => 0, + "ge" => 0, + "com.ge" => 0, + "edu.ge" => 0, + "gov.ge" => 0, + "org.ge" => 0, + "mil.ge" => 0, + "net.ge" => 0, + "pvt.ge" => 0, + "gf" => 0, + "gg" => 0, + "co.gg" => 0, + "net.gg" => 0, + "org.gg" => 0, + "gh" => 0, + "com.gh" => 0, + "edu.gh" => 0, + "gov.gh" => 0, + "org.gh" => 0, + "mil.gh" => 0, + "gi" => 0, + "com.gi" => 0, + "ltd.gi" => 0, + "gov.gi" => 0, + "mod.gi" => 0, + "edu.gi" => 0, + "org.gi" => 0, + "gl" => 0, + "co.gl" => 0, + "com.gl" => 0, + "edu.gl" => 0, + "net.gl" => 0, + "org.gl" => 0, + "gm" => 0, + "gn" => 0, + "ac.gn" => 0, + "com.gn" => 0, + "edu.gn" => 0, + "gov.gn" => 0, + "org.gn" => 0, + "net.gn" => 0, + "gov" => 0, + "gp" => 0, + "com.gp" => 0, + "net.gp" => 0, + "mobi.gp" => 0, + "edu.gp" => 0, + "org.gp" => 0, + "asso.gp" => 0, + "gq" => 0, + "gr" => 0, + "com.gr" => 0, + "edu.gr" => 0, + "net.gr" => 0, + "org.gr" => 0, + "gov.gr" => 0, + "gs" => 0, + "gt" => 0, + "com.gt" => 0, + "edu.gt" => 0, + "gob.gt" => 0, + "ind.gt" => 0, + "mil.gt" => 0, + "net.gt" => 0, + "org.gt" => 0, + "gu" => 0, + "com.gu" => 0, + "edu.gu" => 0, + "gov.gu" => 0, + "guam.gu" => 0, + "info.gu" => 0, + "net.gu" => 0, + "org.gu" => 0, + "web.gu" => 0, + "gw" => 0, + "gy" => 0, + "co.gy" => 0, + "com.gy" => 0, + "edu.gy" => 0, + "gov.gy" => 0, + "net.gy" => 0, + "org.gy" => 0, + "hk" => 0, + "com.hk" => 0, + "edu.hk" => 0, + "gov.hk" => 0, + "idv.hk" => 0, + "net.hk" => 0, + "org.hk" => 0, + "xn--55qx5d.hk" => 0, + "xn--wcvs22d.hk" => 0, + "xn--lcvr32d.hk" => 0, + "xn--mxtq1m.hk" => 0, + "xn--gmqw5a.hk" => 0, + "xn--ciqpn.hk" => 0, + "xn--gmq050i.hk" => 0, + "xn--zf0avx.hk" => 0, + "xn--io0a7i.hk" => 0, + "xn--mk0axi.hk" => 0, + "xn--od0alg.hk" => 0, + "xn--od0aq3b.hk" => 0, + "xn--tn0ag.hk" => 0, + "xn--uc0atv.hk" => 0, + "xn--uc0ay4a.hk" => 0, + "hm" => 0, + "hn" => 0, + "com.hn" => 0, + "edu.hn" => 0, + "org.hn" => 0, + "net.hn" => 0, + "mil.hn" => 0, + "gob.hn" => 0, + "hr" => 0, + "iz.hr" => 0, + "from.hr" => 0, + "name.hr" => 0, + "com.hr" => 0, + "ht" => 0, + "com.ht" => 0, + "shop.ht" => 0, + "firm.ht" => 0, + "info.ht" => 0, + "adult.ht" => 0, + "net.ht" => 0, + "pro.ht" => 0, + "org.ht" => 0, + "med.ht" => 0, + "art.ht" => 0, + "coop.ht" => 0, + "pol.ht" => 0, + "asso.ht" => 0, + "edu.ht" => 0, + "rel.ht" => 0, + "gouv.ht" => 0, + "perso.ht" => 0, + "hu" => 0, + "co.hu" => 0, + "info.hu" => 0, + "org.hu" => 0, + "priv.hu" => 0, + "sport.hu" => 0, + "tm.hu" => 0, + "2000.hu" => 0, + "agrar.hu" => 0, + "bolt.hu" => 0, + "casino.hu" => 0, + "city.hu" => 0, + "erotica.hu" => 0, + "erotika.hu" => 0, + "film.hu" => 0, + "forum.hu" => 0, + "games.hu" => 0, + "hotel.hu" => 0, + "ingatlan.hu" => 0, + "jogasz.hu" => 0, + "konyvelo.hu" => 0, + "lakas.hu" => 0, + "media.hu" => 0, + "news.hu" => 0, + "reklam.hu" => 0, + "sex.hu" => 0, + "shop.hu" => 0, + "suli.hu" => 0, + "szex.hu" => 0, + "tozsde.hu" => 0, + "utazas.hu" => 0, + "video.hu" => 0, + "id" => 0, + "ac.id" => 0, + "biz.id" => 0, + "co.id" => 0, + "desa.id" => 0, + "go.id" => 0, + "mil.id" => 0, + "my.id" => 0, + "net.id" => 0, + "or.id" => 0, + "ponpes.id" => 0, + "sch.id" => 0, + "web.id" => 0, + "ie" => 0, + "gov.ie" => 0, + "il" => 0, + "ac.il" => 0, + "co.il" => 0, + "gov.il" => 0, + "idf.il" => 0, + "k12.il" => 0, + "muni.il" => 0, + "net.il" => 0, + "org.il" => 0, + "im" => 0, + "ac.im" => 0, + "co.im" => 0, + "com.im" => 0, + "ltd.co.im" => 0, + "net.im" => 0, + "org.im" => 0, + "plc.co.im" => 0, + "tt.im" => 0, + "tv.im" => 0, + "in" => 0, + "co.in" => 0, + "firm.in" => 0, + "net.in" => 0, + "org.in" => 0, + "gen.in" => 0, + "ind.in" => 0, + "nic.in" => 0, + "ac.in" => 0, + "edu.in" => 0, + "res.in" => 0, + "gov.in" => 0, + "mil.in" => 0, + "info" => 0, + "int" => 0, + "eu.int" => 0, + "io" => 0, + "com.io" => 0, + "iq" => 0, + "gov.iq" => 0, + "edu.iq" => 0, + "mil.iq" => 0, + "com.iq" => 0, + "org.iq" => 0, + "net.iq" => 0, + "ir" => 0, + "ac.ir" => 0, + "co.ir" => 0, + "gov.ir" => 0, + "id.ir" => 0, + "net.ir" => 0, + "org.ir" => 0, + "sch.ir" => 0, + "xn--mgba3a4f16a.ir" => 0, + "xn--mgba3a4fra.ir" => 0, + "is" => 0, + "net.is" => 0, + "com.is" => 0, + "edu.is" => 0, + "gov.is" => 0, + "org.is" => 0, + "int.is" => 0, + "it" => 0, + "gov.it" => 0, + "edu.it" => 0, + "abr.it" => 0, + "abruzzo.it" => 0, + "aosta-valley.it" => 0, + "aostavalley.it" => 0, + "bas.it" => 0, + "basilicata.it" => 0, + "cal.it" => 0, + "calabria.it" => 0, + "cam.it" => 0, + "campania.it" => 0, + "emilia-romagna.it" => 0, + "emiliaromagna.it" => 0, + "emr.it" => 0, + "friuli-v-giulia.it" => 0, + "friuli-ve-giulia.it" => 0, + "friuli-vegiulia.it" => 0, + "friuli-venezia-giulia.it" => 0, + "friuli-veneziagiulia.it" => 0, + "friuli-vgiulia.it" => 0, + "friuliv-giulia.it" => 0, + "friulive-giulia.it" => 0, + "friulivegiulia.it" => 0, + "friulivenezia-giulia.it" => 0, + "friuliveneziagiulia.it" => 0, + "friulivgiulia.it" => 0, + "fvg.it" => 0, + "laz.it" => 0, + "lazio.it" => 0, + "lig.it" => 0, + "liguria.it" => 0, + "lom.it" => 0, + "lombardia.it" => 0, + "lombardy.it" => 0, + "lucania.it" => 0, + "mar.it" => 0, + "marche.it" => 0, + "mol.it" => 0, + "molise.it" => 0, + "piedmont.it" => 0, + "piemonte.it" => 0, + "pmn.it" => 0, + "pug.it" => 0, + "puglia.it" => 0, + "sar.it" => 0, + "sardegna.it" => 0, + "sardinia.it" => 0, + "sic.it" => 0, + "sicilia.it" => 0, + "sicily.it" => 0, + "taa.it" => 0, + "tos.it" => 0, + "toscana.it" => 0, + "trentin-sud-tirol.it" => 0, + "xn--trentin-sd-tirol-rzb.it" => 0, + "trentin-sudtirol.it" => 0, + "xn--trentin-sdtirol-7vb.it" => 0, + "trentin-sued-tirol.it" => 0, + "trentin-suedtirol.it" => 0, + "trentino-a-adige.it" => 0, + "trentino-aadige.it" => 0, + "trentino-alto-adige.it" => 0, + "trentino-altoadige.it" => 0, + "trentino-s-tirol.it" => 0, + "trentino-stirol.it" => 0, + "trentino-sud-tirol.it" => 0, + "xn--trentino-sd-tirol-c3b.it" => 0, + "trentino-sudtirol.it" => 0, + "xn--trentino-sdtirol-szb.it" => 0, + "trentino-sued-tirol.it" => 0, + "trentino-suedtirol.it" => 0, + "trentino.it" => 0, + "trentinoa-adige.it" => 0, + "trentinoaadige.it" => 0, + "trentinoalto-adige.it" => 0, + "trentinoaltoadige.it" => 0, + "trentinos-tirol.it" => 0, + "trentinostirol.it" => 0, + "trentinosud-tirol.it" => 0, + "xn--trentinosd-tirol-rzb.it" => 0, + "trentinosudtirol.it" => 0, + "xn--trentinosdtirol-7vb.it" => 0, + "trentinosued-tirol.it" => 0, + "trentinosuedtirol.it" => 0, + "trentinsud-tirol.it" => 0, + "xn--trentinsd-tirol-6vb.it" => 0, + "trentinsudtirol.it" => 0, + "xn--trentinsdtirol-nsb.it" => 0, + "trentinsued-tirol.it" => 0, + "trentinsuedtirol.it" => 0, + "tuscany.it" => 0, + "umb.it" => 0, + "umbria.it" => 0, + "val-d-aosta.it" => 0, + "val-daosta.it" => 0, + "vald-aosta.it" => 0, + "valdaosta.it" => 0, + "valle-aosta.it" => 0, + "valle-d-aosta.it" => 0, + "valle-daosta.it" => 0, + "valleaosta.it" => 0, + "valled-aosta.it" => 0, + "valledaosta.it" => 0, + "vallee-aoste.it" => 0, + "xn--valle-aoste-ebb.it" => 0, + "vallee-d-aoste.it" => 0, + "xn--valle-d-aoste-ehb.it" => 0, + "valleeaoste.it" => 0, + "xn--valleaoste-e7a.it" => 0, + "valleedaoste.it" => 0, + "xn--valledaoste-ebb.it" => 0, + "vao.it" => 0, + "vda.it" => 0, + "ven.it" => 0, + "veneto.it" => 0, + "ag.it" => 0, + "agrigento.it" => 0, + "al.it" => 0, + "alessandria.it" => 0, + "alto-adige.it" => 0, + "altoadige.it" => 0, + "an.it" => 0, + "ancona.it" => 0, + "andria-barletta-trani.it" => 0, + "andria-trani-barletta.it" => 0, + "andriabarlettatrani.it" => 0, + "andriatranibarletta.it" => 0, + "ao.it" => 0, + "aosta.it" => 0, + "aoste.it" => 0, + "ap.it" => 0, + "aq.it" => 0, + "aquila.it" => 0, + "ar.it" => 0, + "arezzo.it" => 0, + "ascoli-piceno.it" => 0, + "ascolipiceno.it" => 0, + "asti.it" => 0, + "at.it" => 0, + "av.it" => 0, + "avellino.it" => 0, + "ba.it" => 0, + "balsan-sudtirol.it" => 0, + "xn--balsan-sdtirol-nsb.it" => 0, + "balsan-suedtirol.it" => 0, + "balsan.it" => 0, + "bari.it" => 0, + "barletta-trani-andria.it" => 0, + "barlettatraniandria.it" => 0, + "belluno.it" => 0, + "benevento.it" => 0, + "bergamo.it" => 0, + "bg.it" => 0, + "bi.it" => 0, + "biella.it" => 0, + "bl.it" => 0, + "bn.it" => 0, + "bo.it" => 0, + "bologna.it" => 0, + "bolzano-altoadige.it" => 0, + "bolzano.it" => 0, + "bozen-sudtirol.it" => 0, + "xn--bozen-sdtirol-2ob.it" => 0, + "bozen-suedtirol.it" => 0, + "bozen.it" => 0, + "br.it" => 0, + "brescia.it" => 0, + "brindisi.it" => 0, + "bs.it" => 0, + "bt.it" => 0, + "bulsan-sudtirol.it" => 0, + "xn--bulsan-sdtirol-nsb.it" => 0, + "bulsan-suedtirol.it" => 0, + "bulsan.it" => 0, + "bz.it" => 0, + "ca.it" => 0, + "cagliari.it" => 0, + "caltanissetta.it" => 0, + "campidano-medio.it" => 0, + "campidanomedio.it" => 0, + "campobasso.it" => 0, + "carbonia-iglesias.it" => 0, + "carboniaiglesias.it" => 0, + "carrara-massa.it" => 0, + "carraramassa.it" => 0, + "caserta.it" => 0, + "catania.it" => 0, + "catanzaro.it" => 0, + "cb.it" => 0, + "ce.it" => 0, + "cesena-forli.it" => 0, + "xn--cesena-forl-mcb.it" => 0, + "cesenaforli.it" => 0, + "xn--cesenaforl-i8a.it" => 0, + "ch.it" => 0, + "chieti.it" => 0, + "ci.it" => 0, + "cl.it" => 0, + "cn.it" => 0, + "co.it" => 0, + "como.it" => 0, + "cosenza.it" => 0, + "cr.it" => 0, + "cremona.it" => 0, + "crotone.it" => 0, + "cs.it" => 0, + "ct.it" => 0, + "cuneo.it" => 0, + "cz.it" => 0, + "dell-ogliastra.it" => 0, + "dellogliastra.it" => 0, + "en.it" => 0, + "enna.it" => 0, + "fc.it" => 0, + "fe.it" => 0, + "fermo.it" => 0, + "ferrara.it" => 0, + "fg.it" => 0, + "fi.it" => 0, + "firenze.it" => 0, + "florence.it" => 0, + "fm.it" => 0, + "foggia.it" => 0, + "forli-cesena.it" => 0, + "xn--forl-cesena-fcb.it" => 0, + "forlicesena.it" => 0, + "xn--forlcesena-c8a.it" => 0, + "fr.it" => 0, + "frosinone.it" => 0, + "ge.it" => 0, + "genoa.it" => 0, + "genova.it" => 0, + "go.it" => 0, + "gorizia.it" => 0, + "gr.it" => 0, + "grosseto.it" => 0, + "iglesias-carbonia.it" => 0, + "iglesiascarbonia.it" => 0, + "im.it" => 0, + "imperia.it" => 0, + "is.it" => 0, + "isernia.it" => 0, + "kr.it" => 0, + "la-spezia.it" => 0, + "laquila.it" => 0, + "laspezia.it" => 0, + "latina.it" => 0, + "lc.it" => 0, + "le.it" => 0, + "lecce.it" => 0, + "lecco.it" => 0, + "li.it" => 0, + "livorno.it" => 0, + "lo.it" => 0, + "lodi.it" => 0, + "lt.it" => 0, + "lu.it" => 0, + "lucca.it" => 0, + "macerata.it" => 0, + "mantova.it" => 0, + "massa-carrara.it" => 0, + "massacarrara.it" => 0, + "matera.it" => 0, + "mb.it" => 0, + "mc.it" => 0, + "me.it" => 0, + "medio-campidano.it" => 0, + "mediocampidano.it" => 0, + "messina.it" => 0, + "mi.it" => 0, + "milan.it" => 0, + "milano.it" => 0, + "mn.it" => 0, + "mo.it" => 0, + "modena.it" => 0, + "monza-brianza.it" => 0, + "monza-e-della-brianza.it" => 0, + "monza.it" => 0, + "monzabrianza.it" => 0, + "monzaebrianza.it" => 0, + "monzaedellabrianza.it" => 0, + "ms.it" => 0, + "mt.it" => 0, + "na.it" => 0, + "naples.it" => 0, + "napoli.it" => 0, + "no.it" => 0, + "novara.it" => 0, + "nu.it" => 0, + "nuoro.it" => 0, + "og.it" => 0, + "ogliastra.it" => 0, + "olbia-tempio.it" => 0, + "olbiatempio.it" => 0, + "or.it" => 0, + "oristano.it" => 0, + "ot.it" => 0, + "pa.it" => 0, + "padova.it" => 0, + "padua.it" => 0, + "palermo.it" => 0, + "parma.it" => 0, + "pavia.it" => 0, + "pc.it" => 0, + "pd.it" => 0, + "pe.it" => 0, + "perugia.it" => 0, + "pesaro-urbino.it" => 0, + "pesarourbino.it" => 0, + "pescara.it" => 0, + "pg.it" => 0, + "pi.it" => 0, + "piacenza.it" => 0, + "pisa.it" => 0, + "pistoia.it" => 0, + "pn.it" => 0, + "po.it" => 0, + "pordenone.it" => 0, + "potenza.it" => 0, + "pr.it" => 0, + "prato.it" => 0, + "pt.it" => 0, + "pu.it" => 0, + "pv.it" => 0, + "pz.it" => 0, + "ra.it" => 0, + "ragusa.it" => 0, + "ravenna.it" => 0, + "rc.it" => 0, + "re.it" => 0, + "reggio-calabria.it" => 0, + "reggio-emilia.it" => 0, + "reggiocalabria.it" => 0, + "reggioemilia.it" => 0, + "rg.it" => 0, + "ri.it" => 0, + "rieti.it" => 0, + "rimini.it" => 0, + "rm.it" => 0, + "rn.it" => 0, + "ro.it" => 0, + "roma.it" => 0, + "rome.it" => 0, + "rovigo.it" => 0, + "sa.it" => 0, + "salerno.it" => 0, + "sassari.it" => 0, + "savona.it" => 0, + "si.it" => 0, + "siena.it" => 0, + "siracusa.it" => 0, + "so.it" => 0, + "sondrio.it" => 0, + "sp.it" => 0, + "sr.it" => 0, + "ss.it" => 0, + "suedtirol.it" => 0, + "xn--sdtirol-n2a.it" => 0, + "sv.it" => 0, + "ta.it" => 0, + "taranto.it" => 0, + "te.it" => 0, + "tempio-olbia.it" => 0, + "tempioolbia.it" => 0, + "teramo.it" => 0, + "terni.it" => 0, + "tn.it" => 0, + "to.it" => 0, + "torino.it" => 0, + "tp.it" => 0, + "tr.it" => 0, + "trani-andria-barletta.it" => 0, + "trani-barletta-andria.it" => 0, + "traniandriabarletta.it" => 0, + "tranibarlettaandria.it" => 0, + "trapani.it" => 0, + "trento.it" => 0, + "treviso.it" => 0, + "trieste.it" => 0, + "ts.it" => 0, + "turin.it" => 0, + "tv.it" => 0, + "ud.it" => 0, + "udine.it" => 0, + "urbino-pesaro.it" => 0, + "urbinopesaro.it" => 0, + "va.it" => 0, + "varese.it" => 0, + "vb.it" => 0, + "vc.it" => 0, + "ve.it" => 0, + "venezia.it" => 0, + "venice.it" => 0, + "verbania.it" => 0, + "vercelli.it" => 0, + "verona.it" => 0, + "vi.it" => 0, + "vibo-valentia.it" => 0, + "vibovalentia.it" => 0, + "vicenza.it" => 0, + "viterbo.it" => 0, + "vr.it" => 0, + "vs.it" => 0, + "vt.it" => 0, + "vv.it" => 0, + "je" => 0, + "co.je" => 0, + "net.je" => 0, + "org.je" => 0, + "jm" => -1, + "jo" => 0, + "com.jo" => 0, + "org.jo" => 0, + "net.jo" => 0, + "edu.jo" => 0, + "sch.jo" => 0, + "gov.jo" => 0, + "mil.jo" => 0, + "name.jo" => 0, + "jobs" => 0, + "jp" => 0, + "ac.jp" => 0, + "ad.jp" => 0, + "co.jp" => 0, + "ed.jp" => 0, + "go.jp" => 0, + "gr.jp" => 0, + "lg.jp" => 0, + "ne.jp" => 0, + "or.jp" => 0, + "aichi.jp" => 0, + "akita.jp" => 0, + "aomori.jp" => 0, + "chiba.jp" => 0, + "ehime.jp" => 0, + "fukui.jp" => 0, + "fukuoka.jp" => 0, + "fukushima.jp" => 0, + "gifu.jp" => 0, + "gunma.jp" => 0, + "hiroshima.jp" => 0, + "hokkaido.jp" => 0, + "hyogo.jp" => 0, + "ibaraki.jp" => 0, + "ishikawa.jp" => 0, + "iwate.jp" => 0, + "kagawa.jp" => 0, + "kagoshima.jp" => 0, + "kanagawa.jp" => 0, + "kochi.jp" => 0, + "kumamoto.jp" => 0, + "kyoto.jp" => 0, + "mie.jp" => 0, + "miyagi.jp" => 0, + "miyazaki.jp" => 0, + "nagano.jp" => 0, + "nagasaki.jp" => 0, + "nara.jp" => 0, + "niigata.jp" => 0, + "oita.jp" => 0, + "okayama.jp" => 0, + "okinawa.jp" => 0, + "osaka.jp" => 0, + "saga.jp" => 0, + "saitama.jp" => 0, + "shiga.jp" => 0, + "shimane.jp" => 0, + "shizuoka.jp" => 0, + "tochigi.jp" => 0, + "tokushima.jp" => 0, + "tokyo.jp" => 0, + "tottori.jp" => 0, + "toyama.jp" => 0, + "wakayama.jp" => 0, + "yamagata.jp" => 0, + "yamaguchi.jp" => 0, + "yamanashi.jp" => 0, + "xn--4pvxs.jp" => 0, + "xn--vgu402c.jp" => 0, + "xn--c3s14m.jp" => 0, + "xn--f6qx53a.jp" => 0, + "xn--8pvr4u.jp" => 0, + "xn--uist22h.jp" => 0, + "xn--djrs72d6uy.jp" => 0, + "xn--mkru45i.jp" => 0, + "xn--0trq7p7nn.jp" => 0, + "xn--8ltr62k.jp" => 0, + "xn--2m4a15e.jp" => 0, + "xn--efvn9s.jp" => 0, + "xn--32vp30h.jp" => 0, + "xn--4it797k.jp" => 0, + "xn--1lqs71d.jp" => 0, + "xn--5rtp49c.jp" => 0, + "xn--5js045d.jp" => 0, + "xn--ehqz56n.jp" => 0, + "xn--1lqs03n.jp" => 0, + "xn--qqqt11m.jp" => 0, + "xn--kbrq7o.jp" => 0, + "xn--pssu33l.jp" => 0, + "xn--ntsq17g.jp" => 0, + "xn--uisz3g.jp" => 0, + "xn--6btw5a.jp" => 0, + "xn--1ctwo.jp" => 0, + "xn--6orx2r.jp" => 0, + "xn--rht61e.jp" => 0, + "xn--rht27z.jp" => 0, + "xn--djty4k.jp" => 0, + "xn--nit225k.jp" => 0, + "xn--rht3d.jp" => 0, + "xn--klty5x.jp" => 0, + "xn--kltx9a.jp" => 0, + "xn--kltp7d.jp" => 0, + "xn--uuwu58a.jp" => 0, + "xn--zbx025d.jp" => 0, + "xn--ntso0iqx3a.jp" => 0, + "xn--elqq16h.jp" => 0, + "xn--4it168d.jp" => 0, + "xn--klt787d.jp" => 0, + "xn--rny31h.jp" => 0, + "xn--7t0a264c.jp" => 0, + "xn--5rtq34k.jp" => 0, + "xn--k7yn95e.jp" => 0, + "xn--tor131o.jp" => 0, + "xn--d5qv7z876c.jp" => 0, + "kawasaki.jp" => -1, + "kitakyushu.jp" => -1, + "kobe.jp" => -1, + "nagoya.jp" => -1, + "sapporo.jp" => -1, + "sendai.jp" => -1, + "yokohama.jp" => -1, + "city.kawasaki.jp" => 1, + "city.kitakyushu.jp" => 1, + "city.kobe.jp" => 1, + "city.nagoya.jp" => 1, + "city.sapporo.jp" => 1, + "city.sendai.jp" => 1, + "city.yokohama.jp" => 1, + "aisai.aichi.jp" => 0, + "ama.aichi.jp" => 0, + "anjo.aichi.jp" => 0, + "asuke.aichi.jp" => 0, + "chiryu.aichi.jp" => 0, + "chita.aichi.jp" => 0, + "fuso.aichi.jp" => 0, + "gamagori.aichi.jp" => 0, + "handa.aichi.jp" => 0, + "hazu.aichi.jp" => 0, + "hekinan.aichi.jp" => 0, + "higashiura.aichi.jp" => 0, + "ichinomiya.aichi.jp" => 0, + "inazawa.aichi.jp" => 0, + "inuyama.aichi.jp" => 0, + "isshiki.aichi.jp" => 0, + "iwakura.aichi.jp" => 0, + "kanie.aichi.jp" => 0, + "kariya.aichi.jp" => 0, + "kasugai.aichi.jp" => 0, + "kira.aichi.jp" => 0, + "kiyosu.aichi.jp" => 0, + "komaki.aichi.jp" => 0, + "konan.aichi.jp" => 0, + "kota.aichi.jp" => 0, + "mihama.aichi.jp" => 0, + "miyoshi.aichi.jp" => 0, + "nishio.aichi.jp" => 0, + "nisshin.aichi.jp" => 0, + "obu.aichi.jp" => 0, + "oguchi.aichi.jp" => 0, + "oharu.aichi.jp" => 0, + "okazaki.aichi.jp" => 0, + "owariasahi.aichi.jp" => 0, + "seto.aichi.jp" => 0, + "shikatsu.aichi.jp" => 0, + "shinshiro.aichi.jp" => 0, + "shitara.aichi.jp" => 0, + "tahara.aichi.jp" => 0, + "takahama.aichi.jp" => 0, + "tobishima.aichi.jp" => 0, + "toei.aichi.jp" => 0, + "togo.aichi.jp" => 0, + "tokai.aichi.jp" => 0, + "tokoname.aichi.jp" => 0, + "toyoake.aichi.jp" => 0, + "toyohashi.aichi.jp" => 0, + "toyokawa.aichi.jp" => 0, + "toyone.aichi.jp" => 0, + "toyota.aichi.jp" => 0, + "tsushima.aichi.jp" => 0, + "yatomi.aichi.jp" => 0, + "akita.akita.jp" => 0, + "daisen.akita.jp" => 0, + "fujisato.akita.jp" => 0, + "gojome.akita.jp" => 0, + "hachirogata.akita.jp" => 0, + "happou.akita.jp" => 0, + "higashinaruse.akita.jp" => 0, + "honjo.akita.jp" => 0, + "honjyo.akita.jp" => 0, + "ikawa.akita.jp" => 0, + "kamikoani.akita.jp" => 0, + "kamioka.akita.jp" => 0, + "katagami.akita.jp" => 0, + "kazuno.akita.jp" => 0, + "kitaakita.akita.jp" => 0, + "kosaka.akita.jp" => 0, + "kyowa.akita.jp" => 0, + "misato.akita.jp" => 0, + "mitane.akita.jp" => 0, + "moriyoshi.akita.jp" => 0, + "nikaho.akita.jp" => 0, + "noshiro.akita.jp" => 0, + "odate.akita.jp" => 0, + "oga.akita.jp" => 0, + "ogata.akita.jp" => 0, + "semboku.akita.jp" => 0, + "yokote.akita.jp" => 0, + "yurihonjo.akita.jp" => 0, + "aomori.aomori.jp" => 0, + "gonohe.aomori.jp" => 0, + "hachinohe.aomori.jp" => 0, + "hashikami.aomori.jp" => 0, + "hiranai.aomori.jp" => 0, + "hirosaki.aomori.jp" => 0, + "itayanagi.aomori.jp" => 0, + "kuroishi.aomori.jp" => 0, + "misawa.aomori.jp" => 0, + "mutsu.aomori.jp" => 0, + "nakadomari.aomori.jp" => 0, + "noheji.aomori.jp" => 0, + "oirase.aomori.jp" => 0, + "owani.aomori.jp" => 0, + "rokunohe.aomori.jp" => 0, + "sannohe.aomori.jp" => 0, + "shichinohe.aomori.jp" => 0, + "shingo.aomori.jp" => 0, + "takko.aomori.jp" => 0, + "towada.aomori.jp" => 0, + "tsugaru.aomori.jp" => 0, + "tsuruta.aomori.jp" => 0, + "abiko.chiba.jp" => 0, + "asahi.chiba.jp" => 0, + "chonan.chiba.jp" => 0, + "chosei.chiba.jp" => 0, + "choshi.chiba.jp" => 0, + "chuo.chiba.jp" => 0, + "funabashi.chiba.jp" => 0, + "futtsu.chiba.jp" => 0, + "hanamigawa.chiba.jp" => 0, + "ichihara.chiba.jp" => 0, + "ichikawa.chiba.jp" => 0, + "ichinomiya.chiba.jp" => 0, + "inzai.chiba.jp" => 0, + "isumi.chiba.jp" => 0, + "kamagaya.chiba.jp" => 0, + "kamogawa.chiba.jp" => 0, + "kashiwa.chiba.jp" => 0, + "katori.chiba.jp" => 0, + "katsuura.chiba.jp" => 0, + "kimitsu.chiba.jp" => 0, + "kisarazu.chiba.jp" => 0, + "kozaki.chiba.jp" => 0, + "kujukuri.chiba.jp" => 0, + "kyonan.chiba.jp" => 0, + "matsudo.chiba.jp" => 0, + "midori.chiba.jp" => 0, + "mihama.chiba.jp" => 0, + "minamiboso.chiba.jp" => 0, + "mobara.chiba.jp" => 0, + "mutsuzawa.chiba.jp" => 0, + "nagara.chiba.jp" => 0, + "nagareyama.chiba.jp" => 0, + "narashino.chiba.jp" => 0, + "narita.chiba.jp" => 0, + "noda.chiba.jp" => 0, + "oamishirasato.chiba.jp" => 0, + "omigawa.chiba.jp" => 0, + "onjuku.chiba.jp" => 0, + "otaki.chiba.jp" => 0, + "sakae.chiba.jp" => 0, + "sakura.chiba.jp" => 0, + "shimofusa.chiba.jp" => 0, + "shirako.chiba.jp" => 0, + "shiroi.chiba.jp" => 0, + "shisui.chiba.jp" => 0, + "sodegaura.chiba.jp" => 0, + "sosa.chiba.jp" => 0, + "tako.chiba.jp" => 0, + "tateyama.chiba.jp" => 0, + "togane.chiba.jp" => 0, + "tohnosho.chiba.jp" => 0, + "tomisato.chiba.jp" => 0, + "urayasu.chiba.jp" => 0, + "yachimata.chiba.jp" => 0, + "yachiyo.chiba.jp" => 0, + "yokaichiba.chiba.jp" => 0, + "yokoshibahikari.chiba.jp" => 0, + "yotsukaido.chiba.jp" => 0, + "ainan.ehime.jp" => 0, + "honai.ehime.jp" => 0, + "ikata.ehime.jp" => 0, + "imabari.ehime.jp" => 0, + "iyo.ehime.jp" => 0, + "kamijima.ehime.jp" => 0, + "kihoku.ehime.jp" => 0, + "kumakogen.ehime.jp" => 0, + "masaki.ehime.jp" => 0, + "matsuno.ehime.jp" => 0, + "matsuyama.ehime.jp" => 0, + "namikata.ehime.jp" => 0, + "niihama.ehime.jp" => 0, + "ozu.ehime.jp" => 0, + "saijo.ehime.jp" => 0, + "seiyo.ehime.jp" => 0, + "shikokuchuo.ehime.jp" => 0, + "tobe.ehime.jp" => 0, + "toon.ehime.jp" => 0, + "uchiko.ehime.jp" => 0, + "uwajima.ehime.jp" => 0, + "yawatahama.ehime.jp" => 0, + "echizen.fukui.jp" => 0, + "eiheiji.fukui.jp" => 0, + "fukui.fukui.jp" => 0, + "ikeda.fukui.jp" => 0, + "katsuyama.fukui.jp" => 0, + "mihama.fukui.jp" => 0, + "minamiechizen.fukui.jp" => 0, + "obama.fukui.jp" => 0, + "ohi.fukui.jp" => 0, + "ono.fukui.jp" => 0, + "sabae.fukui.jp" => 0, + "sakai.fukui.jp" => 0, + "takahama.fukui.jp" => 0, + "tsuruga.fukui.jp" => 0, + "wakasa.fukui.jp" => 0, + "ashiya.fukuoka.jp" => 0, + "buzen.fukuoka.jp" => 0, + "chikugo.fukuoka.jp" => 0, + "chikuho.fukuoka.jp" => 0, + "chikujo.fukuoka.jp" => 0, + "chikushino.fukuoka.jp" => 0, + "chikuzen.fukuoka.jp" => 0, + "chuo.fukuoka.jp" => 0, + "dazaifu.fukuoka.jp" => 0, + "fukuchi.fukuoka.jp" => 0, + "hakata.fukuoka.jp" => 0, + "higashi.fukuoka.jp" => 0, + "hirokawa.fukuoka.jp" => 0, + "hisayama.fukuoka.jp" => 0, + "iizuka.fukuoka.jp" => 0, + "inatsuki.fukuoka.jp" => 0, + "kaho.fukuoka.jp" => 0, + "kasuga.fukuoka.jp" => 0, + "kasuya.fukuoka.jp" => 0, + "kawara.fukuoka.jp" => 0, + "keisen.fukuoka.jp" => 0, + "koga.fukuoka.jp" => 0, + "kurate.fukuoka.jp" => 0, + "kurogi.fukuoka.jp" => 0, + "kurume.fukuoka.jp" => 0, + "minami.fukuoka.jp" => 0, + "miyako.fukuoka.jp" => 0, + "miyama.fukuoka.jp" => 0, + "miyawaka.fukuoka.jp" => 0, + "mizumaki.fukuoka.jp" => 0, + "munakata.fukuoka.jp" => 0, + "nakagawa.fukuoka.jp" => 0, + "nakama.fukuoka.jp" => 0, + "nishi.fukuoka.jp" => 0, + "nogata.fukuoka.jp" => 0, + "ogori.fukuoka.jp" => 0, + "okagaki.fukuoka.jp" => 0, + "okawa.fukuoka.jp" => 0, + "oki.fukuoka.jp" => 0, + "omuta.fukuoka.jp" => 0, + "onga.fukuoka.jp" => 0, + "onojo.fukuoka.jp" => 0, + "oto.fukuoka.jp" => 0, + "saigawa.fukuoka.jp" => 0, + "sasaguri.fukuoka.jp" => 0, + "shingu.fukuoka.jp" => 0, + "shinyoshitomi.fukuoka.jp" => 0, + "shonai.fukuoka.jp" => 0, + "soeda.fukuoka.jp" => 0, + "sue.fukuoka.jp" => 0, + "tachiarai.fukuoka.jp" => 0, + "tagawa.fukuoka.jp" => 0, + "takata.fukuoka.jp" => 0, + "toho.fukuoka.jp" => 0, + "toyotsu.fukuoka.jp" => 0, + "tsuiki.fukuoka.jp" => 0, + "ukiha.fukuoka.jp" => 0, + "umi.fukuoka.jp" => 0, + "usui.fukuoka.jp" => 0, + "yamada.fukuoka.jp" => 0, + "yame.fukuoka.jp" => 0, + "yanagawa.fukuoka.jp" => 0, + "yukuhashi.fukuoka.jp" => 0, + "aizubange.fukushima.jp" => 0, + "aizumisato.fukushima.jp" => 0, + "aizuwakamatsu.fukushima.jp" => 0, + "asakawa.fukushima.jp" => 0, + "bandai.fukushima.jp" => 0, + "date.fukushima.jp" => 0, + "fukushima.fukushima.jp" => 0, + "furudono.fukushima.jp" => 0, + "futaba.fukushima.jp" => 0, + "hanawa.fukushima.jp" => 0, + "higashi.fukushima.jp" => 0, + "hirata.fukushima.jp" => 0, + "hirono.fukushima.jp" => 0, + "iitate.fukushima.jp" => 0, + "inawashiro.fukushima.jp" => 0, + "ishikawa.fukushima.jp" => 0, + "iwaki.fukushima.jp" => 0, + "izumizaki.fukushima.jp" => 0, + "kagamiishi.fukushima.jp" => 0, + "kaneyama.fukushima.jp" => 0, + "kawamata.fukushima.jp" => 0, + "kitakata.fukushima.jp" => 0, + "kitashiobara.fukushima.jp" => 0, + "koori.fukushima.jp" => 0, + "koriyama.fukushima.jp" => 0, + "kunimi.fukushima.jp" => 0, + "miharu.fukushima.jp" => 0, + "mishima.fukushima.jp" => 0, + "namie.fukushima.jp" => 0, + "nango.fukushima.jp" => 0, + "nishiaizu.fukushima.jp" => 0, + "nishigo.fukushima.jp" => 0, + "okuma.fukushima.jp" => 0, + "omotego.fukushima.jp" => 0, + "ono.fukushima.jp" => 0, + "otama.fukushima.jp" => 0, + "samegawa.fukushima.jp" => 0, + "shimogo.fukushima.jp" => 0, + "shirakawa.fukushima.jp" => 0, + "showa.fukushima.jp" => 0, + "soma.fukushima.jp" => 0, + "sukagawa.fukushima.jp" => 0, + "taishin.fukushima.jp" => 0, + "tamakawa.fukushima.jp" => 0, + "tanagura.fukushima.jp" => 0, + "tenei.fukushima.jp" => 0, + "yabuki.fukushima.jp" => 0, + "yamato.fukushima.jp" => 0, + "yamatsuri.fukushima.jp" => 0, + "yanaizu.fukushima.jp" => 0, + "yugawa.fukushima.jp" => 0, + "anpachi.gifu.jp" => 0, + "ena.gifu.jp" => 0, + "gifu.gifu.jp" => 0, + "ginan.gifu.jp" => 0, + "godo.gifu.jp" => 0, + "gujo.gifu.jp" => 0, + "hashima.gifu.jp" => 0, + "hichiso.gifu.jp" => 0, + "hida.gifu.jp" => 0, + "higashishirakawa.gifu.jp" => 0, + "ibigawa.gifu.jp" => 0, + "ikeda.gifu.jp" => 0, + "kakamigahara.gifu.jp" => 0, + "kani.gifu.jp" => 0, + "kasahara.gifu.jp" => 0, + "kasamatsu.gifu.jp" => 0, + "kawaue.gifu.jp" => 0, + "kitagata.gifu.jp" => 0, + "mino.gifu.jp" => 0, + "minokamo.gifu.jp" => 0, + "mitake.gifu.jp" => 0, + "mizunami.gifu.jp" => 0, + "motosu.gifu.jp" => 0, + "nakatsugawa.gifu.jp" => 0, + "ogaki.gifu.jp" => 0, + "sakahogi.gifu.jp" => 0, + "seki.gifu.jp" => 0, + "sekigahara.gifu.jp" => 0, + "shirakawa.gifu.jp" => 0, + "tajimi.gifu.jp" => 0, + "takayama.gifu.jp" => 0, + "tarui.gifu.jp" => 0, + "toki.gifu.jp" => 0, + "tomika.gifu.jp" => 0, + "wanouchi.gifu.jp" => 0, + "yamagata.gifu.jp" => 0, + "yaotsu.gifu.jp" => 0, + "yoro.gifu.jp" => 0, + "annaka.gunma.jp" => 0, + "chiyoda.gunma.jp" => 0, + "fujioka.gunma.jp" => 0, + "higashiagatsuma.gunma.jp" => 0, + "isesaki.gunma.jp" => 0, + "itakura.gunma.jp" => 0, + "kanna.gunma.jp" => 0, + "kanra.gunma.jp" => 0, + "katashina.gunma.jp" => 0, + "kawaba.gunma.jp" => 0, + "kiryu.gunma.jp" => 0, + "kusatsu.gunma.jp" => 0, + "maebashi.gunma.jp" => 0, + "meiwa.gunma.jp" => 0, + "midori.gunma.jp" => 0, + "minakami.gunma.jp" => 0, + "naganohara.gunma.jp" => 0, + "nakanojo.gunma.jp" => 0, + "nanmoku.gunma.jp" => 0, + "numata.gunma.jp" => 0, + "oizumi.gunma.jp" => 0, + "ora.gunma.jp" => 0, + "ota.gunma.jp" => 0, + "shibukawa.gunma.jp" => 0, + "shimonita.gunma.jp" => 0, + "shinto.gunma.jp" => 0, + "showa.gunma.jp" => 0, + "takasaki.gunma.jp" => 0, + "takayama.gunma.jp" => 0, + "tamamura.gunma.jp" => 0, + "tatebayashi.gunma.jp" => 0, + "tomioka.gunma.jp" => 0, + "tsukiyono.gunma.jp" => 0, + "tsumagoi.gunma.jp" => 0, + "ueno.gunma.jp" => 0, + "yoshioka.gunma.jp" => 0, + "asaminami.hiroshima.jp" => 0, + "daiwa.hiroshima.jp" => 0, + "etajima.hiroshima.jp" => 0, + "fuchu.hiroshima.jp" => 0, + "fukuyama.hiroshima.jp" => 0, + "hatsukaichi.hiroshima.jp" => 0, + "higashihiroshima.hiroshima.jp" => 0, + "hongo.hiroshima.jp" => 0, + "jinsekikogen.hiroshima.jp" => 0, + "kaita.hiroshima.jp" => 0, + "kui.hiroshima.jp" => 0, + "kumano.hiroshima.jp" => 0, + "kure.hiroshima.jp" => 0, + "mihara.hiroshima.jp" => 0, + "miyoshi.hiroshima.jp" => 0, + "naka.hiroshima.jp" => 0, + "onomichi.hiroshima.jp" => 0, + "osakikamijima.hiroshima.jp" => 0, + "otake.hiroshima.jp" => 0, + "saka.hiroshima.jp" => 0, + "sera.hiroshima.jp" => 0, + "seranishi.hiroshima.jp" => 0, + "shinichi.hiroshima.jp" => 0, + "shobara.hiroshima.jp" => 0, + "takehara.hiroshima.jp" => 0, + "abashiri.hokkaido.jp" => 0, + "abira.hokkaido.jp" => 0, + "aibetsu.hokkaido.jp" => 0, + "akabira.hokkaido.jp" => 0, + "akkeshi.hokkaido.jp" => 0, + "asahikawa.hokkaido.jp" => 0, + "ashibetsu.hokkaido.jp" => 0, + "ashoro.hokkaido.jp" => 0, + "assabu.hokkaido.jp" => 0, + "atsuma.hokkaido.jp" => 0, + "bibai.hokkaido.jp" => 0, + "biei.hokkaido.jp" => 0, + "bifuka.hokkaido.jp" => 0, + "bihoro.hokkaido.jp" => 0, + "biratori.hokkaido.jp" => 0, + "chippubetsu.hokkaido.jp" => 0, + "chitose.hokkaido.jp" => 0, + "date.hokkaido.jp" => 0, + "ebetsu.hokkaido.jp" => 0, + "embetsu.hokkaido.jp" => 0, + "eniwa.hokkaido.jp" => 0, + "erimo.hokkaido.jp" => 0, + "esan.hokkaido.jp" => 0, + "esashi.hokkaido.jp" => 0, + "fukagawa.hokkaido.jp" => 0, + "fukushima.hokkaido.jp" => 0, + "furano.hokkaido.jp" => 0, + "furubira.hokkaido.jp" => 0, + "haboro.hokkaido.jp" => 0, + "hakodate.hokkaido.jp" => 0, + "hamatonbetsu.hokkaido.jp" => 0, + "hidaka.hokkaido.jp" => 0, + "higashikagura.hokkaido.jp" => 0, + "higashikawa.hokkaido.jp" => 0, + "hiroo.hokkaido.jp" => 0, + "hokuryu.hokkaido.jp" => 0, + "hokuto.hokkaido.jp" => 0, + "honbetsu.hokkaido.jp" => 0, + "horokanai.hokkaido.jp" => 0, + "horonobe.hokkaido.jp" => 0, + "ikeda.hokkaido.jp" => 0, + "imakane.hokkaido.jp" => 0, + "ishikari.hokkaido.jp" => 0, + "iwamizawa.hokkaido.jp" => 0, + "iwanai.hokkaido.jp" => 0, + "kamifurano.hokkaido.jp" => 0, + "kamikawa.hokkaido.jp" => 0, + "kamishihoro.hokkaido.jp" => 0, + "kamisunagawa.hokkaido.jp" => 0, + "kamoenai.hokkaido.jp" => 0, + "kayabe.hokkaido.jp" => 0, + "kembuchi.hokkaido.jp" => 0, + "kikonai.hokkaido.jp" => 0, + "kimobetsu.hokkaido.jp" => 0, + "kitahiroshima.hokkaido.jp" => 0, + "kitami.hokkaido.jp" => 0, + "kiyosato.hokkaido.jp" => 0, + "koshimizu.hokkaido.jp" => 0, + "kunneppu.hokkaido.jp" => 0, + "kuriyama.hokkaido.jp" => 0, + "kuromatsunai.hokkaido.jp" => 0, + "kushiro.hokkaido.jp" => 0, + "kutchan.hokkaido.jp" => 0, + "kyowa.hokkaido.jp" => 0, + "mashike.hokkaido.jp" => 0, + "matsumae.hokkaido.jp" => 0, + "mikasa.hokkaido.jp" => 0, + "minamifurano.hokkaido.jp" => 0, + "mombetsu.hokkaido.jp" => 0, + "moseushi.hokkaido.jp" => 0, + "mukawa.hokkaido.jp" => 0, + "muroran.hokkaido.jp" => 0, + "naie.hokkaido.jp" => 0, + "nakagawa.hokkaido.jp" => 0, + "nakasatsunai.hokkaido.jp" => 0, + "nakatombetsu.hokkaido.jp" => 0, + "nanae.hokkaido.jp" => 0, + "nanporo.hokkaido.jp" => 0, + "nayoro.hokkaido.jp" => 0, + "nemuro.hokkaido.jp" => 0, + "niikappu.hokkaido.jp" => 0, + "niki.hokkaido.jp" => 0, + "nishiokoppe.hokkaido.jp" => 0, + "noboribetsu.hokkaido.jp" => 0, + "numata.hokkaido.jp" => 0, + "obihiro.hokkaido.jp" => 0, + "obira.hokkaido.jp" => 0, + "oketo.hokkaido.jp" => 0, + "okoppe.hokkaido.jp" => 0, + "otaru.hokkaido.jp" => 0, + "otobe.hokkaido.jp" => 0, + "otofuke.hokkaido.jp" => 0, + "otoineppu.hokkaido.jp" => 0, + "oumu.hokkaido.jp" => 0, + "ozora.hokkaido.jp" => 0, + "pippu.hokkaido.jp" => 0, + "rankoshi.hokkaido.jp" => 0, + "rebun.hokkaido.jp" => 0, + "rikubetsu.hokkaido.jp" => 0, + "rishiri.hokkaido.jp" => 0, + "rishirifuji.hokkaido.jp" => 0, + "saroma.hokkaido.jp" => 0, + "sarufutsu.hokkaido.jp" => 0, + "shakotan.hokkaido.jp" => 0, + "shari.hokkaido.jp" => 0, + "shibecha.hokkaido.jp" => 0, + "shibetsu.hokkaido.jp" => 0, + "shikabe.hokkaido.jp" => 0, + "shikaoi.hokkaido.jp" => 0, + "shimamaki.hokkaido.jp" => 0, + "shimizu.hokkaido.jp" => 0, + "shimokawa.hokkaido.jp" => 0, + "shinshinotsu.hokkaido.jp" => 0, + "shintoku.hokkaido.jp" => 0, + "shiranuka.hokkaido.jp" => 0, + "shiraoi.hokkaido.jp" => 0, + "shiriuchi.hokkaido.jp" => 0, + "sobetsu.hokkaido.jp" => 0, + "sunagawa.hokkaido.jp" => 0, + "taiki.hokkaido.jp" => 0, + "takasu.hokkaido.jp" => 0, + "takikawa.hokkaido.jp" => 0, + "takinoue.hokkaido.jp" => 0, + "teshikaga.hokkaido.jp" => 0, + "tobetsu.hokkaido.jp" => 0, + "tohma.hokkaido.jp" => 0, + "tomakomai.hokkaido.jp" => 0, + "tomari.hokkaido.jp" => 0, + "toya.hokkaido.jp" => 0, + "toyako.hokkaido.jp" => 0, + "toyotomi.hokkaido.jp" => 0, + "toyoura.hokkaido.jp" => 0, + "tsubetsu.hokkaido.jp" => 0, + "tsukigata.hokkaido.jp" => 0, + "urakawa.hokkaido.jp" => 0, + "urausu.hokkaido.jp" => 0, + "uryu.hokkaido.jp" => 0, + "utashinai.hokkaido.jp" => 0, + "wakkanai.hokkaido.jp" => 0, + "wassamu.hokkaido.jp" => 0, + "yakumo.hokkaido.jp" => 0, + "yoichi.hokkaido.jp" => 0, + "aioi.hyogo.jp" => 0, + "akashi.hyogo.jp" => 0, + "ako.hyogo.jp" => 0, + "amagasaki.hyogo.jp" => 0, + "aogaki.hyogo.jp" => 0, + "asago.hyogo.jp" => 0, + "ashiya.hyogo.jp" => 0, + "awaji.hyogo.jp" => 0, + "fukusaki.hyogo.jp" => 0, + "goshiki.hyogo.jp" => 0, + "harima.hyogo.jp" => 0, + "himeji.hyogo.jp" => 0, + "ichikawa.hyogo.jp" => 0, + "inagawa.hyogo.jp" => 0, + "itami.hyogo.jp" => 0, + "kakogawa.hyogo.jp" => 0, + "kamigori.hyogo.jp" => 0, + "kamikawa.hyogo.jp" => 0, + "kasai.hyogo.jp" => 0, + "kasuga.hyogo.jp" => 0, + "kawanishi.hyogo.jp" => 0, + "miki.hyogo.jp" => 0, + "minamiawaji.hyogo.jp" => 0, + "nishinomiya.hyogo.jp" => 0, + "nishiwaki.hyogo.jp" => 0, + "ono.hyogo.jp" => 0, + "sanda.hyogo.jp" => 0, + "sannan.hyogo.jp" => 0, + "sasayama.hyogo.jp" => 0, + "sayo.hyogo.jp" => 0, + "shingu.hyogo.jp" => 0, + "shinonsen.hyogo.jp" => 0, + "shiso.hyogo.jp" => 0, + "sumoto.hyogo.jp" => 0, + "taishi.hyogo.jp" => 0, + "taka.hyogo.jp" => 0, + "takarazuka.hyogo.jp" => 0, + "takasago.hyogo.jp" => 0, + "takino.hyogo.jp" => 0, + "tamba.hyogo.jp" => 0, + "tatsuno.hyogo.jp" => 0, + "toyooka.hyogo.jp" => 0, + "yabu.hyogo.jp" => 0, + "yashiro.hyogo.jp" => 0, + "yoka.hyogo.jp" => 0, + "yokawa.hyogo.jp" => 0, + "ami.ibaraki.jp" => 0, + "asahi.ibaraki.jp" => 0, + "bando.ibaraki.jp" => 0, + "chikusei.ibaraki.jp" => 0, + "daigo.ibaraki.jp" => 0, + "fujishiro.ibaraki.jp" => 0, + "hitachi.ibaraki.jp" => 0, + "hitachinaka.ibaraki.jp" => 0, + "hitachiomiya.ibaraki.jp" => 0, + "hitachiota.ibaraki.jp" => 0, + "ibaraki.ibaraki.jp" => 0, + "ina.ibaraki.jp" => 0, + "inashiki.ibaraki.jp" => 0, + "itako.ibaraki.jp" => 0, + "iwama.ibaraki.jp" => 0, + "joso.ibaraki.jp" => 0, + "kamisu.ibaraki.jp" => 0, + "kasama.ibaraki.jp" => 0, + "kashima.ibaraki.jp" => 0, + "kasumigaura.ibaraki.jp" => 0, + "koga.ibaraki.jp" => 0, + "miho.ibaraki.jp" => 0, + "mito.ibaraki.jp" => 0, + "moriya.ibaraki.jp" => 0, + "naka.ibaraki.jp" => 0, + "namegata.ibaraki.jp" => 0, + "oarai.ibaraki.jp" => 0, + "ogawa.ibaraki.jp" => 0, + "omitama.ibaraki.jp" => 0, + "ryugasaki.ibaraki.jp" => 0, + "sakai.ibaraki.jp" => 0, + "sakuragawa.ibaraki.jp" => 0, + "shimodate.ibaraki.jp" => 0, + "shimotsuma.ibaraki.jp" => 0, + "shirosato.ibaraki.jp" => 0, + "sowa.ibaraki.jp" => 0, + "suifu.ibaraki.jp" => 0, + "takahagi.ibaraki.jp" => 0, + "tamatsukuri.ibaraki.jp" => 0, + "tokai.ibaraki.jp" => 0, + "tomobe.ibaraki.jp" => 0, + "tone.ibaraki.jp" => 0, + "toride.ibaraki.jp" => 0, + "tsuchiura.ibaraki.jp" => 0, + "tsukuba.ibaraki.jp" => 0, + "uchihara.ibaraki.jp" => 0, + "ushiku.ibaraki.jp" => 0, + "yachiyo.ibaraki.jp" => 0, + "yamagata.ibaraki.jp" => 0, + "yawara.ibaraki.jp" => 0, + "yuki.ibaraki.jp" => 0, + "anamizu.ishikawa.jp" => 0, + "hakui.ishikawa.jp" => 0, + "hakusan.ishikawa.jp" => 0, + "kaga.ishikawa.jp" => 0, + "kahoku.ishikawa.jp" => 0, + "kanazawa.ishikawa.jp" => 0, + "kawakita.ishikawa.jp" => 0, + "komatsu.ishikawa.jp" => 0, + "nakanoto.ishikawa.jp" => 0, + "nanao.ishikawa.jp" => 0, + "nomi.ishikawa.jp" => 0, + "nonoichi.ishikawa.jp" => 0, + "noto.ishikawa.jp" => 0, + "shika.ishikawa.jp" => 0, + "suzu.ishikawa.jp" => 0, + "tsubata.ishikawa.jp" => 0, + "tsurugi.ishikawa.jp" => 0, + "uchinada.ishikawa.jp" => 0, + "wajima.ishikawa.jp" => 0, + "fudai.iwate.jp" => 0, + "fujisawa.iwate.jp" => 0, + "hanamaki.iwate.jp" => 0, + "hiraizumi.iwate.jp" => 0, + "hirono.iwate.jp" => 0, + "ichinohe.iwate.jp" => 0, + "ichinoseki.iwate.jp" => 0, + "iwaizumi.iwate.jp" => 0, + "iwate.iwate.jp" => 0, + "joboji.iwate.jp" => 0, + "kamaishi.iwate.jp" => 0, + "kanegasaki.iwate.jp" => 0, + "karumai.iwate.jp" => 0, + "kawai.iwate.jp" => 0, + "kitakami.iwate.jp" => 0, + "kuji.iwate.jp" => 0, + "kunohe.iwate.jp" => 0, + "kuzumaki.iwate.jp" => 0, + "miyako.iwate.jp" => 0, + "mizusawa.iwate.jp" => 0, + "morioka.iwate.jp" => 0, + "ninohe.iwate.jp" => 0, + "noda.iwate.jp" => 0, + "ofunato.iwate.jp" => 0, + "oshu.iwate.jp" => 0, + "otsuchi.iwate.jp" => 0, + "rikuzentakata.iwate.jp" => 0, + "shiwa.iwate.jp" => 0, + "shizukuishi.iwate.jp" => 0, + "sumita.iwate.jp" => 0, + "tanohata.iwate.jp" => 0, + "tono.iwate.jp" => 0, + "yahaba.iwate.jp" => 0, + "yamada.iwate.jp" => 0, + "ayagawa.kagawa.jp" => 0, + "higashikagawa.kagawa.jp" => 0, + "kanonji.kagawa.jp" => 0, + "kotohira.kagawa.jp" => 0, + "manno.kagawa.jp" => 0, + "marugame.kagawa.jp" => 0, + "mitoyo.kagawa.jp" => 0, + "naoshima.kagawa.jp" => 0, + "sanuki.kagawa.jp" => 0, + "tadotsu.kagawa.jp" => 0, + "takamatsu.kagawa.jp" => 0, + "tonosho.kagawa.jp" => 0, + "uchinomi.kagawa.jp" => 0, + "utazu.kagawa.jp" => 0, + "zentsuji.kagawa.jp" => 0, + "akune.kagoshima.jp" => 0, + "amami.kagoshima.jp" => 0, + "hioki.kagoshima.jp" => 0, + "isa.kagoshima.jp" => 0, + "isen.kagoshima.jp" => 0, + "izumi.kagoshima.jp" => 0, + "kagoshima.kagoshima.jp" => 0, + "kanoya.kagoshima.jp" => 0, + "kawanabe.kagoshima.jp" => 0, + "kinko.kagoshima.jp" => 0, + "kouyama.kagoshima.jp" => 0, + "makurazaki.kagoshima.jp" => 0, + "matsumoto.kagoshima.jp" => 0, + "minamitane.kagoshima.jp" => 0, + "nakatane.kagoshima.jp" => 0, + "nishinoomote.kagoshima.jp" => 0, + "satsumasendai.kagoshima.jp" => 0, + "soo.kagoshima.jp" => 0, + "tarumizu.kagoshima.jp" => 0, + "yusui.kagoshima.jp" => 0, + "aikawa.kanagawa.jp" => 0, + "atsugi.kanagawa.jp" => 0, + "ayase.kanagawa.jp" => 0, + "chigasaki.kanagawa.jp" => 0, + "ebina.kanagawa.jp" => 0, + "fujisawa.kanagawa.jp" => 0, + "hadano.kanagawa.jp" => 0, + "hakone.kanagawa.jp" => 0, + "hiratsuka.kanagawa.jp" => 0, + "isehara.kanagawa.jp" => 0, + "kaisei.kanagawa.jp" => 0, + "kamakura.kanagawa.jp" => 0, + "kiyokawa.kanagawa.jp" => 0, + "matsuda.kanagawa.jp" => 0, + "minamiashigara.kanagawa.jp" => 0, + "miura.kanagawa.jp" => 0, + "nakai.kanagawa.jp" => 0, + "ninomiya.kanagawa.jp" => 0, + "odawara.kanagawa.jp" => 0, + "oi.kanagawa.jp" => 0, + "oiso.kanagawa.jp" => 0, + "sagamihara.kanagawa.jp" => 0, + "samukawa.kanagawa.jp" => 0, + "tsukui.kanagawa.jp" => 0, + "yamakita.kanagawa.jp" => 0, + "yamato.kanagawa.jp" => 0, + "yokosuka.kanagawa.jp" => 0, + "yugawara.kanagawa.jp" => 0, + "zama.kanagawa.jp" => 0, + "zushi.kanagawa.jp" => 0, + "aki.kochi.jp" => 0, + "geisei.kochi.jp" => 0, + "hidaka.kochi.jp" => 0, + "higashitsuno.kochi.jp" => 0, + "ino.kochi.jp" => 0, + "kagami.kochi.jp" => 0, + "kami.kochi.jp" => 0, + "kitagawa.kochi.jp" => 0, + "kochi.kochi.jp" => 0, + "mihara.kochi.jp" => 0, + "motoyama.kochi.jp" => 0, + "muroto.kochi.jp" => 0, + "nahari.kochi.jp" => 0, + "nakamura.kochi.jp" => 0, + "nankoku.kochi.jp" => 0, + "nishitosa.kochi.jp" => 0, + "niyodogawa.kochi.jp" => 0, + "ochi.kochi.jp" => 0, + "okawa.kochi.jp" => 0, + "otoyo.kochi.jp" => 0, + "otsuki.kochi.jp" => 0, + "sakawa.kochi.jp" => 0, + "sukumo.kochi.jp" => 0, + "susaki.kochi.jp" => 0, + "tosa.kochi.jp" => 0, + "tosashimizu.kochi.jp" => 0, + "toyo.kochi.jp" => 0, + "tsuno.kochi.jp" => 0, + "umaji.kochi.jp" => 0, + "yasuda.kochi.jp" => 0, + "yusuhara.kochi.jp" => 0, + "amakusa.kumamoto.jp" => 0, + "arao.kumamoto.jp" => 0, + "aso.kumamoto.jp" => 0, + "choyo.kumamoto.jp" => 0, + "gyokuto.kumamoto.jp" => 0, + "kamiamakusa.kumamoto.jp" => 0, + "kikuchi.kumamoto.jp" => 0, + "kumamoto.kumamoto.jp" => 0, + "mashiki.kumamoto.jp" => 0, + "mifune.kumamoto.jp" => 0, + "minamata.kumamoto.jp" => 0, + "minamioguni.kumamoto.jp" => 0, + "nagasu.kumamoto.jp" => 0, + "nishihara.kumamoto.jp" => 0, + "oguni.kumamoto.jp" => 0, + "ozu.kumamoto.jp" => 0, + "sumoto.kumamoto.jp" => 0, + "takamori.kumamoto.jp" => 0, + "uki.kumamoto.jp" => 0, + "uto.kumamoto.jp" => 0, + "yamaga.kumamoto.jp" => 0, + "yamato.kumamoto.jp" => 0, + "yatsushiro.kumamoto.jp" => 0, + "ayabe.kyoto.jp" => 0, + "fukuchiyama.kyoto.jp" => 0, + "higashiyama.kyoto.jp" => 0, + "ide.kyoto.jp" => 0, + "ine.kyoto.jp" => 0, + "joyo.kyoto.jp" => 0, + "kameoka.kyoto.jp" => 0, + "kamo.kyoto.jp" => 0, + "kita.kyoto.jp" => 0, + "kizu.kyoto.jp" => 0, + "kumiyama.kyoto.jp" => 0, + "kyotamba.kyoto.jp" => 0, + "kyotanabe.kyoto.jp" => 0, + "kyotango.kyoto.jp" => 0, + "maizuru.kyoto.jp" => 0, + "minami.kyoto.jp" => 0, + "minamiyamashiro.kyoto.jp" => 0, + "miyazu.kyoto.jp" => 0, + "muko.kyoto.jp" => 0, + "nagaokakyo.kyoto.jp" => 0, + "nakagyo.kyoto.jp" => 0, + "nantan.kyoto.jp" => 0, + "oyamazaki.kyoto.jp" => 0, + "sakyo.kyoto.jp" => 0, + "seika.kyoto.jp" => 0, + "tanabe.kyoto.jp" => 0, + "uji.kyoto.jp" => 0, + "ujitawara.kyoto.jp" => 0, + "wazuka.kyoto.jp" => 0, + "yamashina.kyoto.jp" => 0, + "yawata.kyoto.jp" => 0, + "asahi.mie.jp" => 0, + "inabe.mie.jp" => 0, + "ise.mie.jp" => 0, + "kameyama.mie.jp" => 0, + "kawagoe.mie.jp" => 0, + "kiho.mie.jp" => 0, + "kisosaki.mie.jp" => 0, + "kiwa.mie.jp" => 0, + "komono.mie.jp" => 0, + "kumano.mie.jp" => 0, + "kuwana.mie.jp" => 0, + "matsusaka.mie.jp" => 0, + "meiwa.mie.jp" => 0, + "mihama.mie.jp" => 0, + "minamiise.mie.jp" => 0, + "misugi.mie.jp" => 0, + "miyama.mie.jp" => 0, + "nabari.mie.jp" => 0, + "shima.mie.jp" => 0, + "suzuka.mie.jp" => 0, + "tado.mie.jp" => 0, + "taiki.mie.jp" => 0, + "taki.mie.jp" => 0, + "tamaki.mie.jp" => 0, + "toba.mie.jp" => 0, + "tsu.mie.jp" => 0, + "udono.mie.jp" => 0, + "ureshino.mie.jp" => 0, + "watarai.mie.jp" => 0, + "yokkaichi.mie.jp" => 0, + "furukawa.miyagi.jp" => 0, + "higashimatsushima.miyagi.jp" => 0, + "ishinomaki.miyagi.jp" => 0, + "iwanuma.miyagi.jp" => 0, + "kakuda.miyagi.jp" => 0, + "kami.miyagi.jp" => 0, + "kawasaki.miyagi.jp" => 0, + "marumori.miyagi.jp" => 0, + "matsushima.miyagi.jp" => 0, + "minamisanriku.miyagi.jp" => 0, + "misato.miyagi.jp" => 0, + "murata.miyagi.jp" => 0, + "natori.miyagi.jp" => 0, + "ogawara.miyagi.jp" => 0, + "ohira.miyagi.jp" => 0, + "onagawa.miyagi.jp" => 0, + "osaki.miyagi.jp" => 0, + "rifu.miyagi.jp" => 0, + "semine.miyagi.jp" => 0, + "shibata.miyagi.jp" => 0, + "shichikashuku.miyagi.jp" => 0, + "shikama.miyagi.jp" => 0, + "shiogama.miyagi.jp" => 0, + "shiroishi.miyagi.jp" => 0, + "tagajo.miyagi.jp" => 0, + "taiwa.miyagi.jp" => 0, + "tome.miyagi.jp" => 0, + "tomiya.miyagi.jp" => 0, + "wakuya.miyagi.jp" => 0, + "watari.miyagi.jp" => 0, + "yamamoto.miyagi.jp" => 0, + "zao.miyagi.jp" => 0, + "aya.miyazaki.jp" => 0, + "ebino.miyazaki.jp" => 0, + "gokase.miyazaki.jp" => 0, + "hyuga.miyazaki.jp" => 0, + "kadogawa.miyazaki.jp" => 0, + "kawaminami.miyazaki.jp" => 0, + "kijo.miyazaki.jp" => 0, + "kitagawa.miyazaki.jp" => 0, + "kitakata.miyazaki.jp" => 0, + "kitaura.miyazaki.jp" => 0, + "kobayashi.miyazaki.jp" => 0, + "kunitomi.miyazaki.jp" => 0, + "kushima.miyazaki.jp" => 0, + "mimata.miyazaki.jp" => 0, + "miyakonojo.miyazaki.jp" => 0, + "miyazaki.miyazaki.jp" => 0, + "morotsuka.miyazaki.jp" => 0, + "nichinan.miyazaki.jp" => 0, + "nishimera.miyazaki.jp" => 0, + "nobeoka.miyazaki.jp" => 0, + "saito.miyazaki.jp" => 0, + "shiiba.miyazaki.jp" => 0, + "shintomi.miyazaki.jp" => 0, + "takaharu.miyazaki.jp" => 0, + "takanabe.miyazaki.jp" => 0, + "takazaki.miyazaki.jp" => 0, + "tsuno.miyazaki.jp" => 0, + "achi.nagano.jp" => 0, + "agematsu.nagano.jp" => 0, + "anan.nagano.jp" => 0, + "aoki.nagano.jp" => 0, + "asahi.nagano.jp" => 0, + "azumino.nagano.jp" => 0, + "chikuhoku.nagano.jp" => 0, + "chikuma.nagano.jp" => 0, + "chino.nagano.jp" => 0, + "fujimi.nagano.jp" => 0, + "hakuba.nagano.jp" => 0, + "hara.nagano.jp" => 0, + "hiraya.nagano.jp" => 0, + "iida.nagano.jp" => 0, + "iijima.nagano.jp" => 0, + "iiyama.nagano.jp" => 0, + "iizuna.nagano.jp" => 0, + "ikeda.nagano.jp" => 0, + "ikusaka.nagano.jp" => 0, + "ina.nagano.jp" => 0, + "karuizawa.nagano.jp" => 0, + "kawakami.nagano.jp" => 0, + "kiso.nagano.jp" => 0, + "kisofukushima.nagano.jp" => 0, + "kitaaiki.nagano.jp" => 0, + "komagane.nagano.jp" => 0, + "komoro.nagano.jp" => 0, + "matsukawa.nagano.jp" => 0, + "matsumoto.nagano.jp" => 0, + "miasa.nagano.jp" => 0, + "minamiaiki.nagano.jp" => 0, + "minamimaki.nagano.jp" => 0, + "minamiminowa.nagano.jp" => 0, + "minowa.nagano.jp" => 0, + "miyada.nagano.jp" => 0, + "miyota.nagano.jp" => 0, + "mochizuki.nagano.jp" => 0, + "nagano.nagano.jp" => 0, + "nagawa.nagano.jp" => 0, + "nagiso.nagano.jp" => 0, + "nakagawa.nagano.jp" => 0, + "nakano.nagano.jp" => 0, + "nozawaonsen.nagano.jp" => 0, + "obuse.nagano.jp" => 0, + "ogawa.nagano.jp" => 0, + "okaya.nagano.jp" => 0, + "omachi.nagano.jp" => 0, + "omi.nagano.jp" => 0, + "ookuwa.nagano.jp" => 0, + "ooshika.nagano.jp" => 0, + "otaki.nagano.jp" => 0, + "otari.nagano.jp" => 0, + "sakae.nagano.jp" => 0, + "sakaki.nagano.jp" => 0, + "saku.nagano.jp" => 0, + "sakuho.nagano.jp" => 0, + "shimosuwa.nagano.jp" => 0, + "shinanomachi.nagano.jp" => 0, + "shiojiri.nagano.jp" => 0, + "suwa.nagano.jp" => 0, + "suzaka.nagano.jp" => 0, + "takagi.nagano.jp" => 0, + "takamori.nagano.jp" => 0, + "takayama.nagano.jp" => 0, + "tateshina.nagano.jp" => 0, + "tatsuno.nagano.jp" => 0, + "togakushi.nagano.jp" => 0, + "togura.nagano.jp" => 0, + "tomi.nagano.jp" => 0, + "ueda.nagano.jp" => 0, + "wada.nagano.jp" => 0, + "yamagata.nagano.jp" => 0, + "yamanouchi.nagano.jp" => 0, + "yasaka.nagano.jp" => 0, + "yasuoka.nagano.jp" => 0, + "chijiwa.nagasaki.jp" => 0, + "futsu.nagasaki.jp" => 0, + "goto.nagasaki.jp" => 0, + "hasami.nagasaki.jp" => 0, + "hirado.nagasaki.jp" => 0, + "iki.nagasaki.jp" => 0, + "isahaya.nagasaki.jp" => 0, + "kawatana.nagasaki.jp" => 0, + "kuchinotsu.nagasaki.jp" => 0, + "matsuura.nagasaki.jp" => 0, + "nagasaki.nagasaki.jp" => 0, + "obama.nagasaki.jp" => 0, + "omura.nagasaki.jp" => 0, + "oseto.nagasaki.jp" => 0, + "saikai.nagasaki.jp" => 0, + "sasebo.nagasaki.jp" => 0, + "seihi.nagasaki.jp" => 0, + "shimabara.nagasaki.jp" => 0, + "shinkamigoto.nagasaki.jp" => 0, + "togitsu.nagasaki.jp" => 0, + "tsushima.nagasaki.jp" => 0, + "unzen.nagasaki.jp" => 0, + "ando.nara.jp" => 0, + "gose.nara.jp" => 0, + "heguri.nara.jp" => 0, + "higashiyoshino.nara.jp" => 0, + "ikaruga.nara.jp" => 0, + "ikoma.nara.jp" => 0, + "kamikitayama.nara.jp" => 0, + "kanmaki.nara.jp" => 0, + "kashiba.nara.jp" => 0, + "kashihara.nara.jp" => 0, + "katsuragi.nara.jp" => 0, + "kawai.nara.jp" => 0, + "kawakami.nara.jp" => 0, + "kawanishi.nara.jp" => 0, + "koryo.nara.jp" => 0, + "kurotaki.nara.jp" => 0, + "mitsue.nara.jp" => 0, + "miyake.nara.jp" => 0, + "nara.nara.jp" => 0, + "nosegawa.nara.jp" => 0, + "oji.nara.jp" => 0, + "ouda.nara.jp" => 0, + "oyodo.nara.jp" => 0, + "sakurai.nara.jp" => 0, + "sango.nara.jp" => 0, + "shimoichi.nara.jp" => 0, + "shimokitayama.nara.jp" => 0, + "shinjo.nara.jp" => 0, + "soni.nara.jp" => 0, + "takatori.nara.jp" => 0, + "tawaramoto.nara.jp" => 0, + "tenkawa.nara.jp" => 0, + "tenri.nara.jp" => 0, + "uda.nara.jp" => 0, + "yamatokoriyama.nara.jp" => 0, + "yamatotakada.nara.jp" => 0, + "yamazoe.nara.jp" => 0, + "yoshino.nara.jp" => 0, + "aga.niigata.jp" => 0, + "agano.niigata.jp" => 0, + "gosen.niigata.jp" => 0, + "itoigawa.niigata.jp" => 0, + "izumozaki.niigata.jp" => 0, + "joetsu.niigata.jp" => 0, + "kamo.niigata.jp" => 0, + "kariwa.niigata.jp" => 0, + "kashiwazaki.niigata.jp" => 0, + "minamiuonuma.niigata.jp" => 0, + "mitsuke.niigata.jp" => 0, + "muika.niigata.jp" => 0, + "murakami.niigata.jp" => 0, + "myoko.niigata.jp" => 0, + "nagaoka.niigata.jp" => 0, + "niigata.niigata.jp" => 0, + "ojiya.niigata.jp" => 0, + "omi.niigata.jp" => 0, + "sado.niigata.jp" => 0, + "sanjo.niigata.jp" => 0, + "seiro.niigata.jp" => 0, + "seirou.niigata.jp" => 0, + "sekikawa.niigata.jp" => 0, + "shibata.niigata.jp" => 0, + "tagami.niigata.jp" => 0, + "tainai.niigata.jp" => 0, + "tochio.niigata.jp" => 0, + "tokamachi.niigata.jp" => 0, + "tsubame.niigata.jp" => 0, + "tsunan.niigata.jp" => 0, + "uonuma.niigata.jp" => 0, + "yahiko.niigata.jp" => 0, + "yoita.niigata.jp" => 0, + "yuzawa.niigata.jp" => 0, + "beppu.oita.jp" => 0, + "bungoono.oita.jp" => 0, + "bungotakada.oita.jp" => 0, + "hasama.oita.jp" => 0, + "hiji.oita.jp" => 0, + "himeshima.oita.jp" => 0, + "hita.oita.jp" => 0, + "kamitsue.oita.jp" => 0, + "kokonoe.oita.jp" => 0, + "kuju.oita.jp" => 0, + "kunisaki.oita.jp" => 0, + "kusu.oita.jp" => 0, + "oita.oita.jp" => 0, + "saiki.oita.jp" => 0, + "taketa.oita.jp" => 0, + "tsukumi.oita.jp" => 0, + "usa.oita.jp" => 0, + "usuki.oita.jp" => 0, + "yufu.oita.jp" => 0, + "akaiwa.okayama.jp" => 0, + "asakuchi.okayama.jp" => 0, + "bizen.okayama.jp" => 0, + "hayashima.okayama.jp" => 0, + "ibara.okayama.jp" => 0, + "kagamino.okayama.jp" => 0, + "kasaoka.okayama.jp" => 0, + "kibichuo.okayama.jp" => 0, + "kumenan.okayama.jp" => 0, + "kurashiki.okayama.jp" => 0, + "maniwa.okayama.jp" => 0, + "misaki.okayama.jp" => 0, + "nagi.okayama.jp" => 0, + "niimi.okayama.jp" => 0, + "nishiawakura.okayama.jp" => 0, + "okayama.okayama.jp" => 0, + "satosho.okayama.jp" => 0, + "setouchi.okayama.jp" => 0, + "shinjo.okayama.jp" => 0, + "shoo.okayama.jp" => 0, + "soja.okayama.jp" => 0, + "takahashi.okayama.jp" => 0, + "tamano.okayama.jp" => 0, + "tsuyama.okayama.jp" => 0, + "wake.okayama.jp" => 0, + "yakage.okayama.jp" => 0, + "aguni.okinawa.jp" => 0, + "ginowan.okinawa.jp" => 0, + "ginoza.okinawa.jp" => 0, + "gushikami.okinawa.jp" => 0, + "haebaru.okinawa.jp" => 0, + "higashi.okinawa.jp" => 0, + "hirara.okinawa.jp" => 0, + "iheya.okinawa.jp" => 0, + "ishigaki.okinawa.jp" => 0, + "ishikawa.okinawa.jp" => 0, + "itoman.okinawa.jp" => 0, + "izena.okinawa.jp" => 0, + "kadena.okinawa.jp" => 0, + "kin.okinawa.jp" => 0, + "kitadaito.okinawa.jp" => 0, + "kitanakagusuku.okinawa.jp" => 0, + "kumejima.okinawa.jp" => 0, + "kunigami.okinawa.jp" => 0, + "minamidaito.okinawa.jp" => 0, + "motobu.okinawa.jp" => 0, + "nago.okinawa.jp" => 0, + "naha.okinawa.jp" => 0, + "nakagusuku.okinawa.jp" => 0, + "nakijin.okinawa.jp" => 0, + "nanjo.okinawa.jp" => 0, + "nishihara.okinawa.jp" => 0, + "ogimi.okinawa.jp" => 0, + "okinawa.okinawa.jp" => 0, + "onna.okinawa.jp" => 0, + "shimoji.okinawa.jp" => 0, + "taketomi.okinawa.jp" => 0, + "tarama.okinawa.jp" => 0, + "tokashiki.okinawa.jp" => 0, + "tomigusuku.okinawa.jp" => 0, + "tonaki.okinawa.jp" => 0, + "urasoe.okinawa.jp" => 0, + "uruma.okinawa.jp" => 0, + "yaese.okinawa.jp" => 0, + "yomitan.okinawa.jp" => 0, + "yonabaru.okinawa.jp" => 0, + "yonaguni.okinawa.jp" => 0, + "zamami.okinawa.jp" => 0, + "abeno.osaka.jp" => 0, + "chihayaakasaka.osaka.jp" => 0, + "chuo.osaka.jp" => 0, + "daito.osaka.jp" => 0, + "fujiidera.osaka.jp" => 0, + "habikino.osaka.jp" => 0, + "hannan.osaka.jp" => 0, + "higashiosaka.osaka.jp" => 0, + "higashisumiyoshi.osaka.jp" => 0, + "higashiyodogawa.osaka.jp" => 0, + "hirakata.osaka.jp" => 0, + "ibaraki.osaka.jp" => 0, + "ikeda.osaka.jp" => 0, + "izumi.osaka.jp" => 0, + "izumiotsu.osaka.jp" => 0, + "izumisano.osaka.jp" => 0, + "kadoma.osaka.jp" => 0, + "kaizuka.osaka.jp" => 0, + "kanan.osaka.jp" => 0, + "kashiwara.osaka.jp" => 0, + "katano.osaka.jp" => 0, + "kawachinagano.osaka.jp" => 0, + "kishiwada.osaka.jp" => 0, + "kita.osaka.jp" => 0, + "kumatori.osaka.jp" => 0, + "matsubara.osaka.jp" => 0, + "minato.osaka.jp" => 0, + "minoh.osaka.jp" => 0, + "misaki.osaka.jp" => 0, + "moriguchi.osaka.jp" => 0, + "neyagawa.osaka.jp" => 0, + "nishi.osaka.jp" => 0, + "nose.osaka.jp" => 0, + "osakasayama.osaka.jp" => 0, + "sakai.osaka.jp" => 0, + "sayama.osaka.jp" => 0, + "sennan.osaka.jp" => 0, + "settsu.osaka.jp" => 0, + "shijonawate.osaka.jp" => 0, + "shimamoto.osaka.jp" => 0, + "suita.osaka.jp" => 0, + "tadaoka.osaka.jp" => 0, + "taishi.osaka.jp" => 0, + "tajiri.osaka.jp" => 0, + "takaishi.osaka.jp" => 0, + "takatsuki.osaka.jp" => 0, + "tondabayashi.osaka.jp" => 0, + "toyonaka.osaka.jp" => 0, + "toyono.osaka.jp" => 0, + "yao.osaka.jp" => 0, + "ariake.saga.jp" => 0, + "arita.saga.jp" => 0, + "fukudomi.saga.jp" => 0, + "genkai.saga.jp" => 0, + "hamatama.saga.jp" => 0, + "hizen.saga.jp" => 0, + "imari.saga.jp" => 0, + "kamimine.saga.jp" => 0, + "kanzaki.saga.jp" => 0, + "karatsu.saga.jp" => 0, + "kashima.saga.jp" => 0, + "kitagata.saga.jp" => 0, + "kitahata.saga.jp" => 0, + "kiyama.saga.jp" => 0, + "kouhoku.saga.jp" => 0, + "kyuragi.saga.jp" => 0, + "nishiarita.saga.jp" => 0, + "ogi.saga.jp" => 0, + "omachi.saga.jp" => 0, + "ouchi.saga.jp" => 0, + "saga.saga.jp" => 0, + "shiroishi.saga.jp" => 0, + "taku.saga.jp" => 0, + "tara.saga.jp" => 0, + "tosu.saga.jp" => 0, + "yoshinogari.saga.jp" => 0, + "arakawa.saitama.jp" => 0, + "asaka.saitama.jp" => 0, + "chichibu.saitama.jp" => 0, + "fujimi.saitama.jp" => 0, + "fujimino.saitama.jp" => 0, + "fukaya.saitama.jp" => 0, + "hanno.saitama.jp" => 0, + "hanyu.saitama.jp" => 0, + "hasuda.saitama.jp" => 0, + "hatogaya.saitama.jp" => 0, + "hatoyama.saitama.jp" => 0, + "hidaka.saitama.jp" => 0, + "higashichichibu.saitama.jp" => 0, + "higashimatsuyama.saitama.jp" => 0, + "honjo.saitama.jp" => 0, + "ina.saitama.jp" => 0, + "iruma.saitama.jp" => 0, + "iwatsuki.saitama.jp" => 0, + "kamiizumi.saitama.jp" => 0, + "kamikawa.saitama.jp" => 0, + "kamisato.saitama.jp" => 0, + "kasukabe.saitama.jp" => 0, + "kawagoe.saitama.jp" => 0, + "kawaguchi.saitama.jp" => 0, + "kawajima.saitama.jp" => 0, + "kazo.saitama.jp" => 0, + "kitamoto.saitama.jp" => 0, + "koshigaya.saitama.jp" => 0, + "kounosu.saitama.jp" => 0, + "kuki.saitama.jp" => 0, + "kumagaya.saitama.jp" => 0, + "matsubushi.saitama.jp" => 0, + "minano.saitama.jp" => 0, + "misato.saitama.jp" => 0, + "miyashiro.saitama.jp" => 0, + "miyoshi.saitama.jp" => 0, + "moroyama.saitama.jp" => 0, + "nagatoro.saitama.jp" => 0, + "namegawa.saitama.jp" => 0, + "niiza.saitama.jp" => 0, + "ogano.saitama.jp" => 0, + "ogawa.saitama.jp" => 0, + "ogose.saitama.jp" => 0, + "okegawa.saitama.jp" => 0, + "omiya.saitama.jp" => 0, + "otaki.saitama.jp" => 0, + "ranzan.saitama.jp" => 0, + "ryokami.saitama.jp" => 0, + "saitama.saitama.jp" => 0, + "sakado.saitama.jp" => 0, + "satte.saitama.jp" => 0, + "sayama.saitama.jp" => 0, + "shiki.saitama.jp" => 0, + "shiraoka.saitama.jp" => 0, + "soka.saitama.jp" => 0, + "sugito.saitama.jp" => 0, + "toda.saitama.jp" => 0, + "tokigawa.saitama.jp" => 0, + "tokorozawa.saitama.jp" => 0, + "tsurugashima.saitama.jp" => 0, + "urawa.saitama.jp" => 0, + "warabi.saitama.jp" => 0, + "yashio.saitama.jp" => 0, + "yokoze.saitama.jp" => 0, + "yono.saitama.jp" => 0, + "yorii.saitama.jp" => 0, + "yoshida.saitama.jp" => 0, + "yoshikawa.saitama.jp" => 0, + "yoshimi.saitama.jp" => 0, + "aisho.shiga.jp" => 0, + "gamo.shiga.jp" => 0, + "higashiomi.shiga.jp" => 0, + "hikone.shiga.jp" => 0, + "koka.shiga.jp" => 0, + "konan.shiga.jp" => 0, + "kosei.shiga.jp" => 0, + "koto.shiga.jp" => 0, + "kusatsu.shiga.jp" => 0, + "maibara.shiga.jp" => 0, + "moriyama.shiga.jp" => 0, + "nagahama.shiga.jp" => 0, + "nishiazai.shiga.jp" => 0, + "notogawa.shiga.jp" => 0, + "omihachiman.shiga.jp" => 0, + "otsu.shiga.jp" => 0, + "ritto.shiga.jp" => 0, + "ryuoh.shiga.jp" => 0, + "takashima.shiga.jp" => 0, + "takatsuki.shiga.jp" => 0, + "torahime.shiga.jp" => 0, + "toyosato.shiga.jp" => 0, + "yasu.shiga.jp" => 0, + "akagi.shimane.jp" => 0, + "ama.shimane.jp" => 0, + "gotsu.shimane.jp" => 0, + "hamada.shimane.jp" => 0, + "higashiizumo.shimane.jp" => 0, + "hikawa.shimane.jp" => 0, + "hikimi.shimane.jp" => 0, + "izumo.shimane.jp" => 0, + "kakinoki.shimane.jp" => 0, + "masuda.shimane.jp" => 0, + "matsue.shimane.jp" => 0, + "misato.shimane.jp" => 0, + "nishinoshima.shimane.jp" => 0, + "ohda.shimane.jp" => 0, + "okinoshima.shimane.jp" => 0, + "okuizumo.shimane.jp" => 0, + "shimane.shimane.jp" => 0, + "tamayu.shimane.jp" => 0, + "tsuwano.shimane.jp" => 0, + "unnan.shimane.jp" => 0, + "yakumo.shimane.jp" => 0, + "yasugi.shimane.jp" => 0, + "yatsuka.shimane.jp" => 0, + "arai.shizuoka.jp" => 0, + "atami.shizuoka.jp" => 0, + "fuji.shizuoka.jp" => 0, + "fujieda.shizuoka.jp" => 0, + "fujikawa.shizuoka.jp" => 0, + "fujinomiya.shizuoka.jp" => 0, + "fukuroi.shizuoka.jp" => 0, + "gotemba.shizuoka.jp" => 0, + "haibara.shizuoka.jp" => 0, + "hamamatsu.shizuoka.jp" => 0, + "higashiizu.shizuoka.jp" => 0, + "ito.shizuoka.jp" => 0, + "iwata.shizuoka.jp" => 0, + "izu.shizuoka.jp" => 0, + "izunokuni.shizuoka.jp" => 0, + "kakegawa.shizuoka.jp" => 0, + "kannami.shizuoka.jp" => 0, + "kawanehon.shizuoka.jp" => 0, + "kawazu.shizuoka.jp" => 0, + "kikugawa.shizuoka.jp" => 0, + "kosai.shizuoka.jp" => 0, + "makinohara.shizuoka.jp" => 0, + "matsuzaki.shizuoka.jp" => 0, + "minamiizu.shizuoka.jp" => 0, + "mishima.shizuoka.jp" => 0, + "morimachi.shizuoka.jp" => 0, + "nishiizu.shizuoka.jp" => 0, + "numazu.shizuoka.jp" => 0, + "omaezaki.shizuoka.jp" => 0, + "shimada.shizuoka.jp" => 0, + "shimizu.shizuoka.jp" => 0, + "shimoda.shizuoka.jp" => 0, + "shizuoka.shizuoka.jp" => 0, + "susono.shizuoka.jp" => 0, + "yaizu.shizuoka.jp" => 0, + "yoshida.shizuoka.jp" => 0, + "ashikaga.tochigi.jp" => 0, + "bato.tochigi.jp" => 0, + "haga.tochigi.jp" => 0, + "ichikai.tochigi.jp" => 0, + "iwafune.tochigi.jp" => 0, + "kaminokawa.tochigi.jp" => 0, + "kanuma.tochigi.jp" => 0, + "karasuyama.tochigi.jp" => 0, + "kuroiso.tochigi.jp" => 0, + "mashiko.tochigi.jp" => 0, + "mibu.tochigi.jp" => 0, + "moka.tochigi.jp" => 0, + "motegi.tochigi.jp" => 0, + "nasu.tochigi.jp" => 0, + "nasushiobara.tochigi.jp" => 0, + "nikko.tochigi.jp" => 0, + "nishikata.tochigi.jp" => 0, + "nogi.tochigi.jp" => 0, + "ohira.tochigi.jp" => 0, + "ohtawara.tochigi.jp" => 0, + "oyama.tochigi.jp" => 0, + "sakura.tochigi.jp" => 0, + "sano.tochigi.jp" => 0, + "shimotsuke.tochigi.jp" => 0, + "shioya.tochigi.jp" => 0, + "takanezawa.tochigi.jp" => 0, + "tochigi.tochigi.jp" => 0, + "tsuga.tochigi.jp" => 0, + "ujiie.tochigi.jp" => 0, + "utsunomiya.tochigi.jp" => 0, + "yaita.tochigi.jp" => 0, + "aizumi.tokushima.jp" => 0, + "anan.tokushima.jp" => 0, + "ichiba.tokushima.jp" => 0, + "itano.tokushima.jp" => 0, + "kainan.tokushima.jp" => 0, + "komatsushima.tokushima.jp" => 0, + "matsushige.tokushima.jp" => 0, + "mima.tokushima.jp" => 0, + "minami.tokushima.jp" => 0, + "miyoshi.tokushima.jp" => 0, + "mugi.tokushima.jp" => 0, + "nakagawa.tokushima.jp" => 0, + "naruto.tokushima.jp" => 0, + "sanagochi.tokushima.jp" => 0, + "shishikui.tokushima.jp" => 0, + "tokushima.tokushima.jp" => 0, + "wajiki.tokushima.jp" => 0, + "adachi.tokyo.jp" => 0, + "akiruno.tokyo.jp" => 0, + "akishima.tokyo.jp" => 0, + "aogashima.tokyo.jp" => 0, + "arakawa.tokyo.jp" => 0, + "bunkyo.tokyo.jp" => 0, + "chiyoda.tokyo.jp" => 0, + "chofu.tokyo.jp" => 0, + "chuo.tokyo.jp" => 0, + "edogawa.tokyo.jp" => 0, + "fuchu.tokyo.jp" => 0, + "fussa.tokyo.jp" => 0, + "hachijo.tokyo.jp" => 0, + "hachioji.tokyo.jp" => 0, + "hamura.tokyo.jp" => 0, + "higashikurume.tokyo.jp" => 0, + "higashimurayama.tokyo.jp" => 0, + "higashiyamato.tokyo.jp" => 0, + "hino.tokyo.jp" => 0, + "hinode.tokyo.jp" => 0, + "hinohara.tokyo.jp" => 0, + "inagi.tokyo.jp" => 0, + "itabashi.tokyo.jp" => 0, + "katsushika.tokyo.jp" => 0, + "kita.tokyo.jp" => 0, + "kiyose.tokyo.jp" => 0, + "kodaira.tokyo.jp" => 0, + "koganei.tokyo.jp" => 0, + "kokubunji.tokyo.jp" => 0, + "komae.tokyo.jp" => 0, + "koto.tokyo.jp" => 0, + "kouzushima.tokyo.jp" => 0, + "kunitachi.tokyo.jp" => 0, + "machida.tokyo.jp" => 0, + "meguro.tokyo.jp" => 0, + "minato.tokyo.jp" => 0, + "mitaka.tokyo.jp" => 0, + "mizuho.tokyo.jp" => 0, + "musashimurayama.tokyo.jp" => 0, + "musashino.tokyo.jp" => 0, + "nakano.tokyo.jp" => 0, + "nerima.tokyo.jp" => 0, + "ogasawara.tokyo.jp" => 0, + "okutama.tokyo.jp" => 0, + "ome.tokyo.jp" => 0, + "oshima.tokyo.jp" => 0, + "ota.tokyo.jp" => 0, + "setagaya.tokyo.jp" => 0, + "shibuya.tokyo.jp" => 0, + "shinagawa.tokyo.jp" => 0, + "shinjuku.tokyo.jp" => 0, + "suginami.tokyo.jp" => 0, + "sumida.tokyo.jp" => 0, + "tachikawa.tokyo.jp" => 0, + "taito.tokyo.jp" => 0, + "tama.tokyo.jp" => 0, + "toshima.tokyo.jp" => 0, + "chizu.tottori.jp" => 0, + "hino.tottori.jp" => 0, + "kawahara.tottori.jp" => 0, + "koge.tottori.jp" => 0, + "kotoura.tottori.jp" => 0, + "misasa.tottori.jp" => 0, + "nanbu.tottori.jp" => 0, + "nichinan.tottori.jp" => 0, + "sakaiminato.tottori.jp" => 0, + "tottori.tottori.jp" => 0, + "wakasa.tottori.jp" => 0, + "yazu.tottori.jp" => 0, + "yonago.tottori.jp" => 0, + "asahi.toyama.jp" => 0, + "fuchu.toyama.jp" => 0, + "fukumitsu.toyama.jp" => 0, + "funahashi.toyama.jp" => 0, + "himi.toyama.jp" => 0, + "imizu.toyama.jp" => 0, + "inami.toyama.jp" => 0, + "johana.toyama.jp" => 0, + "kamiichi.toyama.jp" => 0, + "kurobe.toyama.jp" => 0, + "nakaniikawa.toyama.jp" => 0, + "namerikawa.toyama.jp" => 0, + "nanto.toyama.jp" => 0, + "nyuzen.toyama.jp" => 0, + "oyabe.toyama.jp" => 0, + "taira.toyama.jp" => 0, + "takaoka.toyama.jp" => 0, + "tateyama.toyama.jp" => 0, + "toga.toyama.jp" => 0, + "tonami.toyama.jp" => 0, + "toyama.toyama.jp" => 0, + "unazuki.toyama.jp" => 0, + "uozu.toyama.jp" => 0, + "yamada.toyama.jp" => 0, + "arida.wakayama.jp" => 0, + "aridagawa.wakayama.jp" => 0, + "gobo.wakayama.jp" => 0, + "hashimoto.wakayama.jp" => 0, + "hidaka.wakayama.jp" => 0, + "hirogawa.wakayama.jp" => 0, + "inami.wakayama.jp" => 0, + "iwade.wakayama.jp" => 0, + "kainan.wakayama.jp" => 0, + "kamitonda.wakayama.jp" => 0, + "katsuragi.wakayama.jp" => 0, + "kimino.wakayama.jp" => 0, + "kinokawa.wakayama.jp" => 0, + "kitayama.wakayama.jp" => 0, + "koya.wakayama.jp" => 0, + "koza.wakayama.jp" => 0, + "kozagawa.wakayama.jp" => 0, + "kudoyama.wakayama.jp" => 0, + "kushimoto.wakayama.jp" => 0, + "mihama.wakayama.jp" => 0, + "misato.wakayama.jp" => 0, + "nachikatsuura.wakayama.jp" => 0, + "shingu.wakayama.jp" => 0, + "shirahama.wakayama.jp" => 0, + "taiji.wakayama.jp" => 0, + "tanabe.wakayama.jp" => 0, + "wakayama.wakayama.jp" => 0, + "yuasa.wakayama.jp" => 0, + "yura.wakayama.jp" => 0, + "asahi.yamagata.jp" => 0, + "funagata.yamagata.jp" => 0, + "higashine.yamagata.jp" => 0, + "iide.yamagata.jp" => 0, + "kahoku.yamagata.jp" => 0, + "kaminoyama.yamagata.jp" => 0, + "kaneyama.yamagata.jp" => 0, + "kawanishi.yamagata.jp" => 0, + "mamurogawa.yamagata.jp" => 0, + "mikawa.yamagata.jp" => 0, + "murayama.yamagata.jp" => 0, + "nagai.yamagata.jp" => 0, + "nakayama.yamagata.jp" => 0, + "nanyo.yamagata.jp" => 0, + "nishikawa.yamagata.jp" => 0, + "obanazawa.yamagata.jp" => 0, + "oe.yamagata.jp" => 0, + "oguni.yamagata.jp" => 0, + "ohkura.yamagata.jp" => 0, + "oishida.yamagata.jp" => 0, + "sagae.yamagata.jp" => 0, + "sakata.yamagata.jp" => 0, + "sakegawa.yamagata.jp" => 0, + "shinjo.yamagata.jp" => 0, + "shirataka.yamagata.jp" => 0, + "shonai.yamagata.jp" => 0, + "takahata.yamagata.jp" => 0, + "tendo.yamagata.jp" => 0, + "tozawa.yamagata.jp" => 0, + "tsuruoka.yamagata.jp" => 0, + "yamagata.yamagata.jp" => 0, + "yamanobe.yamagata.jp" => 0, + "yonezawa.yamagata.jp" => 0, + "yuza.yamagata.jp" => 0, + "abu.yamaguchi.jp" => 0, + "hagi.yamaguchi.jp" => 0, + "hikari.yamaguchi.jp" => 0, + "hofu.yamaguchi.jp" => 0, + "iwakuni.yamaguchi.jp" => 0, + "kudamatsu.yamaguchi.jp" => 0, + "mitou.yamaguchi.jp" => 0, + "nagato.yamaguchi.jp" => 0, + "oshima.yamaguchi.jp" => 0, + "shimonoseki.yamaguchi.jp" => 0, + "shunan.yamaguchi.jp" => 0, + "tabuse.yamaguchi.jp" => 0, + "tokuyama.yamaguchi.jp" => 0, + "toyota.yamaguchi.jp" => 0, + "ube.yamaguchi.jp" => 0, + "yuu.yamaguchi.jp" => 0, + "chuo.yamanashi.jp" => 0, + "doshi.yamanashi.jp" => 0, + "fuefuki.yamanashi.jp" => 0, + "fujikawa.yamanashi.jp" => 0, + "fujikawaguchiko.yamanashi.jp" => 0, + "fujiyoshida.yamanashi.jp" => 0, + "hayakawa.yamanashi.jp" => 0, + "hokuto.yamanashi.jp" => 0, + "ichikawamisato.yamanashi.jp" => 0, + "kai.yamanashi.jp" => 0, + "kofu.yamanashi.jp" => 0, + "koshu.yamanashi.jp" => 0, + "kosuge.yamanashi.jp" => 0, + "minami-alps.yamanashi.jp" => 0, + "minobu.yamanashi.jp" => 0, + "nakamichi.yamanashi.jp" => 0, + "nanbu.yamanashi.jp" => 0, + "narusawa.yamanashi.jp" => 0, + "nirasaki.yamanashi.jp" => 0, + "nishikatsura.yamanashi.jp" => 0, + "oshino.yamanashi.jp" => 0, + "otsuki.yamanashi.jp" => 0, + "showa.yamanashi.jp" => 0, + "tabayama.yamanashi.jp" => 0, + "tsuru.yamanashi.jp" => 0, + "uenohara.yamanashi.jp" => 0, + "yamanakako.yamanashi.jp" => 0, + "yamanashi.yamanashi.jp" => 0, + "ke" => 0, + "ac.ke" => 0, + "co.ke" => 0, + "go.ke" => 0, + "info.ke" => 0, + "me.ke" => 0, + "mobi.ke" => 0, + "ne.ke" => 0, + "or.ke" => 0, + "sc.ke" => 0, + "kg" => 0, + "org.kg" => 0, + "net.kg" => 0, + "com.kg" => 0, + "edu.kg" => 0, + "gov.kg" => 0, + "mil.kg" => 0, + "kh" => -1, + "ki" => 0, + "edu.ki" => 0, + "biz.ki" => 0, + "net.ki" => 0, + "org.ki" => 0, + "gov.ki" => 0, + "info.ki" => 0, + "com.ki" => 0, + "km" => 0, + "org.km" => 0, + "nom.km" => 0, + "gov.km" => 0, + "prd.km" => 0, + "tm.km" => 0, + "edu.km" => 0, + "mil.km" => 0, + "ass.km" => 0, + "com.km" => 0, + "coop.km" => 0, + "asso.km" => 0, + "presse.km" => 0, + "medecin.km" => 0, + "notaires.km" => 0, + "pharmaciens.km" => 0, + "veterinaire.km" => 0, + "gouv.km" => 0, + "kn" => 0, + "net.kn" => 0, + "org.kn" => 0, + "edu.kn" => 0, + "gov.kn" => 0, + "kp" => 0, + "com.kp" => 0, + "edu.kp" => 0, + "gov.kp" => 0, + "org.kp" => 0, + "rep.kp" => 0, + "tra.kp" => 0, + "kr" => 0, + "ac.kr" => 0, + "co.kr" => 0, + "es.kr" => 0, + "go.kr" => 0, + "hs.kr" => 0, + "kg.kr" => 0, + "mil.kr" => 0, + "ms.kr" => 0, + "ne.kr" => 0, + "or.kr" => 0, + "pe.kr" => 0, + "re.kr" => 0, + "sc.kr" => 0, + "busan.kr" => 0, + "chungbuk.kr" => 0, + "chungnam.kr" => 0, + "daegu.kr" => 0, + "daejeon.kr" => 0, + "gangwon.kr" => 0, + "gwangju.kr" => 0, + "gyeongbuk.kr" => 0, + "gyeonggi.kr" => 0, + "gyeongnam.kr" => 0, + "incheon.kr" => 0, + "jeju.kr" => 0, + "jeonbuk.kr" => 0, + "jeonnam.kr" => 0, + "seoul.kr" => 0, + "ulsan.kr" => 0, + "kw" => 0, + "com.kw" => 0, + "edu.kw" => 0, + "emb.kw" => 0, + "gov.kw" => 0, + "ind.kw" => 0, + "net.kw" => 0, + "org.kw" => 0, + "ky" => 0, + "edu.ky" => 0, + "gov.ky" => 0, + "com.ky" => 0, + "org.ky" => 0, + "net.ky" => 0, + "kz" => 0, + "org.kz" => 0, + "edu.kz" => 0, + "net.kz" => 0, + "gov.kz" => 0, + "mil.kz" => 0, + "com.kz" => 0, + "la" => 0, + "int.la" => 0, + "net.la" => 0, + "info.la" => 0, + "edu.la" => 0, + "gov.la" => 0, + "per.la" => 0, + "com.la" => 0, + "org.la" => 0, + "lb" => 0, + "com.lb" => 0, + "edu.lb" => 0, + "gov.lb" => 0, + "net.lb" => 0, + "org.lb" => 0, + "lc" => 0, + "com.lc" => 0, + "net.lc" => 0, + "co.lc" => 0, + "org.lc" => 0, + "edu.lc" => 0, + "gov.lc" => 0, + "li" => 0, + "lk" => 0, + "gov.lk" => 0, + "sch.lk" => 0, + "net.lk" => 0, + "int.lk" => 0, + "com.lk" => 0, + "org.lk" => 0, + "edu.lk" => 0, + "ngo.lk" => 0, + "soc.lk" => 0, + "web.lk" => 0, + "ltd.lk" => 0, + "assn.lk" => 0, + "grp.lk" => 0, + "hotel.lk" => 0, + "ac.lk" => 0, + "lr" => 0, + "com.lr" => 0, + "edu.lr" => 0, + "gov.lr" => 0, + "org.lr" => 0, + "net.lr" => 0, + "ls" => 0, + "ac.ls" => 0, + "biz.ls" => 0, + "co.ls" => 0, + "edu.ls" => 0, + "gov.ls" => 0, + "info.ls" => 0, + "net.ls" => 0, + "org.ls" => 0, + "sc.ls" => 0, + "lt" => 0, + "gov.lt" => 0, + "lu" => 0, + "lv" => 0, + "com.lv" => 0, + "edu.lv" => 0, + "gov.lv" => 0, + "org.lv" => 0, + "mil.lv" => 0, + "id.lv" => 0, + "net.lv" => 0, + "asn.lv" => 0, + "conf.lv" => 0, + "ly" => 0, + "com.ly" => 0, + "net.ly" => 0, + "gov.ly" => 0, + "plc.ly" => 0, + "edu.ly" => 0, + "sch.ly" => 0, + "med.ly" => 0, + "org.ly" => 0, + "id.ly" => 0, + "ma" => 0, + "co.ma" => 0, + "net.ma" => 0, + "gov.ma" => 0, + "org.ma" => 0, + "ac.ma" => 0, + "press.ma" => 0, + "mc" => 0, + "tm.mc" => 0, + "asso.mc" => 0, + "md" => 0, + "me" => 0, + "co.me" => 0, + "net.me" => 0, + "org.me" => 0, + "edu.me" => 0, + "ac.me" => 0, + "gov.me" => 0, + "its.me" => 0, + "priv.me" => 0, + "mg" => 0, + "org.mg" => 0, + "nom.mg" => 0, + "gov.mg" => 0, + "prd.mg" => 0, + "tm.mg" => 0, + "edu.mg" => 0, + "mil.mg" => 0, + "com.mg" => 0, + "co.mg" => 0, + "mh" => 0, + "mil" => 0, + "mk" => 0, + "com.mk" => 0, + "org.mk" => 0, + "net.mk" => 0, + "edu.mk" => 0, + "gov.mk" => 0, + "inf.mk" => 0, + "name.mk" => 0, + "ml" => 0, + "com.ml" => 0, + "edu.ml" => 0, + "gouv.ml" => 0, + "gov.ml" => 0, + "net.ml" => 0, + "org.ml" => 0, + "presse.ml" => 0, + "mm" => -1, + "mn" => 0, + "gov.mn" => 0, + "edu.mn" => 0, + "org.mn" => 0, + "mo" => 0, + "com.mo" => 0, + "net.mo" => 0, + "org.mo" => 0, + "edu.mo" => 0, + "gov.mo" => 0, + "mobi" => 0, + "mp" => 0, + "mq" => 0, + "mr" => 0, + "gov.mr" => 0, + "ms" => 0, + "com.ms" => 0, + "edu.ms" => 0, + "gov.ms" => 0, + "net.ms" => 0, + "org.ms" => 0, + "mt" => 0, + "com.mt" => 0, + "edu.mt" => 0, + "net.mt" => 0, + "org.mt" => 0, + "mu" => 0, + "com.mu" => 0, + "net.mu" => 0, + "org.mu" => 0, + "gov.mu" => 0, + "ac.mu" => 0, + "co.mu" => 0, + "or.mu" => 0, + "museum" => 0, + "academy.museum" => 0, + "agriculture.museum" => 0, + "air.museum" => 0, + "airguard.museum" => 0, + "alabama.museum" => 0, + "alaska.museum" => 0, + "amber.museum" => 0, + "ambulance.museum" => 0, + "american.museum" => 0, + "americana.museum" => 0, + "americanantiques.museum" => 0, + "americanart.museum" => 0, + "amsterdam.museum" => 0, + "and.museum" => 0, + "annefrank.museum" => 0, + "anthro.museum" => 0, + "anthropology.museum" => 0, + "antiques.museum" => 0, + "aquarium.museum" => 0, + "arboretum.museum" => 0, + "archaeological.museum" => 0, + "archaeology.museum" => 0, + "architecture.museum" => 0, + "art.museum" => 0, + "artanddesign.museum" => 0, + "artcenter.museum" => 0, + "artdeco.museum" => 0, + "arteducation.museum" => 0, + "artgallery.museum" => 0, + "arts.museum" => 0, + "artsandcrafts.museum" => 0, + "asmatart.museum" => 0, + "assassination.museum" => 0, + "assisi.museum" => 0, + "association.museum" => 0, + "astronomy.museum" => 0, + "atlanta.museum" => 0, + "austin.museum" => 0, + "australia.museum" => 0, + "automotive.museum" => 0, + "aviation.museum" => 0, + "axis.museum" => 0, + "badajoz.museum" => 0, + "baghdad.museum" => 0, + "bahn.museum" => 0, + "bale.museum" => 0, + "baltimore.museum" => 0, + "barcelona.museum" => 0, + "baseball.museum" => 0, + "basel.museum" => 0, + "baths.museum" => 0, + "bauern.museum" => 0, + "beauxarts.museum" => 0, + "beeldengeluid.museum" => 0, + "bellevue.museum" => 0, + "bergbau.museum" => 0, + "berkeley.museum" => 0, + "berlin.museum" => 0, + "bern.museum" => 0, + "bible.museum" => 0, + "bilbao.museum" => 0, + "bill.museum" => 0, + "birdart.museum" => 0, + "birthplace.museum" => 0, + "bonn.museum" => 0, + "boston.museum" => 0, + "botanical.museum" => 0, + "botanicalgarden.museum" => 0, + "botanicgarden.museum" => 0, + "botany.museum" => 0, + "brandywinevalley.museum" => 0, + "brasil.museum" => 0, + "bristol.museum" => 0, + "british.museum" => 0, + "britishcolumbia.museum" => 0, + "broadcast.museum" => 0, + "brunel.museum" => 0, + "brussel.museum" => 0, + "brussels.museum" => 0, + "bruxelles.museum" => 0, + "building.museum" => 0, + "burghof.museum" => 0, + "bus.museum" => 0, + "bushey.museum" => 0, + "cadaques.museum" => 0, + "california.museum" => 0, + "cambridge.museum" => 0, + "can.museum" => 0, + "canada.museum" => 0, + "capebreton.museum" => 0, + "carrier.museum" => 0, + "cartoonart.museum" => 0, + "casadelamoneda.museum" => 0, + "castle.museum" => 0, + "castres.museum" => 0, + "celtic.museum" => 0, + "center.museum" => 0, + "chattanooga.museum" => 0, + "cheltenham.museum" => 0, + "chesapeakebay.museum" => 0, + "chicago.museum" => 0, + "children.museum" => 0, + "childrens.museum" => 0, + "childrensgarden.museum" => 0, + "chiropractic.museum" => 0, + "chocolate.museum" => 0, + "christiansburg.museum" => 0, + "cincinnati.museum" => 0, + "cinema.museum" => 0, + "circus.museum" => 0, + "civilisation.museum" => 0, + "civilization.museum" => 0, + "civilwar.museum" => 0, + "clinton.museum" => 0, + "clock.museum" => 0, + "coal.museum" => 0, + "coastaldefence.museum" => 0, + "cody.museum" => 0, + "coldwar.museum" => 0, + "collection.museum" => 0, + "colonialwilliamsburg.museum" => 0, + "coloradoplateau.museum" => 0, + "columbia.museum" => 0, + "columbus.museum" => 0, + "communication.museum" => 0, + "communications.museum" => 0, + "community.museum" => 0, + "computer.museum" => 0, + "computerhistory.museum" => 0, + "xn--comunicaes-v6a2o.museum" => 0, + "contemporary.museum" => 0, + "contemporaryart.museum" => 0, + "convent.museum" => 0, + "copenhagen.museum" => 0, + "corporation.museum" => 0, + "xn--correios-e-telecomunicaes-ghc29a.museum" => 0, + "corvette.museum" => 0, + "costume.museum" => 0, + "countryestate.museum" => 0, + "county.museum" => 0, + "crafts.museum" => 0, + "cranbrook.museum" => 0, + "creation.museum" => 0, + "cultural.museum" => 0, + "culturalcenter.museum" => 0, + "culture.museum" => 0, + "cyber.museum" => 0, + "cymru.museum" => 0, + "dali.museum" => 0, + "dallas.museum" => 0, + "database.museum" => 0, + "ddr.museum" => 0, + "decorativearts.museum" => 0, + "delaware.museum" => 0, + "delmenhorst.museum" => 0, + "denmark.museum" => 0, + "depot.museum" => 0, + "design.museum" => 0, + "detroit.museum" => 0, + "dinosaur.museum" => 0, + "discovery.museum" => 0, + "dolls.museum" => 0, + "donostia.museum" => 0, + "durham.museum" => 0, + "eastafrica.museum" => 0, + "eastcoast.museum" => 0, + "education.museum" => 0, + "educational.museum" => 0, + "egyptian.museum" => 0, + "eisenbahn.museum" => 0, + "elburg.museum" => 0, + "elvendrell.museum" => 0, + "embroidery.museum" => 0, + "encyclopedic.museum" => 0, + "england.museum" => 0, + "entomology.museum" => 0, + "environment.museum" => 0, + "environmentalconservation.museum" => 0, + "epilepsy.museum" => 0, + "essex.museum" => 0, + "estate.museum" => 0, + "ethnology.museum" => 0, + "exeter.museum" => 0, + "exhibition.museum" => 0, + "family.museum" => 0, + "farm.museum" => 0, + "farmequipment.museum" => 0, + "farmers.museum" => 0, + "farmstead.museum" => 0, + "field.museum" => 0, + "figueres.museum" => 0, + "filatelia.museum" => 0, + "film.museum" => 0, + "fineart.museum" => 0, + "finearts.museum" => 0, + "finland.museum" => 0, + "flanders.museum" => 0, + "florida.museum" => 0, + "force.museum" => 0, + "fortmissoula.museum" => 0, + "fortworth.museum" => 0, + "foundation.museum" => 0, + "francaise.museum" => 0, + "frankfurt.museum" => 0, + "franziskaner.museum" => 0, + "freemasonry.museum" => 0, + "freiburg.museum" => 0, + "fribourg.museum" => 0, + "frog.museum" => 0, + "fundacio.museum" => 0, + "furniture.museum" => 0, + "gallery.museum" => 0, + "garden.museum" => 0, + "gateway.museum" => 0, + "geelvinck.museum" => 0, + "gemological.museum" => 0, + "geology.museum" => 0, + "georgia.museum" => 0, + "giessen.museum" => 0, + "glas.museum" => 0, + "glass.museum" => 0, + "gorge.museum" => 0, + "grandrapids.museum" => 0, + "graz.museum" => 0, + "guernsey.museum" => 0, + "halloffame.museum" => 0, + "hamburg.museum" => 0, + "handson.museum" => 0, + "harvestcelebration.museum" => 0, + "hawaii.museum" => 0, + "health.museum" => 0, + "heimatunduhren.museum" => 0, + "hellas.museum" => 0, + "helsinki.museum" => 0, + "hembygdsforbund.museum" => 0, + "heritage.museum" => 0, + "histoire.museum" => 0, + "historical.museum" => 0, + "historicalsociety.museum" => 0, + "historichouses.museum" => 0, + "historisch.museum" => 0, + "historisches.museum" => 0, + "history.museum" => 0, + "historyofscience.museum" => 0, + "horology.museum" => 0, + "house.museum" => 0, + "humanities.museum" => 0, + "illustration.museum" => 0, + "imageandsound.museum" => 0, + "indian.museum" => 0, + "indiana.museum" => 0, + "indianapolis.museum" => 0, + "indianmarket.museum" => 0, + "intelligence.museum" => 0, + "interactive.museum" => 0, + "iraq.museum" => 0, + "iron.museum" => 0, + "isleofman.museum" => 0, + "jamison.museum" => 0, + "jefferson.museum" => 0, + "jerusalem.museum" => 0, + "jewelry.museum" => 0, + "jewish.museum" => 0, + "jewishart.museum" => 0, + "jfk.museum" => 0, + "journalism.museum" => 0, + "judaica.museum" => 0, + "judygarland.museum" => 0, + "juedisches.museum" => 0, + "juif.museum" => 0, + "karate.museum" => 0, + "karikatur.museum" => 0, + "kids.museum" => 0, + "koebenhavn.museum" => 0, + "koeln.museum" => 0, + "kunst.museum" => 0, + "kunstsammlung.museum" => 0, + "kunstunddesign.museum" => 0, + "labor.museum" => 0, + "labour.museum" => 0, + "lajolla.museum" => 0, + "lancashire.museum" => 0, + "landes.museum" => 0, + "lans.museum" => 0, + "xn--lns-qla.museum" => 0, + "larsson.museum" => 0, + "lewismiller.museum" => 0, + "lincoln.museum" => 0, + "linz.museum" => 0, + "living.museum" => 0, + "livinghistory.museum" => 0, + "localhistory.museum" => 0, + "london.museum" => 0, + "losangeles.museum" => 0, + "louvre.museum" => 0, + "loyalist.museum" => 0, + "lucerne.museum" => 0, + "luxembourg.museum" => 0, + "luzern.museum" => 0, + "mad.museum" => 0, + "madrid.museum" => 0, + "mallorca.museum" => 0, + "manchester.museum" => 0, + "mansion.museum" => 0, + "mansions.museum" => 0, + "manx.museum" => 0, + "marburg.museum" => 0, + "maritime.museum" => 0, + "maritimo.museum" => 0, + "maryland.museum" => 0, + "marylhurst.museum" => 0, + "media.museum" => 0, + "medical.museum" => 0, + "medizinhistorisches.museum" => 0, + "meeres.museum" => 0, + "memorial.museum" => 0, + "mesaverde.museum" => 0, + "michigan.museum" => 0, + "midatlantic.museum" => 0, + "military.museum" => 0, + "mill.museum" => 0, + "miners.museum" => 0, + "mining.museum" => 0, + "minnesota.museum" => 0, + "missile.museum" => 0, + "missoula.museum" => 0, + "modern.museum" => 0, + "moma.museum" => 0, + "money.museum" => 0, + "monmouth.museum" => 0, + "monticello.museum" => 0, + "montreal.museum" => 0, + "moscow.museum" => 0, + "motorcycle.museum" => 0, + "muenchen.museum" => 0, + "muenster.museum" => 0, + "mulhouse.museum" => 0, + "muncie.museum" => 0, + "museet.museum" => 0, + "museumcenter.museum" => 0, + "museumvereniging.museum" => 0, + "music.museum" => 0, + "national.museum" => 0, + "nationalfirearms.museum" => 0, + "nationalheritage.museum" => 0, + "nativeamerican.museum" => 0, + "naturalhistory.museum" => 0, + "naturalhistorymuseum.museum" => 0, + "naturalsciences.museum" => 0, + "nature.museum" => 0, + "naturhistorisches.museum" => 0, + "natuurwetenschappen.museum" => 0, + "naumburg.museum" => 0, + "naval.museum" => 0, + "nebraska.museum" => 0, + "neues.museum" => 0, + "newhampshire.museum" => 0, + "newjersey.museum" => 0, + "newmexico.museum" => 0, + "newport.museum" => 0, + "newspaper.museum" => 0, + "newyork.museum" => 0, + "niepce.museum" => 0, + "norfolk.museum" => 0, + "north.museum" => 0, + "nrw.museum" => 0, + "nuernberg.museum" => 0, + "nuremberg.museum" => 0, + "nyc.museum" => 0, + "nyny.museum" => 0, + "oceanographic.museum" => 0, + "oceanographique.museum" => 0, + "omaha.museum" => 0, + "online.museum" => 0, + "ontario.museum" => 0, + "openair.museum" => 0, + "oregon.museum" => 0, + "oregontrail.museum" => 0, + "otago.museum" => 0, + "oxford.museum" => 0, + "pacific.museum" => 0, + "paderborn.museum" => 0, + "palace.museum" => 0, + "paleo.museum" => 0, + "palmsprings.museum" => 0, + "panama.museum" => 0, + "paris.museum" => 0, + "pasadena.museum" => 0, + "pharmacy.museum" => 0, + "philadelphia.museum" => 0, + "philadelphiaarea.museum" => 0, + "philately.museum" => 0, + "phoenix.museum" => 0, + "photography.museum" => 0, + "pilots.museum" => 0, + "pittsburgh.museum" => 0, + "planetarium.museum" => 0, + "plantation.museum" => 0, + "plants.museum" => 0, + "plaza.museum" => 0, + "portal.museum" => 0, + "portland.museum" => 0, + "portlligat.museum" => 0, + "posts-and-telecommunications.museum" => 0, + "preservation.museum" => 0, + "presidio.museum" => 0, + "press.museum" => 0, + "project.museum" => 0, + "public.museum" => 0, + "pubol.museum" => 0, + "quebec.museum" => 0, + "railroad.museum" => 0, + "railway.museum" => 0, + "research.museum" => 0, + "resistance.museum" => 0, + "riodejaneiro.museum" => 0, + "rochester.museum" => 0, + "rockart.museum" => 0, + "roma.museum" => 0, + "russia.museum" => 0, + "saintlouis.museum" => 0, + "salem.museum" => 0, + "salvadordali.museum" => 0, + "salzburg.museum" => 0, + "sandiego.museum" => 0, + "sanfrancisco.museum" => 0, + "santabarbara.museum" => 0, + "santacruz.museum" => 0, + "santafe.museum" => 0, + "saskatchewan.museum" => 0, + "satx.museum" => 0, + "savannahga.museum" => 0, + "schlesisches.museum" => 0, + "schoenbrunn.museum" => 0, + "schokoladen.museum" => 0, + "school.museum" => 0, + "schweiz.museum" => 0, + "science.museum" => 0, + "scienceandhistory.museum" => 0, + "scienceandindustry.museum" => 0, + "sciencecenter.museum" => 0, + "sciencecenters.museum" => 0, + "science-fiction.museum" => 0, + "sciencehistory.museum" => 0, + "sciences.museum" => 0, + "sciencesnaturelles.museum" => 0, + "scotland.museum" => 0, + "seaport.museum" => 0, + "settlement.museum" => 0, + "settlers.museum" => 0, + "shell.museum" => 0, + "sherbrooke.museum" => 0, + "sibenik.museum" => 0, + "silk.museum" => 0, + "ski.museum" => 0, + "skole.museum" => 0, + "society.museum" => 0, + "sologne.museum" => 0, + "soundandvision.museum" => 0, + "southcarolina.museum" => 0, + "southwest.museum" => 0, + "space.museum" => 0, + "spy.museum" => 0, + "square.museum" => 0, + "stadt.museum" => 0, + "stalbans.museum" => 0, + "starnberg.museum" => 0, + "state.museum" => 0, + "stateofdelaware.museum" => 0, + "station.museum" => 0, + "steam.museum" => 0, + "steiermark.museum" => 0, + "stjohn.museum" => 0, + "stockholm.museum" => 0, + "stpetersburg.museum" => 0, + "stuttgart.museum" => 0, + "suisse.museum" => 0, + "surgeonshall.museum" => 0, + "surrey.museum" => 0, + "svizzera.museum" => 0, + "sweden.museum" => 0, + "sydney.museum" => 0, + "tank.museum" => 0, + "tcm.museum" => 0, + "technology.museum" => 0, + "telekommunikation.museum" => 0, + "television.museum" => 0, + "texas.museum" => 0, + "textile.museum" => 0, + "theater.museum" => 0, + "time.museum" => 0, + "timekeeping.museum" => 0, + "topology.museum" => 0, + "torino.museum" => 0, + "touch.museum" => 0, + "town.museum" => 0, + "transport.museum" => 0, + "tree.museum" => 0, + "trolley.museum" => 0, + "trust.museum" => 0, + "trustee.museum" => 0, + "uhren.museum" => 0, + "ulm.museum" => 0, + "undersea.museum" => 0, + "university.museum" => 0, + "usa.museum" => 0, + "usantiques.museum" => 0, + "usarts.museum" => 0, + "uscountryestate.museum" => 0, + "usculture.museum" => 0, + "usdecorativearts.museum" => 0, + "usgarden.museum" => 0, + "ushistory.museum" => 0, + "ushuaia.museum" => 0, + "uslivinghistory.museum" => 0, + "utah.museum" => 0, + "uvic.museum" => 0, + "valley.museum" => 0, + "vantaa.museum" => 0, + "versailles.museum" => 0, + "viking.museum" => 0, + "village.museum" => 0, + "virginia.museum" => 0, + "virtual.museum" => 0, + "virtuel.museum" => 0, + "vlaanderen.museum" => 0, + "volkenkunde.museum" => 0, + "wales.museum" => 0, + "wallonie.museum" => 0, + "war.museum" => 0, + "washingtondc.museum" => 0, + "watchandclock.museum" => 0, + "watch-and-clock.museum" => 0, + "western.museum" => 0, + "westfalen.museum" => 0, + "whaling.museum" => 0, + "wildlife.museum" => 0, + "williamsburg.museum" => 0, + "windmill.museum" => 0, + "workshop.museum" => 0, + "york.museum" => 0, + "yorkshire.museum" => 0, + "yosemite.museum" => 0, + "youth.museum" => 0, + "zoological.museum" => 0, + "zoology.museum" => 0, + "xn--9dbhblg6di.museum" => 0, + "xn--h1aegh.museum" => 0, + "mv" => 0, + "aero.mv" => 0, + "biz.mv" => 0, + "com.mv" => 0, + "coop.mv" => 0, + "edu.mv" => 0, + "gov.mv" => 0, + "info.mv" => 0, + "int.mv" => 0, + "mil.mv" => 0, + "museum.mv" => 0, + "name.mv" => 0, + "net.mv" => 0, + "org.mv" => 0, + "pro.mv" => 0, + "mw" => 0, + "ac.mw" => 0, + "biz.mw" => 0, + "co.mw" => 0, + "com.mw" => 0, + "coop.mw" => 0, + "edu.mw" => 0, + "gov.mw" => 0, + "int.mw" => 0, + "museum.mw" => 0, + "net.mw" => 0, + "org.mw" => 0, + "mx" => 0, + "com.mx" => 0, + "org.mx" => 0, + "gob.mx" => 0, + "edu.mx" => 0, + "net.mx" => 0, + "my" => 0, + "com.my" => 0, + "net.my" => 0, + "org.my" => 0, + "gov.my" => 0, + "edu.my" => 0, + "mil.my" => 0, + "name.my" => 0, + "mz" => 0, + "ac.mz" => 0, + "adv.mz" => 0, + "co.mz" => 0, + "edu.mz" => 0, + "gov.mz" => 0, + "mil.mz" => 0, + "net.mz" => 0, + "org.mz" => 0, + "na" => 0, + "info.na" => 0, + "pro.na" => 0, + "name.na" => 0, + "school.na" => 0, + "or.na" => 0, + "dr.na" => 0, + "us.na" => 0, + "mx.na" => 0, + "ca.na" => 0, + "in.na" => 0, + "cc.na" => 0, + "tv.na" => 0, + "ws.na" => 0, + "mobi.na" => 0, + "co.na" => 0, + "com.na" => 0, + "org.na" => 0, + "name" => 0, + "nc" => 0, + "asso.nc" => 0, + "nom.nc" => 0, + "ne" => 0, + "net" => 0, + "nf" => 0, + "com.nf" => 0, + "net.nf" => 0, + "per.nf" => 0, + "rec.nf" => 0, + "web.nf" => 0, + "arts.nf" => 0, + "firm.nf" => 0, + "info.nf" => 0, + "other.nf" => 0, + "store.nf" => 0, + "ng" => 0, + "com.ng" => 0, + "edu.ng" => 0, + "gov.ng" => 0, + "i.ng" => 0, + "mil.ng" => 0, + "mobi.ng" => 0, + "name.ng" => 0, + "net.ng" => 0, + "org.ng" => 0, + "sch.ng" => 0, + "ni" => 0, + "ac.ni" => 0, + "biz.ni" => 0, + "co.ni" => 0, + "com.ni" => 0, + "edu.ni" => 0, + "gob.ni" => 0, + "in.ni" => 0, + "info.ni" => 0, + "int.ni" => 0, + "mil.ni" => 0, + "net.ni" => 0, + "nom.ni" => 0, + "org.ni" => 0, + "web.ni" => 0, + "nl" => 0, + "no" => 0, + "fhs.no" => 0, + "vgs.no" => 0, + "fylkesbibl.no" => 0, + "folkebibl.no" => 0, + "museum.no" => 0, + "idrett.no" => 0, + "priv.no" => 0, + "mil.no" => 0, + "stat.no" => 0, + "dep.no" => 0, + "kommune.no" => 0, + "herad.no" => 0, + "aa.no" => 0, + "ah.no" => 0, + "bu.no" => 0, + "fm.no" => 0, + "hl.no" => 0, + "hm.no" => 0, + "jan-mayen.no" => 0, + "mr.no" => 0, + "nl.no" => 0, + "nt.no" => 0, + "of.no" => 0, + "ol.no" => 0, + "oslo.no" => 0, + "rl.no" => 0, + "sf.no" => 0, + "st.no" => 0, + "svalbard.no" => 0, + "tm.no" => 0, + "tr.no" => 0, + "va.no" => 0, + "vf.no" => 0, + "gs.aa.no" => 0, + "gs.ah.no" => 0, + "gs.bu.no" => 0, + "gs.fm.no" => 0, + "gs.hl.no" => 0, + "gs.hm.no" => 0, + "gs.jan-mayen.no" => 0, + "gs.mr.no" => 0, + "gs.nl.no" => 0, + "gs.nt.no" => 0, + "gs.of.no" => 0, + "gs.ol.no" => 0, + "gs.oslo.no" => 0, + "gs.rl.no" => 0, + "gs.sf.no" => 0, + "gs.st.no" => 0, + "gs.svalbard.no" => 0, + "gs.tm.no" => 0, + "gs.tr.no" => 0, + "gs.va.no" => 0, + "gs.vf.no" => 0, + "akrehamn.no" => 0, + "xn--krehamn-dxa.no" => 0, + "algard.no" => 0, + "xn--lgrd-poac.no" => 0, + "arna.no" => 0, + "brumunddal.no" => 0, + "bryne.no" => 0, + "bronnoysund.no" => 0, + "xn--brnnysund-m8ac.no" => 0, + "drobak.no" => 0, + "xn--drbak-wua.no" => 0, + "egersund.no" => 0, + "fetsund.no" => 0, + "floro.no" => 0, + "xn--flor-jra.no" => 0, + "fredrikstad.no" => 0, + "hokksund.no" => 0, + "honefoss.no" => 0, + "xn--hnefoss-q1a.no" => 0, + "jessheim.no" => 0, + "jorpeland.no" => 0, + "xn--jrpeland-54a.no" => 0, + "kirkenes.no" => 0, + "kopervik.no" => 0, + "krokstadelva.no" => 0, + "langevag.no" => 0, + "xn--langevg-jxa.no" => 0, + "leirvik.no" => 0, + "mjondalen.no" => 0, + "xn--mjndalen-64a.no" => 0, + "mo-i-rana.no" => 0, + "mosjoen.no" => 0, + "xn--mosjen-eya.no" => 0, + "nesoddtangen.no" => 0, + "orkanger.no" => 0, + "osoyro.no" => 0, + "xn--osyro-wua.no" => 0, + "raholt.no" => 0, + "xn--rholt-mra.no" => 0, + "sandnessjoen.no" => 0, + "xn--sandnessjen-ogb.no" => 0, + "skedsmokorset.no" => 0, + "slattum.no" => 0, + "spjelkavik.no" => 0, + "stathelle.no" => 0, + "stavern.no" => 0, + "stjordalshalsen.no" => 0, + "xn--stjrdalshalsen-sqb.no" => 0, + "tananger.no" => 0, + "tranby.no" => 0, + "vossevangen.no" => 0, + "afjord.no" => 0, + "xn--fjord-lra.no" => 0, + "agdenes.no" => 0, + "al.no" => 0, + "xn--l-1fa.no" => 0, + "alesund.no" => 0, + "xn--lesund-hua.no" => 0, + "alstahaug.no" => 0, + "alta.no" => 0, + "xn--lt-liac.no" => 0, + "alaheadju.no" => 0, + "xn--laheadju-7ya.no" => 0, + "alvdal.no" => 0, + "amli.no" => 0, + "xn--mli-tla.no" => 0, + "amot.no" => 0, + "xn--mot-tla.no" => 0, + "andebu.no" => 0, + "andoy.no" => 0, + "xn--andy-ira.no" => 0, + "andasuolo.no" => 0, + "ardal.no" => 0, + "xn--rdal-poa.no" => 0, + "aremark.no" => 0, + "arendal.no" => 0, + "xn--s-1fa.no" => 0, + "aseral.no" => 0, + "xn--seral-lra.no" => 0, + "asker.no" => 0, + "askim.no" => 0, + "askvoll.no" => 0, + "askoy.no" => 0, + "xn--asky-ira.no" => 0, + "asnes.no" => 0, + "xn--snes-poa.no" => 0, + "audnedaln.no" => 0, + "aukra.no" => 0, + "aure.no" => 0, + "aurland.no" => 0, + "aurskog-holand.no" => 0, + "xn--aurskog-hland-jnb.no" => 0, + "austevoll.no" => 0, + "austrheim.no" => 0, + "averoy.no" => 0, + "xn--avery-yua.no" => 0, + "balestrand.no" => 0, + "ballangen.no" => 0, + "balat.no" => 0, + "xn--blt-elab.no" => 0, + "balsfjord.no" => 0, + "bahccavuotna.no" => 0, + "xn--bhccavuotna-k7a.no" => 0, + "bamble.no" => 0, + "bardu.no" => 0, + "beardu.no" => 0, + "beiarn.no" => 0, + "bajddar.no" => 0, + "xn--bjddar-pta.no" => 0, + "baidar.no" => 0, + "xn--bidr-5nac.no" => 0, + "berg.no" => 0, + "bergen.no" => 0, + "berlevag.no" => 0, + "xn--berlevg-jxa.no" => 0, + "bearalvahki.no" => 0, + "xn--bearalvhki-y4a.no" => 0, + "bindal.no" => 0, + "birkenes.no" => 0, + "bjarkoy.no" => 0, + "xn--bjarky-fya.no" => 0, + "bjerkreim.no" => 0, + "bjugn.no" => 0, + "bodo.no" => 0, + "xn--bod-2na.no" => 0, + "badaddja.no" => 0, + "xn--bdddj-mrabd.no" => 0, + "budejju.no" => 0, + "bokn.no" => 0, + "bremanger.no" => 0, + "bronnoy.no" => 0, + "xn--brnny-wuac.no" => 0, + "bygland.no" => 0, + "bykle.no" => 0, + "barum.no" => 0, + "xn--brum-voa.no" => 0, + "bo.telemark.no" => 0, + "xn--b-5ga.telemark.no" => 0, + "bo.nordland.no" => 0, + "xn--b-5ga.nordland.no" => 0, + "bievat.no" => 0, + "xn--bievt-0qa.no" => 0, + "bomlo.no" => 0, + "xn--bmlo-gra.no" => 0, + "batsfjord.no" => 0, + "xn--btsfjord-9za.no" => 0, + "bahcavuotna.no" => 0, + "xn--bhcavuotna-s4a.no" => 0, + "dovre.no" => 0, + "drammen.no" => 0, + "drangedal.no" => 0, + "dyroy.no" => 0, + "xn--dyry-ira.no" => 0, + "donna.no" => 0, + "xn--dnna-gra.no" => 0, + "eid.no" => 0, + "eidfjord.no" => 0, + "eidsberg.no" => 0, + "eidskog.no" => 0, + "eidsvoll.no" => 0, + "eigersund.no" => 0, + "elverum.no" => 0, + "enebakk.no" => 0, + "engerdal.no" => 0, + "etne.no" => 0, + "etnedal.no" => 0, + "evenes.no" => 0, + "evenassi.no" => 0, + "xn--eveni-0qa01ga.no" => 0, + "evje-og-hornnes.no" => 0, + "farsund.no" => 0, + "fauske.no" => 0, + "fuossko.no" => 0, + "fuoisku.no" => 0, + "fedje.no" => 0, + "fet.no" => 0, + "finnoy.no" => 0, + "xn--finny-yua.no" => 0, + "fitjar.no" => 0, + "fjaler.no" => 0, + "fjell.no" => 0, + "flakstad.no" => 0, + "flatanger.no" => 0, + "flekkefjord.no" => 0, + "flesberg.no" => 0, + "flora.no" => 0, + "fla.no" => 0, + "xn--fl-zia.no" => 0, + "folldal.no" => 0, + "forsand.no" => 0, + "fosnes.no" => 0, + "frei.no" => 0, + "frogn.no" => 0, + "froland.no" => 0, + "frosta.no" => 0, + "frana.no" => 0, + "xn--frna-woa.no" => 0, + "froya.no" => 0, + "xn--frya-hra.no" => 0, + "fusa.no" => 0, + "fyresdal.no" => 0, + "forde.no" => 0, + "xn--frde-gra.no" => 0, + "gamvik.no" => 0, + "gangaviika.no" => 0, + "xn--ggaviika-8ya47h.no" => 0, + "gaular.no" => 0, + "gausdal.no" => 0, + "gildeskal.no" => 0, + "xn--gildeskl-g0a.no" => 0, + "giske.no" => 0, + "gjemnes.no" => 0, + "gjerdrum.no" => 0, + "gjerstad.no" => 0, + "gjesdal.no" => 0, + "gjovik.no" => 0, + "xn--gjvik-wua.no" => 0, + "gloppen.no" => 0, + "gol.no" => 0, + "gran.no" => 0, + "grane.no" => 0, + "granvin.no" => 0, + "gratangen.no" => 0, + "grimstad.no" => 0, + "grong.no" => 0, + "kraanghke.no" => 0, + "xn--kranghke-b0a.no" => 0, + "grue.no" => 0, + "gulen.no" => 0, + "hadsel.no" => 0, + "halden.no" => 0, + "halsa.no" => 0, + "hamar.no" => 0, + "hamaroy.no" => 0, + "habmer.no" => 0, + "xn--hbmer-xqa.no" => 0, + "hapmir.no" => 0, + "xn--hpmir-xqa.no" => 0, + "hammerfest.no" => 0, + "hammarfeasta.no" => 0, + "xn--hmmrfeasta-s4ac.no" => 0, + "haram.no" => 0, + "hareid.no" => 0, + "harstad.no" => 0, + "hasvik.no" => 0, + "aknoluokta.no" => 0, + "xn--koluokta-7ya57h.no" => 0, + "hattfjelldal.no" => 0, + "aarborte.no" => 0, + "haugesund.no" => 0, + "hemne.no" => 0, + "hemnes.no" => 0, + "hemsedal.no" => 0, + "heroy.more-og-romsdal.no" => 0, + "xn--hery-ira.xn--mre-og-romsdal-qqb.no" => 0, + "heroy.nordland.no" => 0, + "xn--hery-ira.nordland.no" => 0, + "hitra.no" => 0, + "hjartdal.no" => 0, + "hjelmeland.no" => 0, + "hobol.no" => 0, + "xn--hobl-ira.no" => 0, + "hof.no" => 0, + "hol.no" => 0, + "hole.no" => 0, + "holmestrand.no" => 0, + "holtalen.no" => 0, + "xn--holtlen-hxa.no" => 0, + "hornindal.no" => 0, + "horten.no" => 0, + "hurdal.no" => 0, + "hurum.no" => 0, + "hvaler.no" => 0, + "hyllestad.no" => 0, + "hagebostad.no" => 0, + "xn--hgebostad-g3a.no" => 0, + "hoyanger.no" => 0, + "xn--hyanger-q1a.no" => 0, + "hoylandet.no" => 0, + "xn--hylandet-54a.no" => 0, + "ha.no" => 0, + "xn--h-2fa.no" => 0, + "ibestad.no" => 0, + "inderoy.no" => 0, + "xn--indery-fya.no" => 0, + "iveland.no" => 0, + "jevnaker.no" => 0, + "jondal.no" => 0, + "jolster.no" => 0, + "xn--jlster-bya.no" => 0, + "karasjok.no" => 0, + "karasjohka.no" => 0, + "xn--krjohka-hwab49j.no" => 0, + "karlsoy.no" => 0, + "galsa.no" => 0, + "xn--gls-elac.no" => 0, + "karmoy.no" => 0, + "xn--karmy-yua.no" => 0, + "kautokeino.no" => 0, + "guovdageaidnu.no" => 0, + "klepp.no" => 0, + "klabu.no" => 0, + "xn--klbu-woa.no" => 0, + "kongsberg.no" => 0, + "kongsvinger.no" => 0, + "kragero.no" => 0, + "xn--krager-gya.no" => 0, + "kristiansand.no" => 0, + "kristiansund.no" => 0, + "krodsherad.no" => 0, + "xn--krdsherad-m8a.no" => 0, + "kvalsund.no" => 0, + "rahkkeravju.no" => 0, + "xn--rhkkervju-01af.no" => 0, + "kvam.no" => 0, + "kvinesdal.no" => 0, + "kvinnherad.no" => 0, + "kviteseid.no" => 0, + "kvitsoy.no" => 0, + "xn--kvitsy-fya.no" => 0, + "kvafjord.no" => 0, + "xn--kvfjord-nxa.no" => 0, + "giehtavuoatna.no" => 0, + "kvanangen.no" => 0, + "xn--kvnangen-k0a.no" => 0, + "navuotna.no" => 0, + "xn--nvuotna-hwa.no" => 0, + "kafjord.no" => 0, + "xn--kfjord-iua.no" => 0, + "gaivuotna.no" => 0, + "xn--givuotna-8ya.no" => 0, + "larvik.no" => 0, + "lavangen.no" => 0, + "lavagis.no" => 0, + "loabat.no" => 0, + "xn--loabt-0qa.no" => 0, + "lebesby.no" => 0, + "davvesiida.no" => 0, + "leikanger.no" => 0, + "leirfjord.no" => 0, + "leka.no" => 0, + "leksvik.no" => 0, + "lenvik.no" => 0, + "leangaviika.no" => 0, + "xn--leagaviika-52b.no" => 0, + "lesja.no" => 0, + "levanger.no" => 0, + "lier.no" => 0, + "lierne.no" => 0, + "lillehammer.no" => 0, + "lillesand.no" => 0, + "lindesnes.no" => 0, + "lindas.no" => 0, + "xn--linds-pra.no" => 0, + "lom.no" => 0, + "loppa.no" => 0, + "lahppi.no" => 0, + "xn--lhppi-xqa.no" => 0, + "lund.no" => 0, + "lunner.no" => 0, + "luroy.no" => 0, + "xn--lury-ira.no" => 0, + "luster.no" => 0, + "lyngdal.no" => 0, + "lyngen.no" => 0, + "ivgu.no" => 0, + "lardal.no" => 0, + "lerdal.no" => 0, + "xn--lrdal-sra.no" => 0, + "lodingen.no" => 0, + "xn--ldingen-q1a.no" => 0, + "lorenskog.no" => 0, + "xn--lrenskog-54a.no" => 0, + "loten.no" => 0, + "xn--lten-gra.no" => 0, + "malvik.no" => 0, + "masoy.no" => 0, + "xn--msy-ula0h.no" => 0, + "muosat.no" => 0, + "xn--muost-0qa.no" => 0, + "mandal.no" => 0, + "marker.no" => 0, + "marnardal.no" => 0, + "masfjorden.no" => 0, + "meland.no" => 0, + "meldal.no" => 0, + "melhus.no" => 0, + "meloy.no" => 0, + "xn--mely-ira.no" => 0, + "meraker.no" => 0, + "xn--merker-kua.no" => 0, + "moareke.no" => 0, + "xn--moreke-jua.no" => 0, + "midsund.no" => 0, + "midtre-gauldal.no" => 0, + "modalen.no" => 0, + "modum.no" => 0, + "molde.no" => 0, + "moskenes.no" => 0, + "moss.no" => 0, + "mosvik.no" => 0, + "malselv.no" => 0, + "xn--mlselv-iua.no" => 0, + "malatvuopmi.no" => 0, + "xn--mlatvuopmi-s4a.no" => 0, + "namdalseid.no" => 0, + "aejrie.no" => 0, + "namsos.no" => 0, + "namsskogan.no" => 0, + "naamesjevuemie.no" => 0, + "xn--nmesjevuemie-tcba.no" => 0, + "laakesvuemie.no" => 0, + "nannestad.no" => 0, + "narvik.no" => 0, + "narviika.no" => 0, + "naustdal.no" => 0, + "nedre-eiker.no" => 0, + "nes.akershus.no" => 0, + "nes.buskerud.no" => 0, + "nesna.no" => 0, + "nesodden.no" => 0, + "nesseby.no" => 0, + "unjarga.no" => 0, + "xn--unjrga-rta.no" => 0, + "nesset.no" => 0, + "nissedal.no" => 0, + "nittedal.no" => 0, + "nord-aurdal.no" => 0, + "nord-fron.no" => 0, + "nord-odal.no" => 0, + "norddal.no" => 0, + "nordkapp.no" => 0, + "davvenjarga.no" => 0, + "xn--davvenjrga-y4a.no" => 0, + "nordre-land.no" => 0, + "nordreisa.no" => 0, + "raisa.no" => 0, + "xn--risa-5na.no" => 0, + "nore-og-uvdal.no" => 0, + "notodden.no" => 0, + "naroy.no" => 0, + "xn--nry-yla5g.no" => 0, + "notteroy.no" => 0, + "xn--nttery-byae.no" => 0, + "odda.no" => 0, + "oksnes.no" => 0, + "xn--ksnes-uua.no" => 0, + "oppdal.no" => 0, + "oppegard.no" => 0, + "xn--oppegrd-ixa.no" => 0, + "orkdal.no" => 0, + "orland.no" => 0, + "xn--rland-uua.no" => 0, + "orskog.no" => 0, + "xn--rskog-uua.no" => 0, + "orsta.no" => 0, + "xn--rsta-fra.no" => 0, + "os.hedmark.no" => 0, + "os.hordaland.no" => 0, + "osen.no" => 0, + "osteroy.no" => 0, + "xn--ostery-fya.no" => 0, + "ostre-toten.no" => 0, + "xn--stre-toten-zcb.no" => 0, + "overhalla.no" => 0, + "ovre-eiker.no" => 0, + "xn--vre-eiker-k8a.no" => 0, + "oyer.no" => 0, + "xn--yer-zna.no" => 0, + "oygarden.no" => 0, + "xn--ygarden-p1a.no" => 0, + "oystre-slidre.no" => 0, + "xn--ystre-slidre-ujb.no" => 0, + "porsanger.no" => 0, + "porsangu.no" => 0, + "xn--porsgu-sta26f.no" => 0, + "porsgrunn.no" => 0, + "radoy.no" => 0, + "xn--rady-ira.no" => 0, + "rakkestad.no" => 0, + "rana.no" => 0, + "ruovat.no" => 0, + "randaberg.no" => 0, + "rauma.no" => 0, + "rendalen.no" => 0, + "rennebu.no" => 0, + "rennesoy.no" => 0, + "xn--rennesy-v1a.no" => 0, + "rindal.no" => 0, + "ringebu.no" => 0, + "ringerike.no" => 0, + "ringsaker.no" => 0, + "rissa.no" => 0, + "risor.no" => 0, + "xn--risr-ira.no" => 0, + "roan.no" => 0, + "rollag.no" => 0, + "rygge.no" => 0, + "ralingen.no" => 0, + "xn--rlingen-mxa.no" => 0, + "rodoy.no" => 0, + "xn--rdy-0nab.no" => 0, + "romskog.no" => 0, + "xn--rmskog-bya.no" => 0, + "roros.no" => 0, + "xn--rros-gra.no" => 0, + "rost.no" => 0, + "xn--rst-0na.no" => 0, + "royken.no" => 0, + "xn--ryken-vua.no" => 0, + "royrvik.no" => 0, + "xn--ryrvik-bya.no" => 0, + "rade.no" => 0, + "xn--rde-ula.no" => 0, + "salangen.no" => 0, + "siellak.no" => 0, + "saltdal.no" => 0, + "salat.no" => 0, + "xn--slt-elab.no" => 0, + "xn--slat-5na.no" => 0, + "samnanger.no" => 0, + "sande.more-og-romsdal.no" => 0, + "sande.xn--mre-og-romsdal-qqb.no" => 0, + "sande.vestfold.no" => 0, + "sandefjord.no" => 0, + "sandnes.no" => 0, + "sandoy.no" => 0, + "xn--sandy-yua.no" => 0, + "sarpsborg.no" => 0, + "sauda.no" => 0, + "sauherad.no" => 0, + "sel.no" => 0, + "selbu.no" => 0, + "selje.no" => 0, + "seljord.no" => 0, + "sigdal.no" => 0, + "siljan.no" => 0, + "sirdal.no" => 0, + "skaun.no" => 0, + "skedsmo.no" => 0, + "ski.no" => 0, + "skien.no" => 0, + "skiptvet.no" => 0, + "skjervoy.no" => 0, + "xn--skjervy-v1a.no" => 0, + "skierva.no" => 0, + "xn--skierv-uta.no" => 0, + "skjak.no" => 0, + "xn--skjk-soa.no" => 0, + "skodje.no" => 0, + "skanland.no" => 0, + "xn--sknland-fxa.no" => 0, + "skanit.no" => 0, + "xn--sknit-yqa.no" => 0, + "smola.no" => 0, + "xn--smla-hra.no" => 0, + "snillfjord.no" => 0, + "snasa.no" => 0, + "xn--snsa-roa.no" => 0, + "snoasa.no" => 0, + "snaase.no" => 0, + "xn--snase-nra.no" => 0, + "sogndal.no" => 0, + "sokndal.no" => 0, + "sola.no" => 0, + "solund.no" => 0, + "songdalen.no" => 0, + "sortland.no" => 0, + "spydeberg.no" => 0, + "stange.no" => 0, + "stavanger.no" => 0, + "steigen.no" => 0, + "steinkjer.no" => 0, + "stjordal.no" => 0, + "xn--stjrdal-s1a.no" => 0, + "stokke.no" => 0, + "stor-elvdal.no" => 0, + "stord.no" => 0, + "stordal.no" => 0, + "storfjord.no" => 0, + "omasvuotna.no" => 0, + "strand.no" => 0, + "stranda.no" => 0, + "stryn.no" => 0, + "sula.no" => 0, + "suldal.no" => 0, + "sund.no" => 0, + "sunndal.no" => 0, + "surnadal.no" => 0, + "sveio.no" => 0, + "svelvik.no" => 0, + "sykkylven.no" => 0, + "sogne.no" => 0, + "xn--sgne-gra.no" => 0, + "somna.no" => 0, + "xn--smna-gra.no" => 0, + "sondre-land.no" => 0, + "xn--sndre-land-0cb.no" => 0, + "sor-aurdal.no" => 0, + "xn--sr-aurdal-l8a.no" => 0, + "sor-fron.no" => 0, + "xn--sr-fron-q1a.no" => 0, + "sor-odal.no" => 0, + "xn--sr-odal-q1a.no" => 0, + "sor-varanger.no" => 0, + "xn--sr-varanger-ggb.no" => 0, + "matta-varjjat.no" => 0, + "xn--mtta-vrjjat-k7af.no" => 0, + "sorfold.no" => 0, + "xn--srfold-bya.no" => 0, + "sorreisa.no" => 0, + "xn--srreisa-q1a.no" => 0, + "sorum.no" => 0, + "xn--srum-gra.no" => 0, + "tana.no" => 0, + "deatnu.no" => 0, + "time.no" => 0, + "tingvoll.no" => 0, + "tinn.no" => 0, + "tjeldsund.no" => 0, + "dielddanuorri.no" => 0, + "tjome.no" => 0, + "xn--tjme-hra.no" => 0, + "tokke.no" => 0, + "tolga.no" => 0, + "torsken.no" => 0, + "tranoy.no" => 0, + "xn--trany-yua.no" => 0, + "tromso.no" => 0, + "xn--troms-zua.no" => 0, + "tromsa.no" => 0, + "romsa.no" => 0, + "trondheim.no" => 0, + "troandin.no" => 0, + "trysil.no" => 0, + "trana.no" => 0, + "xn--trna-woa.no" => 0, + "trogstad.no" => 0, + "xn--trgstad-r1a.no" => 0, + "tvedestrand.no" => 0, + "tydal.no" => 0, + "tynset.no" => 0, + "tysfjord.no" => 0, + "divtasvuodna.no" => 0, + "divttasvuotna.no" => 0, + "tysnes.no" => 0, + "tysvar.no" => 0, + "xn--tysvr-vra.no" => 0, + "tonsberg.no" => 0, + "xn--tnsberg-q1a.no" => 0, + "ullensaker.no" => 0, + "ullensvang.no" => 0, + "ulvik.no" => 0, + "utsira.no" => 0, + "vadso.no" => 0, + "xn--vads-jra.no" => 0, + "cahcesuolo.no" => 0, + "xn--hcesuolo-7ya35b.no" => 0, + "vaksdal.no" => 0, + "valle.no" => 0, + "vang.no" => 0, + "vanylven.no" => 0, + "vardo.no" => 0, + "xn--vard-jra.no" => 0, + "varggat.no" => 0, + "xn--vrggt-xqad.no" => 0, + "vefsn.no" => 0, + "vaapste.no" => 0, + "vega.no" => 0, + "vegarshei.no" => 0, + "xn--vegrshei-c0a.no" => 0, + "vennesla.no" => 0, + "verdal.no" => 0, + "verran.no" => 0, + "vestby.no" => 0, + "vestnes.no" => 0, + "vestre-slidre.no" => 0, + "vestre-toten.no" => 0, + "vestvagoy.no" => 0, + "xn--vestvgy-ixa6o.no" => 0, + "vevelstad.no" => 0, + "vik.no" => 0, + "vikna.no" => 0, + "vindafjord.no" => 0, + "volda.no" => 0, + "voss.no" => 0, + "varoy.no" => 0, + "xn--vry-yla5g.no" => 0, + "vagan.no" => 0, + "xn--vgan-qoa.no" => 0, + "voagat.no" => 0, + "vagsoy.no" => 0, + "xn--vgsy-qoa0j.no" => 0, + "vaga.no" => 0, + "xn--vg-yiab.no" => 0, + "valer.ostfold.no" => 0, + "xn--vler-qoa.xn--stfold-9xa.no" => 0, + "valer.hedmark.no" => 0, + "xn--vler-qoa.hedmark.no" => 0, + "np" => -1, + "nr" => 0, + "biz.nr" => 0, + "info.nr" => 0, + "gov.nr" => 0, + "edu.nr" => 0, + "org.nr" => 0, + "net.nr" => 0, + "com.nr" => 0, + "nu" => 0, + "nz" => 0, + "ac.nz" => 0, + "co.nz" => 0, + "cri.nz" => 0, + "geek.nz" => 0, + "gen.nz" => 0, + "govt.nz" => 0, + "health.nz" => 0, + "iwi.nz" => 0, + "kiwi.nz" => 0, + "maori.nz" => 0, + "mil.nz" => 0, + "xn--mori-qsa.nz" => 0, + "net.nz" => 0, + "org.nz" => 0, + "parliament.nz" => 0, + "school.nz" => 0, + "om" => 0, + "co.om" => 0, + "com.om" => 0, + "edu.om" => 0, + "gov.om" => 0, + "med.om" => 0, + "museum.om" => 0, + "net.om" => 0, + "org.om" => 0, + "pro.om" => 0, + "onion" => 0, + "org" => 0, + "pa" => 0, + "ac.pa" => 0, + "gob.pa" => 0, + "com.pa" => 0, + "org.pa" => 0, + "sld.pa" => 0, + "edu.pa" => 0, + "net.pa" => 0, + "ing.pa" => 0, + "abo.pa" => 0, + "med.pa" => 0, + "nom.pa" => 0, + "pe" => 0, + "edu.pe" => 0, + "gob.pe" => 0, + "nom.pe" => 0, + "mil.pe" => 0, + "org.pe" => 0, + "com.pe" => 0, + "net.pe" => 0, + "pf" => 0, + "com.pf" => 0, + "org.pf" => 0, + "edu.pf" => 0, + "pg" => -1, + "ph" => 0, + "com.ph" => 0, + "net.ph" => 0, + "org.ph" => 0, + "gov.ph" => 0, + "edu.ph" => 0, + "ngo.ph" => 0, + "mil.ph" => 0, + "i.ph" => 0, + "pk" => 0, + "com.pk" => 0, + "net.pk" => 0, + "edu.pk" => 0, + "org.pk" => 0, + "fam.pk" => 0, + "biz.pk" => 0, + "web.pk" => 0, + "gov.pk" => 0, + "gob.pk" => 0, + "gok.pk" => 0, + "gon.pk" => 0, + "gop.pk" => 0, + "gos.pk" => 0, + "info.pk" => 0, + "pl" => 0, + "com.pl" => 0, + "net.pl" => 0, + "org.pl" => 0, + "aid.pl" => 0, + "agro.pl" => 0, + "atm.pl" => 0, + "auto.pl" => 0, + "biz.pl" => 0, + "edu.pl" => 0, + "gmina.pl" => 0, + "gsm.pl" => 0, + "info.pl" => 0, + "mail.pl" => 0, + "miasta.pl" => 0, + "media.pl" => 0, + "mil.pl" => 0, + "nieruchomosci.pl" => 0, + "nom.pl" => 0, + "pc.pl" => 0, + "powiat.pl" => 0, + "priv.pl" => 0, + "realestate.pl" => 0, + "rel.pl" => 0, + "sex.pl" => 0, + "shop.pl" => 0, + "sklep.pl" => 0, + "sos.pl" => 0, + "szkola.pl" => 0, + "targi.pl" => 0, + "tm.pl" => 0, + "tourism.pl" => 0, + "travel.pl" => 0, + "turystyka.pl" => 0, + "gov.pl" => 0, + "ap.gov.pl" => 0, + "ic.gov.pl" => 0, + "is.gov.pl" => 0, + "us.gov.pl" => 0, + "kmpsp.gov.pl" => 0, + "kppsp.gov.pl" => 0, + "kwpsp.gov.pl" => 0, + "psp.gov.pl" => 0, + "wskr.gov.pl" => 0, + "kwp.gov.pl" => 0, + "mw.gov.pl" => 0, + "ug.gov.pl" => 0, + "um.gov.pl" => 0, + "umig.gov.pl" => 0, + "ugim.gov.pl" => 0, + "upow.gov.pl" => 0, + "uw.gov.pl" => 0, + "starostwo.gov.pl" => 0, + "pa.gov.pl" => 0, + "po.gov.pl" => 0, + "psse.gov.pl" => 0, + "pup.gov.pl" => 0, + "rzgw.gov.pl" => 0, + "sa.gov.pl" => 0, + "so.gov.pl" => 0, + "sr.gov.pl" => 0, + "wsa.gov.pl" => 0, + "sko.gov.pl" => 0, + "uzs.gov.pl" => 0, + "wiih.gov.pl" => 0, + "winb.gov.pl" => 0, + "pinb.gov.pl" => 0, + "wios.gov.pl" => 0, + "witd.gov.pl" => 0, + "wzmiuw.gov.pl" => 0, + "piw.gov.pl" => 0, + "wiw.gov.pl" => 0, + "griw.gov.pl" => 0, + "wif.gov.pl" => 0, + "oum.gov.pl" => 0, + "sdn.gov.pl" => 0, + "zp.gov.pl" => 0, + "uppo.gov.pl" => 0, + "mup.gov.pl" => 0, + "wuoz.gov.pl" => 0, + "konsulat.gov.pl" => 0, + "oirm.gov.pl" => 0, + "augustow.pl" => 0, + "babia-gora.pl" => 0, + "bedzin.pl" => 0, + "beskidy.pl" => 0, + "bialowieza.pl" => 0, + "bialystok.pl" => 0, + "bielawa.pl" => 0, + "bieszczady.pl" => 0, + "boleslawiec.pl" => 0, + "bydgoszcz.pl" => 0, + "bytom.pl" => 0, + "cieszyn.pl" => 0, + "czeladz.pl" => 0, + "czest.pl" => 0, + "dlugoleka.pl" => 0, + "elblag.pl" => 0, + "elk.pl" => 0, + "glogow.pl" => 0, + "gniezno.pl" => 0, + "gorlice.pl" => 0, + "grajewo.pl" => 0, + "ilawa.pl" => 0, + "jaworzno.pl" => 0, + "jelenia-gora.pl" => 0, + "jgora.pl" => 0, + "kalisz.pl" => 0, + "kazimierz-dolny.pl" => 0, + "karpacz.pl" => 0, + "kartuzy.pl" => 0, + "kaszuby.pl" => 0, + "katowice.pl" => 0, + "kepno.pl" => 0, + "ketrzyn.pl" => 0, + "klodzko.pl" => 0, + "kobierzyce.pl" => 0, + "kolobrzeg.pl" => 0, + "konin.pl" => 0, + "konskowola.pl" => 0, + "kutno.pl" => 0, + "lapy.pl" => 0, + "lebork.pl" => 0, + "legnica.pl" => 0, + "lezajsk.pl" => 0, + "limanowa.pl" => 0, + "lomza.pl" => 0, + "lowicz.pl" => 0, + "lubin.pl" => 0, + "lukow.pl" => 0, + "malbork.pl" => 0, + "malopolska.pl" => 0, + "mazowsze.pl" => 0, + "mazury.pl" => 0, + "mielec.pl" => 0, + "mielno.pl" => 0, + "mragowo.pl" => 0, + "naklo.pl" => 0, + "nowaruda.pl" => 0, + "nysa.pl" => 0, + "olawa.pl" => 0, + "olecko.pl" => 0, + "olkusz.pl" => 0, + "olsztyn.pl" => 0, + "opoczno.pl" => 0, + "opole.pl" => 0, + "ostroda.pl" => 0, + "ostroleka.pl" => 0, + "ostrowiec.pl" => 0, + "ostrowwlkp.pl" => 0, + "pila.pl" => 0, + "pisz.pl" => 0, + "podhale.pl" => 0, + "podlasie.pl" => 0, + "polkowice.pl" => 0, + "pomorze.pl" => 0, + "pomorskie.pl" => 0, + "prochowice.pl" => 0, + "pruszkow.pl" => 0, + "przeworsk.pl" => 0, + "pulawy.pl" => 0, + "radom.pl" => 0, + "rawa-maz.pl" => 0, + "rybnik.pl" => 0, + "rzeszow.pl" => 0, + "sanok.pl" => 0, + "sejny.pl" => 0, + "slask.pl" => 0, + "slupsk.pl" => 0, + "sosnowiec.pl" => 0, + "stalowa-wola.pl" => 0, + "skoczow.pl" => 0, + "starachowice.pl" => 0, + "stargard.pl" => 0, + "suwalki.pl" => 0, + "swidnica.pl" => 0, + "swiebodzin.pl" => 0, + "swinoujscie.pl" => 0, + "szczecin.pl" => 0, + "szczytno.pl" => 0, + "tarnobrzeg.pl" => 0, + "tgory.pl" => 0, + "turek.pl" => 0, + "tychy.pl" => 0, + "ustka.pl" => 0, + "walbrzych.pl" => 0, + "warmia.pl" => 0, + "warszawa.pl" => 0, + "waw.pl" => 0, + "wegrow.pl" => 0, + "wielun.pl" => 0, + "wlocl.pl" => 0, + "wloclawek.pl" => 0, + "wodzislaw.pl" => 0, + "wolomin.pl" => 0, + "wroclaw.pl" => 0, + "zachpomor.pl" => 0, + "zagan.pl" => 0, + "zarow.pl" => 0, + "zgora.pl" => 0, + "zgorzelec.pl" => 0, + "pm" => 0, + "pn" => 0, + "gov.pn" => 0, + "co.pn" => 0, + "org.pn" => 0, + "edu.pn" => 0, + "net.pn" => 0, + "post" => 0, + "pr" => 0, + "com.pr" => 0, + "net.pr" => 0, + "org.pr" => 0, + "gov.pr" => 0, + "edu.pr" => 0, + "isla.pr" => 0, + "pro.pr" => 0, + "biz.pr" => 0, + "info.pr" => 0, + "name.pr" => 0, + "est.pr" => 0, + "prof.pr" => 0, + "ac.pr" => 0, + "pro" => 0, + "aaa.pro" => 0, + "aca.pro" => 0, + "acct.pro" => 0, + "avocat.pro" => 0, + "bar.pro" => 0, + "cpa.pro" => 0, + "eng.pro" => 0, + "jur.pro" => 0, + "law.pro" => 0, + "med.pro" => 0, + "recht.pro" => 0, + "ps" => 0, + "edu.ps" => 0, + "gov.ps" => 0, + "sec.ps" => 0, + "plo.ps" => 0, + "com.ps" => 0, + "org.ps" => 0, + "net.ps" => 0, + "pt" => 0, + "net.pt" => 0, + "gov.pt" => 0, + "org.pt" => 0, + "edu.pt" => 0, + "int.pt" => 0, + "publ.pt" => 0, + "com.pt" => 0, + "nome.pt" => 0, + "pw" => 0, + "co.pw" => 0, + "ne.pw" => 0, + "or.pw" => 0, + "ed.pw" => 0, + "go.pw" => 0, + "belau.pw" => 0, + "py" => 0, + "com.py" => 0, + "coop.py" => 0, + "edu.py" => 0, + "gov.py" => 0, + "mil.py" => 0, + "net.py" => 0, + "org.py" => 0, + "qa" => 0, + "com.qa" => 0, + "edu.qa" => 0, + "gov.qa" => 0, + "mil.qa" => 0, + "name.qa" => 0, + "net.qa" => 0, + "org.qa" => 0, + "sch.qa" => 0, + "re" => 0, + "asso.re" => 0, + "com.re" => 0, + "nom.re" => 0, + "ro" => 0, + "arts.ro" => 0, + "com.ro" => 0, + "firm.ro" => 0, + "info.ro" => 0, + "nom.ro" => 0, + "nt.ro" => 0, + "org.ro" => 0, + "rec.ro" => 0, + "store.ro" => 0, + "tm.ro" => 0, + "www.ro" => 0, + "rs" => 0, + "ac.rs" => 0, + "co.rs" => 0, + "edu.rs" => 0, + "gov.rs" => 0, + "in.rs" => 0, + "org.rs" => 0, + "ru" => 0, + "ac.ru" => 0, + "edu.ru" => 0, + "gov.ru" => 0, + "int.ru" => 0, + "mil.ru" => 0, + "test.ru" => 0, + "rw" => 0, + "ac.rw" => 0, + "co.rw" => 0, + "coop.rw" => 0, + "gov.rw" => 0, + "mil.rw" => 0, + "net.rw" => 0, + "org.rw" => 0, + "sa" => 0, + "com.sa" => 0, + "net.sa" => 0, + "org.sa" => 0, + "gov.sa" => 0, + "med.sa" => 0, + "pub.sa" => 0, + "edu.sa" => 0, + "sch.sa" => 0, + "sb" => 0, + "com.sb" => 0, + "edu.sb" => 0, + "gov.sb" => 0, + "net.sb" => 0, + "org.sb" => 0, + "sc" => 0, + "com.sc" => 0, + "gov.sc" => 0, + "net.sc" => 0, + "org.sc" => 0, + "edu.sc" => 0, + "sd" => 0, + "com.sd" => 0, + "net.sd" => 0, + "org.sd" => 0, + "edu.sd" => 0, + "med.sd" => 0, + "tv.sd" => 0, + "gov.sd" => 0, + "info.sd" => 0, + "se" => 0, + "a.se" => 0, + "ac.se" => 0, + "b.se" => 0, + "bd.se" => 0, + "brand.se" => 0, + "c.se" => 0, + "d.se" => 0, + "e.se" => 0, + "f.se" => 0, + "fh.se" => 0, + "fhsk.se" => 0, + "fhv.se" => 0, + "g.se" => 0, + "h.se" => 0, + "i.se" => 0, + "k.se" => 0, + "komforb.se" => 0, + "kommunalforbund.se" => 0, + "komvux.se" => 0, + "l.se" => 0, + "lanbib.se" => 0, + "m.se" => 0, + "n.se" => 0, + "naturbruksgymn.se" => 0, + "o.se" => 0, + "org.se" => 0, + "p.se" => 0, + "parti.se" => 0, + "pp.se" => 0, + "press.se" => 0, + "r.se" => 0, + "s.se" => 0, + "t.se" => 0, + "tm.se" => 0, + "u.se" => 0, + "w.se" => 0, + "x.se" => 0, + "y.se" => 0, + "z.se" => 0, + "sg" => 0, + "com.sg" => 0, + "net.sg" => 0, + "org.sg" => 0, + "gov.sg" => 0, + "edu.sg" => 0, + "per.sg" => 0, + "sh" => 0, + "com.sh" => 0, + "net.sh" => 0, + "gov.sh" => 0, + "org.sh" => 0, + "mil.sh" => 0, + "si" => 0, + "sj" => 0, + "sk" => 0, + "sl" => 0, + "com.sl" => 0, + "net.sl" => 0, + "edu.sl" => 0, + "gov.sl" => 0, + "org.sl" => 0, + "sm" => 0, + "sn" => 0, + "art.sn" => 0, + "com.sn" => 0, + "edu.sn" => 0, + "gouv.sn" => 0, + "org.sn" => 0, + "perso.sn" => 0, + "univ.sn" => 0, + "so" => 0, + "com.so" => 0, + "net.so" => 0, + "org.so" => 0, + "sr" => 0, + "st" => 0, + "co.st" => 0, + "com.st" => 0, + "consulado.st" => 0, + "edu.st" => 0, + "embaixada.st" => 0, + "gov.st" => 0, + "mil.st" => 0, + "net.st" => 0, + "org.st" => 0, + "principe.st" => 0, + "saotome.st" => 0, + "store.st" => 0, + "su" => 0, + "sv" => 0, + "com.sv" => 0, + "edu.sv" => 0, + "gob.sv" => 0, + "org.sv" => 0, + "red.sv" => 0, + "sx" => 0, + "gov.sx" => 0, + "sy" => 0, + "edu.sy" => 0, + "gov.sy" => 0, + "net.sy" => 0, + "mil.sy" => 0, + "com.sy" => 0, + "org.sy" => 0, + "sz" => 0, + "co.sz" => 0, + "ac.sz" => 0, + "org.sz" => 0, + "tc" => 0, + "td" => 0, + "tel" => 0, + "tf" => 0, + "tg" => 0, + "th" => 0, + "ac.th" => 0, + "co.th" => 0, + "go.th" => 0, + "in.th" => 0, + "mi.th" => 0, + "net.th" => 0, + "or.th" => 0, + "tj" => 0, + "ac.tj" => 0, + "biz.tj" => 0, + "co.tj" => 0, + "com.tj" => 0, + "edu.tj" => 0, + "go.tj" => 0, + "gov.tj" => 0, + "int.tj" => 0, + "mil.tj" => 0, + "name.tj" => 0, + "net.tj" => 0, + "nic.tj" => 0, + "org.tj" => 0, + "test.tj" => 0, + "web.tj" => 0, + "tk" => 0, + "tl" => 0, + "gov.tl" => 0, + "tm" => 0, + "com.tm" => 0, + "co.tm" => 0, + "org.tm" => 0, + "net.tm" => 0, + "nom.tm" => 0, + "gov.tm" => 0, + "mil.tm" => 0, + "edu.tm" => 0, + "tn" => 0, + "com.tn" => 0, + "ens.tn" => 0, + "fin.tn" => 0, + "gov.tn" => 0, + "ind.tn" => 0, + "intl.tn" => 0, + "nat.tn" => 0, + "net.tn" => 0, + "org.tn" => 0, + "info.tn" => 0, + "perso.tn" => 0, + "tourism.tn" => 0, + "edunet.tn" => 0, + "rnrt.tn" => 0, + "rns.tn" => 0, + "rnu.tn" => 0, + "mincom.tn" => 0, + "agrinet.tn" => 0, + "defense.tn" => 0, + "turen.tn" => 0, + "to" => 0, + "com.to" => 0, + "gov.to" => 0, + "net.to" => 0, + "org.to" => 0, + "edu.to" => 0, + "mil.to" => 0, + "tr" => 0, + "av.tr" => 0, + "bbs.tr" => 0, + "bel.tr" => 0, + "biz.tr" => 0, + "com.tr" => 0, + "dr.tr" => 0, + "edu.tr" => 0, + "gen.tr" => 0, + "gov.tr" => 0, + "info.tr" => 0, + "mil.tr" => 0, + "k12.tr" => 0, + "kep.tr" => 0, + "name.tr" => 0, + "net.tr" => 0, + "org.tr" => 0, + "pol.tr" => 0, + "tel.tr" => 0, + "tsk.tr" => 0, + "tv.tr" => 0, + "web.tr" => 0, + "nc.tr" => 0, + "gov.nc.tr" => 0, + "tt" => 0, + "co.tt" => 0, + "com.tt" => 0, + "org.tt" => 0, + "net.tt" => 0, + "biz.tt" => 0, + "info.tt" => 0, + "pro.tt" => 0, + "int.tt" => 0, + "coop.tt" => 0, + "jobs.tt" => 0, + "mobi.tt" => 0, + "travel.tt" => 0, + "museum.tt" => 0, + "aero.tt" => 0, + "name.tt" => 0, + "gov.tt" => 0, + "edu.tt" => 0, + "tv" => 0, + "tw" => 0, + "edu.tw" => 0, + "gov.tw" => 0, + "mil.tw" => 0, + "com.tw" => 0, + "net.tw" => 0, + "org.tw" => 0, + "idv.tw" => 0, + "game.tw" => 0, + "ebiz.tw" => 0, + "club.tw" => 0, + "xn--zf0ao64a.tw" => 0, + "xn--uc0atv.tw" => 0, + "xn--czrw28b.tw" => 0, + "tz" => 0, + "ac.tz" => 0, + "co.tz" => 0, + "go.tz" => 0, + "hotel.tz" => 0, + "info.tz" => 0, + "me.tz" => 0, + "mil.tz" => 0, + "mobi.tz" => 0, + "ne.tz" => 0, + "or.tz" => 0, + "sc.tz" => 0, + "tv.tz" => 0, + "ua" => 0, + "com.ua" => 0, + "edu.ua" => 0, + "gov.ua" => 0, + "in.ua" => 0, + "net.ua" => 0, + "org.ua" => 0, + "cherkassy.ua" => 0, + "cherkasy.ua" => 0, + "chernigov.ua" => 0, + "chernihiv.ua" => 0, + "chernivtsi.ua" => 0, + "chernovtsy.ua" => 0, + "ck.ua" => 0, + "cn.ua" => 0, + "cr.ua" => 0, + "crimea.ua" => 0, + "cv.ua" => 0, + "dn.ua" => 0, + "dnepropetrovsk.ua" => 0, + "dnipropetrovsk.ua" => 0, + "dominic.ua" => 0, + "donetsk.ua" => 0, + "dp.ua" => 0, + "if.ua" => 0, + "ivano-frankivsk.ua" => 0, + "kh.ua" => 0, + "kharkiv.ua" => 0, + "kharkov.ua" => 0, + "kherson.ua" => 0, + "khmelnitskiy.ua" => 0, + "khmelnytskyi.ua" => 0, + "kiev.ua" => 0, + "kirovograd.ua" => 0, + "km.ua" => 0, + "kr.ua" => 0, + "krym.ua" => 0, + "ks.ua" => 0, + "kv.ua" => 0, + "kyiv.ua" => 0, + "lg.ua" => 0, + "lt.ua" => 0, + "lugansk.ua" => 0, + "lutsk.ua" => 0, + "lv.ua" => 0, + "lviv.ua" => 0, + "mk.ua" => 0, + "mykolaiv.ua" => 0, + "nikolaev.ua" => 0, + "od.ua" => 0, + "odesa.ua" => 0, + "odessa.ua" => 0, + "pl.ua" => 0, + "poltava.ua" => 0, + "rivne.ua" => 0, + "rovno.ua" => 0, + "rv.ua" => 0, + "sb.ua" => 0, + "sebastopol.ua" => 0, + "sevastopol.ua" => 0, + "sm.ua" => 0, + "sumy.ua" => 0, + "te.ua" => 0, + "ternopil.ua" => 0, + "uz.ua" => 0, + "uzhgorod.ua" => 0, + "vinnica.ua" => 0, + "vinnytsia.ua" => 0, + "vn.ua" => 0, + "volyn.ua" => 0, + "yalta.ua" => 0, + "zaporizhzhe.ua" => 0, + "zaporizhzhia.ua" => 0, + "zhitomir.ua" => 0, + "zhytomyr.ua" => 0, + "zp.ua" => 0, + "zt.ua" => 0, + "ug" => 0, + "co.ug" => 0, + "or.ug" => 0, + "ac.ug" => 0, + "sc.ug" => 0, + "go.ug" => 0, + "ne.ug" => 0, + "com.ug" => 0, + "org.ug" => 0, + "uk" => 0, + "ac.uk" => 0, + "co.uk" => 0, + "gov.uk" => 0, + "ltd.uk" => 0, + "me.uk" => 0, + "net.uk" => 0, + "nhs.uk" => 0, + "org.uk" => 0, + "plc.uk" => 0, + "police.uk" => 0, + "sch.uk" => -1, + "us" => 0, + "dni.us" => 0, + "fed.us" => 0, + "isa.us" => 0, + "kids.us" => 0, + "nsn.us" => 0, + "ak.us" => 0, + "al.us" => 0, + "ar.us" => 0, + "as.us" => 0, + "az.us" => 0, + "ca.us" => 0, + "co.us" => 0, + "ct.us" => 0, + "dc.us" => 0, + "de.us" => 0, + "fl.us" => 0, + "ga.us" => 0, + "gu.us" => 0, + "hi.us" => 0, + "ia.us" => 0, + "id.us" => 0, + "il.us" => 0, + "in.us" => 0, + "ks.us" => 0, + "ky.us" => 0, + "la.us" => 0, + "ma.us" => 0, + "md.us" => 0, + "me.us" => 0, + "mi.us" => 0, + "mn.us" => 0, + "mo.us" => 0, + "ms.us" => 0, + "mt.us" => 0, + "nc.us" => 0, + "nd.us" => 0, + "ne.us" => 0, + "nh.us" => 0, + "nj.us" => 0, + "nm.us" => 0, + "nv.us" => 0, + "ny.us" => 0, + "oh.us" => 0, + "ok.us" => 0, + "or.us" => 0, + "pa.us" => 0, + "pr.us" => 0, + "ri.us" => 0, + "sc.us" => 0, + "sd.us" => 0, + "tn.us" => 0, + "tx.us" => 0, + "ut.us" => 0, + "vi.us" => 0, + "vt.us" => 0, + "va.us" => 0, + "wa.us" => 0, + "wi.us" => 0, + "wv.us" => 0, + "wy.us" => 0, + "k12.ak.us" => 0, + "k12.al.us" => 0, + "k12.ar.us" => 0, + "k12.as.us" => 0, + "k12.az.us" => 0, + "k12.ca.us" => 0, + "k12.co.us" => 0, + "k12.ct.us" => 0, + "k12.dc.us" => 0, + "k12.de.us" => 0, + "k12.fl.us" => 0, + "k12.ga.us" => 0, + "k12.gu.us" => 0, + "k12.ia.us" => 0, + "k12.id.us" => 0, + "k12.il.us" => 0, + "k12.in.us" => 0, + "k12.ks.us" => 0, + "k12.ky.us" => 0, + "k12.la.us" => 0, + "k12.ma.us" => 0, + "k12.md.us" => 0, + "k12.me.us" => 0, + "k12.mi.us" => 0, + "k12.mn.us" => 0, + "k12.mo.us" => 0, + "k12.ms.us" => 0, + "k12.mt.us" => 0, + "k12.nc.us" => 0, + "k12.ne.us" => 0, + "k12.nh.us" => 0, + "k12.nj.us" => 0, + "k12.nm.us" => 0, + "k12.nv.us" => 0, + "k12.ny.us" => 0, + "k12.oh.us" => 0, + "k12.ok.us" => 0, + "k12.or.us" => 0, + "k12.pa.us" => 0, + "k12.pr.us" => 0, + "k12.ri.us" => 0, + "k12.sc.us" => 0, + "k12.tn.us" => 0, + "k12.tx.us" => 0, + "k12.ut.us" => 0, + "k12.vi.us" => 0, + "k12.vt.us" => 0, + "k12.va.us" => 0, + "k12.wa.us" => 0, + "k12.wi.us" => 0, + "k12.wy.us" => 0, + "cc.ak.us" => 0, + "cc.al.us" => 0, + "cc.ar.us" => 0, + "cc.as.us" => 0, + "cc.az.us" => 0, + "cc.ca.us" => 0, + "cc.co.us" => 0, + "cc.ct.us" => 0, + "cc.dc.us" => 0, + "cc.de.us" => 0, + "cc.fl.us" => 0, + "cc.ga.us" => 0, + "cc.gu.us" => 0, + "cc.hi.us" => 0, + "cc.ia.us" => 0, + "cc.id.us" => 0, + "cc.il.us" => 0, + "cc.in.us" => 0, + "cc.ks.us" => 0, + "cc.ky.us" => 0, + "cc.la.us" => 0, + "cc.ma.us" => 0, + "cc.md.us" => 0, + "cc.me.us" => 0, + "cc.mi.us" => 0, + "cc.mn.us" => 0, + "cc.mo.us" => 0, + "cc.ms.us" => 0, + "cc.mt.us" => 0, + "cc.nc.us" => 0, + "cc.nd.us" => 0, + "cc.ne.us" => 0, + "cc.nh.us" => 0, + "cc.nj.us" => 0, + "cc.nm.us" => 0, + "cc.nv.us" => 0, + "cc.ny.us" => 0, + "cc.oh.us" => 0, + "cc.ok.us" => 0, + "cc.or.us" => 0, + "cc.pa.us" => 0, + "cc.pr.us" => 0, + "cc.ri.us" => 0, + "cc.sc.us" => 0, + "cc.sd.us" => 0, + "cc.tn.us" => 0, + "cc.tx.us" => 0, + "cc.ut.us" => 0, + "cc.vi.us" => 0, + "cc.vt.us" => 0, + "cc.va.us" => 0, + "cc.wa.us" => 0, + "cc.wi.us" => 0, + "cc.wv.us" => 0, + "cc.wy.us" => 0, + "lib.ak.us" => 0, + "lib.al.us" => 0, + "lib.ar.us" => 0, + "lib.as.us" => 0, + "lib.az.us" => 0, + "lib.ca.us" => 0, + "lib.co.us" => 0, + "lib.ct.us" => 0, + "lib.dc.us" => 0, + "lib.fl.us" => 0, + "lib.ga.us" => 0, + "lib.gu.us" => 0, + "lib.hi.us" => 0, + "lib.ia.us" => 0, + "lib.id.us" => 0, + "lib.il.us" => 0, + "lib.in.us" => 0, + "lib.ks.us" => 0, + "lib.ky.us" => 0, + "lib.la.us" => 0, + "lib.ma.us" => 0, + "lib.md.us" => 0, + "lib.me.us" => 0, + "lib.mi.us" => 0, + "lib.mn.us" => 0, + "lib.mo.us" => 0, + "lib.ms.us" => 0, + "lib.mt.us" => 0, + "lib.nc.us" => 0, + "lib.nd.us" => 0, + "lib.ne.us" => 0, + "lib.nh.us" => 0, + "lib.nj.us" => 0, + "lib.nm.us" => 0, + "lib.nv.us" => 0, + "lib.ny.us" => 0, + "lib.oh.us" => 0, + "lib.ok.us" => 0, + "lib.or.us" => 0, + "lib.pa.us" => 0, + "lib.pr.us" => 0, + "lib.ri.us" => 0, + "lib.sc.us" => 0, + "lib.sd.us" => 0, + "lib.tn.us" => 0, + "lib.tx.us" => 0, + "lib.ut.us" => 0, + "lib.vi.us" => 0, + "lib.vt.us" => 0, + "lib.va.us" => 0, + "lib.wa.us" => 0, + "lib.wi.us" => 0, + "lib.wy.us" => 0, + "pvt.k12.ma.us" => 0, + "chtr.k12.ma.us" => 0, + "paroch.k12.ma.us" => 0, + "ann-arbor.mi.us" => 0, + "cog.mi.us" => 0, + "dst.mi.us" => 0, + "eaton.mi.us" => 0, + "gen.mi.us" => 0, + "mus.mi.us" => 0, + "tec.mi.us" => 0, + "washtenaw.mi.us" => 0, + "uy" => 0, + "com.uy" => 0, + "edu.uy" => 0, + "gub.uy" => 0, + "mil.uy" => 0, + "net.uy" => 0, + "org.uy" => 0, + "uz" => 0, + "co.uz" => 0, + "com.uz" => 0, + "net.uz" => 0, + "org.uz" => 0, + "va" => 0, + "vc" => 0, + "com.vc" => 0, + "net.vc" => 0, + "org.vc" => 0, + "gov.vc" => 0, + "mil.vc" => 0, + "edu.vc" => 0, + "ve" => 0, + "arts.ve" => 0, + "co.ve" => 0, + "com.ve" => 0, + "e12.ve" => 0, + "edu.ve" => 0, + "firm.ve" => 0, + "gob.ve" => 0, + "gov.ve" => 0, + "info.ve" => 0, + "int.ve" => 0, + "mil.ve" => 0, + "net.ve" => 0, + "org.ve" => 0, + "rec.ve" => 0, + "store.ve" => 0, + "tec.ve" => 0, + "web.ve" => 0, + "vg" => 0, + "vi" => 0, + "co.vi" => 0, + "com.vi" => 0, + "k12.vi" => 0, + "net.vi" => 0, + "org.vi" => 0, + "vn" => 0, + "com.vn" => 0, + "net.vn" => 0, + "org.vn" => 0, + "edu.vn" => 0, + "gov.vn" => 0, + "int.vn" => 0, + "ac.vn" => 0, + "biz.vn" => 0, + "info.vn" => 0, + "name.vn" => 0, + "pro.vn" => 0, + "health.vn" => 0, + "vu" => 0, + "com.vu" => 0, + "edu.vu" => 0, + "net.vu" => 0, + "org.vu" => 0, + "wf" => 0, + "ws" => 0, + "com.ws" => 0, + "net.ws" => 0, + "org.ws" => 0, + "gov.ws" => 0, + "edu.ws" => 0, + "yt" => 0, + "xn--mgbaam7a8h" => 0, + "xn--y9a3aq" => 0, + "xn--54b7fta0cc" => 0, + "xn--90ae" => 0, + "xn--90ais" => 0, + "xn--fiqs8s" => 0, + "xn--fiqz9s" => 0, + "xn--lgbbat1ad8j" => 0, + "xn--wgbh1c" => 0, + "xn--e1a4c" => 0, + "xn--node" => 0, + "xn--qxam" => 0, + "xn--j6w193g" => 0, + "xn--55qx5d.xn--j6w193g" => 0, + "xn--wcvs22d.xn--j6w193g" => 0, + "xn--mxtq1m.xn--j6w193g" => 0, + "xn--gmqw5a.xn--j6w193g" => 0, + "xn--od0alg.xn--j6w193g" => 0, + "xn--uc0atv.xn--j6w193g" => 0, + "xn--2scrj9c" => 0, + "xn--3hcrj9c" => 0, + "xn--45br5cyl" => 0, + "xn--h2breg3eve" => 0, + "xn--h2brj9c8c" => 0, + "xn--mgbgu82a" => 0, + "xn--rvc1e0am3e" => 0, + "xn--h2brj9c" => 0, + "xn--mgbbh1a" => 0, + "xn--mgbbh1a71e" => 0, + "xn--fpcrj9c3d" => 0, + "xn--gecrj9c" => 0, + "xn--s9brj9c" => 0, + "xn--45brj9c" => 0, + "xn--xkc2dl3a5ee0h" => 0, + "xn--mgba3a4f16a" => 0, + "xn--mgba3a4fra" => 0, + "xn--mgbtx2b" => 0, + "xn--mgbayh7gpa" => 0, + "xn--3e0b707e" => 0, + "xn--80ao21a" => 0, + "xn--fzc2c9e2c" => 0, + "xn--xkc2al3hye2a" => 0, + "xn--mgbc0a9azcg" => 0, + "xn--d1alf" => 0, + "xn--l1acc" => 0, + "xn--mix891f" => 0, + "xn--mix082f" => 0, + "xn--mgbx4cd0ab" => 0, + "xn--mgb9awbf" => 0, + "xn--mgbai9azgqp6j" => 0, + "xn--mgbai9a5eva00b" => 0, + "xn--ygbi2ammx" => 0, + "xn--90a3ac" => 0, + "xn--o1ac.xn--90a3ac" => 0, + "xn--c1avg.xn--90a3ac" => 0, + "xn--90azh.xn--90a3ac" => 0, + "xn--d1at.xn--90a3ac" => 0, + "xn--o1ach.xn--90a3ac" => 0, + "xn--80au.xn--90a3ac" => 0, + "xn--p1ai" => 0, + "xn--wgbl6a" => 0, + "xn--mgberp4a5d4ar" => 0, + "xn--mgberp4a5d4a87g" => 0, + "xn--mgbqly7c0a67fbc" => 0, + "xn--mgbqly7cvafr" => 0, + "xn--mgbpl2fh" => 0, + "xn--yfro4i67o" => 0, + "xn--clchc0ea0b2g2a9gcd" => 0, + "xn--ogbpf8fl" => 0, + "xn--mgbtf8fl" => 0, + "xn--o3cw4h" => 0, + "xn--12c1fe0br.xn--o3cw4h" => 0, + "xn--12co0c3b4eva.xn--o3cw4h" => 0, + "xn--h3cuzk1di.xn--o3cw4h" => 0, + "xn--o3cyx2a.xn--o3cw4h" => 0, + "xn--m3ch0j3a.xn--o3cw4h" => 0, + "xn--12cfi8ixb8l.xn--o3cw4h" => 0, + "xn--pgbs0dh" => 0, + "xn--kpry57d" => 0, + "xn--kprw13d" => 0, + "xn--nnx388a" => 0, + "xn--j1amh" => 0, + "xn--mgb2ddes" => 0, + "xxx" => 0, + "ye" => -1, + "za" => 1, + "ac.za" => 0, + "agric.za" => 0, + "alt.za" => 0, + "co.za" => 0, + "edu.za" => 0, + "gov.za" => 0, + "grondar.za" => 0, + "law.za" => 0, + "mil.za" => 0, + "net.za" => 0, + "ngo.za" => 0, + "nis.za" => 0, + "nom.za" => 0, + "org.za" => 0, + "school.za" => 0, + "tm.za" => 0, + "web.za" => 0, + "zm" => 0, + "ac.zm" => 0, + "biz.zm" => 0, + "co.zm" => 0, + "com.zm" => 0, + "edu.zm" => 0, + "gov.zm" => 0, + "info.zm" => 0, + "mil.zm" => 0, + "net.zm" => 0, + "org.zm" => 0, + "sch.zm" => 0, + "zw" => 0, + "ac.zw" => 0, + "co.zw" => 0, + "gov.zw" => 0, + "mil.zw" => 0, + "org.zw" => 0, + "aaa" => 0, + "aarp" => 0, + "abarth" => 0, + "abb" => 0, + "abbott" => 0, + "abbvie" => 0, + "abc" => 0, + "able" => 0, + "abogado" => 0, + "abudhabi" => 0, + "academy" => 0, + "accenture" => 0, + "accountant" => 0, + "accountants" => 0, + "aco" => 0, + "actor" => 0, + "adac" => 0, + "ads" => 0, + "adult" => 0, + "aeg" => 0, + "aetna" => 0, + "afamilycompany" => 0, + "afl" => 0, + "africa" => 0, + "agakhan" => 0, + "agency" => 0, + "aig" => 0, + "aigo" => 0, + "airbus" => 0, + "airforce" => 0, + "airtel" => 0, + "akdn" => 0, + "alfaromeo" => 0, + "alibaba" => 0, + "alipay" => 0, + "allfinanz" => 0, + "allstate" => 0, + "ally" => 0, + "alsace" => 0, + "alstom" => 0, + "americanexpress" => 0, + "americanfamily" => 0, + "amex" => 0, + "amfam" => 0, + "amica" => 0, + "amsterdam" => 0, + "analytics" => 0, + "android" => 0, + "anquan" => 0, + "anz" => 0, + "aol" => 0, + "apartments" => 0, + "app" => 0, + "apple" => 0, + "aquarelle" => 0, + "arab" => 0, + "aramco" => 0, + "archi" => 0, + "army" => 0, + "art" => 0, + "arte" => 0, + "asda" => 0, + "associates" => 0, + "athleta" => 0, + "attorney" => 0, + "auction" => 0, + "audi" => 0, + "audible" => 0, + "audio" => 0, + "auspost" => 0, + "author" => 0, + "auto" => 0, + "autos" => 0, + "avianca" => 0, + "aws" => 0, + "axa" => 0, + "azure" => 0, + "baby" => 0, + "baidu" => 0, + "banamex" => 0, + "bananarepublic" => 0, + "band" => 0, + "bank" => 0, + "bar" => 0, + "barcelona" => 0, + "barclaycard" => 0, + "barclays" => 0, + "barefoot" => 0, + "bargains" => 0, + "baseball" => 0, + "basketball" => 0, + "bauhaus" => 0, + "bayern" => 0, + "bbc" => 0, + "bbt" => 0, + "bbva" => 0, + "bcg" => 0, + "bcn" => 0, + "beats" => 0, + "beauty" => 0, + "beer" => 0, + "bentley" => 0, + "berlin" => 0, + "best" => 0, + "bestbuy" => 0, + "bet" => 0, + "bharti" => 0, + "bible" => 0, + "bid" => 0, + "bike" => 0, + "bing" => 0, + "bingo" => 0, + "bio" => 0, + "black" => 0, + "blackfriday" => 0, + "blockbuster" => 0, + "blog" => 0, + "bloomberg" => 0, + "blue" => 0, + "bms" => 0, + "bmw" => 0, + "bnl" => 0, + "bnpparibas" => 0, + "boats" => 0, + "boehringer" => 0, + "bofa" => 0, + "bom" => 0, + "bond" => 0, + "boo" => 0, + "book" => 0, + "booking" => 0, + "bosch" => 0, + "bostik" => 0, + "boston" => 0, + "bot" => 0, + "boutique" => 0, + "box" => 0, + "bradesco" => 0, + "bridgestone" => 0, + "broadway" => 0, + "broker" => 0, + "brother" => 0, + "brussels" => 0, + "budapest" => 0, + "bugatti" => 0, + "build" => 0, + "builders" => 0, + "business" => 0, + "buy" => 0, + "buzz" => 0, + "bzh" => 0, + "cab" => 0, + "cafe" => 0, + "cal" => 0, + "call" => 0, + "calvinklein" => 0, + "cam" => 0, + "camera" => 0, + "camp" => 0, + "cancerresearch" => 0, + "canon" => 0, + "capetown" => 0, + "capital" => 0, + "capitalone" => 0, + "car" => 0, + "caravan" => 0, + "cards" => 0, + "care" => 0, + "career" => 0, + "careers" => 0, + "cars" => 0, + "cartier" => 0, + "casa" => 0, + "case" => 0, + "caseih" => 0, + "cash" => 0, + "casino" => 0, + "catering" => 0, + "catholic" => 0, + "cba" => 0, + "cbn" => 0, + "cbre" => 0, + "cbs" => 0, + "ceb" => 0, + "center" => 0, + "ceo" => 0, + "cern" => 0, + "cfa" => 0, + "cfd" => 0, + "chanel" => 0, + "channel" => 0, + "charity" => 0, + "chase" => 0, + "chat" => 0, + "cheap" => 0, + "chintai" => 0, + "christmas" => 0, + "chrome" => 0, + "chrysler" => 0, + "church" => 0, + "cipriani" => 0, + "circle" => 0, + "cisco" => 0, + "citadel" => 0, + "citi" => 0, + "citic" => 0, + "city" => 0, + "cityeats" => 0, + "claims" => 0, + "cleaning" => 0, + "click" => 0, + "clinic" => 0, + "clinique" => 0, + "clothing" => 0, + "cloud" => 0, + "club" => 0, + "clubmed" => 0, + "coach" => 0, + "codes" => 0, + "coffee" => 0, + "college" => 0, + "cologne" => 0, + "comcast" => 0, + "commbank" => 0, + "community" => 0, + "company" => 0, + "compare" => 0, + "computer" => 0, + "comsec" => 0, + "condos" => 0, + "construction" => 0, + "consulting" => 0, + "contact" => 0, + "contractors" => 0, + "cooking" => 0, + "cookingchannel" => 0, + "cool" => 0, + "corsica" => 0, + "country" => 0, + "coupon" => 0, + "coupons" => 0, + "courses" => 0, + "cpa" => 0, + "credit" => 0, + "creditcard" => 0, + "creditunion" => 0, + "cricket" => 0, + "crown" => 0, + "crs" => 0, + "cruise" => 0, + "cruises" => 0, + "csc" => 0, + "cuisinella" => 0, + "cymru" => 0, + "cyou" => 0, + "dabur" => 0, + "dad" => 0, + "dance" => 0, + "data" => 0, + "date" => 0, + "dating" => 0, + "datsun" => 0, + "day" => 0, + "dclk" => 0, + "dds" => 0, + "deal" => 0, + "dealer" => 0, + "deals" => 0, + "degree" => 0, + "delivery" => 0, + "dell" => 0, + "deloitte" => 0, + "delta" => 0, + "democrat" => 0, + "dental" => 0, + "dentist" => 0, + "desi" => 0, + "design" => 0, + "dev" => 0, + "dhl" => 0, + "diamonds" => 0, + "diet" => 0, + "digital" => 0, + "direct" => 0, + "directory" => 0, + "discount" => 0, + "discover" => 0, + "dish" => 0, + "diy" => 0, + "dnp" => 0, + "docs" => 0, + "doctor" => 0, + "dodge" => 0, + "dog" => 0, + "domains" => 0, + "dot" => 0, + "download" => 0, + "drive" => 0, + "dtv" => 0, + "dubai" => 0, + "duck" => 0, + "dunlop" => 0, + "duns" => 0, + "dupont" => 0, + "durban" => 0, + "dvag" => 0, + "dvr" => 0, + "earth" => 0, + "eat" => 0, + "eco" => 0, + "edeka" => 0, + "education" => 0, + "email" => 0, + "emerck" => 0, + "energy" => 0, + "engineer" => 0, + "engineering" => 0, + "enterprises" => 0, + "epson" => 0, + "equipment" => 0, + "ericsson" => 0, + "erni" => 0, + "esq" => 0, + "estate" => 0, + "esurance" => 0, + "etisalat" => 0, + "eurovision" => 0, + "eus" => 0, + "events" => 0, + "everbank" => 0, + "exchange" => 0, + "expert" => 0, + "exposed" => 0, + "express" => 0, + "extraspace" => 0, + "fage" => 0, + "fail" => 0, + "fairwinds" => 0, + "faith" => 0, + "family" => 0, + "fan" => 0, + "fans" => 0, + "farm" => 0, + "farmers" => 0, + "fashion" => 0, + "fast" => 0, + "fedex" => 0, + "feedback" => 0, + "ferrari" => 0, + "ferrero" => 0, + "fiat" => 0, + "fidelity" => 0, + "fido" => 0, + "film" => 0, + "final" => 0, + "finance" => 0, + "financial" => 0, + "fire" => 0, + "firestone" => 0, + "firmdale" => 0, + "fish" => 0, + "fishing" => 0, + "fit" => 0, + "fitness" => 0, + "flickr" => 0, + "flights" => 0, + "flir" => 0, + "florist" => 0, + "flowers" => 0, + "fly" => 0, + "foo" => 0, + "food" => 0, + "foodnetwork" => 0, + "football" => 0, + "ford" => 0, + "forex" => 0, + "forsale" => 0, + "forum" => 0, + "foundation" => 0, + "fox" => 0, + "free" => 0, + "fresenius" => 0, + "frl" => 0, + "frogans" => 0, + "frontdoor" => 0, + "frontier" => 0, + "ftr" => 0, + "fujitsu" => 0, + "fujixerox" => 0, + "fun" => 0, + "fund" => 0, + "furniture" => 0, + "futbol" => 0, + "fyi" => 0, + "gal" => 0, + "gallery" => 0, + "gallo" => 0, + "gallup" => 0, + "game" => 0, + "games" => 0, + "gap" => 0, + "garden" => 0, + "gay" => 0, + "gbiz" => 0, + "gdn" => 0, + "gea" => 0, + "gent" => 0, + "genting" => 0, + "george" => 0, + "ggee" => 0, + "gift" => 0, + "gifts" => 0, + "gives" => 0, + "giving" => 0, + "glade" => 0, + "glass" => 0, + "gle" => 0, + "global" => 0, + "globo" => 0, + "gmail" => 0, + "gmbh" => 0, + "gmo" => 0, + "gmx" => 0, + "godaddy" => 0, + "gold" => 0, + "goldpoint" => 0, + "golf" => 0, + "goo" => 0, + "goodyear" => 0, + "goog" => 0, + "google" => 0, + "gop" => 0, + "got" => 0, + "grainger" => 0, + "graphics" => 0, + "gratis" => 0, + "green" => 0, + "gripe" => 0, + "grocery" => 0, + "group" => 0, + "guardian" => 0, + "gucci" => 0, + "guge" => 0, + "guide" => 0, + "guitars" => 0, + "guru" => 0, + "hair" => 0, + "hamburg" => 0, + "hangout" => 0, + "haus" => 0, + "hbo" => 0, + "hdfc" => 0, + "hdfcbank" => 0, + "health" => 0, + "healthcare" => 0, + "help" => 0, + "helsinki" => 0, + "here" => 0, + "hermes" => 0, + "hgtv" => 0, + "hiphop" => 0, + "hisamitsu" => 0, + "hitachi" => 0, + "hiv" => 0, + "hkt" => 0, + "hockey" => 0, + "holdings" => 0, + "holiday" => 0, + "homedepot" => 0, + "homegoods" => 0, + "homes" => 0, + "homesense" => 0, + "honda" => 0, + "honeywell" => 0, + "horse" => 0, + "hospital" => 0, + "host" => 0, + "hosting" => 0, + "hot" => 0, + "hoteles" => 0, + "hotels" => 0, + "hotmail" => 0, + "house" => 0, + "how" => 0, + "hsbc" => 0, + "hughes" => 0, + "hyatt" => 0, + "hyundai" => 0, + "ibm" => 0, + "icbc" => 0, + "ice" => 0, + "icu" => 0, + "ieee" => 0, + "ifm" => 0, + "ikano" => 0, + "imamat" => 0, + "imdb" => 0, + "immo" => 0, + "immobilien" => 0, + "inc" => 0, + "industries" => 0, + "infiniti" => 0, + "ing" => 0, + "ink" => 0, + "institute" => 0, + "insurance" => 0, + "insure" => 0, + "intel" => 0, + "international" => 0, + "intuit" => 0, + "investments" => 0, + "ipiranga" => 0, + "irish" => 0, + "iselect" => 0, + "ismaili" => 0, + "ist" => 0, + "istanbul" => 0, + "itau" => 0, + "itv" => 0, + "iveco" => 0, + "jaguar" => 0, + "java" => 0, + "jcb" => 0, + "jcp" => 0, + "jeep" => 0, + "jetzt" => 0, + "jewelry" => 0, + "jio" => 0, + "jll" => 0, + "jmp" => 0, + "jnj" => 0, + "joburg" => 0, + "jot" => 0, + "joy" => 0, + "jpmorgan" => 0, + "jprs" => 0, + "juegos" => 0, + "juniper" => 0, + "kaufen" => 0, + "kddi" => 0, + "kerryhotels" => 0, + "kerrylogistics" => 0, + "kerryproperties" => 0, + "kfh" => 0, + "kia" => 0, + "kim" => 0, + "kinder" => 0, + "kindle" => 0, + "kitchen" => 0, + "kiwi" => 0, + "koeln" => 0, + "komatsu" => 0, + "kosher" => 0, + "kpmg" => 0, + "kpn" => 0, + "krd" => 0, + "kred" => 0, + "kuokgroup" => 0, + "kyoto" => 0, + "lacaixa" => 0, + "ladbrokes" => 0, + "lamborghini" => 0, + "lamer" => 0, + "lancaster" => 0, + "lancia" => 0, + "lancome" => 0, + "land" => 0, + "landrover" => 0, + "lanxess" => 0, + "lasalle" => 0, + "lat" => 0, + "latino" => 0, + "latrobe" => 0, + "law" => 0, + "lawyer" => 0, + "lds" => 0, + "lease" => 0, + "leclerc" => 0, + "lefrak" => 0, + "legal" => 0, + "lego" => 0, + "lexus" => 0, + "lgbt" => 0, + "liaison" => 0, + "lidl" => 0, + "life" => 0, + "lifeinsurance" => 0, + "lifestyle" => 0, + "lighting" => 0, + "like" => 0, + "lilly" => 0, + "limited" => 0, + "limo" => 0, + "lincoln" => 0, + "linde" => 0, + "link" => 0, + "lipsy" => 0, + "live" => 0, + "living" => 0, + "lixil" => 0, + "llc" => 0, + "loan" => 0, + "loans" => 0, + "locker" => 0, + "locus" => 0, + "loft" => 0, + "lol" => 0, + "london" => 0, + "lotte" => 0, + "lotto" => 0, + "love" => 0, + "lpl" => 0, + "lplfinancial" => 0, + "ltd" => 0, + "ltda" => 0, + "lundbeck" => 0, + "lupin" => 0, + "luxe" => 0, + "luxury" => 0, + "macys" => 0, + "madrid" => 0, + "maif" => 0, + "maison" => 0, + "makeup" => 0, + "man" => 0, + "management" => 0, + "mango" => 0, + "map" => 0, + "market" => 0, + "marketing" => 0, + "markets" => 0, + "marriott" => 0, + "marshalls" => 0, + "maserati" => 0, + "mattel" => 0, + "mba" => 0, + "mckinsey" => 0, + "med" => 0, + "media" => 0, + "meet" => 0, + "melbourne" => 0, + "meme" => 0, + "memorial" => 0, + "men" => 0, + "menu" => 0, + "merckmsd" => 0, + "metlife" => 0, + "miami" => 0, + "microsoft" => 0, + "mini" => 0, + "mint" => 0, + "mit" => 0, + "mitsubishi" => 0, + "mlb" => 0, + "mls" => 0, + "mma" => 0, + "mobile" => 0, + "mobily" => 0, + "moda" => 0, + "moe" => 0, + "moi" => 0, + "mom" => 0, + "monash" => 0, + "money" => 0, + "monster" => 0, + "mopar" => 0, + "mormon" => 0, + "mortgage" => 0, + "moscow" => 0, + "moto" => 0, + "motorcycles" => 0, + "mov" => 0, + "movie" => 0, + "movistar" => 0, + "msd" => 0, + "mtn" => 0, + "mtr" => 0, + "mutual" => 0, + "nab" => 0, + "nadex" => 0, + "nagoya" => 0, + "nationwide" => 0, + "natura" => 0, + "navy" => 0, + "nba" => 0, + "nec" => 0, + "netbank" => 0, + "netflix" => 0, + "network" => 0, + "neustar" => 0, + "new" => 0, + "newholland" => 0, + "news" => 0, + "next" => 0, + "nextdirect" => 0, + "nexus" => 0, + "nfl" => 0, + "ngo" => 0, + "nhk" => 0, + "nico" => 0, + "nike" => 0, + "nikon" => 0, + "ninja" => 0, + "nissan" => 0, + "nissay" => 0, + "nokia" => 0, + "northwesternmutual" => 0, + "norton" => 0, + "now" => 0, + "nowruz" => 0, + "nowtv" => 0, + "nra" => 0, + "nrw" => 0, + "ntt" => 0, + "nyc" => 0, + "obi" => 0, + "observer" => 0, + "off" => 0, + "office" => 0, + "okinawa" => 0, + "olayan" => 0, + "olayangroup" => 0, + "oldnavy" => 0, + "ollo" => 0, + "omega" => 0, + "one" => 0, + "ong" => 0, + "onl" => 0, + "online" => 0, + "onyourside" => 0, + "ooo" => 0, + "open" => 0, + "oracle" => 0, + "orange" => 0, + "organic" => 0, + "origins" => 0, + "osaka" => 0, + "otsuka" => 0, + "ott" => 0, + "ovh" => 0, + "page" => 0, + "panasonic" => 0, + "paris" => 0, + "pars" => 0, + "partners" => 0, + "parts" => 0, + "party" => 0, + "passagens" => 0, + "pay" => 0, + "pccw" => 0, + "pet" => 0, + "pfizer" => 0, + "pharmacy" => 0, + "phd" => 0, + "philips" => 0, + "phone" => 0, + "photo" => 0, + "photography" => 0, + "photos" => 0, + "physio" => 0, + "piaget" => 0, + "pics" => 0, + "pictet" => 0, + "pictures" => 0, + "pid" => 0, + "pin" => 0, + "ping" => 0, + "pink" => 0, + "pioneer" => 0, + "pizza" => 0, + "place" => 0, + "play" => 0, + "playstation" => 0, + "plumbing" => 0, + "plus" => 0, + "pnc" => 0, + "pohl" => 0, + "poker" => 0, + "politie" => 0, + "porn" => 0, + "pramerica" => 0, + "praxi" => 0, + "press" => 0, + "prime" => 0, + "prod" => 0, + "productions" => 0, + "prof" => 0, + "progressive" => 0, + "promo" => 0, + "properties" => 0, + "property" => 0, + "protection" => 0, + "pru" => 0, + "prudential" => 0, + "pub" => 0, + "pwc" => 0, + "qpon" => 0, + "quebec" => 0, + "quest" => 0, + "qvc" => 0, + "racing" => 0, + "radio" => 0, + "raid" => 0, + "read" => 0, + "realestate" => 0, + "realtor" => 0, + "realty" => 0, + "recipes" => 0, + "red" => 0, + "redstone" => 0, + "redumbrella" => 0, + "rehab" => 0, + "reise" => 0, + "reisen" => 0, + "reit" => 0, + "reliance" => 0, + "ren" => 0, + "rent" => 0, + "rentals" => 0, + "repair" => 0, + "report" => 0, + "republican" => 0, + "rest" => 0, + "restaurant" => 0, + "review" => 0, + "reviews" => 0, + "rexroth" => 0, + "rich" => 0, + "richardli" => 0, + "ricoh" => 0, + "rightathome" => 0, + "ril" => 0, + "rio" => 0, + "rip" => 0, + "rmit" => 0, + "rocher" => 0, + "rocks" => 0, + "rodeo" => 0, + "rogers" => 0, + "room" => 0, + "rsvp" => 0, + "rugby" => 0, + "ruhr" => 0, + "run" => 0, + "rwe" => 0, + "ryukyu" => 0, + "saarland" => 0, + "safe" => 0, + "safety" => 0, + "sakura" => 0, + "sale" => 0, + "salon" => 0, + "samsclub" => 0, + "samsung" => 0, + "sandvik" => 0, + "sandvikcoromant" => 0, + "sanofi" => 0, + "sap" => 0, + "sarl" => 0, + "sas" => 0, + "save" => 0, + "saxo" => 0, + "sbi" => 0, + "sbs" => 0, + "sca" => 0, + "scb" => 0, + "schaeffler" => 0, + "schmidt" => 0, + "scholarships" => 0, + "school" => 0, + "schule" => 0, + "schwarz" => 0, + "science" => 0, + "scjohnson" => 0, + "scor" => 0, + "scot" => 0, + "search" => 0, + "seat" => 0, + "secure" => 0, + "security" => 0, + "seek" => 0, + "select" => 0, + "sener" => 0, + "services" => 0, + "ses" => 0, + "seven" => 0, + "sew" => 0, + "sex" => 0, + "sexy" => 0, + "sfr" => 0, + "shangrila" => 0, + "sharp" => 0, + "shaw" => 0, + "shell" => 0, + "shia" => 0, + "shiksha" => 0, + "shoes" => 0, + "shop" => 0, + "shopping" => 0, + "shouji" => 0, + "show" => 0, + "showtime" => 0, + "shriram" => 0, + "silk" => 0, + "sina" => 0, + "singles" => 0, + "site" => 0, + "ski" => 0, + "skin" => 0, + "sky" => 0, + "skype" => 0, + "sling" => 0, + "smart" => 0, + "smile" => 0, + "sncf" => 0, + "soccer" => 0, + "social" => 0, + "softbank" => 0, + "software" => 0, + "sohu" => 0, + "solar" => 0, + "solutions" => 0, + "song" => 0, + "sony" => 0, + "soy" => 0, + "space" => 0, + "sport" => 0, + "spot" => 0, + "spreadbetting" => 0, + "srl" => 0, + "srt" => 0, + "stada" => 0, + "staples" => 0, + "star" => 0, + "starhub" => 0, + "statebank" => 0, + "statefarm" => 0, + "stc" => 0, + "stcgroup" => 0, + "stockholm" => 0, + "storage" => 0, + "store" => 0, + "stream" => 0, + "studio" => 0, + "study" => 0, + "style" => 0, + "sucks" => 0, + "supplies" => 0, + "supply" => 0, + "support" => 0, + "surf" => 0, + "surgery" => 0, + "suzuki" => 0, + "swatch" => 0, + "swiftcover" => 0, + "swiss" => 0, + "sydney" => 0, + "symantec" => 0, + "systems" => 0, + "tab" => 0, + "taipei" => 0, + "talk" => 0, + "taobao" => 0, + "target" => 0, + "tatamotors" => 0, + "tatar" => 0, + "tattoo" => 0, + "tax" => 0, + "taxi" => 0, + "tci" => 0, + "tdk" => 0, + "team" => 0, + "tech" => 0, + "technology" => 0, + "telefonica" => 0, + "temasek" => 0, + "tennis" => 0, + "teva" => 0, + "thd" => 0, + "theater" => 0, + "theatre" => 0, + "tiaa" => 0, + "tickets" => 0, + "tienda" => 0, + "tiffany" => 0, + "tips" => 0, + "tires" => 0, + "tirol" => 0, + "tjmaxx" => 0, + "tjx" => 0, + "tkmaxx" => 0, + "tmall" => 0, + "today" => 0, + "tokyo" => 0, + "tools" => 0, + "top" => 0, + "toray" => 0, + "toshiba" => 0, + "total" => 0, + "tours" => 0, + "town" => 0, + "toyota" => 0, + "toys" => 0, + "trade" => 0, + "trading" => 0, + "training" => 0, + "travel" => 0, + "travelchannel" => 0, + "travelers" => 0, + "travelersinsurance" => 0, + "trust" => 0, + "trv" => 0, + "tube" => 0, + "tui" => 0, + "tunes" => 0, + "tushu" => 0, + "tvs" => 0, + "ubank" => 0, + "ubs" => 0, + "uconnect" => 0, + "unicom" => 0, + "university" => 0, + "uno" => 0, + "uol" => 0, + "ups" => 0, + "vacations" => 0, + "vana" => 0, + "vanguard" => 0, + "vegas" => 0, + "ventures" => 0, + "verisign" => 0, + "versicherung" => 0, + "vet" => 0, + "viajes" => 0, + "video" => 0, + "vig" => 0, + "viking" => 0, + "villas" => 0, + "vin" => 0, + "vip" => 0, + "virgin" => 0, + "visa" => 0, + "vision" => 0, + "vistaprint" => 0, + "viva" => 0, + "vivo" => 0, + "vlaanderen" => 0, + "vodka" => 0, + "volkswagen" => 0, + "volvo" => 0, + "vote" => 0, + "voting" => 0, + "voto" => 0, + "voyage" => 0, + "vuelos" => 0, + "wales" => 0, + "walmart" => 0, + "walter" => 0, + "wang" => 0, + "wanggou" => 0, + "warman" => 0, + "watch" => 0, + "watches" => 0, + "weather" => 0, + "weatherchannel" => 0, + "webcam" => 0, + "weber" => 0, + "website" => 0, + "wed" => 0, + "wedding" => 0, + "weibo" => 0, + "weir" => 0, + "whoswho" => 0, + "wien" => 0, + "wiki" => 0, + "williamhill" => 0, + "win" => 0, + "windows" => 0, + "wine" => 0, + "winners" => 0, + "wme" => 0, + "wolterskluwer" => 0, + "woodside" => 0, + "work" => 0, + "works" => 0, + "world" => 0, + "wow" => 0, + "wtc" => 0, + "wtf" => 0, + "xbox" => 0, + "xerox" => 0, + "xfinity" => 0, + "xihuan" => 0, + "xin" => 0, + "xn--11b4c3d" => 0, + "xn--1ck2e1b" => 0, + "xn--1qqw23a" => 0, + "xn--30rr7y" => 0, + "xn--3bst00m" => 0, + "xn--3ds443g" => 0, + "xn--3oq18vl8pn36a" => 0, + "xn--3pxu8k" => 0, + "xn--42c2d9a" => 0, + "xn--45q11c" => 0, + "xn--4gbrim" => 0, + "xn--55qw42g" => 0, + "xn--55qx5d" => 0, + "xn--5su34j936bgsg" => 0, + "xn--5tzm5g" => 0, + "xn--6frz82g" => 0, + "xn--6qq986b3xl" => 0, + "xn--80adxhks" => 0, + "xn--80aqecdr1a" => 0, + "xn--80asehdb" => 0, + "xn--80aswg" => 0, + "xn--8y0a063a" => 0, + "xn--9dbq2a" => 0, + "xn--9et52u" => 0, + "xn--9krt00a" => 0, + "xn--b4w605ferd" => 0, + "xn--bck1b9a5dre4c" => 0, + "xn--c1avg" => 0, + "xn--c2br7g" => 0, + "xn--cck2b3b" => 0, + "xn--cg4bki" => 0, + "xn--czr694b" => 0, + "xn--czrs0t" => 0, + "xn--czru2d" => 0, + "xn--d1acj3b" => 0, + "xn--eckvdtc9d" => 0, + "xn--efvy88h" => 0, + "xn--estv75g" => 0, + "xn--fct429k" => 0, + "xn--fhbei" => 0, + "xn--fiq228c5hs" => 0, + "xn--fiq64b" => 0, + "xn--fjq720a" => 0, + "xn--flw351e" => 0, + "xn--fzys8d69uvgm" => 0, + "xn--g2xx48c" => 0, + "xn--gckr3f0f" => 0, + "xn--gk3at1e" => 0, + "xn--hxt814e" => 0, + "xn--i1b6b1a6a2e" => 0, + "xn--imr513n" => 0, + "xn--io0a7i" => 0, + "xn--j1aef" => 0, + "xn--jlq61u9w7b" => 0, + "xn--jvr189m" => 0, + "xn--kcrx77d1x4a" => 0, + "xn--kpu716f" => 0, + "xn--kput3i" => 0, + "xn--mgba3a3ejt" => 0, + "xn--mgba7c0bbn0a" => 0, + "xn--mgbaakc7dvf" => 0, + "xn--mgbab2bd" => 0, + "xn--mgbb9fbpob" => 0, + "xn--mgbca7dzdo" => 0, + "xn--mgbi4ecexp" => 0, + "xn--mgbt3dhd" => 0, + "xn--mk1bu44c" => 0, + "xn--mxtq1m" => 0, + "xn--ngbc5azd" => 0, + "xn--ngbe9e0a" => 0, + "xn--ngbrx" => 0, + "xn--nqv7f" => 0, + "xn--nqv7fs00ema" => 0, + "xn--nyqy26a" => 0, + "xn--otu796d" => 0, + "xn--p1acf" => 0, + "xn--pbt977c" => 0, + "xn--pssy2u" => 0, + "xn--q9jyb4c" => 0, + "xn--qcka1pmc" => 0, + "xn--rhqv96g" => 0, + "xn--rovu88b" => 0, + "xn--ses554g" => 0, + "xn--t60b56a" => 0, + "xn--tckwe" => 0, + "xn--tiq49xqyj" => 0, + "xn--unup4y" => 0, + "xn--vermgensberater-ctb" => 0, + "xn--vermgensberatung-pwb" => 0, + "xn--vhquv" => 0, + "xn--vuq861b" => 0, + "xn--w4r85el8fhu5dnra" => 0, + "xn--w4rs40l" => 0, + "xn--xhq521b" => 0, + "xn--zfr164b" => 0, + "xyz" => 0, + "yachts" => 0, + "yahoo" => 0, + "yamaxun" => 0, + "yandex" => 0, + "yodobashi" => 0, + "yoga" => 0, + "yokohama" => 0, + "you" => 0, + "youtube" => 0, + "yun" => 0, + "zappos" => 0, + "zara" => 0, + "zero" => 0, + "zip" => 0, + "zone" => 0, + "zuerich" => 0, + "cc.ua" => 0, + "inf.ua" => 0, + "ltd.ua" => 0, + "beep.pl" => 0, + "barsy.ca" => 0, + "compute.estate" => -1, + "alces.network" => -1, + "alwaysdata.net" => 0, + "cloudfront.net" => 0, + "compute.amazonaws.com" => -1, + "compute-1.amazonaws.com" => -1, + "compute.amazonaws.com.cn" => -1, + "us-east-1.amazonaws.com" => 0, + "cn-north-1.eb.amazonaws.com.cn" => 0, + "cn-northwest-1.eb.amazonaws.com.cn" => 0, + "elasticbeanstalk.com" => 0, + "ap-northeast-1.elasticbeanstalk.com" => 0, + "ap-northeast-2.elasticbeanstalk.com" => 0, + "ap-northeast-3.elasticbeanstalk.com" => 0, + "ap-south-1.elasticbeanstalk.com" => 0, + "ap-southeast-1.elasticbeanstalk.com" => 0, + "ap-southeast-2.elasticbeanstalk.com" => 0, + "ca-central-1.elasticbeanstalk.com" => 0, + "eu-central-1.elasticbeanstalk.com" => 0, + "eu-west-1.elasticbeanstalk.com" => 0, + "eu-west-2.elasticbeanstalk.com" => 0, + "eu-west-3.elasticbeanstalk.com" => 0, + "sa-east-1.elasticbeanstalk.com" => 0, + "us-east-1.elasticbeanstalk.com" => 0, + "us-east-2.elasticbeanstalk.com" => 0, + "us-gov-west-1.elasticbeanstalk.com" => 0, + "us-west-1.elasticbeanstalk.com" => 0, + "us-west-2.elasticbeanstalk.com" => 0, + "elb.amazonaws.com" => -1, + "elb.amazonaws.com.cn" => -1, + "s3.amazonaws.com" => 0, + "s3-ap-northeast-1.amazonaws.com" => 0, + "s3-ap-northeast-2.amazonaws.com" => 0, + "s3-ap-south-1.amazonaws.com" => 0, + "s3-ap-southeast-1.amazonaws.com" => 0, + "s3-ap-southeast-2.amazonaws.com" => 0, + "s3-ca-central-1.amazonaws.com" => 0, + "s3-eu-central-1.amazonaws.com" => 0, + "s3-eu-west-1.amazonaws.com" => 0, + "s3-eu-west-2.amazonaws.com" => 0, + "s3-eu-west-3.amazonaws.com" => 0, + "s3-external-1.amazonaws.com" => 0, + "s3-fips-us-gov-west-1.amazonaws.com" => 0, + "s3-sa-east-1.amazonaws.com" => 0, + "s3-us-gov-west-1.amazonaws.com" => 0, + "s3-us-east-2.amazonaws.com" => 0, + "s3-us-west-1.amazonaws.com" => 0, + "s3-us-west-2.amazonaws.com" => 0, + "s3.ap-northeast-2.amazonaws.com" => 0, + "s3.ap-south-1.amazonaws.com" => 0, + "s3.cn-north-1.amazonaws.com.cn" => 0, + "s3.ca-central-1.amazonaws.com" => 0, + "s3.eu-central-1.amazonaws.com" => 0, + "s3.eu-west-2.amazonaws.com" => 0, + "s3.eu-west-3.amazonaws.com" => 0, + "s3.us-east-2.amazonaws.com" => 0, + "s3.dualstack.ap-northeast-1.amazonaws.com" => 0, + "s3.dualstack.ap-northeast-2.amazonaws.com" => 0, + "s3.dualstack.ap-south-1.amazonaws.com" => 0, + "s3.dualstack.ap-southeast-1.amazonaws.com" => 0, + "s3.dualstack.ap-southeast-2.amazonaws.com" => 0, + "s3.dualstack.ca-central-1.amazonaws.com" => 0, + "s3.dualstack.eu-central-1.amazonaws.com" => 0, + "s3.dualstack.eu-west-1.amazonaws.com" => 0, + "s3.dualstack.eu-west-2.amazonaws.com" => 0, + "s3.dualstack.eu-west-3.amazonaws.com" => 0, + "s3.dualstack.sa-east-1.amazonaws.com" => 0, + "s3.dualstack.us-east-1.amazonaws.com" => 0, + "s3.dualstack.us-east-2.amazonaws.com" => 0, + "s3-website-us-east-1.amazonaws.com" => 0, + "s3-website-us-west-1.amazonaws.com" => 0, + "s3-website-us-west-2.amazonaws.com" => 0, + "s3-website-ap-northeast-1.amazonaws.com" => 0, + "s3-website-ap-southeast-1.amazonaws.com" => 0, + "s3-website-ap-southeast-2.amazonaws.com" => 0, + "s3-website-eu-west-1.amazonaws.com" => 0, + "s3-website-sa-east-1.amazonaws.com" => 0, + "s3-website.ap-northeast-2.amazonaws.com" => 0, + "s3-website.ap-south-1.amazonaws.com" => 0, + "s3-website.ca-central-1.amazonaws.com" => 0, + "s3-website.eu-central-1.amazonaws.com" => 0, + "s3-website.eu-west-2.amazonaws.com" => 0, + "s3-website.eu-west-3.amazonaws.com" => 0, + "s3-website.us-east-2.amazonaws.com" => 0, + "t3l3p0rt.net" => 0, + "tele.amune.org" => 0, + "apigee.io" => 0, + "on-aptible.com" => 0, + "user.party.eus" => 0, + "pimienta.org" => 0, + "poivron.org" => 0, + "potager.org" => 0, + "sweetpepper.org" => 0, + "myasustor.com" => 0, + "go-vip.co" => 0, + "go-vip.net" => 0, + "wpcomstaging.com" => 0, + "myfritz.net" => 0, + "awdev.ca" => -1, + "advisor.ws" => -1, + "b-data.io" => 0, + "backplaneapp.io" => 0, + "balena-devices.com" => 0, + "app.banzaicloud.io" => 0, + "betainabox.com" => 0, + "bnr.la" => 0, + "blackbaudcdn.net" => 0, + "boomla.net" => 0, + "boxfuse.io" => 0, + "square7.ch" => 0, + "bplaced.com" => 0, + "bplaced.de" => 0, + "square7.de" => 0, + "bplaced.net" => 0, + "square7.net" => 0, + "browsersafetymark.io" => 0, + "uk0.bigv.io" => 0, + "dh.bytemark.co.uk" => 0, + "vm.bytemark.co.uk" => 0, + "mycd.eu" => 0, + "carrd.co" => 0, + "crd.co" => 0, + "uwu.ai" => 0, + "ae.org" => 0, + "ar.com" => 0, + "br.com" => 0, + "cn.com" => 0, + "com.de" => 0, + "com.se" => 0, + "de.com" => 0, + "eu.com" => 0, + "gb.com" => 0, + "gb.net" => 0, + "hu.com" => 0, + "hu.net" => 0, + "jp.net" => 0, + "jpn.com" => 0, + "kr.com" => 0, + "mex.com" => 0, + "no.com" => 0, + "qc.com" => 0, + "ru.com" => 0, + "sa.com" => 0, + "se.net" => 0, + "uk.com" => 0, + "uk.net" => 0, + "us.com" => 0, + "uy.com" => 0, + "za.bz" => 0, + "za.com" => 0, + "africa.com" => 0, + "gr.com" => 0, + "in.net" => 0, + "us.org" => 0, + "co.com" => 0, + "c.la" => 0, + "certmgr.org" => 0, + "xenapponazure.com" => 0, + "discourse.group" => 0, + "virtueeldomein.nl" => 0, + "cleverapps.io" => 0, + "lcl.dev" => -1, + "stg.dev" => -1, + "c66.me" => 0, + "cloud66.ws" => 0, + "cloud66.zone" => 0, + "jdevcloud.com" => 0, + "wpdevcloud.com" => 0, + "cloudaccess.host" => 0, + "freesite.host" => 0, + "cloudaccess.net" => 0, + "cloudcontrolled.com" => 0, + "cloudcontrolapp.com" => 0, + "cloudera.site" => 0, + "trycloudflare.com" => 0, + "workers.dev" => 0, + "wnext.app" => 0, + "co.ca" => 0, + "otap.co" => -1, + "co.cz" => 0, + "c.cdn77.org" => 0, + "cdn77-ssl.net" => 0, + "r.cdn77.net" => 0, + "rsc.cdn77.org" => 0, + "ssl.origin.cdn77-secure.org" => 0, + "cloudns.asia" => 0, + "cloudns.biz" => 0, + "cloudns.club" => 0, + "cloudns.cc" => 0, + "cloudns.eu" => 0, + "cloudns.in" => 0, + "cloudns.info" => 0, + "cloudns.org" => 0, + "cloudns.pro" => 0, + "cloudns.pw" => 0, + "cloudns.us" => 0, + "cloudeity.net" => 0, + "cnpy.gdn" => 0, + "co.nl" => 0, + "co.no" => 0, + "webhosting.be" => 0, + "hosting-cluster.nl" => 0, + "dyn.cosidns.de" => 0, + "dynamisches-dns.de" => 0, + "dnsupdater.de" => 0, + "internet-dns.de" => 0, + "l-o-g-i-n.de" => 0, + "dynamic-dns.info" => 0, + "feste-ip.net" => 0, + "knx-server.net" => 0, + "static-access.net" => 0, + "realm.cz" => 0, + "cryptonomic.net" => -1, + "cupcake.is" => 0, + "cyon.link" => 0, + "cyon.site" => 0, + "daplie.me" => 0, + "localhost.daplie.me" => 0, + "dattolocal.com" => 0, + "dattorelay.com" => 0, + "dattoweb.com" => 0, + "mydatto.com" => 0, + "dattolocal.net" => 0, + "mydatto.net" => 0, + "biz.dk" => 0, + "co.dk" => 0, + "firm.dk" => 0, + "reg.dk" => 0, + "store.dk" => 0, + "dapps.earth" => -1, + "bzz.dapps.earth" => -1, + "debian.net" => 0, + "dedyn.io" => 0, + "dnshome.de" => 0, + "online.th" => 0, + "shop.th" => 0, + "drayddns.com" => 0, + "dreamhosters.com" => 0, + "mydrobo.com" => 0, + "drud.io" => 0, + "drud.us" => 0, + "duckdns.org" => 0, + "dy.fi" => 0, + "tunk.org" => 0, + "dyndns-at-home.com" => 0, + "dyndns-at-work.com" => 0, + "dyndns-blog.com" => 0, + "dyndns-free.com" => 0, + "dyndns-home.com" => 0, + "dyndns-ip.com" => 0, + "dyndns-mail.com" => 0, + "dyndns-office.com" => 0, + "dyndns-pics.com" => 0, + "dyndns-remote.com" => 0, + "dyndns-server.com" => 0, + "dyndns-web.com" => 0, + "dyndns-wiki.com" => 0, + "dyndns-work.com" => 0, + "dyndns.biz" => 0, + "dyndns.info" => 0, + "dyndns.org" => 0, + "dyndns.tv" => 0, + "at-band-camp.net" => 0, + "ath.cx" => 0, + "barrel-of-knowledge.info" => 0, + "barrell-of-knowledge.info" => 0, + "better-than.tv" => 0, + "blogdns.com" => 0, + "blogdns.net" => 0, + "blogdns.org" => 0, + "blogsite.org" => 0, + "boldlygoingnowhere.org" => 0, + "broke-it.net" => 0, + "buyshouses.net" => 0, + "cechire.com" => 0, + "dnsalias.com" => 0, + "dnsalias.net" => 0, + "dnsalias.org" => 0, + "dnsdojo.com" => 0, + "dnsdojo.net" => 0, + "dnsdojo.org" => 0, + "does-it.net" => 0, + "doesntexist.com" => 0, + "doesntexist.org" => 0, + "dontexist.com" => 0, + "dontexist.net" => 0, + "dontexist.org" => 0, + "doomdns.com" => 0, + "doomdns.org" => 0, + "dvrdns.org" => 0, + "dyn-o-saur.com" => 0, + "dynalias.com" => 0, + "dynalias.net" => 0, + "dynalias.org" => 0, + "dynathome.net" => 0, + "dyndns.ws" => 0, + "endofinternet.net" => 0, + "endofinternet.org" => 0, + "endoftheinternet.org" => 0, + "est-a-la-maison.com" => 0, + "est-a-la-masion.com" => 0, + "est-le-patron.com" => 0, + "est-mon-blogueur.com" => 0, + "for-better.biz" => 0, + "for-more.biz" => 0, + "for-our.info" => 0, + "for-some.biz" => 0, + "for-the.biz" => 0, + "forgot.her.name" => 0, + "forgot.his.name" => 0, + "from-ak.com" => 0, + "from-al.com" => 0, + "from-ar.com" => 0, + "from-az.net" => 0, + "from-ca.com" => 0, + "from-co.net" => 0, + "from-ct.com" => 0, + "from-dc.com" => 0, + "from-de.com" => 0, + "from-fl.com" => 0, + "from-ga.com" => 0, + "from-hi.com" => 0, + "from-ia.com" => 0, + "from-id.com" => 0, + "from-il.com" => 0, + "from-in.com" => 0, + "from-ks.com" => 0, + "from-ky.com" => 0, + "from-la.net" => 0, + "from-ma.com" => 0, + "from-md.com" => 0, + "from-me.org" => 0, + "from-mi.com" => 0, + "from-mn.com" => 0, + "from-mo.com" => 0, + "from-ms.com" => 0, + "from-mt.com" => 0, + "from-nc.com" => 0, + "from-nd.com" => 0, + "from-ne.com" => 0, + "from-nh.com" => 0, + "from-nj.com" => 0, + "from-nm.com" => 0, + "from-nv.com" => 0, + "from-ny.net" => 0, + "from-oh.com" => 0, + "from-ok.com" => 0, + "from-or.com" => 0, + "from-pa.com" => 0, + "from-pr.com" => 0, + "from-ri.com" => 0, + "from-sc.com" => 0, + "from-sd.com" => 0, + "from-tn.com" => 0, + "from-tx.com" => 0, + "from-ut.com" => 0, + "from-va.com" => 0, + "from-vt.com" => 0, + "from-wa.com" => 0, + "from-wi.com" => 0, + "from-wv.com" => 0, + "from-wy.com" => 0, + "ftpaccess.cc" => 0, + "fuettertdasnetz.de" => 0, + "game-host.org" => 0, + "game-server.cc" => 0, + "getmyip.com" => 0, + "gets-it.net" => 0, + "go.dyndns.org" => 0, + "gotdns.com" => 0, + "gotdns.org" => 0, + "groks-the.info" => 0, + "groks-this.info" => 0, + "ham-radio-op.net" => 0, + "here-for-more.info" => 0, + "hobby-site.com" => 0, + "hobby-site.org" => 0, + "home.dyndns.org" => 0, + "homedns.org" => 0, + "homeftp.net" => 0, + "homeftp.org" => 0, + "homeip.net" => 0, + "homelinux.com" => 0, + "homelinux.net" => 0, + "homelinux.org" => 0, + "homeunix.com" => 0, + "homeunix.net" => 0, + "homeunix.org" => 0, + "iamallama.com" => 0, + "in-the-band.net" => 0, + "is-a-anarchist.com" => 0, + "is-a-blogger.com" => 0, + "is-a-bookkeeper.com" => 0, + "is-a-bruinsfan.org" => 0, + "is-a-bulls-fan.com" => 0, + "is-a-candidate.org" => 0, + "is-a-caterer.com" => 0, + "is-a-celticsfan.org" => 0, + "is-a-chef.com" => 0, + "is-a-chef.net" => 0, + "is-a-chef.org" => 0, + "is-a-conservative.com" => 0, + "is-a-cpa.com" => 0, + "is-a-cubicle-slave.com" => 0, + "is-a-democrat.com" => 0, + "is-a-designer.com" => 0, + "is-a-doctor.com" => 0, + "is-a-financialadvisor.com" => 0, + "is-a-geek.com" => 0, + "is-a-geek.net" => 0, + "is-a-geek.org" => 0, + "is-a-green.com" => 0, + "is-a-guru.com" => 0, + "is-a-hard-worker.com" => 0, + "is-a-hunter.com" => 0, + "is-a-knight.org" => 0, + "is-a-landscaper.com" => 0, + "is-a-lawyer.com" => 0, + "is-a-liberal.com" => 0, + "is-a-libertarian.com" => 0, + "is-a-linux-user.org" => 0, + "is-a-llama.com" => 0, + "is-a-musician.com" => 0, + "is-a-nascarfan.com" => 0, + "is-a-nurse.com" => 0, + "is-a-painter.com" => 0, + "is-a-patsfan.org" => 0, + "is-a-personaltrainer.com" => 0, + "is-a-photographer.com" => 0, + "is-a-player.com" => 0, + "is-a-republican.com" => 0, + "is-a-rockstar.com" => 0, + "is-a-socialist.com" => 0, + "is-a-soxfan.org" => 0, + "is-a-student.com" => 0, + "is-a-teacher.com" => 0, + "is-a-techie.com" => 0, + "is-a-therapist.com" => 0, + "is-an-accountant.com" => 0, + "is-an-actor.com" => 0, + "is-an-actress.com" => 0, + "is-an-anarchist.com" => 0, + "is-an-artist.com" => 0, + "is-an-engineer.com" => 0, + "is-an-entertainer.com" => 0, + "is-by.us" => 0, + "is-certified.com" => 0, + "is-found.org" => 0, + "is-gone.com" => 0, + "is-into-anime.com" => 0, + "is-into-cars.com" => 0, + "is-into-cartoons.com" => 0, + "is-into-games.com" => 0, + "is-leet.com" => 0, + "is-lost.org" => 0, + "is-not-certified.com" => 0, + "is-saved.org" => 0, + "is-slick.com" => 0, + "is-uberleet.com" => 0, + "is-very-bad.org" => 0, + "is-very-evil.org" => 0, + "is-very-good.org" => 0, + "is-very-nice.org" => 0, + "is-very-sweet.org" => 0, + "is-with-theband.com" => 0, + "isa-geek.com" => 0, + "isa-geek.net" => 0, + "isa-geek.org" => 0, + "isa-hockeynut.com" => 0, + "issmarterthanyou.com" => 0, + "isteingeek.de" => 0, + "istmein.de" => 0, + "kicks-ass.net" => 0, + "kicks-ass.org" => 0, + "knowsitall.info" => 0, + "land-4-sale.us" => 0, + "lebtimnetz.de" => 0, + "leitungsen.de" => 0, + "likes-pie.com" => 0, + "likescandy.com" => 0, + "merseine.nu" => 0, + "mine.nu" => 0, + "misconfused.org" => 0, + "mypets.ws" => 0, + "myphotos.cc" => 0, + "neat-url.com" => 0, + "office-on-the.net" => 0, + "on-the-web.tv" => 0, + "podzone.net" => 0, + "podzone.org" => 0, + "readmyblog.org" => 0, + "saves-the-whales.com" => 0, + "scrapper-site.net" => 0, + "scrapping.cc" => 0, + "selfip.biz" => 0, + "selfip.com" => 0, + "selfip.info" => 0, + "selfip.net" => 0, + "selfip.org" => 0, + "sells-for-less.com" => 0, + "sells-for-u.com" => 0, + "sells-it.net" => 0, + "sellsyourhome.org" => 0, + "servebbs.com" => 0, + "servebbs.net" => 0, + "servebbs.org" => 0, + "serveftp.net" => 0, + "serveftp.org" => 0, + "servegame.org" => 0, + "shacknet.nu" => 0, + "simple-url.com" => 0, + "space-to-rent.com" => 0, + "stuff-4-sale.org" => 0, + "stuff-4-sale.us" => 0, + "teaches-yoga.com" => 0, + "thruhere.net" => 0, + "traeumtgerade.de" => 0, + "webhop.biz" => 0, + "webhop.info" => 0, + "webhop.net" => 0, + "webhop.org" => 0, + "worse-than.tv" => 0, + "writesthisblog.com" => 0, + "ddnss.de" => 0, + "dyn.ddnss.de" => 0, + "dyndns.ddnss.de" => 0, + "dyndns1.de" => 0, + "dyn-ip24.de" => 0, + "home-webserver.de" => 0, + "dyn.home-webserver.de" => 0, + "myhome-server.de" => 0, + "ddnss.org" => 0, + "definima.net" => 0, + "definima.io" => 0, + "bci.dnstrace.pro" => 0, + "ddnsfree.com" => 0, + "ddnsgeek.com" => 0, + "giize.com" => 0, + "gleeze.com" => 0, + "kozow.com" => 0, + "loseyourip.com" => 0, + "ooguy.com" => 0, + "theworkpc.com" => 0, + "casacam.net" => 0, + "dynu.net" => 0, + "accesscam.org" => 0, + "camdvr.org" => 0, + "freeddns.org" => 0, + "mywire.org" => 0, + "webredirect.org" => 0, + "myddns.rocks" => 0, + "blogsite.xyz" => 0, + "dynv6.net" => 0, + "e4.cz" => 0, + "mytuleap.com" => 0, + "onred.one" => 0, + "staging.onred.one" => 0, + "enonic.io" => 0, + "customer.enonic.io" => 0, + "eu.org" => 0, + "al.eu.org" => 0, + "asso.eu.org" => 0, + "at.eu.org" => 0, + "au.eu.org" => 0, + "be.eu.org" => 0, + "bg.eu.org" => 0, + "ca.eu.org" => 0, + "cd.eu.org" => 0, + "ch.eu.org" => 0, + "cn.eu.org" => 0, + "cy.eu.org" => 0, + "cz.eu.org" => 0, + "de.eu.org" => 0, + "dk.eu.org" => 0, + "edu.eu.org" => 0, + "ee.eu.org" => 0, + "es.eu.org" => 0, + "fi.eu.org" => 0, + "fr.eu.org" => 0, + "gr.eu.org" => 0, + "hr.eu.org" => 0, + "hu.eu.org" => 0, + "ie.eu.org" => 0, + "il.eu.org" => 0, + "in.eu.org" => 0, + "int.eu.org" => 0, + "is.eu.org" => 0, + "it.eu.org" => 0, + "jp.eu.org" => 0, + "kr.eu.org" => 0, + "lt.eu.org" => 0, + "lu.eu.org" => 0, + "lv.eu.org" => 0, + "mc.eu.org" => 0, + "me.eu.org" => 0, + "mk.eu.org" => 0, + "mt.eu.org" => 0, + "my.eu.org" => 0, + "net.eu.org" => 0, + "ng.eu.org" => 0, + "nl.eu.org" => 0, + "no.eu.org" => 0, + "nz.eu.org" => 0, + "paris.eu.org" => 0, + "pl.eu.org" => 0, + "pt.eu.org" => 0, + "q-a.eu.org" => 0, + "ro.eu.org" => 0, + "ru.eu.org" => 0, + "se.eu.org" => 0, + "si.eu.org" => 0, + "sk.eu.org" => 0, + "tr.eu.org" => 0, + "uk.eu.org" => 0, + "us.eu.org" => 0, + "eu-1.evennode.com" => 0, + "eu-2.evennode.com" => 0, + "eu-3.evennode.com" => 0, + "eu-4.evennode.com" => 0, + "us-1.evennode.com" => 0, + "us-2.evennode.com" => 0, + "us-3.evennode.com" => 0, + "us-4.evennode.com" => 0, + "twmail.cc" => 0, + "twmail.net" => 0, + "twmail.org" => 0, + "mymailer.com.tw" => 0, + "url.tw" => 0, + "apps.fbsbx.com" => 0, + "ru.net" => 0, + "adygeya.ru" => 0, + "bashkiria.ru" => 0, + "bir.ru" => 0, + "cbg.ru" => 0, + "com.ru" => 0, + "dagestan.ru" => 0, + "grozny.ru" => 0, + "kalmykia.ru" => 0, + "kustanai.ru" => 0, + "marine.ru" => 0, + "mordovia.ru" => 0, + "msk.ru" => 0, + "mytis.ru" => 0, + "nalchik.ru" => 0, + "nov.ru" => 0, + "pyatigorsk.ru" => 0, + "spb.ru" => 0, + "vladikavkaz.ru" => 0, + "vladimir.ru" => 0, + "abkhazia.su" => 0, + "adygeya.su" => 0, + "aktyubinsk.su" => 0, + "arkhangelsk.su" => 0, + "armenia.su" => 0, + "ashgabad.su" => 0, + "azerbaijan.su" => 0, + "balashov.su" => 0, + "bashkiria.su" => 0, + "bryansk.su" => 0, + "bukhara.su" => 0, + "chimkent.su" => 0, + "dagestan.su" => 0, + "east-kazakhstan.su" => 0, + "exnet.su" => 0, + "georgia.su" => 0, + "grozny.su" => 0, + "ivanovo.su" => 0, + "jambyl.su" => 0, + "kalmykia.su" => 0, + "kaluga.su" => 0, + "karacol.su" => 0, + "karaganda.su" => 0, + "karelia.su" => 0, + "khakassia.su" => 0, + "krasnodar.su" => 0, + "kurgan.su" => 0, + "kustanai.su" => 0, + "lenug.su" => 0, + "mangyshlak.su" => 0, + "mordovia.su" => 0, + "msk.su" => 0, + "murmansk.su" => 0, + "nalchik.su" => 0, + "navoi.su" => 0, + "north-kazakhstan.su" => 0, + "nov.su" => 0, + "obninsk.su" => 0, + "penza.su" => 0, + "pokrovsk.su" => 0, + "sochi.su" => 0, + "spb.su" => 0, + "tashkent.su" => 0, + "termez.su" => 0, + "togliatti.su" => 0, + "troitsk.su" => 0, + "tselinograd.su" => 0, + "tula.su" => 0, + "tuva.su" => 0, + "vladikavkaz.su" => 0, + "vladimir.su" => 0, + "vologda.su" => 0, + "channelsdvr.net" => 0, + "fastly-terrarium.com" => 0, + "fastlylb.net" => 0, + "map.fastlylb.net" => 0, + "freetls.fastly.net" => 0, + "map.fastly.net" => 0, + "a.prod.fastly.net" => 0, + "global.prod.fastly.net" => 0, + "a.ssl.fastly.net" => 0, + "b.ssl.fastly.net" => 0, + "global.ssl.fastly.net" => 0, + "fastpanel.direct" => 0, + "fastvps-server.com" => 0, + "fhapp.xyz" => 0, + "fedorainfracloud.org" => 0, + "fedorapeople.org" => 0, + "cloud.fedoraproject.org" => 0, + "app.os.fedoraproject.org" => 0, + "app.os.stg.fedoraproject.org" => 0, + "mydobiss.com" => 0, + "filegear.me" => 0, + "filegear-au.me" => 0, + "filegear-de.me" => 0, + "filegear-gb.me" => 0, + "filegear-ie.me" => 0, + "filegear-jp.me" => 0, + "filegear-sg.me" => 0, + "firebaseapp.com" => 0, + "flynnhub.com" => 0, + "flynnhosting.net" => 0, + "freebox-os.com" => 0, + "freeboxos.com" => 0, + "fbx-os.fr" => 0, + "fbxos.fr" => 0, + "freebox-os.fr" => 0, + "freeboxos.fr" => 0, + "freedesktop.org" => 0, + "futurecms.at" => -1, + "ex.futurecms.at" => -1, + "in.futurecms.at" => -1, + "futurehosting.at" => 0, + "futuremailing.at" => 0, + "ex.ortsinfo.at" => -1, + "kunden.ortsinfo.at" => -1, + "statics.cloud" => -1, + "service.gov.uk" => 0, + "gehirn.ne.jp" => 0, + "usercontent.jp" => 0, + "lab.ms" => 0, + "github.io" => 0, + "githubusercontent.com" => 0, + "gitlab.io" => 0, + "glitch.me" => 0, + "cloudapps.digital" => 0, + "london.cloudapps.digital" => 0, + "homeoffice.gov.uk" => 0, + "ro.im" => 0, + "shop.ro" => 0, + "goip.de" => 0, + "run.app" => 0, + "a.run.app" => 0, + "web.app" => 0, + "0emm.com" => -1, + "appspot.com" => 0, + "blogspot.ae" => 0, + "blogspot.al" => 0, + "blogspot.am" => 0, + "blogspot.ba" => 0, + "blogspot.be" => 0, + "blogspot.bg" => 0, + "blogspot.bj" => 0, + "blogspot.ca" => 0, + "blogspot.cf" => 0, + "blogspot.ch" => 0, + "blogspot.cl" => 0, + "blogspot.co.at" => 0, + "blogspot.co.id" => 0, + "blogspot.co.il" => 0, + "blogspot.co.ke" => 0, + "blogspot.co.nz" => 0, + "blogspot.co.uk" => 0, + "blogspot.co.za" => 0, + "blogspot.com" => 0, + "blogspot.com.ar" => 0, + "blogspot.com.au" => 0, + "blogspot.com.br" => 0, + "blogspot.com.by" => 0, + "blogspot.com.co" => 0, + "blogspot.com.cy" => 0, + "blogspot.com.ee" => 0, + "blogspot.com.eg" => 0, + "blogspot.com.es" => 0, + "blogspot.com.mt" => 0, + "blogspot.com.ng" => 0, + "blogspot.com.tr" => 0, + "blogspot.com.uy" => 0, + "blogspot.cv" => 0, + "blogspot.cz" => 0, + "blogspot.de" => 0, + "blogspot.dk" => 0, + "blogspot.fi" => 0, + "blogspot.fr" => 0, + "blogspot.gr" => 0, + "blogspot.hk" => 0, + "blogspot.hr" => 0, + "blogspot.hu" => 0, + "blogspot.ie" => 0, + "blogspot.in" => 0, + "blogspot.is" => 0, + "blogspot.it" => 0, + "blogspot.jp" => 0, + "blogspot.kr" => 0, + "blogspot.li" => 0, + "blogspot.lt" => 0, + "blogspot.lu" => 0, + "blogspot.md" => 0, + "blogspot.mk" => 0, + "blogspot.mr" => 0, + "blogspot.mx" => 0, + "blogspot.my" => 0, + "blogspot.nl" => 0, + "blogspot.no" => 0, + "blogspot.pe" => 0, + "blogspot.pt" => 0, + "blogspot.qa" => 0, + "blogspot.re" => 0, + "blogspot.ro" => 0, + "blogspot.rs" => 0, + "blogspot.ru" => 0, + "blogspot.se" => 0, + "blogspot.sg" => 0, + "blogspot.si" => 0, + "blogspot.sk" => 0, + "blogspot.sn" => 0, + "blogspot.td" => 0, + "blogspot.tw" => 0, + "blogspot.ug" => 0, + "blogspot.vn" => 0, + "cloudfunctions.net" => 0, + "cloud.goog" => 0, + "codespot.com" => 0, + "googleapis.com" => 0, + "googlecode.com" => 0, + "pagespeedmobilizer.com" => 0, + "publishproxy.com" => 0, + "withgoogle.com" => 0, + "withyoutube.com" => 0, + "fin.ci" => 0, + "free.hr" => 0, + "caa.li" => 0, + "ua.rs" => 0, + "conf.se" => 0, + "hs.zone" => 0, + "hs.run" => 0, + "hashbang.sh" => 0, + "hasura.app" => 0, + "hasura-app.io" => 0, + "hepforge.org" => 0, + "herokuapp.com" => 0, + "herokussl.com" => 0, + "myravendb.com" => 0, + "ravendb.community" => 0, + "ravendb.me" => 0, + "development.run" => 0, + "ravendb.run" => 0, + "bpl.biz" => 0, + "orx.biz" => 0, + "ng.city" => 0, + "ng.ink" => 0, + "biz.gl" => 0, + "col.ng" => 0, + "gen.ng" => 0, + "ltd.ng" => 0, + "sch.so" => 0, + "xn--hkkinen-5wa.fi" => 0, + "moonscale.io" => -1, + "moonscale.net" => 0, + "iki.fi" => 0, + "dyn-berlin.de" => 0, + "in-berlin.de" => 0, + "in-brb.de" => 0, + "in-butter.de" => 0, + "in-dsl.de" => 0, + "in-dsl.net" => 0, + "in-dsl.org" => 0, + "in-vpn.de" => 0, + "in-vpn.net" => 0, + "in-vpn.org" => 0, + "biz.at" => 0, + "info.at" => 0, + "info.cx" => 0, + "ac.leg.br" => 0, + "al.leg.br" => 0, + "am.leg.br" => 0, + "ap.leg.br" => 0, + "ba.leg.br" => 0, + "ce.leg.br" => 0, + "df.leg.br" => 0, + "es.leg.br" => 0, + "go.leg.br" => 0, + "ma.leg.br" => 0, + "mg.leg.br" => 0, + "ms.leg.br" => 0, + "mt.leg.br" => 0, + "pa.leg.br" => 0, + "pb.leg.br" => 0, + "pe.leg.br" => 0, + "pi.leg.br" => 0, + "pr.leg.br" => 0, + "rj.leg.br" => 0, + "rn.leg.br" => 0, + "ro.leg.br" => 0, + "rr.leg.br" => 0, + "rs.leg.br" => 0, + "sc.leg.br" => 0, + "se.leg.br" => 0, + "sp.leg.br" => 0, + "to.leg.br" => 0, + "pixolino.com" => 0, + "ipifony.net" => 0, + "mein-iserv.de" => 0, + "test-iserv.de" => 0, + "iserv.dev" => 0, + "iobb.net" => 0, + "myjino.ru" => 0, + "hosting.myjino.ru" => -1, + "landing.myjino.ru" => -1, + "spectrum.myjino.ru" => -1, + "vps.myjino.ru" => -1, + "triton.zone" => -1, + "cns.joyent.com" => -1, + "js.org" => 0, + "kaas.gg" => 0, + "khplay.nl" => 0, + "keymachine.de" => 0, + "kinghost.net" => 0, + "uni5.net" => 0, + "knightpoint.systems" => 0, + "co.krd" => 0, + "edu.krd" => 0, + "git-repos.de" => 0, + "lcube-server.de" => 0, + "svn-repos.de" => 0, + "leadpages.co" => 0, + "lpages.co" => 0, + "lpusercontent.com" => 0, + "co.business" => 0, + "co.education" => 0, + "co.events" => 0, + "co.financial" => 0, + "co.network" => 0, + "co.place" => 0, + "co.technology" => 0, + "app.lmpm.com" => 0, + "linkitools.space" => 0, + "linkyard.cloud" => 0, + "linkyard-cloud.ch" => 0, + "members.linode.com" => 0, + "nodebalancer.linode.com" => 0, + "we.bs" => 0, + "loginline.app" => 0, + "loginline.dev" => 0, + "loginline.io" => 0, + "loginline.services" => 0, + "loginline.site" => 0, + "krasnik.pl" => 0, + "leczna.pl" => 0, + "lubartow.pl" => 0, + "lublin.pl" => 0, + "poniatowa.pl" => 0, + "swidnik.pl" => 0, + "uklugs.org" => 0, + "glug.org.uk" => 0, + "lug.org.uk" => 0, + "lugs.org.uk" => 0, + "barsy.bg" => 0, + "barsy.co.uk" => 0, + "barsyonline.co.uk" => 0, + "barsycenter.com" => 0, + "barsyonline.com" => 0, + "barsy.club" => 0, + "barsy.de" => 0, + "barsy.eu" => 0, + "barsy.in" => 0, + "barsy.info" => 0, + "barsy.io" => 0, + "barsy.me" => 0, + "barsy.menu" => 0, + "barsy.mobi" => 0, + "barsy.net" => 0, + "barsy.online" => 0, + "barsy.org" => 0, + "barsy.pro" => 0, + "barsy.pub" => 0, + "barsy.shop" => 0, + "barsy.site" => 0, + "barsy.support" => 0, + "barsy.uk" => 0, + "magentosite.cloud" => -1, + "mayfirst.info" => 0, + "mayfirst.org" => 0, + "hb.cldmail.ru" => 0, + "miniserver.com" => 0, + "memset.net" => 0, + "cloud.metacentrum.cz" => 0, + "custom.metacentrum.cz" => 0, + "flt.cloud.muni.cz" => 0, + "usr.cloud.muni.cz" => 0, + "meteorapp.com" => 0, + "eu.meteorapp.com" => 0, + "co.pl" => 0, + "azurecontainer.io" => 0, + "azurewebsites.net" => 0, + "azure-mobile.net" => 0, + "cloudapp.net" => 0, + "mozilla-iot.org" => 0, + "bmoattachments.org" => 0, + "net.ru" => 0, + "org.ru" => 0, + "pp.ru" => 0, + "ui.nabu.casa" => 0, + "pony.club" => 0, + "of.fashion" => 0, + "on.fashion" => 0, + "of.football" => 0, + "in.london" => 0, + "of.london" => 0, + "for.men" => 0, + "and.mom" => 0, + "for.mom" => 0, + "for.one" => 0, + "for.sale" => 0, + "of.work" => 0, + "to.work" => 0, + "nctu.me" => 0, + "bitballoon.com" => 0, + "netlify.com" => 0, + "4u.com" => 0, + "ngrok.io" => 0, + "nh-serv.co.uk" => 0, + "nfshost.com" => 0, + "dnsking.ch" => 0, + "mypi.co" => 0, + "n4t.co" => 0, + "001www.com" => 0, + "ddnslive.com" => 0, + "myiphost.com" => 0, + "forumz.info" => 0, + "16-b.it" => 0, + "32-b.it" => 0, + "64-b.it" => 0, + "soundcast.me" => 0, + "tcp4.me" => 0, + "dnsup.net" => 0, + "hicam.net" => 0, + "now-dns.net" => 0, + "ownip.net" => 0, + "vpndns.net" => 0, + "dynserv.org" => 0, + "now-dns.org" => 0, + "x443.pw" => 0, + "now-dns.top" => 0, + "ntdll.top" => 0, + "freeddns.us" => 0, + "crafting.xyz" => 0, + "zapto.xyz" => 0, + "nsupdate.info" => 0, + "nerdpol.ovh" => 0, + "blogsyte.com" => 0, + "brasilia.me" => 0, + "cable-modem.org" => 0, + "ciscofreak.com" => 0, + "collegefan.org" => 0, + "couchpotatofries.org" => 0, + "damnserver.com" => 0, + "ddns.me" => 0, + "ditchyourip.com" => 0, + "dnsfor.me" => 0, + "dnsiskinky.com" => 0, + "dvrcam.info" => 0, + "dynns.com" => 0, + "eating-organic.net" => 0, + "fantasyleague.cc" => 0, + "geekgalaxy.com" => 0, + "golffan.us" => 0, + "health-carereform.com" => 0, + "homesecuritymac.com" => 0, + "homesecuritypc.com" => 0, + "hopto.me" => 0, + "ilovecollege.info" => 0, + "loginto.me" => 0, + "mlbfan.org" => 0, + "mmafan.biz" => 0, + "myactivedirectory.com" => 0, + "mydissent.net" => 0, + "myeffect.net" => 0, + "mymediapc.net" => 0, + "mypsx.net" => 0, + "mysecuritycamera.com" => 0, + "mysecuritycamera.net" => 0, + "mysecuritycamera.org" => 0, + "net-freaks.com" => 0, + "nflfan.org" => 0, + "nhlfan.net" => 0, + "no-ip.ca" => 0, + "no-ip.co.uk" => 0, + "no-ip.net" => 0, + "noip.us" => 0, + "onthewifi.com" => 0, + "pgafan.net" => 0, + "point2this.com" => 0, + "pointto.us" => 0, + "privatizehealthinsurance.net" => 0, + "quicksytes.com" => 0, + "read-books.org" => 0, + "securitytactics.com" => 0, + "serveexchange.com" => 0, + "servehumour.com" => 0, + "servep2p.com" => 0, + "servesarcasm.com" => 0, + "stufftoread.com" => 0, + "ufcfan.org" => 0, + "unusualperson.com" => 0, + "workisboring.com" => 0, + "3utilities.com" => 0, + "bounceme.net" => 0, + "ddns.net" => 0, + "ddnsking.com" => 0, + "gotdns.ch" => 0, + "hopto.org" => 0, + "myftp.biz" => 0, + "myftp.org" => 0, + "myvnc.com" => 0, + "no-ip.biz" => 0, + "no-ip.info" => 0, + "no-ip.org" => 0, + "noip.me" => 0, + "redirectme.net" => 0, + "servebeer.com" => 0, + "serveblog.net" => 0, + "servecounterstrike.com" => 0, + "serveftp.com" => 0, + "servegame.com" => 0, + "servehalflife.com" => 0, + "servehttp.com" => 0, + "serveirc.com" => 0, + "serveminecraft.net" => 0, + "servemp3.com" => 0, + "servepics.com" => 0, + "servequake.com" => 0, + "sytes.net" => 0, + "webhop.me" => 0, + "zapto.org" => 0, + "stage.nodeart.io" => 0, + "nodum.co" => 0, + "nodum.io" => 0, + "pcloud.host" => 0, + "nyc.mn" => 0, + "nom.ae" => 0, + "nom.af" => 0, + "nom.ai" => 0, + "nom.al" => 0, + "nym.by" => 0, + "nym.bz" => 0, + "nom.cl" => 0, + "nom.gd" => 0, + "nom.ge" => 0, + "nom.gl" => 0, + "nym.gr" => 0, + "nom.gt" => 0, + "nym.gy" => 0, + "nom.hn" => 0, + "nym.ie" => 0, + "nom.im" => 0, + "nom.ke" => 0, + "nym.kz" => 0, + "nym.la" => 0, + "nym.lc" => 0, + "nom.li" => 0, + "nym.li" => 0, + "nym.lt" => 0, + "nym.lu" => 0, + "nym.me" => 0, + "nom.mk" => 0, + "nym.mn" => 0, + "nym.mx" => 0, + "nom.nu" => 0, + "nym.nz" => 0, + "nym.pe" => 0, + "nym.pt" => 0, + "nom.pw" => 0, + "nom.qa" => 0, + "nym.ro" => 0, + "nom.rs" => 0, + "nom.si" => 0, + "nym.sk" => 0, + "nom.st" => 0, + "nym.su" => 0, + "nym.sx" => 0, + "nom.tj" => 0, + "nym.tw" => 0, + "nom.ug" => 0, + "nom.uy" => 0, + "nom.vc" => 0, + "nom.vg" => 0, + "cya.gg" => 0, + "cloudycluster.net" => 0, + "nid.io" => 0, + "opencraft.hosting" => 0, + "operaunite.com" => 0, + "outsystemscloud.com" => 0, + "ownprovider.com" => 0, + "own.pm" => 0, + "ox.rs" => 0, + "oy.lc" => 0, + "pgfog.com" => 0, + "pagefrontapp.com" => 0, + "art.pl" => 0, + "gliwice.pl" => 0, + "krakow.pl" => 0, + "poznan.pl" => 0, + "wroc.pl" => 0, + "zakopane.pl" => 0, + "pantheonsite.io" => 0, + "gotpantheon.com" => 0, + "mypep.link" => 0, + "on-web.fr" => 0, + "platform.sh" => -1, + "platformsh.site" => -1, + "dyn53.io" => 0, + "co.bn" => 0, + "xen.prgmr.com" => 0, + "priv.at" => 0, + "prvcy.page" => 0, + "dweb.link" => -1, + "protonet.io" => 0, + "chirurgiens-dentistes-en-france.fr" => 0, + "byen.site" => 0, + "pubtls.org" => 0, + "qualifioapp.com" => 0, + "instantcloud.cn" => 0, + "ras.ru" => 0, + "qa2.com" => 0, + "dev-myqnapcloud.com" => 0, + "alpha-myqnapcloud.com" => 0, + "myqnapcloud.com" => 0, + "quipelements.com" => -1, + "vapor.cloud" => 0, + "vaporcloud.io" => 0, + "rackmaze.com" => 0, + "rackmaze.net" => 0, + "on-rancher.cloud" => -1, + "on-rio.io" => -1, + "readthedocs.io" => 0, + "rhcloud.com" => 0, + "app.render.com" => 0, + "onrender.com" => 0, + "repl.co" => 0, + "repl.run" => 0, + "resindevice.io" => 0, + "devices.resinstaging.io" => 0, + "hzc.io" => 0, + "wellbeingzone.eu" => 0, + "ptplus.fit" => 0, + "wellbeingzone.co.uk" => 0, + "git-pages.rit.edu" => 0, + "sandcats.io" => 0, + "logoip.de" => 0, + "logoip.com" => 0, + "schokokeks.net" => 0, + "scrysec.com" => 0, + "firewall-gateway.com" => 0, + "firewall-gateway.de" => 0, + "my-gateway.de" => 0, + "my-router.de" => 0, + "spdns.de" => 0, + "spdns.eu" => 0, + "firewall-gateway.net" => 0, + "my-firewall.org" => 0, + "myfirewall.org" => 0, + "spdns.org" => 0, + "s5y.io" => -1, + "sensiosite.cloud" => -1, + "biz.ua" => 0, + "co.ua" => 0, + "pp.ua" => 0, + "shiftedit.io" => 0, + "myshopblocks.com" => 0, + "shopitsite.com" => 0, + "mo-siemens.io" => 0, + "1kapp.com" => 0, + "appchizi.com" => 0, + "applinzi.com" => 0, + "sinaapp.com" => 0, + "vipsinaapp.com" => 0, + "siteleaf.net" => 0, + "bounty-full.com" => 0, + "alpha.bounty-full.com" => 0, + "beta.bounty-full.com" => 0, + "stackhero-network.com" => 0, + "static.land" => 0, + "dev.static.land" => 0, + "sites.static.land" => 0, + "apps.lair.io" => 0, + "stolos.io" => -1, + "spacekit.io" => 0, + "customer.speedpartner.de" => 0, + "api.stdlib.com" => 0, + "storj.farm" => 0, + "utwente.io" => 0, + "soc.srcf.net" => 0, + "user.srcf.net" => 0, + "temp-dns.com" => 0, + "applicationcloud.io" => 0, + "scapp.io" => 0, + "syncloud.it" => 0, + "diskstation.me" => 0, + "dscloud.biz" => 0, + "dscloud.me" => 0, + "dscloud.mobi" => 0, + "dsmynas.com" => 0, + "dsmynas.net" => 0, + "dsmynas.org" => 0, + "familyds.com" => 0, + "familyds.net" => 0, + "familyds.org" => 0, + "i234.me" => 0, + "myds.me" => 0, + "synology.me" => 0, + "vpnplus.to" => 0, + "taifun-dns.de" => 0, + "gda.pl" => 0, + "gdansk.pl" => 0, + "gdynia.pl" => 0, + "med.pl" => 0, + "sopot.pl" => 0, + "edugit.org" => 0, + "telebit.app" => 0, + "telebit.io" => 0, + "telebit.xyz" => -1, + "gwiddle.co.uk" => 0, + "thingdustdata.com" => 0, + "cust.dev.thingdust.io" => 0, + "cust.disrec.thingdust.io" => 0, + "cust.prod.thingdust.io" => 0, + "cust.testing.thingdust.io" => 0, + "arvo.network" => 0, + "azimuth.network" => 0, + "bloxcms.com" => 0, + "townnews-staging.com" => 0, + "12hp.at" => 0, + "2ix.at" => 0, + "4lima.at" => 0, + "lima-city.at" => 0, + "12hp.ch" => 0, + "2ix.ch" => 0, + "4lima.ch" => 0, + "lima-city.ch" => 0, + "trafficplex.cloud" => 0, + "de.cool" => 0, + "12hp.de" => 0, + "2ix.de" => 0, + "4lima.de" => 0, + "lima-city.de" => 0, + "1337.pictures" => 0, + "clan.rip" => 0, + "lima-city.rocks" => 0, + "webspace.rocks" => 0, + "lima.zone" => 0, + "transurl.be" => -1, + "transurl.eu" => -1, + "transurl.nl" => -1, + "tuxfamily.org" => 0, + "dd-dns.de" => 0, + "diskstation.eu" => 0, + "diskstation.org" => 0, + "dray-dns.de" => 0, + "draydns.de" => 0, + "dyn-vpn.de" => 0, + "dynvpn.de" => 0, + "mein-vigor.de" => 0, + "my-vigor.de" => 0, + "my-wan.de" => 0, + "syno-ds.de" => 0, + "synology-diskstation.de" => 0, + "synology-ds.de" => 0, + "uber.space" => 0, + "uberspace.de" => -1, + "hk.com" => 0, + "hk.org" => 0, + "ltd.hk" => 0, + "inc.hk" => 0, + "virtualuser.de" => 0, + "virtual-user.de" => 0, + "lib.de.us" => 0, + "2038.io" => 0, + "router.management" => 0, + "v-info.info" => 0, + "voorloper.cloud" => 0, + "wafflecell.com" => 0, + "wedeploy.io" => 0, + "wedeploy.me" => 0, + "wedeploy.sh" => 0, + "remotewd.com" => 0, + "wmflabs.org" => 0, + "half.host" => 0, + "xnbay.com" => 0, + "u2.xnbay.com" => 0, + "u2-local.xnbay.com" => 0, + "cistron.nl" => 0, + "demon.nl" => 0, + "xs4all.space" => 0, + "official.academy" => 0, + "yolasite.com" => 0, + "ybo.faith" => 0, + "yombo.me" => 0, + "homelink.one" => 0, + "ybo.party" => 0, + "ybo.review" => 0, + "ybo.science" => 0, + "ybo.trade" => 0, + "nohost.me" => 0, + "noho.st" => 0, + "za.net" => 0, + "za.org" => 0, + "now.sh" => 0, + "bss.design" => 0, + "basicserver.io" => 0, + "virtualserver.io" => 0, + "site.builder.nu" => 0, + "enterprisecloud.nu" => 0, + "zone.id" => 0, + } + + def self.etld_data + ETLD_DATA + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb.erb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb.erb new file mode 100644 index 0000000..c45feb7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb.erb @@ -0,0 +1,11 @@ +class DomainName + ETLD_DATA_DATE = '<%= etld_data_date.utc.strftime('%Y-%m-%dT%H:%M:%SZ') %>' + + ETLD_DATA = { +<% etld_data.each_pair { |key, value| %> <%= key.inspect %> => <%= value.inspect %>, +<% } %> } + + def self.etld_data + ETLD_DATA + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/punycode.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/punycode.rb new file mode 100644 index 0000000..b945a2e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/punycode.rb @@ -0,0 +1,283 @@ +# -*- coding: utf-8 -*- +#-- +# punycode.rb - PunyCode encoder for the Domain Name library +# +# Copyright (C) 2011-2017 Akinori MUSHA, All rights reserved. +# +# Ported from puny.c, a part of VeriSign XCode (encode/decode) IDN +# Library. +# +# Copyright (C) 2000-2002 Verisign Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or +# without modification, are permitted provided that the following +# conditions are met: +# +# 1) Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2) Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3) Neither the name of the VeriSign Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# This software is licensed under the BSD open source license. For more +# information visit www.opensource.org. +# +# Authors: +# John Colosi (VeriSign) +# Srikanth Veeramachaneni (VeriSign) +# Nagesh Chigurupati (Verisign) +# Praveen Srinivasan(Verisign) +#++ + +class DomainName + module Punycode + BASE = 36 + TMIN = 1 + TMAX = 26 + SKEW = 38 + DAMP = 700 + INITIAL_BIAS = 72 + INITIAL_N = 0x80 + DELIMITER = '-'.freeze + + MAXINT = (1 << 32) - 1 + + LOBASE = BASE - TMIN + CUTOFF = LOBASE * TMAX / 2 + + RE_NONBASIC = /[^\x00-\x7f]/ + + # Returns the numeric value of a basic code point (for use in + # representing integers) in the range 0 to base-1, or nil if cp + # is does not represent a value. + DECODE_DIGIT = {}.tap { |map| + # ASCII A..Z map to 0..25 + # ASCII a..z map to 0..25 + (0..25).each { |i| map[65 + i] = map[97 + i] = i } + # ASCII 0..9 map to 26..35 + (26..35).each { |i| map[22 + i] = i } + } + + # Returns the basic code point whose value (when used for + # representing integers) is d, which must be in the range 0 to + # BASE-1. The lowercase form is used unless flag is true, in + # which case the uppercase form is used. The behavior is + # undefined if flag is nonzero and digit d has no uppercase + # form. + ENCODE_DIGIT = proc { |d, flag| + (d + 22 + (d < 26 ? 75 : 0) - (flag ? (1 << 5) : 0)).chr + # 0..25 map to ASCII a..z or A..Z + # 26..35 map to ASCII 0..9 + } + + DOT = '.'.freeze + PREFIX = 'xn--'.freeze + + # Most errors we raise are basically kind of ArgumentError. + class ArgumentError < ::ArgumentError; end + class BufferOverflowError < ArgumentError; end + + class << self + # Encode a +string+ in Punycode + def encode(string) + input = string.unpack('U*') + output = '' + + # Initialize the state + n = INITIAL_N + delta = 0 + bias = INITIAL_BIAS + + # Handle the basic code points + input.each { |cp| output << cp.chr if cp < 0x80 } + + h = b = output.length + + # h is the number of code points that have been handled, b is the + # number of basic code points, and out is the number of characters + # that have been output. + + output << DELIMITER if b > 0 + + # Main encoding loop + + while h < input.length + # All non-basic code points < n have been handled already. Find + # the next larger one + + m = MAXINT + input.each { |cp| + m = cp if (n...m) === cp + } + + # Increase delta enough to advance the decoder's state to + # , but guard against overflow + + delta += (m - n) * (h + 1) + raise BufferOverflowError if delta > MAXINT + n = m + + input.each { |cp| + # AMC-ACE-Z can use this simplified version instead + if cp < n + delta += 1 + raise BufferOverflowError if delta > MAXINT + elsif cp == n + # Represent delta as a generalized variable-length integer + q = delta + k = BASE + loop { + t = k <= bias ? TMIN : k - bias >= TMAX ? TMAX : k - bias + break if q < t + q, r = (q - t).divmod(BASE - t) + output << ENCODE_DIGIT[t + r, false] + k += BASE + } + + output << ENCODE_DIGIT[q, false] + + # Adapt the bias + delta = h == b ? delta / DAMP : delta >> 1 + delta += delta / (h + 1) + bias = 0 + while delta > CUTOFF + delta /= LOBASE + bias += BASE + end + bias += (LOBASE + 1) * delta / (delta + SKEW) + + delta = 0 + h += 1 + end + } + + delta += 1 + n += 1 + end + + output + end + + # Encode a hostname using IDN/Punycode algorithms + def encode_hostname(hostname) + hostname.match(RE_NONBASIC) or return hostname + + hostname.split(DOT).map { |name| + if name.match(RE_NONBASIC) + PREFIX + encode(name) + else + name + end + }.join(DOT) + end + + # Decode a +string+ encoded in Punycode + def decode(string) + # Initialize the state + n = INITIAL_N + i = 0 + bias = INITIAL_BIAS + + if j = string.rindex(DELIMITER) + b = string[0...j] + + b.match(RE_NONBASIC) and + raise ArgumentError, "Illegal character is found in basic part: #{string.inspect}" + + # Handle the basic code points + + output = b.unpack('U*') + u = string[(j + 1)..-1] + else + output = [] + u = string + end + + # Main decoding loop: Start just after the last delimiter if any + # basic code points were copied; start at the beginning + # otherwise. + + input = u.unpack('C*') + input_length = input.length + h = 0 + out = output.length + + while h < input_length + # Decode a generalized variable-length integer into delta, + # which gets added to i. The overflow checking is easier + # if we increase i as we go, then subtract off its starting + # value at the end to obtain delta. + + oldi = i + w = 1 + k = BASE + + loop { + digit = DECODE_DIGIT[input[h]] or + raise ArgumentError, "Illegal character is found in non-basic part: #{string.inspect}" + h += 1 + i += digit * w + raise BufferOverflowError if i > MAXINT + t = k <= bias ? TMIN : k - bias >= TMAX ? TMAX : k - bias + break if digit < t + w *= BASE - t + raise BufferOverflowError if w > MAXINT + k += BASE + h < input_length or raise ArgumentError, "Malformed input given: #{string.inspect}" + } + + # Adapt the bias + delta = oldi == 0 ? i / DAMP : (i - oldi) >> 1 + delta += delta / (out + 1) + bias = 0 + while delta > CUTOFF + delta /= LOBASE + bias += BASE + end + bias += (LOBASE + 1) * delta / (delta + SKEW) + + # i was supposed to wrap around from out+1 to 0, incrementing + # n each time, so we'll fix that now: + + q, i = i.divmod(out + 1) + n += q + raise BufferOverflowError if n > MAXINT + + # Insert n at position i of the output: + + output[i, 0] = n + + out += 1 + i += 1 + end + output.pack('U*') + end + + # Decode a hostname using IDN/Punycode algorithms + def decode_hostname(hostname) + hostname.gsub(/(\A|#{Regexp.quote(DOT)})#{Regexp.quote(PREFIX)}([^#{Regexp.quote(DOT)}]*)/o) { + $1 << decode($2) + } + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/version.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/version.rb new file mode 100644 index 0000000..c37552f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/lib/domain_name/version.rb @@ -0,0 +1,3 @@ +class DomainName + VERSION = '0.5.20190701' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/helper.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/helper.rb new file mode 100644 index 0000000..beb8025 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/helper.rb @@ -0,0 +1,17 @@ +require 'rubygems' +require 'bundler' +begin + Bundler.setup(:default, :development) +rescue Bundler::BundlerError => e + $stderr.puts e.message + $stderr.puts "Run `bundle install` to install missing gems" + exit e.status_code +end +require 'test/unit' + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +$LOAD_PATH.unshift(File.dirname(__FILE__)) +require 'domain_name' + +class Test::Unit::TestCase +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name-punycode.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name-punycode.rb new file mode 100644 index 0000000..5e601f2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name-punycode.rb @@ -0,0 +1,97 @@ +require 'helper' + +class TestDomainName < Test::Unit::TestCase + test "encode labels just as listed in RFC 3492 #7.1 (slightly modified)" do + [ + ['(A) Arabic (Egyptian)', + [0x0644, 0x064A, 0x0647, 0x0645, 0x0627, 0x0628, 0x062A, 0x0643, 0x0644, + 0x0645, 0x0648, 0x0634, 0x0639, 0x0631, 0x0628, 0x064A, 0x061F], + 'egbpdaj6bu4bxfgehfvwxn'], + ['(B) Chinese (simplified)', + [0x4ED6, 0x4EEC, 0x4E3A, 0x4EC0, 0x4E48, 0x4E0D, 0x8BF4, 0x4E2D, 0x6587], + 'ihqwcrb4cv8a8dqg056pqjye'], + ['(C) Chinese (traditional)', + [0x4ED6, 0x5011, 0x7232, 0x4EC0, 0x9EBD, 0x4E0D, 0x8AAA, 0x4E2D, 0x6587], + 'ihqwctvzc91f659drss3x8bo0yb'], + ['(D) Czech: Proprostnemluvesky', + [0x0050, 0x0072, 0x006F, 0x010D, 0x0070, 0x0072, 0x006F, 0x0073, 0x0074, + 0x011B, 0x006E, 0x0065, 0x006D, 0x006C, 0x0075, 0x0076, 0x00ED, 0x010D, + 0x0065, 0x0073, 0x006B, 0x0079], + 'Proprostnemluvesky-uyb24dma41a'], + ['(E) Hebrew', + [0x05DC, 0x05DE, 0x05D4, 0x05D4, 0x05DD, 0x05E4, 0x05E9, 0x05D5, 0x05D8, + 0x05DC, 0x05D0, 0x05DE, 0x05D3, 0x05D1, 0x05E8, 0x05D9, 0x05DD, 0x05E2, + 0x05D1, 0x05E8, 0x05D9, 0x05EA], + '4dbcagdahymbxekheh6e0a7fei0b'], + ['(F) Hindi (Devanagari)', + [0x092F, 0x0939, 0x0932, 0x094B, 0x0917, 0x0939, 0x093F, 0x0928, 0x094D, + 0x0926, 0x0940, 0x0915, 0x094D, 0x092F, 0x094B, 0x0902, 0x0928, 0x0939, + 0x0940, 0x0902, 0x092C, 0x094B, 0x0932, 0x0938, 0x0915, 0x0924, 0x0947, + 0x0939, 0x0948, 0x0902], + 'i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd'], + ['(G) Japanese (kanji and hiragana)', + [0x306A, 0x305C, 0x307F, 0x3093, 0x306A, 0x65E5, 0x672C, 0x8A9E, 0x3092, + 0x8A71, 0x3057, 0x3066, 0x304F, 0x308C, 0x306A, 0x3044, 0x306E, 0x304B], + 'n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa'], + ['(H) Korean (Hangul syllables)', + [0xC138, 0xACC4, 0xC758, 0xBAA8, 0xB4E0, 0xC0AC, 0xB78C, 0xB4E4, 0xC774, + 0xD55C, 0xAD6D, 0xC5B4, 0xB97C, 0xC774, 0xD574, 0xD55C, 0xB2E4, 0xBA74, + 0xC5BC, 0xB9C8, 0xB098, 0xC88B, 0xC744, 0xAE4C], + '989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5j' << + 'psd879ccm6fea98c'], + ['(I) Russian (Cyrillic)', + [0x043F, 0x043E, 0x0447, 0x0435, 0x043C, 0x0443, 0x0436, 0x0435, 0x043E, + 0x043D, 0x0438, 0x043D, 0x0435, 0x0433, 0x043E, 0x0432, 0x043E, 0x0440, + 0x044F, 0x0442, 0x043F, 0x043E, 0x0440, 0x0443, 0x0441, 0x0441, 0x043A, + 0x0438], + 'b1abfaaepdrnnbgefbadotcwatmq2g4l'], + ['(J) Spanish: PorqunopuedensimplementehablarenEspaol', + [0x0050, 0x006F, 0x0072, 0x0071, 0x0075, 0x00E9, 0x006E, 0x006F, 0x0070, + 0x0075, 0x0065, 0x0064, 0x0065, 0x006E, 0x0073, 0x0069, 0x006D, 0x0070, + 0x006C, 0x0065, 0x006D, 0x0065, 0x006E, 0x0074, 0x0065, 0x0068, 0x0061, + 0x0062, 0x006C, 0x0061, 0x0072, 0x0065, 0x006E, 0x0045, 0x0073, 0x0070, + 0x0061, 0x00F1, 0x006F, 0x006C], + 'PorqunopuedensimplementehablarenEspaol-fmd56a'], + ['(K) Vietnamese: Tisaohkhngthch' << + 'nitingVit', + [0x0054, 0x1EA1, 0x0069, 0x0073, 0x0061, 0x006F, 0x0068, 0x1ECD, 0x006B, + 0x0068, 0x00F4, 0x006E, 0x0067, 0x0074, 0x0068, 0x1EC3, 0x0063, 0x0068, + 0x1EC9, 0x006E, 0x00F3, 0x0069, 0x0074, 0x0069, 0x1EBF, 0x006E, 0x0067, + 0x0056, 0x0069, 0x1EC7, 0x0074], + 'TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g'], + ['(L) 3B', + [0x0033, 0x5E74, 0x0042, 0x7D44, 0x91D1, 0x516B, 0x5148, 0x751F], + '3B-ww4c5e180e575a65lsy2b'], + ['(M) -with-SUPER-MONKEYS', + [0x5B89, 0x5BA4, 0x5948, 0x7F8E, 0x6075, 0x002D, 0x0077, 0x0069, 0x0074, + 0x0068, 0x002D, 0x0053, 0x0055, 0x0050, 0x0045, 0x0052, 0x002D, 0x004D, + 0x004F, 0x004E, 0x004B, 0x0045, 0x0059, 0x0053], + '-with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n'], + ['(N) Hello-Another-Way-', + [0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x002D, 0x0041, 0x006E, 0x006F, + 0x0074, 0x0068, 0x0065, 0x0072, 0x002D, 0x0057, 0x0061, 0x0079, 0x002D, + 0x305D, 0x308C, 0x305E, 0x308C, 0x306E, 0x5834, 0x6240], + 'Hello-Another-Way--fc4qua05auwb3674vfr0b'], + ['(O) 2', + [0x3072, 0x3068, 0x3064, 0x5C4B, 0x6839, 0x306E, 0x4E0B, 0x0032], + '2-u9tlzr9756bt3uc0v'], + ['(P) MajiKoi5', + [0x004D, 0x0061, 0x006A, 0x0069, 0x3067, 0x004B, 0x006F, 0x0069, 0x3059, + 0x308B, 0x0035, 0x79D2, 0x524D], + 'MajiKoi5-783gue6qz075azm5e'], + ['(Q) de', + [0x30D1, 0x30D5, 0x30A3, 0x30FC, 0x0064, 0x0065, 0x30EB, 0x30F3, 0x30D0], + 'de-jg4avhby1noc0d'], + ['(R) ', + [0x305D, 0x306E, 0x30B9, 0x30D4, 0x30FC, 0x30C9, 0x3067], + 'd9juau41awczczp'], + ['(S) -> $1.00 <-', + [0x002D, 0x003E, 0x0020, 0x0024, 0x0031, 0x002E, 0x0030, 0x0030, 0x0020, + 0x003C, 0x002D], + '-> $1.00 <--'] + ].each { |title, cps, punycode| + assert_equal punycode, DomainName::Punycode.encode(cps.pack('U*')), title + assert_equal cps.pack('U*').to_nfc, DomainName::Punycode.decode(punycode), title + } + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name.rb new file mode 100644 index 0000000..86696cc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/test/test_domain_name.rb @@ -0,0 +1,317 @@ +# -*- coding: utf-8 -*- +require 'helper' +require 'ipaddr' + +class TestDomainName < Test::Unit::TestCase + test "raise ArgumentError if hostname starts with a dot" do + [ + # Leading dot. + '.com', + '.example', + '.example.com', + '.example.example', + ].each { |hostname| + assert_raises(ArgumentError) { DomainName.new(hostname) } + } + end + + test "accept a String-alike for initialization" do + Object.new.tap { |obj| + def obj.to_str + "Example.org" + end + assert_equal "example.org", DomainName.new(obj).hostname + } + + Object.new.tap { |obj| + def obj.to_str + 123 + end + assert_raises(TypeError) { DomainName.new(obj) } + } + + Object.new.tap { |obj| + assert_raises(TypeError) { DomainName.new(obj) } + } + end + + test "parse canonical domain names correctly" do + [ + # Mixed case. + ['COM', nil, false, 'com', true], + ['example.COM', 'example.com', true, 'com', true], + ['WwW.example.COM', 'example.com', true, 'com', true], + # Unlisted TLD. + ['example', 'example', false, 'example', false], + ['example.example', 'example.example', false, 'example', false], + ['b.example.example', 'example.example', false, 'example', false], + ['a.b.example.example', 'example.example', false, 'example', false], + # Listed, but non-Internet, TLD. + ['local', 'local', false, 'local', false], + ['example.local', 'example.local', false, 'local', false], + ['b.example.local', 'example.local', false, 'local', false], + ['a.b.example.local', 'example.local', false, 'local', false], + # TLD with only 1 rule. + ['biz', nil, false, 'biz', true], + ['domain.biz', 'domain.biz', true, 'biz', true], + ['b.domain.biz', 'domain.biz', true, 'biz', true], + ['a.b.domain.biz', 'domain.biz', true, 'biz', true], + # TLD with some 2-level rules. + ['com', nil, false, 'com', true], + ['example.com', 'example.com', true, 'com', true], + ['b.example.com', 'example.com', true, 'com', true], + ['a.b.example.com', 'example.com', true, 'com', true], + ['uk.com', nil, false, 'com', true], + ['example.uk.com', 'example.uk.com', true, 'com', true], + ['b.example.uk.com', 'example.uk.com', true, 'com', true], + ['a.b.example.uk.com', 'example.uk.com', true, 'com', true], + ['test.ac', 'test.ac', true, 'ac', true], + # TLD with only 1 (wildcard) rule. + ['bd', nil, false, 'bd', true], + ['c.bd', nil, false, 'bd', true], + ['b.c.bd', 'b.c.bd', true, 'bd', true], + ['a.b.c.bd', 'b.c.bd', true, 'bd', true], + # More complex TLD. + ['jp', nil, false, 'jp', true], + ['test.jp', 'test.jp', true, 'jp', true], + ['www.test.jp', 'test.jp', true, 'jp', true], + ['ac.jp', nil, false, 'jp', true], + ['test.ac.jp', 'test.ac.jp', true, 'jp', true], + ['www.test.ac.jp', 'test.ac.jp', true, 'jp', true], + ['kyoto.jp', nil, false, 'jp', true], + ['test.kyoto.jp', 'test.kyoto.jp', true, 'jp', true], + ['ide.kyoto.jp', nil, false, 'jp', true], + ['b.ide.kyoto.jp', 'b.ide.kyoto.jp', true, 'jp', true], + ['a.b.ide.kyoto.jp', 'b.ide.kyoto.jp', true, 'jp', true], + ['c.kobe.jp', nil, false, 'jp', true], + ['b.c.kobe.jp', 'b.c.kobe.jp', true, 'jp', true], + ['a.b.c.kobe.jp', 'b.c.kobe.jp', true, 'jp', true], + ['city.kobe.jp', 'city.kobe.jp', true, 'jp', true], + ['www.city.kobe.jp', 'city.kobe.jp', true, 'jp', true], + # TLD with a wildcard rule and exceptions. + ['ck', nil, false, 'ck', true], + ['test.ck', nil, false, 'ck', true], + ['b.test.ck', 'b.test.ck', true, 'ck', true], + ['a.b.test.ck', 'b.test.ck', true, 'ck', true], + ['www.ck', 'www.ck', true, 'ck', true], + ['www.www.ck', 'www.ck', true, 'ck', true], + # US K12. + ['us', nil, false, 'us', true], + ['test.us', 'test.us', true, 'us', true], + ['www.test.us', 'test.us', true, 'us', true], + ['ak.us', nil, false, 'us', true], + ['test.ak.us', 'test.ak.us', true, 'us', true], + ['www.test.ak.us', 'test.ak.us', true, 'us', true], + ['k12.ak.us', nil, false, 'us', true], + ['test.k12.ak.us', 'test.k12.ak.us', true, 'us', true], + ['www.test.k12.ak.us', 'test.k12.ak.us', true, 'us', true], + # IDN labels. (modified; currently DomainName always converts U-labels to A-labels) + ['食狮.com.cn', 'xn--85x722f.com.cn', true, 'cn', true], + ['食狮.公司.cn', 'xn--85x722f.xn--55qx5d.cn', true, 'cn', true], + ['www.食狮.公司.cn', 'xn--85x722f.xn--55qx5d.cn', true, 'cn', true], + ['shishi.公司.cn', 'shishi.xn--55qx5d.cn', true, 'cn', true], + ['公司.cn', nil, false, 'cn', true], + ['食狮.中国', 'xn--85x722f.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['www.食狮.中国', 'xn--85x722f.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['shishi.中国', 'shishi.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['中国', nil, false, 'xn--fiqs8s', true], + # Same as above, but punycoded. + ['xn--85x722f.com.cn', 'xn--85x722f.com.cn', true, 'cn', true], + ['xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn', true, 'cn', true], + ['www.xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn', true, 'cn', true], + ['shishi.xn--55qx5d.cn', 'shishi.xn--55qx5d.cn', true, 'cn', true], + ['xn--55qx5d.cn', nil, false, 'cn', true], + ['xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['www.xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['shishi.xn--fiqs8s', 'shishi.xn--fiqs8s', true, 'xn--fiqs8s', true], + ['xn--fiqs8s', nil, false, 'xn--fiqs8s', true], + ].each { |hostname, domain, canonical, tld, canonical_tld| + dn = DomainName.new(hostname) + assert_equal(domain, dn.domain, hostname + ':domain') + assert_equal(canonical, dn.canonical?, hostname + ':canoninal?') + assert_equal(tld, dn.tld, hostname + ':tld') + assert_equal(canonical_tld, dn.canonical_tld?, hostname + ':canoninal_tld?') + } + end + + test "compare hostnames correctly" do + [ + ["foo.com", "abc.foo.com", 1], + ["COM", "abc.foo.com", 1], + ["abc.def.foo.com", "foo.com", -1], + ["abc.def.foo.com", "ABC.def.FOO.com", 0], + ["abc.def.foo.com", "bar.com", nil], + ].each { |x, y, v| + dx, dy = DomainName(x), DomainName(y) + [ + [dx, y, v], + [dx, dy, v], + [dy, x, v ? -v : v], + [dy, dx, v ? -v : v], + ].each { |a, b, expected| + assert_equal expected, a <=> b + case expected + when 1 + assert_equal(true, a > b) + assert_equal(true, a >= b) + assert_equal(false, a == b) + assert_equal(false, a <= b) + assert_equal(false, a < b) + when -1 + assert_equal(true, a < b) + assert_equal(true, a <= b) + assert_equal(false, a == b) + assert_equal(false, a >= b) + assert_equal(false, a > b) + when 0 + assert_equal(false, a < b) + assert_equal(true, a <= b) + assert_equal(true, a == b) + assert_equal(true, a >= b) + assert_equal(false, a > b) + when nil + assert_equal(nil, a < b) + assert_equal(nil, a <= b) + assert_equal(false, a == b) + assert_equal(nil, a >= b) + assert_equal(nil, a > b) + end + } + } + end + + test "check cookie domain correctly" do + { + 'com' => [ + ['com', false], + ['example.com', false], + ['foo.example.com', false], + ['bar.foo.example.com', false], + ], + + 'example.com' => [ + ['com', false], + ['example.com', true], + ['foo.example.com', false], + ['bar.foo.example.com', false], + ], + + 'foo.example.com' => [ + ['com', false], + ['example.com', true], + ['foo.example.com', true], + ['foo.Example.com', true], + ['bar.foo.example.com', false], + ['bar.Foo.Example.com', false], + ], + + 'b.sapporo.jp' => [ + ['jp', false], + ['sapporo.jp', false], + ['b.sapporo.jp', false], + ['a.b.sapporo.jp', false], + ], + + 'b.c.sapporo.jp' => [ + ['jp', false], + ['sapporo.jp', false], + ['c.sapporo.jp', false], + ['b.c.sapporo.jp', true], + ['a.b.c.sapporo.jp', false], + ], + + 'b.c.d.sapporo.jp' => [ + ['jp', false], + ['sapporo.jp', false], + ['d.sapporo.jp', false], + ['c.d.sapporo.jp', true], + ['b.c.d.sapporo.jp', true], + ['a.b.c.d.sapporo.jp', false], + ], + + 'city.sapporo.jp' => [ + ['jp', false], + ['sapporo.jp', false], + ['city.sapporo.jp', true], + ['a.city.sapporo.jp', false], + ], + + 'b.city.sapporo.jp' => [ + ['jp', false], + ['sapporo.jp', false], + ['city.sapporo.jp', true], + ['b.city.sapporo.jp', true], + ['a.b.city.sapporo.jp', false], + ], + }.each_pair { |host, pairs| + dn = DomainName(host) + assert_equal(true, dn.cookie_domain?(host.upcase, true), dn.to_s) + assert_equal(true, dn.cookie_domain?(host.downcase, true), dn.to_s) + assert_equal(false, dn.cookie_domain?("www." << host, true), dn.to_s) + pairs.each { |domain, expected| + assert_equal(expected, dn.cookie_domain?(domain), "%s - %s" % [dn.to_s, domain]) + assert_equal(expected, dn.cookie_domain?(DomainName(domain)), "%s - %s" % [dn.to_s, domain]) + } + } + end + + test "parse IPv4 addresseses" do + a = '192.168.10.20' + dn = DomainName(a) + assert_equal(a, dn.hostname) + assert_equal(true, dn.ipaddr?) + assert_equal(IPAddr.new(a), dn.ipaddr) + assert_equal(true, dn.cookie_domain?(a)) + assert_equal(true, dn.cookie_domain?(a, true)) + assert_equal(true, dn.cookie_domain?(dn)) + assert_equal(true, dn.cookie_domain?(dn, true)) + assert_equal(false, dn.cookie_domain?('168.10.20')) + assert_equal(false, dn.cookie_domain?('20')) + assert_equal(nil, dn.superdomain) + end + + test "parse IPv6 addresseses" do + a = '2001:200:dff:fff1:216:3eff:feb1:44d7' + b = '2001:0200:0dff:fff1:0216:3eff:feb1:44d7' + [b, b.upcase, "[#{b}]", "[#{b.upcase}]"].each { |host| + dn = DomainName(host) + assert_equal("[#{a}]", dn.uri_host) + assert_equal(a, dn.hostname) + assert_equal(true, dn.ipaddr?) + assert_equal(IPAddr.new(a), dn.ipaddr) + assert_equal(true, dn.cookie_domain?(host)) + assert_equal(true, dn.cookie_domain?(host, true)) + assert_equal(true, dn.cookie_domain?(dn)) + assert_equal(true, dn.cookie_domain?(dn, true)) + assert_equal(true, dn.cookie_domain?(a)) + assert_equal(true, dn.cookie_domain?(a, true)) + assert_equal(nil, dn.superdomain) + } + end + + test "get superdomain" do + [ + %w[www.sub.example.local sub.example.local example.local local], + %w[www.sub.example.com sub.example.com example.com com], + ].each { |domain, *superdomains| + dn = DomainName(domain) + superdomains.each { |superdomain| + sdn = DomainName(superdomain) + assert_equal sdn, dn.superdomain + dn = sdn + } + assert_equal nil, dn.superdomain + } + end + + test "have idn methods" do + dn = DomainName("金八先生.B組.3年.日本語ドメイン名Example.日本") + + assert_equal "xn--44q1cv48kq8x.xn--b-gf6c.xn--3-pj3b.xn--example-6q4fyliikhk162btq3b2zd4y2o.xn--wgv71a", dn.hostname + assert_equal "金八先生.b組.3年.日本語ドメイン名example.日本", dn.hostname_idn + assert_equal "xn--example-6q4fyliikhk162btq3b2zd4y2o.xn--wgv71a", dn.domain + assert_equal "日本語ドメイン名example.日本", dn.domain_idn + assert_equal "xn--wgv71a", dn.tld + assert_equal "日本", dn.tld_idn + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/tool/gen_etld_data.rb b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/tool/gen_etld_data.rb new file mode 100755 index 0000000..4340c8e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/domain_name-0.5.20190701/tool/gen_etld_data.rb @@ -0,0 +1,63 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'pathname' +$basedir = Pathname.new(__FILE__).dirname.parent +$LOAD_PATH.unshift $basedir + 'lib' +require 'domain_name' +require 'set' +require 'erb' + +def main + dat_file = $basedir + 'data' + 'public_suffix_list.dat' + dir = $basedir + 'lib' + 'domain_name' + erb_file = dir + 'etld_data.rb.erb' + rb_file = dir + 'etld_data.rb' + + etld_data_date = File.mtime(dat_file) + + File.open(dat_file, 'r:utf-8') { |dat| + etld_data = parse(dat) + File.open(rb_file, 'w:utf-8') { |rb| + File.open(erb_file, 'r:utf-8') { |erb| + rb.print ERB.new(erb.read).result(binding) + } + } + } +end + +def normalize_hostname(domain) + DomainName.normalize(domain) +end + +def parse(f) + {}.tap { |table| + tlds = Set[] + f.each_line { |line| + line.sub!(%r{//.*}, '') + line.strip! + next if line.empty? + case line + when /^local$/ + # ignore .local + next + when /^([^!*]+)$/ + domain = normalize_hostname($1) + value = 0 + when /^\*\.([^!*]+)$/ + domain = normalize_hostname($1) + value = -1 + when /^\!([^!*]+)$/ + domain = normalize_hostname($1) + value = 1 + else + raise "syntax error: #{line}" + end + tld = domain.match(/(?:^|\.)([^.]+)$/)[1] + table[tld] ||= 1 + table[domain] = value + } + } +end + +main() diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/CHANGELOG.md new file mode 100644 index 0000000..5f7c761 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/CHANGELOG.md @@ -0,0 +1,394 @@ +## 5.2.4 (2021-09-12) + +* Keep original cookies between redirections (@antprt) + +## 5.2.3 (2021-08-03) + +* Bump addressable version requirement to 2.8+ to remediate vulnerability (@aldodelgado) + +## 5.2.2 (2021-05-27) + +* Add info about received content length in `Down::TooLarge` error (@evheny0) + +* Relax http.rb constraint to allow versions 5.x (@mgrunberg) + +## 5.2.1 (2021-04-26) + +* Raise `Down::NotModified` on 304 response status in `Down::NetHttp#open` (@ellafeldmann) + +## 5.2.0 (2020-09-20) + +* Add `:uri_normalizer` option to `Down::NetHttp` (@janko) + +* Add `:http_basic_authentication` option to `Down::NetHttp#open` (@janko) + +* Fix uninitialized instance variables warnings in `Down::ChunkedIO` (@janko) + +* Handle unknown HTTP error codes in `Down::NetHttp` (@darndt) + +## 5.1.1 (2020-02-04) + +* Fix keyword arguments warnings on Ruby 2.7 in `Down.download` and `Down.open` (@janko) + +## 5.1.0 (2020-01-09) + +* Fix keyword arguments warnings on Ruby 2.7 (@janko) + +* Fix `FrozenError` exception in `Down::ChunkedIO#readpartial` (@janko) + +* Deprecate passing headers as top-level options in `Down::NetHttp` (@janko) + +## 5.0.1 (2019-12-20) + +* In `Down::NetHttp` only use Addressable normalization if `URI.parse` fails (@coding-chimp) + +## 5.0.0 (2019-09-26) + +* Change `ChunkedIO#each_chunk` to return chunks in original encoding (@janko) + +* Always return binary strings in `ChunkedIO#readpartial` (@janko) + +* Handle frozen chunks in `Down::ChunkedIO` (@janko) + +* Change `ChunkedIO#gets` to return lines in specified encoding (@janko) + +* Halve memory allocation for `ChunkedIO#gets` (@janko) + +* Halve memory allocation for `ChunkedIO#read` without arguments (@janko) + +* Drop support for `HTTP::Client` argument in `Down::HTTP.new` (@janko) + +* Repurpose `Down::NotFound` to be raised on `404 Not Found` response (@janko) + +## 4.8.1 (2019-05-01) + +* Make `ChunkedIO#read`/`#readpartial` with length always return strings in binary encoding (@janko) + +* In `ChunkedIO#gets` respect the limit argument when separator is nil (@edlebert) + +## 4.8.0 (2018-12-19) + +* Prefer UTF-8 filenames in `Content-Disposition` header for `Tempfile#original_filename` (@janko) + +* Make the internal Tempfile of `Down::ChunkedIO` inaccessible to outside programs (@janko) + +## 4.7.0 (2018-11-18) + +* Allow request headers to be passed via `:headers` to `Down::NetHttp#download` and `#open` (@janko) + +## 4.6.1 (2018-10-24) + +* Release HTTP.rb version constraint to allow HTTP.rb 4.x (@janko) + +## 4.6.0 (2018-09-29) + +* Ensure URLs are properly encoded in `NetHttp#download` and `#open` using Addressable (@linyaoli) + +* Raise `ResponseError` with clear message when redirect URI was invalid in Down::NetHttp (@janko) + +## 4.5.0 (2018-05-11) + +* Deprecate passing an `HTTP::Client` object to `Down::Http#initialize` (@janko) + +* Add ability to pass a block to `Down::Http#initialize` for extending default options (@janko) + +* Return empty string when length is zero in `ChunkedIO#read` and `ChunkedIO#readpartial` (@janko) + +* Make `posix-spawn` optional (@janko) + +## 4.4.0 (2018-04-12) + +* Add `:method` option to `Down::Http` for specifying the request method (@janko) + +* Set default timeout of 30 for each operation to all backends (@janko) + +## 4.3.0 (2018-03-11) + +* Accept CLI arguments as a list of symbols in `Down::Wget#download` (@janko) + +* Avoid potential URL parsing errors in `Down::Http::DownloadedFile#filename_from_url` (@janko) + +* Make memory usage of `Down::Wget#download` constant (@janko) + +* Add `:destination` option to `Down.download` for specifying download destination (@janko) + +## 4.2.1 (2018-01-29) + +* Reduce memory allocation in `Down::ChunkedIO` by 10x when buffer string is used (@janko) + +* Reduce memory allocation in `Down::Http.download` by 10x. + +## 4.2.0 (2017-12-22) + +* Handle `:max_redirects` in `Down::NetHttp#open` and follow up to 2 redirects by default (@janko) + +## 4.1.1 (2017-10-15) + +* Raise all system call exceptions as `Down::ConnectionError` in `Down::NetHttp` (@janko) + +* Raise `Errno::ETIMEDOUT` as `Down::TimeoutError` in `Down::NetHttp` (@janko) + +* Raise `Addressable::URI::InvalidURIError` as `Down::InvalidUrl` in `Down::Http` (@janko) + +## 4.1.0 (2017-08-29) + +* Fix `FiberError` occurring on `Down::NetHttp.open` when response is chunked and gzipped (@janko) + +* Use a default `User-Agent` in `Down::NetHttp.open` (@janko) + +* Fix raw read timeout error sometimes being raised instead of `Down::TimeoutError` in `Down.open` (@janko) + +* `Down::ChunkedIO` can now be parsed by the CSV Ruby standard library (@janko) + +* Implement `Down::ChunkedIO#gets` (@janko) + +* Implement `Down::ChunkedIO#pos` (@janko) + +## 4.0.1 (2017-07-08) + +* Load and assign the `NetHttp` backend immediately on `require "down"` (@janko) + +* Remove undocumented `Down::ChunkedIO#backend=` that was added in 4.0.0 to avoid confusion (@janko) + +## 4.0.0 (2017-06-24) + +* Don't apply `Down.download` and `Down.open` overrides when loading a backend (@janko) + +* Remove `Down::Http.client` attribute accessor (@janko) + +* Make `Down::NetHttp`, `Down::Http`, and `Down::Wget` classes instead of modules (@janko) + +* Remove `Down.copy_to_tempfile` (@janko) + +* Add Wget backend (@janko) + +* Add `:content_length_proc` and `:progress_proc` to the HTTP.rb backend (@janko) + +* Halve string allocations in `Down::ChunkedIO#readpartial` when buffer string is not used (@janko) + +## 3.2.0 (2017-06-21) + +* Add `Down::ChunkedIO#readpartial` for more memory efficient reading (@janko) + +* Fix `Down::ChunkedIO` not returning second part of the last chunk if it was previously partially read (@janko) + +* Strip internal variables from `Down::ChunkedIO#inspect` and show only the important ones (@janko) + +* Add `Down::ChunkedIO#closed?` (@janko) + +* Add `Down::ChunkedIO#rewindable?` (@janko) + +* In `Down::ChunkedIO` only create the Tempfile if it's going to be used (@janko) + +## 3.1.0 (2017-06-16) + +* Split `Down::NotFound` into explanatory exceptions (@janko) + +* Add `:read_timeout` and `:open_timeout` options to `Down::NetHttp.open` (@janko) + +* Return an `Integer` in `data[:status]` on a result of `Down.open` when using the HTTP.rb strategy (@janko) + +## 3.0.0 (2017-05-24) + +* Make `Down.open` pass encoding from content type charset to `Down::ChunkedIO` (@janko) + +* Add `:encoding` option to `Down::ChunkedIO.new` for specifying the encoding of returned content (@janko) + +* Add HTTP.rb backend as an alternative to Net::HTTP (@janko) + +* Stop testing on MRI 2.1 (@janko) + +* Forward cookies from the `Set-Cookie` response header when redirecting (@janko) + +* Add `frozen-string-literal: true` comments for less string allocations on Ruby 2.3+ (@janko) + +* Modify `#content_type` to return nil instead of `application/octet-stream` when `Content-Type` is blank in `Down.download` (@janko) + +* `Down::ChunkedIO#read`, `#each_chunk`, `#eof?`, `rewind` now raise an `IOError` when `Down::ChunkedIO` has been closed (@janko) + +* `Down::ChunkedIO` now caches only the content that has been read (@janko) + +* Add `Down::ChunkedIO#size=` to allow assigning size after the `Down::ChunkedIO` has been instantiated (@janko) + +* Make `:size` an optional argument in `Down::ChunkedIO` (@janko) + +* Call enumerator's `ensure` block when `Down::ChunkedIO#close` is called (@janko) + +* Add `:rewindable` option to `Down::ChunkedIO` and `Down.open` for disabling caching read content into a file (@janko) + +* Drop support for MRI 2.0 (@janko) + +* Drop support for MRI 1.9.3 (@janko) + +* Remove deprecated `:progress` option (@janko) + +* Remove deprecated `:timeout` option (@janko) + +* Reraise only a subset of exceptions as `Down::NotFound` in `Down.download` (@janko) + +* Support streaming of "Transfer-Encoding: chunked" responses in `Down.open` again (@janko) + +* Remove deprecated `Down.stream` (@janko) + +## 2.5.1 (2017-05-13) + +* Remove URL from the error messages (@janko) + +## 2.5.0 (2017-05-03) + +* Support both Strings and `URI` objects in `Down.download` and `Down.open` (@olleolleolle) + +* Work around a `CGI.unescape` bug in Ruby 2.4. + +* Apply HTTP Basic authentication contained in URLs in `Down.open`. + +* Raise `Down::NotFound` on 4xx and 5xx responses in `Down.open`. + +* Write `:status` and `:headers` information to `Down::ChunkedIO#data` in `Down.open`. + +* Add `#data` attribute to `Down::ChunkedIO` for saving custom result data. + +* Don't save retrieved chunks into the file in `Down::ChunkedIO#each_chunk`. + +* Add `:proxy` option to `Down.download` and `Down.open`. + +## 2.4.3 (2017-04-06) + +* Show the input URL in the `Down::Error` message. + +## 2.4.2 (2017-03-28) + +* Don't raise `StopIteration` in `Down::ChunkedIO` when `:chunks` is an empty + Enumerator. + +## 2.4.1 (2017-03-23) + +* Correctly detect empty filename from `Content-Disposition` header, and + in this case continue extracting filename from URL. + +## 2.4.0 (2017-03-19) + +* Allow `Down.open` to accept request headers as options with String keys, + just like `Down.download` does. + +* Decode URI-decoded filenames from the `Content-Disposition` header + +* Parse filenames without quotes from the `Content-Disposition` header + +## 2.3.8 (2016-11-07) + +* Work around `Transfer-Encoding: chunked` responses by downloading whole + response body. + +## 2.3.7 (2016-11-06) + +* In `Down.open` send requests using the URI *path* instead of the full URI. + +## 2.3.6 (2016-07-26) + +* Read #original_filename from the "Content-Disposition" header. + +* Extract `Down::ChunkedIO` into a file, so that it can be required separately. + +* In `Down.stream` close the IO after reading from it. + +## 2.3.5 (2016-07-18) + +* Prevent reading the whole response body when the IO returned by `Down.open` + is closed. + +## 2.3.4 (2016-07-14) + +* Require `net/http` + +## 2.3.3 (2016-06-23) + +* Improve `Down::ChunkedIO` (and thus `Down.open`): + + - `#each_chunk` and `#read` now automatically call `:on_close` when all + chunks were downloaded + + - `#eof?` had incorrect behaviour, where it would return true if + everything was downloaded, instead only when it's also at the end of + the file + + - `#close` can now be called multiple times, as the `:on_close` will always + be called only once + + - end of download is now detected immediately when the last chunk was + downloaded (as opposed to after trying to read the next one) + +## 2.3.2 (2016-06-22) + +* Add `Down.open` for IO-like streaming, and deprecate `Down.stream` (janko-m) + +* Allow URLs with basic authentication (`http://user:password@example.com`) (janko-m) + +## ~~2.3.1 (2016-06-22)~~ (yanked) + +## ~~2.3.0 (2016-06-22)~~ (yanked) + +## 2.2.1 (2016-06-06) + +* Make Down work on Windows (martinsefcik) + +* Close an internal file descriptor that was left open (martinsefcik) + +## 2.2.0 (2016-05-19) + +* Add ability to follow redirects, and allow maximum of 2 redirects by default (janko-m) + +* Fix a potential Windows issue when extracting `#original_filename` (janko-m) + +* Fix `#original_filename` being incomplete if filename contains a slash (janko-m) + +## 2.1.0 (2016-04-12) + +* Make `:progress_proc` and `:content_length_proc` work with `:max_size` (janko-m) + +* Deprecate `:progress` in favor of open-uri's `:progress_proc` (janko-m) + +* Deprecate `:timeout` in favor of open-uri's `:open_timeout` and `:read_timeout` (janko-m) + +* Add `Down.stream` for streaming remote files in chunks (janko-m) + +* Replace deprecated `URI.encode` with `CGI.unescape` in downloaded file's `#original_filename` (janko-m) + +## 2.0.1 (2016-03-06) + +* Add error message when file was to large, and use a simple error message for other generic download failures (janko-m) + +## 2.0.0 (2016-02-03) + +* Fix an issue where valid URLs were transformed into invalid URLs (janko-m) + + - All input URLs now have to be properly encoded, which should already be the + case in most situations. + +* Include the error class when download fails (janko-m) + +## 1.1.0 (2016-01-26) + +* Forward all additional options to open-uri (janko-m) + +## 1.0.5 (2015-12-18) + +* Move the open-uri file to the new location instead of copying it (janko-m) + +## 1.0.4 (2015-11-19) + +* Delete the old open-uri file after using it (janko-m) + +## 1.0.3 (2015-11-16) + +* Fix `#download` and `#copy_to_tempfile` not preserving the file extension (janko-m) + +* Fix `#copy_to_tempfile` not working when given a nested basename (janko-m) + +## 1.0.2 (2015-10-24) + +* Fix Down not working with Ruby 1.9.3 (janko-m) + +## 1.0.1 (2015-10-01) + +* Don't allow redirects when downloading files (janko-m) diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/LICENSE.txt new file mode 100644 index 0000000..6514e66 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Janko Marohnić + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/README.md b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/README.md new file mode 100644 index 0000000..f13352d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/README.md @@ -0,0 +1,512 @@ +# Down + +Down is a utility tool for streaming, flexible and safe downloading of remote +files. It can use [open-uri] + `Net::HTTP`, [http.rb] or `wget` as the backend +HTTP library. + +## Installation + +```rb +gem "down", "~> 5.0" +``` + +## Downloading + +The primary method is `Down.download`, which downloads the remote file into a +`Tempfile`: + +```rb +require "down" + +tempfile = Down.download("http://example.com/nature.jpg") +tempfile #=> # +``` + +### Metadata + +The returned `Tempfile` has some additional attributes extracted from the +response data: + +```rb +tempfile.content_type #=> "text/plain" +tempfile.original_filename #=> "document.txt" +tempfile.charset #=> "utf-8" +``` + +### Maximum size + +When you're accepting URLs from an outside source, it's a good idea to limit +the filesize (because attackers want to give a lot of work to your servers). +Down allows you to pass a `:max_size` option: + +```rb +Down.download("http://example.com/image.jpg", max_size: 5 * 1024 * 1024) # 5 MB +# Down::TooLarge: file is too large (max is 5MB) +``` + +What is the advantage over simply checking size after downloading? Well, Down +terminates the download very early, as soon as it gets the `Content-Length` +header. And if the `Content-Length` header is missing, Down will terminate the +download as soon as the downloaded content surpasses the maximum size. + +### Destination + +By default the remote file will be downloaded into a temporary location and +returned as a `Tempfile`. If you would like the file to be downloaded to a +specific location on disk, you can specify the `:destination` option: + +```rb +Down.download("http://example.com/image.jpg", destination: "/path/to/destination") +#=> nil +``` + +In this case `Down.download` won't have any return value, so if you need a File +object you'll have to create it manually. + +### Basic authentication + +`Down.download` and `Down.open` will automatically detect and apply HTTP basic +authentication from the URL: + +```rb +Down.download("http://user:password@example.org") +Down.open("http://user:password@example.org") +``` + +### Progress + +`Down.download` supports `:content_length_proc`, which gets called with the +value of the `Content-Length` header as soon as it's received, and +`:progress_proc`, which gets called with current filesize whenever a new chunk +is downloaded. + +```rb +Down.download "http://example.com/movie.mp4", + content_length_proc: -> (content_length) { ... }, + progress_proc: -> (progress) { ... } +``` + +## Streaming + +Down has the ability to retrieve content of the remote file *as it is being +downloaded*. The `Down.open` method returns a `Down::ChunkedIO` object which +represents the remote file on the given URL. When you read from it, Down +internally downloads chunks of the remote file, but only how much is needed. + +```rb +remote_file = Down.open("http://example.com/image.jpg") +remote_file.size # read from the "Content-Length" header + +remote_file.read(1024) # downloads and returns first 1 KB +remote_file.read(1024) # downloads and returns next 1 KB + +remote_file.eof? #=> false +remote_file.read # downloads and returns the rest of the file content +remote_file.eof? #=> true + +remote_file.close # closes the HTTP connection and deletes the internal Tempfile +``` + +The following IO methods are implemented: + +* `#read` & `#readpartial` +* `#gets` +* `#seek` +* `#pos` & `#tell` +* `#eof?` +* `#rewind` +* `#close` + +### Caching + +By default the downloaded content is internally cached into a `Tempfile`, so +that when you rewind the `Down::ChunkedIO`, it continues reading the cached +content that it had already retrieved. + +```rb +remote_file = Down.open("http://example.com/image.jpg") +remote_file.read(1*1024*1024) # downloads, caches, and returns first 1MB +remote_file.rewind +remote_file.read(1*1024*1024) # reads the cached content +remote_file.read(1*1024*1024) # downloads the next 1MB +``` + +If you want to save on IO calls and on disk usage, and don't need to be able to +rewind the `Down::ChunkedIO`, you can disable caching downloaded content: + +```rb +Down.open("http://example.com/image.jpg", rewindable: false) +``` + +### Yielding chunks + +You can also yield chunks directly as they're downloaded via `#each_chunk`, in +which case the downloaded content is not cached into a file regardless of the +`:rewindable` option. + +```rb +remote_file = Down.open("http://example.com/image.jpg") +remote_file.each_chunk { |chunk| ... } +remote_file.close +``` + +### Data + +You can access the response status and headers of the HTTP request that was made: + +```rb +remote_file = Down.open("http://example.com/image.jpg") +remote_file.data[:status] #=> 200 +remote_file.data[:headers] #=> { ... } +remote_file.data[:response] # returns the response object +``` + +Note that a `Down::ResponseError` exception will automatically be raised if +response status was 4xx or 5xx. + +### Down::ChunkedIO + +The `Down.open` performs HTTP logic and returns an instance of +`Down::ChunkedIO`. However, `Down::ChunkedIO` is a generic class that can wrap +any kind of streaming. It accepts an `Enumerator` that yields chunks of +content, and provides IO-like interface over that enumerator, calling it +whenever more content is needed. + +```rb +require "down/chunked_io" + +Down::ChunkedIO.new(...) +``` + +* `:chunks` – `Enumerator` that yields chunks of content +* `:size` – size of the file if it's known (returned by `#size`) +* `:on_close` – called when streaming finishes or IO is closed +* `:data` - custom data that you want to store (returned by `#data`) +* `:rewindable` - whether to cache retrieved data into a file (defaults to `true`) +* `:encoding` - force content to be returned in specified encoding (defaults to `Encoding::BINARY`) + +Here is an example of creating a streaming IO of a MongoDB GridFS file: + +```rb +require "down/chunked_io" + +mongo = Mongo::Client.new(...) +bucket = mongo.database.fs + +content_length = bucket.find(_id: id).first[:length] +stream = bucket.open_download_stream(id) + +io = Down::ChunkedIO.new( + size: content_length, + chunks: stream.enum_for(:each), + on_close: -> { stream.close }, +) +``` + +### Exceptions + +Down tries to recognize various types of exceptions and re-raise them as one of +the `Down::Error` subclasses. This is Down's exception hierarchy: + +* `Down::Error` + * `Down::TooLarge` + * `Down::InvalidUrl` + * `Down::TooManyRedirects` + * `Down::NotModified` + * `Down::ResponseError` + * `Down::ClientError` + * `Down::NotFound` + * `Down::ServerError` + * `Down::ConnectionError` + * `Down::TimeoutError` + * `Down::SSLError` + +## Backends + +The following backends are available: + +* [Down::NetHttp](#downnethttp) (default) +* [Down::Http](#downhttp) +* [Down::Wget](#downwget) + +You can use the backend directly: + +```rb +require "down/net_http" + +Down::NetHttp.download("...") +Down::NetHttp.open("...") +``` + +Or you can set the backend globally (default is `:net_http`): + +```rb +require "down" + +Down.backend :http # use the Down::Http backend + +Down.download("...") +Down.open("...") +``` + +### Down::NetHttp + +The `Down::NetHttp` backend implements downloads using [open-uri] and +[Net::HTTP] standard libraries. + +```rb +gem "down", "~> 5.0" +``` +```rb +require "down/net_http" + +tempfile = Down::NetHttp.download("http://nature.com/forest.jpg") +tempfile #=> # + +io = Down::NetHttp.open("http://nature.com/forest.jpg") +io #=> # +``` + +`Down::NetHttp.download` is implemented as a wrapper around open-uri, and fixes +some of open-uri's undesired behaviours: + +* uses `URI::HTTP#open` or `URI::HTTPS#open` directly for [security](https://sakurity.com/blog/2015/02/28/openuri.html) +* always returns a `Tempfile` object, whereas open-uri returns `StringIO` + when file is smaller than 10KB +* gives the extension to the `Tempfile` object from the URL +* allows you to limit maximum number of redirects + +On the other hand `Down::NetHttp.open` is implemented using Net::HTTP directly, +as open-uri doesn't support downloading on-demand. + +#### Redirects + +`Down::NetHttp#download` turns off open-uri's following redirects, as open-uri +doesn't have a way to limit the maximum number of hops, and implements its own. +By default maximum of 2 redirects will be followed, but you can change it via +the `:max_redirects` option: + +```rb +Down::NetHttp.download("http://example.com/image.jpg") # 2 redirects allowed +Down::NetHttp.download("http://example.com/image.jpg", max_redirects: 5) # 5 redirects allowed +Down::NetHttp.download("http://example.com/image.jpg", max_redirects: 0) # 0 redirects allowed + +Down::NetHttp.open("http://example.com/image.jpg") # 2 redirects allowed +Down::NetHttp.open("http://example.com/image.jpg", max_redirects: 5) # 5 redirects allowed +Down::NetHttp.open("http://example.com/image.jpg", max_redirects: 0) # 0 redirects allowed +``` + +#### Proxy + +An HTTP proxy can be specified via the `:proxy` option: + +```rb +Down::NetHttp.download("http://example.com/image.jpg", proxy: "http://proxy.org") +Down::NetHttp.open("http://example.com/image.jpg", proxy: "http://user:password@proxy.org") +``` + +#### Timeouts + +Timeouts can be configured via the `:open_timeout` and `:read_timeout` options: + +```rb +Down::NetHttp.download("http://example.com/image.jpg", open_timeout: 5) +Down::NetHttp.open("http://example.com/image.jpg", read_timeout: 10) +``` + +#### Headers + +Request headers can be added via the `:headers` option: + +```rb +Down::NetHttp.download("http://example.com/image.jpg", headers: { "Header" => "Value" }) +Down::NetHttp.open("http://example.com/image.jpg", headers: { "Header" => "Value" }) +``` + +#### SSL options + +The `:ssl_ca_cert` and `:ssl_verify_mode` options are supported, and they have +the same semantics as in `open-uri`: + +```rb +Down::NetHttp.open("http://example.com/image.jpg", + ssl_ca_cert: "/path/to/cert", + ssl_verify_mode: OpenSSL::SSL::VERIFY_PEER) +``` + +#### URI normalization + +If the URL isn't parseable by `URI.parse`, `Down::NetHttp` will +attempt to normalize the URL using [Addressable::URI], URI-escaping +any potentially unescaped characters. You can change the normalizer +via the `:uri_normalizer` option: + +```rb +# this skips URL normalization +Down::NetHttp.download("http://example.com/image.jpg", uri_normalizer: -> (url) { url }) +``` + +#### Additional options + +Any additional options passed to `Down.download` will be forwarded to +[open-uri], so you can for example add basic authentication or a timeout: + +```rb +Down::NetHttp.download "http://example.com/image.jpg", + http_basic_authentication: ['john', 'secret'], + read_timeout: 5 +``` + +You can also initialize the backend with default options: + +```rb +net_http = Down::NetHttp.new(open_timeout: 3) + +net_http.download("http://example.com/image.jpg") +net_http.open("http://example.com/image.jpg") +``` + +### Down::Http + +The `Down::Http` backend implements downloads using the [http.rb] gem. + +```rb +gem "down", "~> 5.0" +gem "http", "~> 5.0" +``` +```rb +require "down/http" + +tempfile = Down::Http.download("http://nature.com/forest.jpg") +tempfile #=> # + +io = Down::Http.open("http://nature.com/forest.jpg") +io #=> # +``` + +Some features that give the http.rb backend an advantage over `open-uri` and +`Net::HTTP` include: + +* Low memory usage (**10x less** than `open-uri`/`Net::HTTP`) +* Proper SSL support +* Support for persistent connections +* Global timeouts (limiting how long the whole request can take) +* Chainable builder API for setting default options + +#### Additional options + +All additional options will be forwarded to `HTTP::Client#request`: + +```rb +Down::Http.download("http://example.org/image.jpg", headers: { "Foo" => "Bar" }) +Down::Http.open("http://example.org/image.jpg", follow: { max_hops: 0 }) +``` + +However, it's recommended to configure request options using http.rb's +chainable API, as it's more convenient than passing raw options. + +```rb +Down::Http.open("http://example.org/image.jpg") do |client| + client.timeout(connect: 3, read: 3) +end +``` + +You can also initialize the backend with default options: + +```rb +http = Down::Http.new(headers: { "Foo" => "Bar" }) +# or +http = Down::Http.new { |client| client.timeout(connect: 3) } + +http.download("http://example.com/image.jpg") +http.open("http://example.com/image.jpg") +``` + +#### Request method + +By default `Down::Http` makes a `GET` request to the specified endpoint, but you +can specify a different request method using the `:method` option: + +```rb +Down::Http.download("http://example.org/image.jpg", method: :post) +Down::Http.open("http://example.org/image.jpg", method: :post) + +down = Down::Http.new(method: :post) +down.download("http://example.org/image.jpg") +``` + +### Down::Wget (experimental) + +The `Down::Wget` backend implements downloads using the `wget` command line +utility. + +```rb +gem "down", "~> 5.0" +gem "posix-spawn" # omit if on JRuby +gem "http_parser.rb" +``` +```rb +require "down/wget" + +tempfile = Down::Wget.download("http://nature.com/forest.jpg") +tempfile #=> # + +io = Down::Wget.open("http://nature.com/forest.jpg") +io #=> # +``` + +One major advantage of `wget` is that it automatically resumes downloads that +were interrupted due to network failures, which is very useful when you're +downloading large files. + +However, the Wget backend should still be considered experimental, as it wasn't +easy to implement a CLI wrapper that streams output, so it's possible that I've +made mistakes. Let me know how it's working out for you 😉. + +#### Additional arguments + +You can pass additional arguments to the underlying `wget` commmand via symbols: + +```rb +Down::Wget.download("http://nature.com/forest.jpg", :no_proxy, connect_timeout: 3) +Down::Wget.open("http://nature.com/forest.jpg", user: "janko", password: "secret") +``` + +You can also initialize the backend with default arguments: + +```rb +wget = Down::Wget.new(:no_proxy, connect_timeout: 3) + +wget.download("http://nature.com/forest.jpg") +wget.open("http://nature.com/forest.jpg") +``` + +## Supported Ruby versions + +* MRI 2.3 +* MRI 2.4 +* MRI 2.5 +* MRI 2.6 +* MRI 2.7 +* JRuby 9.2 + +## Development + +You can run tests with + +``` +$ bundle exec rake test +``` + +The test suite pulls and runs [kennethreitz/httpbin] as a Docker container, so +you'll need to have Docker installed and running. + +## License + +[MIT](LICENSE.txt) + +[open-uri]: http://ruby-doc.org/stdlib-2.3.0/libdoc/open-uri/rdoc/OpenURI.html +[Net::HTTP]: https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html +[http.rb]: https://github.com/httprb/http +[Addressable::URI]: https://github.com/sporkmonger/addressable +[kennethreitz/httpbin]: https://github.com/kennethreitz/httpbin diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/down.gemspec b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/down.gemspec new file mode 100644 index 0000000..c063cc2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/down.gemspec @@ -0,0 +1,33 @@ +require File.expand_path("../lib/down/version", __FILE__) + +Gem::Specification.new do |spec| + spec.name = "down" + spec.version = Down::VERSION + + spec.required_ruby_version = ">= 2.3" + + spec.summary = "Robust streaming downloads using Net::HTTP, HTTP.rb or wget." + spec.homepage = "https://github.com/janko/down" + spec.authors = ["Janko Marohnić"] + spec.email = ["janko.marohnic@gmail.com"] + spec.license = "MIT" + + spec.files = Dir["README.md", "LICENSE.txt", "CHANGELOG.md", "*.gemspec", "lib/**/*.rb"] + spec.require_path = "lib" + + spec.add_dependency "addressable", "~> 2.8" + + spec.add_development_dependency "minitest", "~> 5.8" + spec.add_development_dependency "mocha", "~> 1.5" + spec.add_development_dependency "rake" + # http 5.0 drop support of ruby 2.3 and 2.4. We still support those versions. + if RUBY_VERSION >= "2.5" + spec.add_development_dependency "http", "~> 5.0" + else + spec.add_development_dependency "http", "~> 4.3" + end + spec.add_development_dependency "posix-spawn" unless RUBY_ENGINE == "jruby" + spec.add_development_dependency "http_parser.rb" unless RUBY_ENGINE == "jruby" + spec.add_development_dependency "docker-api" + spec.add_development_dependency "warning" if RUBY_VERSION >= "2.4" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down.rb new file mode 100644 index 0000000..e942454 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down.rb @@ -0,0 +1,31 @@ +# frozen-string-literal: true + +require "down/version" +require "down/net_http" + +module Down + module_function + + def download(*args, **options, &block) + backend.download(*args, **options, &block) + end + + def open(*args, **options, &block) + backend.open(*args, **options, &block) + end + + # Allows setting a backend via a symbol or a downloader object. + def backend(value = nil) + if value.is_a?(Symbol) + require "down/#{value}" + @backend = Down.const_get(value.to_s.split("_").map(&:capitalize).join) + elsif value + @backend = value + else + @backend + end + end +end + +# Set Net::HTTP as the default backend +Down.backend Down::NetHttp diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/backend.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/backend.rb new file mode 100644 index 0000000..9dc4a2d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/backend.rb @@ -0,0 +1,33 @@ +# frozen-string-literal: true + +require "down/version" +require "down/chunked_io" +require "down/errors" +require "down/utils" + +require "fileutils" + +module Down + class Backend + def self.download(*args, **options, &block) + new.download(*args, **options, &block) + end + + def self.open(*args, **options, &block) + new.open(*args, **options, &block) + end + + private + + # If destination path is defined, move tempfile to the destination, + # otherwise return the tempfile unchanged. + def download_result(tempfile, destination) + return tempfile unless destination + + tempfile.close # required for Windows + FileUtils.mv tempfile.path, destination + + nil + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/chunked_io.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/chunked_io.rb new file mode 100644 index 0000000..938391b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/chunked_io.rb @@ -0,0 +1,346 @@ +# frozen-string-literal: true + +require "tempfile" +require "fiber" + +module Down + # Wraps an enumerator that yields chunks of content into an IO object. It + # implements some essential IO methods: + # + # * IO#read + # * IO#readpartial + # * IO#gets + # * IO#size + # * IO#pos + # * IO#eof? + # * IO#rewind + # * IO#close + # + # By default the Down::ChunkedIO caches all read content into a tempfile, + # allowing it to be rewindable. If rewindability won't be used, it can be + # disabled by setting `:rewindable` to false, which eliminates any disk I/O. + # + # Any cleanup code (i.e. ensure block) that the given enumerator carries is + # guaranteed to get executed, either when all content has been retrieved or + # when Down::ChunkedIO is closed. One can also specify an `:on_close` + # callback that will also get executed in those situations. + class ChunkedIO + attr_accessor :size, :data, :encoding + + def initialize(chunks:, size: nil, on_close: nil, data: {}, rewindable: true, encoding: nil) + @chunks = chunks + @size = size + @on_close = on_close + @data = data + @encoding = find_encoding(encoding || "binary") + @rewindable = rewindable + @buffer = nil + @position = 0 + @next_chunk = nil + @closed = false + + retrieve_chunk # fetch first chunk so that we know whether the file is empty + end + + # Yields elements of the underlying enumerator. + def each_chunk + fail IOError, "closed stream" if closed? + + return enum_for(__method__) unless block_given? + + yield retrieve_chunk until chunks_depleted? + end + + # Implements IO#read semantics. Without arguments it retrieves and returns + # all content. + # + # With `length` argument returns exactly that number of bytes if they're + # available. + # + # With `outbuf` argument each call will return that same string object, + # where the value is replaced with retrieved content. + # + # If end of file is reached, returns empty string if called without + # arguments, or nil if called with arguments. Raises IOError if closed. + def read(length = nil, outbuf = nil) + fail IOError, "closed stream" if closed? + + data = outbuf.clear.force_encoding(Encoding::BINARY) if outbuf + data ||= "".b + + remaining_length = length + + until remaining_length == 0 || eof? + data << readpartial(remaining_length, buffer ||= String.new) + remaining_length = length - data.bytesize if length + end + + buffer.clear if buffer # deallocate string + + data.force_encoding(@encoding) unless length + data unless data.empty? && length && length > 0 + end + + # Implements IO#gets semantics. Without arguments it retrieves lines of + # content separated by newlines. + # + # With `separator` argument it does the following: + # + # * if `separator` is a nonempty string returns chunks of content + # surrounded with that sequence of bytes + # * if `separator` is an empty string returns paragraphs of content + # (content delimited by two newlines) + # * if `separator` is nil and `limit` is nil returns all content + # + # With `limit` argument returns maximum of that amount of bytes. + # + # Returns nil if end of file is reached. Raises IOError if closed. + def gets(separator_or_limit = $/, limit = nil) + fail IOError, "closed stream" if closed? + + if separator_or_limit.is_a?(Integer) + separator = $/ + limit = separator_or_limit + else + separator = separator_or_limit + end + + return read(limit) if separator.nil? + + separator = "\n\n" if separator.empty? + + data = String.new + + until data.include?(separator) || data.bytesize == limit || eof? + remaining_length = limit - data.bytesize if limit + data << readpartial(remaining_length, buffer ||= String.new) + end + + buffer.clear if buffer # deallocate buffer + + line, extra = data.split(separator, 2) + line << separator if data.include?(separator) + + data.clear # deallocate data + + if extra + if cache + cache.pos -= extra.bytesize + else + if @buffer + @buffer.prepend(extra) + else + @buffer = extra + end + end + end + + line.force_encoding(@encoding) if line + end + + # Implements IO#readpartial semantics. If there is any content readily + # available reads from it, otherwise fetches and reads from the next chunk. + # It writes to and reads from the cache when needed. + # + # Without arguments it either returns all content that's readily available, + # or the next chunk. This is useful when you don't care about the size of + # chunks and you want to minimize string allocations. + # + # With `maxlen` argument returns maximum of that amount of bytes (default + # is 16KB). + # + # With `outbuf` argument each call will return that same string object, + # where the value is replaced with retrieved content. + # + # Raises EOFError if end of file is reached. Raises IOError if closed. + def readpartial(maxlen = nil, outbuf = nil) + fail IOError, "closed stream" if closed? + + maxlen ||= 16*1024 + + data = cache.read(maxlen, outbuf) if cache && !cache.eof? + data ||= outbuf.clear.force_encoding(Encoding::BINARY) if outbuf + data ||= "".b + + return data if maxlen == 0 + + if @buffer.nil? && data.empty? + fail EOFError, "end of file reached" if chunks_depleted? + @buffer = retrieve_chunk + end + + remaining_length = maxlen - data.bytesize + + unless @buffer.nil? || remaining_length == 0 + if remaining_length < @buffer.bytesize + buffered_data = @buffer.byteslice(0, remaining_length) + @buffer = @buffer.byteslice(remaining_length..-1) + else + buffered_data = @buffer + @buffer = nil + end + + data << buffered_data + + cache.write(buffered_data) if cache + + buffered_data.clear unless buffered_data.frozen? + end + + @position += data.bytesize + + data.force_encoding(Encoding::BINARY) + end + + # Implements IO#seek semantics. + def seek(amount, whence = IO::SEEK_SET) + fail Errno::ESPIPE, "Illegal seek" if cache.nil? + + case whence + when IO::SEEK_SET, :SET + target_pos = amount + when IO::SEEK_CUR, :CUR + target_pos = @position + amount + when IO::SEEK_END, :END + unless chunks_depleted? + cache.seek(0, IO::SEEK_END) + IO.copy_stream(self, File::NULL) + end + + target_pos = cache.size + amount + else + fail ArgumentError, "invalid whence: #{whence.inspect}" + end + + if target_pos <= cache.size + cache.seek(target_pos) + else + cache.seek(0, IO::SEEK_END) + IO.copy_stream(self, File::NULL, target_pos - cache.size) + end + + @position = cache.pos + end + + # Implements IO#pos semantics. Returns the current position of the + # Down::ChunkedIO. + def pos + @position + end + alias tell pos + + # Implements IO#eof? semantics. Returns whether we've reached end of file. + # It returns true if cache is at the end and there is no more content to + # retrieve. Raises IOError if closed. + def eof? + fail IOError, "closed stream" if closed? + + return false if cache && !cache.eof? + @buffer.nil? && chunks_depleted? + end + + # Implements IO#rewind semantics. Rewinds the Down::ChunkedIO by rewinding + # the cache and setting the position to the beginning of the file. Raises + # IOError if closed or not rewindable. + def rewind + fail IOError, "closed stream" if closed? + fail IOError, "this Down::ChunkedIO is not rewindable" if cache.nil? + + cache.rewind + @position = 0 + end + + # Implements IO#close semantics. Closes the Down::ChunkedIO by terminating + # chunk retrieval and deleting the cached content. + def close + return if @closed + + chunks_fiber.resume(:terminate) if chunks_fiber.alive? + cache.close! if cache + @buffer = nil + @closed = true + end + + # Returns whether the Down::ChunkedIO has been closed. + def closed? + !!@closed + end + + # Returns whether the Down::ChunkedIO was specified as rewindable. + def rewindable? + @rewindable + end + + # Returns useful information about the Down::ChunkedIO object. + def inspect + string = String.new + string << "#<#{self.class.name}" + string << " chunks=#{@chunks.inspect}" + string << " size=#{size.inspect}" + string << " encoding=#{encoding.inspect}" + string << " data=#{data.inspect}" + string << " on_close=#{@on_close.inspect}" + string << " rewindable=#{@rewindable.inspect}" + string << " (closed)" if closed? + string << ">" + end + + private + + # If Down::ChunkedIO is specified as rewindable, returns a new Tempfile for + # writing read content to. This allows the Down::ChunkedIO to be rewinded. + def cache + return if !rewindable? + + @cache ||= ( + tempfile = Tempfile.new("down-chunked_io", binmode: true) + tempfile.chmod(0000) # make sure nobody else can read or write to it + tempfile.unlink if posix? # remove entry from filesystem if it's POSIX + tempfile + ) + end + + # Returns current chunk and retrieves the next chunk. If next chunk is nil, + # we know we've reached EOF. + def retrieve_chunk + chunk = @next_chunk + @next_chunk = chunks_fiber.resume + chunk + end + + # Returns whether there is any content left to retrieve. + def chunks_depleted? + !chunks_fiber.alive? + end + + # Creates a Fiber wrapper around the underlying enumerator. The advantage + # of using a Fiber here is that we can terminate the chunk retrieval, in a + # way that executes any cleanup code that the enumerator potentially + # carries. At the end of iteration the :on_close callback is executed. + def chunks_fiber + @chunks_fiber ||= Fiber.new do + begin + @chunks.each do |chunk| + action = Fiber.yield chunk + break if action == :terminate + end + ensure + @on_close.call if @on_close + end + end + end + + # Finds encoding by name. If the encoding couldn't be find, falls back to + # the generic binary encoding. + def find_encoding(encoding) + Encoding.find(encoding) + rescue ArgumentError + Encoding::BINARY + end + + # Returns whether the filesystem has POSIX semantics. + def posix? + RUBY_PLATFORM !~ /(mswin|mingw|cygwin|java)/ + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/errors.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/errors.rb new file mode 100644 index 0000000..898f0a9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/errors.rb @@ -0,0 +1,46 @@ +# frozen-string-literal: true + +module Down + # generic error which is a superclass to all other errors + class Error < StandardError; end + + # raised when the file is larger than the specified maximum size + class TooLarge < Error; end + + # raised when the given URL couldn't be parsed + class InvalidUrl < Error; end + + # raised when the number of redirects was larger than the specified maximum + class TooManyRedirects < Error; end + + # raised when the requested resource has not been modified + class NotModified < Error; end + + # raised when response returned 4xx or 5xx response + class ResponseError < Error + attr_reader :response + + def initialize(message, response = nil) + super(message) + @response = response + end + end + + # raised when response returned 4xx response + class ClientError < ResponseError; end + + # raised when response returned 404 response + class NotFound < ClientError; end + + # raised when response returned 5xx response + class ServerError < ResponseError; end + + # raised when there was an error connecting to the server + class ConnectionError < Error; end + + # raised when connecting to the server too longer than the specified timeout + class TimeoutError < ConnectionError; end + + # raised when an SSL error was raised + class SSLError < Error; end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/http.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/http.rb new file mode 100644 index 0000000..19fed1a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/http.rb @@ -0,0 +1,155 @@ +# frozen-string-literal: true + +gem "http", ">= 2.1.0", "< 6" + +require "http" + +require "down/backend" + +require "tempfile" + +module Down + # Provides streaming downloads implemented with HTTP.rb. + class Http < Backend + # Initializes the backend with common defaults. + def initialize(**options, &block) + @method = options.delete(:method) || :get + @client = HTTP + .headers("User-Agent" => "Down/#{Down::VERSION}") + .follow(max_hops: 2) + .timeout(connect: 30, write: 30, read: 30) + + @client = HTTP::Client.new(@client.default_options.merge(options)) if options.any? + @client = block.call(@client) if block + end + + # Downlods the remote file to disk. Accepts HTTP.rb options via a hash or a + # block, and some additional options as well. + def download(url, max_size: nil, progress_proc: nil, content_length_proc: nil, destination: nil, **options, &block) + response = request(url, **options, &block) + + content_length_proc.call(response.content_length) if content_length_proc && response.content_length + + if max_size && response.content_length && response.content_length > max_size + raise Down::TooLarge, "file is too large (#{response.content_length/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + + extname = File.extname(response.uri.path) + tempfile = Tempfile.new(["down-http", extname], binmode: true) + + stream_body(response) do |chunk| + tempfile.write(chunk) + chunk.clear # deallocate string + + progress_proc.call(tempfile.size) if progress_proc + + if max_size && tempfile.size > max_size + raise Down::TooLarge, "file is too large (#{tempfile.size/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + end + + tempfile.open # flush written content + + tempfile.extend Down::Http::DownloadedFile + tempfile.url = response.uri.to_s + tempfile.headers = response.headers.to_h + + download_result(tempfile, destination) + rescue + tempfile.close! if tempfile + raise + end + + # Starts retrieving the remote file and returns an IO-like object which + # downloads the response body on-demand. Accepts HTTP.rb options via a hash + # or a block. + def open(url, rewindable: true, **options, &block) + response = request(url, **options, &block) + + Down::ChunkedIO.new( + chunks: enum_for(:stream_body, response), + size: response.content_length, + encoding: response.content_type.charset, + rewindable: rewindable, + data: { status: response.code, headers: response.headers.to_h, response: response }, + ) + end + + private + + def request(url, method: @method, **options, &block) + response = send_request(method, url, **options, &block) + response_error!(response) unless response.status.success? + response + end + + def send_request(method, url, **options, &block) + uri = HTTP::URI.parse(url) + + client = @client + client = client.basic_auth(user: uri.user, pass: uri.password) if uri.user || uri.password + client = block.call(client) if block + + client.request(method, url, options) + rescue => exception + request_error!(exception) + end + + # Yields chunks of the response body to the block. + def stream_body(response, &block) + response.body.each(&block) + rescue => exception + request_error!(exception) + ensure + response.connection.close unless @client.persistent? + end + + # Raises non-sucessful response as a Down::ResponseError. + def response_error!(response) + args = [response.status.to_s, response] + + case response.code + when 404 then raise Down::NotFound.new(*args) + when 400..499 then raise Down::ClientError.new(*args) + when 500..599 then raise Down::ServerError.new(*args) + else raise Down::ResponseError.new(*args) + end + end + + # Re-raise HTTP.rb exceptions as Down::Error exceptions. + def request_error!(exception) + case exception + when HTTP::Request::UnsupportedSchemeError, Addressable::URI::InvalidURIError + raise Down::InvalidUrl, exception.message + when HTTP::ConnectionError + raise Down::ConnectionError, exception.message + when HTTP::TimeoutError + raise Down::TimeoutError, exception.message + when HTTP::Redirector::TooManyRedirectsError + raise Down::TooManyRedirects, exception.message + when OpenSSL::SSL::SSLError + raise Down::SSLError, exception.message + else + raise exception + end + end + + # Defines some additional attributes for the returned Tempfile. + module DownloadedFile + attr_accessor :url, :headers + + def original_filename + Utils.filename_from_content_disposition(headers["Content-Disposition"]) || + Utils.filename_from_path(HTTP::URI.parse(url).path) + end + + def content_type + HTTP::ContentType.parse(headers["Content-Type"]).mime_type + end + + def charset + HTTP::ContentType.parse(headers["Content-Type"]).charset + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/net_http.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/net_http.rb new file mode 100644 index 0000000..f5477a4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/net_http.rb @@ -0,0 +1,393 @@ +# frozen-string-literal: true + +require "open-uri" +require "net/https" +require "addressable/uri" + +require "down/backend" + +require "tempfile" +require "fileutils" + +module Down + # Provides streaming downloads implemented with Net::HTTP and open-uri. + class NetHttp < Backend + URI_NORMALIZER = -> (url) do + addressable_uri = Addressable::URI.parse(url) + addressable_uri.normalize.to_s + end + + # Initializes the backend with common defaults. + def initialize(*args, **options) + @options = merge_options({ + headers: { "User-Agent" => "Down/#{Down::VERSION}" }, + max_redirects: 2, + open_timeout: 30, + read_timeout: 30, + uri_normalizer: URI_NORMALIZER, + }, *args, **options) + end + + # Downloads a remote file to disk using open-uri. Accepts any open-uri + # options, and a few more. + def download(url, *args, **options) + options = merge_options(@options, *args, **options) + + max_size = options.delete(:max_size) + max_redirects = options.delete(:max_redirects) + progress_proc = options.delete(:progress_proc) + content_length_proc = options.delete(:content_length_proc) + destination = options.delete(:destination) + headers = options.delete(:headers) + uri_normalizer = options.delete(:uri_normalizer) + + # Use open-uri's :content_lenth_proc or :progress_proc to raise an + # exception early if the file is too large. + # + # Also disable following redirects, as we'll provide our own + # implementation that has the ability to limit the number of redirects. + open_uri_options = { + content_length_proc: proc { |size| + if size && max_size && size > max_size + raise Down::TooLarge, "file is too large (#{size/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + content_length_proc.call(size) if content_length_proc + }, + progress_proc: proc { |current_size| + if max_size && current_size > max_size + raise Down::TooLarge, "file is too large (#{current_size/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + progress_proc.call(current_size) if progress_proc + }, + redirect: false, + } + + # Handle basic authentication in the :proxy option. + if options[:proxy] + proxy = URI(options.delete(:proxy)) + user = proxy.user + password = proxy.password + + if user || password + proxy.user = nil + proxy.password = nil + + open_uri_options[:proxy_http_basic_authentication] = [proxy.to_s, user, password] + else + open_uri_options[:proxy] = proxy.to_s + end + end + + open_uri_options.merge!(options) + open_uri_options.merge!(headers) + + uri = ensure_uri(normalize_uri(url, uri_normalizer: uri_normalizer)) + + # Handle basic authentication in the remote URL. + if uri.user || uri.password + open_uri_options[:http_basic_authentication] ||= [uri.user, uri.password] + uri.user = nil + uri.password = nil + end + + open_uri_file = open_uri(uri, open_uri_options, follows_remaining: max_redirects) + + # Handle the fact that open-uri returns StringIOs for small files. + tempfile = ensure_tempfile(open_uri_file, File.extname(open_uri_file.base_uri.path)) + OpenURI::Meta.init tempfile, open_uri_file # add back open-uri methods + tempfile.extend Down::NetHttp::DownloadedFile + + download_result(tempfile, destination) + end + + # Starts retrieving the remote file using Net::HTTP and returns an IO-like + # object which downloads the response body on-demand. + def open(url, *args, **options) + options = merge_options(@options, *args, **options) + + max_redirects = options.delete(:max_redirects) + uri_normalizer = options.delete(:uri_normalizer) + + uri = ensure_uri(normalize_uri(url, uri_normalizer: uri_normalizer)) + + # Create a Fiber that halts when response headers are received. + request = Fiber.new do + net_http_request(uri, options, follows_remaining: max_redirects) do |response| + Fiber.yield response + end + end + + response = request.resume + + response_error!(response) unless response.is_a?(Net::HTTPSuccess) + + # Build an IO-like object that will retrieve response body on-demand. + Down::ChunkedIO.new( + chunks: enum_for(:stream_body, response), + size: response["Content-Length"] && response["Content-Length"].to_i, + encoding: response.type_params["charset"], + rewindable: options.fetch(:rewindable, true), + on_close: -> { request.resume }, # close HTTP connnection + data: { + status: response.code.to_i, + headers: response.each_header.inject({}) { |headers, (downcased_name, value)| + name = downcased_name.split("-").map(&:capitalize).join("-") + headers.merge!(name => value) + }, + response: response, + }, + ) + end + + private + + # Calls open-uri's URI::HTTP#open method. Additionally handles redirects. + def open_uri(uri, options, follows_remaining:) + uri.open(options) + rescue OpenURI::HTTPRedirect => exception + raise Down::TooManyRedirects, "too many redirects" if follows_remaining == 0 + + # fail if redirect URI scheme is not http or https + begin + uri = ensure_uri(exception.uri) + rescue Down::InvalidUrl + response = rebuild_response_from_open_uri_exception(exception) + + raise ResponseError.new("Invalid Redirect URI: #{exception.uri}", response: response) + end + + # forward cookies on the redirect + if !exception.io.meta["set-cookie"].to_s.empty? + options["Cookie"] ||= '' + # Add new cookies avoiding duplication + new_cookies = exception.io.meta["set-cookie"].to_s.split(',').map(&:strip) + old_cookies = options["Cookie"].split(',') + options["Cookie"] = (old_cookies | new_cookies).join(',') + end + + follows_remaining -= 1 + retry + rescue OpenURI::HTTPError => exception + response = rebuild_response_from_open_uri_exception(exception) + + # open-uri attempts to parse the redirect URI, so we re-raise that exception + if exception.message.include?("(Invalid Location URI)") + raise ResponseError.new("Invalid Redirect URI: #{response["Location"]}", response: response) + end + + response_error!(response) + rescue => exception + request_error!(exception) + end + + # Converts the given IO into a Tempfile if it isn't one already (open-uri + # returns a StringIO when there is less than 10KB of content), and gives + # it the specified file extension. + def ensure_tempfile(io, extension) + tempfile = Tempfile.new(["down-net_http", extension], binmode: true) + + if io.is_a?(Tempfile) + # Windows requires file descriptors to be closed before files are moved + io.close + tempfile.close + FileUtils.mv io.path, tempfile.path + else + IO.copy_stream(io, tempfile) + io.close + end + + tempfile.open + tempfile + end + + # Makes a Net::HTTP request and follows redirects. + def net_http_request(uri, options, follows_remaining:, &block) + http, request = create_net_http(uri, options) + + begin + response = http.start do + http.request(request) do |resp| + unless resp.is_a?(Net::HTTPRedirection) + yield resp + # In certain cases the caller wants to download only one portion + # of the file and close the connection, so we tell Net::HTTP that + # it shouldn't continue retrieving it. + resp.instance_variable_set("@read", true) + end + end + end + rescue => exception + request_error!(exception) + end + + if response.is_a?(Net::HTTPNotModified) + raise Down::NotModified + elsif response.is_a?(Net::HTTPRedirection) + raise Down::TooManyRedirects if follows_remaining == 0 + + # fail if redirect URI is not a valid http or https URL + begin + location = ensure_uri(response["Location"], allow_relative: true) + rescue Down::InvalidUrl + raise ResponseError.new("Invalid Redirect URI: #{response["Location"]}", response: response) + end + + # handle relative redirects + location = uri + location if location.relative? + + net_http_request(location, options, follows_remaining: follows_remaining - 1, &block) + end + end + + # Build a Net::HTTP object for making a request. + def create_net_http(uri, options) + http_class = Net::HTTP + + if options[:proxy] + proxy = URI(options[:proxy]) + http_class = Net::HTTP::Proxy(proxy.hostname, proxy.port, proxy.user, proxy.password) + end + + http = http_class.new(uri.host, uri.port) + + # Handle SSL parameters (taken from the open-uri implementation). + if uri.is_a?(URI::HTTPS) + http.use_ssl = true + http.verify_mode = options[:ssl_verify_mode] || OpenSSL::SSL::VERIFY_PEER + store = OpenSSL::X509::Store.new + if options[:ssl_ca_cert] + Array(options[:ssl_ca_cert]).each do |cert| + File.directory?(cert) ? store.add_path(cert) : store.add_file(cert) + end + else + store.set_default_paths + end + http.cert_store = store + end + + http.read_timeout = options[:read_timeout] if options.key?(:read_timeout) + http.open_timeout = options[:open_timeout] if options.key?(:open_timeout) + + headers = options[:headers].to_h + headers["Accept-Encoding"] = "" # Net::HTTP's inflater causes FiberErrors + + get = Net::HTTP::Get.new(uri.request_uri, headers) + + user, password = options[:http_basic_authentication] || [uri.user, uri.password] + get.basic_auth(user, password) if user || password + + [http, get] + end + + # Yields chunks of the response body to the block. + def stream_body(response, &block) + response.read_body(&block) + rescue => exception + request_error!(exception) + end + + # Checks that the url is a valid URI and that its scheme is http or https. + def ensure_uri(url, allow_relative: false) + begin + uri = URI(url) + rescue URI::InvalidURIError => exception + raise Down::InvalidUrl, exception.message + end + + unless allow_relative && uri.relative? + raise Down::InvalidUrl, "URL scheme needs to be http or https: #{uri}" unless uri.is_a?(URI::HTTP) + end + + uri + end + + # Makes sure that the URL is properly encoded. + def normalize_uri(url, uri_normalizer:) + URI(url) + rescue URI::InvalidURIError + uri_normalizer.call(url) + end + + # When open-uri raises an exception, it doesn't expose the response object. + # Fortunately, the exception object holds response data that can be used to + # rebuild the Net::HTTP response object. + def rebuild_response_from_open_uri_exception(exception) + code, message = exception.io.status + + response_class = Net::HTTPResponse::CODE_TO_OBJ.fetch(code) do |c| + Net::HTTPResponse::CODE_CLASS_TO_OBJ.fetch(c[0]) do + Net::HTTPUnknownResponse + end + end + response = response_class.new(nil, code, message) + + exception.io.metas.each do |name, values| + values.each { |value| response.add_field(name, value) } + end + + response + end + + # Raises non-sucessful response as a Down::ResponseError. + def response_error!(response) + code = response.code.to_i + message = response.message.split(" ").map(&:capitalize).join(" ") + + args = ["#{code} #{message}", response] + + case response.code.to_i + when 404 then raise Down::NotFound.new(*args) + when 400..499 then raise Down::ClientError.new(*args) + when 500..599 then raise Down::ServerError.new(*args) + else raise Down::ResponseError.new(*args) + end + end + + # Re-raise Net::HTTP exceptions as Down::Error exceptions. + def request_error!(exception) + case exception + when Net::OpenTimeout + raise Down::TimeoutError, "timed out waiting for connection to open" + when Net::ReadTimeout + raise Down::TimeoutError, "timed out while reading data" + when EOFError, IOError, SocketError, SystemCallError + raise Down::ConnectionError, exception.message + when OpenSSL::SSL::SSLError + raise Down::SSLError, exception.message + else + raise exception + end + end + + # Merge default and ad-hoc options, merging nested headers. + def merge_options(options, headers = {}, **new_options) + # Deprecate passing headers as top-level options, taking into account + # that Ruby 2.7+ accepts kwargs with string keys. + if headers.any? + warn %([Down::NetHttp] Passing headers as top-level options has been deprecated, use the :headers option instead, e.g: `Down::NetHttp.download(headers: { "Key" => "Value", ... }, ...)`) + new_options[:headers] = headers + elsif new_options.any? { |key, value| key.is_a?(String) } + warn %([Down::NetHttp] Passing headers as top-level options has been deprecated, use the :headers option instead, e.g: `Down::NetHttp.download(headers: { "Key" => "Value", ... }, ...)`) + new_options[:headers] = new_options.select { |key, value| key.is_a?(String) } + new_options.reject! { |key, value| key.is_a?(String) } + end + + options.merge(new_options) do |key, value1, value2| + key == :headers ? value1.merge(value2) : value2 + end + end + + # Defines some additional attributes for the returned Tempfile (on top of what + # OpenURI::Meta already defines). + module DownloadedFile + def original_filename + Utils.filename_from_content_disposition(meta["content-disposition"]) || + Utils.filename_from_path(base_uri.path) + end + + def content_type + super unless meta["content-type"].to_s.empty? + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/utils.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/utils.rb new file mode 100644 index 0000000..711077f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/utils.rb @@ -0,0 +1,27 @@ +require "cgi" + +module Down + module Utils + module_function + + # Retrieves potential filename from the "Content-Disposition" header. + def filename_from_content_disposition(content_disposition) + content_disposition = content_disposition.to_s + + escaped_filename = + content_disposition[/filename\*=UTF-8''(\S+)/, 1] || + content_disposition[/filename="([^"]*)"/, 1] || + content_disposition[/filename=(\S+)/, 1] + + filename = CGI.unescape(escaped_filename.to_s) + + filename unless filename.empty? + end + + # Retrieves potential filename from the URL path. + def filename_from_path(path) + filename = path.split("/").last + CGI.unescape(filename) if filename + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/version.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/version.rb new file mode 100644 index 0000000..1cecf73 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/version.rb @@ -0,0 +1,5 @@ +# frozen-string-literal: true + +module Down + VERSION = "5.2.4" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/wget.rb b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/wget.rb new file mode 100644 index 0000000..9df19f2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/down-5.2.4/lib/down/wget.rb @@ -0,0 +1,248 @@ +# frozen-string-literal: true + +begin + require "posix-spawn" +rescue LoadError + require "open3" +end +require "http_parser" + +require "down/backend" + +require "tempfile" +require "uri" + +module Down + # Provides streaming downloads implemented with the wget command-line tool. + # The design is very similar to Down::Http. + class Wget < Backend + # Initializes the backend with common defaults. + def initialize(*arguments) + @arguments = [ + user_agent: "Down/#{Down::VERSION}", + max_redirect: 2, + dns_timeout: 30, + connect_timeout: 30, + read_timeout: 30, + ] + arguments + end + + # Downlods the remote file to disk. Accepts wget command-line options and + # some additional options as well. + def download(url, *args, max_size: nil, content_length_proc: nil, progress_proc: nil, destination: nil, **options) + io = open(url, *args, **options, rewindable: false) + + content_length_proc.call(io.size) if content_length_proc && io.size + + if max_size && io.size && io.size > max_size + raise Down::TooLarge, "file is too large (#{io.size/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + + extname = File.extname(URI(url).path) + tempfile = Tempfile.new(["down-wget", extname], binmode: true) + + until io.eof? + chunk = io.readpartial(nil, buffer ||= String.new) + + tempfile.write(chunk) + + progress_proc.call(tempfile.size) if progress_proc + + if max_size && tempfile.size > max_size + raise Down::TooLarge, "file is too large (#{tempfile.size/1024/1024}MB, max is #{max_size/1024/1024}MB)" + end + end + + tempfile.open # flush written content + + tempfile.extend Down::Wget::DownloadedFile + tempfile.url = url + tempfile.headers = io.data[:headers] + + download_result(tempfile, destination) + rescue + tempfile.close! if tempfile + raise + ensure + io.close if io + end + + # Starts retrieving the remote file and returns an IO-like object which + # downloads the response body on-demand. Accepts wget command-line options. + def open(url, *args, rewindable: true, **options) + arguments = generate_command(url, *args, **options) + + command = Down::Wget::Command.execute(arguments) + # Wrap the wget command output in an IO-like object. + output = Down::ChunkedIO.new( + chunks: command.enum_for(:output), + on_close: command.method(:terminate), + rewindable: false, + ) + + # https://github.com/tmm1/http_parser.rb/issues/29#issuecomment-309976363 + header_string = output.readpartial + header_string << output.readpartial until header_string.include?("\r\n\r\n") + header_string, first_chunk = header_string.split("\r\n\r\n", 2) + + # Use an HTTP parser to parse out the response headers. + parser = HTTP::Parser.new + parser << header_string + + if parser.headers.nil? + output.close + raise Down::Error, "failed to parse response headers" + end + + headers = parser.headers + status = parser.status_code + + content_length = headers["Content-Length"].to_i if headers["Content-Length"] + charset = headers["Content-Type"][/;\s*charset=([^;]+)/i, 1] if headers["Content-Type"] + + # Create an Enumerator which will lazily retrieve chunks of response body. + chunks = Enumerator.new do |yielder| + yielder << first_chunk if first_chunk + yielder << output.readpartial until output.eof? + end + + Down::ChunkedIO.new( + chunks: chunks, + size: content_length, + encoding: charset, + rewindable: rewindable, + on_close: output.method(:close), + data: { status: status, headers: headers }, + ) + end + + private + + # Generates the wget command. + def generate_command(url, *args, **options) + command = %W[wget --no-verbose --save-headers -O -] + + options = @arguments.grep(Hash).inject({}, :merge).merge(options) + args = @arguments.grep(->(o){!o.is_a?(Hash)}) + args + + (args + options.to_a).each do |option, value| + if option.is_a?(String) + command << option + elsif option.length == 1 + command << "-#{option}" + else + command << "--#{option.to_s.gsub("_", "-")}" + end + + command << value.to_s unless value.nil? + end + + command << url + command + end + + # Handles executing the wget command. + class Command + PIPE_BUFFER_SIZE = 64*1024 + + def self.execute(arguments) + # posix-spawn gem has better performance, so we use it if it's available + if defined?(POSIX::Spawn) + pid, stdin_pipe, stdout_pipe, stderr_pipe = POSIX::Spawn.popen4(*arguments) + status_reaper = Process.detach(pid) + else + stdin_pipe, stdout_pipe, stderr_pipe, status_reaper = Open3.popen3(*arguments) + end + + stdin_pipe.close + [stdout_pipe, stderr_pipe].each(&:binmode) + + new(stdout_pipe, stderr_pipe, status_reaper) + rescue Errno::ENOENT + raise Down::Error, "wget is not installed" + end + + def initialize(stdout_pipe, stderr_pipe, status_reaper) + @status_reaper = status_reaper + @stdout_pipe = stdout_pipe + @stderr_pipe = stderr_pipe + end + + # Yields chunks of stdout. At the end handles the exit status. + def output + # Keep emptying the stderr buffer, to allow the subprocess to send more + # than 64KB if it wants to. + stderr_reader = Thread.new { @stderr_pipe.read } + + yield @stdout_pipe.readpartial(PIPE_BUFFER_SIZE) until @stdout_pipe.eof? + + status = @status_reaper.value + stderr = stderr_reader.value + + close + + handle_status(status, stderr) + end + + def terminate + begin + Process.kill("TERM", @status_reaper[:pid]) + Process.waitpid(@status_reaper[:pid]) + rescue Errno::ESRCH + # process has already terminated + end + + close + end + + def close + @stdout_pipe.close unless @stdout_pipe.closed? + @stderr_pipe.close unless @stderr_pipe.closed? + end + + private + + # Translates nonzero wget exit statuses into exceptions. + def handle_status(status, stderr) + case status.exitstatus + when 0 # No problems occurred + # success + when 1, # Generic error code + 2, # Parse error---for instance, when parsing command-line options, the .wgetrc or .netrc... + 3 # File I/O error + raise Down::Error, stderr + when 4 # Network failure + raise Down::TimeoutError, stderr if stderr.include?("timed out") + raise Down::ConnectionError, stderr + when 5 # SSL verification failure + raise Down::SSLError, stderr + when 6 # Username/password authentication failure + raise Down::ClientError, stderr + when 7 # Protocol errors + raise Down::Error, stderr + when 8 # Server issued an error response + raise Down::TooManyRedirects, stderr if stderr.include?("redirections exceeded") + raise Down::ResponseError, stderr + end + end + end + + # Adds additional attributes to the Tempfile returned in #download. + module DownloadedFile + attr_accessor :url, :headers + + def original_filename + Utils.filename_from_content_disposition(headers["Content-Disposition"]) || + Utils.filename_from_path(URI.parse(url).path) + end + + def content_type + headers["Content-Type"].to_s.split(";").first + end + + def charset + headers["Content-Type"].to_s[/;\s*charset=([^;]+)/i, 1] + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.gitignore b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.gitignore new file mode 100644 index 0000000..43bbef6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.gitignore @@ -0,0 +1,24 @@ +.DS_Store +*.tmp +*~ +*#* +vendor +.sass-cache +.bundle +config.yml +*.gem +*.rbc +.config +.yardoc +InstalledFiles +_yardoc +coverage +doc/ +lib/bundler/man +pkg +rdoc +spec/reports +test/tmp +test/version_tmp +tmp +.ruby-version \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.travis.yml new file mode 100644 index 0000000..9bb57b8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/.travis.yml @@ -0,0 +1,7 @@ +language: ruby +rvm: + - 2.1.0 + - 2.2.7 + - 2.3.4 + - 2.4.1 + diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Gemfile b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Gemfile new file mode 100644 index 0000000..c0c4bae --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in event_emitter.gemspec +gemspec diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/History.txt b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/History.txt new file mode 100644 index 0000000..d570448 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/History.txt @@ -0,0 +1,63 @@ +=== 0.2.6 2013-07-25 + +* Update Travis ruby versions (#16) +* Fix Fixnum warning on Ruby 2.4+ (#15) + +=== 0.2.5 2013-03-31 + +* add benchmark + +=== 0.2.4 2013-03-21 + +* bugfix multiple once error + +=== 0.2.3 2013-03-05 + +* catch all events with "EventEmitter#on :*" + +=== 0.2.2 2013-01-04 + +* bugfix + +=== 0.2.1 2013-01-04 + +* use bundler gem template + +=== 0.2.0 2012-12-16 + +* remove_listener +* fix method-name duplication + +=== 0.1.0 2012-11-15 + +* support on/emit multiple arguments + +=== 0.0.7 2012-11-09 + +* on/emit without any args +* add tests + +=== 0.0.6 2012-11-09 + +* add sample + +=== 0.0.5 2012-11-08 + +* add github page link + +=== 0.0.4 2012-11-08 + +* instance-specific method with EventEmitter.apply(instance) + +=== 0.0.3 2012-11-08 + +* call listener with Object#instance_exec + +=== 0.0.2 2012-11-07 + +* EventEmitter#once : call listener only first time +* EventEmitter#add_listener, remove_listener + +=== 0.0.1 2012-11-07 + +* implement "on" and "emit" diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/LICENSE.txt new file mode 100644 index 0000000..9752632 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2012 Sho Hashimoto + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/README.md b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/README.md new file mode 100644 index 0000000..a06b209 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/README.md @@ -0,0 +1,119 @@ +event_emitter +============= + +* Ruby port of EventEmitter from Node.js +* http://shokai.github.com/event_emitter + +[![Build Status](https://travis-ci.org/shokai/event_emitter.svg)](https://travis-ci.org/shokai/event_emitter) + + +Install +------- + + % gem install event_emitter + + +Requirements +------------ + +testing on + +* Ruby 1.8.7 +* Ruby 1.9.2 +* Ruby 2.0.0 +* Ruby 2.1.0 +* JRuby + + +Synopsys +-------- + +load rubygem +```ruby +require "rubygems" +require "event_emitter" +``` + +include +```ruby +class User + include EventEmitter + attr_accessor :name +end +``` + +regist event listener +```ruby +user = User.new +user.name = "shokai" +user.on :go do |data| + puts "#{name} go to #{data[:place]}" +end +``` + +call event +```ruby +user.emit :go, {:place => "mountain"} +# => "shokai go to mountain" +``` + +regist event using "once" +```ruby +user.once :eat do |what, where| + puts "#{name} -> eat #{what} at #{where}" +end +``` + +call +```ruby +user.emit :eat, "BEEF", "zanmai" # => "shokai -> eat BEEF at zanmai" +user.emit :eat, "Ramen", "marutomo" # => do not call. call only first time. +``` + +apply as instance-specific method +```ruby +class Foo +end + +foo = Foo.new +EventEmitter.apply foo +``` + +remove event listener +```ruby +user.remove_listener :go +user.remove_listener event_id +``` + +catch all events +```ruby +user.on :* do |event_name, args| + puts event_name + " called" + p args +end +``` + +see samples https://github.com/shokai/event_emitter/tree/master/samples + + +Test +---- + + % gem install bundler + % bundle install + % rake test + + +Benchmark +--------- + + % rake benchmark + + +Contributing +------------ +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Rakefile b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Rakefile new file mode 100644 index 0000000..30846eb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/Rakefile @@ -0,0 +1,14 @@ +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new do |t| + t.pattern = "test/test_*.rb" +end + +task :default => :test + +desc "run eventemitter benchmark" +task :benchmark do + require File.expand_path 'benchmark/benchmark', File.dirname(__FILE__) + Bench.run +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark.rb new file mode 100644 index 0000000..c5304a2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark.rb @@ -0,0 +1,57 @@ +#!/usr/bin/env ruby +require File.expand_path 'benchmark_helper', File.dirname(__FILE__) + +class Bench + + class Foo + include EventEmitter + end + + def bench_1on_100Kemit + foo = Foo.new + count = 0 + foo.on :bar do |num| + count += num + end + 100000.times do + foo.emit :bar, 1 + end + raise Error, "test code error" unless count == 100000 + end + + def bench_1Kon_1Kemit + foo = Foo.new + count = 0 + (1000-1).times do + foo.on :bar do + end + end + foo.on :bar do |num| + count += num + end + 1000.times do + foo.emit :bar, 1 + end + raise Error, "test code error" unless count == 1000 + end + + def bench_100Kon_1emit + foo = Foo.new + count = 0 + 1.upto(100000-1).each do |i| + foo.on "bar_#{i}" do + end + end + foo.on :bar do |num| + count += num + end + foo.emit :bar, 1 + raise Error, "test code error" unless count == 1 + end + +end + + +if __FILE__ == $0 + Bench.run +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark_helper.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark_helper.rb new file mode 100644 index 0000000..16e6cef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/benchmark/benchmark_helper.rb @@ -0,0 +1,22 @@ +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' +require 'benchmark' + +class Bench + + class Error < StandardError + end + + def self.run + puts "ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]" + bench = self.new + Benchmark.bm do |x| + bench.methods.select{|i| i.to_s =~ /^bench_(.+)$/}.sort.each do |m| + x.report m.to_s.scan(/^bench_(.+)$/)[0][0] do + bench.__send__ m + end + end + end + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/event_emitter.gemspec b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/event_emitter.gemspec new file mode 100644 index 0000000..afed763 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/event_emitter.gemspec @@ -0,0 +1,22 @@ +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'event_emitter/version' + +Gem::Specification.new do |gem| + gem.name = "event_emitter" + gem.version = EventEmitter::VERSION + gem.authors = ["Sho Hashimoto"] + gem.email = ["hashimoto@shokai.org"] + gem.description = %q{Ruby port of EventEmitter from Node.js} + gem.summary = gem.description + gem.homepage = "http://shokai.github.com/event_emitter" + + gem.files = `git ls-files`.split($/).reject{|i| i=="Gemfile.lock" } + gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.require_paths = ["lib"] + + gem.add_development_dependency "minitest" + gem.add_development_dependency "rake" + gem.add_development_dependency "bundler", "~> 1.15" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter.rb new file mode 100644 index 0000000..8c62ca1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter.rb @@ -0,0 +1,5 @@ +$:.unshift(File.dirname(__FILE__)) unless + $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) + +require 'event_emitter/emitter' +require 'event_emitter/version' diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/emitter.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/emitter.rb new file mode 100644 index 0000000..444c13c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/emitter.rb @@ -0,0 +1,71 @@ + +module EventEmitter + def self.included(klass) + # klass.extend ClassMethods + klass.__send__ :include, InstanceMethods + end + + def self.apply(object) + object.extend InstanceMethods + end + + module ClassMethods + end + + module InstanceMethods + def __events + @__events ||= [] + end + + def add_listener(type, params={}, &block) + raise ArgumentError, 'listener block not given' unless block_given? + id = __events.empty? ? 0 : __events.last[:id]+1 + __events << { + :type => type.to_sym, + :listener => block, + :params => params, + :id => id + } + id + end + + alias :on :add_listener + + def remove_listener(id_or_type) + if id_or_type.is_a? Integer + __events.delete_if do |e| + e[:id] == id_or_type + end + elsif [String, Symbol].include? id_or_type.class + __events.delete_if do |e| + e[:type] == id_or_type.to_sym + end + end + end + + def emit(type, *data) + type = type.to_sym + __events.each do |e| + case e[:type] + when type + listener = e[:listener] + e[:type] = nil if e[:params][:once] + instance_exec(*data, &listener) + when :* + listener = e[:listener] + e[:type] = nil if e[:params][:once] + instance_exec(type, *data, &listener) + end + end + __events.each do |e| + remove_listener e[:id] unless e[:type] + end + end + + def once(type, &block) + add_listener type, {:once => true}, &block + end + + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/version.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/version.rb new file mode 100644 index 0000000..b00ee42 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/lib/event_emitter/version.rb @@ -0,0 +1,3 @@ +module EventEmitter + VERSION = '0.2.6' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/class-method.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/class-method.rb new file mode 100644 index 0000000..431eabe --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/class-method.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' + +class DB + def self.connect + self.emit :connect, :connected + end +end + +EventEmitter.apply DB + +DB.on :connect do |status| + puts status +end + +DB.connect diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/instance-specific-method.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/instance-specific-method.rb new file mode 100644 index 0000000..b883cfd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/instance-specific-method.rb @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' + +class User + attr_accessor :name + def initialize(name) + @name = name + end +end + +shokai = User.new "shokai" +ymrl = User.new "ymrl" +EventEmitter.apply shokai ## set instance-specific method + +shokai.on :go do |data| + puts "#{name} go to #{data[:place]}" +end + +shokai.emit :go, :place => "chiba city" + +## raise undefined-method error +begin + ymrl.on :go do |data| + puts "#{name} go to #{data[:place]}" + end +rescue => e + STDERR.puts e +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/sample.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/sample.rb new file mode 100644 index 0000000..bc2a4e7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/sample.rb @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' + +class User + include EventEmitter + attr_accessor :name + + def initialize(name) + @name = name + end +end + +shokai = User.new 'shokai' +ymrl = User.new 'ymrl' + +shokai.on :go do |data| + puts "#{name} go to #{data[:place]}" +end +ymrl.on :go do |data| + puts "#{name} go to #{data[:place]}" +end + +shokai.emit :go, {:place => 'mountain'} +ymrl.emit :go, :place => 'cyberspace' + + +shokai.once :eat do |what, where| + puts "#{name} -> #{what} at #{where}" +end + +shokai.emit :eat, 'BEEF', 'zanmai' +shokai.emit :eat, 'Ramen', 'marutomo' # do not call. call only first time if regist with "once" diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/timer.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/timer.rb new file mode 100644 index 0000000..e0548d0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/samples/timer.rb @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' + +class Timer + include EventEmitter + + def start(sec, count) + count.times do + sleep sec + emit :tick + end + emit :end + end +end + +timer = Timer.new + +timer.on :tick do + puts Time.now +end + +timer.once :tick do + puts "timer start" +end + +timer.on :end do + puts "timer end" +end + +timer.start 1, 5 diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_catch_all_events.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_catch_all_events.rb new file mode 100644 index 0000000..c764f41 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_catch_all_events.rb @@ -0,0 +1,61 @@ +require File.expand_path 'test_helper', File.dirname(__FILE__) + +class TestCatchAllEvents < MiniTest::Test + + class Foo + include EventEmitter + attr_accessor :created_at + end + + def setup + @foo = Foo.new + @foo.created_at = @now = Time.now + end + + def test_catch_all_emits + created_at = nil + created_at_ = nil + called_event = nil + @foo.on :* do |event| + called_event = event + created_at = self.created_at + end + @foo.on :bar do + created_at_ = self.created_at + end + @foo.emit :bar + + assert created_at == @now + assert called_event == :bar + assert created_at_ == @now + end + + def test_catch_all_emits_with_args + arg1_ = nil + arg2_ = nil + called_event = nil + @foo.on :* do |event, arg1, arg2| + called_event = event + arg1_ = arg1 + arg2_ = arg2 + end + @foo.emit :bar, 'kazusuke', 'zanmai' + + assert called_event == :bar + assert arg1_ == 'kazusuke' + assert arg2_ == 'zanmai' + end + + def test_once + total = 0 + @foo.once :* do |event, data| + total += data[:num] if event == :add + end + + @foo.emit :add, :num => 10 + assert total == 10, 'first call' + @foo.emit :add, :num => 5 + assert total == 10, 'call listener only first time' + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_class_method.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_class_method.rb new file mode 100644 index 0000000..3c2055c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_class_method.rb @@ -0,0 +1,113 @@ +require File.expand_path 'test_helper', File.dirname(__FILE__) + +class TestClassMethod < MiniTest::Test + + class Foo + def self.created_at + @@created_at + end + def self.created_at=(time) + @@created_at = time + end + end + + def setup + Foo.created_at = @now = Time.now + EventEmitter.apply Foo + end + + def test_simple + created_at = nil + Foo.on :bar do + created_at = self.created_at + end + Foo.emit :bar + + assert created_at == @now + end + + def test_on_emit + result = nil + created_at = nil + Foo.on :chat do |data| + result = data + created_at = self.created_at + end + + Foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_on_emit_multiargs + _user = nil + _message = nil + _session = nil + created_at = nil + Foo.on :chat2 do |user, message, session| + _user = user + _message = message + _session = session + created_at = self.created_at + end + + sid = Time.now.to_i + Foo.emit :chat2, 'shokai', 'hello world', sid + + assert _user == 'shokai' + assert _message == 'hello world' + assert _session == sid + assert created_at == @now, 'instance method' + end + + def test_add_listener + result = nil + created_at = nil + Foo.add_listener :chat do |data| + result = data + created_at = self.created_at + end + + Foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_remove_listener + size = Foo.__events.size + + Foo.on :foo do |data| + puts "bar #{data}" + end + Foo.on :foo do |data| + puts "barbar: #{data}" + end + + id = Foo.on :baz do |data| + p data + end + + assert Foo.__events.size == size+3, 'check registerd listener count' + Foo.remove_listener id + assert Foo.__events.size == size+2, 'remove listener by id' + + Foo.remove_listener :foo + assert Foo.__events.size == size, 'remove all "foo" listener' + end + + def test_once + total = 0 + Foo.once :add do |data| + total += data + end + + Foo.emit :add, 1 + assert total == 1, 'first call' + Foo.emit :add, 1 + assert total == 1, 'call listener only first time' + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_event_emitter.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_event_emitter.rb new file mode 100644 index 0000000..b1b7376 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_event_emitter.rb @@ -0,0 +1,143 @@ +require File.expand_path 'test_helper', File.dirname(__FILE__) + +class TestEventEmitter < MiniTest::Test + + class Foo + include EventEmitter + attr_accessor :created_at + end + + def setup + @foo = Foo.new + @foo.created_at = @now = Time.now + end + + def test_simple + created_at = nil + @foo.on :bar do + created_at = self.created_at + end + @foo.emit :bar + + assert created_at == @now + end + + def test_string_event_name + created_at = nil + @foo.on "bar" do + created_at = self.created_at + end + @foo.emit :bar + end + + def test_on_emit + result = nil + created_at = nil + @foo.on :chat do |data| + result = data + created_at = self.created_at + end + + @foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_on_emit_multiargs + _user = nil + _message = nil + _session = nil + created_at = nil + @foo.on :chat do |user, message, session| + _user = user + _message = message + _session = session + created_at = self.created_at + end + + sid = Time.now.to_i + @foo.emit :chat, 'shokai', 'hello world', sid + + assert _user == 'shokai' + assert _message == 'hello world' + assert _session == sid + assert created_at == @now, 'instance method' + end + + def test_add_listener + result = nil + created_at = nil + @foo.add_listener :chat do |data| + result = data + created_at = self.created_at + end + + @foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_remove_listener + @foo.on :bar do |data| + puts "bar #{data}" + end + @foo.on :bar do |data| + puts "barbar: #{data}" + end + + id = @foo.on :baz do |data| + p data + end + + assert @foo.__events.size == 3, 'check registerd listener count' + @foo.remove_listener id + assert @foo.__events.size == 2, 'remove listener by id' + + @foo.remove_listener :bar + assert @foo.__events.size == 0, 'remove all "bar" listener' + end + + def test_once + total = 0 + @foo.once :add do |num| + total += num + end + + @foo.emit :add, 1 + assert total == 1, 'first call' + @foo.emit :add, 1 + assert total == 1, 'call listener only first time' + end + + def test_multiple_once + total = 0 + @foo.on :add do |num| + total += num + end + + @foo.once :add do |num| + total += num + end + + @foo.once :add do |num| + total += num + end + + @foo.once :add do |num| + total += num + end + + @foo.once :add do |num| + total += num + end + + @foo.emit :add, 1 + assert total == 5, 'first call' + @foo.emit :add, 1 + assert total == 6, 'call' + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_helper.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_helper.rb new file mode 100644 index 0000000..2f4ed46 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_helper.rb @@ -0,0 +1,6 @@ +require 'rubygems' +require 'bundler/setup' +require 'minitest/autorun' + +$:.unshift File.expand_path '../lib', File.dirname(__FILE__) +require 'event_emitter' diff --git a/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_singular_method.rb b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_singular_method.rb new file mode 100644 index 0000000..0add7f8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/event_emitter-0.2.6/test/test_singular_method.rb @@ -0,0 +1,107 @@ +require File.expand_path 'test_helper', File.dirname(__FILE__) + +class TestSingularMethod < MiniTest::Test + + class Foo + attr_accessor :created_at + end + + def setup + @foo = Foo.new + @foo.created_at = @now = Time.now + EventEmitter.apply @foo + end + + def test_simple + created_at = nil + @foo.on :bar do + created_at = self.created_at + end + @foo.emit :bar + + assert created_at == @now + end + + def test_on_emit + result = nil + created_at = nil + @foo.on :chat do |data| + result = data + created_at = self.created_at + end + + @foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_on_emit_multiargs + _user = nil + _message = nil + _session = nil + created_at = nil + @foo.on :chat do |user, message, session| + _user = user + _message = message + _session = session + created_at = self.created_at + end + + sid = Time.now.to_i + @foo.emit :chat, 'shokai', 'hello world', sid + + assert _user == 'shokai' + assert _message == 'hello world' + assert _session == sid + assert created_at == @now, 'instance method' + end + + def test_add_listener + result = nil + created_at = nil + @foo.add_listener :chat do |data| + result = data + created_at = self.created_at + end + + @foo.emit :chat, :user => 'shokai', :message => 'hello world' + + assert result[:user] == 'shokai' + assert result[:message] == 'hello world' + assert created_at == @now, 'instance method' + end + + def test_remove_listener + @foo.on :bar do |data| + puts "bar #{data}" + end + @foo.on :bar do |data| + puts "barbar: #{data}" + end + + id = @foo.on :baz do |data| + p data + end + + assert @foo.__events.size == 3, 'check registerd listener count' + @foo.remove_listener id + assert @foo.__events.size == 2, 'remove listener by id' + + @foo.remove_listener :bar + assert @foo.__events.size == 0, 'remove all "bar" listener' + end + + def test_once + total = 0 + @foo.once :add do |data| + total += data + end + + @foo.emit :add, 1 + assert total == 1, 'first call' + @foo.emit :add, 1 + assert total == 1, 'call listener only first time' + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/CHANGELOG.md new file mode 100644 index 0000000..26b9ce7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/CHANGELOG.md @@ -0,0 +1,338 @@ +1.15.5 / 2022-01-10 +------------------- + +Fixed: +* Fix long double argument or return values on 32bit i686. #849 +* FFI::ConstGenerator: avoid usage of the same binary file simultaneously. #929 + +Added: +* Add Windows fat binary gem for Ruby-3.1 + +Removed: +* Remove Windows fat binary gem for Ruby < 2.4 + + +1.15.4 / 2021-09-01 +------------------- + +Fixed: +* Fix build for uClibc. #913 +* Correct module lookup when including `ffi-module` gem. #912 + +Changed: +* Use ruby code of the ffi gem in JRuby-9.2.20+. #915 + + +1.15.3 / 2021-06-16 +------------------- + +Fixed: +* Fix temporary packaging issue with libffi. #904 + + +1.15.2 / 2021-06-16 +------------------- + +Added: +* Add support for Windows MINGW-UCRT build. #903 +* Add `/opt/homebrew/lib/` to fallback search paths to improve homebrew support. #880 #882 + +Changed: +* Regenerate `types.conf` for FreeBSD12 aarch64. #902 + + +1.15.1 / 2021-05-22 +------------------- + +Fixed: +* Append -pthread to linker options. #893 +* Use arm or aarch64 to identify Apple ARM CPU arch. #899 +* Allow overriding `gcc` with the `CC` env var in `const_generator.rb` and `struct_generator.rb`. #897 + + +1.15.0 / 2021-03-05 +------------------- + +Fixed: +* Fix MSVC build +* Fix async callbacks in conjunction with fork(). #884 + +Added: +* Allow to pass callbacks in varargs. #885 +* Name the threads for FFI callback dispatcher and async thread calls for easier debugging. #883 + The name can be retrieved by Thread.name and is shown by Thread.list.inspect etc. + Even gdb shows the thread name on supported operating systems. +* Add types.conf for powerpc64le-linux +* Add types.conf for riscv64-linux +* More release automation of ffi gems + +Changed: +* Switch from rubygems-tasks to bundler/gem_helper + +Removed: +* Remove unused VariadicInvoker#init + + +1.14.2 / 2020-12-21 +------------------- + +Fixed: +* Fix builtin libffi on newer Ubuntu caused by an outdated Makefile.in . #863 + + +1.14.1 / 2020-12-19 +------------------- + +Changed: +* Revert changes to FFI::Pointer#write_string made in ffi-1.14.0. + It breaks compatibilty in a way that can cause hard to find errors. #857 + + +1.14.0 / 2020-12-18 +------------------- + +Added: +* Add types.conf for x86_64-msys, x86_64-haiku, aarch64-openbsd and aarch64-darwin (alias arm64-darwin) +* Add method AbstractMemory#size_limit? . #829 +* Add new extconf option --enable-libffi-alloc which is enabled per default on Apple M1 (arm64-darwin). + +Changed: +* Do NULL pointer check only when array length > 0 . #305 +* Raise an error on an unknown order argument. #830 +* Change FFI::Pointer#write_string to terminate with a NUL byte like other string methods. #805 +* Update bundled libffi to latest master. + +Removed: +* Remove win32/stdint.h and stdbool.h because of copyright issue. #693 + +Fixed: +* Fix possible UTF-8 load error in loader script interpretation. #792 +* Fix segfault on non-array argument to #write_array_of_* +* Fix memory leak in MethodHandle . #815 +* Fix possible segfault in combination with fiddle or other libffi using gems . #835 +* Fix possibility to use ffi ruby gem with JRuby-9.3 . #763 +* Fix a GC issue, when a callback Proc is used on more than 2 callback signatures. #820 + + +1.13.1 / 2020-06-09 +------------------- + +Changed: +* Revert use of `ucrtbase.dll` as default C library on Windows-MINGW. + `ucrtbase.dll` is still used on MSWIN target. #790 +* Test for `ffi_prep_closure_loc()` to make sure we can use this function. + This fixes incorrect use of system libffi on MacOS Mojave (10.14). #787 +* Update types.conf on x86_64-dragonflybsd + + +1.13.0 / 2020-06-01 +------------------- + +Added: +* Add TruffleRuby support. Almost all specs are running on TruffleRuby and succeed. #768 +* Add ruby source files to the java gem. This allows to ship the Ruby library code per platform java gem and add it as a default gem to JRuby. #763 +* Add FFI::Platform::LONG_DOUBLE_SIZE +* Add bounds checks for writing to an inline char[] . #756 +* Add long double as callback return value. #771 +* Update type definitions and add types from stdint.h and stddef.h on i386-windows, x86_64-windows, x86_64-darwin, x86_64-linux, arm-linux, powerpc-linux. #749 +* Add new type definitions for powerpc-openbsd and sparcv9-openbsd. #775, #778 + +Changed: +* Raise required ruby version to >= 2.3. +* Lots of cleanups and improvements in library, specs and benchmarks. +* Fix a lot of compiler warnings at the C-extension +* Fix several install issues on MacOS: + * Look for libffi in SDK paths, since recent versions of macOS removed it from `/usr/include` . #757 + * Fix error `ld: library not found for -lgcc_s.10.4` + * Don't built for i386 architecture as it is deprecated +* Several fixes for MSVC build on Windows. #779 +* Use `ucrtbase.dll` as default C library on Windows instead of old `msvcrt.dll`. #779 +* Update builtin libffi to fix a Powerpc issue with parameters of type long +* Allow unmodified sourcing of (the ruby code of) this gem in JRuby and TruffleRuby as a default gem. #747 +* Improve check to detect if a module has a #find_type method suitable for FFI. This fixes compatibility with stdlib `mkmf` . #776 + +Removed: +* Reject callback with `:string` return type at definition, because it didn't work so far and is not save to use. #751, #782 + + +1.12.2 / 2020-02-01 +------------------- + +* Fix possible segfault at FFI::Struct#[] and []= after GC.compact . #742 + + +1.12.1 / 2020-01-14 +------------------- + +Added: +* Add binary gem support for ruby-2.7 on Windows + + +1.12.0 / 2020-01-14 +------------------- + +Added: +* FFI::VERSION is defined as part of `require 'ffi'` now. + It is no longer necessary to `require 'ffi/version'` . + +Changed: +* Update libffi to latest master. + +Deprecated: +* Overwriting struct layouts is now warned and will be disallowed in ffi-2.0. #734, #735 + + +1.11.3 / 2019-11-25 +------------------- + +Removed: +* Remove support for tainted objects which cause deprecation warnings in ruby-2.7. #730 + + +1.11.2 / 2019-11-11 +------------------- + +Added: +* Add DragonFlyBSD as a platform. #724 + +Changed: +* Sort all types.conf files, so that files and changes are easier to compare. +* Regenerated type conf for freebsd12 and x86_64-linux targets. #722 +* Remove MACOSX_DEPLOYMENT_TARGET that was targeting very old version 10.4. #647 +* Fix library name mangling for non glibc Linux/UNIX. #727 +* Fix compiler warnings raised by ruby-2.7 +* Update libffi to latest master. + + +1.11.1 / 2019-05-20 +------------------- + +Changed: +* Raise required ruby version to >=2.0. #699, #700 +* Fix a possible linker error on ruby < 2.3 on Linux. + + +1.11.0 / 2019-05-17 +------------------- +This version was yanked on 2019-05-20 to fix an install issue on ruby-1.9.3. #700 + +Added: +* Add ability to disable or force use of system libffi. #669 + Use like `gem inst ffi -- --enable-system-libffi` . +* Add ability to call FFI callbacks from outside of FFI call frame. #584 +* Add proper documentation to FFI::Generator and ::Task +* Add gemspec metadata. #696, #698 + +Changed: +* Fix stdcall on Win32. #649, #669 +* Fix load paths for FFI::Generator::Task +* Fix FFI::Pointer#read_string(0) to return a binary String. #692 +* Fix benchmark suite so that it runs on ruby-2.x +* Move FFI::Platform::CPU from C to Ruby. #663 +* Move FFI::StructByReference to Ruby. #681 +* Move FFI::DataConverter to Ruby (#661) +* Various cleanups and improvements of specs and benchmarks + +Removed: +* Remove ruby-1.8 and 1.9 compatibility code. #683 +* Remove unused spec files. #684 + + +1.10.0 / 2019-01-06 +------------------- + +Added: +* Add /opt/local/lib/ to ffi's fallback library search path. #638 +* Add binary gem support for ruby-2.6 on Windows +* Add FreeBSD on AArch64 and ARM support. #644 +* Add FFI::LastError.winapi_error on Windows native or Cygwin. #633 + +Changed: +* Update to rake-compiler-dock-0.7.0 +* Use 64-bit inodes on FreeBSD >= 12. #644 +* Switch time_t and suseconds_t types to long on FreeBSD. #627 +* Make register_t long_long on 64-bit FreeBSD. #644 +* Fix Pointer#write_array_of_type #637 + +Removed: +* Drop binary gem support for ruby-2.0 and 2.1 on Windows + + +1.9.25 / 2018-06-03 +------------------- + +Changed: +* Revert closures via libffi. + This re-adds ClosurePool and fixes compat with SELinux enabled systems. #621 + + +1.9.24 / 2018-06-02 +------------------- + +Security Note: + +This update addresses vulnerability CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS, when a Symbol is used as DLL name instead of a String. Found by Matthew Bush. + +Added: +* Added a CHANGELOG file +* Add mips64(eb) support, and mips r6 support. (#601) + +Changed: +* Update libffi to latest changes on master. +* Don't search in hardcoded /usr paths on Windows. +* Don't treat Symbol args different to Strings in ffi_lib. +* Make sure size_t is defined in Thread.c. Fixes #609 + + +1.9.23 / 2018-02-25 +------------------- + +Changed: +* Fix unnecessary rebuild of configure in darwin multi arch. Fixes #605 + + +1.9.22 / 2018-02-22 +------------------- + +Changed: +* Update libffi to latest changes on master. +* Update detection of system libffi to match new requirements. Fixes #617 +* Prefer bundled libffi over system libffi on Mac OS. +* Do closures via libffi. This removes ClosurePool and fixes compat with PaX. #540 +* Use a more deterministic gem packaging. +* Fix unnecessary update of autoconf files at gem install. + + +1.9.21 / 2018-02-06 +------------------- + +Added: +* Ruby-2.5 support by Windows binary gems. Fixes #598 +* Add missing win64 types. +* Added support for Bitmask. (#573) +* Add support for MSYS2 (#572) and Sparc64 Linux. (#574) + +Changed: +* Fix read_string to not throw an error on length 0. +* Don't use absolute paths for sh and env. Fixes usage on Adroid #528 +* Use Ruby implementation for `which` for better compat with Windows. Fixes #315 +* Fix compatibility with PPC64LE platform. (#577) +* Normalize sparc64 to sparcv9. (#575) + +Removed: +* Drop Ruby 1.8.7 support (#480) + + +1.9.18 / 2017-03-03 +------------------- + +Added: +* Add compatibility with Ruby-2.4. + +Changed: +* Add missing shlwapi.h include to fix Windows build. +* Avoid undefined behaviour of LoadLibrary() on Windows. #553 + + +1.9.17 / 2017-01-13 +------------------- diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/COPYING b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/COPYING new file mode 100644 index 0000000..7622318 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/COPYING @@ -0,0 +1,49 @@ +Copyright (c) 2008-2013, Ruby FFI project contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Ruby FFI project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +libffi, used by this project, is licensed under the MIT license: + +libffi - Copyright (c) 1996-2011 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Gemfile b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Gemfile new file mode 100644 index 0000000..ad819ef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Gemfile @@ -0,0 +1,14 @@ +source 'https://rubygems.org' + +group :development do + gem 'rake', '~> 13.0' + gem 'rake-compiler', '~> 1.0.3' + gem 'rake-compiler-dock', '~> 1.0' + gem 'rspec', '~> 3.0' + gem 'bundler', '>= 1.16', '< 3' +end + +group :doc do + gem 'kramdown' + gem 'yard', '~> 0.9' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE new file mode 100644 index 0000000..20185fd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2008-2016, Ruby FFI project contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Ruby FFI project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE.SPECS b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE.SPECS new file mode 100644 index 0000000..5c9ffce --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/LICENSE.SPECS @@ -0,0 +1,22 @@ +Copyright (c) 2008-2012 Ruby-FFI contributors + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/README.md b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/README.md new file mode 100644 index 0000000..5845f26 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/README.md @@ -0,0 +1,136 @@ +# Ruby-FFI https://github.com/ffi/ffi/wiki [![Build Status](https://travis-ci.com/ffi/ffi.svg?branch=master)](https://travis-ci.com/ffi/ffi) [![Build status Windows](https://ci.appveyor.com/api/projects/status/r8wxn1sd4s794gg1/branch/master?svg=true)](https://ci.appveyor.com/project/larskanis/ffi-aofqa/branch/master) + +## Description + +Ruby-FFI is a gem for programmatically loading dynamically-linked native +libraries, binding functions within them, and calling those functions +from Ruby code. Moreover, a Ruby-FFI extension works without changes +on CRuby (MRI), JRuby, Rubinius and TruffleRuby. [Discover why you should write your next extension +using Ruby-FFI](https://github.com/ffi/ffi/wiki/why-use-ffi). + +## Features + +* Intuitive DSL +* Supports all C native types +* C structs (also nested), enums and global variables +* Callbacks from C to Ruby +* Automatic garbage collection of native memory + +## Synopsis + +```ruby +require 'ffi' + +module MyLib + extend FFI::Library + ffi_lib 'c' + attach_function :puts, [ :string ], :int +end + +MyLib.puts 'Hello, World using libc!' +``` + +For less minimalistic and more examples you may look at: + +* the `samples/` folder +* the examples on the [wiki](https://github.com/ffi/ffi/wiki) +* the projects using FFI listed on the wiki: https://github.com/ffi/ffi/wiki/projects-using-ffi + +## Requirements + +When installing the gem on CRuby (MRI), you will need: +* A C compiler (e.g., Xcode on macOS, `gcc` or `clang` on everything else) +Optionally (speeds up installation): +* The `libffi` library and development headers - this is commonly in the `libffi-dev` or `libffi-devel` packages + +The ffi gem comes with a builtin libffi version, which is used, when the system libffi library is not available or too old. +Use of the system libffi can be enforced by: +``` +gem install ffi -- --enable-system-libffi # to install the gem manually +bundle config build.ffi --enable-system-libffi # for bundle install +``` +or prevented by `--disable-system-libffi`. + +On Linux systems running with [PaX](https://en.wikipedia.org/wiki/PaX) (Gentoo, Alpine, etc.), FFI may trigger `mprotect` errors. You may need to disable [mprotect](https://en.wikibooks.org/wiki/Grsecurity/Appendix/Grsecurity_and_PaX_Configuration_Options#Restrict_mprotect.28.29) for ruby (`paxctl -m [/path/to/ruby]`) for the time being until a solution is found. + +On FreeBSD systems pkgconf must be installed for the gem to be able to compile using clang. Install either via packages `pkg install pkgconf` or from ports via `devel/pkgconf`. + +On JRuby and TruffleRuby, there are no requirements to install the FFI gem, and `require 'ffi'` works even without installing the gem (i.e., the gem is preinstalled on these implementations). + +## Installation + +From rubygems: + + [sudo] gem install ffi + +From a Gemfile using git or GitHub + + gem 'ffi', github: 'ffi/ffi', submodules: true + +or from the git repository on github: + + git clone git://github.com/ffi/ffi.git + cd ffi + git submodule update --init --recursive + bundle install + rake install + +### Install options: + +* `--enable-system-libffi` : Force usage of system libffi +* `--disable-system-libffi` : Force usage of builtin libffi +* `--enable-libffi-alloc` : Force closure allocation by libffi +* `--disable-libffi-alloc` : Force closure allocation by builtin method + +## License + +The ffi library is covered by the BSD license, also see the LICENSE file. +The specs are covered by the same license as [ruby/spec](https://github.com/ruby/spec), the MIT license. + +## Credits + +The following people have submitted code, bug reports, or otherwise contributed to the success of this project: + +* Alban Peignier +* Aman Gupta +* Andrea Fazzi +* Andreas Niederl +* Andrew Cholakian +* Antonio Terceiro +* Benoit Daloze +* Brian Candler +* Brian D. Burns +* Bryan Kearney +* Charlie Savage +* Chikanaga Tomoyuki +* Hongli Lai +* Ian MacLeod +* Jake Douglas +* Jean-Dominique Morani +* Jeremy Hinegardner +* Jesús García Sáez +* Joe Khoobyar +* Jurij Smakov +* KISHIMOTO, Makoto +* Kim Burgestrand +* Lars Kanis +* Luc Heinrich +* Luis Lavena +* Matijs van Zuijlen +* Matthew King +* Mike Dalessio +* NARUSE, Yui +* Park Heesob +* Shin Yee +* Stephen Bannasch +* Suraj N. Kurapati +* Sylvain Daubert +* Victor Costan +* beoran@gmail.com +* ctide +* emboss +* hobophobe +* meh +* postmodern +* wycats@gmail.com +* Wayne Meissner diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Rakefile b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Rakefile new file mode 100644 index 0000000..7175060 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/Rakefile @@ -0,0 +1,191 @@ +require 'rbconfig' +require 'date' +require 'fileutils' +require 'rbconfig' +require 'rspec/core/rake_task' +require 'rubygems/package_task' +require 'rake/extensiontask' +require_relative "lib/ffi/version" +require_relative "rakelib/ffi_gem_helper" + +BUILD_DIR = "build" +BUILD_EXT_DIR = File.join(BUILD_DIR, "#{RbConfig::CONFIG['arch']}", 'ffi_c', RUBY_VERSION) + +gem_spec = Bundler.load_gemspec('ffi.gemspec') + +RSpec::Core::RakeTask.new(:spec => :compile) do |config| + config.rspec_opts = YAML.load_file 'spec/spec.opts' +end + +desc "Build all packages" +task :package => %w[ gem:java gem:native ] + +CLOBBER.include 'lib/ffi/types.conf' +CLOBBER.include 'pkg' +CLOBBER.include 'log' + +CLEAN.include 'build' +CLEAN.include 'conftest.dSYM' +CLEAN.include 'spec/ffi/fixtures/libtest.{dylib,so,dll}' +CLEAN.include 'spec/ffi/fixtures/*.o' +CLEAN.include 'spec/ffi/embed-test/ext/*.{o,def}' +CLEAN.include 'spec/ffi/embed-test/ext/Makefile' +CLEAN.include "pkg/ffi-*-{mingw32,java}" +CLEAN.include 'lib/1.*' +CLEAN.include 'lib/2.*' + +# clean all shipped files, that are not in git +CLEAN.include( + gem_spec.files - + `git --git-dir ext/ffi_c/libffi/.git ls-files -z`.split("\x0").map { |f| File.join("ext/ffi_c/libffi", f) } - + `git ls-files -z`.split("\x0") +) + +task :distclean => :clobber + +desc "Test the extension" +task :test => [ :spec ] + + +namespace :bench do + ITER = ENV['ITER'] ? ENV['ITER'].to_i : 100000 + bench_files = Dir["bench/bench_*.rb"].sort.reject { |f| f == "bench/bench_helper.rb" } + bench_files.each do |bench| + task File.basename(bench, ".rb")[6..-1] => :compile do + sh %{#{Gem.ruby} #{bench} #{ITER}} + end + end + task :all => :compile do + bench_files.each do |bench| + sh %{#{Gem.ruby} #{bench}} + end + end +end + +task 'spec:run' => :compile +task 'spec:specdoc' => :compile + +task :default => :spec + +namespace 'java' do + + java_gem_spec = gem_spec.dup.tap do |s| + s.files.reject! { |f| File.fnmatch?("ext/*", f) } + s.extensions = [] + s.platform = 'java' + end + + Gem::PackageTask.new(java_gem_spec) do |pkg| + pkg.need_zip = true + pkg.need_tar = true + pkg.package_dir = 'pkg' + end +end + +task 'gem:java' => 'java:gem' + +FfiGemHelper.install_tasks +# Register windows gems to be pushed to rubygems.org +Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32] + +if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' + require 'rake/extensiontask' + Rake::ExtensionTask.new('ffi_c', gem_spec) do |ext| + ext.name = 'ffi_c' # indicate the name of the extension. + # ext.lib_dir = BUILD_DIR # put binaries into this folder. + ext.tmp_dir = BUILD_DIR # temporary folder used during compilation. + ext.cross_compile = true # enable cross compilation (requires cross compile toolchain) + ext.cross_platform = Bundler::GemHelper.instance.cross_platforms + ext.cross_compiling do |spec| + spec.files.reject! { |path| File.fnmatch?('ext/*', path) } + end + + end +else + task :compile do + STDERR.puts "Nothing to compile on #{RUBY_ENGINE}" + end +end + + +namespace "gem" do + task 'prepare' do + require 'rake_compiler_dock' + sh "bundle package --all" + end + + Bundler::GemHelper.instance.cross_platforms.each do |plat| + desc "Build all native binary gems in parallel" + multitask 'native' => plat + + desc "Build the native gem for #{plat}" + task plat => ['prepare', 'build'] do + RakeCompilerDock.sh <<-EOT, platform: plat + sudo apt-get update && + sudo apt-get install -y libltdl-dev && bundle --local && + rake cross native gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=${RUBY_CC_VERSION/:2.2.2/} + EOT + end + end +end + +directory "ext/ffi_c/libffi" +file "ext/ffi_c/libffi/autogen.sh" => "ext/ffi_c/libffi" do + warn "Downloading libffi ..." + sh "git submodule update --init --recursive" +end +task :libffi => "ext/ffi_c/libffi/autogen.sh" + +LIBFFI_GIT_FILES = `git --git-dir ext/ffi_c/libffi/.git ls-files -z`.split("\x0") + +# Generate files which are in the gemspec but not in libffi's git repo by running autogen.sh +gem_spec.files.select do |f| + f =~ /ext\/ffi_c\/libffi\/(.*)/ && !LIBFFI_GIT_FILES.include?($1) +end.each do |f| + file f => "ext/ffi_c/libffi/autogen.sh" do + chdir "ext/ffi_c/libffi" do + sh "sh ./autogen.sh" + end + touch f + if gem_spec.files != Gem::Specification.load('./ffi.gemspec').files + warn "gemspec files have changed -> Please restart rake!" + exit 1 + end + end +end + +# Make sure we have all gemspec files before packaging +task :build => gem_spec.files +task :gem => :build + + +require_relative "lib/ffi/platform" +types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf')) +logfile = File.join(File.dirname(__FILE__), 'types_log') + +task types_conf do |task| + require 'fileutils' + require_relative "lib/ffi/tools/types_generator" + options = {} + FileUtils.mkdir_p(File.dirname(task.name), mode: 0755 ) + File.open(task.name, File::CREAT|File::TRUNC|File::RDWR, 0644) do |f| + f.puts FFI::TypesGenerator.generate(options) + end + File.open(logfile, 'w') do |log| + log.puts(types_conf) + end +end + +desc "Create or update type information for platform #{FFI::Platform::NAME}" +task :types_conf => types_conf + +begin + require 'yard' + + namespace :doc do + YARD::Rake::YardocTask.new do |yard| + end + end +rescue LoadError + warn "[warn] YARD unavailable" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/.sitearchdir.time b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/.sitearchdir.time new file mode 100644 index 0000000..e69de29 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.c new file mode 100644 index 0000000..1a7fcde --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.c @@ -0,0 +1,1104 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (C) 2009 Jake Douglas + * Copyright (C) 2008 Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#ifndef _MSC_VER +# include +#endif +#include +#include + +#include +#include + +#include "rbffi.h" +#include "compat.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "Function.h" +#include "LongDouble.h" + +#ifdef PRIsVALUE +# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj) +# define RB_OBJ_STRING(obj) (obj) +#else +# define PRIsVALUE "s" +# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj) +# define RB_OBJ_STRING(obj) StringValueCStr(obj) +#endif + +static inline char* memory_address(VALUE self); +VALUE rbffi_AbstractMemoryClass = Qnil; +static VALUE NullPointerErrorClass = Qnil; +static ID id_to_ptr = 0, id_plus = 0, id_call = 0; + +static VALUE +memory_allocate(VALUE klass) +{ + AbstractMemory* memory; + VALUE obj; + obj = Data_Make_Struct(klass, AbstractMemory, NULL, -1, memory); + memory->flags = MEM_RD | MEM_WR; + + return obj; +} +#define VAL(x, swap) (unlikely(((memory->flags & MEM_SWAP) != 0)) ? swap((x)) : (x)) + +#define NUM_OP(name, type, toNative, fromNative, swap) \ +static void memory_op_put_##name(AbstractMemory* memory, long off, VALUE value); \ +static void \ +memory_op_put_##name(AbstractMemory* memory, long off, VALUE value) \ +{ \ + type tmp = (type) VAL(toNative(value), swap); \ + checkWrite(memory); \ + checkBounds(memory, off, sizeof(type)); \ + memcpy(memory->address + off, &tmp, sizeof(tmp)); \ +} \ +static VALUE memory_put_##name(VALUE self, VALUE offset, VALUE value); \ +static VALUE \ +memory_put_##name(VALUE self, VALUE offset, VALUE value) \ +{ \ + AbstractMemory* memory; \ + Data_Get_Struct(self, AbstractMemory, memory); \ + memory_op_put_##name(memory, NUM2LONG(offset), value); \ + return self; \ +} \ +static VALUE memory_write_##name(VALUE self, VALUE value); \ +static VALUE \ +memory_write_##name(VALUE self, VALUE value) \ +{ \ + AbstractMemory* memory; \ + Data_Get_Struct(self, AbstractMemory, memory); \ + memory_op_put_##name(memory, 0, value); \ + return self; \ +} \ +static VALUE memory_op_get_##name(AbstractMemory* memory, long off); \ +static VALUE \ +memory_op_get_##name(AbstractMemory* memory, long off) \ +{ \ + type tmp; \ + checkRead(memory); \ + checkBounds(memory, off, sizeof(type)); \ + memcpy(&tmp, memory->address + off, sizeof(tmp)); \ + return fromNative(VAL(tmp, swap)); \ +} \ +static VALUE memory_get_##name(VALUE self, VALUE offset); \ +static VALUE \ +memory_get_##name(VALUE self, VALUE offset) \ +{ \ + AbstractMemory* memory; \ + Data_Get_Struct(self, AbstractMemory, memory); \ + return memory_op_get_##name(memory, NUM2LONG(offset)); \ +} \ +static VALUE memory_read_##name(VALUE self); \ +static VALUE \ +memory_read_##name(VALUE self) \ +{ \ + AbstractMemory* memory; \ + Data_Get_Struct(self, AbstractMemory, memory); \ + return memory_op_get_##name(memory, 0); \ +} \ +static MemoryOp memory_op_##name = { memory_op_get_##name, memory_op_put_##name }; \ +\ +static VALUE memory_put_array_of_##name(VALUE self, VALUE offset, VALUE ary); \ +static VALUE \ +memory_put_array_of_##name(VALUE self, VALUE offset, VALUE ary) \ +{ \ + long count; \ + long off = NUM2LONG(offset); \ + AbstractMemory* memory = MEMORY(self); \ + long i; \ + Check_Type(ary, T_ARRAY); \ + count = RARRAY_LEN(ary); \ + if (likely(count > 0)) checkWrite(memory); \ + checkBounds(memory, off, count * sizeof(type)); \ + for (i = 0; i < count; i++) { \ + type tmp = (type) VAL(toNative(RARRAY_PTR(ary)[i]), swap); \ + memcpy(memory->address + off + (i * sizeof(type)), &tmp, sizeof(tmp)); \ + } \ + return self; \ +} \ +static VALUE memory_write_array_of_##name(VALUE self, VALUE ary); \ +static VALUE \ +memory_write_array_of_##name(VALUE self, VALUE ary) \ +{ \ + return memory_put_array_of_##name(self, INT2FIX(0), ary); \ +} \ +static VALUE memory_get_array_of_##name(VALUE self, VALUE offset, VALUE length); \ +static VALUE \ +memory_get_array_of_##name(VALUE self, VALUE offset, VALUE length) \ +{ \ + long count = NUM2LONG(length); \ + long off = NUM2LONG(offset); \ + AbstractMemory* memory = MEMORY(self); \ + VALUE retVal = rb_ary_new2(count); \ + long i; \ + if (likely(count > 0)) checkRead(memory); \ + checkBounds(memory, off, count * sizeof(type)); \ + for (i = 0; i < count; ++i) { \ + type tmp; \ + memcpy(&tmp, memory->address + off + (i * sizeof(type)), sizeof(tmp)); \ + rb_ary_push(retVal, fromNative(VAL(tmp, swap))); \ + } \ + return retVal; \ +} \ +static VALUE memory_read_array_of_##name(VALUE self, VALUE length); \ +static VALUE \ +memory_read_array_of_##name(VALUE self, VALUE length) \ +{ \ + return memory_get_array_of_##name(self, INT2FIX(0), length); \ +} + +#define NOSWAP(x) (x) +#define bswap16(x) (((x) >> 8) & 0xff) | (((x) << 8) & 0xff00); +static inline int16_t +SWAPS16(int16_t x) +{ + return bswap16(x); +} + +static inline uint16_t +SWAPU16(uint16_t x) +{ + return bswap16(x); +} + +#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) +#define bswap32(x) \ + (((x << 24) & 0xff000000) | \ + ((x << 8) & 0x00ff0000) | \ + ((x >> 8) & 0x0000ff00) | \ + ((x >> 24) & 0x000000ff)) + +#define bswap64(x) \ + (((x << 56) & 0xff00000000000000ULL) | \ + ((x << 40) & 0x00ff000000000000ULL) | \ + ((x << 24) & 0x0000ff0000000000ULL) | \ + ((x << 8) & 0x000000ff00000000ULL) | \ + ((x >> 8) & 0x00000000ff000000ULL) | \ + ((x >> 24) & 0x0000000000ff0000ULL) | \ + ((x >> 40) & 0x000000000000ff00ULL) | \ + ((x >> 56) & 0x00000000000000ffULL)) + +static inline int32_t +SWAPS32(int32_t x) +{ + return bswap32(x); +} + +static inline uint32_t +SWAPU32(uint32_t x) +{ + return bswap32(x); +} + +static inline int64_t +SWAPS64(int64_t x) +{ + return bswap64(x); +} + +static inline uint64_t +SWAPU64(uint64_t x) +{ + return bswap64(x); +} + +#else +# define SWAPS32(x) ((int32_t) __builtin_bswap32(x)) +# define SWAPU32(x) ((uint32_t) __builtin_bswap32(x)) +# define SWAPS64(x) ((int64_t) __builtin_bswap64(x)) +# define SWAPU64(x) ((uint64_t) __builtin_bswap64(x)) +#endif + +#if LONG_MAX > INT_MAX +# define SWAPSLONG SWAPS64 +# define SWAPULONG SWAPU64 +#else +# define SWAPSLONG SWAPS32 +# define SWAPULONG SWAPU32 +#endif + +NUM_OP(int8, int8_t, NUM2INT, INT2NUM, NOSWAP); +NUM_OP(uint8, uint8_t, NUM2UINT, UINT2NUM, NOSWAP); +NUM_OP(int16, int16_t, NUM2INT, INT2NUM, SWAPS16); +NUM_OP(uint16, uint16_t, NUM2UINT, UINT2NUM, SWAPU16); +NUM_OP(int32, int32_t, NUM2INT, INT2NUM, SWAPS32); +NUM_OP(uint32, uint32_t, NUM2UINT, UINT2NUM, SWAPU32); +NUM_OP(int64, int64_t, NUM2LL, LL2NUM, SWAPS64); +NUM_OP(uint64, uint64_t, NUM2ULL, ULL2NUM, SWAPU64); +NUM_OP(long, long, NUM2LONG, LONG2NUM, SWAPSLONG); +NUM_OP(ulong, unsigned long, NUM2ULONG, ULONG2NUM, SWAPULONG); +NUM_OP(float32, float, NUM2DBL, rb_float_new, NOSWAP); +NUM_OP(float64, double, NUM2DBL, rb_float_new, NOSWAP); +NUM_OP(longdouble, long double, rbffi_num2longdouble, rbffi_longdouble_new, NOSWAP); + +static inline void* +get_pointer_value(VALUE value) +{ + const int type = TYPE(value); + if (type == T_DATA && rb_obj_is_kind_of(value, rbffi_PointerClass)) { + return memory_address(value); + } else if (type == T_NIL) { + return NULL; + } else if (type == T_FIXNUM) { + return (void *) (uintptr_t) FIX2ULONG(value); + } else if (type == T_BIGNUM) { + return (void *) (uintptr_t) NUM2ULL(value); + } else if (rb_respond_to(value, id_to_ptr)) { + return MEMORY_PTR(rb_funcall2(value, id_to_ptr, 0, NULL)); + } else { + rb_raise(rb_eArgError, "value is not a pointer"); + return NULL; + } +} + +NUM_OP(pointer, void *, get_pointer_value, rbffi_Pointer_NewInstance, NOSWAP); + +static inline uint8_t +rbffi_bool_value(VALUE value) +{ + return RTEST(value); +} + +static inline VALUE +rbffi_bool_new(uint8_t value) +{ + return (value & 1) != 0 ? Qtrue : Qfalse; +} + +NUM_OP(bool, unsigned char, rbffi_bool_value, rbffi_bool_new, NOSWAP); + + +/* + * call-seq: memory.clear + * Set the memory to all-zero. + * @return [self] + */ +static VALUE +memory_clear(VALUE self) +{ + AbstractMemory* ptr = MEMORY(self); + memset(ptr->address, 0, ptr->size); + return self; +} + +/* + * call-seq: memory.size + * Return memory size in bytes (alias: #total) + * @return [Numeric] + */ +static VALUE +memory_size(VALUE self) +{ + AbstractMemory* ptr; + + Data_Get_Struct(self, AbstractMemory, ptr); + + return LONG2NUM(ptr->size); +} + +/* + * call-seq: memory.get(type, offset) + * Return data of given type contained in memory. + * @param [Symbol, Type] type_name type of data to get + * @param [Numeric] offset point in buffer to start from + * @return [Object] + * @raise {ArgumentError} if type is not supported + */ +static VALUE +memory_get(VALUE self, VALUE type_name, VALUE offset) +{ + AbstractMemory* ptr; + VALUE nType; + Type *type; + + nType = rbffi_Type_Lookup(type_name); + if(NIL_P(nType)) goto undefined_type; + + Data_Get_Struct(self, AbstractMemory, ptr); + Data_Get_Struct(nType, Type, type); + + MemoryOp *op = get_memory_op(type); + if(op == NULL) goto undefined_type; + + return op->get(ptr, NUM2LONG(offset)); + +undefined_type: { + VALUE msg = rb_sprintf("undefined type '%" PRIsVALUE "'", type_name); + rb_exc_raise(rb_exc_new3(rb_eArgError, msg)); + return Qnil; + } +} + +/* + * call-seq: memory.put(type, offset, value) + * @param [Symbol, Type] type_name type of data to put + * @param [Numeric] offset point in buffer to start from + * @return [nil] + * @raise {ArgumentError} if type is not supported + */ +static VALUE +memory_put(VALUE self, VALUE type_name, VALUE offset, VALUE value) +{ + AbstractMemory* ptr; + VALUE nType; + Type *type; + + nType = rbffi_Type_Lookup(type_name); + if(NIL_P(nType)) goto undefined_type; + + Data_Get_Struct(self, AbstractMemory, ptr); + Data_Get_Struct(nType, Type, type); + + MemoryOp *op = get_memory_op(type); + if(op == NULL) goto undefined_type; + + op->put(ptr, NUM2LONG(offset), value); + return Qnil; + +undefined_type: { + VALUE msg = rb_sprintf("unsupported type '%" PRIsVALUE "'", type_name); + rb_exc_raise(rb_exc_new3(rb_eArgError, msg)); + return Qnil; + } +} + +/* + * call-seq: memory.get_string(offset, length=nil) + * Return string contained in memory. + * @param [Numeric] offset point in buffer to start from + * @param [Numeric] length string's length in bytes. If nil, a (memory size - offset) length string is returned). + * @return [String] + * @raise {IndexError} if +length+ is too great + * @raise {NullPointerError} if memory not initialized + */ +static VALUE +memory_get_string(int argc, VALUE* argv, VALUE self) +{ + VALUE length = Qnil, offset = Qnil; + AbstractMemory* ptr = MEMORY(self); + long off, len; + char* end; + int nargs = rb_scan_args(argc, argv, "11", &offset, &length); + + off = NUM2LONG(offset); + len = nargs > 1 && length != Qnil ? NUM2LONG(length) : (ptr->size - off); + checkRead(ptr); + checkBounds(ptr, off, len); + + end = memchr(ptr->address + off, 0, len); + return rb_str_new((char *) ptr->address + off, + (end != NULL ? end - ptr->address - off : len)); +} + +/* + * call-seq: memory.get_array_of_string(offset, count=nil) + * Return an array of strings contained in memory. + * @param [Numeric] offset point in memory to start from + * @param [Numeric] count number of strings to get. If nil, return all strings + * @return [Array] + * @raise {IndexError} if +offset+ is too great + * @raise {NullPointerError} if memory not initialized + */ +static VALUE +memory_get_array_of_string(int argc, VALUE* argv, VALUE self) +{ + VALUE offset = Qnil, countnum = Qnil, retVal = Qnil; + AbstractMemory* ptr; + long off; + int count; + + rb_scan_args(argc, argv, "11", &offset, &countnum); + off = NUM2LONG(offset); + count = (countnum == Qnil ? 0 : NUM2INT(countnum)); + retVal = rb_ary_new2(count); + + Data_Get_Struct(self, AbstractMemory, ptr); + checkRead(ptr); + + if (countnum != Qnil) { + int i; + + checkBounds(ptr, off, count * sizeof (char*)); + + for (i = 0; i < count; ++i) { + const char* strptr = *((const char**) (ptr->address + off) + i); + rb_ary_push(retVal, (strptr == NULL ? Qnil : rb_str_new2(strptr))); + } + + } else { + checkBounds(ptr, off, sizeof (char*)); + for ( ; off < ptr->size - (long) sizeof (void *); off += (long) sizeof (void *)) { + const char* strptr = *(const char**) (ptr->address + off); + if (strptr == NULL) { + break; + } + rb_ary_push(retVal, rb_str_new2(strptr)); + } + } + + return retVal; +} + +/* + * call-seq: memory.read_array_of_string(count=nil) + * Return an array of strings contained in memory. Same as: + * memory.get_array_of_string(0, count) + * @param [Numeric] count number of strings to get. If nil, return all strings + * @return [Array] + */ +static VALUE +memory_read_array_of_string(int argc, VALUE* argv, VALUE self) +{ + VALUE* rargv = ALLOCA_N(VALUE, argc + 1); + int i; + + rargv[0] = INT2FIX(0); + for (i = 0; i < argc; i++) { + rargv[i + 1] = argv[i]; + } + + return memory_get_array_of_string(argc + 1, rargv, self); +} + + +/* + * call-seq: memory.put_string(offset, str) + * @param [Numeric] offset + * @param [String] str + * @return [self] + * @raise {SecurityError} when writing unsafe string to memory + * @raise {IndexError} if +offset+ is too great + * @raise {NullPointerError} if memory not initialized + * Put a string in memory. + */ +static VALUE +memory_put_string(VALUE self, VALUE offset, VALUE str) +{ + AbstractMemory* ptr = MEMORY(self); + long off, len; + + Check_Type(str, T_STRING); + off = NUM2LONG(offset); + len = RSTRING_LEN(str); + + checkWrite(ptr); + checkBounds(ptr, off, len + 1); + + memcpy(ptr->address + off, RSTRING_PTR(str), len); + *((char *) ptr->address + off + len) = '\0'; + + return self; +} + +/* + * call-seq: memory.get_bytes(offset, length) + * Return string contained in memory. + * @param [Numeric] offset point in buffer to start from + * @param [Numeric] length string's length in bytes. + * @return [String] + * @raise {IndexError} if +length+ is too great + * @raise {NullPointerError} if memory not initialized + */ +static VALUE +memory_get_bytes(VALUE self, VALUE offset, VALUE length) +{ + AbstractMemory* ptr = MEMORY(self); + long off, len; + + off = NUM2LONG(offset); + len = NUM2LONG(length); + + checkRead(ptr); + checkBounds(ptr, off, len); + + return rb_str_new((char *) ptr->address + off, len); +} + +/* + * call-seq: memory.put_bytes(offset, str, index=0, length=nil) + * Put a string in memory. + * @param [Numeric] offset point in buffer to start from + * @param [String] str string to put to memory + * @param [Numeric] index + * @param [Numeric] length string's length in bytes. If nil, a (memory size - offset) length string is returned). + * @return [self] + * @raise {IndexError} if +length+ is too great + * @raise {NullPointerError} if memory not initialized + * @raise {RangeError} if +index+ is negative, or if index+length is greater than size of string + * @raise {SecurityError} when writing unsafe string to memory + */ +static VALUE +memory_put_bytes(int argc, VALUE* argv, VALUE self) +{ + AbstractMemory* ptr = MEMORY(self); + VALUE offset = Qnil, str = Qnil, rbIndex = Qnil, rbLength = Qnil; + long off, len, idx; + int nargs = rb_scan_args(argc, argv, "22", &offset, &str, &rbIndex, &rbLength); + + Check_Type(str, T_STRING); + + off = NUM2LONG(offset); + idx = nargs > 2 ? NUM2LONG(rbIndex) : 0; + if (idx < 0) { + rb_raise(rb_eRangeError, "index cannot be less than zero"); + return Qnil; + } + len = nargs > 3 ? NUM2LONG(rbLength) : (RSTRING_LEN(str) - idx); + if ((idx + len) > RSTRING_LEN(str)) { + rb_raise(rb_eRangeError, "index+length is greater than size of string"); + return Qnil; + } + + checkWrite(ptr); + checkBounds(ptr, off, len); + + memcpy(ptr->address + off, RSTRING_PTR(str) + idx, len); + + return self; +} + +/* + * call-seq: memory.read_bytes(length) + * @param [Numeric] length of string to return + * @return [String] + * equivalent to : + * memory.get_bytes(0, length) + */ +static VALUE +memory_read_bytes(VALUE self, VALUE length) +{ + return memory_get_bytes(self, INT2FIX(0), length); +} + +/* + * call-seq: memory.write_bytes(str, index=0, length=nil) + * @param [String] str string to put to memory + * @param [Numeric] index + * @param [Numeric] length string's length in bytes. If nil, a (memory size - offset) length string is returned). + * @return [self] + * equivalent to : + * memory.put_bytes(0, str, index, length) + */ +static VALUE +memory_write_bytes(int argc, VALUE* argv, VALUE self) +{ + VALUE* wargv = ALLOCA_N(VALUE, argc + 1); + int i; + + wargv[0] = INT2FIX(0); + for (i = 0; i < argc; i++) { + wargv[i + 1] = argv[i]; + } + + return memory_put_bytes(argc + 1, wargv, self); +} + +/* + * call-seq: memory.type_size + * @return [Numeric] type size in bytes + * Get the memory's type size. + */ +static VALUE +memory_type_size(VALUE self) +{ + AbstractMemory* ptr; + + Data_Get_Struct(self, AbstractMemory, ptr); + + return INT2NUM(ptr->typeSize); +} + +/* + * Document-method: [] + * call-seq: memory[idx] + * @param [Numeric] idx index to access in memory + * @return + * Memory read accessor. + */ +static VALUE +memory_aref(VALUE self, VALUE idx) +{ + AbstractMemory* ptr; + VALUE rbOffset = Qnil; + + Data_Get_Struct(self, AbstractMemory, ptr); + + rbOffset = ULONG2NUM(NUM2ULONG(idx) * ptr->typeSize); + + return rb_funcall2(self, id_plus, 1, &rbOffset); +} + +static inline char* +memory_address(VALUE obj) +{ + return ((AbstractMemory *) DATA_PTR(obj))->address; +} + +static VALUE +memory_copy_from(VALUE self, VALUE rbsrc, VALUE rblen) +{ + AbstractMemory* dst; + + Data_Get_Struct(self, AbstractMemory, dst); + + memcpy(dst->address, rbffi_AbstractMemory_Cast(rbsrc, rbffi_AbstractMemoryClass)->address, NUM2INT(rblen)); + + return self; +} + +AbstractMemory* +rbffi_AbstractMemory_Cast(VALUE obj, VALUE klass) +{ + if (rb_obj_is_kind_of(obj, klass)) { + AbstractMemory* memory; + Data_Get_Struct(obj, AbstractMemory, memory); + return memory; + } + + rb_raise(rb_eArgError, "Invalid Memory object"); + return NULL; +} + +void +rbffi_AbstractMemory_Error(AbstractMemory *mem, int op) +{ + VALUE rbErrorClass = mem->address == NULL ? NullPointerErrorClass : rb_eRuntimeError; + if (op == MEM_RD) { + rb_raise(rbErrorClass, "invalid memory read at address=%p", mem->address); + } else if (op == MEM_WR) { + rb_raise(rbErrorClass, "invalid memory write at address=%p", mem->address); + } else { + rb_raise(rbErrorClass, "invalid memory access at address=%p", mem->address); + } +} + +static VALUE +memory_op_get_strptr(AbstractMemory* ptr, long offset) +{ + void* tmp = NULL; + + if (ptr != NULL && ptr->address != NULL) { + checkRead(ptr); + checkBounds(ptr, offset, sizeof(tmp)); + memcpy(&tmp, ptr->address + offset, sizeof(tmp)); + } + + return tmp != NULL ? rb_str_new2(tmp) : Qnil; +} + +static void +memory_op_put_strptr(AbstractMemory* ptr, long offset, VALUE value) +{ + rb_raise(rb_eArgError, "Cannot set :string fields"); +} + +static MemoryOp memory_op_strptr = { memory_op_get_strptr, memory_op_put_strptr }; + + +MemoryOps rbffi_AbstractMemoryOps = { + &memory_op_int8, /*.int8 */ + &memory_op_uint8, /* .uint8 */ + &memory_op_int16, /* .int16 */ + &memory_op_uint16, /* .uint16 */ + &memory_op_int32, /* .int32 */ + &memory_op_uint32, /* .uint32 */ + &memory_op_int64, /* .int64 */ + &memory_op_uint64, /* .uint64 */ + &memory_op_long, /* .slong */ + &memory_op_ulong, /* .uslong */ + &memory_op_float32, /* .float32 */ + &memory_op_float64, /* .float64 */ + &memory_op_longdouble, /* .longdouble */ + &memory_op_pointer, /* .pointer */ + &memory_op_strptr, /* .strptr */ + &memory_op_bool /* .boolOp */ +}; + +void +rbffi_AbstractMemory_Init(VALUE moduleFFI) +{ + /* + * Document-class: FFI::AbstractMemory + * + * {AbstractMemory} is the base class for many memory management classes such as {Buffer}. + * + * This class has a lot of methods to work with integers : + * * put_intsize(offset, value) + * * get_intsize(offset) + * * put_uintsize(offset, value) + * * get_uintsize(offset) + * * writeuintsize(value) + * * read_intsize + * * write_uintsize(value) + * * read_uintsize + * * put_array_of_intsize(offset, ary) + * * get_array_of_intsize(offset, length) + * * put_array_of_uintsize(offset, ary) + * * get_array_of_uintsize(offset, length) + * * write_array_of_intsize(ary) + * * read_array_of_intsize(length) + * * write_array_of_uintsize(ary) + * * read_array_of_uintsize(length) + * where _size_ is 8, 16, 32 or 64. Same methods exist for long type. + * + * Aliases exist : _char_ for _int8_, _short_ for _int16_, _int_ for _int32_ and long_long for _int64_. + * + * Others methods are listed below. + */ + VALUE classMemory = rb_define_class_under(moduleFFI, "AbstractMemory", rb_cObject); + rbffi_AbstractMemoryClass = classMemory; + /* + * Document-variable: FFI::AbstractMemory + */ + rb_global_variable(&rbffi_AbstractMemoryClass); + rb_define_alloc_func(classMemory, memory_allocate); + + NullPointerErrorClass = rb_define_class_under(moduleFFI, "NullPointerError", rb_eRuntimeError); + /* Document-variable: NullPointerError */ + rb_global_variable(&NullPointerErrorClass); + + +#undef INT +#define INT(type) \ + rb_define_method(classMemory, "put_" #type, memory_put_##type, 2); \ + rb_define_method(classMemory, "get_" #type, memory_get_##type, 1); \ + rb_define_method(classMemory, "put_u" #type, memory_put_u##type, 2); \ + rb_define_method(classMemory, "get_u" #type, memory_get_u##type, 1); \ + rb_define_method(classMemory, "write_" #type, memory_write_##type, 1); \ + rb_define_method(classMemory, "read_" #type, memory_read_##type, 0); \ + rb_define_method(classMemory, "write_u" #type, memory_write_u##type, 1); \ + rb_define_method(classMemory, "read_u" #type, memory_read_u##type, 0); \ + rb_define_method(classMemory, "put_array_of_" #type, memory_put_array_of_##type, 2); \ + rb_define_method(classMemory, "get_array_of_" #type, memory_get_array_of_##type, 2); \ + rb_define_method(classMemory, "put_array_of_u" #type, memory_put_array_of_u##type, 2); \ + rb_define_method(classMemory, "get_array_of_u" #type, memory_get_array_of_u##type, 2); \ + rb_define_method(classMemory, "write_array_of_" #type, memory_write_array_of_##type, 1); \ + rb_define_method(classMemory, "read_array_of_" #type, memory_read_array_of_##type, 1); \ + rb_define_method(classMemory, "write_array_of_u" #type, memory_write_array_of_u##type, 1); \ + rb_define_method(classMemory, "read_array_of_u" #type, memory_read_array_of_u##type, 1); + + INT(int8); + INT(int16); + INT(int32); + INT(int64); + INT(long); + +#define ALIAS(name, old) \ + rb_define_alias(classMemory, "put_" #name, "put_" #old); \ + rb_define_alias(classMemory, "get_" #name, "get_" #old); \ + rb_define_alias(classMemory, "put_u" #name, "put_u" #old); \ + rb_define_alias(classMemory, "get_u" #name, "get_u" #old); \ + rb_define_alias(classMemory, "write_" #name, "write_" #old); \ + rb_define_alias(classMemory, "read_" #name, "read_" #old); \ + rb_define_alias(classMemory, "write_u" #name, "write_u" #old); \ + rb_define_alias(classMemory, "read_u" #name, "read_u" #old); \ + rb_define_alias(classMemory, "put_array_of_" #name, "put_array_of_" #old); \ + rb_define_alias(classMemory, "get_array_of_" #name, "get_array_of_" #old); \ + rb_define_alias(classMemory, "put_array_of_u" #name, "put_array_of_u" #old); \ + rb_define_alias(classMemory, "get_array_of_u" #name, "get_array_of_u" #old); \ + rb_define_alias(classMemory, "write_array_of_" #name, "write_array_of_" #old); \ + rb_define_alias(classMemory, "read_array_of_" #name, "read_array_of_" #old); \ + rb_define_alias(classMemory, "write_array_of_u" #name, "write_array_of_u" #old); \ + rb_define_alias(classMemory, "read_array_of_u" #name, "read_array_of_u" #old); + + ALIAS(char, int8); + ALIAS(short, int16); + ALIAS(int, int32); + ALIAS(long_long, int64); + + /* + * Document-method: put_float32 + * call-seq: memory.put_float32offset, value) + * @param [Numeric] offset + * @param [Numeric] value + * @return [self] + * Put +value+ as a 32-bit float in memory at offset +offset+ (alias: #put_float). + */ + rb_define_method(classMemory, "put_float32", memory_put_float32, 2); + /* + * Document-method: get_float32 + * call-seq: memory.get_float32(offset) + * @param [Numeric] offset + * @return [Float] + * Get a 32-bit float from memory at offset +offset+ (alias: #get_float). + */ + rb_define_method(classMemory, "get_float32", memory_get_float32, 1); + rb_define_alias(classMemory, "put_float", "put_float32"); + rb_define_alias(classMemory, "get_float", "get_float32"); + /* + * Document-method: write_float + * call-seq: memory.write_float(value) + * @param [Numeric] value + * @return [self] + * Write +value+ as a 32-bit float in memory. + * + * Same as: + * memory.put_float(0, value) + */ + rb_define_method(classMemory, "write_float", memory_write_float32, 1); + /* + * Document-method: read_float + * call-seq: memory.read_float + * @return [Float] + * Read a 32-bit float from memory. + * + * Same as: + * memory.get_float(0) + */ + rb_define_method(classMemory, "read_float", memory_read_float32, 0); + /* + * Document-method: put_array_of_float32 + * call-seq: memory.put_array_of_float32(offset, ary) + * @param [Numeric] offset + * @param [Array] ary + * @return [self] + * Put values from +ary+ as 32-bit floats in memory from offset +offset+ (alias: #put_array_of_float). + */ + rb_define_method(classMemory, "put_array_of_float32", memory_put_array_of_float32, 2); + /* + * Document-method: get_array_of_float32 + * call-seq: memory.get_array_of_float32(offset, length) + * @param [Numeric] offset + * @param [Numeric] length number of Float to get + * @return [Array] + * Get 32-bit floats in memory from offset +offset+ (alias: #get_array_of_float). + */ + rb_define_method(classMemory, "get_array_of_float32", memory_get_array_of_float32, 2); + /* + * Document-method: write_array_of_float + * call-seq: memory.write_array_of_float(ary) + * @param [Array] ary + * @return [self] + * Write values from +ary+ as 32-bit floats in memory. + * + * Same as: + * memory.put_array_of_float(0, ary) + */ + rb_define_method(classMemory, "write_array_of_float", memory_write_array_of_float32, 1); + /* + * Document-method: read_array_of_float + * call-seq: memory.read_array_of_float(length) + * @param [Numeric] length number of Float to read + * @return [Array] + * Read 32-bit floats from memory. + * + * Same as: + * memory.get_array_of_float(0, ary) + */ + rb_define_method(classMemory, "read_array_of_float", memory_read_array_of_float32, 1); + rb_define_alias(classMemory, "put_array_of_float", "put_array_of_float32"); + rb_define_alias(classMemory, "get_array_of_float", "get_array_of_float32"); + /* + * Document-method: put_float64 + * call-seq: memory.put_float64(offset, value) + * @param [Numeric] offset + * @param [Numeric] value + * @return [self] + * Put +value+ as a 64-bit float (double) in memory at offset +offset+ (alias: #put_double). + */ + rb_define_method(classMemory, "put_float64", memory_put_float64, 2); + /* + * Document-method: get_float64 + * call-seq: memory.get_float64(offset) + * @param [Numeric] offset + * @return [Float] + * Get a 64-bit float (double) from memory at offset +offset+ (alias: #get_double). + */ + rb_define_method(classMemory, "get_float64", memory_get_float64, 1); + rb_define_alias(classMemory, "put_double", "put_float64"); + rb_define_alias(classMemory, "get_double", "get_float64"); + /* + * Document-method: write_double + * call-seq: memory.write_double(value) + * @param [Numeric] value + * @return [self] + * Write +value+ as a 64-bit float (double) in memory. + * + * Same as: + * memory.put_double(0, value) + */ + rb_define_method(classMemory, "write_double", memory_write_float64, 1); + /* + * Document-method: read_double + * call-seq: memory.read_double + * @return [Float] + * Read a 64-bit float (double) from memory. + * + * Same as: + * memory.get_double(0) + */ + rb_define_method(classMemory, "read_double", memory_read_float64, 0); + /* + * Document-method: put_array_of_float64 + * call-seq: memory.put_array_of_float64(offset, ary) + * @param [Numeric] offset + * @param [Array] ary + * @return [self] + * Put values from +ary+ as 64-bit floats (doubles) in memory from offset +offset+ (alias: #put_array_of_double). + */ + rb_define_method(classMemory, "put_array_of_float64", memory_put_array_of_float64, 2); + /* + * Document-method: get_array_of_float64 + * call-seq: memory.get_array_of_float64(offset, length) + * @param [Numeric] offset + * @param [Numeric] length number of Float to get + * @return [Array] + * Get 64-bit floats (doubles) in memory from offset +offset+ (alias: #get_array_of_double). + */ + rb_define_method(classMemory, "get_array_of_float64", memory_get_array_of_float64, 2); + /* + * Document-method: write_array_of_double + * call-seq: memory.write_array_of_double(ary) + * @param [Array] ary + * @return [self] + * Write values from +ary+ as 64-bit floats (doubles) in memory. + * + * Same as: + * memory.put_array_of_double(0, ary) + */ + rb_define_method(classMemory, "write_array_of_double", memory_write_array_of_float64, 1); + /* + * Document-method: read_array_of_double + * call-seq: memory.read_array_of_double(length) + * @param [Numeric] length number of Float to read + * @return [Array] + * Read 64-bit floats (doubles) from memory. + * + * Same as: + * memory.get_array_of_double(0, ary) + */ + rb_define_method(classMemory, "read_array_of_double", memory_read_array_of_float64, 1); + rb_define_alias(classMemory, "put_array_of_double", "put_array_of_float64"); + rb_define_alias(classMemory, "get_array_of_double", "get_array_of_float64"); + /* + * Document-method: put_pointer + * call-seq: memory.put_pointer(offset, value) + * @param [Numeric] offset + * @param [nil,Pointer, Integer, #to_ptr] value + * @return [self] + * Put +value+ in memory from +offset+.. + */ + rb_define_method(classMemory, "put_pointer", memory_put_pointer, 2); + /* + * Document-method: get_pointer + * call-seq: memory.get_pointer(offset) + * @param [Numeric] offset + * @return [Pointer] + * Get a {Pointer} to the memory from +offset+. + */ + rb_define_method(classMemory, "get_pointer", memory_get_pointer, 1); + /* + * Document-method: write_pointer + * call-seq: memory.write_pointer(value) + * @param [nil,Pointer, Integer, #to_ptr] value + * @return [self] + * Write +value+ in memory. + * + * Equivalent to: + * memory.put_pointer(0, value) + */ + rb_define_method(classMemory, "write_pointer", memory_write_pointer, 1); + /* + * Document-method: read_pointer + * call-seq: memory.read_pointer + * @return [Pointer] + * Get a {Pointer} to the memory from base address. + * + * Equivalent to: + * memory.get_pointer(0) + */ + rb_define_method(classMemory, "read_pointer", memory_read_pointer, 0); + /* + * Document-method: put_array_of_pointer + * call-seq: memory.put_array_of_pointer(offset, ary) + * @param [Numeric] offset + * @param [Array<#to_ptr>] ary + * @return [self] + * Put an array of {Pointer} into memory from +offset+. + */ + rb_define_method(classMemory, "put_array_of_pointer", memory_put_array_of_pointer, 2); + /* + * Document-method: get_array_of_pointer + * call-seq: memory.get_array_of_pointer(offset, length) + * @param [Numeric] offset + * @param [Numeric] length + * @return [Array] + * Get an array of {Pointer} of length +length+ from +offset+. + */ + rb_define_method(classMemory, "get_array_of_pointer", memory_get_array_of_pointer, 2); + /* + * Document-method: write_array_of_pointer + * call-seq: memory.write_array_of_pointer(ary) + * @param [Array<#to_ptr>] ary + * @return [self] + * Write an array of {Pointer} into memory from +offset+. + * + * Same as : + * memory.put_array_of_pointer(0, ary) + */ + rb_define_method(classMemory, "write_array_of_pointer", memory_write_array_of_pointer, 1); + /* + * Document-method: read_array_of_pointer + * call-seq: memory.read_array_of_pointer(length) + * @param [Numeric] length + * @return [Array] + * Read an array of {Pointer} of length +length+. + * + * Same as: + * memory.get_array_of_pointer(0, length) + */ + rb_define_method(classMemory, "read_array_of_pointer", memory_read_array_of_pointer, 1); + + rb_define_method(classMemory, "get_string", memory_get_string, -1); + rb_define_method(classMemory, "put_string", memory_put_string, 2); + rb_define_method(classMemory, "get_bytes", memory_get_bytes, 2); + rb_define_method(classMemory, "put_bytes", memory_put_bytes, -1); + rb_define_method(classMemory, "read_bytes", memory_read_bytes, 1); + rb_define_method(classMemory, "write_bytes", memory_write_bytes, -1); + rb_define_method(classMemory, "get_array_of_string", memory_get_array_of_string, -1); + + rb_define_method(classMemory, "get", memory_get, 2); + rb_define_method(classMemory, "put", memory_put, 3); + + rb_define_method(classMemory, "clear", memory_clear, 0); + rb_define_method(classMemory, "total", memory_size, 0); + rb_define_alias(classMemory, "size", "total"); + rb_define_method(classMemory, "type_size", memory_type_size, 0); + rb_define_method(classMemory, "[]", memory_aref, 1); + rb_define_method(classMemory, "__copy_from__", memory_copy_from, 2); + + id_to_ptr = rb_intern("to_ptr"); + id_call = rb_intern("call"); + id_plus = rb_intern("+"); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.h new file mode 100644 index 0000000..1119288 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.h @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_ABSTRACTMEMORY_H +#define RBFFI_ABSTRACTMEMORY_H + +#ifndef _MSC_VER +#include +#endif +#include +#ifndef _MSC_VER +#include +#endif + +#include "compat.h" +#include "Types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#define MEM_RD 0x01 +#define MEM_WR 0x02 +#define MEM_CODE 0x04 +#define MEM_SWAP 0x08 +#define MEM_EMBED 0x10 + +typedef struct AbstractMemory_ AbstractMemory; + +typedef struct { + VALUE (*get)(AbstractMemory* ptr, long offset); + void (*put)(AbstractMemory* ptr, long offset, VALUE value); +} MemoryOp; + +typedef struct { + MemoryOp* int8; + MemoryOp* uint8; + MemoryOp* int16; + MemoryOp* uint16; + MemoryOp* int32; + MemoryOp* uint32; + MemoryOp* int64; + MemoryOp* uint64; + MemoryOp* slong; + MemoryOp* uslong; + MemoryOp* float32; + MemoryOp* float64; + MemoryOp* longdouble; + MemoryOp* pointer; + MemoryOp* strptr; + MemoryOp* boolOp; +} MemoryOps; + +struct AbstractMemory_ { + char* address; /* Use char* instead of void* to ensure adding to it works correctly */ + long size; + int flags; + int typeSize; +}; + + +extern VALUE rbffi_AbstractMemoryClass; +extern MemoryOps rbffi_AbstractMemoryOps; + +extern void rbffi_AbstractMemory_Init(VALUE ffiModule); + +extern AbstractMemory* rbffi_AbstractMemory_Cast(VALUE obj, VALUE klass); + +extern void rbffi_AbstractMemory_Error(AbstractMemory *, int op); + +static inline void +checkBounds(AbstractMemory* mem, long off, long len) +{ + if (unlikely((off | len | (off + len) | (mem->size - (off + len))) < 0)) { + rb_raise(rb_eIndexError, "Memory access offset=%ld size=%ld is out of bounds", + off, len); + } +} + +static inline void +checkRead(AbstractMemory* mem) +{ + if (unlikely((mem->flags & MEM_RD) == 0)) { + rbffi_AbstractMemory_Error(mem, MEM_RD); + } +} + +static inline void +checkWrite(AbstractMemory* mem) +{ + if (unlikely((mem->flags & MEM_WR) == 0)) { + rbffi_AbstractMemory_Error(mem, MEM_WR); + } +} + +static inline MemoryOp* +get_memory_op(Type* type) +{ + switch (type->nativeType) { + case NATIVE_INT8: + return rbffi_AbstractMemoryOps.int8; + case NATIVE_UINT8: + return rbffi_AbstractMemoryOps.uint8; + case NATIVE_INT16: + return rbffi_AbstractMemoryOps.int16; + case NATIVE_UINT16: + return rbffi_AbstractMemoryOps.uint16; + case NATIVE_INT32: + return rbffi_AbstractMemoryOps.int32; + case NATIVE_UINT32: + return rbffi_AbstractMemoryOps.uint32; + case NATIVE_INT64: + return rbffi_AbstractMemoryOps.int64; + case NATIVE_UINT64: + return rbffi_AbstractMemoryOps.uint64; + case NATIVE_LONG: + return rbffi_AbstractMemoryOps.slong; + case NATIVE_ULONG: + return rbffi_AbstractMemoryOps.uslong; + case NATIVE_FLOAT32: + return rbffi_AbstractMemoryOps.float32; + case NATIVE_FLOAT64: + return rbffi_AbstractMemoryOps.float64; + case NATIVE_LONGDOUBLE: + return rbffi_AbstractMemoryOps.longdouble; + case NATIVE_POINTER: + return rbffi_AbstractMemoryOps.pointer; + case NATIVE_STRING: + return rbffi_AbstractMemoryOps.strptr; + case NATIVE_BOOL: + return rbffi_AbstractMemoryOps.boolOp; + default: + return NULL; + } +} + +#define MEMORY(obj) rbffi_AbstractMemory_Cast((obj), rbffi_AbstractMemoryClass) +#define MEMORY_PTR(obj) MEMORY((obj))->address +#define MEMORY_LEN(obj) MEMORY((obj))->size + + + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_ABSTRACTMEMORY_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.o new file mode 100644 index 0000000..eefca7d Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/AbstractMemory.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.c new file mode 100644 index 0000000..bfd666a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include "ArrayType.h" + +static VALUE array_type_s_allocate(VALUE klass); +static VALUE array_type_initialize(VALUE self, VALUE rbComponentType, VALUE rbLength); +static void array_type_mark(ArrayType *); +static void array_type_free(ArrayType *); + +VALUE rbffi_ArrayTypeClass = Qnil; + +static VALUE +array_type_s_allocate(VALUE klass) +{ + ArrayType* array; + VALUE obj; + + obj = Data_Make_Struct(klass, ArrayType, array_type_mark, array_type_free, array); + + array->base.nativeType = NATIVE_ARRAY; + array->base.ffiType = xcalloc(1, sizeof(*array->base.ffiType)); + array->base.ffiType->type = FFI_TYPE_STRUCT; + array->base.ffiType->size = 0; + array->base.ffiType->alignment = 0; + array->rbComponentType = Qnil; + + return obj; +} + +static void +array_type_mark(ArrayType *array) +{ + rb_gc_mark(array->rbComponentType); +} + +static void +array_type_free(ArrayType *array) +{ + xfree(array->base.ffiType); + xfree(array->ffiTypes); + xfree(array); +} + + +/* + * call-seq: initialize(component_type, length) + * @param [Type] component_type + * @param [Numeric] length + * @return [self] + * A new instance of ArrayType. + */ +static VALUE +array_type_initialize(VALUE self, VALUE rbComponentType, VALUE rbLength) +{ + ArrayType* array; + int i; + + Data_Get_Struct(self, ArrayType, array); + + array->length = NUM2UINT(rbLength); + array->rbComponentType = rbComponentType; + Data_Get_Struct(rbComponentType, Type, array->componentType); + + array->ffiTypes = xcalloc(array->length + 1, sizeof(*array->ffiTypes)); + array->base.ffiType->elements = array->ffiTypes; + array->base.ffiType->size = array->componentType->ffiType->size * array->length; + array->base.ffiType->alignment = array->componentType->ffiType->alignment; + + for (i = 0; i < array->length; ++i) { + array->ffiTypes[i] = array->componentType->ffiType; + } + + return self; +} + +/* + * call-seq: length + * @return [Numeric] + * Get array's length + */ +static VALUE +array_type_length(VALUE self) +{ + ArrayType* array; + + Data_Get_Struct(self, ArrayType, array); + + return UINT2NUM(array->length); +} + +/* + * call-seq: element_type + * @return [Type] + * Get element type. + */ +static VALUE +array_type_element_type(VALUE self) +{ + ArrayType* array; + + Data_Get_Struct(self, ArrayType, array); + + return array->rbComponentType; +} + +void +rbffi_ArrayType_Init(VALUE moduleFFI) +{ + VALUE ffi_Type; + + ffi_Type = rbffi_TypeClass; + + /* + * Document-class: FFI::ArrayType < FFI::Type + * + * This is a typed array. The type is a {NativeType native type}. + */ + rbffi_ArrayTypeClass = rb_define_class_under(moduleFFI, "ArrayType", ffi_Type); + /* + * Document-variable: FFI::ArrayType + */ + rb_global_variable(&rbffi_ArrayTypeClass); + /* + * Document-constant: FFI::Type::Array + */ + rb_define_const(ffi_Type, "Array", rbffi_ArrayTypeClass); + + rb_define_alloc_func(rbffi_ArrayTypeClass, array_type_s_allocate); + rb_define_method(rbffi_ArrayTypeClass, "initialize", array_type_initialize, 2); + rb_define_method(rbffi_ArrayTypeClass, "length", array_type_length, 0); + rb_define_method(rbffi_ArrayTypeClass, "elem_type", array_type_element_type, 0); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.h new file mode 100644 index 0000000..356ffb1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_ARRAYTYPE_H +#define RBFFI_ARRAYTYPE_H + +#include +#include +#include "Type.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct ArrayType_ { + Type base; + int length; + ffi_type** ffiTypes; + Type* componentType; + VALUE rbComponentType; +} ArrayType; + +extern void rbffi_ArrayType_Init(VALUE moduleFFI); +extern VALUE rbffi_ArrayTypeClass; + + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_ARRAYTYPE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.o new file mode 100644 index 0000000..19ec84c Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ArrayType.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.c new file mode 100644 index 0000000..b5f39a4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.c @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * Copyright (C) 2009 Aman Gupta + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "rbffi.h" +#include "rbffi_endian.h" +#include "AbstractMemory.h" + +#define BUFFER_EMBED_MAXLEN (8) +typedef struct Buffer { + AbstractMemory memory; + + union { + VALUE rbParent; /* link to parent buffer */ + char* storage; /* start of malloc area */ + long embed[BUFFER_EMBED_MAXLEN / sizeof(long)]; /* storage for tiny allocations */ + } data; +} Buffer; + +static VALUE buffer_allocate(VALUE klass); +static VALUE buffer_initialize(int argc, VALUE* argv, VALUE self); +static void buffer_release(Buffer* ptr); +static void buffer_mark(Buffer* ptr); +static VALUE buffer_free(VALUE self); + +static VALUE BufferClass = Qnil; + +static VALUE +buffer_allocate(VALUE klass) +{ + Buffer* buffer; + VALUE obj; + + obj = Data_Make_Struct(klass, Buffer, NULL, buffer_release, buffer); + buffer->data.rbParent = Qnil; + buffer->memory.flags = MEM_RD | MEM_WR; + + return obj; +} + +static void +buffer_release(Buffer* ptr) +{ + if ((ptr->memory.flags & MEM_EMBED) == 0 && ptr->data.storage != NULL) { + xfree(ptr->data.storage); + ptr->data.storage = NULL; + } + + xfree(ptr); +} + +/* + * call-seq: initialize(size, count=1, clear=false) + * @param [Integer, Symbol, #size] Type or size in bytes of a buffer cell + * @param [Fixnum] count number of cell in the Buffer + * @param [Boolean] clear if true, set the buffer to all-zero + * @return [self] + * @raise {NoMemoryError} if failed to allocate memory for Buffer + * A new instance of Buffer. + */ +static VALUE +buffer_initialize(int argc, VALUE* argv, VALUE self) +{ + VALUE rbSize = Qnil, rbCount = Qnil, rbClear = Qnil; + Buffer* p; + int nargs; + + Data_Get_Struct(self, Buffer, p); + + nargs = rb_scan_args(argc, argv, "12", &rbSize, &rbCount, &rbClear); + p->memory.typeSize = rbffi_type_size(rbSize); + p->memory.size = p->memory.typeSize * (nargs > 1 ? NUM2LONG(rbCount) : 1); + + if (p->memory.size > BUFFER_EMBED_MAXLEN) { + p->data.storage = xmalloc(p->memory.size + 7); + if (p->data.storage == NULL) { + rb_raise(rb_eNoMemError, "Failed to allocate memory size=%lu bytes", p->memory.size); + return Qnil; + } + + /* ensure the memory is aligned on at least a 8 byte boundary */ + p->memory.address = (void *) (((uintptr_t) p->data.storage + 0x7) & (uintptr_t) ~0x7ULL); + + if (p->memory.size > 0 && (nargs < 3 || RTEST(rbClear))) { + memset(p->memory.address, 0, p->memory.size); + } + + } else { + p->memory.flags |= MEM_EMBED; + p->memory.address = (void *) &p->data.embed[0]; + } + + if (rb_block_given_p()) { + return rb_ensure(rb_yield, self, buffer_free, self); + } + + return self; +} + +/* + * call-seq: initialize_copy(other) + * @return [self] + * DO NOT CALL THIS METHOD. + */ +static VALUE +buffer_initialize_copy(VALUE self, VALUE other) +{ + AbstractMemory* src; + Buffer* dst; + + Data_Get_Struct(self, Buffer, dst); + src = rbffi_AbstractMemory_Cast(other, BufferClass); + if ((dst->memory.flags & MEM_EMBED) == 0 && dst->data.storage != NULL) { + xfree(dst->data.storage); + } + dst->data.storage = xmalloc(src->size + 7); + if (dst->data.storage == NULL) { + rb_raise(rb_eNoMemError, "failed to allocate memory size=%lu bytes", src->size); + return Qnil; + } + + dst->memory.address = (void *) (((uintptr_t) dst->data.storage + 0x7) & (uintptr_t) ~0x7ULL); + dst->memory.size = src->size; + dst->memory.typeSize = src->typeSize; + + /* finally, copy the actual buffer contents */ + memcpy(dst->memory.address, src->address, src->size); + + return self; +} + +static VALUE +buffer_alloc_inout(int argc, VALUE* argv, VALUE klass) +{ + return buffer_initialize(argc, argv, buffer_allocate(klass)); +} + +static VALUE +slice(VALUE self, long offset, long len) +{ + Buffer* ptr; + Buffer* result; + VALUE obj = Qnil; + + Data_Get_Struct(self, Buffer, ptr); + checkBounds(&ptr->memory, offset, len); + + obj = Data_Make_Struct(BufferClass, Buffer, buffer_mark, -1, result); + result->memory.address = ptr->memory.address + offset; + result->memory.size = len; + result->memory.flags = ptr->memory.flags; + result->memory.typeSize = ptr->memory.typeSize; + result->data.rbParent = self; + + return obj; +} + +/* + * call-seq: + offset + * @param [Numeric] offset + * @return [Buffer] a new instance of Buffer pointing from offset until end of previous buffer. + * Add a Buffer with an offset + */ +static VALUE +buffer_plus(VALUE self, VALUE rbOffset) +{ + Buffer* ptr; + long offset = NUM2LONG(rbOffset); + + Data_Get_Struct(self, Buffer, ptr); + + return slice(self, offset, ptr->memory.size - offset); +} + +/* + * call-seq: slice(offset, length) + * @param [Numeric] offset + * @param [Numeric] length + * @return [Buffer] a new instance of Buffer + * Slice an existing Buffer. + */ +static VALUE +buffer_slice(VALUE self, VALUE rbOffset, VALUE rbLength) +{ + return slice(self, NUM2LONG(rbOffset), NUM2LONG(rbLength)); +} + +/* + * call-seq: inspect + * @return [String] + * Inspect a Buffer. + */ +static VALUE +buffer_inspect(VALUE self) +{ + char tmp[100]; + Buffer* ptr; + + Data_Get_Struct(self, Buffer, ptr); + + snprintf(tmp, sizeof(tmp), "#", ptr, ptr->memory.address, ptr->memory.size); + + return rb_str_new2(tmp); +} + + +#if BYTE_ORDER == LITTLE_ENDIAN +# define SWAPPED_ORDER BIG_ENDIAN +#else +# define SWAPPED_ORDER LITTLE_ENDIAN +#endif + +/* + * Set or get endianness of Buffer. + * @overload order + * @return [:big, :little] + * Get endianness of Buffer. + * @overload order(order) + * @param [:big, :little, :network] order + * @return [self] + * Set endianness of Buffer (+:network+ is an alias for +:big+). + */ +static VALUE +buffer_order(int argc, VALUE* argv, VALUE self) +{ + Buffer* ptr; + + Data_Get_Struct(self, Buffer, ptr); + if (argc == 0) { + int order = (ptr->memory.flags & MEM_SWAP) == 0 ? BYTE_ORDER : SWAPPED_ORDER; + return order == BIG_ENDIAN ? ID2SYM(rb_intern("big")) : ID2SYM(rb_intern("little")); + } else { + VALUE rbOrder = Qnil; + int order = BYTE_ORDER; + + if (rb_scan_args(argc, argv, "1", &rbOrder) < 1) { + rb_raise(rb_eArgError, "need byte order"); + } + if (SYMBOL_P(rbOrder)) { + ID id = SYM2ID(rbOrder); + if (id == rb_intern("little")) { + order = LITTLE_ENDIAN; + + } else if (id == rb_intern("big") || id == rb_intern("network")) { + order = BIG_ENDIAN; + } + } + if (order != BYTE_ORDER) { + Buffer* p2; + VALUE retval = slice(self, 0, ptr->memory.size); + + Data_Get_Struct(retval, Buffer, p2); + p2->memory.flags |= MEM_SWAP; + return retval; + } + + return self; + } +} + +/* Only used to free the buffer if the yield in the initializer throws an exception */ +static VALUE +buffer_free(VALUE self) +{ + Buffer* ptr; + + Data_Get_Struct(self, Buffer, ptr); + if ((ptr->memory.flags & MEM_EMBED) == 0 && ptr->data.storage != NULL) { + xfree(ptr->data.storage); + ptr->data.storage = NULL; + } + + return self; +} + +static void +buffer_mark(Buffer* ptr) +{ + rb_gc_mark(ptr->data.rbParent); +} + +void +rbffi_Buffer_Init(VALUE moduleFFI) +{ + VALUE ffi_AbstractMemory = rbffi_AbstractMemoryClass; + + /* + * Document-class: FFI::Buffer < FFI::AbstractMemory + * + * A Buffer is a function argument type. It should be use with functions playing with C arrays. + */ + BufferClass = rb_define_class_under(moduleFFI, "Buffer", ffi_AbstractMemory); + + /* + * Document-variable: FFI::Buffer + */ + rb_global_variable(&BufferClass); + rb_define_alloc_func(BufferClass, buffer_allocate); + + /* + * Document-method: alloc_inout + * call-seq: alloc_inout(*args) + * Create a new Buffer for in and out arguments (alias : new_inout). + */ + rb_define_singleton_method(BufferClass, "alloc_inout", buffer_alloc_inout, -1); + /* + * Document-method: alloc_out + * call-seq: alloc_out(*args) + * Create a new Buffer for out arguments (alias : new_out). + */ + rb_define_singleton_method(BufferClass, "alloc_out", buffer_alloc_inout, -1); + /* + * Document-method: alloc_in + * call-seq: alloc_in(*args) + * Create a new Buffer for in arguments (alias : new_in). + */ + rb_define_singleton_method(BufferClass, "alloc_in", buffer_alloc_inout, -1); + rb_define_alias(rb_singleton_class(BufferClass), "new_in", "alloc_in"); + rb_define_alias(rb_singleton_class(BufferClass), "new_out", "alloc_out"); + rb_define_alias(rb_singleton_class(BufferClass), "new_inout", "alloc_inout"); + + rb_define_method(BufferClass, "initialize", buffer_initialize, -1); + rb_define_method(BufferClass, "initialize_copy", buffer_initialize_copy, 1); + rb_define_method(BufferClass, "order", buffer_order, -1); + rb_define_method(BufferClass, "inspect", buffer_inspect, 0); + rb_define_alias(BufferClass, "length", "total"); + rb_define_method(BufferClass, "+", buffer_plus, 1); + rb_define_method(BufferClass, "slice", buffer_slice, 2); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.o new file mode 100644 index 0000000..204f131 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Buffer.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.c new file mode 100644 index 0000000..bd6c277 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.c @@ -0,0 +1,487 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * Copyright (c) 2009, Mike Dalessio + * Copyright (c) 2009, Aman Gupta. + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#if defined(HAVE_NATIVETHREAD) && !defined(_WIN32) +# include +# include +#endif +#include +#include "extconf.h" +#include "rbffi.h" +#include "compat.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "Struct.h" +#include "Function.h" +#include "Type.h" +#include "LastError.h" +#include "Call.h" +#include "MappedType.h" +#include "Thread.h" +#include "LongDouble.h" + +#ifdef USE_RAW +# ifndef __i386__ +# error "RAW argument packing only supported on i386" +# endif + +#define INT8_ADJ (4) +#define INT16_ADJ (4) +#define INT32_ADJ (4) +#define INT64_ADJ (8) +#define LONG_ADJ (sizeof(long)) +#define FLOAT32_ADJ (4) +#define FLOAT64_ADJ (8) +#define ADDRESS_ADJ (sizeof(void *)) +#define LONGDOUBLE_ADJ (ffi_type_longdouble.alignment > sizeof(long double) ? ffi_type_longdouble.alignment : sizeof(long double)) + +#endif /* USE_RAW */ + +#ifdef USE_RAW +# define ADJ(p, a) ((p) = (FFIStorage*) (((char *) p) + a##_ADJ)) +#else +# define ADJ(p, a) (++(p)) +#endif + +static void* callback_param(VALUE proc, VALUE cbinfo); +static inline void* getPointer(VALUE value, int type); + +static ID id_to_ptr, id_map_symbol, id_to_native; + +void +rbffi_SetupCallParams(int argc, VALUE* argv, int paramCount, Type** paramTypes, + FFIStorage* paramStorage, void** ffiValues, + VALUE* callbackParameters, int callbackCount, VALUE enums) +{ + VALUE callbackProc = Qnil; + FFIStorage* param = ¶mStorage[0]; + int i, argidx, cbidx, argCount; + + if (unlikely(paramCount != -1 && paramCount != argc)) { + if (argc == (paramCount - 1) && callbackCount == 1 && rb_block_given_p()) { + callbackProc = rb_block_proc(); + } else { + rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, paramCount); + } + } + + argCount = paramCount != -1 ? paramCount : argc; + + for (i = 0, argidx = 0, cbidx = 0; i < argCount; ++i) { + Type* paramType = paramTypes[i]; + int type; + + + if (unlikely(paramType->nativeType == NATIVE_MAPPED)) { + VALUE values[] = { argv[argidx], Qnil }; + argv[argidx] = rb_funcall2(((MappedType *) paramType)->rbConverter, id_to_native, 2, values); + paramType = ((MappedType *) paramType)->type; + } + + type = argidx < argc ? TYPE(argv[argidx]) : T_NONE; + ffiValues[i] = param; + + switch (paramType->nativeType) { + + case NATIVE_INT8: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->s8 = NUM2INT(value); + } else { + param->s8 = NUM2INT(argv[argidx]); + } + + ++argidx; + ADJ(param, INT8); + break; + + case NATIVE_INT16: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->s16 = NUM2INT(value); + + } else { + param->s16 = NUM2INT(argv[argidx]); + } + + ++argidx; + ADJ(param, INT16); + break; + + case NATIVE_INT32: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->s32 = NUM2INT(value); + + } else { + param->s32 = NUM2INT(argv[argidx]); + } + + ++argidx; + ADJ(param, INT32); + break; + + case NATIVE_BOOL: + if (type != T_TRUE && type != T_FALSE) { + rb_raise(rb_eTypeError, "wrong argument type (expected a boolean parameter)"); + } + param->s8 = argv[argidx++] == Qtrue; + ADJ(param, INT8); + break; + + case NATIVE_UINT8: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->u8 = NUM2UINT(value); + } else { + param->u8 = NUM2UINT(argv[argidx]); + } + + ADJ(param, INT8); + ++argidx; + break; + + case NATIVE_UINT16: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->u16 = NUM2UINT(value); + } else { + param->u16 = NUM2UINT(argv[argidx]); + } + + ADJ(param, INT16); + ++argidx; + break; + + case NATIVE_UINT32: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->u32 = NUM2UINT(value); + } else { + param->u32 = NUM2UINT(argv[argidx]); + } + + ADJ(param, INT32); + ++argidx; + break; + + case NATIVE_INT64: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->i64 = NUM2LL(value); + } else { + param->i64 = NUM2LL(argv[argidx]); + } + + ADJ(param, INT64); + ++argidx; + break; + + case NATIVE_UINT64: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->u64 = NUM2ULL(value); + } else { + param->u64 = NUM2ULL(argv[argidx]); + } + + ADJ(param, INT64); + ++argidx; + break; + + case NATIVE_LONG: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + *(ffi_sarg *) param = NUM2LONG(value); + } else { + *(ffi_sarg *) param = NUM2LONG(argv[argidx]); + } + + ADJ(param, LONG); + ++argidx; + break; + + case NATIVE_ULONG: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + *(ffi_arg *) param = NUM2ULONG(value); + } else { + *(ffi_arg *) param = NUM2ULONG(argv[argidx]); + } + + ADJ(param, LONG); + ++argidx; + break; + + case NATIVE_FLOAT32: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->f32 = (float) NUM2DBL(value); + } else { + param->f32 = (float) NUM2DBL(argv[argidx]); + } + + ADJ(param, FLOAT32); + ++argidx; + break; + + case NATIVE_FLOAT64: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->f64 = NUM2DBL(value); + } else { + param->f64 = NUM2DBL(argv[argidx]); + } + + ADJ(param, FLOAT64); + ++argidx; + break; + + case NATIVE_LONGDOUBLE: + if (unlikely(type == T_SYMBOL && enums != Qnil)) { + VALUE value = rb_funcall(enums, id_map_symbol, 1, argv[argidx]); + param->ld = rbffi_num2longdouble(value); + } else { + param->ld = rbffi_num2longdouble(argv[argidx]); + } + + ADJ(param, LONGDOUBLE); + ++argidx; + break; + + + case NATIVE_STRING: + if (type == T_NIL) { + param->ptr = NULL; + + } else { + param->ptr = StringValueCStr(argv[argidx]); + } + + ADJ(param, ADDRESS); + ++argidx; + break; + + case NATIVE_POINTER: + case NATIVE_BUFFER_IN: + case NATIVE_BUFFER_OUT: + case NATIVE_BUFFER_INOUT: + param->ptr = getPointer(argv[argidx++], type); + ADJ(param, ADDRESS); + break; + + + case NATIVE_FUNCTION: + if (callbackProc != Qnil) { + param->ptr = callback_param(callbackProc, callbackParameters[cbidx++]); + } else { + param->ptr = callback_param(argv[argidx], callbackParameters[cbidx++]); + ++argidx; + } + ADJ(param, ADDRESS); + break; + + case NATIVE_STRUCT: + ffiValues[i] = getPointer(argv[argidx++], type); + break; + + default: + rb_raise(rb_eArgError, "Invalid parameter type: %d", paramType->nativeType); + } + } +} + +static void * +call_blocking_function(void* data) +{ + rbffi_blocking_call_t* b = (rbffi_blocking_call_t *) data; + ffi_call(&b->cif, FFI_FN(b->function), b->retval, b->ffiValues); + + return NULL; +} + +VALUE +rbffi_do_blocking_call(VALUE data) +{ + rb_thread_call_without_gvl(call_blocking_function, (void*)data, (rb_unblock_function_t *) -1, NULL); + + return Qnil; +} + +VALUE +rbffi_save_frame_exception(VALUE data, VALUE exc) +{ + rbffi_frame_t* frame = (rbffi_frame_t *) data; + frame->exc = exc; + return Qnil; +} + +VALUE +rbffi_CallFunction(int argc, VALUE* argv, void* function, FunctionType* fnInfo) +{ + void* retval; + void** ffiValues; + FFIStorage* params; + VALUE rbReturnValue; + rbffi_frame_t frame = { 0 }; + + retval = alloca(MAX(fnInfo->ffi_cif.rtype->size, FFI_SIZEOF_ARG)); + + if (unlikely(fnInfo->blocking)) { + rbffi_blocking_call_t* bc; + + /* allocate information passed to the blocking function on the stack */ + ffiValues = ALLOCA_N(void *, fnInfo->parameterCount); + params = ALLOCA_N(FFIStorage, fnInfo->parameterCount); + bc = ALLOCA_N(rbffi_blocking_call_t, 1); + bc->retval = retval; + bc->cif = fnInfo->ffi_cif; + bc->function = function; + bc->ffiValues = ffiValues; + bc->params = params; + bc->frame = &frame; + + rbffi_SetupCallParams(argc, argv, + fnInfo->parameterCount, fnInfo->parameterTypes, params, ffiValues, + fnInfo->callbackParameters, fnInfo->callbackCount, fnInfo->rbEnums); + + rbffi_frame_push(&frame); + rb_rescue2(rbffi_do_blocking_call, (VALUE) bc, rbffi_save_frame_exception, (VALUE) &frame, rb_eException, (VALUE) 0); + rbffi_frame_pop(&frame); + + } else { + + ffiValues = ALLOCA_N(void *, fnInfo->parameterCount); + params = ALLOCA_N(FFIStorage, fnInfo->parameterCount); + + rbffi_SetupCallParams(argc, argv, + fnInfo->parameterCount, fnInfo->parameterTypes, params, ffiValues, + fnInfo->callbackParameters, fnInfo->callbackCount, fnInfo->rbEnums); + + rbffi_frame_push(&frame); + ffi_call(&fnInfo->ffi_cif, FFI_FN(function), retval, ffiValues); + rbffi_frame_pop(&frame); + } + + if (unlikely(!fnInfo->ignoreErrno)) { + rbffi_save_errno(); + } + + if (RTEST(frame.exc) && frame.exc != Qnil) { + rb_exc_raise(frame.exc); + } + + RB_GC_GUARD(rbReturnValue) = rbffi_NativeValue_ToRuby(fnInfo->returnType, fnInfo->rbReturnType, retval); + RB_GC_GUARD(fnInfo->rbReturnType); + + return rbReturnValue; +} + +static inline void* +getPointer(VALUE value, int type) +{ + if (likely(type == T_DATA && rb_obj_is_kind_of(value, rbffi_AbstractMemoryClass))) { + + return ((AbstractMemory *) DATA_PTR(value))->address; + + } else if (type == T_DATA && rb_obj_is_kind_of(value, rbffi_StructClass)) { + + AbstractMemory* memory = ((Struct *) DATA_PTR(value))->pointer; + return memory != NULL ? memory->address : NULL; + + } else if (type == T_STRING) { + + return StringValuePtr(value); + + } else if (type == T_NIL) { + + return NULL; + + } else if (rb_respond_to(value, id_to_ptr)) { + + VALUE ptr = rb_funcall2(value, id_to_ptr, 0, NULL); + if (rb_obj_is_kind_of(ptr, rbffi_AbstractMemoryClass) && TYPE(ptr) == T_DATA) { + return ((AbstractMemory *) DATA_PTR(ptr))->address; + } + rb_raise(rb_eArgError, "to_ptr returned an invalid pointer"); + } + + rb_raise(rb_eArgError, ":pointer argument is not a valid pointer"); + return NULL; +} + +Invoker +rbffi_GetInvoker(FunctionType *fnInfo) +{ + return rbffi_CallFunction; +} + + +static void* +callback_param(VALUE proc, VALUE cbInfo) +{ + VALUE callback ; + if (unlikely(proc == Qnil)) { + return NULL ; + } + + /* Handle Function pointers here */ + if (rb_obj_is_kind_of(proc, rbffi_FunctionClass)) { + AbstractMemory* ptr; + Data_Get_Struct(proc, AbstractMemory, ptr); + return ptr->address; + } + + callback = rbffi_Function_ForProc(cbInfo, proc); + RB_GC_GUARD(callback); + + return ((AbstractMemory *) DATA_PTR(callback))->address; +} + + +void +rbffi_Call_Init(VALUE moduleFFI) +{ + id_to_ptr = rb_intern("to_ptr"); + id_to_native = rb_intern("to_native"); + id_map_symbol = rb_intern("__map_symbol"); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.h new file mode 100644 index 0000000..b892d85 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * Copyright (c) 2009, Mike Dalessio + * Copyright (c) 2009, Aman Gupta. + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_CALL_H +#define RBFFI_CALL_H + +#include "Thread.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__i386__) && \ + (defined(HAVE_RAW_API) || defined(USE_INTERNAL_LIBFFI)) && \ + !defined(_WIN32) && !defined(__WIN32__) +# define USE_RAW +#endif + +#if (defined(__i386__) || defined(__x86_64__)) && !(defined(_WIN32) || defined(__WIN32__)) +# define BYPASS_FFI 1 +#endif + +typedef union { +#ifdef USE_RAW + signed int s8, s16, s32; + unsigned int u8, u16, u32; +#else + signed char s8; + unsigned char u8; + signed short s16; + unsigned short u16; + signed int s32; + unsigned int u32; +#endif + signed long long i64; + unsigned long long u64; + signed long sl; + unsigned long ul; + void* ptr; + float f32; + double f64; + long double ld; +} FFIStorage; + +extern void rbffi_Call_Init(VALUE moduleFFI); + +extern void rbffi_SetupCallParams(int argc, VALUE* argv, int paramCount, Type** paramTypes, + FFIStorage* paramStorage, void** ffiValues, + VALUE* callbackParameters, int callbackCount, VALUE enums); + +struct FunctionType_; +extern VALUE rbffi_CallFunction(int argc, VALUE* argv, void* function, struct FunctionType_* fnInfo); + +typedef VALUE (*Invoker)(int argc, VALUE* argv, void* function, struct FunctionType_* fnInfo); + +Invoker rbffi_GetInvoker(struct FunctionType_* fnInfo); + +extern VALUE rbffi_GetEnumValue(VALUE enums, VALUE value); +extern int rbffi_GetSignedIntValue(VALUE value, int type, int minValue, int maxValue, const char* typeName, VALUE enums); + +typedef struct rbffi_blocking_call { + rbffi_frame_t* frame; + void* function; + ffi_cif cif; + void **ffiValues; + void* retval; + void* params; +} rbffi_blocking_call_t; + +VALUE rbffi_do_blocking_call(VALUE data); +VALUE rbffi_save_frame_exception(VALUE data, VALUE exc); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_CALL_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.o new file mode 100644 index 0000000..b67f516 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Call.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.c new file mode 100644 index 0000000..cfdcf6c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.c @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2009, 2010 Wayne Meissner + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include +#if defined(__CYGWIN__) || !defined(_WIN32) +# include +#endif +#include +#include +#include +#if defined(__CYGWIN__) || !defined(_WIN32) +# include +#else +# include +# define _WINSOCKAPI_ +# include +#endif +#include +#include + +#include +#include "rbffi.h" +#include "compat.h" + +#include "Function.h" +#include "Types.h" +#include "Type.h" +#include "LastError.h" +#include "Call.h" + +#include "ClosurePool.h" + +#ifndef roundup +# define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#endif + +typedef struct Memory { + void* code; + void* data; + struct Memory* next; +} Memory; + +struct ClosurePool_ { + void* ctx; + int closureSize; + bool (*prep)(void* ctx, void *code, Closure* closure, char* errbuf, size_t errbufsize); + struct Memory* blocks; /* Keeps track of all the allocated memory for this pool */ + Closure* list; + long refcnt; +}; + +static long pageSize; + +static void* allocatePage(void); +static bool freePage(void *); +static bool protectPage(void *); + +ClosurePool* +rbffi_ClosurePool_New(int closureSize, + bool (*prep)(void* ctx, void *code, Closure* closure, char* errbuf, size_t errbufsize), + void* ctx) +{ + ClosurePool* pool; + + pool = xcalloc(1, sizeof(*pool)); + pool->closureSize = closureSize; + pool->ctx = ctx; + pool->prep = prep; + pool->refcnt = 1; + + return pool; +} + +void +cleanup_closure_pool(ClosurePool* pool) +{ + Memory* memory; + + for (memory = pool->blocks; memory != NULL; ) { + Memory* next = memory->next; +#if !USE_FFI_ALLOC + freePage(memory->code); +#else + ffi_closure_free(memory->code); +#endif + free(memory->data); + free(memory); + memory = next; + } + xfree(pool); +} + +void +rbffi_ClosurePool_Free(ClosurePool* pool) +{ + if (pool != NULL) { + long refcnt = --(pool->refcnt); + if (refcnt == 0) { + cleanup_closure_pool(pool); + } + } +} + +#if !USE_FFI_ALLOC + +Closure* +rbffi_Closure_Alloc(ClosurePool* pool) +{ + Closure *list = NULL; + Memory* block = NULL; + void *code = NULL; + char errmsg[256]; + int nclosures; + long trampolineSize; + int i; + + if (pool->list != NULL) { + Closure* closure = pool->list; + pool->list = pool->list->next; + pool->refcnt++; + + return closure; + } + + trampolineSize = roundup(pool->closureSize, 8); + nclosures = (int) (pageSize / trampolineSize); + block = calloc(1, sizeof(*block)); + list = calloc(nclosures, sizeof(*list)); + code = allocatePage(); + + if (block == NULL || list == NULL || code == NULL) { + snprintf(errmsg, sizeof(errmsg), "failed to allocate a page. errno=%d (%s)", errno, strerror(errno)); + goto error; + } + + for (i = 0; i < nclosures; ++i) { + Closure* closure = &list[i]; + closure->next = &list[i + 1]; + closure->pool = pool; + closure->code = ((char *)code + (i * trampolineSize)); + closure->pcl = closure->code; + + if (!(*pool->prep)(pool->ctx, closure->code, closure, errmsg, sizeof(errmsg))) { + goto error; + } + } + + if (!protectPage(code)) { + goto error; + } + + /* Track the allocated page + Closure memory area */ + block->data = list; + block->code = code; + block->next = pool->blocks; + pool->blocks = block; + + /* Thread the new block onto the free list, apart from the first one. */ + list[nclosures - 1].next = pool->list; + pool->list = list->next; + pool->refcnt++; + + /* Use the first one as the new handle */ + return list; + +error: + free(block); + free(list); + if (code != NULL) { + freePage(code); + } + + + rb_raise(rb_eRuntimeError, "%s", errmsg); + return NULL; +} + +#else + +Closure* +rbffi_Closure_Alloc(ClosurePool* pool) +{ + Closure *closure = NULL; + Memory* block = NULL; + void *code = NULL; + void *pcl = NULL; + char errmsg[256]; + + block = calloc(1, sizeof(*block)); + closure = calloc(1, sizeof(*closure)); + pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + + if (block == NULL || closure == NULL || pcl == NULL) { + snprintf(errmsg, sizeof(errmsg), "failed to allocate a page. errno=%d (%s)", errno, strerror(errno)); + goto error; + } + + closure->pool = pool; + closure->code = code; + closure->pcl = pcl; + + if (!(*pool->prep)(pool->ctx, closure->code, closure, errmsg, sizeof(errmsg))) { + goto error; + } + + /* Track the allocated page + Closure memory area */ + block->data = closure; + block->code = pcl; + pool->blocks = block; + + /* Thread the new block onto the free list, apart from the first one. */ + pool->refcnt++; + + return closure; + +error: + free(block); + free(closure); + if (pcl != NULL) { + ffi_closure_free(pcl); + } + + rb_raise(rb_eRuntimeError, "%s", errmsg); + return NULL; +} + +#endif /* !USE_FFI_ALLOC */ + +void +rbffi_Closure_Free(Closure* closure) +{ + if (closure != NULL) { + ClosurePool* pool = closure->pool; + long refcnt; + /* Just push it on the front of the free list */ + closure->next = pool->list; + pool->list = closure; + refcnt = --(pool->refcnt); + if (refcnt == 0) { + cleanup_closure_pool(pool); + } + } +} + +void* +rbffi_Closure_CodeAddress(Closure* handle) +{ + return handle->code; +} + + +static long +getPageSize() +{ +#if !defined(__CYGWIN__) && (defined(_WIN32) || defined(__WIN32__)) + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +#else + return sysconf(_SC_PAGESIZE); +#endif +} + +#if !USE_FFI_ALLOC + +static void* +allocatePage(void) +{ +#if !defined(__CYGWIN__) && (defined(_WIN32) || defined(__WIN32__)) + return VirtualAlloc(NULL, pageSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); +#else + void *page = mmap(NULL, pageSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + return (page != (void *) -1) ? page : NULL; +#endif +} + +static bool +freePage(void *addr) +{ +#if !defined(__CYGWIN__) && (defined(_WIN32) || defined(__WIN32__)) + return VirtualFree(addr, 0, MEM_RELEASE); +#else + return munmap(addr, pageSize) == 0; +#endif +} + +static bool +protectPage(void* page) +{ +#if !defined(__CYGWIN__) && (defined(_WIN32) || defined(__WIN32__)) + DWORD oldProtect; + return VirtualProtect(page, pageSize, PAGE_EXECUTE_READ, &oldProtect); +#else + return mprotect(page, pageSize, PROT_READ | PROT_EXEC) == 0; +#endif +} + +#endif /* !USE_FFI_ALLOC */ + +void +rbffi_ClosurePool_Init(VALUE module) +{ + pageSize = getPageSize(); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.h new file mode 100644 index 0000000..99e3a47 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2009, 2010 Wayne Meissner + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RUBYFFI_CLOSUREPOOL_H +#define RUBYFFI_CLOSUREPOOL_H + +typedef struct ClosurePool_ ClosurePool; +typedef struct Closure_ Closure; + +struct Closure_ { + void* info; /* opaque handle for storing closure-instance specific data */ + void* function; /* closure-instance specific function, called by custom trampoline */ + void* code; /* Executable address for the native trampoline code location */ + void* pcl; /* Writeable address for the native trampoline code location */ + + struct ClosurePool_* pool; + Closure* next; +}; + +void rbffi_ClosurePool_Init(VALUE module); + +ClosurePool* rbffi_ClosurePool_New(int closureSize, + bool (*prep)(void* ctx, void *code, Closure* closure, char* errbuf, size_t errbufsize), + void* ctx); + +void rbffi_ClosurePool_Free(ClosurePool *); + +Closure* rbffi_Closure_Alloc(ClosurePool *); +void rbffi_Closure_Free(Closure *); + +void* rbffi_Closure_GetCodeAddress(Closure *); + +#endif /* RUBYFFI_CLOSUREPOOL_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.o new file mode 100644 index 0000000..e5b69c2 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ClosurePool.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.c new file mode 100644 index 0000000..78b3de6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.c @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(__CYGWIN__) +# include +# define _WINSOCKAPI_ +# include +# include +#else +# include +#endif +#include + +#include + +#include "rbffi.h" +#include "compat.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "DynamicLibrary.h" + +typedef struct LibrarySymbol_ { + Pointer base; + VALUE library; + VALUE name; +} LibrarySymbol; + +static VALUE library_initialize(VALUE self, VALUE libname, VALUE libflags); +static void library_free(Library* lib); + + +static VALUE symbol_allocate(VALUE klass); +static VALUE symbol_new(VALUE library, void* address, VALUE name); +static void symbol_mark(LibrarySymbol* sym); + +static VALUE LibraryClass = Qnil, SymbolClass = Qnil; + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(__CYGWIN__) +static void* dl_open(const char* name, int flags); +static void dl_error(char* buf, int size); +#define dl_sym(handle, name) GetProcAddress(handle, name) +#define dl_close(handle) FreeLibrary(handle) +#else +# define dl_open(name, flags) dlopen(name, flags != 0 ? flags : RTLD_LAZY) +# define dl_error(buf, size) do { snprintf(buf, size, "%s", dlerror()); } while(0) +# define dl_sym(handle, name) dlsym(handle, name) +# define dl_close(handle) dlclose(handle) +#endif + +static VALUE +library_allocate(VALUE klass) +{ + Library* library; + return Data_Make_Struct(klass, Library, NULL, library_free, library); +} + +/* + * call-seq: DynamicLibrary.open(libname, libflags) + * @param libname (see #initialize) + * @param libflags (see #initialize) + * @return [FFI::DynamicLibrary] + * @raise {LoadError} if +libname+ cannot be opened + * Open a library. + */ +static VALUE +library_open(VALUE klass, VALUE libname, VALUE libflags) +{ + return library_initialize(library_allocate(klass), libname, libflags); +} + +/* + * call-seq: initialize(libname, libflags) + * @param [String] libname name of library to open + * @param [Fixnum] libflags flags for library to open + * @return [FFI::DynamicLibrary] + * @raise {LoadError} if +libname+ cannot be opened + * A new DynamicLibrary instance. + */ +static VALUE +library_initialize(VALUE self, VALUE libname, VALUE libflags) +{ + Library* library; + int flags; + + Check_Type(libflags, T_FIXNUM); + + Data_Get_Struct(self, Library, library); + flags = libflags != Qnil ? NUM2UINT(libflags) : 0; + + library->handle = dl_open(libname != Qnil ? StringValueCStr(libname) : NULL, flags); + if (library->handle == NULL) { + char errmsg[1024]; + dl_error(errmsg, sizeof(errmsg)); + rb_raise(rb_eLoadError, "Could not open library '%s': %s", + libname != Qnil ? StringValueCStr(libname) : "[current process]", + errmsg); + } +#ifdef __CYGWIN__ + // On Cygwin 1.7.17 "dlsym(dlopen(0,0), 'getpid')" fails. (dlerror: "No such process") + // As a workaround we can use "dlsym(RTLD_DEFAULT, 'getpid')" instead. + // Since 0 == RTLD_DEFAULT we won't call dl_close later. + if (libname == Qnil) { + dl_close(library->handle); + library->handle = RTLD_DEFAULT; + } +#endif + rb_iv_set(self, "@name", libname != Qnil ? libname : rb_str_new2("[current process]")); + return self; +} + +static VALUE +library_dlsym(VALUE self, VALUE name) +{ + Library* library; + void* address = NULL; + Check_Type(name, T_STRING); + + Data_Get_Struct(self, Library, library); + address = dl_sym(library->handle, StringValueCStr(name)); + + return address != NULL ? symbol_new(self, address, name) : Qnil; +} + +/* + * call-seq: last_error + * @return [String] library's last error string + */ +static VALUE +library_dlerror(VALUE self) +{ + char errmsg[1024]; + dl_error(errmsg, sizeof(errmsg)); + return rb_str_new2(errmsg); +} + +static void +library_free(Library* library) +{ + /* dlclose() on MacOS tends to segfault - avoid it */ +#ifndef __APPLE__ + if (library->handle != NULL) { + dl_close(library->handle); + } +#endif + xfree(library); +} + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(__CYGWIN__) +static void* +dl_open(const char* name, int flags) +{ + if (name == NULL) { + return GetModuleHandle(NULL); + } else { + DWORD dwFlags = PathIsRelativeA(name) ? 0 : LOAD_WITH_ALTERED_SEARCH_PATH; + return LoadLibraryExA(name, NULL, dwFlags); + } +} + +static void +dl_error(char* buf, int size) +{ + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), + 0, buf, size, NULL); +} +#endif + +static VALUE +symbol_allocate(VALUE klass) +{ + LibrarySymbol* sym; + VALUE obj = Data_Make_Struct(klass, LibrarySymbol, NULL, -1, sym); + sym->name = Qnil; + sym->library = Qnil; + sym->base.rbParent = Qnil; + + return obj; +} + + +/* + * call-seq: initialize_copy(other) + * @param [Object] other + * @return [nil] + * DO NOT CALL THIS METHOD + */ +static VALUE +symbol_initialize_copy(VALUE self, VALUE other) +{ + rb_raise(rb_eRuntimeError, "cannot duplicate symbol"); + return Qnil; +} + +static VALUE +symbol_new(VALUE library, void* address, VALUE name) +{ + LibrarySymbol* sym; + VALUE obj = Data_Make_Struct(SymbolClass, LibrarySymbol, symbol_mark, -1, sym); + + sym->base.memory.address = address; + sym->base.memory.size = LONG_MAX; + sym->base.memory.typeSize = 1; + sym->base.memory.flags = MEM_RD | MEM_WR; + sym->library = library; + sym->name = name; + + return obj; +} + +static void +symbol_mark(LibrarySymbol* sym) +{ + rb_gc_mark(sym->library); + rb_gc_mark(sym->name); +} + +/* + * call-seq: inspect + * @return [String] + * Inspect. + */ +static VALUE +symbol_inspect(VALUE self) +{ + LibrarySymbol* sym; + char buf[256]; + + Data_Get_Struct(self, LibrarySymbol, sym); + snprintf(buf, sizeof(buf), "#", + StringValueCStr(sym->name), sym->base.memory.address); + return rb_str_new2(buf); +} + +void +rbffi_DynamicLibrary_Init(VALUE moduleFFI) +{ + /* + * Document-class: FFI::DynamicLibrary + */ + LibraryClass = rb_define_class_under(moduleFFI, "DynamicLibrary", rb_cObject); + rb_global_variable(&LibraryClass); + /* + * Document-class: FFI::DynamicLibrary::Symbol < FFI::Pointer + * + * An instance of this class represents a library symbol. It may be a {Pointer pointer} to + * a function or to a variable. + */ + SymbolClass = rb_define_class_under(LibraryClass, "Symbol", rbffi_PointerClass); + rb_global_variable(&SymbolClass); + + /* + * Document-const: FFI::NativeLibrary + * Backward compatibility for FFI::DynamicLibrary + */ + rb_define_const(moduleFFI, "NativeLibrary", LibraryClass); /* backwards compat library */ + rb_define_alloc_func(LibraryClass, library_allocate); + rb_define_singleton_method(LibraryClass, "open", library_open, 2); + rb_define_singleton_method(LibraryClass, "last_error", library_dlerror, 0); + rb_define_method(LibraryClass, "initialize", library_initialize, 2); + /* + * Document-method: find_symbol + * call-seq: find_symbol(name) + * @param [String] name library symbol's name + * @return [FFI::DynamicLibrary::Symbol] library symbol + */ + rb_define_method(LibraryClass, "find_symbol", library_dlsym, 1); + /* + * Document-method: find_function + * call-seq: find_function(name) + * @param [String] name library function's name + * @return [FFI::DynamicLibrary::Symbol] library function symbol + */ + rb_define_method(LibraryClass, "find_function", library_dlsym, 1); + /* + * Document-method: find_variable + * call-seq: find_variable(name) + * @param [String] name library variable's name + * @return [FFI::DynamicLibrary::Symbol] library variable symbol + */ + rb_define_method(LibraryClass, "find_variable", library_dlsym, 1); + rb_define_method(LibraryClass, "last_error", library_dlerror, 0); + rb_define_attr(LibraryClass, "name", 1, 0); + + rb_define_alloc_func(SymbolClass, symbol_allocate); + rb_undef_method(SymbolClass, "new"); + rb_define_method(SymbolClass, "inspect", symbol_inspect, 0); + rb_define_method(SymbolClass, "initialize_copy", symbol_initialize_copy, 1); + +#define DEF(x) rb_define_const(LibraryClass, "RTLD_" #x, UINT2NUM(RTLD_##x)) + DEF(LAZY); + DEF(NOW); + DEF(GLOBAL); + DEF(LOCAL); + DEF(NOLOAD); + DEF(NODELETE); + DEF(FIRST); + DEF(DEEPBIND); + DEF(MEMBER); + DEF(BINDING_MASK); + DEF(LOCATION_MASK); + DEF(ALL_MASK); +#undef DEF + +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.h new file mode 100644 index 0000000..97bf7bc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LIBRARY_H +#define _LIBRARY_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* if these aren't defined (eg. windows), we need sensible defaults */ +#ifndef RTLD_LAZY +#define RTLD_LAZY 1 +#endif + +#ifndef RTLD_NOW +#define RTLD_NOW 2 +#endif + +#ifndef RTLD_LOCAL +#define RTLD_LOCAL 4 +#endif + +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 8 +#endif + +/* If these aren't defined, they're not supported so define as 0 */ +#ifndef RTLD_NOLOAD +#define RTLD_NOLOAD 0 +#endif + +#ifndef RTLD_NODELETE +#define RTLD_NODELETE 0 +#endif + +#ifndef RTLD_FIRST +#define RTLD_FIRST 0 +#endif + +#ifndef RTLD_DEEPBIND +#define RTLD_DEEPBIND 0 +#endif + +#ifndef RTLD_MEMBER +#define RTLD_MEMBER 0 +#endif + +/* convenience */ +#ifndef RTLD_BINDING_MASK +#define RTLD_BINDING_MASK (RTLD_LAZY | RTLD_NOW) +#endif + +#ifndef RTLD_LOCATION_MASK +#define RTLD_LOCATION_MASK (RTLD_LOCAL | RTLD_GLOBAL) +#endif + +#ifndef RTLD_ALL_MASK +#define RTLD_ALL_MASK (RTLD_BINDING_MASK | RTLD_LOCATION_MASK | RTLD_NOLOAD | RTLD_NODELETE | RTLD_FIRST | RTLD_DEEPBIND | RTLD_MEMBER) +#endif + +typedef struct Library { + void* handle; +} Library; + +extern void rbffi_DynamicLibrary_Init(VALUE ffiModule); + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBRARY_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.o new file mode 100644 index 0000000..c54aa95 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/DynamicLibrary.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.c new file mode 100644 index 0000000..1a57591 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.c @@ -0,0 +1,917 @@ +/* + * Copyright (c) 2009-2011 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include +#ifndef _WIN32 +# include +# include +#endif + +#include +#include +#include +#include +#include + +#include +#if defined(HAVE_NATIVETHREAD) && !defined(_WIN32) +#include +#endif +#include + +#include "rbffi.h" +#include "compat.h" + +#include "AbstractMemory.h" +#include "Pointer.h" +#include "Struct.h" +#include "Platform.h" +#include "Type.h" +#include "LastError.h" +#include "Call.h" +#include "ClosurePool.h" +#include "MappedType.h" +#include "Thread.h" +#include "LongDouble.h" +#include "MethodHandle.h" +#include "Function.h" + +typedef struct Function_ { + Pointer base; + FunctionType* info; + MethodHandle* methodHandle; + bool autorelease; + Closure* closure; + VALUE rbProc; + VALUE rbFunctionInfo; +} Function; + +static void function_mark(Function *); +static void function_free(Function *); +static VALUE function_init(VALUE self, VALUE rbFunctionInfo, VALUE rbProc); +static void callback_invoke(ffi_cif* cif, void* retval, void** parameters, void* user_data); +static bool callback_prep(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize); +static void* callback_with_gvl(void* data); +static VALUE invoke_callback(VALUE data); +static VALUE save_callback_exception(VALUE data, VALUE exc); + +#define DEFER_ASYNC_CALLBACK 1 + + +#if defined(DEFER_ASYNC_CALLBACK) +static VALUE async_cb_event(void *); +static VALUE async_cb_call(void *); +#endif + +extern int ruby_thread_has_gvl_p(void); +extern int ruby_native_thread_p(void); + +VALUE rbffi_FunctionClass = Qnil; + +#if defined(DEFER_ASYNC_CALLBACK) +static VALUE async_cb_thread = Qnil; +#endif + +static ID id_call = 0, id_to_native = 0, id_from_native = 0, id_cbtable = 0, id_cb_ref = 0; + +struct gvl_callback { + Closure* closure; + void* retval; + void** parameters; + bool done; + rbffi_frame_t *frame; +#if defined(DEFER_ASYNC_CALLBACK) + struct gvl_callback* next; +# ifndef _WIN32 + pthread_cond_t async_cond; + pthread_mutex_t async_mutex; +# else + HANDLE async_event; +# endif +#endif +}; + + +#if defined(DEFER_ASYNC_CALLBACK) +static struct gvl_callback* async_cb_list = NULL; +# ifndef _WIN32 + static pthread_mutex_t async_cb_mutex = PTHREAD_MUTEX_INITIALIZER; + static pthread_cond_t async_cb_cond = PTHREAD_COND_INITIALIZER; +# else + static HANDLE async_cb_cond; + static CRITICAL_SECTION async_cb_lock; +# endif +#endif + + +static VALUE +function_allocate(VALUE klass) +{ + Function *fn; + VALUE obj; + + obj = Data_Make_Struct(klass, Function, function_mark, function_free, fn); + + fn->base.memory.flags = MEM_RD; + fn->base.rbParent = Qnil; + fn->rbProc = Qnil; + fn->rbFunctionInfo = Qnil; + fn->autorelease = true; + + return obj; +} + +static void +function_mark(Function *fn) +{ + rb_gc_mark(fn->base.rbParent); + rb_gc_mark(fn->rbProc); + rb_gc_mark(fn->rbFunctionInfo); +} + +static void +function_free(Function *fn) +{ + if (fn->methodHandle != NULL) { + rbffi_MethodHandle_Free(fn->methodHandle); + } + + if (fn->closure != NULL && fn->autorelease) { + rbffi_Closure_Free(fn->closure); + } + + xfree(fn); +} + +/* + * @param [Type, Symbol] return_type return type for the function + * @param [Array] param_types array of parameters types + * @param [Hash] options see {FFI::FunctionType} for available options + * @return [self] + * A new Function instance. + * + * Define a function from a Proc or a block. + * + * @overload initialize(return_type, param_types, options = {}) { |i| ... } + * @yieldparam i parameters for the function + * @overload initialize(return_type, param_types, proc, options = {}) + * @param [Proc] proc + */ +static VALUE +function_initialize(int argc, VALUE* argv, VALUE self) +{ + + VALUE rbReturnType = Qnil, rbParamTypes = Qnil, rbProc = Qnil, rbOptions = Qnil; + VALUE rbFunctionInfo = Qnil; + VALUE infoArgv[3]; + int nargs; + + nargs = rb_scan_args(argc, argv, "22", &rbReturnType, &rbParamTypes, &rbProc, &rbOptions); + + /* + * Callback with block, + * e.g. Function.new(:int, [ :int ]) { |i| blah } + * or Function.new(:int, [ :int ], { :convention => :stdcall }) { |i| blah } + */ + if (rb_block_given_p()) { + if (nargs > 3) { + rb_raise(rb_eArgError, "cannot create function with both proc/address and block"); + } + rbOptions = rbProc; + rbProc = rb_block_proc(); + } else { + /* Callback with proc, or Function with address + * e.g. Function.new(:int, [ :int ], Proc.new { |i| }) + * Function.new(:int, [ :int ], Proc.new { |i| }, { :convention => :stdcall }) + * Function.new(:int, [ :int ], addr) + * Function.new(:int, [ :int ], addr, { :convention => :stdcall }) + */ + } + + infoArgv[0] = rbReturnType; + infoArgv[1] = rbParamTypes; + infoArgv[2] = rbOptions; + rbFunctionInfo = rb_class_new_instance(rbOptions != Qnil ? 3 : 2, infoArgv, rbffi_FunctionTypeClass); + + function_init(self, rbFunctionInfo, rbProc); + + return self; +} + +/* + * call-seq: initialize_copy(other) + * @return [nil] + * DO NOT CALL THIS METHOD + */ +static VALUE +function_initialize_copy(VALUE self, VALUE other) +{ + rb_raise(rb_eRuntimeError, "cannot duplicate function instances"); + return Qnil; +} + +VALUE +rbffi_Function_NewInstance(VALUE rbFunctionInfo, VALUE rbProc) +{ + return function_init(function_allocate(rbffi_FunctionClass), rbFunctionInfo, rbProc); +} + +VALUE +rbffi_Function_ForProc(VALUE rbFunctionInfo, VALUE proc) +{ + VALUE callback, cbref, cbTable; + + cbref = RTEST(rb_ivar_defined(proc, id_cb_ref)) ? rb_ivar_get(proc, id_cb_ref) : Qnil; + /* If the first callback reference has the same function function signature, use it */ + if (cbref != Qnil && CLASS_OF(cbref) == rbffi_FunctionClass) { + Function* fp; + Data_Get_Struct(cbref, Function, fp); + if (fp->rbFunctionInfo == rbFunctionInfo) { + return cbref; + } + } + + cbTable = RTEST(rb_ivar_defined(proc, id_cbtable)) ? rb_ivar_get(proc, id_cbtable) : Qnil; + if (cbTable != Qnil && (callback = rb_hash_aref(cbTable, rbFunctionInfo)) != Qnil) { + return callback; + } + + /* No existing function for the proc with that signature, create a new one and cache it */ + callback = rbffi_Function_NewInstance(rbFunctionInfo, proc); + if (cbref == Qnil) { + /* If there is no other cb already cached for this proc, we can use the ivar slot */ + rb_ivar_set(proc, id_cb_ref, callback); + } else { + /* The proc instance has been used as more than one type of callback, store extras in a hash */ + if(cbTable == Qnil) { + cbTable = rb_hash_new(); + rb_ivar_set(proc, id_cbtable, cbTable); + } + rb_hash_aset(cbTable, rbFunctionInfo, callback); + } + + return callback; +} + +#if !defined(_WIN32) && defined(DEFER_ASYNC_CALLBACK) +static void +after_fork_callback(void) +{ + /* Ensure that a new dispatcher thread is started in a forked process */ + async_cb_thread = Qnil; + pthread_mutex_init(&async_cb_mutex, NULL); + pthread_cond_init(&async_cb_cond, NULL); +} +#endif + +static VALUE +function_init(VALUE self, VALUE rbFunctionInfo, VALUE rbProc) +{ + Function* fn = NULL; + + Data_Get_Struct(self, Function, fn); + + fn->rbFunctionInfo = rbFunctionInfo; + + Data_Get_Struct(fn->rbFunctionInfo, FunctionType, fn->info); + + if (rb_obj_is_kind_of(rbProc, rbffi_PointerClass)) { + Pointer* orig; + Data_Get_Struct(rbProc, Pointer, orig); + fn->base.memory = orig->memory; + fn->base.rbParent = rbProc; + + } else if (rb_obj_is_kind_of(rbProc, rb_cProc) || rb_respond_to(rbProc, id_call)) { + if (fn->info->closurePool == NULL) { + fn->info->closurePool = rbffi_ClosurePool_New(sizeof(ffi_closure), callback_prep, fn->info); + if (fn->info->closurePool == NULL) { + rb_raise(rb_eNoMemError, "failed to create closure pool"); + } + } + +#if defined(DEFER_ASYNC_CALLBACK) + if (async_cb_thread == Qnil) { + +#if !defined(_WIN32) + if( pthread_atfork(NULL, NULL, after_fork_callback) ){ + rb_warn("FFI: unable to register fork callback"); + } +#endif + + async_cb_thread = rb_thread_create(async_cb_event, NULL); + /* Name thread, for better debugging */ + rb_funcall(async_cb_thread, rb_intern("name="), 1, rb_str_new2("FFI Callback Dispatcher")); + } +#endif + + fn->closure = rbffi_Closure_Alloc(fn->info->closurePool); + fn->closure->info = fn; + fn->base.memory.address = fn->closure->code; + fn->base.memory.size = sizeof(*fn->closure); + fn->autorelease = true; + + } else { + rb_raise(rb_eTypeError, "wrong argument type %s, expected pointer or proc", + rb_obj_classname(rbProc)); + } + + fn->rbProc = rbProc; + + return self; +} + +/* + * call-seq: call(*args) + * @param [Array] args function arguments + * @return [FFI::Type] + * Call the function + */ +static VALUE +function_call(int argc, VALUE* argv, VALUE self) +{ + Function* fn; + + Data_Get_Struct(self, Function, fn); + + return (*fn->info->invoke)(argc, argv, fn->base.memory.address, fn->info); +} + +/* + * call-seq: attach(m, name) + * @param [Module] m + * @param [String] name + * @return [self] + * Attach a Function to the Module +m+ as +name+. + */ +static VALUE +function_attach(VALUE self, VALUE module, VALUE name) +{ + Function* fn; + char var[1024]; + + Data_Get_Struct(self, Function, fn); + + if (fn->info->parameterCount == -1) { + rb_raise(rb_eRuntimeError, "cannot attach variadic functions"); + return Qnil; + } + + if (!rb_obj_is_kind_of(module, rb_cModule)) { + rb_raise(rb_eRuntimeError, "trying to attach function to non-module"); + return Qnil; + } + + if (fn->methodHandle == NULL) { + fn->methodHandle = rbffi_MethodHandle_Alloc(fn->info, fn->base.memory.address); + } + + /* + * Stash the Function in a module variable so it does not get garbage collected + */ + snprintf(var, sizeof(var), "@@%s", StringValueCStr(name)); + rb_cv_set(module, var, self); + + rb_define_singleton_method(module, StringValueCStr(name), + rbffi_MethodHandle_CodeAddress(fn->methodHandle), -1); + + + rb_define_method(module, StringValueCStr(name), + rbffi_MethodHandle_CodeAddress(fn->methodHandle), -1); + + return self; +} + +/* + * call-seq: autorelease = autorelease + * @param [Boolean] autorelease + * @return [self] + * Set +autorelease+ attribute (See {Pointer}). + */ +static VALUE +function_set_autorelease(VALUE self, VALUE autorelease) +{ + Function* fn; + + Data_Get_Struct(self, Function, fn); + + fn->autorelease = RTEST(autorelease); + + return self; +} + +static VALUE +function_autorelease_p(VALUE self) +{ + Function* fn; + + Data_Get_Struct(self, Function, fn); + + return fn->autorelease ? Qtrue : Qfalse; +} + +/* + * call-seq: free + * @return [self] + * Free memory allocated by Function. + */ +static VALUE +function_release(VALUE self) +{ + Function* fn; + + Data_Get_Struct(self, Function, fn); + + if (fn->closure == NULL) { + rb_raise(rb_eRuntimeError, "cannot free function which was not allocated"); + } + + rbffi_Closure_Free(fn->closure); + fn->closure = NULL; + + return self; +} + +static void +callback_invoke(ffi_cif* cif, void* retval, void** parameters, void* user_data) +{ + struct gvl_callback cb = { 0 }; + + cb.closure = (Closure *) user_data; + cb.retval = retval; + cb.parameters = parameters; + cb.done = false; + cb.frame = rbffi_frame_current(); + + if (cb.frame != NULL) cb.frame->exc = Qnil; + + if (ruby_native_thread_p()) { + if(ruby_thread_has_gvl_p()) { + callback_with_gvl(&cb); + } else { + rb_thread_call_with_gvl(callback_with_gvl, &cb); + } +#if defined(DEFER_ASYNC_CALLBACK) && !defined(_WIN32) + } else { + bool empty = false; + + pthread_mutex_init(&cb.async_mutex, NULL); + pthread_cond_init(&cb.async_cond, NULL); + + /* Now signal the async callback thread */ + pthread_mutex_lock(&async_cb_mutex); + empty = async_cb_list == NULL; + cb.next = async_cb_list; + async_cb_list = &cb; + + pthread_cond_signal(&async_cb_cond); + pthread_mutex_unlock(&async_cb_mutex); + + /* Wait for the thread executing the ruby callback to signal it is done */ + pthread_mutex_lock(&cb.async_mutex); + while (!cb.done) { + pthread_cond_wait(&cb.async_cond, &cb.async_mutex); + } + pthread_mutex_unlock(&cb.async_mutex); + pthread_cond_destroy(&cb.async_cond); + pthread_mutex_destroy(&cb.async_mutex); + +#elif defined(DEFER_ASYNC_CALLBACK) && defined(_WIN32) + } else { + bool empty = false; + + cb.async_event = CreateEvent(NULL, FALSE, FALSE, NULL); + + /* Now signal the async callback thread */ + EnterCriticalSection(&async_cb_lock); + empty = async_cb_list == NULL; + cb.next = async_cb_list; + async_cb_list = &cb; + LeaveCriticalSection(&async_cb_lock); + + SetEvent(async_cb_cond); + + /* Wait for the thread executing the ruby callback to signal it is done */ + WaitForSingleObject(cb.async_event, INFINITE); + CloseHandle(cb.async_event); +#endif + } +} + +#if defined(DEFER_ASYNC_CALLBACK) +struct async_wait { + void* cb; + bool stop; +}; + +static void * async_cb_wait(void *); +static void async_cb_stop(void *); + +static VALUE +async_cb_event(void* unused) +{ + struct async_wait w = { 0 }; + + w.stop = false; + while (!w.stop) { + rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w); + if (w.cb != NULL) { + /* Start up a new ruby thread to run the ruby callback */ + VALUE new_thread = rb_thread_create(async_cb_call, w.cb); + /* Name thread, for better debugging */ + rb_funcall(new_thread, rb_intern("name="), 1, rb_str_new2("FFI Callback Runner")); + } + } + + return Qnil; +} + +#ifdef _WIN32 +static void * +async_cb_wait(void *data) +{ + struct async_wait* w = (struct async_wait *) data; + + w->cb = NULL; + + EnterCriticalSection(&async_cb_lock); + + while (!w->stop && async_cb_list == NULL) { + LeaveCriticalSection(&async_cb_lock); + WaitForSingleObject(async_cb_cond, INFINITE); + EnterCriticalSection(&async_cb_lock); + } + + if (async_cb_list != NULL) { + w->cb = async_cb_list; + async_cb_list = async_cb_list->next; + } + + LeaveCriticalSection(&async_cb_lock); + + return NULL; +} + +static void +async_cb_stop(void *data) +{ + struct async_wait* w = (struct async_wait *) data; + + EnterCriticalSection(&async_cb_lock); + w->stop = true; + LeaveCriticalSection(&async_cb_lock); + SetEvent(async_cb_cond); +} + +#else +static void * +async_cb_wait(void *data) +{ + struct async_wait* w = (struct async_wait *) data; + + w->cb = NULL; + + pthread_mutex_lock(&async_cb_mutex); + + while (!w->stop && async_cb_list == NULL) { + pthread_cond_wait(&async_cb_cond, &async_cb_mutex); + } + + if (async_cb_list != NULL) { + w->cb = async_cb_list; + async_cb_list = async_cb_list->next; + } + + pthread_mutex_unlock(&async_cb_mutex); + + return NULL; +} + +static void +async_cb_stop(void *data) +{ + struct async_wait* w = (struct async_wait *) data; + + pthread_mutex_lock(&async_cb_mutex); + w->stop = true; + pthread_cond_signal(&async_cb_cond); + pthread_mutex_unlock(&async_cb_mutex); +} +#endif + +static VALUE +async_cb_call(void *data) +{ + struct gvl_callback* cb = (struct gvl_callback *) data; + + callback_with_gvl(data); + + /* Signal the original native thread that the ruby code has completed */ +#ifdef _WIN32 + SetEvent(cb->async_event); +#else + pthread_mutex_lock(&cb->async_mutex); + cb->done = true; + pthread_cond_signal(&cb->async_cond); + pthread_mutex_unlock(&cb->async_mutex); +#endif + + return Qnil; +} + +#endif + +static void * +callback_with_gvl(void* data) +{ + rb_rescue2(invoke_callback, (VALUE) data, save_callback_exception, (VALUE) data, rb_eException, (VALUE) 0); + return NULL; +} + +static VALUE +invoke_callback(VALUE data) +{ + struct gvl_callback* cb = (struct gvl_callback *) data; + + Function* fn = (Function *) cb->closure->info; + FunctionType *cbInfo = fn->info; + Type* returnType = cbInfo->returnType; + void* retval = cb->retval; + void** parameters = cb->parameters; + VALUE* rbParams; + VALUE rbReturnType = cbInfo->rbReturnType; + VALUE rbReturnValue; + int i; + + rbParams = ALLOCA_N(VALUE, cbInfo->parameterCount); + for (i = 0; i < cbInfo->parameterCount; ++i) { + VALUE param; + Type* paramType = cbInfo->parameterTypes[i]; + VALUE rbParamType = rb_ary_entry(cbInfo->rbParameterTypes, i); + + if (unlikely(paramType->nativeType == NATIVE_MAPPED)) { + rbParamType = ((MappedType *) paramType)->rbType; + paramType = ((MappedType *) paramType)->type; + } + + switch (paramType->nativeType) { + case NATIVE_INT8: + param = INT2NUM(*(int8_t *) parameters[i]); + break; + case NATIVE_UINT8: + param = UINT2NUM(*(uint8_t *) parameters[i]); + break; + case NATIVE_INT16: + param = INT2NUM(*(int16_t *) parameters[i]); + break; + case NATIVE_UINT16: + param = UINT2NUM(*(uint16_t *) parameters[i]); + break; + case NATIVE_INT32: + param = INT2NUM(*(int32_t *) parameters[i]); + break; + case NATIVE_UINT32: + param = UINT2NUM(*(uint32_t *) parameters[i]); + break; + case NATIVE_INT64: + param = LL2NUM(*(int64_t *) parameters[i]); + break; + case NATIVE_UINT64: + param = ULL2NUM(*(uint64_t *) parameters[i]); + break; + case NATIVE_LONG: + param = LONG2NUM(*(long *) parameters[i]); + break; + case NATIVE_ULONG: + param = ULONG2NUM(*(unsigned long *) parameters[i]); + break; + case NATIVE_FLOAT32: + param = rb_float_new(*(float *) parameters[i]); + break; + case NATIVE_FLOAT64: + param = rb_float_new(*(double *) parameters[i]); + break; + case NATIVE_LONGDOUBLE: + param = rbffi_longdouble_new(*(long double *) parameters[i]); + break; + case NATIVE_STRING: + param = (*(void **) parameters[i] != NULL) ? rb_str_new2(*(char **) parameters[i]) : Qnil; + break; + case NATIVE_POINTER: + param = rbffi_Pointer_NewInstance(*(void **) parameters[i]); + break; + case NATIVE_BOOL: + param = (*(uint8_t *) parameters[i]) ? Qtrue : Qfalse; + break; + + case NATIVE_FUNCTION: + case NATIVE_STRUCT: + param = rbffi_NativeValue_ToRuby(paramType, rbParamType, parameters[i]); + break; + + default: + param = Qnil; + break; + } + + /* Convert the native value into a custom ruby value */ + if (unlikely(cbInfo->parameterTypes[i]->nativeType == NATIVE_MAPPED)) { + VALUE values[] = { param, Qnil }; + param = rb_funcall2(((MappedType *) cbInfo->parameterTypes[i])->rbConverter, id_from_native, 2, values); + } + + rbParams[i] = param; + } + + rbReturnValue = rb_funcall2(fn->rbProc, id_call, cbInfo->parameterCount, rbParams); + + if (unlikely(returnType->nativeType == NATIVE_MAPPED)) { + VALUE values[] = { rbReturnValue, Qnil }; + rbReturnValue = rb_funcall2(((MappedType *) returnType)->rbConverter, id_to_native, 2, values); + rbReturnType = ((MappedType *) returnType)->rbType; + returnType = ((MappedType* ) returnType)->type; + } + + if (rbReturnValue == Qnil || TYPE(rbReturnValue) == T_NIL) { + memset(retval, 0, returnType->ffiType->size); + } else switch (returnType->nativeType) { + case NATIVE_INT8: + case NATIVE_INT16: + case NATIVE_INT32: + *((ffi_sarg *) retval) = NUM2INT(rbReturnValue); + break; + case NATIVE_UINT8: + case NATIVE_UINT16: + case NATIVE_UINT32: + *((ffi_arg *) retval) = NUM2UINT(rbReturnValue); + break; + case NATIVE_INT64: + *((int64_t *) retval) = NUM2LL(rbReturnValue); + break; + case NATIVE_UINT64: + *((uint64_t *) retval) = NUM2ULL(rbReturnValue); + break; + case NATIVE_LONG: + *((ffi_sarg *) retval) = NUM2LONG(rbReturnValue); + break; + case NATIVE_ULONG: + *((ffi_arg *) retval) = NUM2ULONG(rbReturnValue); + break; + case NATIVE_FLOAT32: + *((float *) retval) = (float) NUM2DBL(rbReturnValue); + break; + case NATIVE_FLOAT64: + *((double *) retval) = NUM2DBL(rbReturnValue); + break; + case NATIVE_LONGDOUBLE: + *((long double *) retval) = rbffi_num2longdouble(rbReturnValue); + break; + case NATIVE_POINTER: + if (TYPE(rbReturnValue) == T_DATA && rb_obj_is_kind_of(rbReturnValue, rbffi_PointerClass)) { + *((void **) retval) = ((AbstractMemory *) DATA_PTR(rbReturnValue))->address; + } else { + /* Default to returning NULL if not a value pointer object. handles nil case as well */ + *((void **) retval) = NULL; + } + break; + + case NATIVE_BOOL: + *((ffi_arg *) retval) = rbReturnValue == Qtrue; + break; + + case NATIVE_FUNCTION: + if (TYPE(rbReturnValue) == T_DATA && rb_obj_is_kind_of(rbReturnValue, rbffi_PointerClass)) { + + *((void **) retval) = ((AbstractMemory *) DATA_PTR(rbReturnValue))->address; + + } else if (rb_obj_is_kind_of(rbReturnValue, rb_cProc) || rb_respond_to(rbReturnValue, id_call)) { + VALUE function; + + function = rbffi_Function_ForProc(rbReturnType, rbReturnValue); + + *((void **) retval) = ((AbstractMemory *) DATA_PTR(function))->address; + } else { + *((void **) retval) = NULL; + } + break; + + case NATIVE_STRUCT: + if (TYPE(rbReturnValue) == T_DATA && rb_obj_is_kind_of(rbReturnValue, rbffi_StructClass)) { + AbstractMemory* memory = ((Struct *) DATA_PTR(rbReturnValue))->pointer; + + if (memory->address != NULL) { + memcpy(retval, memory->address, returnType->ffiType->size); + + } else { + memset(retval, 0, returnType->ffiType->size); + } + + } else { + memset(retval, 0, returnType->ffiType->size); + } + break; + + default: + *((ffi_arg *) retval) = 0; + break; + } + + return Qnil; +} + +static VALUE +save_callback_exception(VALUE data, VALUE exc) +{ + struct gvl_callback* cb = (struct gvl_callback *) data; + + memset(cb->retval, 0, ((Function *) cb->closure->info)->info->returnType->ffiType->size); + if (cb->frame != NULL) cb->frame->exc = exc; + + return Qnil; +} + +static bool +callback_prep(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize) +{ + FunctionType* fnInfo = (FunctionType *) ctx; + ffi_status ffiStatus; + + ffiStatus = ffi_prep_closure_loc(closure->pcl, &fnInfo->ffi_cif, callback_invoke, closure, code); + if (ffiStatus != FFI_OK) { + snprintf(errmsg, errmsgsize, "ffi_prep_closure_loc failed. status=%#x", ffiStatus); + return false; + } + + return true; +} + +void +rbffi_Function_Init(VALUE moduleFFI) +{ + rbffi_FunctionInfo_Init(moduleFFI); + /* + * Document-class: FFI::Function < FFI::Pointer + */ + rbffi_FunctionClass = rb_define_class_under(moduleFFI, "Function", rbffi_PointerClass); + + rb_global_variable(&rbffi_FunctionClass); + rb_define_alloc_func(rbffi_FunctionClass, function_allocate); + + rb_define_method(rbffi_FunctionClass, "initialize", function_initialize, -1); + rb_define_method(rbffi_FunctionClass, "initialize_copy", function_initialize_copy, 1); + rb_define_method(rbffi_FunctionClass, "call", function_call, -1); + rb_define_method(rbffi_FunctionClass, "attach", function_attach, 2); + rb_define_method(rbffi_FunctionClass, "free", function_release, 0); + rb_define_method(rbffi_FunctionClass, "autorelease=", function_set_autorelease, 1); + /* + * call-seq: autorelease + * @return [Boolean] + * Get +autorelease+ attribute. + * Synonymous for {#autorelease?}. + */ + rb_define_method(rbffi_FunctionClass, "autorelease", function_autorelease_p, 0); + /* + * call-seq: autorelease? + * @return [Boolean] +autorelease+ attribute + * Get +autorelease+ attribute. + */ + rb_define_method(rbffi_FunctionClass, "autorelease?", function_autorelease_p, 0); + + id_call = rb_intern("call"); + id_cbtable = rb_intern("@__ffi_callback_table__"); + id_cb_ref = rb_intern("@__ffi_callback__"); + id_to_native = rb_intern("to_native"); + id_from_native = rb_intern("from_native"); +#if defined(_WIN32) + InitializeCriticalSection(&async_cb_lock); + async_cb_cond = CreateEvent(NULL, FALSE, FALSE, NULL); +#endif +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.h new file mode 100644 index 0000000..406b4d8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_FUNCTION_H +#define RBFFI_FUNCTION_H + +#ifdef __cplusplus +extern "C" { +#endif + +# include + +#include + +typedef struct FunctionType_ FunctionType; + +#include "Type.h" +#include "Call.h" +#include "ClosurePool.h" + +struct FunctionType_ { + Type type; /* The native type of a FunctionInfo object */ + VALUE rbReturnType; + VALUE rbParameterTypes; + + Type* returnType; + Type** parameterTypes; + NativeType* nativeParameterTypes; + ffi_type* ffiReturnType; + ffi_type** ffiParameterTypes; + ffi_cif ffi_cif; + Invoker invoke; + ClosurePool* closurePool; + int parameterCount; + int flags; + ffi_abi abi; + int callbackCount; + VALUE* callbackParameters; + VALUE rbEnums; + bool ignoreErrno; + bool blocking; + bool hasStruct; +}; + +extern VALUE rbffi_FunctionTypeClass, rbffi_FunctionClass; + +void rbffi_Function_Init(VALUE moduleFFI); +VALUE rbffi_Function_NewInstance(VALUE functionInfo, VALUE proc); +VALUE rbffi_Function_ForProc(VALUE cbInfo, VALUE proc); +void rbffi_FunctionInfo_Init(VALUE moduleFFI); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_FUNCTION_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.o new file mode 100644 index 0000000..69ae2b2 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Function.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.c new file mode 100644 index 0000000..64e9874 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.c @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * Copyright (C) 2009 Andrea Fazzi + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +# include +#endif +#include +#include + +#include +#include + +#include +#include + +#include +#include "rbffi.h" +#include "compat.h" + +#include "AbstractMemory.h" +#include "Types.h" +#include "Type.h" +#include "StructByValue.h" +#include "Function.h" + +static VALUE fntype_allocate(VALUE klass); +static VALUE fntype_initialize(int argc, VALUE* argv, VALUE self); +static void fntype_mark(FunctionType*); +static void fntype_free(FunctionType *); + +VALUE rbffi_FunctionTypeClass = Qnil; + +static VALUE +fntype_allocate(VALUE klass) +{ + FunctionType* fnInfo; + VALUE obj = Data_Make_Struct(klass, FunctionType, fntype_mark, fntype_free, fnInfo); + + fnInfo->type.ffiType = &ffi_type_pointer; + fnInfo->type.nativeType = NATIVE_FUNCTION; + fnInfo->rbReturnType = Qnil; + fnInfo->rbParameterTypes = Qnil; + fnInfo->rbEnums = Qnil; + fnInfo->invoke = rbffi_CallFunction; + fnInfo->closurePool = NULL; + + return obj; +} + +static void +fntype_mark(FunctionType* fnInfo) +{ + rb_gc_mark(fnInfo->rbReturnType); + rb_gc_mark(fnInfo->rbParameterTypes); + rb_gc_mark(fnInfo->rbEnums); + if (fnInfo->callbackCount > 0 && fnInfo->callbackParameters != NULL) { + rb_gc_mark_locations(&fnInfo->callbackParameters[0], &fnInfo->callbackParameters[fnInfo->callbackCount]); + } +} + +static void +fntype_free(FunctionType* fnInfo) +{ + xfree(fnInfo->parameterTypes); + xfree(fnInfo->ffiParameterTypes); + xfree(fnInfo->nativeParameterTypes); + xfree(fnInfo->callbackParameters); + if (fnInfo->closurePool != NULL) { + rbffi_ClosurePool_Free(fnInfo->closurePool); + } + xfree(fnInfo); +} + +/* + * call-seq: initialize(return_type, param_types, options={}) + * @param [Type, Symbol] return_type return type for the function + * @param [Array] param_types array of parameters types + * @param [Hash] options + * @option options [Boolean] :blocking set to true if the C function is a blocking call + * @option options [Symbol] :convention calling convention see {FFI::Library#calling_convention} + * @option options [FFI::Enums] :enums + * @return [self] + * A new FunctionType instance. + */ +static VALUE +fntype_initialize(int argc, VALUE* argv, VALUE self) +{ + FunctionType *fnInfo; + ffi_status status; + VALUE rbReturnType = Qnil, rbParamTypes = Qnil, rbOptions = Qnil; + VALUE rbEnums = Qnil, rbConvention = Qnil, rbBlocking = Qnil; +#if defined(X86_WIN32) + VALUE rbConventionStr; +#endif + int i, nargs; + + nargs = rb_scan_args(argc, argv, "21", &rbReturnType, &rbParamTypes, &rbOptions); + if (nargs >= 3 && rbOptions != Qnil) { + rbConvention = rb_hash_aref(rbOptions, ID2SYM(rb_intern("convention"))); + rbEnums = rb_hash_aref(rbOptions, ID2SYM(rb_intern("enums"))); + rbBlocking = rb_hash_aref(rbOptions, ID2SYM(rb_intern("blocking"))); + } + + Check_Type(rbParamTypes, T_ARRAY); + + Data_Get_Struct(self, FunctionType, fnInfo); + fnInfo->parameterCount = (int) RARRAY_LEN(rbParamTypes); + fnInfo->parameterTypes = xcalloc(fnInfo->parameterCount, sizeof(*fnInfo->parameterTypes)); + fnInfo->ffiParameterTypes = xcalloc(fnInfo->parameterCount, sizeof(ffi_type *)); + fnInfo->nativeParameterTypes = xcalloc(fnInfo->parameterCount, sizeof(*fnInfo->nativeParameterTypes)); + fnInfo->rbParameterTypes = rb_ary_new2(fnInfo->parameterCount); + fnInfo->rbEnums = rbEnums; + fnInfo->blocking = RTEST(rbBlocking); + fnInfo->hasStruct = false; + + for (i = 0; i < fnInfo->parameterCount; ++i) { + VALUE entry = rb_ary_entry(rbParamTypes, i); + VALUE type = rbffi_Type_Lookup(entry); + + if (!RTEST(type)) { + VALUE typeName = rb_funcall2(entry, rb_intern("inspect"), 0, NULL); + rb_raise(rb_eTypeError, "Invalid parameter type (%s)", RSTRING_PTR(typeName)); + } + + if (rb_obj_is_kind_of(type, rbffi_FunctionTypeClass)) { + REALLOC_N(fnInfo->callbackParameters, VALUE, fnInfo->callbackCount + 1); + fnInfo->callbackParameters[fnInfo->callbackCount++] = type; + } + + if (rb_obj_is_kind_of(type, rbffi_StructByValueClass)) { + fnInfo->hasStruct = true; + } + + rb_ary_push(fnInfo->rbParameterTypes, type); + Data_Get_Struct(type, Type, fnInfo->parameterTypes[i]); + fnInfo->ffiParameterTypes[i] = fnInfo->parameterTypes[i]->ffiType; + fnInfo->nativeParameterTypes[i] = fnInfo->parameterTypes[i]->nativeType; + } + + fnInfo->rbReturnType = rbffi_Type_Lookup(rbReturnType); + if (!RTEST(fnInfo->rbReturnType)) { + VALUE typeName = rb_funcall2(rbReturnType, rb_intern("inspect"), 0, NULL); + rb_raise(rb_eTypeError, "Invalid return type (%s)", RSTRING_PTR(typeName)); + } + + if (rb_obj_is_kind_of(fnInfo->rbReturnType, rbffi_StructByValueClass)) { + fnInfo->hasStruct = true; + } + + Data_Get_Struct(fnInfo->rbReturnType, Type, fnInfo->returnType); + fnInfo->ffiReturnType = fnInfo->returnType->ffiType; + +#if defined(X86_WIN32) + rbConventionStr = (rbConvention != Qnil) ? rb_funcall2(rbConvention, rb_intern("to_s"), 0, NULL) : Qnil; + fnInfo->abi = (rbConventionStr != Qnil && strcmp(StringValueCStr(rbConventionStr), "stdcall") == 0) + ? FFI_STDCALL : FFI_DEFAULT_ABI; +#else + fnInfo->abi = FFI_DEFAULT_ABI; +#endif + + status = ffi_prep_cif(&fnInfo->ffi_cif, fnInfo->abi, fnInfo->parameterCount, + fnInfo->ffiReturnType, fnInfo->ffiParameterTypes); + switch (status) { + case FFI_BAD_ABI: + rb_raise(rb_eArgError, "Invalid ABI specified"); + case FFI_BAD_TYPEDEF: + rb_raise(rb_eArgError, "Invalid argument type specified"); + case FFI_OK: + break; + default: + rb_raise(rb_eArgError, "Unknown FFI error"); + } + + fnInfo->invoke = rbffi_GetInvoker(fnInfo); + + return self; +} + +/* + * call-seq: result_type + * @return [Type] + * Get the return type of the function type + */ +static VALUE +fntype_result_type(VALUE self) +{ + FunctionType* ft; + + Data_Get_Struct(self, FunctionType, ft); + + return ft->rbReturnType; +} + +/* + * call-seq: param_types + * @return [Array] + * Get parameters types. + */ +static VALUE +fntype_param_types(VALUE self) +{ + FunctionType* ft; + + Data_Get_Struct(self, FunctionType, ft); + + return rb_ary_dup(ft->rbParameterTypes); +} + +void +rbffi_FunctionInfo_Init(VALUE moduleFFI) +{ + VALUE ffi_Type; + + ffi_Type = rbffi_TypeClass; + + /* + * Document-class: FFI::FunctionType < FFI::Type + */ + rbffi_FunctionTypeClass = rb_define_class_under(moduleFFI, "FunctionType",ffi_Type); + rb_global_variable(&rbffi_FunctionTypeClass); + /* + * Document-const: FFI::CallbackInfo = FFI::FunctionType + */ + rb_define_const(moduleFFI, "CallbackInfo", rbffi_FunctionTypeClass); + /* + * Document-const: FFI::FunctionInfo = FFI::FunctionType + */ + rb_define_const(moduleFFI, "FunctionInfo", rbffi_FunctionTypeClass); + /* + * Document-const: FFI::Type::Function = FFI::FunctionType + */ + rb_define_const(ffi_Type, "Function", rbffi_FunctionTypeClass); + + rb_define_alloc_func(rbffi_FunctionTypeClass, fntype_allocate); + rb_define_method(rbffi_FunctionTypeClass, "initialize", fntype_initialize, -1); + rb_define_method(rbffi_FunctionTypeClass, "result_type", fntype_result_type, 0); + rb_define_method(rbffi_FunctionTypeClass, "param_types", fntype_param_types, 0); + +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.o new file mode 100644 index 0000000..3fc1ce0 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/FunctionInfo.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.c new file mode 100644 index 0000000..6beecef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.c @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (C) 2009 Aman Gupta + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +# include +#endif +#include +#include +#include +#include +#include +#include + +#include "LastError.h" + +#if defined(HAVE_NATIVETHREAD) && !defined(_WIN32) && !defined(__WIN32__) +# include +# define USE_PTHREAD_LOCAL +#endif + +#if defined(__CYGWIN__) +typedef uint32_t DWORD; +DWORD __stdcall GetLastError(void); +void __stdcall SetLastError(DWORD); +#endif + +typedef struct ThreadData { + int td_errno; +#if defined(_WIN32) || defined(__CYGWIN__) + DWORD td_winapi_errno; +#endif +} ThreadData; + +#if defined(USE_PTHREAD_LOCAL) +static pthread_key_t threadDataKey; +#endif + +static inline ThreadData* thread_data_get(void); + +#if defined(USE_PTHREAD_LOCAL) + +static ThreadData* +thread_data_init(void) +{ + ThreadData* td = xcalloc(1, sizeof(ThreadData)); + + pthread_setspecific(threadDataKey, td); + + return td; +} + + +static inline ThreadData* +thread_data_get(void) +{ + ThreadData* td = pthread_getspecific(threadDataKey); + return td != NULL ? td : thread_data_init(); +} + +static void +thread_data_free(void *ptr) +{ + xfree(ptr); +} + +#else +static ID id_thread_data; + +static ThreadData* +thread_data_init(void) +{ + ThreadData* td; + VALUE obj; + + obj = Data_Make_Struct(rb_cObject, ThreadData, NULL, -1, td); + rb_thread_local_aset(rb_thread_current(), id_thread_data, obj); + + return td; +} + +static inline ThreadData* +thread_data_get() +{ + VALUE obj = rb_thread_local_aref(rb_thread_current(), id_thread_data); + + if (obj != Qnil && TYPE(obj) == T_DATA) { + return (ThreadData *) DATA_PTR(obj); + } + + return thread_data_init(); +} + +#endif + + +/* + * call-seq: error + * @return [Numeric] + * Get +errno+ value. + */ +static VALUE +get_last_error(VALUE self) +{ + return INT2NUM(thread_data_get()->td_errno); +} + +#if defined(_WIN32) || defined(__CYGWIN__) +/* + * call-seq: winapi_error + * @return [Numeric] + * Get +GetLastError()+ value. Only Windows or Cygwin. + */ +static VALUE +get_last_winapi_error(VALUE self) +{ + return INT2NUM(thread_data_get()->td_winapi_errno); +} +#endif + + +/* + * call-seq: error(error) + * @param [Numeric] error + * @return [nil] + * Set +errno+ value. + */ +static VALUE +set_last_error(VALUE self, VALUE error) +{ + +#ifdef _WIN32 + SetLastError(NUM2INT(error)); +#else + errno = NUM2INT(error); +#endif + + return Qnil; +} + +#if defined(_WIN32) || defined(__CYGWIN__) +/* + * call-seq: error(error) + * @param [Numeric] error + * @return [nil] + * Set +GetLastError()+ value. Only on Windows and Cygwin. + */ +static VALUE +set_last_winapi_error(VALUE self, VALUE error) +{ + SetLastError(NUM2INT(error)); + return Qnil; +} +#endif + + +void +rbffi_save_errno(void) +{ + int error = 0; +#ifdef _WIN32 + error = GetLastError(); +#else + error = errno; +#endif + +#if defined(_WIN32) || defined(__CYGWIN__) + DWORD winapi_error = GetLastError(); + thread_data_get()->td_winapi_errno = winapi_error; +#endif + + thread_data_get()->td_errno = error; +} + +void +rbffi_LastError_Init(VALUE moduleFFI) +{ + /* + * Document-module: FFI::LastError + * This module defines a couple of method to set and get +errno+ + * for current thread. + */ + VALUE moduleError = rb_define_module_under(moduleFFI, "LastError"); + + rb_define_module_function(moduleError, "error", get_last_error, 0); + rb_define_module_function(moduleError, "error=", set_last_error, 1); + +#if defined(_WIN32) || defined(__CYGWIN__) + rb_define_module_function(moduleError, "winapi_error", get_last_winapi_error, 0); + rb_define_module_function(moduleError, "winapi_error=", set_last_winapi_error, 1); +#endif + +#if defined(USE_PTHREAD_LOCAL) + pthread_key_create(&threadDataKey, thread_data_free); +#else + id_thread_data = rb_intern("ffi_thread_local_data"); +#endif /* USE_PTHREAD_LOCAL */ +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.h new file mode 100644 index 0000000..ee1dfbb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_LASTERROR_H +#define RBFFI_LASTERROR_H + +#ifdef __cplusplus +extern "C" { +#endif + + +void rbffi_LastError_Init(VALUE moduleFFI); + +void rbffi_save_errno(void); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_LASTERROR_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.o new file mode 100644 index 0000000..510cdf9 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LastError.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.c new file mode 100644 index 0000000..c95f2fd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.c @@ -0,0 +1,65 @@ +#include "LongDouble.h" +#include +#include +#include + +#if defined (__CYGWIN__) || defined(__INTERIX) || defined(_MSC_VER) +# define strtold(str, endptr) ((long double) strtod((str), (endptr))) +#endif /* defined (__CYGWIN__) */ + +static VALUE rb_cBigDecimal = Qnil; +static VALUE bigdecimal_load(VALUE unused); +static VALUE bigdecimal_failed(VALUE value, VALUE exc); + +VALUE +rbffi_longdouble_new(long double ld) +{ + if (!RTEST(rb_cBigDecimal)) { + /* allow fallback if the bigdecimal library is unavailable in future ruby versions */ + rb_cBigDecimal = rb_rescue(bigdecimal_load, Qnil, bigdecimal_failed, rb_cObject); + } + + if (RTEST(rb_cBigDecimal) && rb_cBigDecimal != rb_cObject) { + char buf[128]; + return rb_funcall(rb_mKernel, rb_intern("BigDecimal"), 1, rb_str_new(buf, sprintf(buf, "%.35Le", ld))); + } + + /* Fall through to handling as a float */ + return rb_float_new(ld); +} + +long double +rbffi_num2longdouble(VALUE value) +{ + if (TYPE(value) == T_FLOAT) { + return rb_num2dbl(value); + } + + if (!RTEST(rb_cBigDecimal) && rb_const_defined(rb_cObject, rb_intern("BigDecimal"))) { + rb_cBigDecimal = rb_const_get(rb_cObject, rb_intern("BigDecimal")); + } + + if (RTEST(rb_cBigDecimal) && rb_cBigDecimal != rb_cObject && RTEST(rb_obj_is_kind_of(value, rb_cBigDecimal))) { + VALUE s = rb_funcall(value, rb_intern("to_s"), 1, rb_str_new2("E")); + long double ret = strtold(RSTRING_PTR(s), NULL); + RB_GC_GUARD(s); + return ret; + } + + /* Fall through to handling as a float */ + return rb_num2dbl(value); +} + + +static VALUE +bigdecimal_load(VALUE unused) +{ + rb_require("bigdecimal"); + return rb_const_get(rb_cObject, rb_intern("BigDecimal")); +} + +static VALUE +bigdecimal_failed(VALUE value, VALUE exc) +{ + return value; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.h new file mode 100644 index 0000000..079e890 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2012, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_LONGDOUBLE_H +#define RBFFI_LONGDOUBLE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern VALUE rbffi_longdouble_new(long double ld); +extern long double rbffi_num2longdouble(VALUE value); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_LONGDOUBLE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.o new file mode 100644 index 0000000..7e372ec Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/LongDouble.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Makefile b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Makefile new file mode 100644 index 0000000..a428503 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Makefile @@ -0,0 +1,267 @@ + +SHELL = /bin/sh + +# V=0 quiet, V=1 verbose. other values don't work. +V = 0 +V0 = $(V:0=) +Q1 = $(V:1=) +Q = $(Q1:0=@) +ECHO1 = $(V:1=@ :) +ECHO = $(ECHO1:0=@ echo) +NULLCMD = : + +#### Start of system configuration section. #### + +srcdir = . +topdir = /usr/include/ruby-3.1.0 +hdrdir = $(topdir) +arch_hdrdir = /usr/include/ruby-3.1.0/x86_64-linux-gnu +PATH_SEPARATOR = : +VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby +prefix = $(DESTDIR)/usr +rubysitearchprefix = $(rubylibprefix)/$(sitearch) +rubyarchprefix = $(rubylibprefix)/$(arch) +rubylibprefix = $(libdir)/$(RUBY_BASE_NAME) +exec_prefix = $(DESTDIR)/usr +vendorarchhdrdir = $(vendorhdrdir)/$(sitearch) +sitearchhdrdir = $(sitehdrdir)/$(sitearch) +rubyarchhdrdir = $(rubyhdrdir)/$(arch) +vendorhdrdir = $(rubyhdrdir)/vendor_ruby +sitehdrdir = $(rubyhdrdir)/site_ruby +rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME) +vendorarchdir = $(vendorlibdir)/$(sitearch) +vendorlibdir = $(vendordir)/$(ruby_version) +vendordir = $(rubylibprefix)/vendor_ruby +sitearchdir = $(DESTDIR)./.gem.20220204-28723-jrafwf +sitelibdir = $(DESTDIR)./.gem.20220204-28723-jrafwf +sitedir = $(rubylibprefix)/site_ruby +rubyarchdir = $(rubylibdir)/$(arch) +rubylibdir = $(rubylibprefix)/$(ruby_version) +sitearchincludedir = $(includedir)/$(sitearch) +archincludedir = $(includedir)/$(arch) +sitearchlibdir = $(libdir)/$(sitearch) +archlibdir = $(libdir)/$(arch) +ridir = $(datarootdir)/$(RI_BASE_NAME) +mandir = $(DESTDIR)/usr/share/man +localedir = $(datarootdir)/locale +libdir = $(exec_prefix)/lib64 +psdir = $(docdir) +pdfdir = $(docdir) +dvidir = $(docdir) +htmldir = $(docdir) +infodir = $(DESTDIR)/usr/share/info +docdir = $(datarootdir)/doc/$(PACKAGE) +oldincludedir = $(DESTDIR)/usr/include +includedir = $(exec_prefix)/include +runstatedir = $(localstatedir)/run +localstatedir = $(DESTDIR)/var +sharedstatedir = $(DESTDIR)/var/lib +sysconfdir = $(DESTDIR)/etc +datadir = $(DESTDIR)/usr/share +datarootdir = $(prefix)/share +libexecdir = $(DESTDIR)/usr/libexec +sbindir = $(DESTDIR)/usr/sbin +bindir = $(exec_prefix)/bin +archdir = $(rubyarchdir) + + +CC_WRAPPER = +CC = gcc +CXX = g++ +LIBRUBY = $(LIBRUBY_SO) +LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a +LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME) +LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static $(MAINLIBS) +empty = +OUTFLAG = -o $(empty) +COUTFLAG = -o $(empty) +CSRCFLAG = $(empty) + +RUBY_EXTCONF_H = extconf.h +cflags = $(optflags) $(debugflags) $(warnflags) +cxxflags = +optflags = -O3 -fno-fast-math +debugflags = -ggdb3 +warnflags = +cppflags = +CCDLFLAGS = -fPIC +CFLAGS = $(CCDLFLAGS) -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC $(ARCH_FLAG) +INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) +DEFS = +CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" $(DEFS) $(cppflags) +CXXFLAGS = $(CCDLFLAGS) -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g $(ARCH_FLAG) +ldflags = -L. -flto=auto -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -L/usr/lib64/../lib64 -pthread +dldflags = -flto=auto -Wl,--compress-debug-sections=none +ARCH_FLAG = +DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG) +LDSHARED = $(CC) -shared +LDSHAREDXX = $(CXX) -shared +AR = gcc-ar +EXEEXT = + +RUBY_INSTALL_NAME = $(RUBY_BASE_NAME).ruby3.1 +RUBY_SO_NAME = ruby3.1 +RUBYW_INSTALL_NAME = +RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version) +RUBYW_BASE_NAME = rubyw +RUBY_BASE_NAME = ruby + +arch = x86_64-linux-gnu +sitearch = $(arch) +ruby_version = 3.1.0 +ruby = $(bindir)/$(RUBY_BASE_NAME).ruby3.1 +RUBY = $(ruby) +ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H) + +RM = rm -f +RM_RF = rm -fr +RMDIRS = rmdir --ignore-fail-on-non-empty -p +MAKEDIRS = /usr/bin/mkdir -p +INSTALL = /usr/bin/install -c +INSTALL_PROG = $(INSTALL) -m 0755 +INSTALL_DATA = $(INSTALL) -m 644 +COPY = cp +TOUCH = exit > + +#### End of system configuration section. #### + +preload = +libpath = . $(libdir) +LIBPATH = -L. -L$(libdir) +DEFFILE = + +CLEANFILES = mkmf.log +DISTCLEANFILES = +DISTCLEANDIRS = + +extout = +extout_prefix = +target_prefix = +LOCAL_LIBS = +LIBS = $(LIBRUBYARG_SHARED) -lffi -lffi -lm -lc +ORIG_SRCS = AbstractMemory.c ArrayType.c Buffer.c Call.c ClosurePool.c DynamicLibrary.c Function.c FunctionInfo.c LastError.c LongDouble.c MappedType.c MemoryPointer.c MethodHandle.c Platform.c Pointer.c Struct.c StructByValue.c StructLayout.c Thread.c Type.c Types.c Variadic.c ffi.c +SRCS = $(ORIG_SRCS) +OBJS = AbstractMemory.o ArrayType.o Buffer.o Call.o ClosurePool.o DynamicLibrary.o Function.o FunctionInfo.o LastError.o LongDouble.o MappedType.o MemoryPointer.o MethodHandle.o Platform.o Pointer.o Struct.o StructByValue.o StructLayout.o Thread.o Type.o Types.o Variadic.o ffi.o +HDRS = $(srcdir)/AbstractMemory.h $(srcdir)/ArrayType.h $(srcdir)/Call.h $(srcdir)/ClosurePool.h $(srcdir)/DynamicLibrary.h $(srcdir)/Function.h $(srcdir)/LastError.h $(srcdir)/LongDouble.h $(srcdir)/MappedType.h $(srcdir)/MemoryPointer.h $(srcdir)/MethodHandle.h $(srcdir)/Platform.h $(srcdir)/Pointer.h $(srcdir)/Struct.h $(srcdir)/StructByValue.h $(srcdir)/Thread.h $(srcdir)/Type.h $(srcdir)/Types.h $(srcdir)/compat.h $(srcdir)/extconf.h $(srcdir)/rbffi.h $(srcdir)/rbffi_endian.h +LOCAL_HDRS = +TARGET = ffi_c +TARGET_NAME = ffi_c +TARGET_ENTRY = Init_$(TARGET_NAME) +DLLIB = $(TARGET).so +EXTSTATIC = +STATIC_LIB = + +TIMESTAMP_DIR = . +BINDIR = $(bindir) +RUBYCOMMONDIR = $(sitedir)$(target_prefix) +RUBYLIBDIR = $(sitelibdir)$(target_prefix) +RUBYARCHDIR = $(sitearchdir)$(target_prefix) +HDRDIR = $(sitehdrdir)$(target_prefix) +ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix) +TARGET_SO_DIR = +TARGET_SO = $(TARGET_SO_DIR)$(DLLIB) +CLEANLIBS = $(TARGET_SO) false +CLEANOBJS = *.o *.bak + +all: $(DLLIB) +static: $(STATIC_LIB) +.PHONY: all install static install-so install-rb +.PHONY: clean clean-so clean-static clean-rb + +clean-static:: +clean-rb-default:: +clean-rb:: +clean-so:: +clean: clean-so clean-static clean-rb-default clean-rb + -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time + +distclean-rb-default:: +distclean-rb:: +distclean-so:: +distclean-static:: +distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb + -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log + -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES) + -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true + +realclean: distclean +install: install-so install-rb + +install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time + $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR) +clean-static:: + -$(Q)$(RM) $(STATIC_LIB) +install-rb: pre-install-rb do-install-rb install-rb-default +install-rb-default: pre-install-rb-default do-install-rb-default +pre-install-rb: Makefile +pre-install-rb-default: Makefile +do-install-rb: +do-install-rb-default: +pre-install-rb-default: + @$(NULLCMD) +$(TIMESTAMP_DIR)/.sitearchdir.time: + $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR) + $(Q) $(TOUCH) $@ + +site-install: site-install-so site-install-rb +site-install-so: install-so +site-install-rb: install-rb + +.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S + +.cc.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.cc.S: + $(ECHO) translating $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +.mm.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.mm.S: + $(ECHO) translating $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +.cxx.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.cxx.S: + $(ECHO) translating $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +.cpp.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.cpp.S: + $(ECHO) translating $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +.c.o: + $(ECHO) compiling $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.c.S: + $(ECHO) translating $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +.m.o: + $(ECHO) compiling $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$< + +.m.S: + $(ECHO) translating $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$< + +$(TARGET_SO): $(OBJS) Makefile + $(ECHO) linking shared-object $(DLLIB) + -$(Q)$(RM) $(@) + $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS) + + + +$(OBJS): $(HDRS) $(ruby_headers) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.c new file mode 100644 index 0000000..d1a4189 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.c @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2010, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include "rbffi.h" + +#include "Type.h" +#include "MappedType.h" + + +static VALUE mapped_allocate(VALUE); +static VALUE mapped_initialize(VALUE, VALUE); +static void mapped_mark(MappedType *); +static ID id_native_type, id_to_native, id_from_native; + +VALUE rbffi_MappedTypeClass = Qnil; + +static VALUE +mapped_allocate(VALUE klass) +{ + MappedType* m; + + VALUE obj = Data_Make_Struct(klass, MappedType, mapped_mark, -1, m); + + m->rbConverter = Qnil; + m->rbType = Qnil; + m->type = NULL; + m->base.nativeType = NATIVE_MAPPED; + m->base.ffiType = &ffi_type_void; + + return obj; +} + +/* + * call-seq: initialize(converter) + * @param [#native_type, #to_native, #from_native] converter +converter+ must respond to + * all these methods + * @return [self] + */ +static VALUE +mapped_initialize(VALUE self, VALUE rbConverter) +{ + MappedType* m = NULL; + + if (!rb_respond_to(rbConverter, id_native_type)) { + rb_raise(rb_eNoMethodError, "native_type method not implemented"); + } + + if (!rb_respond_to(rbConverter, id_to_native)) { + rb_raise(rb_eNoMethodError, "to_native method not implemented"); + } + + if (!rb_respond_to(rbConverter, id_from_native)) { + rb_raise(rb_eNoMethodError, "from_native method not implemented"); + } + + Data_Get_Struct(self, MappedType, m); + m->rbType = rb_funcall2(rbConverter, id_native_type, 0, NULL); + if (!(rb_obj_is_kind_of(m->rbType, rbffi_TypeClass))) { + rb_raise(rb_eTypeError, "native_type did not return instance of FFI::Type"); + } + + m->rbConverter = rbConverter; + Data_Get_Struct(m->rbType, Type, m->type); + m->base.ffiType = m->type->ffiType; + + return self; +} + +static void +mapped_mark(MappedType* m) +{ + rb_gc_mark(m->rbType); + rb_gc_mark(m->rbConverter); +} + +/* + * call-seq: mapped_type.native_type + * @return [Type] + * Get native type of mapped type. + */ +static VALUE +mapped_native_type(VALUE self) +{ + MappedType*m = NULL; + Data_Get_Struct(self, MappedType, m); + + return m->rbType; +} + +/* + * call-seq: mapped_type.to_native(*args) + * @param args depends on {FFI::DataConverter} used to initialize +self+ + */ +static VALUE +mapped_to_native(int argc, VALUE* argv, VALUE self) +{ + MappedType*m = NULL; + + Data_Get_Struct(self, MappedType, m); + + return rb_funcall2(m->rbConverter, id_to_native, argc, argv); +} + +/* + * call-seq: mapped_type.from_native(*args) + * @param args depends on {FFI::DataConverter} used to initialize +self+ + */ +static VALUE +mapped_from_native(int argc, VALUE* argv, VALUE self) +{ + MappedType*m = NULL; + + Data_Get_Struct(self, MappedType, m); + + return rb_funcall2(m->rbConverter, id_from_native, argc, argv); +} + +void +rbffi_MappedType_Init(VALUE moduleFFI) +{ + /* + * Document-class: FFI::Type::Mapped < FFI::Type + */ + rbffi_MappedTypeClass = rb_define_class_under(rbffi_TypeClass, "Mapped", rbffi_TypeClass); + + rb_global_variable(&rbffi_MappedTypeClass); + + id_native_type = rb_intern("native_type"); + id_to_native = rb_intern("to_native"); + id_from_native = rb_intern("from_native"); + + rb_define_alloc_func(rbffi_MappedTypeClass, mapped_allocate); + rb_define_method(rbffi_MappedTypeClass, "initialize", mapped_initialize, 1); + rb_define_method(rbffi_MappedTypeClass, "type", mapped_native_type, 0); + rb_define_method(rbffi_MappedTypeClass, "native_type", mapped_native_type, 0); + rb_define_method(rbffi_MappedTypeClass, "to_native", mapped_to_native, -1); + rb_define_method(rbffi_MappedTypeClass, "from_native", mapped_from_native, -1); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.h new file mode 100644 index 0000000..4b26cc1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_MAPPEDTYPE_H +#define RBFFI_MAPPEDTYPE_H + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct MappedType_ { + Type base; + Type* type; + VALUE rbConverter; + VALUE rbType; + +} MappedType; + +void rbffi_MappedType_Init(VALUE moduleFFI); + +extern VALUE rbffi_MappedTypeClass; + + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_MAPPEDTYPE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.o new file mode 100644 index 0000000..9253a21 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MappedType.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.c new file mode 100644 index 0000000..1a64f2e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.c @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (C) 2009 Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "rbffi.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "MemoryPointer.h" + + +static VALUE memptr_allocate(VALUE klass); +static void memptr_release(Pointer* ptr); +static VALUE memptr_malloc(VALUE self, long size, long count, bool clear); +static VALUE memptr_free(VALUE self); + +VALUE rbffi_MemoryPointerClass; + +#define MEMPTR(obj) ((MemoryPointer *) rbffi_AbstractMemory_Cast(obj, rbffi_MemoryPointerClass)) + +VALUE +rbffi_MemoryPointer_NewInstance(long size, long count, bool clear) +{ + return memptr_malloc(memptr_allocate(rbffi_MemoryPointerClass), size, count, clear); +} + +static VALUE +memptr_allocate(VALUE klass) +{ + Pointer* p; + VALUE obj = Data_Make_Struct(klass, Pointer, NULL, memptr_release, p); + p->rbParent = Qnil; + p->memory.flags = MEM_RD | MEM_WR; + + return obj; +} + +/* + * call-seq: initialize(size, count=1, clear=true) + * @param [Fixnum, Bignum, Symbol, FFI::Type] size size of a memory cell (in bytes, or type whom size will be used) + * @param [Numeric] count number of cells in memory + * @param [Boolean] clear set memory to all-zero if +true+ + * @return [self] + * A new instance of FFI::MemoryPointer. + */ +static VALUE +memptr_initialize(int argc, VALUE* argv, VALUE self) +{ + VALUE size = Qnil, count = Qnil, clear = Qnil; + int nargs = rb_scan_args(argc, argv, "12", &size, &count, &clear); + + memptr_malloc(self, rbffi_type_size(size), nargs > 1 ? NUM2LONG(count) : 1, + RTEST(clear) || clear == Qnil); + + if (rb_block_given_p()) { + return rb_ensure(rb_yield, self, memptr_free, self); + } + + return self; +} + +static VALUE +memptr_malloc(VALUE self, long size, long count, bool clear) +{ + Pointer* p; + unsigned long msize; + + Data_Get_Struct(self, Pointer, p); + + msize = size * count; + + p->storage = xmalloc(msize + 7); + if (p->storage == NULL) { + rb_raise(rb_eNoMemError, "Failed to allocate memory size=%ld bytes", msize); + return Qnil; + } + p->autorelease = true; + p->memory.typeSize = (int) size; + p->memory.size = msize; + /* ensure the memory is aligned on at least a 8 byte boundary */ + p->memory.address = (char *) (((uintptr_t) p->storage + 0x7) & (uintptr_t) ~0x7ULL); + p->allocated = true; + + if (clear && p->memory.size > 0) { + memset(p->memory.address, 0, p->memory.size); + } + + return self; +} + +static VALUE +memptr_free(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + if (ptr->allocated) { + if (ptr->storage != NULL) { + xfree(ptr->storage); + ptr->storage = NULL; + } + ptr->allocated = false; + } + + return self; +} + +static void +memptr_release(Pointer* ptr) +{ + if (ptr->autorelease && ptr->allocated && ptr->storage != NULL) { + xfree(ptr->storage); + ptr->storage = NULL; + } + xfree(ptr); +} + +/* + * call-seq: from_string(s) + * @param [String] s string + * @return [MemoryPointer] + * Create a {MemoryPointer} with +s+ inside. + */ +static VALUE +memptr_s_from_string(VALUE klass, VALUE to_str) +{ + VALUE s = StringValue(to_str); + VALUE args[] = { INT2FIX(1), LONG2NUM(RSTRING_LEN(s) + 1), Qfalse }; + VALUE obj = rb_class_new_instance(3, args, klass); + rb_funcall(obj, rb_intern("put_string"), 2, INT2FIX(0), s); + + return obj; +} + +void +rbffi_MemoryPointer_Init(VALUE moduleFFI) +{ + VALUE ffi_Pointer; + + ffi_Pointer = rbffi_PointerClass; + + /* + * Document-class: FFI::MemoryPointer < FFI::Pointer + * A MemoryPointer is a specific {Pointer}. It points to a memory composed of cells. All cells have the + * same size. + * + * @example Create a new MemoryPointer + * mp = FFI::MemoryPointer.new(:long, 16) # Create a pointer on a memory of 16 long ints. + * @example Create a new MemoryPointer from a String + * mp1 = FFI::MemoryPointer.from_string("this is a string") + * # same as: + * mp2 = FFI::MemoryPointer.new(:char,16) + * mp2.put_string("this is a string") + */ + rbffi_MemoryPointerClass = rb_define_class_under(moduleFFI, "MemoryPointer", ffi_Pointer); + rb_global_variable(&rbffi_MemoryPointerClass); + + rb_define_alloc_func(rbffi_MemoryPointerClass, memptr_allocate); + rb_define_method(rbffi_MemoryPointerClass, "initialize", memptr_initialize, -1); + rb_define_singleton_method(rbffi_MemoryPointerClass, "from_string", memptr_s_from_string, 1); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.h new file mode 100644 index 0000000..8106030 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (c) 2008, Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_MEMORYPOINTER_H +#define RBFFI_MEMORYPOINTER_H + +# include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + extern void rbffi_MemoryPointer_Init(VALUE moduleFFI); + extern VALUE rbffi_MemoryPointerClass; + extern VALUE rbffi_MemoryPointer_NewInstance(long size, long count, bool clear); +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_MEMORYPOINTER_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.o new file mode 100644 index 0000000..ec4e880 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MemoryPointer.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.c new file mode 100644 index 0000000..d047e10 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.c @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2009, 2010 Wayne Meissner + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include +#ifndef _WIN32 +# include +#endif +#include +#include +#include +#ifndef _WIN32 +# include +#endif +#include +#include +#if defined(HAVE_NATIVETHREAD) && !defined(_WIN32) && !defined(__WIN32__) +# include +#endif + +#include +#include "rbffi.h" +#include "compat.h" + +#include "Function.h" +#include "Types.h" +#include "Type.h" +#include "LastError.h" +#include "Call.h" +#include "ClosurePool.h" +#include "MethodHandle.h" + + +#define MAX_METHOD_FIXED_ARITY (6) + +#ifndef roundup +# define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#endif + +#ifdef USE_RAW +# define METHOD_CLOSURE ffi_raw_closure +# define METHOD_PARAMS ffi_raw* +#else +# define METHOD_CLOSURE ffi_closure +# define METHOD_PARAMS void** +#endif + + + +static bool prep_trampoline(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize); +static long trampoline_size(void); + +#if defined(__x86_64__) && (defined(__linux__) || defined(__APPLE__)) +# define CUSTOM_TRAMPOLINE 1 +#endif + + +struct MethodHandle { + Closure* closure; +}; + +static ClosurePool* defaultClosurePool; + + +MethodHandle* +rbffi_MethodHandle_Alloc(FunctionType* fnInfo, void* function) +{ + MethodHandle* handle; + Closure* closure = rbffi_Closure_Alloc(defaultClosurePool); + if (closure == NULL) { + rb_raise(rb_eNoMemError, "failed to allocate closure from pool"); + return NULL; + } + + handle = xcalloc(1, sizeof(*handle)); + handle->closure = closure; + closure->info = fnInfo; + closure->function = function; + + return handle; +} + +void +rbffi_MethodHandle_Free(MethodHandle* handle) +{ + if (handle != NULL) { + rbffi_Closure_Free(handle->closure); + xfree(handle); + } +} + +rbffi_function_anyargs rbffi_MethodHandle_CodeAddress(MethodHandle* handle) +{ + return (rbffi_function_anyargs) handle->closure->code; +} + +#ifndef CUSTOM_TRAMPOLINE +static void attached_method_invoke(ffi_cif* cif, void* retval, METHOD_PARAMS parameters, void* user_data); + +static ffi_type* methodHandleParamTypes[3]; + +static ffi_cif mh_cif; + +static bool +prep_trampoline(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize) +{ + ffi_status ffiStatus; + +#if defined(USE_RAW) + ffiStatus = ffi_prep_raw_closure(code, &mh_cif, attached_method_invoke, closure); +#else + ffiStatus = ffi_prep_closure_loc(closure->pcl, &mh_cif, attached_method_invoke, closure, code); +#endif + if (ffiStatus != FFI_OK) { + snprintf(errmsg, errmsgsize, "ffi_prep_closure_loc failed. status=%#x", ffiStatus); + return false; + } + + return true; +} + + +static long +trampoline_size(void) +{ + return sizeof(METHOD_CLOSURE); +} + +/* + * attached_method_invoke is used functions with more than 6 parameters, or + * with struct param or return values + */ +static void +attached_method_invoke(ffi_cif* cif, void* mretval, METHOD_PARAMS parameters, void* user_data) +{ + Closure* handle = (Closure *) user_data; + FunctionType* fnInfo = (FunctionType *) handle->info; + +#ifdef USE_RAW + int argc = parameters[0].sint; + VALUE* argv = *(VALUE **) ¶meters[1]; +#else + int argc = *(int *) parameters[0]; + VALUE* argv = *(VALUE **) parameters[1]; +#endif + + *(VALUE *) mretval = (*fnInfo->invoke)(argc, argv, handle->function, fnInfo); +} + +#endif + + + +#if defined(CUSTOM_TRAMPOLINE) +#if defined(__x86_64__) + +static VALUE custom_trampoline(int argc, VALUE* argv, VALUE self, Closure*); + +#define TRAMPOLINE_CTX_MAGIC (0xfee1deadcafebabe) +#define TRAMPOLINE_FUN_MAGIC (0xfeedfacebeeff00d) + +/* + * This is a hand-coded trampoline to speedup entry from ruby to the FFI translation + * layer for x86_64 arches. + * + * Since a ruby function has exactly 3 arguments, and the first 6 arguments are + * passed in registers for x86_64, we can tack on a context pointer by simply + * putting a value in %rcx, then jumping to the C trampoline code. + * + * This results in approx a 30% speedup for x86_64 FFI dispatch + */ +__asm__( + ".text\n\t" + ".globl ffi_trampoline\n\t" + ".globl _ffi_trampoline\n\t" + "ffi_trampoline:\n\t" + "_ffi_trampoline:\n\t" + "movabsq $0xfee1deadcafebabe, %rcx\n\t" + "movabsq $0xfeedfacebeeff00d, %r11\n\t" + "jmpq *%r11\n\t" + ".globl ffi_trampoline_end\n\t" + "ffi_trampoline_end:\n\t" + ".globl _ffi_trampoline_end\n\t" + "_ffi_trampoline_end:\n\t" +); + +static VALUE +custom_trampoline(int argc, VALUE* argv, VALUE self, Closure* handle) +{ + FunctionType* fnInfo = (FunctionType *) handle->info; + VALUE rbReturnValue; + + RB_GC_GUARD(rbReturnValue) = (*fnInfo->invoke)(argc, argv, handle->function, fnInfo); + RB_GC_GUARD(self); + + return rbReturnValue; +} + +#elif defined(__i386__) && 0 + +static VALUE custom_trampoline(void *args, Closure*); +#define TRAMPOLINE_CTX_MAGIC (0xfee1dead) +#define TRAMPOLINE_FUN_MAGIC (0xbeefcafe) + +/* + * This is a hand-coded trampoline to speed-up entry from ruby to the FFI translation + * layer for i386 arches. + * + * This does not make a discernible difference vs a raw closure, so for now, + * it is not enabled. + */ +__asm__( + ".text\n\t" + ".globl ffi_trampoline\n\t" + ".globl _ffi_trampoline\n\t" + "ffi_trampoline:\n\t" + "_ffi_trampoline:\n\t" + "subl $12, %esp\n\t" + "leal 16(%esp), %eax\n\t" + "movl %eax, (%esp)\n\t" + "movl $0xfee1dead, 4(%esp)\n\t" + "movl $0xbeefcafe, %eax\n\t" + "call *%eax\n\t" + "addl $12, %esp\n\t" + "ret\n\t" + ".globl ffi_trampoline_end\n\t" + "ffi_trampoline_end:\n\t" + ".globl _ffi_trampoline_end\n\t" + "_ffi_trampoline_end:\n\t" +); + +static VALUE +custom_trampoline(void *args, Closure* handle) +{ + FunctionType* fnInfo = (FunctionType *) handle->info; + return (*fnInfo->invoke)(*(int *) args, *(VALUE **) (args + 4), handle->function, fnInfo); +} + +#endif /* __x86_64__ else __i386__ */ + +extern void ffi_trampoline(int argc, VALUE* argv, VALUE self); +extern void ffi_trampoline_end(void); +static int trampoline_offsets(long *, long *); + +static long trampoline_ctx_offset, trampoline_func_offset; + +static long +trampoline_offset(int off, const long value) +{ + char *ptr; + for (ptr = (char *) &ffi_trampoline + off; ptr < (char *) &ffi_trampoline_end; ++ptr) { + if (*(long *) ptr == value) { + return ptr - (char *) &ffi_trampoline; + } + } + + return -1; +} + +static int +trampoline_offsets(long* ctxOffset, long* fnOffset) +{ + *ctxOffset = trampoline_offset(0, TRAMPOLINE_CTX_MAGIC); + if (*ctxOffset == -1) { + return -1; + } + + *fnOffset = trampoline_offset(0, TRAMPOLINE_FUN_MAGIC); + if (*fnOffset == -1) { + return -1; + } + + return 0; +} + +static bool +prep_trampoline(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize) +{ + memcpy(code, (void*) &ffi_trampoline, trampoline_size()); + /* Patch the context and function addresses into the stub code */ + *(intptr_t *)((char*)code + trampoline_ctx_offset) = (intptr_t) closure; + *(intptr_t *)((char*)code + trampoline_func_offset) = (intptr_t) custom_trampoline; + + return true; +} + +static long +trampoline_size(void) +{ + return (char *) &ffi_trampoline_end - (char *) &ffi_trampoline; +} + +#endif /* CUSTOM_TRAMPOLINE */ + + +void +rbffi_MethodHandle_Init(VALUE module) +{ +#ifndef CUSTOM_TRAMPOLINE + ffi_status ffiStatus; +#endif + + defaultClosurePool = rbffi_ClosurePool_New((int) trampoline_size(), prep_trampoline, NULL); + +#if defined(CUSTOM_TRAMPOLINE) + if (trampoline_offsets(&trampoline_ctx_offset, &trampoline_func_offset) != 0) { + rb_raise(rb_eFatal, "Could not locate offsets in trampoline code"); + } +#else + methodHandleParamTypes[0] = &ffi_type_sint; + methodHandleParamTypes[1] = &ffi_type_pointer; + methodHandleParamTypes[2] = &ffi_type_ulong; + + ffiStatus = ffi_prep_cif(&mh_cif, FFI_DEFAULT_ABI, 3, &ffi_type_ulong, + methodHandleParamTypes); + if (ffiStatus != FFI_OK) { + rb_raise(rb_eFatal, "ffi_prep_cif failed. status=%#x", ffiStatus); + } + +#endif +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.h new file mode 100644 index 0000000..0dcc058 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_METHODHANDLE_H +#define RBFFI_METHODHANDLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "Function.h" + + +typedef struct MethodHandlePool MethodHandlePool; +typedef struct MethodHandle MethodHandle; +typedef VALUE (*rbffi_function_anyargs)(int argc, VALUE* argv, VALUE self); + + +MethodHandle* rbffi_MethodHandle_Alloc(FunctionType* fnInfo, void* function); +void rbffi_MethodHandle_Free(MethodHandle* handle); +rbffi_function_anyargs rbffi_MethodHandle_CodeAddress(MethodHandle* handle); +void rbffi_MethodHandle_Init(VALUE module); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_METHODHANDLE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.o new file mode 100644 index 0000000..62c27de Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/MethodHandle.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.c new file mode 100644 index 0000000..57f3219 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +# include +#endif +# include +#include +#include +#include +#include +#include "rbffi_endian.h" +#include "Platform.h" + +#if defined(__GNU__) || (defined(__GLIBC__) && !defined(__UCLIBC__)) +# include +#endif + +static VALUE PlatformModule = Qnil; + +static void +export_primitive_types(VALUE module) +{ +#define S(name, T) do { \ + typedef struct { char c; T v; } s; \ + rb_define_const(module, #name "_ALIGN", INT2NUM((sizeof(s) - sizeof(T)) * 8)); \ + rb_define_const(module, #name "_SIZE", INT2NUM(sizeof(T)* 8)); \ +} while(0) + S(INT8, char); + S(INT16, short); + S(INT32, int); + S(INT64, long long); + S(LONG, long); + S(FLOAT, float); + S(DOUBLE, double); + S(LONG_DOUBLE, long double); + S(ADDRESS, void*); +#undef S +} + +void +rbffi_Platform_Init(VALUE moduleFFI) +{ + PlatformModule = rb_define_module_under(moduleFFI, "Platform"); + rb_define_const(PlatformModule, "BYTE_ORDER", INT2FIX(BYTE_ORDER)); + rb_define_const(PlatformModule, "LITTLE_ENDIAN", INT2FIX(LITTLE_ENDIAN)); + rb_define_const(PlatformModule, "BIG_ENDIAN", INT2FIX(BIG_ENDIAN)); +#if defined(__GNU__) || (defined(__GLIBC__) && !defined(__UCLIBC__)) + rb_define_const(PlatformModule, "GNU_LIBC", rb_str_new2(LIBC_SO)); +#endif + export_primitive_types(PlatformModule); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.h new file mode 100644 index 0000000..5575e34 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_PLATFORM_H +#define RBFFI_PLATFORM_H + +#ifdef __cplusplus +extern "C" { +#endif + + extern void rbffi_Platform_Init(VALUE moduleFFI); + + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_PLATFORM_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.o new file mode 100644 index 0000000..988a5e5 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Platform.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.c new file mode 100644 index 0000000..153fff1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.c @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include "rbffi.h" +#include "rbffi_endian.h" +#include "AbstractMemory.h" +#include "Pointer.h" + +#define POINTER(obj) rbffi_AbstractMemory_Cast((obj), rbffi_PointerClass) + +VALUE rbffi_PointerClass = Qnil; +VALUE rbffi_NullPointerSingleton = Qnil; + +static void ptr_release(Pointer* ptr); +static void ptr_mark(Pointer* ptr); + +VALUE +rbffi_Pointer_NewInstance(void* addr) +{ + Pointer* p; + VALUE obj; + + if (addr == NULL) { + return rbffi_NullPointerSingleton; + } + + obj = Data_Make_Struct(rbffi_PointerClass, Pointer, NULL, -1, p); + p->memory.address = addr; + p->memory.size = LONG_MAX; + p->memory.flags = (addr == NULL) ? 0 : (MEM_RD | MEM_WR); + p->memory.typeSize = 1; + p->rbParent = Qnil; + + return obj; +} + +static VALUE +ptr_allocate(VALUE klass) +{ + Pointer* p; + VALUE obj; + + obj = Data_Make_Struct(klass, Pointer, ptr_mark, ptr_release, p); + p->rbParent = Qnil; + p->memory.flags = MEM_RD | MEM_WR; + + return obj; +} + +/* + * @overload initialize(pointer) + * @param [Pointer] pointer another pointer to initialize from + * Create a new pointer from another {Pointer}. + * @overload initialize(type, address) + * @param [Type] type type for pointer + * @param [Integer] address base address for pointer + * Create a new pointer from a {Type} and a base address + * @return [self] + * A new instance of Pointer. + */ +static VALUE +ptr_initialize(int argc, VALUE* argv, VALUE self) +{ + Pointer* p; + VALUE rbType = Qnil, rbAddress = Qnil; + int typeSize = 1; + + Data_Get_Struct(self, Pointer, p); + + switch (rb_scan_args(argc, argv, "11", &rbType, &rbAddress)) { + case 1: + rbAddress = rbType; + typeSize = 1; + break; + case 2: + typeSize = rbffi_type_size(rbType); + break; + default: + rb_raise(rb_eArgError, "Invalid arguments"); + } + + switch (TYPE(rbAddress)) { + case T_FIXNUM: + case T_BIGNUM: + p->memory.address = (void*) (uintptr_t) NUM2LL(rbAddress); + p->memory.size = LONG_MAX; + if (p->memory.address == NULL) { + p->memory.flags = 0; + } + break; + + default: + if (rb_obj_is_kind_of(rbAddress, rbffi_PointerClass)) { + Pointer* orig; + + p->rbParent = rbAddress; + Data_Get_Struct(rbAddress, Pointer, orig); + p->memory = orig->memory; + } else { + rb_raise(rb_eTypeError, "wrong argument type, expected Integer or FFI::Pointer"); + } + break; + } + + p->memory.typeSize = typeSize; + + return self; +} + +/* + * call-seq: ptr.initialize_copy(other) + * @param [Pointer] other source for cloning or dupping + * @return [self] + * @raise {RuntimeError} if +other+ is an unbounded memory area, or is unreadable/unwritable + * @raise {NoMemError} if failed to allocate memory for new object + * DO NOT CALL THIS METHOD. + * + * This method is internally used by #dup and #clone. Memory content is copied from +other+. + */ +static VALUE +ptr_initialize_copy(VALUE self, VALUE other) +{ + AbstractMemory* src; + Pointer* dst; + + Data_Get_Struct(self, Pointer, dst); + src = POINTER(other); + if (src->size == LONG_MAX) { + rb_raise(rb_eRuntimeError, "cannot duplicate unbounded memory area"); + return Qnil; + } + + if ((dst->memory.flags & (MEM_RD | MEM_WR)) != (MEM_RD | MEM_WR)) { + rb_raise(rb_eRuntimeError, "cannot duplicate unreadable/unwritable memory area"); + return Qnil; + } + + if (dst->storage != NULL) { + xfree(dst->storage); + dst->storage = NULL; + } + + dst->storage = xmalloc(src->size + 7); + if (dst->storage == NULL) { + rb_raise(rb_eNoMemError, "failed to allocate memory size=%lu bytes", src->size); + return Qnil; + } + + dst->allocated = true; + dst->autorelease = true; + dst->memory.address = (void *) (((uintptr_t) dst->storage + 0x7) & (uintptr_t) ~0x7ULL); + dst->memory.size = src->size; + dst->memory.typeSize = src->typeSize; + + /* finally, copy the actual memory contents */ + memcpy(dst->memory.address, src->address, src->size); + + return self; +} + +static VALUE +slice(VALUE self, long offset, long size) +{ + AbstractMemory* ptr; + Pointer* p; + VALUE retval; + + Data_Get_Struct(self, AbstractMemory, ptr); + checkBounds(ptr, offset, size == LONG_MAX ? 1 : size); + + retval = Data_Make_Struct(rbffi_PointerClass, Pointer, ptr_mark, -1, p); + + p->memory.address = ptr->address + offset; + p->memory.size = size; + p->memory.flags = ptr->flags; + p->memory.typeSize = ptr->typeSize; + p->rbParent = self; + + return retval; +} + +/* + * Document-method: + + * call-seq: ptr + offset + * @param [Numeric] offset + * @return [Pointer] + * Return a new {Pointer} from an existing pointer and an +offset+. + */ +static VALUE +ptr_plus(VALUE self, VALUE offset) +{ + AbstractMemory* ptr; + long off = NUM2LONG(offset); + + Data_Get_Struct(self, AbstractMemory, ptr); + + return slice(self, off, ptr->size == LONG_MAX ? LONG_MAX : ptr->size - off); +} + +/* + * call-seq: ptr.slice(offset, length) + * @param [Numeric] offset + * @param [Numeric] length + * @return [Pointer] + * Return a new {Pointer} from an existing one. This pointer points on same contents + * from +offset+ for a length +length+. + */ +static VALUE +ptr_slice(VALUE self, VALUE rbOffset, VALUE rbLength) +{ + return slice(self, NUM2LONG(rbOffset), NUM2LONG(rbLength)); +} + +/* + * call-seq: ptr.inspect + * @return [String] + * Inspect pointer object. + */ +static VALUE +ptr_inspect(VALUE self) +{ + char buf[100]; + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + if (ptr->memory.size != LONG_MAX) { + snprintf(buf, sizeof(buf), "#<%s address=%p size=%lu>", + rb_obj_classname(self), ptr->memory.address, ptr->memory.size); + } else { + snprintf(buf, sizeof(buf), "#<%s address=%p>", rb_obj_classname(self), ptr->memory.address); + } + + return rb_str_new2(buf); +} + +/* + * Document-method: null? + * call-seq: ptr.null? + * @return [Boolean] + * Return +true+ if +self+ is a {NULL} pointer. + */ +static VALUE +ptr_null_p(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + return ptr->memory.address == NULL ? Qtrue : Qfalse; +} + +/* + * Document-method: == + * call-seq: ptr == other + * @param [Pointer] other + * Check equality between +self+ and +other+. Equality is tested on {#address}. + */ +static VALUE +ptr_equals(VALUE self, VALUE other) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + if (NIL_P(other)) { + return ptr->memory.address == NULL ? Qtrue : Qfalse; + } + + return ptr->memory.address == POINTER(other)->address ? Qtrue : Qfalse; +} + +/* + * call-seq: ptr.address + * @return [Numeric] pointer's base address + * Return +self+'s base address (alias: #to_i). + */ +static VALUE +ptr_address(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + return ULL2NUM((uintptr_t) ptr->memory.address); +} + +#if BYTE_ORDER == LITTLE_ENDIAN +# define SWAPPED_ORDER BIG_ENDIAN +#else +# define SWAPPED_ORDER LITTLE_ENDIAN +#endif + +/* + * Get or set +self+'s endianness + * @overload order + * @return [:big, :little] endianness of +self+ + * @overload order(order) + * @param [Symbol] order endianness to set (+:little+, +:big+ or +:network+). +:big+ and +:network+ + * are synonymous. + * @return a new pointer with the new order + */ +static VALUE +ptr_order(int argc, VALUE* argv, VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + if (argc == 0) { + int order = (ptr->memory.flags & MEM_SWAP) == 0 ? BYTE_ORDER : SWAPPED_ORDER; + return order == BIG_ENDIAN ? ID2SYM(rb_intern("big")) : ID2SYM(rb_intern("little")); + } else { + VALUE rbOrder = Qnil; + int order = BYTE_ORDER; + + if (rb_scan_args(argc, argv, "1", &rbOrder) < 1) { + rb_raise(rb_eArgError, "need byte order"); + } + if (SYMBOL_P(rbOrder)) { + ID id = SYM2ID(rbOrder); + if (id == rb_intern("little")) { + order = LITTLE_ENDIAN; + + } else if (id == rb_intern("big") || id == rb_intern("network")) { + order = BIG_ENDIAN; + } else { + rb_raise(rb_eArgError, "unknown byte order"); + } + } + if (order != BYTE_ORDER) { + Pointer* p2; + VALUE retval = slice(self, 0, ptr->memory.size); + + Data_Get_Struct(retval, Pointer, p2); + p2->memory.flags |= MEM_SWAP; + return retval; + } + + return self; + } +} + + +/* + * call-seq: ptr.free + * @return [self] + * Free memory pointed by +self+. + */ +static VALUE +ptr_free(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + if (ptr->allocated) { + if (ptr->storage != NULL) { + xfree(ptr->storage); + ptr->storage = NULL; + } + ptr->allocated = false; + + } else { + VALUE caller = rb_funcall(rb_funcall(Qnil, rb_intern("caller"), 0), rb_intern("first"), 0); + + rb_warn("calling free on non allocated pointer %s from %s", RSTRING_PTR(ptr_inspect(self)), RSTRING_PTR(rb_str_to_str(caller))); + } + + return self; +} + +static VALUE +ptr_type_size(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + return INT2NUM(ptr->memory.typeSize); +} + +/* + * call-seq: ptr.autorelease = autorelease + * @param [Boolean] autorelease + * @return [Boolean] +autorelease+ + * Set +autorelease+ attribute. See also Autorelease section. + */ +static VALUE +ptr_autorelease(VALUE self, VALUE autorelease) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + ptr->autorelease = autorelease == Qtrue; + + return autorelease; +} + +/* + * call-seq: ptr.autorelease? + * @return [Boolean] + * Get +autorelease+ attribute. See also Autorelease section. + */ +static VALUE +ptr_autorelease_p(VALUE self) +{ + Pointer* ptr; + + Data_Get_Struct(self, Pointer, ptr); + + return ptr->autorelease ? Qtrue : Qfalse; +} + + +static void +ptr_release(Pointer* ptr) +{ + if (ptr->autorelease && ptr->allocated && ptr->storage != NULL) { + xfree(ptr->storage); + ptr->storage = NULL; + } + xfree(ptr); +} + +static void +ptr_mark(Pointer* ptr) +{ + rb_gc_mark(ptr->rbParent); +} + +void +rbffi_Pointer_Init(VALUE moduleFFI) +{ + VALUE rbNullAddress = ULL2NUM(0); + VALUE ffi_AbstractMemory = rbffi_AbstractMemoryClass; + + /* + * Document-class: FFI::Pointer < FFI::AbstractMemory + * Pointer class is used to manage C pointers with ease. A {Pointer} object is defined by his + * {#address} (as a C pointer). It permits additions with an integer for pointer arithmetic. + * + * == Autorelease + * By default a pointer object frees its content when it's garbage collected. + * Therefore it's usually not necessary to call {#free} explicit. + * This behaviour may be changed with {#autorelease=} method. + * If it's set to +false+, the memory isn't freed by the garbage collector, but stays valid until +free()+ is called on C level or when the process terminates. + */ + rbffi_PointerClass = rb_define_class_under(moduleFFI, "Pointer", ffi_AbstractMemory); + /* + * Document-variable: Pointer + */ + rb_global_variable(&rbffi_PointerClass); + + rb_define_alloc_func(rbffi_PointerClass, ptr_allocate); + rb_define_method(rbffi_PointerClass, "initialize", ptr_initialize, -1); + rb_define_method(rbffi_PointerClass, "initialize_copy", ptr_initialize_copy, 1); + rb_define_method(rbffi_PointerClass, "inspect", ptr_inspect, 0); + rb_define_method(rbffi_PointerClass, "to_s", ptr_inspect, 0); + rb_define_method(rbffi_PointerClass, "+", ptr_plus, 1); + rb_define_method(rbffi_PointerClass, "slice", ptr_slice, 2); + rb_define_method(rbffi_PointerClass, "null?", ptr_null_p, 0); + rb_define_method(rbffi_PointerClass, "address", ptr_address, 0); + rb_define_alias(rbffi_PointerClass, "to_i", "address"); + rb_define_method(rbffi_PointerClass, "==", ptr_equals, 1); + rb_define_method(rbffi_PointerClass, "order", ptr_order, -1); + rb_define_method(rbffi_PointerClass, "autorelease=", ptr_autorelease, 1); + rb_define_method(rbffi_PointerClass, "autorelease?", ptr_autorelease_p, 0); + rb_define_method(rbffi_PointerClass, "free", ptr_free, 0); + rb_define_method(rbffi_PointerClass, "type_size", ptr_type_size, 0); + + rbffi_NullPointerSingleton = rb_class_new_instance(1, &rbNullAddress, rbffi_PointerClass); + /* + * NULL pointer + */ + rb_define_const(rbffi_PointerClass, "NULL", rbffi_NullPointerSingleton); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.h new file mode 100644 index 0000000..b3d6c85 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_POINTER_H +#define RBFFI_POINTER_H + +# include + +#ifdef __cplusplus +extern "C" { +#endif + +#include "AbstractMemory.h" + +extern void rbffi_Pointer_Init(VALUE moduleFFI); +extern VALUE rbffi_Pointer_NewInstance(void* addr); +extern VALUE rbffi_PointerClass; +extern VALUE rbffi_NullPointerSingleton; + +typedef struct Pointer { + AbstractMemory memory; + VALUE rbParent; + char* storage; /* start of malloc area */ + bool autorelease; + bool allocated; +} Pointer; + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_POINTER_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.o new file mode 100644 index 0000000..97388c7 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Pointer.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.c new file mode 100644 index 0000000..92731c8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.c @@ -0,0 +1,822 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (C) 2009 Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#ifndef _MSC_VER +# include +#endif +#include +#include +#include +#include "rbffi.h" +#include "compat.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "MemoryPointer.h" +#include "Function.h" +#include "Types.h" +#include "Function.h" +#include "StructByValue.h" +#include "ArrayType.h" +#include "MappedType.h" +#include "Struct.h" + +typedef struct InlineArray_ { + VALUE rbMemory; + VALUE rbField; + + AbstractMemory* memory; + StructField* field; + MemoryOp *op; + Type* componentType; + ArrayType* arrayType; + int length; +} InlineArray; + + +static void struct_mark(Struct *); +static void struct_free(Struct *); +static VALUE struct_class_layout(VALUE klass); +static void struct_malloc(Struct* s); +static void inline_array_mark(InlineArray *); +static void store_reference_value(StructField* f, Struct* s, VALUE value); + +VALUE rbffi_StructClass = Qnil; + +VALUE rbffi_StructInlineArrayClass = Qnil; +VALUE rbffi_StructLayoutCharArrayClass = Qnil; + +static ID id_pointer_ivar = 0, id_layout_ivar = 0; +static ID id_get = 0, id_put = 0, id_to_ptr = 0, id_to_s = 0, id_layout = 0; + +static inline char* +memory_address(VALUE self) +{ + return ((AbstractMemory *)DATA_PTR((self)))->address; +} + +static VALUE +struct_allocate(VALUE klass) +{ + Struct* s; + VALUE obj = Data_Make_Struct(klass, Struct, struct_mark, struct_free, s); + + s->rbPointer = Qnil; + s->rbLayout = Qnil; + + return obj; +} + +/* + * call-seq: initialize + * @overload initialize(pointer, *args) + * @param [AbstractMemory] pointer + * @param [Array] args + * @return [self] + */ +static VALUE +struct_initialize(int argc, VALUE* argv, VALUE self) +{ + Struct* s; + VALUE rbPointer = Qnil, rest = Qnil, klass = CLASS_OF(self); + int nargs; + + Data_Get_Struct(self, Struct, s); + + nargs = rb_scan_args(argc, argv, "01*", &rbPointer, &rest); + + /* Call up into ruby code to adjust the layout */ + if (nargs > 1) { + s->rbLayout = rb_funcall2(CLASS_OF(self), id_layout, (int) RARRAY_LEN(rest), RARRAY_PTR(rest)); + } else { + s->rbLayout = struct_class_layout(klass); + } + + if (!rb_obj_is_kind_of(s->rbLayout, rbffi_StructLayoutClass)) { + rb_raise(rb_eRuntimeError, "Invalid Struct layout"); + } + + Data_Get_Struct(s->rbLayout, StructLayout, s->layout); + + if (rbPointer != Qnil) { + s->pointer = MEMORY(rbPointer); + s->rbPointer = rbPointer; + } else { + struct_malloc(s); + } + + return self; +} + +/* + * call-seq: initialize_copy(other) + * @return [nil] + * DO NOT CALL THIS METHOD + */ +static VALUE +struct_initialize_copy(VALUE self, VALUE other) +{ + Struct* src; + Struct* dst; + + Data_Get_Struct(self, Struct, dst); + Data_Get_Struct(other, Struct, src); + if (dst == src) { + return self; + } + + dst->rbLayout = src->rbLayout; + dst->layout = src->layout; + + /* + * A new MemoryPointer instance is allocated here instead of just calling + * #dup on rbPointer, since the Pointer may not know its length, or may + * be longer than just this struct. + */ + if (src->pointer->address != NULL) { + dst->rbPointer = rbffi_MemoryPointer_NewInstance(1, src->layout->size, false); + dst->pointer = MEMORY(dst->rbPointer); + memcpy(dst->pointer->address, src->pointer->address, src->layout->size); + } else { + dst->rbPointer = src->rbPointer; + dst->pointer = src->pointer; + } + + if (src->layout->referenceFieldCount > 0) { + dst->rbReferences = ALLOC_N(VALUE, dst->layout->referenceFieldCount); + memcpy(dst->rbReferences, src->rbReferences, dst->layout->referenceFieldCount * sizeof(VALUE)); + } + + return self; +} + +static VALUE +struct_class_layout(VALUE klass) +{ + VALUE layout; + if (!rb_ivar_defined(klass, id_layout_ivar)) { + rb_raise(rb_eRuntimeError, "no Struct layout configured for %s", rb_class2name(klass)); + } + + layout = rb_ivar_get(klass, id_layout_ivar); + if (!rb_obj_is_kind_of(layout, rbffi_StructLayoutClass)) { + rb_raise(rb_eRuntimeError, "invalid Struct layout for %s", rb_class2name(klass)); + } + + return layout; +} + +static StructLayout* +struct_layout(VALUE self) +{ + Struct* s = (Struct *) DATA_PTR(self); + if (s->layout != NULL) { + return s->layout; + } + + if (s->layout == NULL) { + s->rbLayout = struct_class_layout(CLASS_OF(self)); + Data_Get_Struct(s->rbLayout, StructLayout, s->layout); + } + + return s->layout; +} + +static Struct* +struct_validate(VALUE self) +{ + Struct* s; + Data_Get_Struct(self, Struct, s); + + if (struct_layout(self) == NULL) { + rb_raise(rb_eRuntimeError, "struct layout == null"); + } + + if (s->pointer == NULL) { + struct_malloc(s); + } + + return s; +} + +static void +struct_malloc(Struct* s) +{ + if (s->rbPointer == Qnil) { + s->rbPointer = rbffi_MemoryPointer_NewInstance(s->layout->size, 1, true); + + } else if (!rb_obj_is_kind_of(s->rbPointer, rbffi_AbstractMemoryClass)) { + rb_raise(rb_eRuntimeError, "invalid pointer in struct"); + } + + s->pointer = (AbstractMemory *) DATA_PTR(s->rbPointer); +} + +static void +struct_mark(Struct *s) +{ + rb_gc_mark(s->rbPointer); + rb_gc_mark(s->rbLayout); + if (s->rbReferences != NULL) { + rb_gc_mark_locations(&s->rbReferences[0], &s->rbReferences[s->layout->referenceFieldCount]); + } +} + +static void +struct_free(Struct* s) +{ + xfree(s->rbReferences); + xfree(s); +} + + +static void +store_reference_value(StructField* f, Struct* s, VALUE value) +{ + if (unlikely(f->referenceIndex == -1)) { + rb_raise(rb_eRuntimeError, "put_reference_value called for non-reference type"); + return; + } + if (s->rbReferences == NULL) { + int i; + s->rbReferences = ALLOC_N(VALUE, s->layout->referenceFieldCount); + for (i = 0; i < s->layout->referenceFieldCount; ++i) { + s->rbReferences[i] = Qnil; + } + } + + s->rbReferences[f->referenceIndex] = value; +} + + +static StructField * +struct_field(Struct* s, VALUE fieldName) +{ + StructLayout* layout = s->layout; + struct field_cache_entry *p_ce = FIELD_CACHE_LOOKUP(layout, fieldName); + + /* Do a hash lookup only if cache entry is empty or fieldName is unexpected? */ + if (unlikely(!SYMBOL_P(fieldName) || !p_ce->fieldName || p_ce->fieldName != fieldName)) { + VALUE rbField = rb_hash_aref(layout->rbFieldMap, fieldName); + if (unlikely(NIL_P(rbField))) { + VALUE str = rb_funcall2(fieldName, id_to_s, 0, NULL); + rb_raise(rb_eArgError, "No such field '%s'", StringValueCStr(str)); + } + /* Write the retrieved coder to the cache */ + p_ce->fieldName = fieldName; + p_ce->field = (StructField *) DATA_PTR(rbField); + } + + return p_ce->field; +} + +/* + * call-seq: struct[field_name] + * @param field_name field to access + * Acces to a Struct field. + */ +static VALUE +struct_aref(VALUE self, VALUE fieldName) +{ + Struct* s; + StructField* f; + + s = struct_validate(self); + + f = struct_field(s, fieldName); + if (f->get != NULL) { + return (*f->get)(f, s); + + } else if (f->memoryOp != NULL) { + return (*f->memoryOp->get)(s->pointer, f->offset); + + } else { + VALUE rbField = rb_hash_aref(s->layout->rbFieldMap, fieldName); + /* call up to the ruby code to fetch the value */ + return rb_funcall2(rbField, id_get, 1, &s->rbPointer); + } +} + +/* + * call-seq: []=(field_name, value) + * @param field_name field to access + * @param value value to set to +field_name+ + * @return [value] + * Set a field in Struct. + */ +static VALUE +struct_aset(VALUE self, VALUE fieldName, VALUE value) +{ + Struct* s; + StructField* f; + + s = struct_validate(self); + + f = struct_field(s, fieldName); + if (f->put != NULL) { + (*f->put)(f, s, value); + + } else if (f->memoryOp != NULL) { + + (*f->memoryOp->put)(s->pointer, f->offset, value); + + } else { + VALUE rbField = rb_hash_aref(s->layout->rbFieldMap, fieldName); + /* call up to the ruby code to set the value */ + VALUE argv[2]; + argv[0] = s->rbPointer; + argv[1] = value; + rb_funcall2(rbField, id_put, 2, argv); + } + + if (f->referenceRequired) { + store_reference_value(f, s, value); + } + + return value; +} + +/* + * call-seq: pointer= pointer + * @param [AbstractMemory] pointer + * @return [self] + * Make Struct point to +pointer+. + */ +static VALUE +struct_set_pointer(VALUE self, VALUE pointer) +{ + Struct* s; + StructLayout* layout; + AbstractMemory* memory; + + if (!rb_obj_is_kind_of(pointer, rbffi_AbstractMemoryClass)) { + rb_raise(rb_eTypeError, "wrong argument type %s (expected Pointer or Buffer)", + rb_obj_classname(pointer)); + return Qnil; + } + + + Data_Get_Struct(self, Struct, s); + Data_Get_Struct(pointer, AbstractMemory, memory); + layout = struct_layout(self); + + if ((int) layout->base.ffiType->size > memory->size) { + rb_raise(rb_eArgError, "memory of %ld bytes too small for struct %s (expected at least %ld)", + memory->size, rb_obj_classname(self), (long) layout->base.ffiType->size); + } + + s->pointer = MEMORY(pointer); + s->rbPointer = pointer; + rb_ivar_set(self, id_pointer_ivar, pointer); + + return self; +} + +/* + * call-seq: pointer + * @return [AbstractMemory] + * Get pointer to Struct contents. + */ +static VALUE +struct_get_pointer(VALUE self) +{ + Struct* s; + + Data_Get_Struct(self, Struct, s); + + return s->rbPointer; +} + +/* + * call-seq: layout= layout + * @param [StructLayout] layout + * @return [self] + * Set the Struct's layout. + */ +static VALUE +struct_set_layout(VALUE self, VALUE layout) +{ + Struct* s; + Data_Get_Struct(self, Struct, s); + + if (!rb_obj_is_kind_of(layout, rbffi_StructLayoutClass)) { + rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", + rb_obj_classname(layout), rb_class2name(rbffi_StructLayoutClass)); + return Qnil; + } + + Data_Get_Struct(layout, StructLayout, s->layout); + rb_ivar_set(self, id_layout_ivar, layout); + + return self; +} + +/* + * call-seq: layout + * @return [StructLayout] + * Get the Struct's layout. + */ +static VALUE +struct_get_layout(VALUE self) +{ + Struct* s; + + Data_Get_Struct(self, Struct, s); + + return s->rbLayout; +} + +/* + * call-seq: null? + * @return [Boolean] + * Test if Struct's pointer is NULL + */ +static VALUE +struct_null_p(VALUE self) +{ + Struct* s; + + Data_Get_Struct(self, Struct, s); + + return s->pointer->address == NULL ? Qtrue : Qfalse; +} + +/* + * (see Pointer#order) + */ +static VALUE +struct_order(int argc, VALUE* argv, VALUE self) +{ + Struct* s; + + Data_Get_Struct(self, Struct, s); + if (argc == 0) { + return rb_funcall(s->rbPointer, rb_intern("order"), 0); + + } else { + VALUE retval = rb_obj_dup(self); + VALUE rbPointer = rb_funcall2(s->rbPointer, rb_intern("order"), argc, argv); + struct_set_pointer(retval, rbPointer); + + return retval; + } +} + +static VALUE +inline_array_allocate(VALUE klass) +{ + InlineArray* array; + VALUE obj; + + obj = Data_Make_Struct(klass, InlineArray, inline_array_mark, -1, array); + array->rbField = Qnil; + array->rbMemory = Qnil; + + return obj; +} + +static void +inline_array_mark(InlineArray* array) +{ + rb_gc_mark(array->rbField); + rb_gc_mark(array->rbMemory); +} + +/* + * Document-method: FFI::Struct::InlineArray#initialize + * call-seq: initialize(memory, field) + * @param [AbstractMemory] memory + * @param [StructField] field + * @return [self] + */ +static VALUE +inline_array_initialize(VALUE self, VALUE rbMemory, VALUE rbField) +{ + InlineArray* array; + + Data_Get_Struct(self, InlineArray, array); + array->rbMemory = rbMemory; + array->rbField = rbField; + + Data_Get_Struct(rbMemory, AbstractMemory, array->memory); + Data_Get_Struct(rbField, StructField, array->field); + Data_Get_Struct(array->field->rbType, ArrayType, array->arrayType); + Data_Get_Struct(array->arrayType->rbComponentType, Type, array->componentType); + + array->op = get_memory_op(array->componentType); + if (array->op == NULL && array->componentType->nativeType == NATIVE_MAPPED) { + array->op = get_memory_op(((MappedType *) array->componentType)->type); + } + + array->length = array->arrayType->length; + + return self; +} + +/* + * call-seq: size + * @return [Numeric] + * Get size + */ +static VALUE +inline_array_size(VALUE self) +{ + InlineArray* array; + + Data_Get_Struct(self, InlineArray, array); + + return UINT2NUM(((ArrayType *) array->field->type)->length); +} + +static int +inline_array_offset(InlineArray* array, int index) +{ + if (index < 0 || (index >= array->length && array->length > 0)) { + rb_raise(rb_eIndexError, "index %d out of bounds", index); + } + + return (int) array->field->offset + (index * (int) array->componentType->ffiType->size); +} + +/* + * call-seq: [](index) + * @param [Numeric] index + * @return [Type, Struct] + */ +static VALUE +inline_array_aref(VALUE self, VALUE rbIndex) +{ + InlineArray* array; + + Data_Get_Struct(self, InlineArray, array); + + if (array->op != NULL) { + VALUE rbNativeValue = array->op->get(array->memory, + inline_array_offset(array, NUM2INT(rbIndex))); + if (unlikely(array->componentType->nativeType == NATIVE_MAPPED)) { + return rb_funcall(((MappedType *) array->componentType)->rbConverter, + rb_intern("from_native"), 2, rbNativeValue, Qnil); + } else { + return rbNativeValue; + } + + } else if (array->componentType->nativeType == NATIVE_STRUCT) { + VALUE rbOffset = INT2NUM(inline_array_offset(array, NUM2INT(rbIndex))); + VALUE rbLength = INT2NUM(array->componentType->ffiType->size); + VALUE rbPointer = rb_funcall(array->rbMemory, rb_intern("slice"), 2, rbOffset, rbLength); + + return rb_class_new_instance(1, &rbPointer, ((StructByValue *) array->componentType)->rbStructClass); + } else { + + rb_raise(rb_eArgError, "get not supported for %s", rb_obj_classname(array->arrayType->rbComponentType)); + return Qnil; + } +} + +/* + * call-seq: []=(index, value) + * @param [Numeric] index + * @param [Type, Struct] + * @return [value] + */ +static VALUE +inline_array_aset(VALUE self, VALUE rbIndex, VALUE rbValue) +{ + InlineArray* array; + + Data_Get_Struct(self, InlineArray, array); + + if (array->op != NULL) { + if (unlikely(array->componentType->nativeType == NATIVE_MAPPED)) { + rbValue = rb_funcall(((MappedType *) array->componentType)->rbConverter, + rb_intern("to_native"), 2, rbValue, Qnil); + } + array->op->put(array->memory, inline_array_offset(array, NUM2INT(rbIndex)), + rbValue); + + } else if (array->componentType->nativeType == NATIVE_STRUCT) { + int offset = inline_array_offset(array, NUM2INT(rbIndex)); + Struct* s; + + if (!rb_obj_is_kind_of(rbValue, rbffi_StructClass)) { + rb_raise(rb_eTypeError, "argument not an instance of struct"); + return Qnil; + } + + checkWrite(array->memory); + checkBounds(array->memory, offset, array->componentType->ffiType->size); + + Data_Get_Struct(rbValue, Struct, s); + checkRead(s->pointer); + checkBounds(s->pointer, 0, array->componentType->ffiType->size); + + memcpy(array->memory->address + offset, s->pointer->address, array->componentType->ffiType->size); + + } else { + ArrayType* arrayType; + Data_Get_Struct(array->field->rbType, ArrayType, arrayType); + + rb_raise(rb_eArgError, "set not supported for %s", rb_obj_classname(arrayType->rbComponentType)); + return Qnil; + } + + return rbValue; +} + +/* + * call-seq: each + * Yield block for each element of +self+. + */ +static VALUE +inline_array_each(VALUE self) +{ + InlineArray* array; + + int i; + + Data_Get_Struct(self, InlineArray, array); + + for (i = 0; i < array->length; ++i) { + rb_yield(inline_array_aref(self, INT2FIX(i))); + } + + return self; +} + +/* + * call-seq: to_a + * @return [Array] + * Convert +self+ to an array. + */ +static VALUE +inline_array_to_a(VALUE self) +{ + InlineArray* array; + VALUE obj; + int i; + + Data_Get_Struct(self, InlineArray, array); + obj = rb_ary_new2(array->length); + + + for (i = 0; i < array->length; ++i) { + rb_ary_push(obj, inline_array_aref(self, INT2FIX(i))); + } + + return obj; +} + +/* + * Document-method: FFI::StructLayout::CharArray#to_s + * call-seq: to_s + * @return [String] + * Convert +self+ to a string. + */ +static VALUE +inline_array_to_s(VALUE self) +{ + InlineArray* array; + VALUE argv[2]; + + Data_Get_Struct(self, InlineArray, array); + + if (array->componentType->nativeType != NATIVE_INT8 && array->componentType->nativeType != NATIVE_UINT8) { + VALUE dummy = Qnil; + return rb_call_super(0, &dummy); + } + + argv[0] = UINT2NUM(array->field->offset); + argv[1] = UINT2NUM(array->length); + + return rb_funcall2(array->rbMemory, rb_intern("get_string"), 2, argv); +} + +/* + * call-seq: to_ptr + * @return [AbstractMemory] + * Get pointer to +self+ content. + */ +static VALUE +inline_array_to_ptr(VALUE self) +{ + InlineArray* array; + + Data_Get_Struct(self, InlineArray, array); + + return rb_funcall(array->rbMemory, rb_intern("slice"), 2, + UINT2NUM(array->field->offset), UINT2NUM(array->arrayType->base.ffiType->size)); +} + + +void +rbffi_Struct_Init(VALUE moduleFFI) +{ + VALUE StructClass; + + rbffi_StructLayout_Init(moduleFFI); + + /* + * Document-class: FFI::Struct + * + * A FFI::Struct means to mirror a C struct. + * + * A Struct is defined as: + * class MyStruct < FFI::Struct + * layout :value1, :int, + * :value2, :double + * end + * and is used as: + * my_struct = MyStruct.new + * my_struct[:value1] = 12 + * + * For more information, see http://github.com/ffi/ffi/wiki/Structs + */ + rbffi_StructClass = rb_define_class_under(moduleFFI, "Struct", rb_cObject); + StructClass = rbffi_StructClass; // put on a line alone to help RDoc + rb_global_variable(&rbffi_StructClass); + + /* + * Document-class: FFI::Struct::InlineArray + */ + rbffi_StructInlineArrayClass = rb_define_class_under(rbffi_StructClass, "InlineArray", rb_cObject); + rb_global_variable(&rbffi_StructInlineArrayClass); + + /* + * Document-class: FFI::StructLayout::CharArray < FFI::Struct::InlineArray + */ + rbffi_StructLayoutCharArrayClass = rb_define_class_under(rbffi_StructLayoutClass, "CharArray", + rbffi_StructInlineArrayClass); + rb_global_variable(&rbffi_StructLayoutCharArrayClass); + + + rb_define_alloc_func(StructClass, struct_allocate); + rb_define_method(StructClass, "initialize", struct_initialize, -1); + rb_define_method(StructClass, "initialize_copy", struct_initialize_copy, 1); + rb_define_method(StructClass, "order", struct_order, -1); + + rb_define_alias(rb_singleton_class(StructClass), "alloc_in", "new"); + rb_define_alias(rb_singleton_class(StructClass), "alloc_out", "new"); + rb_define_alias(rb_singleton_class(StructClass), "alloc_inout", "new"); + rb_define_alias(rb_singleton_class(StructClass), "new_in", "new"); + rb_define_alias(rb_singleton_class(StructClass), "new_out", "new"); + rb_define_alias(rb_singleton_class(StructClass), "new_inout", "new"); + + rb_define_method(StructClass, "pointer", struct_get_pointer, 0); + rb_define_private_method(StructClass, "pointer=", struct_set_pointer, 1); + + rb_define_method(StructClass, "layout", struct_get_layout, 0); + rb_define_private_method(StructClass, "layout=", struct_set_layout, 1); + + rb_define_method(StructClass, "[]", struct_aref, 1); + rb_define_method(StructClass, "[]=", struct_aset, 2); + rb_define_method(StructClass, "null?", struct_null_p, 0); + + rb_include_module(rbffi_StructInlineArrayClass, rb_mEnumerable); + rb_define_alloc_func(rbffi_StructInlineArrayClass, inline_array_allocate); + rb_define_method(rbffi_StructInlineArrayClass, "initialize", inline_array_initialize, 2); + rb_define_method(rbffi_StructInlineArrayClass, "[]", inline_array_aref, 1); + rb_define_method(rbffi_StructInlineArrayClass, "[]=", inline_array_aset, 2); + rb_define_method(rbffi_StructInlineArrayClass, "each", inline_array_each, 0); + rb_define_method(rbffi_StructInlineArrayClass, "size", inline_array_size, 0); + rb_define_method(rbffi_StructInlineArrayClass, "to_a", inline_array_to_a, 0); + rb_define_method(rbffi_StructInlineArrayClass, "to_ptr", inline_array_to_ptr, 0); + + rb_define_method(rbffi_StructLayoutCharArrayClass, "to_s", inline_array_to_s, 0); + rb_define_alias(rbffi_StructLayoutCharArrayClass, "to_str", "to_s"); + + id_pointer_ivar = rb_intern("@pointer"); + id_layout_ivar = rb_intern("@layout"); + id_layout = rb_intern("layout"); + id_get = rb_intern("get"); + id_put = rb_intern("put"); + id_to_ptr = rb_intern("to_ptr"); + id_to_s = rb_intern("to_s"); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.h new file mode 100644 index 0000000..eb6edf2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_STRUCT_H +#define RBFFI_STRUCT_H + +#include "extconf.h" +#include "AbstractMemory.h" +#include "Type.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + extern void rbffi_Struct_Init(VALUE ffiModule); + extern void rbffi_StructLayout_Init(VALUE ffiModule); + typedef struct StructField_ StructField; + typedef struct StructLayout_ StructLayout; + typedef struct Struct_ Struct; + + struct StructField_ { + Type* type; + unsigned int offset; + + int referenceIndex; + + bool referenceRequired; + VALUE rbType; + VALUE rbName; + + VALUE (*get)(StructField* field, Struct* s); + void (*put)(StructField* field, Struct* s, VALUE value); + + MemoryOp* memoryOp; + }; + + struct StructLayout_ { + Type base; + StructField** fields; + int fieldCount; + int size; + int align; + ffi_type** ffiTypes; + + /* + * We use the fieldName's minor 8 Bits as index to a 256 entry cache. + * This avoids full ruby hash lookups for repeated lookups. + */ + #define FIELD_CACHE_LOOKUP(this, sym) ( &(this)->cache_row[((sym) >> 8) & 0xff] ) + + struct field_cache_entry { + VALUE fieldName; + StructField *field; + } cache_row[0x100]; + + /** The number of reference tracking fields in this struct */ + int referenceFieldCount; + + VALUE rbFieldNames; + VALUE rbFieldMap; + VALUE rbFields; + }; + + struct Struct_ { + StructLayout* layout; + AbstractMemory* pointer; + VALUE* rbReferences; + + VALUE rbLayout; + VALUE rbPointer; + }; + + extern VALUE rbffi_StructClass, rbffi_StructLayoutClass; + extern VALUE rbffi_StructLayoutFieldClass, rbffi_StructLayoutFunctionFieldClass; + extern VALUE rbffi_StructLayoutArrayFieldClass; + extern VALUE rbffi_StructInlineArrayClass; + extern VALUE rbffi_StructLayoutCharArrayClass; + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_STRUCT_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.o new file mode 100644 index 0000000..9f157bf Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Struct.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.c new file mode 100644 index 0000000..a3255f4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include +#include +#include +#include +#include +#include + +#include +#include "rbffi.h" +#include "compat.h" + +#include "Type.h" +#include "StructByValue.h" +#include "Struct.h" + +#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) + +static VALUE sbv_allocate(VALUE); +static VALUE sbv_initialize(VALUE, VALUE); +static void sbv_mark(StructByValue *); +static void sbv_free(StructByValue *); + +VALUE rbffi_StructByValueClass = Qnil; + +static VALUE +sbv_allocate(VALUE klass) +{ + StructByValue* sbv; + + VALUE obj = Data_Make_Struct(klass, StructByValue, sbv_mark, sbv_free, sbv); + + sbv->rbStructClass = Qnil; + sbv->rbStructLayout = Qnil; + sbv->base.nativeType = NATIVE_STRUCT; + + sbv->base.ffiType = xcalloc(1, sizeof(*sbv->base.ffiType)); + sbv->base.ffiType->size = 0; + sbv->base.ffiType->alignment = 1; + sbv->base.ffiType->type = FFI_TYPE_STRUCT; + + return obj; +} + +static VALUE +sbv_initialize(VALUE self, VALUE rbStructClass) +{ + StructByValue* sbv = NULL; + StructLayout* layout = NULL; + VALUE rbLayout = Qnil; + + rbLayout = rb_ivar_get(rbStructClass, rb_intern("@layout")); + if (!rb_obj_is_instance_of(rbLayout, rbffi_StructLayoutClass)) { + rb_raise(rb_eTypeError, "wrong type in @layout ivar (expected FFI::StructLayout)"); + } + + Data_Get_Struct(rbLayout, StructLayout, layout); + Data_Get_Struct(self, StructByValue, sbv); + sbv->rbStructClass = rbStructClass; + sbv->rbStructLayout = rbLayout; + + /* We can just use everything from the ffi_type directly */ + *sbv->base.ffiType = *layout->base.ffiType; + + return self; +} + +static void +sbv_mark(StructByValue *sbv) +{ + rb_gc_mark(sbv->rbStructClass); + rb_gc_mark(sbv->rbStructLayout); +} + +static void +sbv_free(StructByValue *sbv) +{ + xfree(sbv->base.ffiType); + xfree(sbv); +} + + +static VALUE +sbv_layout(VALUE self) +{ + StructByValue* sbv; + + Data_Get_Struct(self, StructByValue, sbv); + return sbv->rbStructLayout; +} + +static VALUE +sbv_struct_class(VALUE self) +{ + StructByValue* sbv; + + Data_Get_Struct(self, StructByValue, sbv); + + return sbv->rbStructClass; +} + +void +rbffi_StructByValue_Init(VALUE moduleFFI) +{ + rbffi_StructByValueClass = rb_define_class_under(moduleFFI, "StructByValue", rbffi_TypeClass); + rb_global_variable(&rbffi_StructByValueClass); + rb_define_const(rbffi_TypeClass, "Struct", rbffi_StructByValueClass); + + rb_define_alloc_func(rbffi_StructByValueClass, sbv_allocate); + rb_define_method(rbffi_StructByValueClass, "initialize", sbv_initialize, 1); + rb_define_method(rbffi_StructByValueClass, "layout", sbv_layout, 0); + rb_define_method(rbffi_StructByValueClass, "struct_class", sbv_struct_class, 0); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.h new file mode 100644 index 0000000..07b2763 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_STRUCTBYVALUE_H +#define RBFFI_STRUCTBYVALUE_H + +#include +#include "Type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct StructByValue_ { + Type base; + VALUE rbStructClass; + VALUE rbStructLayout; +} StructByValue; + +void rbffi_StructByValue_Init(VALUE moduleFFI); + +extern VALUE rbffi_StructByValueClass; + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_STRUCTBYVALUE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.o new file mode 100644 index 0000000..a9ea9fd Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructByValue.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.c new file mode 100644 index 0000000..d318b8c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.c @@ -0,0 +1,700 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#ifndef _MSC_VER +# include +#endif +#include +#include +#include +#include "rbffi.h" +#include "compat.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "MemoryPointer.h" +#include "Function.h" +#include "Types.h" +#include "StructByValue.h" +#include "ArrayType.h" +#include "Function.h" +#include "MappedType.h" +#include "Struct.h" + +#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) + +static void struct_layout_mark(StructLayout *); +static void struct_layout_free(StructLayout *); +static void struct_field_mark(StructField* ); + +VALUE rbffi_StructLayoutFieldClass = Qnil; +VALUE rbffi_StructLayoutNumberFieldClass = Qnil, rbffi_StructLayoutPointerFieldClass = Qnil; +VALUE rbffi_StructLayoutStringFieldClass = Qnil; +VALUE rbffi_StructLayoutFunctionFieldClass = Qnil, rbffi_StructLayoutArrayFieldClass = Qnil; + +VALUE rbffi_StructLayoutClass = Qnil; + + +static VALUE +struct_field_allocate(VALUE klass) +{ + StructField* field; + VALUE obj; + + obj = Data_Make_Struct(klass, StructField, struct_field_mark, -1, field); + field->rbType = Qnil; + field->rbName = Qnil; + + return obj; +} + +static void +struct_field_mark(StructField* f) +{ + rb_gc_mark(f->rbType); + rb_gc_mark(f->rbName); +} + +/* + * call-seq: initialize(name, offset, type) + * @param [String,Symbol] name + * @param [Fixnum] offset + * @param [FFI::Type] type + * @return [self] + * A new FFI::StructLayout::Field instance. + */ +static VALUE +struct_field_initialize(int argc, VALUE* argv, VALUE self) +{ + VALUE rbOffset = Qnil, rbName = Qnil, rbType = Qnil; + StructField* field; + int nargs; + + Data_Get_Struct(self, StructField, field); + + nargs = rb_scan_args(argc, argv, "3", &rbName, &rbOffset, &rbType); + + if (TYPE(rbName) != T_SYMBOL && TYPE(rbName) != T_STRING) { + rb_raise(rb_eTypeError, "wrong argument type %s (expected Symbol/String)", + rb_obj_classname(rbName)); + } + + Check_Type(rbOffset, T_FIXNUM); + + if (!rb_obj_is_kind_of(rbType, rbffi_TypeClass)) { + rb_raise(rb_eTypeError, "wrong argument type %s (expected FFI::Type)", + rb_obj_classname(rbType)); + } + + field->offset = NUM2UINT(rbOffset); + field->rbName = (TYPE(rbName) == T_SYMBOL) ? rbName : rb_str_intern(rbName); + field->rbType = rbType; + Data_Get_Struct(field->rbType, Type, field->type); + field->memoryOp = get_memory_op(field->type); + field->referenceIndex = -1; + + switch (field->type->nativeType == NATIVE_MAPPED ? ((MappedType *) field->type)->type->nativeType : field->type->nativeType) { + case NATIVE_FUNCTION: + case NATIVE_POINTER: + field->referenceRequired = true; + break; + + default: + field->referenceRequired = (rb_respond_to(self, rb_intern("reference_required?")) + && RTEST(rb_funcall2(self, rb_intern("reference_required?"), 0, NULL))) + || (rb_respond_to(rbType, rb_intern("reference_required?")) + && RTEST(rb_funcall2(rbType, rb_intern("reference_required?"), 0, NULL))); + break; + } + + return self; +} + +/* + * call-seq: offset + * @return [Numeric] + * Get the field offset. + */ +static VALUE +struct_field_offset(VALUE self) +{ + StructField* field; + Data_Get_Struct(self, StructField, field); + return UINT2NUM(field->offset); +} + +/* + * call-seq: size + * @return [Numeric] + * Get the field size. + */ +static VALUE +struct_field_size(VALUE self) +{ + StructField* field; + Data_Get_Struct(self, StructField, field); + return UINT2NUM(field->type->ffiType->size); +} + +/* + * call-seq: alignment + * @return [Numeric] + * Get the field alignment. + */ +static VALUE +struct_field_alignment(VALUE self) +{ + StructField* field; + Data_Get_Struct(self, StructField, field); + return UINT2NUM(field->type->ffiType->alignment); +} + +/* + * call-seq: type + * @return [Type] + * Get the field type. + */ +static VALUE +struct_field_type(VALUE self) +{ + StructField* field; + Data_Get_Struct(self, StructField, field); + + return field->rbType; +} + +/* + * call-seq: name + * @return [Symbol] + * Get the field name. + */ +static VALUE +struct_field_name(VALUE self) +{ + StructField* field; + Data_Get_Struct(self, StructField, field); + return field->rbName; +} + +/* + * call-seq: get(pointer) + * @param [AbstractMemory] pointer pointer on a {Struct} + * @return [Object] + * Get an object of type {#type} from memory pointed by +pointer+. + */ +static VALUE +struct_field_get(VALUE self, VALUE pointer) +{ + StructField* f; + + Data_Get_Struct(self, StructField, f); + if (f->memoryOp == NULL) { + rb_raise(rb_eArgError, "get not supported for %s", rb_obj_classname(f->rbType)); + return Qnil; + } + + return (*f->memoryOp->get)(MEMORY(pointer), f->offset); +} + +/* + * call-seq: put(pointer, value) + * @param [AbstractMemory] pointer pointer on a {Struct} + * @param [Object] value this object must be a kind of {#type} + * @return [self] + * Put an object to memory pointed by +pointer+. + */ +static VALUE +struct_field_put(VALUE self, VALUE pointer, VALUE value) +{ + StructField* f; + + Data_Get_Struct(self, StructField, f); + if (f->memoryOp == NULL) { + rb_raise(rb_eArgError, "put not supported for %s", rb_obj_classname(f->rbType)); + return self; + } + + (*f->memoryOp->put)(MEMORY(pointer), f->offset, value); + + return self; +} + +/* + * call-seq: get(pointer) + * @param [AbstractMemory] pointer pointer on a {Struct} + * @return [Function] + * Get a {Function} from memory pointed by +pointer+. + */ +static VALUE +function_field_get(VALUE self, VALUE pointer) +{ + StructField* f; + + Data_Get_Struct(self, StructField, f); + + return rbffi_Function_NewInstance(f->rbType, (*rbffi_AbstractMemoryOps.pointer->get)(MEMORY(pointer), f->offset)); +} + +/* + * call-seq: put(pointer, proc) + * @param [AbstractMemory] pointer pointer to a {Struct} + * @param [Function, Proc] proc + * @return [Function] + * Set a {Function} to memory pointed by +pointer+ as a function. + * + * If a Proc is submitted as +proc+, it is automatically transformed to a {Function}. + */ +static VALUE +function_field_put(VALUE self, VALUE pointer, VALUE proc) +{ + StructField* f; + VALUE value = Qnil; + + Data_Get_Struct(self, StructField, f); + + if (NIL_P(proc) || rb_obj_is_kind_of(proc, rbffi_FunctionClass)) { + value = proc; + } else if (rb_obj_is_kind_of(proc, rb_cProc) || rb_respond_to(proc, rb_intern("call"))) { + value = rbffi_Function_ForProc(f->rbType, proc); + } else { + rb_raise(rb_eTypeError, "wrong type (expected Proc or Function)"); + } + + (*rbffi_AbstractMemoryOps.pointer->put)(MEMORY(pointer), f->offset, value); + + return self; +} + +static inline bool +isCharArray(ArrayType* arrayType) +{ + return arrayType->componentType->nativeType == NATIVE_INT8 + || arrayType->componentType->nativeType == NATIVE_UINT8; +} + +/* + * call-seq: get(pointer) + * @param [AbstractMemory] pointer pointer on a {Struct} + * @return [FFI::StructLayout::CharArray, FFI::Struct::InlineArray] + * Get an array from a {Struct}. + */ +static VALUE +array_field_get(VALUE self, VALUE pointer) +{ + StructField* f; + ArrayType* array; + VALUE argv[2]; + + Data_Get_Struct(self, StructField, f); + Data_Get_Struct(f->rbType, ArrayType, array); + + argv[0] = pointer; + argv[1] = self; + + return rb_class_new_instance(2, argv, isCharArray(array) + ? rbffi_StructLayoutCharArrayClass : rbffi_StructInlineArrayClass); +} + +/* + * call-seq: put(pointer, value) + * @param [AbstractMemory] pointer pointer on a {Struct} + * @param [String, Array] value +value+ may be a String only if array's type is a kind of +int8+ + * @return [value] + * Set an array in a {Struct}. + */ +static VALUE +array_field_put(VALUE self, VALUE pointer, VALUE value) +{ + StructField* f; + ArrayType* array; + + + Data_Get_Struct(self, StructField, f); + Data_Get_Struct(f->rbType, ArrayType, array); + + if (isCharArray(array) && rb_obj_is_instance_of(value, rb_cString)) { + VALUE argv[2]; + + argv[0] = INT2FIX(f->offset); + argv[1] = value; + + if (RSTRING_LEN(value) < array->length) { + rb_funcall2(pointer, rb_intern("put_string"), 2, argv); + } else if (RSTRING_LEN(value) == array->length) { + rb_funcall2(pointer, rb_intern("put_bytes"), 2, argv); + } else { + rb_raise(rb_eIndexError, "String is longer (%ld bytes) than the char array (%d bytes)", RSTRING_LEN(value), array->length); + } + } else { +#ifdef notyet + MemoryOp* op; + int count = RARRAY_LEN(value); + int i; + AbstractMemory* memory = MEMORY(pointer); + + if (count > array->length) { + rb_raise(rb_eIndexError, "array too large"); + } + + /* clear the contents in case of a short write */ + checkWrite(memory); + checkBounds(memory, f->offset, f->type->ffiType->size); + if (count < array->length) { + memset(memory->address + f->offset + (count * array->componentType->ffiType->size), + 0, (array->length - count) * array->componentType->ffiType->size); + } + + /* now copy each element in */ + if ((op = get_memory_op(array->componentType)) != NULL) { + + for (i = 0; i < count; ++i) { + (*op->put)(memory, f->offset + (i * array->componentType->ffiType->size), rb_ary_entry(value, i)); + } + + } else if (array->componentType->nativeType == NATIVE_STRUCT) { + + for (i = 0; i < count; ++i) { + VALUE entry = rb_ary_entry(value, i); + Struct* s; + + if (!rb_obj_is_kind_of(entry, rbffi_StructClass)) { + rb_raise(rb_eTypeError, "array element not an instance of FFI::Struct"); + break; + } + + Data_Get_Struct(entry, Struct, s); + checkRead(s->pointer); + checkBounds(s->pointer, 0, array->componentType->ffiType->size); + + memcpy(memory->address + f->offset + (i * array->componentType->ffiType->size), + s->pointer->address, array->componentType->ffiType->size); + } + + } else { + rb_raise(rb_eNotImpError, "put not supported for arrays of type %s", rb_obj_classname(array->rbComponentType)); + } +#else + rb_raise(rb_eNotImpError, "cannot set array field"); +#endif + } + + return value; +} + + +static VALUE +struct_layout_allocate(VALUE klass) +{ + StructLayout* layout; + VALUE obj; + + obj = Data_Make_Struct(klass, StructLayout, struct_layout_mark, struct_layout_free, layout); + layout->rbFieldMap = Qnil; + layout->rbFieldNames = Qnil; + layout->rbFields = Qnil; + layout->base.ffiType = xcalloc(1, sizeof(*layout->base.ffiType)); + layout->base.ffiType->size = 0; + layout->base.ffiType->alignment = 0; + layout->base.ffiType->type = FFI_TYPE_STRUCT; + + return obj; +} + +/* + * call-seq: initialize(fields, size, align) + * @param [Array] fields + * @param [Numeric] size + * @param [Numeric] align + * @return [self] + * A new StructLayout instance. + */ +static VALUE +struct_layout_initialize(VALUE self, VALUE fields, VALUE size, VALUE align) +{ + StructLayout* layout; + ffi_type* ltype; + int i; + + Data_Get_Struct(self, StructLayout, layout); + layout->fieldCount = (int) RARRAY_LEN(fields); + layout->rbFieldMap = rb_hash_new(); + layout->rbFieldNames = rb_ary_new2(layout->fieldCount); + layout->size = (int) FFI_ALIGN(NUM2INT(size), NUM2INT(align)); + layout->align = NUM2INT(align); + layout->fields = xcalloc(layout->fieldCount, sizeof(StructField *)); + layout->ffiTypes = xcalloc(layout->fieldCount + 1, sizeof(ffi_type *)); + layout->rbFields = rb_ary_new2(layout->fieldCount); + layout->referenceFieldCount = 0; + layout->base.ffiType->elements = layout->ffiTypes; + layout->base.ffiType->size = layout->size; + layout->base.ffiType->alignment = layout->align; + + ltype = layout->base.ffiType; + for (i = 0; i < (int) layout->fieldCount; ++i) { + VALUE rbField = rb_ary_entry(fields, i); + VALUE rbName; + StructField* field; + ffi_type* ftype; + + + if (!rb_obj_is_kind_of(rbField, rbffi_StructLayoutFieldClass)) { + rb_raise(rb_eTypeError, "wrong type for field %d.", i); + } + rbName = rb_funcall2(rbField, rb_intern("name"), 0, NULL); + + Data_Get_Struct(rbField, StructField, field); + layout->fields[i] = field; + + if (field->type == NULL || field->type->ffiType == NULL) { + rb_raise(rb_eRuntimeError, "type of field %d not supported", i); + } + + ftype = field->type->ffiType; + if (ftype->size == 0 && i < ((int) layout->fieldCount - 1)) { + rb_raise(rb_eTypeError, "type of field %d has zero size", i); + } + + if (field->referenceRequired) { + field->referenceIndex = layout->referenceFieldCount++; + } + + + layout->ffiTypes[i] = ftype->size > 0 ? ftype : NULL; + rb_hash_aset(layout->rbFieldMap, rbName, rbField); + rb_ary_push(layout->rbFields, rbField); + rb_ary_push(layout->rbFieldNames, rbName); + } + + if (ltype->size == 0) { + rb_raise(rb_eRuntimeError, "Struct size is zero"); + } + + return self; +} + +/* + * call-seq: [](field) + * @param [Symbol] field + * @return [StructLayout::Field] + * Get a field from the layout. + */ +static VALUE +struct_layout_union_bang(VALUE self) +{ + const ffi_type *alignment_types[] = { &ffi_type_sint8, &ffi_type_sint16, &ffi_type_sint32, &ffi_type_sint64, + &ffi_type_float, &ffi_type_double, &ffi_type_longdouble, NULL }; + StructLayout* layout; + ffi_type *t = NULL; + int count, i; + + Data_Get_Struct(self, StructLayout, layout); + + for (i = 0; alignment_types[i] != NULL; ++i) { + if (alignment_types[i]->alignment == layout->align) { + t = (ffi_type *) alignment_types[i]; + break; + } + } + if (t == NULL) { + rb_raise(rb_eRuntimeError, "cannot create libffi union representation for alignment %d", layout->align); + return Qnil; + } + + count = (int) layout->size / (int) t->size; + xfree(layout->ffiTypes); + layout->ffiTypes = xcalloc(count + 1, sizeof(ffi_type *)); + layout->base.ffiType->elements = layout->ffiTypes; + + for (i = 0; i < count; ++i) { + layout->ffiTypes[i] = t; + } + + return self; +} + +static VALUE +struct_layout_aref(VALUE self, VALUE field) +{ + StructLayout* layout; + + Data_Get_Struct(self, StructLayout, layout); + + return rb_hash_aref(layout->rbFieldMap, field); +} + +/* + * call-seq: fields + * @return [Array] + * Get fields list. + */ +static VALUE +struct_layout_fields(VALUE self) +{ + StructLayout* layout; + + Data_Get_Struct(self, StructLayout, layout); + + return rb_ary_dup(layout->rbFields); +} + +/* + * call-seq: members + * @return [Array] + * Get list of field names. + */ +static VALUE +struct_layout_members(VALUE self) +{ + StructLayout* layout; + + Data_Get_Struct(self, StructLayout, layout); + + return rb_ary_dup(layout->rbFieldNames); +} + +/* + * call-seq: to_a + * @return [Array] + * Get an array of fields. + */ +static VALUE +struct_layout_to_a(VALUE self) +{ + StructLayout* layout; + + Data_Get_Struct(self, StructLayout, layout); + + return rb_ary_dup(layout->rbFields); +} + +static void +struct_layout_mark(StructLayout *layout) +{ + rb_gc_mark(layout->rbFieldMap); + rb_gc_mark(layout->rbFieldNames); + rb_gc_mark(layout->rbFields); + /* Clear the cache, to be safe from changes of fieldName VALUE by GC.compact. + * TODO: Move cache clearing to compactation callback provided by Ruby-2.7+. + */ + memset(&layout->cache_row, 0, sizeof(layout->cache_row)); +} + +static void +struct_layout_free(StructLayout *layout) +{ + xfree(layout->ffiTypes); + xfree(layout->base.ffiType); + xfree(layout->fields); + xfree(layout); +} + + +void +rbffi_StructLayout_Init(VALUE moduleFFI) +{ + VALUE ffi_Type = rbffi_TypeClass; + + /* + * Document-class: FFI::StructLayout < FFI::Type + * + * This class aims at defining a struct layout. + */ + rbffi_StructLayoutClass = rb_define_class_under(moduleFFI, "StructLayout", ffi_Type); + rb_global_variable(&rbffi_StructLayoutClass); + + /* + * Document-class: FFI::StructLayout::Field + * A field in a {StructLayout}. + */ + rbffi_StructLayoutFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "Field", rb_cObject); + rb_global_variable(&rbffi_StructLayoutFieldClass); + + /* + * Document-class: FFI::StructLayout::Number + * A numeric {Field} in a {StructLayout}. + */ + rbffi_StructLayoutNumberFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "Number", rbffi_StructLayoutFieldClass); + rb_global_variable(&rbffi_StructLayoutNumberFieldClass); + + /* + * Document-class: FFI::StructLayout::String + * A string {Field} in a {StructLayout}. + */ + rbffi_StructLayoutStringFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "String", rbffi_StructLayoutFieldClass); + rb_global_variable(&rbffi_StructLayoutStringFieldClass); + + /* + * Document-class: FFI::StructLayout::Pointer + * A pointer {Field} in a {StructLayout}. + */ + rbffi_StructLayoutPointerFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "Pointer", rbffi_StructLayoutFieldClass); + rb_global_variable(&rbffi_StructLayoutPointerFieldClass); + + /* + * Document-class: FFI::StructLayout::Function + * A function pointer {Field} in a {StructLayout}. + */ + rbffi_StructLayoutFunctionFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "Function", rbffi_StructLayoutFieldClass); + rb_global_variable(&rbffi_StructLayoutFunctionFieldClass); + + /* + * Document-class: FFI::StructLayout::Array + * An array {Field} in a {StructLayout}. + */ + rbffi_StructLayoutArrayFieldClass = rb_define_class_under(rbffi_StructLayoutClass, "Array", rbffi_StructLayoutFieldClass); + rb_global_variable(&rbffi_StructLayoutArrayFieldClass); + + rb_define_alloc_func(rbffi_StructLayoutFieldClass, struct_field_allocate); + rb_define_method(rbffi_StructLayoutFieldClass, "initialize", struct_field_initialize, -1); + rb_define_method(rbffi_StructLayoutFieldClass, "offset", struct_field_offset, 0); + rb_define_method(rbffi_StructLayoutFieldClass, "size", struct_field_size, 0); + rb_define_method(rbffi_StructLayoutFieldClass, "alignment", struct_field_alignment, 0); + rb_define_method(rbffi_StructLayoutFieldClass, "name", struct_field_name, 0); + rb_define_method(rbffi_StructLayoutFieldClass, "type", struct_field_type, 0); + rb_define_method(rbffi_StructLayoutFieldClass, "put", struct_field_put, 2); + rb_define_method(rbffi_StructLayoutFieldClass, "get", struct_field_get, 1); + + rb_define_method(rbffi_StructLayoutFunctionFieldClass, "put", function_field_put, 2); + rb_define_method(rbffi_StructLayoutFunctionFieldClass, "get", function_field_get, 1); + + rb_define_method(rbffi_StructLayoutArrayFieldClass, "get", array_field_get, 1); + rb_define_method(rbffi_StructLayoutArrayFieldClass, "put", array_field_put, 2); + + rb_define_alloc_func(rbffi_StructLayoutClass, struct_layout_allocate); + rb_define_method(rbffi_StructLayoutClass, "initialize", struct_layout_initialize, 3); + rb_define_method(rbffi_StructLayoutClass, "[]", struct_layout_aref, 1); + rb_define_method(rbffi_StructLayoutClass, "fields", struct_layout_fields, 0); + rb_define_method(rbffi_StructLayoutClass, "members", struct_layout_members, 0); + rb_define_method(rbffi_StructLayoutClass, "to_a", struct_layout_to_a, 0); + rb_define_method(rbffi_StructLayoutClass, "__union!", struct_layout_union_bang, 0); + +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.o new file mode 100644 index 0000000..76f8098 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/StructLayout.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.c new file mode 100644 index 0000000..f6a8387 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2010 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#if defined(__CYGWIN__) || !defined(_WIN32) +# include +# include +# include +# include +#else +# include +# define _WINSOCKAPI_ +# include +#endif +#include +#include "Thread.h" + +#ifdef _WIN32 +static volatile DWORD frame_thread_key = TLS_OUT_OF_INDEXES; +#else +static pthread_key_t thread_data_key; +struct thread_data { + rbffi_frame_t* frame; +}; +static inline struct thread_data* thread_data_get(void); + +#endif + +rbffi_frame_t* +rbffi_frame_current(void) +{ +#ifdef _WIN32 + return (rbffi_frame_t *) TlsGetValue(frame_thread_key); +#else + struct thread_data* td = (struct thread_data *) pthread_getspecific(thread_data_key); + return td != NULL ? td->frame : NULL; +#endif +} + +void +rbffi_frame_push(rbffi_frame_t* frame) +{ + memset(frame, 0, sizeof(*frame)); + frame->exc = Qnil; + +#ifdef _WIN32 + frame->prev = TlsGetValue(frame_thread_key); + TlsSetValue(frame_thread_key, frame); +#else + frame->td = thread_data_get(); + frame->prev = frame->td->frame; + frame->td->frame = frame; +#endif +} + +void +rbffi_frame_pop(rbffi_frame_t* frame) +{ +#ifdef _WIN32 + TlsSetValue(frame_thread_key, frame->prev); +#else + frame->td->frame = frame->prev; +#endif +} + +#ifndef _WIN32 +static struct thread_data* thread_data_init(void); + +static inline struct thread_data* +thread_data_get(void) +{ + struct thread_data* td = (struct thread_data *) pthread_getspecific(thread_data_key); + return td != NULL ? td : thread_data_init(); +} + +static struct thread_data* +thread_data_init(void) +{ + struct thread_data* td = calloc(1, sizeof(struct thread_data)); + + pthread_setspecific(thread_data_key, td); + + return td; +} + +static void +thread_data_free(void *ptr) +{ + free(ptr); +} +#endif + +void +rbffi_Thread_Init(VALUE moduleFFI) +{ +#ifdef _WIN32 + frame_thread_key = TlsAlloc(); +#else + pthread_key_create(&thread_data_key, thread_data_free); +#endif +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.h new file mode 100644 index 0000000..8c335e4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2010 Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_THREAD_H +#define RBFFI_THREAD_H + +#include +#include +#include "extconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef _WIN32 +# include +#else +# include +#endif + +typedef struct { +#ifdef _WIN32 + DWORD id; +#else + pthread_t id; +#endif + bool valid; + bool has_gvl; + VALUE exc; +} rbffi_thread_t; + +typedef struct rbffi_frame { +#ifndef _WIN32 + struct thread_data* td; +#endif + struct rbffi_frame* prev; + VALUE exc; +} rbffi_frame_t; + +rbffi_frame_t* rbffi_frame_current(void); +void rbffi_frame_push(rbffi_frame_t* frame); +void rbffi_frame_pop(rbffi_frame_t* frame); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_THREAD_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.o new file mode 100644 index 0000000..a1a44e3 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Thread.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.c new file mode 100644 index 0000000..7776bb0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.c @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +# include +#endif + +#include +#include +#include +#include "rbffi.h" +#include "compat.h" +#include "Types.h" +#include "Type.h" + + +typedef struct BuiltinType_ { + Type type; + char* name; +} BuiltinType; + +static void builtin_type_free(BuiltinType *); + +VALUE rbffi_TypeClass = Qnil; + +static VALUE classBuiltinType = Qnil; +static VALUE moduleNativeType = Qnil; +static VALUE typeMap = Qnil, sizeMap = Qnil; +static ID id_find_type = 0, id_type_size = 0, id_size = 0; + +static VALUE +type_allocate(VALUE klass) +{ + Type* type; + VALUE obj = Data_Make_Struct(klass, Type, NULL, -1, type); + + type->nativeType = -1; + type->ffiType = &ffi_type_void; + + return obj; +} + +/* + * Document-method: initialize + * call-seq: initialize(value) + * @param [Fixnum,Type] value + * @return [self] + */ +static VALUE +type_initialize(VALUE self, VALUE value) +{ + Type* type; + Type* other; + + Data_Get_Struct(self, Type, type); + + if (FIXNUM_P(value)) { + type->nativeType = FIX2INT(value); + } else if (rb_obj_is_kind_of(value, rbffi_TypeClass)) { + Data_Get_Struct(value, Type, other); + type->nativeType = other->nativeType; + type->ffiType = other->ffiType; + } else { + rb_raise(rb_eArgError, "wrong type"); + } + + return self; +} + +/* + * call-seq: type.size + * @return [Fixnum] + * Return type's size, in bytes. + */ +static VALUE +type_size(VALUE self) +{ + Type *type; + + Data_Get_Struct(self, Type, type); + + return INT2FIX(type->ffiType->size); +} + +/* + * call-seq: type.alignment + * @return [Fixnum] + * Get Type alignment. + */ +static VALUE +type_alignment(VALUE self) +{ + Type *type; + + Data_Get_Struct(self, Type, type); + + return INT2FIX(type->ffiType->alignment); +} + +/* + * call-seq: type.inspect + * @return [String] + * Inspect {Type} object. + */ +static VALUE +type_inspect(VALUE self) +{ + char buf[100]; + Type *type; + + Data_Get_Struct(self, Type, type); + + snprintf(buf, sizeof(buf), "#<%s:%p size=%d alignment=%d>", + rb_obj_classname(self), type, (int) type->ffiType->size, (int) type->ffiType->alignment); + + return rb_str_new2(buf); +} + +static VALUE +builtin_type_new(VALUE klass, int nativeType, ffi_type* ffiType, const char* name) +{ + BuiltinType* type; + VALUE obj = Qnil; + + obj = Data_Make_Struct(klass, BuiltinType, NULL, builtin_type_free, type); + + type->name = strdup(name); + type->type.nativeType = nativeType; + type->type.ffiType = ffiType; + + return obj; +} + +static void +builtin_type_free(BuiltinType *type) +{ + free(type->name); + xfree(type); +} + +/* + * call-seq: type.inspect + * @return [String] + * Inspect {Type::Builtin} object. + */ +static VALUE +builtin_type_inspect(VALUE self) +{ + char buf[100]; + BuiltinType *type; + + Data_Get_Struct(self, BuiltinType, type); + snprintf(buf, sizeof(buf), "#<%s:%s size=%d alignment=%d>", + rb_obj_classname(self), type->name, (int) type->type.ffiType->size, type->type.ffiType->alignment); + + return rb_str_new2(buf); +} + +int +rbffi_type_size(VALUE type) +{ + int t = TYPE(type); + + if (t == T_FIXNUM || t == T_BIGNUM) { + return NUM2INT(type); + + } else if (t == T_SYMBOL) { + /* + * Try looking up directly in the type and size maps + */ + VALUE nType; + if ((nType = rb_hash_lookup(typeMap, type)) != Qnil) { + if (rb_obj_is_kind_of(nType, rbffi_TypeClass)) { + Type* type; + Data_Get_Struct(nType, Type, type); + return (int) type->ffiType->size; + + } else if (rb_respond_to(nType, id_size)) { + return NUM2INT(rb_funcall2(nType, id_size, 0, NULL)); + } + } + + /* Not found - call up to the ruby version to resolve */ + return NUM2INT(rb_funcall2(rbffi_FFIModule, id_type_size, 1, &type)); + + } else { + return NUM2INT(rb_funcall2(type, id_size, 0, NULL)); + } +} + +VALUE +rbffi_Type_Lookup(VALUE name) +{ + int t = TYPE(name); + if (t == T_SYMBOL || t == T_STRING) { + /* + * Try looking up directly in the type Map + */ + VALUE nType; + if ((nType = rb_hash_lookup(typeMap, name)) != Qnil && rb_obj_is_kind_of(nType, rbffi_TypeClass)) { + return nType; + } + } else if (rb_obj_is_kind_of(name, rbffi_TypeClass)) { + + return name; + } + + /* Nothing found - let caller handle raising exceptions */ + return Qnil; +} + +void +rbffi_Type_Init(VALUE moduleFFI) +{ + /* + * Document-class: FFI::Type + * This class manages C types. + * + * It embbed {FFI::Type::Builtin} objects as constants (for names, + * see {FFI::NativeType}). + */ + rbffi_TypeClass = rb_define_class_under(moduleFFI, "Type", rb_cObject); + + /* + * Document-constant: FFI::TypeDefs + */ + rb_define_const(moduleFFI, "TypeDefs", typeMap = rb_hash_new()); + rb_define_const(moduleFFI, "SizeTypes", sizeMap = rb_hash_new()); + rb_global_variable(&typeMap); + rb_global_variable(&sizeMap); + id_find_type = rb_intern("find_type"); + id_type_size = rb_intern("type_size"); + id_size = rb_intern("size"); + + /* + * Document-class: FFI::Type::Builtin + * Class for Built-in types. + */ + classBuiltinType = rb_define_class_under(rbffi_TypeClass, "Builtin", rbffi_TypeClass); + /* + * Document-module: FFI::NativeType + * This module defines constants for native (C) types. + * + * ==Native type constants + * Native types are defined by constants : + * * INT8, SCHAR, CHAR + * * UINT8, UCHAR + * * INT16, SHORT, SSHORT + * * UINT16, USHORT + * * INT32,, INT, SINT + * * UINT32, UINT + * * INT64, LONG_LONG, SLONG_LONG + * * UINT64, ULONG_LONG + * * LONG, SLONG + * * ULONG + * * FLOAT32, FLOAT + * * FLOAT64, DOUBLE + * * POINTER + * * CALLBACK + * * FUNCTION + * * CHAR_ARRAY + * * BOOL + * * STRING (immutable string, nul terminated) + * * STRUCT (struct-b-value param or result) + * * ARRAY (array type definition) + * * MAPPED (custom native type) + * For function return type only : + * * VOID + * For function argument type only : + * * BUFFER_IN + * * BUFFER_OUT + * * VARARGS (function takes a variable number of arguments) + * + * All these constants are exported to {FFI} module prefixed with "TYPE_". + * They are objets from {FFI::Type::Builtin} class. + */ + moduleNativeType = rb_define_module_under(moduleFFI, "NativeType"); + + /* + * Document-global: FFI::Type + */ + rb_global_variable(&rbffi_TypeClass); + rb_global_variable(&classBuiltinType); + rb_global_variable(&moduleNativeType); + + rb_define_alloc_func(rbffi_TypeClass, type_allocate); + rb_define_method(rbffi_TypeClass, "initialize", type_initialize, 1); + rb_define_method(rbffi_TypeClass, "size", type_size, 0); + rb_define_method(rbffi_TypeClass, "alignment", type_alignment, 0); + rb_define_method(rbffi_TypeClass, "inspect", type_inspect, 0); + + /* Make Type::Builtin non-allocatable */ + rb_undef_method(CLASS_OF(classBuiltinType), "new"); + rb_define_method(classBuiltinType, "inspect", builtin_type_inspect, 0); + + rb_global_variable(&rbffi_TypeClass); + rb_global_variable(&classBuiltinType); + + /* Define all the builtin types */ + #define T(x, ffiType) do { \ + VALUE t = Qnil; \ + rb_define_const(rbffi_TypeClass, #x, t = builtin_type_new(classBuiltinType, NATIVE_##x, ffiType, #x)); \ + rb_define_const(moduleNativeType, #x, t); \ + rb_define_const(moduleFFI, "TYPE_" #x, t); \ + } while(0) + + #define A(old_type, new_type) do { \ + VALUE t = rb_const_get(rbffi_TypeClass, rb_intern(#old_type)); \ + rb_const_set(rbffi_TypeClass, rb_intern(#new_type), t); \ + } while(0) + + /* + * Document-constant: FFI::Type::Builtin::VOID + */ + T(VOID, &ffi_type_void); + T(INT8, &ffi_type_sint8); + A(INT8, SCHAR); + A(INT8, CHAR); + T(UINT8, &ffi_type_uint8); + A(UINT8, UCHAR); + + T(INT16, &ffi_type_sint16); + A(INT16, SHORT); + A(INT16, SSHORT); + T(UINT16, &ffi_type_uint16); + A(UINT16, USHORT); + T(INT32, &ffi_type_sint32); + A(INT32, INT); + A(INT32, SINT); + T(UINT32, &ffi_type_uint32); + A(UINT32, UINT); + T(INT64, &ffi_type_sint64); + A(INT64, LONG_LONG); + A(INT64, SLONG_LONG); + T(UINT64, &ffi_type_uint64); + A(UINT64, ULONG_LONG); + T(LONG, &ffi_type_slong); + A(LONG, SLONG); + T(ULONG, &ffi_type_ulong); + T(FLOAT32, &ffi_type_float); + A(FLOAT32, FLOAT); + T(FLOAT64, &ffi_type_double); + A(FLOAT64, DOUBLE); + T(LONGDOUBLE, &ffi_type_longdouble); + T(POINTER, &ffi_type_pointer); + T(STRING, &ffi_type_pointer); + T(BUFFER_IN, &ffi_type_pointer); + T(BUFFER_OUT, &ffi_type_pointer); + T(BUFFER_INOUT, &ffi_type_pointer); + T(BOOL, &ffi_type_uchar); + T(VARARGS, &ffi_type_void); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.h new file mode 100644 index 0000000..b81995a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * Copyright (C) 2009 Luc Heinrich + * + * This file is part of ruby-ffi. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the Evan Phoenix nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef RBFFI_TYPE_H +#define RBFFI_TYPE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct Type_ Type; + +#include "Types.h" + +struct Type_ { + NativeType nativeType; + ffi_type* ffiType; +}; + +extern VALUE rbffi_TypeClass; +extern VALUE rbffi_Type_Lookup(VALUE type); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_TYPE_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.o new file mode 100644 index 0000000..778de69 Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Type.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.c new file mode 100644 index 0000000..77741e0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * Copyright (c) 2009, Aman Gupta. + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "Pointer.h" +#include "rbffi.h" +#include "Function.h" +#include "StructByValue.h" +#include "Types.h" +#include "Struct.h" +#include "MappedType.h" +#include "MemoryPointer.h" +#include "LongDouble.h" + +static ID id_from_native = 0; + + +VALUE +rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr) +{ + switch (type->nativeType) { + case NATIVE_VOID: + return Qnil; + case NATIVE_INT8: + return INT2NUM((signed char) *(ffi_sarg *) ptr); + case NATIVE_INT16: + return INT2NUM((signed short) *(ffi_sarg *) ptr); + case NATIVE_INT32: + return INT2NUM((signed int) *(ffi_sarg *) ptr); + case NATIVE_LONG: + return LONG2NUM((signed long) *(ffi_sarg *) ptr); + case NATIVE_INT64: + return LL2NUM(*(signed long long *) ptr); + + case NATIVE_UINT8: + return UINT2NUM((unsigned char) *(ffi_arg *) ptr); + case NATIVE_UINT16: + return UINT2NUM((unsigned short) *(ffi_arg *) ptr); + case NATIVE_UINT32: + return UINT2NUM((unsigned int) *(ffi_arg *) ptr); + case NATIVE_ULONG: + return ULONG2NUM((unsigned long) *(ffi_arg *) ptr); + case NATIVE_UINT64: + return ULL2NUM(*(unsigned long long *) ptr); + + case NATIVE_FLOAT32: + return rb_float_new(*(float *) ptr); + case NATIVE_FLOAT64: + return rb_float_new(*(double *) ptr); + + case NATIVE_LONGDOUBLE: + return rbffi_longdouble_new(*(long double *) ptr); + + case NATIVE_STRING: + return (*(void **) ptr != NULL) ? rb_str_new2(*(char **) ptr) : Qnil; + case NATIVE_POINTER: + return rbffi_Pointer_NewInstance(*(void **) ptr); + case NATIVE_BOOL: + return ((unsigned char) *(ffi_arg *) ptr) ? Qtrue : Qfalse; + + case NATIVE_FUNCTION: { + return *(void **) ptr != NULL + ? rbffi_Function_NewInstance(rbType, rbffi_Pointer_NewInstance(*(void **) ptr)) + : Qnil; + } + + case NATIVE_STRUCT: { + StructByValue* sbv = (StructByValue *)type; + AbstractMemory* mem; + VALUE rbMemory = rbffi_MemoryPointer_NewInstance(1, sbv->base.ffiType->size, false); + + Data_Get_Struct(rbMemory, AbstractMemory, mem); + memcpy(mem->address, ptr, sbv->base.ffiType->size); + RB_GC_GUARD(rbMemory); + RB_GC_GUARD(rbType); + + return rb_class_new_instance(1, &rbMemory, sbv->rbStructClass); + } + + case NATIVE_MAPPED: { + /* + * For mapped types, first convert to the real native type, then upcall to + * ruby to convert to the expected return type + */ + MappedType* m = (MappedType *) type; + VALUE values[2], rbReturnValue; + + values[0] = rbffi_NativeValue_ToRuby(m->type, m->rbType, ptr); + values[1] = Qnil; + + + rbReturnValue = rb_funcall2(m->rbConverter, id_from_native, 2, values); + RB_GC_GUARD(values[0]); + RB_GC_GUARD(rbType); + + return rbReturnValue; + } + + default: + rb_raise(rb_eRuntimeError, "Unknown type: %d", type->nativeType); + return Qnil; + } +} + +void +rbffi_Types_Init(VALUE moduleFFI) +{ + id_from_native = rb_intern("from_native"); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.h new file mode 100644 index 0000000..4b72320 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (c) 2009, Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_TYPES_H +#define RBFFI_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + NATIVE_VOID, + NATIVE_INT8, + NATIVE_UINT8, + NATIVE_INT16, + NATIVE_UINT16, + NATIVE_INT32, + NATIVE_UINT32, + NATIVE_INT64, + NATIVE_UINT64, + NATIVE_LONG, + NATIVE_ULONG, + NATIVE_FLOAT32, + NATIVE_FLOAT64, + NATIVE_LONGDOUBLE, + NATIVE_POINTER, + NATIVE_FUNCTION, + NATIVE_BUFFER_IN, + NATIVE_BUFFER_OUT, + NATIVE_BUFFER_INOUT, + NATIVE_CHAR_ARRAY, + NATIVE_BOOL, + + /** An immutable string. Nul terminated, but only copies in to the native function */ + NATIVE_STRING, + + /** The function takes a variable number of arguments */ + NATIVE_VARARGS, + + /** Struct-by-value param or result */ + NATIVE_STRUCT, + + /** An array type definition */ + NATIVE_ARRAY, + + /** Custom native type */ + NATIVE_MAPPED, +} NativeType; + +#include +#include "Type.h" + +VALUE rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr); +void rbffi_Types_Init(VALUE moduleFFI); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_TYPES_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.o new file mode 100644 index 0000000..47b363c Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Types.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.c new file mode 100644 index 0000000..8ad38b1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.c @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2008-2010 Wayne Meissner + * Copyright (C) 2009 Andrea Fazzi + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MSC_VER +#include +#endif +#include + +#include +#include +#include +#include + +#include +#include "rbffi.h" +#include "compat.h" + +#include "AbstractMemory.h" +#include "Pointer.h" +#include "Types.h" +#include "Type.h" +#include "LastError.h" +#include "MethodHandle.h" +#include "Call.h" +#include "Thread.h" + +typedef struct VariadicInvoker_ { + VALUE rbAddress; + VALUE rbReturnType; + VALUE rbEnums; + + Type* returnType; + ffi_abi abi; + void* function; + int paramCount; + bool blocking; +} VariadicInvoker; + + +static VALUE variadic_allocate(VALUE klass); +static VALUE variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, + VALUE rbReturnType, VALUE options); +static void variadic_mark(VariadicInvoker *); + +static VALUE classVariadicInvoker = Qnil; + + +static VALUE +variadic_allocate(VALUE klass) +{ + VariadicInvoker *invoker; + VALUE obj = Data_Make_Struct(klass, VariadicInvoker, variadic_mark, -1, invoker); + + invoker->rbAddress = Qnil; + invoker->rbEnums = Qnil; + invoker->rbReturnType = Qnil; + invoker->blocking = false; + + return obj; +} + +static void +variadic_mark(VariadicInvoker *invoker) +{ + rb_gc_mark(invoker->rbEnums); + rb_gc_mark(invoker->rbAddress); + rb_gc_mark(invoker->rbReturnType); +} + +static VALUE +variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE rbReturnType, VALUE options) +{ + VariadicInvoker* invoker = NULL; + VALUE retval = Qnil; + VALUE convention = Qnil; + VALUE fixed = Qnil; +#if defined(X86_WIN32) + VALUE rbConventionStr; +#endif + int i; + + Check_Type(options, T_HASH); + convention = rb_hash_aref(options, ID2SYM(rb_intern("convention"))); + + Data_Get_Struct(self, VariadicInvoker, invoker); + invoker->rbEnums = rb_hash_aref(options, ID2SYM(rb_intern("enums"))); + invoker->rbAddress = rbFunction; + invoker->function = rbffi_AbstractMemory_Cast(rbFunction, rbffi_PointerClass)->address; + invoker->blocking = RTEST(rb_hash_aref(options, ID2SYM(rb_intern("blocking")))); + +#if defined(X86_WIN32) + rbConventionStr = rb_funcall2(convention, rb_intern("to_s"), 0, NULL); + invoker->abi = (RTEST(convention) && strcmp(StringValueCStr(rbConventionStr), "stdcall") == 0) + ? FFI_STDCALL : FFI_DEFAULT_ABI; +#else + invoker->abi = FFI_DEFAULT_ABI; +#endif + + invoker->rbReturnType = rbffi_Type_Lookup(rbReturnType); + if (!RTEST(invoker->rbReturnType)) { + VALUE typeName = rb_funcall2(rbReturnType, rb_intern("inspect"), 0, NULL); + rb_raise(rb_eTypeError, "Invalid return type (%s)", RSTRING_PTR(typeName)); + } + + Data_Get_Struct(rbReturnType, Type, invoker->returnType); + + invoker->paramCount = -1; + + fixed = rb_ary_new2(RARRAY_LEN(rbParameterTypes) - 1); + for (i = 0; i < RARRAY_LEN(rbParameterTypes); ++i) { + VALUE entry = rb_ary_entry(rbParameterTypes, i); + VALUE rbType = rbffi_Type_Lookup(entry); + Type* type; + + if (!RTEST(rbType)) { + VALUE typeName = rb_funcall2(entry, rb_intern("inspect"), 0, NULL); + rb_raise(rb_eTypeError, "Invalid parameter type (%s)", RSTRING_PTR(typeName)); + } + Data_Get_Struct(rbType, Type, type); + if (type->nativeType != NATIVE_VARARGS) { + rb_ary_push(fixed, entry); + } + } + /* + * @fixed and @type_map are used by the parameter mangling ruby code + */ + rb_iv_set(self, "@fixed", fixed); + rb_iv_set(self, "@type_map", rb_hash_aref(options, ID2SYM(rb_intern("type_map")))); + + return retval; +} + +static VALUE +variadic_invoke(VALUE self, VALUE parameterTypes, VALUE parameterValues) +{ + VariadicInvoker* invoker; + FFIStorage* params; + void* retval; + ffi_cif cif; + void** ffiValues; + ffi_type** ffiParamTypes; + ffi_type* ffiReturnType; + Type** paramTypes; + VALUE* argv; + VALUE* callbackParameters; + int paramCount = 0, fixedCount = 0, callbackCount = 0, i; + ffi_status ffiStatus; + rbffi_frame_t frame = { 0 }; + + Check_Type(parameterTypes, T_ARRAY); + Check_Type(parameterValues, T_ARRAY); + + Data_Get_Struct(self, VariadicInvoker, invoker); + paramCount = (int) RARRAY_LEN(parameterTypes); + paramTypes = ALLOCA_N(Type *, paramCount); + ffiParamTypes = ALLOCA_N(ffi_type *, paramCount); + params = ALLOCA_N(FFIStorage, paramCount); + ffiValues = ALLOCA_N(void*, paramCount); + argv = ALLOCA_N(VALUE, paramCount); + callbackParameters = ALLOCA_N(VALUE, paramCount); + retval = alloca(MAX(invoker->returnType->ffiType->size, FFI_SIZEOF_ARG)); + + for (i = 0; i < paramCount; ++i) { + VALUE rbType = rb_ary_entry(parameterTypes, i); + + if (!rb_obj_is_kind_of(rbType, rbffi_TypeClass)) { + rb_raise(rb_eTypeError, "wrong type. Expected (FFI::Type)"); + } + Data_Get_Struct(rbType, Type, paramTypes[i]); + + switch (paramTypes[i]->nativeType) { + case NATIVE_INT8: + case NATIVE_INT16: + case NATIVE_INT32: + rbType = rb_const_get(rbffi_TypeClass, rb_intern("INT32")); + Data_Get_Struct(rbType, Type, paramTypes[i]); + break; + case NATIVE_UINT8: + case NATIVE_UINT16: + case NATIVE_UINT32: + rbType = rb_const_get(rbffi_TypeClass, rb_intern("UINT32")); + Data_Get_Struct(rbType, Type, paramTypes[i]); + break; + + case NATIVE_FLOAT32: + rbType = rb_const_get(rbffi_TypeClass, rb_intern("DOUBLE")); + Data_Get_Struct(rbType, Type, paramTypes[i]); + break; + + case NATIVE_FUNCTION: + if (!rb_obj_is_kind_of(rbType, rbffi_FunctionTypeClass)) { + VALUE typeName = rb_funcall2(rbType, rb_intern("inspect"), 0, NULL); + rb_raise(rb_eTypeError, "Incorrect parameter type (%s)", RSTRING_PTR(typeName)); + } + callbackParameters[callbackCount++] = rbType; + break; + + default: + break; + } + + + ffiParamTypes[i] = paramTypes[i]->ffiType; + if (ffiParamTypes[i] == NULL) { + rb_raise(rb_eArgError, "Invalid parameter type #%x", paramTypes[i]->nativeType); + } + argv[i] = rb_ary_entry(parameterValues, i); + } + + ffiReturnType = invoker->returnType->ffiType; + if (ffiReturnType == NULL) { + rb_raise(rb_eArgError, "Invalid return type"); + } + + /*Get the number of fixed args from @fixed array*/ + fixedCount = RARRAY_LEN(rb_iv_get(self, "@fixed")); + +#ifdef HAVE_FFI_PREP_CIF_VAR + ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, fixedCount, paramCount, ffiReturnType, ffiParamTypes); +#else + ffiStatus = ffi_prep_cif(&cif, invoker->abi, paramCount, ffiReturnType, ffiParamTypes); +#endif + switch (ffiStatus) { + case FFI_BAD_ABI: + rb_raise(rb_eArgError, "Invalid ABI specified"); + case FFI_BAD_TYPEDEF: + rb_raise(rb_eArgError, "Invalid argument type specified"); + case FFI_OK: + break; + default: + rb_raise(rb_eArgError, "Unknown FFI error"); + } + + rbffi_SetupCallParams(paramCount, argv, -1, paramTypes, params, + ffiValues, callbackParameters, callbackCount, invoker->rbEnums); + + rbffi_frame_push(&frame); + + if(unlikely(invoker->blocking)) { + rbffi_blocking_call_t* bc; + bc = ALLOCA_N(rbffi_blocking_call_t, 1); + bc->retval = retval; + bc->function = invoker->function; + bc->ffiValues = ffiValues; + bc->params = params; + bc->frame = &frame; + bc->cif = cif; + + rb_rescue2(rbffi_do_blocking_call, (VALUE) bc, rbffi_save_frame_exception, (VALUE) &frame, rb_eException, (VALUE) 0); + } else { + ffi_call(&cif, FFI_FN(invoker->function), retval, ffiValues); + } + + rbffi_frame_pop(&frame); + + rbffi_save_errno(); + + if (RTEST(frame.exc) && frame.exc != Qnil) { + rb_exc_raise(frame.exc); + } + + return rbffi_NativeValue_ToRuby(invoker->returnType, invoker->rbReturnType, retval); +} + + +void +rbffi_Variadic_Init(VALUE moduleFFI) +{ + classVariadicInvoker = rb_define_class_under(moduleFFI, "VariadicInvoker", rb_cObject); + rb_global_variable(&classVariadicInvoker); + + rb_define_alloc_func(classVariadicInvoker, variadic_allocate); + + rb_define_method(classVariadicInvoker, "initialize", variadic_initialize, 4); + rb_define_method(classVariadicInvoker, "invoke", variadic_invoke, 2); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.o new file mode 100644 index 0000000..2ed4f9a Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Variadic.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/compat.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/compat.h new file mode 100644 index 0000000..3f7bbae --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/compat.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_COMPAT_H +#define RBFFI_COMPAT_H + +#include + +#ifndef RARRAY_LEN +# define RARRAY_LEN(ary) RARRAY(ary)->len +#endif + +#ifndef RARRAY_PTR +# define RARRAY_PTR(ary) RARRAY(ary)->ptr +#endif + +#ifndef RSTRING_LEN +# define RSTRING_LEN(s) RSTRING(s)->len +#endif + +#ifndef RSTRING_PTR +# define RSTRING_PTR(s) RSTRING(s)->ptr +#endif + +#ifndef NUM2ULL +# define NUM2ULL(x) rb_num2ull((VALUE)x) +#endif + +#ifndef roundup +# define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#endif + +#ifdef __GNUC__ +# define likely(x) __builtin_expect((x), 1) +# define unlikely(x) __builtin_expect((x), 0) +#else +# define likely(x) (x) +# define unlikely(x) (x) +#endif + +#ifdef _MSC_VER +#define ffi_type_longdouble ffi_type_double +#endif + +#ifndef MAX +# define MAX(a, b) ((a) < (b) ? (b) : (a)) +#endif +#ifndef MIN +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef RB_GC_GUARD +# define RB_GC_GUARD(x) (x) +#endif + +#endif /* RBFFI_COMPAT_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.h new file mode 100644 index 0000000..a2e81a1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.h @@ -0,0 +1,7 @@ +#ifndef EXTCONF_H +#define EXTCONF_H +#define HAVE_FFI_PREP_CIF_VAR 1 +#define HAVE_FFI_RAW_CALL 1 +#define HAVE_FFI_PREP_RAW_CLOSURE 1 +#define HAVE_RAW_API 1 +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.rb new file mode 100644 index 0000000..720fb06 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/extconf.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby + +if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' + require 'mkmf' + require 'rbconfig' + + def system_libffi_usable? + # We need pkg_config or ffi.h + libffi_ok = pkg_config("libffi") || + have_header("ffi.h") || + find_header("ffi.h", "/usr/local/include", "/usr/include/ffi", + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") || + (find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false) + + # Ensure we can link to ffi_prep_closure_loc + libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) || + have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) || + have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ]) + + if RbConfig::CONFIG['host_os'] =~ /mswin/ + have_library('libffi_convenience') + have_library('shlwapi') + end + + libffi_ok + end + + dir_config("ffi_c") + + # recent versions of ruby add restrictive ansi and warning flags on a whim - kill them all + $warnflags = '' + $CFLAGS.gsub!(/[\s+]-ansi/, '') + $CFLAGS.gsub!(/[\s+]-std=[^\s]+/, '') + # solaris 10 needs -c99 for + $CFLAGS << " -std=c99" if RbConfig::CONFIG['host_os'] =~ /solaris(!?2\.11)/ + + # Check whether we use system libffi + system_libffi = enable_config('system-libffi', :try) + + if system_libffi == :try + system_libffi = ENV['RUBY_CC_VERSION'].nil? && system_libffi_usable? + elsif system_libffi + abort "system libffi is not usable" unless system_libffi_usable? + end + + if system_libffi + have_func('ffi_prep_cif_var') + $defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure") + else + $defs << "-DHAVE_FFI_PREP_CIF_VAR" + $defs << "-DUSE_INTERNAL_LIBFFI" + + # Ensure libffi symbols aren't exported when using static libffi. + # This is to avoid interference with other gems like fiddle. + # See https://github.com/ffi/ffi/issues/835 + append_ldflags "-Wl,--exclude-libs,ALL" + end + + # Some linux archs need explicit linking to pthread, see https://github.com/ffi/ffi/issues/893 + append_ldflags "-pthread" + + ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm|aarch64/i + if enable_config('libffi-alloc', ffi_alloc_default) + $defs << "-DUSE_FFI_ALLOC" + end + + $defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works + + create_header + create_makefile("ffi_c") + + unless system_libffi + File.open("Makefile", "a") do |mf| + mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias") + if RbConfig::CONFIG['host_os'] =~ /darwin/i + if RbConfig::CONFIG['host'] =~ /arm|aarch64/i + mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}" + end + mf.puts "include ${srcdir}/libffi.darwin.mk" + elsif RbConfig::CONFIG['host_os'] =~ /bsd/i + mf.puts '.include "${srcdir}/libffi.bsd.mk"' + elsif RbConfig::CONFIG['host_os'] =~ /mswin64/i + mf.puts '!include $(srcdir)/libffi.vc64.mk' + elsif RbConfig::CONFIG['host_os'] =~ /mswin32/i + mf.puts '!include $(srcdir)/libffi.vc.mk' + else + mf.puts "include ${srcdir}/libffi.mk" + end + end + end + +else + File.open("Makefile", "w") do |mf| + mf.puts "# Dummy makefile for non-mri rubies" + mf.puts "all install::\n" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.c new file mode 100644 index 0000000..22ea3bf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * Copyright (C) 2009 Luc Heinrich + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include + +#include "rbffi.h" +#include "AbstractMemory.h" +#include "Pointer.h" +#include "MemoryPointer.h" +#include "Struct.h" +#include "StructByValue.h" +#include "DynamicLibrary.h" +#include "Platform.h" +#include "Types.h" +#include "LastError.h" +#include "Function.h" +#include "ClosurePool.h" +#include "MethodHandle.h" +#include "Call.h" +#include "ArrayType.h" +#include "MappedType.h" + +void Init_ffi_c(void); + +VALUE rbffi_FFIModule = Qnil; + +static VALUE moduleFFI = Qnil; + +void +Init_ffi_c(void) +{ + /* + * Document-module: FFI + * + * This module embbed type constants from {FFI::NativeType}. + */ + rbffi_FFIModule = moduleFFI = rb_define_module("FFI"); + rb_global_variable(&rbffi_FFIModule); + + rbffi_Thread_Init(rbffi_FFIModule); + + /* FFI::Type needs to be initialized before most other classes */ + rbffi_Type_Init(moduleFFI); + + rbffi_ArrayType_Init(moduleFFI); + rbffi_LastError_Init(moduleFFI); + rbffi_Call_Init(moduleFFI); + rbffi_ClosurePool_Init(moduleFFI); + rbffi_MethodHandle_Init(moduleFFI); + rbffi_Platform_Init(moduleFFI); + rbffi_AbstractMemory_Init(moduleFFI); + rbffi_Pointer_Init(moduleFFI); + rbffi_Function_Init(moduleFFI); + rbffi_MemoryPointer_Init(moduleFFI); + rbffi_Buffer_Init(moduleFFI); + rbffi_StructByValue_Init(moduleFFI); + rbffi_Struct_Init(moduleFFI); + rbffi_DynamicLibrary_Init(moduleFFI); + rbffi_Variadic_Init(moduleFFI); + rbffi_Types_Init(moduleFFI); + rbffi_MappedType_Init(moduleFFI); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.o b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.o new file mode 100644 index 0000000..04b386e Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi.o differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi_c.so b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi_c.so new file mode 100755 index 0000000..9347d1f Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/ffi_c.so differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.bsd.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.bsd.mk new file mode 100644 index 0000000..ab66256 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.bsd.mk @@ -0,0 +1,40 @@ +# -*- makefile -*- +# +# Makefile for BSD systems +# + +LOCAL_LIBS += ${LIBFFI} -lpthread + +LIBFFI_CFLAGS = ${FFI_MMAP_EXEC} -pthread +LIBFFI_BUILD_DIR = ${.CURDIR}/libffi-${arch} +INCFLAGS := -I${LIBFFI_BUILD_DIR}/include -I${INCFLAGS} + +.if ${srcdir} == "." + LIBFFI_SRC_DIR := ${.CURDIR}/libffi +.else + LIBFFI_SRC_DIR := ${srcdir}/libffi +.endif + + +LIBFFI = ${LIBFFI_BUILD_DIR}/.libs/libffi_convenience.a +LIBFFI_AUTOGEN = ${LIBFFI_SRC_DIR}/autogen.sh +LIBFFI_CONFIGURE = ${LIBFFI_SRC_DIR}/configure --disable-static \ + --with-pic=yes --disable-dependency-tracking --disable-docs + +$(OBJS): ${LIBFFI} + +$(LIBFFI): + @mkdir -p ${LIBFFI_BUILD_DIR} + @if [ ! -f $(LIBFFI_SRC_DIR)/configure ]; then \ + echo "Running autoreconf for libffi"; \ + cd "$(LIBFFI_SRC_DIR)" && \ + /bin/sh $(LIBFFI_AUTOGEN) > /dev/null; \ + fi + @if [ ! -f ${LIBFFI_BUILD_DIR}/Makefile ]; then \ + echo "Configuring libffi"; \ + cd ${LIBFFI_BUILD_DIR} && \ + /usr/bin/env CC="${CC}" LD="${LD}" CFLAGS="${LIBFFI_CFLAGS}" GREP_OPTIONS="" \ + /bin/sh ${LIBFFI_CONFIGURE} ${LIBFFI_HOST} > /dev/null; \ + fi + @cd ${LIBFFI_BUILD_DIR} && ${MAKE} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.darwin.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.darwin.mk new file mode 100644 index 0000000..893a8e1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.darwin.mk @@ -0,0 +1,105 @@ +# -*- makefile -*- + +include ${srcdir}/libffi.gnu.mk + +CCACHE := $(shell type -p ccache) +BUILD_DIR := $(shell pwd) + +INCFLAGS += -I"$(BUILD_DIR)" + +# Work out which arches we need to compile the lib for +ARCHES := +ARCHFLAGS ?= $(filter -arch %, $(CFLAGS)) + +ifneq ($(findstring -arch ppc,$(ARCHFLAGS)),) + ARCHES += ppc +endif + +ifneq ($(findstring -arch i386,$(ARCHFLAGS)),) + ARCHES += i386 +endif + +ifneq ($(findstring -arch x86_64,$(ARCHFLAGS)),) + ARCHES += x86_64 +endif + +ifeq ($(strip $(ARCHES)),) +LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi-$(arch) +# Just build the one (default) architecture +$(LIBFFI): + @mkdir -p "$(LIBFFI_BUILD_DIR)" "$(@D)" + @if [ ! -f "$(LIBFFI_SRC_DIR)"/configure ]; then \ + echo "Running autoreconf for libffi"; \ + cd "$(LIBFFI_SRC_DIR)" && \ + /bin/sh $(LIBFFI_AUTOGEN) > /dev/null; \ + fi + @if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \ + echo "Configuring libffi"; \ + cd "$(LIBFFI_BUILD_DIR)" && \ + /usr/bin/env CC="$(CC)" LD="$(LD)" CFLAGS="$(LIBFFI_CFLAGS)" GREP_OPTIONS="" \ + /bin/sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \ + fi + cd "$(LIBFFI_BUILD_DIR)" && $(MAKE) + +else +LIBTARGETS = $(foreach arch,$(ARCHES),"$(BUILD_DIR)"/libffi-$(arch)/.libs/libffi_convenience.a) + +# Build a fat binary and assemble +build_ffi = \ + mkdir -p "$(BUILD_DIR)"/libffi-$(1); \ + (if [ ! -f "$(LIBFFI_SRC_DIR)"/configure ]; then \ + echo "Running autoreconf for libffi"; \ + cd "$(LIBFFI_SRC_DIR)" && \ + /bin/sh $(LIBFFI_AUTOGEN) > /dev/null; \ + fi); \ + (if [ ! -f "$(BUILD_DIR)"/libffi-$(1)/Makefile ]; then \ + echo "Configuring libffi for $(1)"; \ + cd "$(BUILD_DIR)"/libffi-$(1) && \ + env CC="$(CCACHE) $(CC)" CFLAGS="-arch $(1) $(LIBFFI_CFLAGS)" LDFLAGS="-arch $(1)" \ + $(LIBFFI_CONFIGURE) --host=$(1)-apple-darwin > /dev/null; \ + fi); \ + $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1) + +target_ffi = "$(BUILD_DIR)"/libffi-$(1)/.libs/libffi_convenience.a:; $(call build_ffi,$(1)) + +# Work out which arches we need to compile the lib for +ifneq ($(findstring ppc,$(ARCHES)),) + $(call target_ffi,ppc) +endif + +ifneq ($(findstring i386,$(ARCHES)),) + $(call target_ffi,i386) +endif + +ifneq ($(findstring x86_64,$(ARCHES)),) + $(call target_ffi,x86_64) +endif + + +$(LIBFFI): $(LIBTARGETS) + # Assemble into a FAT (x86_64, i386, ppc) library + @mkdir -p "$(@D)" + /usr/bin/libtool -static -o $@ \ + $(foreach arch, $(ARCHES),"$(BUILD_DIR)"/libffi-$(arch)/.libs/libffi_convenience.a) + @mkdir -p "$(LIBFFI_BUILD_DIR)"/include + $(RM) "$(LIBFFI_BUILD_DIR)"/include/ffi.h + @( \ + printf "#if defined(__i386__)\n"; \ + printf "#include \"libffi-i386/include/ffi.h\"\n"; \ + printf "#elif defined(__x86_64__)\n"; \ + printf "#include \"libffi-x86_64/include/ffi.h\"\n";\ + printf "#elif defined(__ppc__)\n"; \ + printf "#include \"libffi-ppc/include/ffi.h\"\n";\ + printf "#endif\n";\ + ) > "$(LIBFFI_BUILD_DIR)"/include/ffi.h + @( \ + printf "#if defined(__i386__)\n"; \ + printf "#include \"libffi-i386/include/ffitarget.h\"\n"; \ + printf "#elif defined(__x86_64__)\n"; \ + printf "#include \"libffi-x86_64/include/ffitarget.h\"\n";\ + printf "#elif defined(__ppc__)\n"; \ + printf "#include \"libffi-ppc/include/ffitarget.h\"\n";\ + printf "#endif\n";\ + ) > "$(LIBFFI_BUILD_DIR)"/include/ffitarget.h + +endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.gnu.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.gnu.mk new file mode 100644 index 0000000..473b8fb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.gnu.mk @@ -0,0 +1,32 @@ +# -*- makefile -*- +# +# Common definitions for all systems that use GNU make +# + + +# Tack the extra deps onto the autogenerated variables +LOCAL_LIBS += $(LIBFFI) +BUILD_DIR = $(shell pwd) +LIBFFI_CFLAGS = $(FFI_MMAP_EXEC) +LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi-$(arch) +INCFLAGS := -I"$(LIBFFI_BUILD_DIR)"/include $(INCFLAGS) + +ifeq ($(srcdir),.) + LIBFFI_SRC_DIR := $(shell pwd)/libffi +else ifeq ($(srcdir),..) + LIBFFI_SRC_DIR := $(shell pwd)/../libffi +else + LIBFFI_SRC_DIR := $(realpath $(srcdir)/libffi) +endif + +LIBFFI = "$(LIBFFI_BUILD_DIR)"/.libs/libffi_convenience.a +LIBFFI_AUTOGEN = ${LIBFFI_SRC_DIR}/autogen.sh +LIBFFI_CONFIGURE = "$(LIBFFI_SRC_DIR)"/configure --disable-static \ + --with-pic=yes --disable-dependency-tracking --disable-docs + +$(OBJS): $(LIBFFI) + +# +# libffi.mk or libffi.darwin.mk contains rules for building the actual library +# + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.mk new file mode 100644 index 0000000..3b58227 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.mk @@ -0,0 +1,18 @@ +# -*- makefile -*- + +include ${srcdir}/libffi.gnu.mk + +$(LIBFFI): + @mkdir -p "$(LIBFFI_BUILD_DIR)" "$@(D)" + @if [ ! -f "$(LIBFFI_SRC_DIR)"/configure ]; then \ + echo "Running autoreconf for libffi"; \ + cd "$(LIBFFI_SRC_DIR)" && \ + /bin/sh $(LIBFFI_AUTOGEN) > /dev/null; \ + fi + @if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \ + echo "Configuring libffi"; \ + cd "$(LIBFFI_BUILD_DIR)" && \ + env CFLAGS="$(LIBFFI_CFLAGS)" GREP_OPTIONS="" \ + sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \ + fi + $(MAKE) -C "$(LIBFFI_BUILD_DIR)" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc.mk new file mode 100644 index 0000000..8cd4603 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc.mk @@ -0,0 +1,26 @@ +# -*- makefile -*- +# +# Makefile for msvc +# + +# Tack the extra deps onto the autogenerated variables +INCFLAGS = -I$(LIBFFI_BUILD_DIR)/include -I$(LIBFFI_BUILD_DIR)/src/x86 $(INCFLAGS) +LOCAL_LIBS = $(LOCAL_LIBS) $(LIBFFI) +BUILD_DIR = $(MAKEDIR) +LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi + +!IF "$(srcdir)" == "." +LIBFFI_SRC_DIR = $(MAKEDIR)/libffi +!ELSE +LIBFFI_SRC_DIR = $(srcdir)/libffi +!ENDIF + +LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.lib + +$(OBJS): $(LIBFFI) + +$(LIBFFI): + @$(MAKEDIRS) $(LIBFFI_BUILD_DIR) + @cd $(LIBFFI_BUILD_DIR) && $(MAKE) -f Makefile.vc + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc64.mk b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc64.mk new file mode 100644 index 0000000..6f3dbbc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi.vc64.mk @@ -0,0 +1,26 @@ +# -*- makefile -*- +# +# Makefile for msvc +# + +# Tack the extra deps onto the autogenerated variables +INCFLAGS = -I$(LIBFFI_BUILD_DIR)/include -I$(LIBFFI_BUILD_DIR)/src/x86 $(INCFLAGS) +LOCAL_LIBS = $(LOCAL_LIBS) $(LIBFFI) +BUILD_DIR = $(MAKEDIR) +LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi + +!IF "$(srcdir)" == "." +LIBFFI_SRC_DIR = $(MAKEDIR)/libffi +!ELSE +LIBFFI_SRC_DIR = $(srcdir)/libffi +!ENDIF + +LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.lib + +$(OBJS): $(LIBFFI) + +$(LIBFFI): + @$(MAKEDIRS) $(LIBFFI_BUILD_DIR) + @cd $(LIBFFI_BUILD_DIR) && $(MAKE) -f Makefile.vc64 + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.appveyor.yml b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.appveyor.yml new file mode 100644 index 0000000..ece8a94 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.appveyor.yml @@ -0,0 +1,66 @@ +shallow_clone: true + +# We're currently only testing libffi built with Microsoft's +# tools. +# This matrix should be expanded to include at least: +# 32- and 64-bit gcc/cygwin +# 32- and 64-bit gcc/mingw +# 32- and 64-bit clang/mingw +# and perhaps more. + +image: Visual Studio 2017 +platform: + - x64 + - x86 + - arm + - arm64 + +environment: + global: + CYG_ROOT: C:/cygwin + CYG_CACHE: C:/cygwin/var/cache/setup + CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ + matrix: + - VSVER: 15 + +install: + - ps: >- + If ($env:Platform -Match "x86") { + $env:VCVARS_PLATFORM="x86" + $env:BUILD="i686-pc-cygwin" + $env:HOST="i686-pc-cygwin" + $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh" + $env:SRC_ARCHITECTURE="x86" + } ElseIf ($env:Platform -Match "arm64") { + $env:VCVARS_PLATFORM="x86_arm64" + $env:BUILD="i686-pc-cygwin" + $env:HOST="aarch64-w64-cygwin" + $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm64" + $env:SRC_ARCHITECTURE="aarch64" + } ElseIf ($env:Platform -Match "arm") { + $env:VCVARS_PLATFORM="x86_arm" + $env:BUILD="i686-pc-cygwin" + $env:HOST="arm-w32-cygwin" + $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm" + $env:SRC_ARCHITECTURE="arm" + } Else { + $env:VCVARS_PLATFORM="amd64" + $env:BUILD="x86_64-w64-cygwin" + $env:HOST="x86_64-w64-cygwin" + $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64" + $env:SRC_ARCHITECTURE="x86" + } + - 'appveyor DownloadFile https://cygwin.com/setup-x86.exe -FileName setup.exe' + - 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P dejagnu >NUL' + - '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"' + - echo call VsDevCmd to set VS150COMNTOOLS + - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" + - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS")) + - echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%" + - call "%VSCOMNTOOLS%..\..\vc\Auxiliary\Build\vcvarsall.bat" %VCVARS_PLATFORM% + +build_script: + - c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./autogen.sh;)" + - c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./configure CC='%MSVCC%' CXX='%MSVCC%' LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='/cygdrive/c/projects/libffi/.travis/ar-lib lib' NM='dumpbin -symbols' STRIP=':' --build=$BUILD --host=$HOST;)" + - c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp src/%SRC_ARCHITECTURE%/ffitarget.h include; make; find .;)" + - c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp `find . -name 'libffi-?.dll'` $HOST/testsuite/; make check; cat `find ./ -name libffi.log`)" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitattributes b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitattributes new file mode 100644 index 0000000..f7d3833 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitattributes @@ -0,0 +1,4 @@ +* text=auto + +*.sln text eol=crlf +*.vcxproj* text eol=crlf diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.github/issue_template.md b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.github/issue_template.md new file mode 100644 index 0000000..e197e2c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.github/issue_template.md @@ -0,0 +1,10 @@ +## System Details + + + + +## Problems Description + + + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitignore b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitignore new file mode 100644 index 0000000..5d39689 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.gitignore @@ -0,0 +1,38 @@ +.libs +.deps +*.o +*.lo +.dirstamp +*.la +Makefile +!testsuite/libffi.bhaible/Makefile +Makefile.in +aclocal.m4 +compile +!.travis/compile +configure +depcomp +doc/libffi.info +*~ +fficonfig.h.in +fficonfig.h +include/ffi.h +include/ffitarget.h +install-sh +libffi.pc +libtool +libtool-ldflags +ltmain.sh +m4/libtool.m4 +m4/lt*.m4 +mdate-sh +missing +stamp-h1 +libffi*gz +autom4te.cache +libffi.xcodeproj/xcuserdata +libffi.xcodeproj/project.xcworkspace +build_*/ +darwin_*/ +src/arm/trampoline.S +**/texinfo.tex diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis.yml new file mode 100644 index 0000000..8db2ddf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis.yml @@ -0,0 +1,83 @@ +--- +sudo: required + +language: cpp + +# For qemu-powered targets, get the list of supported processors from +# travis by setting QEMU_CPU=help, then set -mcpu= for the compilers +# accordingly. + +matrix: + include: + - os: linux + env: HOST=powerpc-eabisim RUNTESTFLAGS="--target_board powerpc-eabisim" DEJAGNU="/opt/.travis/site.exp" + - os: linux + env: HOST=or1k-elf RUNTESTFLAGS="--target_board or1k-sim" DEJAGNU="/opt/.travis/site.exp" + - os: linux + env: HOST=m32r-elf RUNTESTFLAGS="--target_board m32r-sim" DEJAGNU="/opt/.travis/site.exp" + - os: linux + env: HOST=bfin-elf RUNTESTFLAGS="--target_board bfin-sim" DEJAGNU="/opt/.travis/site.exp" +# This configuration is still using the native x86 toolchain? +# - os: osx +# env: HOST=aarch64-apple-darwin13 + - os: osx + env: HOST=x86_64-apple-darwin10 + - os: linux + env: HOST=x86_64-w64-mingw32 MEVAL='export CC="x86_64-w64-mingw32-gcc" && CXX="x86_64-w64-mingw32-g++" RUNTESTFLAGS="--target_board wine-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp" CONFIGURE_OPTIONS=--disable-shared LIBFFI_TEST_OPTIMIZATION="-O2" + - os: linux + env: HOST=sh4-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu + - os: linux + env: HOST=alpha-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/alpha-linux-gnu + - os: linux + env: HOST=m68k-linux-gnu MEVAL='export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" && CXX="m68k-linux-gnu-g++-8 -mcpu=547x"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/m68k-linux-gnu QEMU_CPU=cfv4e + - os: linux + arch: s390x + env: HOST=s390x-linux-gnu + - os: linux + arch: ppc64le + env: HOST=ppc64le-linux-gnu + - os: linux + arch: arm64 + env: HOST=aarch64-linux-gnu + - os: linux + arch: arm64 + env: HOST=aarch64-linux-gnu + compiler: clang + - os: linux + env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O0" + - os: linux + env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2" + - os: linux + env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2 -fomit-frame-pointer" +# The sparc64 linux system in the GCC compile farm is non-responsive. +# - os: linux +# env: HOST=sparc64-linux-gnu +# The mips64 linux system in the GCC compile farm is not allowing logins +# - os: linux +# env: HOST=mips64el-linux-gnu + - os: linux + compiler: gcc + env: HOST=i386-pc-linux-gnu MEVAL='export CC="$CC -m32" && CXX="$CXX -m32"' + - os: linux + compiler: gcc + - os: linux + compiler: gcc + env: CONFIGURE_OPTIONS=--disable-shared + - os: linux + compiler: clang + - os: linux + compiler: clang + env: CONFIGURE_OPTIONS=--disable-shared + - os: linux + env: HOST=moxie-elf MEVAL='export PATH=/opt/moxielogic/bin:$PATH && CC=moxie-elf-gcc && CXX=moxie-elf-g++' LDFLAGS=-Tsim.ld RUNTESTFLAGS="--target_board moxie-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp" + +before_install: + - if test x"$MEVAL" != x; then eval ${MEVAL}; fi + +install: + - travis_wait 30 ./.travis/install.sh + +script: + - if ! test x"$MEVAL" = x; then eval ${MEVAL}; fi + - travis_wait 115 sleep infinity & + - ./.travis/build.sh diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/ar-lib b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/ar-lib new file mode 100755 index 0000000..0baa4f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/ar-lib @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2018 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat < libffi.log + + ./rlgl l --key=${RLGL_KEY} https://rl.gl + ID=$(./rlgl start) + ./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git libffi.log + exit $? +} + +function build_linux() +{ + ./autogen.sh + ./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS} || cat */config.log + make + make dist + make check RUNTESTFLAGS="-a $RUNTESTFLAGS" + + ./rlgl l --key=${RLGL_KEY} https://rl.gl + ID=$(./rlgl start) + ./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log + exit $? +} + +function build_foreign_linux() +{ + ${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh + + ./rlgl l --key=${RLGL_KEY} https://rl.gl + ID=$(./rlgl start) + ./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log + exit $? +} + +function build_cross_linux() +{ + ${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e HOST="${HOST}" -e CC="${HOST}-gcc-8 ${GCC_OPTIONS}" -e CXX="${HOST}-g++-8 ${GCC_OPTIONS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" moxielogic/cross-ci-build-container:latest bash -c /opt/.travis/build-in-container.sh + + ./rlgl l --key=${RLGL_KEY} https://rl.gl + ID=$(./rlgl start) + ./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log + exit $? +} + +function build_cross() +{ + ${DOCKER} pull quay.io/moxielogic/libffi-ci-${HOST} + ${DOCKER} run --rm -t -i -v $(pwd):/opt -e HOST="${HOST}" -e CC="${HOST}-gcc ${GCC_OPTIONS}" -e CXX="${HOST}-g++ ${GCC_OPTIONS}" -e TRAVIS_BUILD_DIR=/opt -e DEJAGNU="${DEJAGNU}" -e RUNTESTFLAGS="${RUNTESTFLAGS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/libffi-ci-${HOST} bash -c /opt/.travis/build-cross-in-container.sh + + ./rlgl l --key=${RLGL_KEY} https://rl.gl + ID=$(./rlgl start) + ./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log + exit $? +} + +function build_ios() +{ + which python +# export PYTHON_BIN=/usr/local/bin/python + ./generate-darwin-source-and-headers.py --only-ios + xcodebuild -showsdks + xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos11.4 + exit $? +} + +function build_macosx() +{ + which python +# export PYTHON_BIN=/usr/local/bin/python + ./generate-darwin-source-and-headers.py --only-osx + xcodebuild -showsdks + xcodebuild -project libffi.xcodeproj -target "libffi-Mac" -configuration Release -sdk macosx10.13 + echo "Finished build" + exit $? +} + +case "$HOST" in + arm-apple-darwin*) + ./autogen.sh + build_ios + ;; + x86_64-apple-darwin*) + ./autogen.sh + build_macosx + ;; + arm32v7-linux-gnu) + ./autogen.sh + build_foreign_linux arm moxielogic/arm32v7-ci-build-container:latest + ;; + mips64el-linux-gnu | sparc64-linux-gnu) + build_cfarm + ;; + bfin-elf ) + ./autogen.sh + GCC_OPTIONS=-msim build_cross + ;; + m32r-elf ) + ./autogen.sh + build_cross + ;; + or1k-elf ) + ./autogen.sh + build_cross + ;; + powerpc-eabisim ) + ./autogen.sh + build_cross + ;; + m68k-linux-gnu ) + ./autogen.sh + GCC_OPTIONS=-mcpu=547x build_cross_linux + ;; + alpha-linux-gnu | sh4-linux-gnu ) + ./autogen.sh + build_cross_linux + ;; + *) + ./autogen.sh + build_linux + ;; +esac diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/compile b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/compile new file mode 100755 index 0000000..655932a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/compile @@ -0,0 +1,351 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-27.18; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -warn) + eat=1 + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/install.sh b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/install.sh new file mode 100755 index 0000000..2420245 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/install.sh @@ -0,0 +1,71 @@ +#!/bin/bash +set -x + +if [[ $TRAVIS_OS_NAME != 'linux' ]]; then + brew update > brew-update.log 2>&1 + # fix an issue with libtool on travis by reinstalling it + brew uninstall libtool; + brew install libtool dejagnu; + + # Download and extract the rlgl client + wget -qO - https://rl.gl/cli/rlgl-darwin-amd64.tgz | \ + tar --strip-components=2 -xvzf - ./rlgl/rlgl; + +else + # Download and extract the rlgl client + case $HOST in + aarch64-linux-gnu) + wget -qO - https://rl.gl/cli/rlgl-linux-arm.tgz | \ + tar --strip-components=2 -xvzf - ./rlgl/rlgl; + ;; + ppc64le-linux-gnu) + wget -qO - https://rl.gl/cli/rlgl-linux-ppc64le.tgz | \ + tar --strip-components=2 -xvzf - ./rlgl/rlgl; + ;; + s390x-linux-gnu) + wget -qO - https://rl.gl/cli/rlgl-linux-s390x.tgz | \ + tar --strip-components=2 -xvzf - ./rlgl/rlgl; + ;; + *) + wget -qO - https://rl.gl/cli/rlgl-linux-amd64.tgz | \ + tar --strip-components=2 -xvzf - ./rlgl/rlgl; + ;; + esac + + sudo apt-get clean # clear the cache + sudo apt-get update + case $HOST in + mips64el-linux-gnu | sparc64-linux-gnu) + ;; + alpha-linux-gnu | arm32v7-linux-gnu | m68k-linux-gnu | sh4-linux-gnu) + sudo apt-get install qemu-user-static + ;; + hppa-linux-gnu ) + sudo apt-get install -y qemu-user-static g++-5-hppa-linux-gnu + ;; + i386-pc-linux-gnu) + sudo apt-get install gcc-multilib g++-multilib; + ;; + moxie-elf) + echo 'deb https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list + sudo apt-get clean # clear the cache + sudo apt-get update ## -qq + sudo apt-get update + sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim + ;; + x86_64-w64-mingw32) + sudo apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wine; + ;; + i686-w32-mingw32) + sudo apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 wine; + ;; + esac + case $HOST in + arm32v7-linux-gnu) + # don't install host tools + ;; + *) + sudo apt-get install dejagnu texinfo sharutils + ;; + esac +fi diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/m32r-sim.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/m32r-sim.exp new file mode 100644 index 0000000..c18123f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/m32r-sim.exp @@ -0,0 +1,58 @@ +# Copyright (C) 2010, 2019 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {m32r-elf} + +# Load the generic configuration for this board. This will define a basic set +# of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +# basic-sim.exp is a basic description for the standard Cygnus simulator. +load_base_board_description "basic-sim" + +# "m32r" is the name of the sim subdir in devo/sim. +setup_sim m32r + +# No multilib options needed by default. +process_multilib_options "" + +# We only support newlib on this target. We assume that all multilib +# options have been specified before we get here. + +set_board_info compiler "[find_gcc]" +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" + +# Configuration settings for testsuites +set_board_info noargs 1 +set_board_info gdb,nosignals 1 +set_board_info gdb,noresults 1 +set_board_info gdb,cannot_call_functions 1 +set_board_info gdb,skip_float_tests 1 +set_board_info gdb,can_reverse 1 +set_board_info gdb,use_precord 1 + +# More time is needed +set_board_info gcc,timeout 800 +set_board_info gdb,timeout 60 + +# Used by a few gcc.c-torture testcases to delimit how large the stack can +# be. +set_board_info gcc,stack_size 5000 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/moxie-sim.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/moxie-sim.exp new file mode 100644 index 0000000..32979ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/moxie-sim.exp @@ -0,0 +1,60 @@ +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {moxie-elf} + +# Load the generic configuration for this board. This will define a basic set +# of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +# basic-sim.exp is a basic description for the standard Cygnus simulator. +load_base_board_description "basic-sim" + +# "moxie" is the name of the sim subdir in devo/sim. +setup_sim moxie + +# No multilib options needed by default. +process_multilib_options "" + +# We only support newlib on this target. We assume that all multilib +# options have been specified before we get here. + +set_board_info compiler "[find_gcc]" +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" +# No linker script needed. +set_board_info ldscript "-Tsim.ld" + +# Configuration settings for testsuites +set_board_info noargs 1 +set_board_info gdb,nosignals 1 +set_board_info gdb,noresults 1 +set_board_info gdb,cannot_call_functions 1 +set_board_info gdb,skip_float_tests 1 +set_board_info gdb,can_reverse 1 +set_board_info gdb,use_precord 1 + +# More time is needed +set_board_info gcc,timeout 800 +set_board_info gdb,timeout 60 + +# Used by a few gcc.c-torture testcases to delimit how large the stack can +# be. +set_board_info gcc,stack_size 5000 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/or1k-sim.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/or1k-sim.exp new file mode 100644 index 0000000..3920413 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/or1k-sim.exp @@ -0,0 +1,58 @@ +# Copyright (C) 2010, 2019 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {or1k-elf} + +# Load the generic configuration for this board. This will define a basic set +# of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +# basic-sim.exp is a basic description for the standard Cygnus simulator. +load_base_board_description "basic-sim" + +# "or1k" is the name of the sim subdir in devo/sim. +setup_sim or1k + +# No multilib options needed by default. +process_multilib_options "" + +# We only support newlib on this target. We assume that all multilib +# options have been specified before we get here. + +set_board_info compiler "[find_gcc]" +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" + +# Configuration settings for testsuites +set_board_info noargs 1 +set_board_info gdb,nosignals 1 +set_board_info gdb,noresults 1 +set_board_info gdb,cannot_call_functions 1 +set_board_info gdb,skip_float_tests 1 +set_board_info gdb,can_reverse 1 +set_board_info gdb,use_precord 1 + +# More time is needed +set_board_info gcc,timeout 800 +set_board_info gdb,timeout 60 + +# Used by a few gcc.c-torture testcases to delimit how large the stack can +# be. +set_board_info gcc,stack_size 5000 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp new file mode 100644 index 0000000..285fd4f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp @@ -0,0 +1,58 @@ +# Copyright (C) 2010, 2019 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {powerpc-eabisim} + +# Load the generic configuration for this board. This will define a basic set +# of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +# basic-sim.exp is a basic description for the standard Cygnus simulator. +load_base_board_description "basic-sim" + +# "powerpc" is the name of the sim subdir in devo/sim. +setup_sim powerpc + +# No multilib options needed by default. +process_multilib_options "" + +# We only support newlib on this target. We assume that all multilib +# options have been specified before we get here. + +set_board_info compiler "[find_gcc]" +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" + +# Configuration settings for testsuites +set_board_info noargs 1 +set_board_info gdb,nosignals 1 +set_board_info gdb,noresults 1 +set_board_info gdb,cannot_call_functions 1 +set_board_info gdb,skip_float_tests 1 +set_board_info gdb,can_reverse 1 +set_board_info gdb,use_precord 1 + +# More time is needed +set_board_info gcc,timeout 800 +set_board_info gdb,timeout 60 + +# Used by a few gcc.c-torture testcases to delimit how large the stack can +# be. +set_board_info gcc,stack_size 5000 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/site.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/site.exp new file mode 100644 index 0000000..644ec63 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/site.exp @@ -0,0 +1,27 @@ +# Copyright (C) 2008, 2010, 2018, 2019 Anthony Green + +# Make sure we look in the right place for the board description files. +if ![info exists boards_dir] { + set boards_dir {} +} + +lappend boards_dir $::env(TRAVIS_BUILD_DIR)/.travis + +verbose "Global Config File: target_triplet is $target_triplet" 2 +global target_list + +case "$target_triplet" in { + { "bfin-elf" } { + set target_list "bfin-sim" + } + { "m32r-elf" } { + set target_list "m32r-sim" + } + { "moxie-elf" } { + set target_list "moxie-sim" + } + { "or1k-elf" } { + set target_list "or1k-sim" + } +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/wine-sim.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/wine-sim.exp new file mode 100644 index 0000000..1ad6038 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/wine-sim.exp @@ -0,0 +1,55 @@ +# Copyright (C) 2010, 2019 Free Software Foundation, Inc. +# +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA. + +# This is a list of toolchains that are supported on this board. +set_board_info target_install {i686-w64-mingw32} + +# Load the generic configuration for this board. This will define a basic set +# of routines needed by the tool to communicate with the board. +load_generic_config "sim" + +set_board_info sim "wineconsole --backend=curses" +set_board_info is_simulator 1 + +# No multilib options needed by default. +process_multilib_options "" + +# We only support newlib on this target. We assume that all multilib +# options have been specified before we get here. + +set_board_info compiler "[find_gcc]" +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" + +# Configuration settings for testsuites +set_board_info noargs 1 +set_board_info gdb,nosignals 1 +set_board_info gdb,noresults 1 +set_board_info gdb,cannot_call_functions 1 +set_board_info gdb,skip_float_tests 1 +set_board_info gdb,can_reverse 1 +set_board_info gdb,use_precord 1 + +# More time is needed +set_board_info gcc,timeout 800 +set_board_info gdb,timeout 60 + +# Used by a few gcc.c-torture testcases to delimit how large the stack can +# be. +set_board_info gcc,stack_size 5000 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/ChangeLog.old b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/ChangeLog.old new file mode 100644 index 0000000..8de1ca7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/ChangeLog.old @@ -0,0 +1,7407 @@ +Libffi change logs used to be maintained in separate ChangeLog files. +These days we generate them directly from the git commit messages. +The old ChangeLog files are saved here in order to maintain the historical +record. + +============================================================================= +From the old ChangeLog.libffi-3.1 file... + +2014-03-16 Josh Triplett + + * ChangeLog: Archive to ChangeLog.libffi-3.1 and delete. Future + changelogs will come from git, with autogenerated snapshots shipped in + distributed tarballs. + +2014-03-16 Josh Triplett + + Add support for stdcall, thiscall, and fastcall on non-Windows + x86-32. + + Linux supports the stdcall calling convention, either via + functions explicitly declared with the stdcall attribute, or via + code compiled with -mrtd which effectively makes stdcall the + default. + + This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on + non-Windows x86-32 platforms, as non-default calling conventions. + + * Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32. + * src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and + FFI_FASTCALL on non-Windows x86-32. Increase trampoline size to + accomodate these calling conventions, and unify some ifdeffery. + * src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and + FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery. + * src/x86/win32.S: Support compiling on non-Windows x86-32 + platforms. On those platforms, avoid redefining the SYSV symbols + already provided by src/x86/sysv.S. + * testsuite/libffi.call/closure_stdcall.c: Run on non-Windows. + #define __stdcall if needed. + * testsuite/libffi.call/closure_thiscall.c: Run on non-Windows. + #define __fastcall if needed. + * testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows. + * testsuite/libffi.call/fastthis2_win32.c: Ditto. + * testsuite/libffi.call/fastthis3_win32.c: Ditto. + * testsuite/libffi.call/many2_win32.c: Ditto. + * testsuite/libffi.call/many_win32.c: Ditto. + * testsuite/libffi.call/strlen2_win32.c: Ditto. + * testsuite/libffi.call/strlen_win32.c: Ditto. + * testsuite/libffi.call/struct1_win32.c: Ditto. + * testsuite/libffi.call/struct2_win32.c: Ditto. + +2014-03-16 Josh Triplett + + * prep_cif.c: Remove unnecessary ifdef for X86_WIN32. + ffi_prep_cif_core had a special case for X86_WIN32, checking for + FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI + range before returning FFI_BAD_ABI. However, on X86_WIN32, + FFI_THISCALL already falls in that range, making the special case + unnecessary. Remove it. + +2014-03-16 Josh Triplett + + * testsuite/libffi.call/closure_stdcall.c, + testsuite/libffi.call/closure_thiscall.c: Remove fragile stack + pointer checks. These files included inline assembly to save the + stack pointer before and after the call, and compare the values. + However, compilers can and do leave the stack in different states + for these two pieces of inline assembly, such as by saving a + temporary value on the stack across the call; observed with gcc + -Os, and verified as spurious through careful inspection of + disassembly. + +2014-03-16 Josh Triplett + + * testsuite/libffi.call/many.c: Avoid spurious failure due to + excess floating-point precision. + * testsuite/libffi.call/many_win32.c: Ditto. + +2014-03-16 Josh Triplett + + * libtool-ldflags: Re-add. + +2014-03-16 Josh Triplett + + * Makefile.in, aclocal.m4, compile, config.guess, config.sub, + configure, depcomp, include/Makefile.in, install-sh, + libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, + m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4, + man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete + autogenerated files from version control. + * .gitignore: Add autogenerated files. + * autogen.sh: New script to generate the autogenerated files. + * README: Document requirement to run autogen.sh when building + directly from version control. + * .travis.yml: Run autogen.sh + +2014-03-14 Anthony Green + + * configure, Makefile.in: Rebuilt. + +2014-03-10 Mike Hommey + + * configure.ac: Allow building for mipsel with Android NDK r8. + * Makefile.am (AM_MAKEFLAGS): Replace double quotes with single + quotes. + +2014-03-10 Landry Breuil + + * configure.ac: Ensure the linker supports @unwind sections in libffi. + +2014-03-01 Anthony Green + + * Makefile.am (EXTRA_DIST): Replace old scripts with + generate-darwin-source-and-headers.py. + * Makefile.in: Rebuilt. + +2014-02-28 Anthony Green + + * Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for + --enable-debug builds. + * Makefile.in: Rebuilt. + +2014-02-28 Makoto Kato + + * src/closures.c: Fix build failure when using clang for Android. + +2014-02-28 Marcin Wojdyr + + * libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead + of -L${libdir}. + +2014-02-28 Paulo Pizarro + + * src/bfin/sysv.S: Calling functions in shared libraries requires + considering the GOT. + +2014-02-28 Josh Triplett + + * src/x86/ffi64.c (classify_argument): Handle case where + FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE. + +2014-02-28 Anthony Green + + * ltmain.sh: Generate with libtool-2.4.2.418. + * m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto. + * configure: Rebuilt. + +2014-02-28 Dominik Vogt + + * configure.ac (AC_ARG_ENABLE struct): Fix typo in help + message. + (AC_ARG_ENABLE raw_api): Ditto. + * configure, fficonfig.h.in: Rebuilt. + +2014-02-28 Will Newton + + * src/arm/sysv.S: Initialize IP register with FP. + +2014-02-28 Yufeng Zhang + + * src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the + main CFA reg; update cfi_rel_offset. + +2014-02-15 Marcus Comstedt + + * src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove + assumption on contents of r11 in closure. + +2014-02-09 Heiher + + * src/mips/n32.S: Fix call floating point va function. + +2014-01-21 Zachary Waldowski + + * src/aarch64/ffi.c: Fix missing semicolons on assertions under + debug mode. + +2013-12-30 Zachary Waldowski + + * .gitignore: Exclude darwin_* generated source and build_* trees. + * src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang + previous prototype warnings. + * src/arm/ffi.c: Prevent NULL dereference, fix short type warning + * src/dlmalloc.c: Fix warnings from set_segment_flags return type, + and the native use of size_t for malloc on platforms + * src/arm/sysv.S: Use unified syntax. Clang clean-ups for + ARM_FUNC_START. + * generate-osx-source-and-headers.py: Remove. + * build-ios.sh: Remove. + * libffi.xcodeproj/project.pbxproj: Rebuild targets. Include + x86_64+aarch64 pieces in library. Export headers properly. + * src/x86/ffi64.c: More Clang warning clean-ups. + * src/closures.c (open_temp_exec_file_dir): Use size_t. + * src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result. + * src/aarch64/sysv.S: Use CNAME for global symbols. Only use + .size for ELF targets. + * src/aarch64/ffi.c: Clean up for double == long double. Clean up + from Clang warnings. Use Clang cache invalidation builtin. Use + size_t in place of unsigned in many places. Accommodate for + differences in Apple AArch64 ABI. + +2013-12-02 Daniel Rodríguez Troitiño + + * generate-darwin-source-and-headers.py: Clean up, modernize, + merged version of previous scripts. + +2013-11-21 Anthony Green + + * configure, Makefile.in, include/Makefile.in, include/ffi.h.in, + man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt. + +2013-11-21 Alan Modra + + * Makefile.am (EXTRA_DIST): Add new src/powerpc files. + (nodist_libffi_la_SOURCES ): Likewise. + * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc. + * include/ffi.h.in (ffi_prep_types): Declare. + * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types. + * src/types.c (FFI_NONCONST_TYPEDEF): Define and use for + HAVE_LONG_DOUBLE_VARIANT. + * src/powerpc/ffi_powerpc.h: New file. + * src/powerpc/ffi.c: Split into.. + * src/powerpc/ffi_sysv.c: ..new file, and.. + * src/powerpc/ffi_linux64.c: ..new file, rewriting parts. + * src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI + selection as bits controlling features. + * src/powerpc/linux64.S: For consistency, use POWERPC64 rather + than __powerpc64__. + * src/powerpc/linux64_closure.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. Move .note.FNU-stack + inside guard. + * src/powerpc/sysv.S: Likewise. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * Makefile.in: Regenerate. + +2013-11-20 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use + NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their + 32-bit versions for 64-bit code. + * src/powerpc/linux64_closure.S: Don't use the return value area + as a parameter save area on ELFv2. + +2013-11-18 Iain Sandoe + + * src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding. + * src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase + labels. + +2013-11-18 Anthony Green + + * src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of + function. + * src/arm/ffi.c (ffi_closure_inner): Moderize function declaration + to appease compiler. + Thanks for Gregory P. Smith . + +2013-11-18 Anthony Green + + * README (tested): Mention PowerPC ELFv2. + +2013-11-16 Alan Modra + + * src/powerpc/ppc_closure.S: Move errant #endif to where it belongs. + Don't bl .Luint128. + +2013-11-16 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF + test to select parameter save sizing for ELFv2 vs. ELFv1. + * src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG, + FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define. + (FFI_TRAMPOLINE_SIZE): Define variant for ELFv2. + * src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define. + (discover_homogeneous_aggregate): New function. + (ffi_prep_args64): Adjust start of param save area for ELFv2. + Handle homogenous floating point struct parms. + (ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2. + Handle ELFv2 return values. Set FLAG_ARG_NEEDS_PSAVE. Handle + homogenous floating point structs. + (ffi_call): Increase size of smst_buffer for ELFv2. Handle ELFv2. + (flush_icache): Compile for ELFv2. + (ffi_prep_closure_loc): Set up ELFv2 trampoline. + (ffi_closure_helper_LINUX64): Don't return all structs directly + to caller. Handle homogenous floating point structs. Handle + ELFv2 struct return values. + * src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for + ELFv2. Adjust toc save location. Call function pointer using + r12. Handle FLAG_RETURNS_SMST. Don't predict branches. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2 + for ELFv2. Define ELFv2 versions of STACKFRAME, PARMSAVE, and + RETVAL. Handle possibly missing parameter save area. Handle + ELFv2 return values. + (.note.GNU-stack): Move inside outer #ifdef. + +2013-11-16 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08 + change. Do not consume an int arg when returning a small struct + for FFI_SYSV ABI. + (ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST. + Properly copy bounce buffer to destination. + * src/powerpc/sysv.S: Revert 2013-02-08 change. + * src/powerpc/ppc_closure.S: Remove stray '+'. + +2013-11-16 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters + according to __STRUCT_PARM_ALIGN__. + (ffi_prep_cif_machdep_core): Likewise. + (ffi_closure_helper_LINUX64): Likewise. + +2013-11-16 Alan Modra + + * src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28. + (.note.GNU-stack): Move inside outer #ifdef. + * src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE, + RETVAL): Define and use throughout. + (ffi_closure_LINUX64): Save fprs before buying stack. + (.note.GNU-stack): Move inside outer #ifdef. + +2013-11-16 Alan Modra + + * src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define. + (FFI_EXTRA_CIF_FIELDS): Define. + * src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the + ABI, not to both fpr and param save area. + (ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep. + Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT + code. + (ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions. + (ffi_closure_helper_LINUX64): Pass floating point as per ABI, + not to both fpr and parameter save areas. + + * libffi/testsuite/libffi.call/cls_double_va.c (main): Correct + function cast and don't call ffi_prep_cif. + * libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise. + +2013-11-15 Andrew Haley + + * doc/libffi.texi (Closure Example): Fix the sample code. + * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. + +2013-11-15 Andrew Haley + + * testsuite/libffi.call/va_struct1.c (main): Fix broken test. + * testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise + * testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise. + * testsuite/libffi.call/va_1.c (main): Likewise. + +2013-11-14 David Schneider + + * src/arm/ffi.c: Fix register allocation for mixed float and + doubles. + * testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase + for many mixed float and double arguments. + +2013-11-13 Alan Modra + + * doc/libffi.texi (Simple Example): Correct example code. + * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. + +2013-11-13 Anthony Green + + * include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler + based build. (Thanks to tmr111116 on github) + +2013-11-09 Anthony Green + + * m4/libtool.m4: Refresh. + * configure, Makefile.in: Rebuilt. + * README: Add more notes about next release. + +2013-11-09 Shigeharu TAKENO + + * m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize + UltraSPARC-IIi as ultrasparc3. + +2013-11-06 Mark Kettenis + + * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to + 16-bytes. + +2013-11-06 Konstantin Belousov + + * src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler + source as not requiring executable stack. + +2013-11-02 Anthony Green + + * doc/libffi.texi (The Basics): Clarify return value buffer size + requirements. Also, NULL result buffer pointers are no longer + supported. + * doc/libffi.info: Rebuilt. + +2013-11-02 Mischa Jonker + + * Makefile.am (nodist_libffi_la_SOURCES): Fix build error. + * Makefile.in: Rebuilt. + +2013-11-02 David Schneider + + * src/arm/ffi.c: more robust argument handling for closures on arm hardfloat + * testsuite/libffi.call/many_mixed.c: New file. + * testsuite/libffi.call/cls_many_mixed_args.c: More tests. + +2013-11-02 Vitaly Budovski + + * src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32. + +2013-10-23 Mark H Weaver + + * src/mips/ffi.c: Fix handling of uint32_t arguments on the + MIPS N32 ABI. + +2013-10-13 Sandra Loosemore + + * README: Add Nios II to table of supported platforms. + * Makefile.am (EXTRA_DIST): Add nios2 files. + (nodist_libffi_la_SOURCES): Likewise. + * Makefile.in: Regenerated. + * configure.ac (nios2*-linux*): New host. + (NIOS2): Add AM_CONDITIONAL. + * configure: Regenerated. + * src/nios2/ffi.c: New. + * src/nios2/ffitarget.h: New. + * src/nios2/sysv.S: New. + * src/prep_cif.c (initialize_aggregate): Handle extra structure + alignment via FFI_AGGREGATE_ALIGNMENT. + (ffi_prep_cif_core): Conditionalize structure return for NIOS2. + +2013-10-10 Sandra Loosemore + + * testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn): + Fix uninitialized variable. + +2013-10-11 Marcus Shawcroft + + * testsuite/libffi.call/many.c (many): Replace * with +. + +2013-10-08 Ondřej Bílka + + * src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c, + src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c, + src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c, + src/microblaze/sysv.S, src/powerpc/darwin_closure.S, + src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c, + src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix + spelling errors. + +2013-10-08 Anthony Green + + * aclocal.m4, compile, config.guess, config.sub, depcomp, + install-sh, mdate-sh, missing, texinfo.tex: Update from upstream. + * configure.ac: Update version to 3.0.14-rc0. + * Makefile.in, configure, Makefile.in, include/Makefile.in, + man/Makefile.in, testsuite/Makefile.in: Rebuilt. + * README: Mention M88K and VAX. + +2013-07-15 Miod Vallat + + * Makefile.am, + configure.ac, + src/m88k/ffi.c, + src/m88k/ffitarget.h, + src/m88k/obsd.S, + src/vax/elfbsd.S, + src/vax/ffi.c, + src/vax/ffitarget.h: Add m88k and vax support. + +2013-06-24 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration + before statements. + (ffi_prep_args64): Support little-endian. + (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. + * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise. + +2013-06-12 Mischa Jonker + + * configure.ac: Add support for ARC. + * Makefile.am: Likewise. + * README: Add ARC details. + * src/arc/arcompact.S: New. + * src/arc/ffi.c: Likewise. + * src/arc/ffitarget.h: Likewise. + +2013-03-28 David Schneider + + * src/arm/ffi.c: Fix support for ARM hard-float calling convention. + * src/arm/sysv.S: call different methods for SYSV and VFP ABIs. + * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with + mixed arguments, many doubles. + * testsuite/libffi.call/many_double.c: testcase for calling a function using + more than 8 doubles. + * testcase/libffi.call/many.c: use absolute value to check result against an + epsilon + +2013-03-17 Anthony Green + + * README: Update for 3.0.13. + * configure.ac: Ditto. + * configure: Rebuilt. + * doc/*: Update version. + +2013-03-17 Dave Korn + + * src/closures.c (is_emutramp_enabled + [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside + enclosing #if scope. + +2013-03-17 Anthony Green + + * configure.ac: Only modify toolexecdir in certain cases. + * configure: Rebuilt. + +2013-03-16 Gilles Talis + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use + fparg_count,etc on __NO_FPRS__ targets. + +2013-03-16 Alan Hourihane + + * src/m68k/sysv.S (epilogue): Don't use extb instruction on + m680000 machines. + +2013-03-16 Alex Gaynor + + * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack. + +2013-03-13 Markos Chandras + + * configure.ac: Add support for Imagination Technologies Meta. + * Makefile.am: Likewise. + * README: Add Imagination Technologies Meta details. + * src/metag/ffi.c: New. + * src/metag/ffitarget.h: Likewise. + * src/metag/sysv.S: Likewise. + +2013-02-24 Andreas Schwab + + * doc/libffi.texi (Structures): Fix missing category argument of + @deftp. + +2013-02-11 Anthony Green + + * configure.ac: Update release number to 3.0.12. + * configure: Rebuilt. + * README: Update release info. + +2013-02-10 Anthony Green + + * README: Add Moxie. + * src/moxie/ffi.c: Created. + * src/moxie/eabi.S: Created. + * src/moxie/ffitarget.h: Created. + * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie. + * Makefile.in: Rebuilt. + * configure.ac: Add Moxie. + * configure: Rebuilt. + * testsuite/libffi.call/huge_struct.c: Disable format string + warnings for moxie*-*-elf tests. + +2013-02-10 Anthony Green + + * Makefile.am (LTLDFLAGS): Fix reference. + * Makefile.in: Rebuilt. + +2013-02-10 Anthony Green + + * README: Update supported platforms. Update test results link. + +2013-02-09 Anthony Green + + * testsuite/libffi.call/negint.c: Remove forced -O2. + * testsuite/libffi.call/many2.c (foo): Remove GCCism. + * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition. + + * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong + closure return type fix developed by Martin v. Löwis for cpython + fork. + +2013-02-08 Andreas Tobler + + * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct + support. + * src/powerpc/sysv.S: Ditto. + +2013-02-08 Anthony Green + + * testsuite/libffi.call/cls_longdouble.c: Remove xfail for + arm*-*-*. + +2013-02-08 Anthony Green + + * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC. + +2013-02-08 Matthias Klose + + * man/ffi_prep_cif.3: Clean up for debian linter. + +2013-02-08 Peter Bergner + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed + on the stack. + +2013-02-08 Anthony Green + + * Makefile.am (EXTRA_DIST): Add missing files. + * testsuite/Makefile.am (EXTRA_DIST): Ditto. + * Makefile.in: Rebuilt. + +2013-02-08 Anthony Green + + * configure.ac: Move sparc asm config checks to within functions + for compatibility with sun tools. + * configure: Rebuilt. + * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9 + systems. + * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache + flusher. + +2013-02-08 Nathan Rossi + + * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of + small big-endian structures. + (ffi_prep_args): Ditto. + +2013-02-07 Anthony Green + + * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch + (effectively hiding ffi_call_v8). + +2013-02-07 Anthony Green + + * configure.ac: Update bug reporting address. + * configure.in: Rebuild. + + * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for + Sun compiler. + * src/sparc/ffi.c (ffi_call): Remove warning. + Call ffi_flush_icache for non-GCC builds. + (ffi_prep_closure_loc): Use ffi_flush_icache. + + * Makefile.am (EXTRA_DIST): Add libtool-ldflags. + * Makefile.in: Rebuilt. + * libtool-ldflags: New file. + +2013-02-07 Daniel Schepler + + * configure.ac: Correctly identify x32 systems as 64-bit. + * m4/libtool.m4: Remove libtool expr error. + * aclocal.m4, configure: Rebuilt. + +2013-02-07 Anthony Green + + * configure.ac: Fix GCC usage test. + * configure: Rebuilt. + * README: Mention LLVM/GCC x86_64 issue. + * testsuite/Makefile.in: Rebuilt. + +2013-02-07 Anthony Green + + * testsuite/libffi.call/cls_double_va.c (main): Replace // style + comments with /* */ for xlc compiler. + * testsuite/libffi.call/stret_large.c (main): Ditto. + * testsuite/libffi.call/stret_large2.c (main): Ditto. + * testsuite/libffi.call/nested_struct1.c (main): Ditto. + * testsuite/libffi.call/huge_struct.c (main): Ditto. + * testsuite/libffi.call/float_va.c (main): Ditto. + * testsuite/libffi.call/cls_struct_va1.c (main): Ditto. + * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto. + * testsuite/libffi.call/cls_pointer.c (main): Ditto. + * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto. + +2013-02-06 Anthony Green + + * man/ffi_prep_cif.3: Clean up for debian lintian checker. + +2013-02-06 Anthony Green + + * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits. + * Makefile.in: Rebuild. + +2013-02-02 Mark H Weaver + + * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed + via general purpose registers. + +2013-01-21 Nathan Rossi + + * README: Add MicroBlaze details. + * Makefile.am: Add MicroBlaze support. + * configure.ac: Likewise. + * src/microblaze/ffi.c: New. + * src/microblaze/ffitarget.h: Likewise. + * src/microblaze/sysv.S: Likewise. + +2013-01-21 Nathan Rossi + * testsuite/libffi.call/return_uc.c: Fixed issue. + +2013-01-21 Chris Zankel + + * README: Add Xtensa support. + * Makefile.am: Likewise. + * configure.ac: Likewise. + * Makefile.in Regenerate. + * configure: Likewise. + * src/prep_cif.c: Handle Xtensa. + * src/xtensa: New directory. + * src/xtensa/ffi.c: New file. + * src/xtensa/ffitarget.h: Ditto. + * src/xtensa/sysv.S: Ditto. + +2013-01-11 Anthony Green + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style + comments with /* */ for xlc compiler. + * src/powerpc/aix.S (ffi_call_AIX): Ditto. + * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete + deprecated inline function. + * testsuite/libffi.special/ffitestcxx.h: Ditto. + * README: Add update for AIX support. + +2013-01-11 Anthony Green + + * configure.ac: Robustify pc relative reloc check. + * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI + changing option for 32-bit x86. + * aclocal.m4, configure: Rebuilt. + * README: Update supported target list. + +2013-01-10 Anthony Green + + * README (tested): Add Compiler column to table. + +2013-01-10 Anthony Green + + * src/x86/ffi64.c (struct register_args): Make sse array and array + of unions for sunpro compiler compatibility. + +2013-01-10 Anthony Green + + * configure.ac: Test target platform size_t size. Handle both 32 + and 64-bit builds for x86_64-* and i?86-* targets (allowing for + CFLAG option to change default settings). + * configure, aclocal.m4: Rebuilt. + +2013-01-10 Anthony Green + + * testsuite/libffi.special/special.exp: Only run exception + handling tests when using GNU compiler. + + * m4/ax_compiler_vendor.m4: New file. + * configure.ac: Test for compiler vendor and don't use + AX_CFLAGS_WARN_ALL with the sun compiler. + * aclocal.m4, configure: Rebuilt. + +2013-01-10 Anthony Green + + * include/ffi_common.h: Don't use GCCisms to define types when + building with the SUNPRO compiler. + +2013-01-10 Anthony Green + + * configure.ac: Put local.exp in the right place. + * configure: Rebuilt. + + * src/x86/ffi.c: Update comment about regparm function attributes. + * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires + that all function arguments be passed on the stack (no regparm + support). + +2013-01-08 Anthony Green + + * configure.ac: Generate local.exp. This sets CC_FOR_TARGET + when we are using the vendor compiler. + * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to + ../local.exp. + * configure, testsuite/Makefile.in: Rebuilt. + + * testsuite/libffi.call/call.exp: Run tests with different + options, depending on whether or not we are using gcc or the + vendor compiler. + * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on + whether or not we are building/testing with gcc. + +2013-01-08 Anthony Green + + * configure.ac: Switch x86 solaris target to X86 by default. + * configure: Rebuilt. + +2013-01-08 Anthony Green + + * configure.ac: Fix test for read-only eh_frame. + * configure: Rebuilt. + +2013-01-08 Anthony Green + + * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info + when building with the GNU toolchain. + * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor + compiler. + +2013-01-07 Thorsten Glaser + + * testsuite/libffi.call/cls_uchar_va.c, + testsuite/libffi.call/cls_ushort_va.c, + testsuite/libffi.call/va_1.c: Testsuite fixes. + +2013-01-07 Thorsten Glaser + + * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define. + (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls. + * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto. + +2013-01-04 Anthony Green + + * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions + and -Wall. This is set in the configure script after testing for + GCC. + * Makefile.in: Rebuilt. + +2013-01-02 rofl0r + + * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc + when long double == double. + +2013-01-02 Reini Urban + + * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS + (required for shared libs on cygwin/mingw). + * Makefile.in: Rebuilt. + +2012-10-31 Alan Modra + + * src/powerpc/linux64_closure.S: Add new ABI support. + * src/powerpc/linux64.S: Likewise. + +2012-10-30 Magnus Granberg + Pavel Labushev + + * configure.ac: New options pax_emutramp + * configure, fficonfig.h.in: Regenerated + * src/closures.c: New function emutramp_enabled_check() and + checks. + +2012-10-30 Frederick Cheung + + * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain + lion) and future version. + * configure: Rebuild. + +2012-10-30 James Greenhalgh + Marcus Shawcroft + + * README: Add details of aarch64 port. + * src/aarch64/ffi.c: New. + * src/aarch64/ffitarget.h: Likewise. + * src/aarch64/sysv.S: Likewise. + * Makefile.am: Support aarch64. + * configure.ac: Support aarch64. + * Makefile.in, configure: Rebuilt. + +2012-10-30 James Greenhalgh + Marcus Shawcroft + + * testsuite/lib/libffi.exp: Add support for aarch64. + * testsuite/libffi.call/cls_struct_va1.c: New. + * testsuite/libffi.call/cls_uchar_va.c: Likewise. + * testsuite/libffi.call/cls_uint_va.c: Likewise. + * testsuite/libffi.call/cls_ulong_va.c: Likewise. + * testsuite/libffi.call/cls_ushort_va.c: Likewise. + * testsuite/libffi.call/nested_struct11.c: Likewise. + * testsuite/libffi.call/uninitialized.c: Likewise. + * testsuite/libffi.call/va_1.c: Likewise. + * testsuite/libffi.call/va_struct1.c: Likewise. + * testsuite/libffi.call/va_struct2.c: Likewise. + * testsuite/libffi.call/va_struct3.c: Likewise. + +2012-10-12 Walter Lee + + * Makefile.am: Add TILE-Gx/TILEPro support. + * configure.ac: Likewise. + * Makefile.in: Regenerate. + * configure: Likewise. + * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro. + * src/tile: New directory. + * src/tile/ffi.c: New file. + * src/tile/ffitarget.h: Ditto. + * src/tile/tile.S: Ditto. + +2012-10-12 Matthias Klose + + * generate-osx-source-and-headers.py: Normalize whitespace. + +2012-09-14 David Edelsohn + + * configure: Regenerated. + +2012-08-26 Andrew Pinski + + PR libffi/53014 + * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with + soft-float. + +2012-08-08 Uros Bizjak + + * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, + just return FFI_BAD_ABI when things are wrong. + +2012-07-18 H.J. Lu + + PR libffi/53982 + PR libffi/53973 + * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32. + (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32. + +2012-05-16 H.J. Lu + + * configure: Regenerated. + +2012-05-05 Nicolas Lelong + + * libffi.xcodeproj/project.pbxproj: Fixes. + * README: Update for iOS builds. + +2012-04-23 Alexandre Keunecke I. de Mendonca + + * configure.ac: Add Blackfin/sysv support + * Makefile.am: Add Blackfin/sysv support + * src/bfin/ffi.c: Add Blackfin/sysv support + * src/bfin/ffitarget.h: Add Blackfin/sysv support + +2012-04-11 Anthony Green + + * Makefile.am (EXTRA_DIST): Add new script. + * Makefile.in: Rebuilt. + +2012-04-11 Zachary Waldowski + + * generate-ios-source-and-headers.py, + libffi.xcodeproj/project.pbxproj: Support a Mac static library via + Xcode. Set iOS compatibility to 4.0. Move iOS trampoline + generation into an Xcode "run script" phase. Include both as + Xcode build scripts. Don't always regenerate config files. + +2012-04-10 Anthony Green + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon. + +2012-04-06 Anthony Green + + * Makefile.am (EXTRA_DIST): Add new iOS/xcode files. + * Makefile.in: Rebuilt. + +2012-04-06 Mike Lewis + + * generate-ios-source-and-headers.py: New file. + * libffi.xcodeproj/project.pbxproj: New file. + * README: Update instructions on building iOS binary. + * build-ios.sh: Delete. + +2012-04-06 Anthony Green + + * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU + compilers, then use it. + +2012-04-06 H.J. Lu + + * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32. + +2012-04-06 Anthony Green + + * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases. + * testsuite/Makefile.in: Rebuilt. + +2012-04-05 Zachary Waldowski + + * include/ffi.h.in: Add missing trampoline table fields. + * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references + in CNAME. + * src/x86/ffi.c: Wrap Windows specific code in ifdefs. + +2012-04-02 Peter Bergner + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. + Silence casting pointer to integer of different size warning. + Delete goto to previously deleted label. + (ffi_call): Silence possibly undefined warning. + (ffi_closure_helper_SYSV): Declare variable type. + +2012-04-02 Peter Rosin + + * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return + value in the Intel version as is already done for the AT&T version. + (ffi_closure_SYSV): Likewise. + (ffi_closure_raw_SYSV): Likewise. + (ffi_closure_STDCALL): Likewise. + +2012-03-29 Peter Rosin + + * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame + generation, fix the ENDP label and remove the surplus third arg + from the 'lea' insn. + +2012-03-29 Peter Rosin + + * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label + visible outside the PROC, so that ffi_closure_raw_THISCALL can see + it. Also instruct the assembler to add a frame to the function. + +2012-03-23 Peter Rosin + + * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING. + * Makefile.in: Rebuilt. + * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations + to all data exports, when compiling libffi clients using MSVC. + +2012-03-29 Peter Rosin + + * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and + make it the default for MSVC. + (FFI_TYPE_MS_STRUCT): New structure return convention. + * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure + return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT + instead of an ordinary FFI_TYPE_STRUCT. + (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. + (ffi_call): Likewise. + (ffi_prep_incoming_args_SYSV): Likewise. + (ffi_raw_call): Likewise. + (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV. + * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT, + return a pointer to the result structure in eax and don't pop + that pointer from the stack, the caller takes care of it. + (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. + (ffi_closure_raw_SYSV): Likewise. + +2012-03-22 Peter Rosin + + * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline + assembly version with Intel syntax. + * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise. + +2012-03-23 Peter Rosin + + * testsuite/libffi.call/ffitest.h: Provide abstration of + __attribute__((fastcall)) in the form of a __FASTCALL__ + define. Define it to __fastcall for MSVC. + * testsuite/libffi.call/fastthis1_win32.c: Use the above. + * testsuite/libffi.call/fastthis2_win32.c: Likewise. + * testsuite/libffi.call/fastthis3_win32.c: Likewise. + * testsuite/libffi.call/strlen2_win32.c: Likewise. + * testsuite/libffi.call/struct1_win32.c: Likewise. + * testsuite/libffi.call/struct2_win32.c: Likewise. + +2012-03-22 Peter Rosin + + * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual + frame on function entry, MASM adds one automatically. + +2012-03-22 Peter Rosin + + * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing + bits in the MSVC headers. + +2012-03-22 Peter Rosin + + * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style + with no declarations after statements. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_18byte.c: Likewise. + * testsuite/libffi.call/cls_19byte.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_20byte1.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_5_1_byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + * testsuite/libffi.call/cls_64byte.c: Likewise. + * testsuite/libffi.call/cls_6_1_byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7_1_byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_9byte1.c: Likewise. + * testsuite/libffi.call/cls_9byte2.c: Likewise. + * testsuite/libffi.call/cls_align_double.c: Likewise. + * testsuite/libffi.call/cls_align_float.c: Likewise. + * testsuite/libffi.call/cls_align_longdouble.c: Likewise. + * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise. + * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. + * testsuite/libffi.call/cls_align_pointer.c: Likewise. + * testsuite/libffi.call/cls_align_sint16.c: Likewise. + * testsuite/libffi.call/cls_align_sint32.c: Likewise. + * testsuite/libffi.call/cls_align_sint64.c: Likewise. + * testsuite/libffi.call/cls_align_uint16.c: Likewise. + * testsuite/libffi.call/cls_align_uint32.c: Likewise. + * testsuite/libffi.call/cls_align_uint64.c: Likewise. + * testsuite/libffi.call/cls_dbls_struct.c: Likewise. + * testsuite/libffi.call/cls_pointer_stack.c: Likewise. + * testsuite/libffi.call/err_bad_typedef.c: Likewise. + * testsuite/libffi.call/huge_struct.c: Likewise. + * testsuite/libffi.call/nested_struct.c: Likewise. + * testsuite/libffi.call/nested_struct1.c: Likewise. + * testsuite/libffi.call/nested_struct10.c: Likewise. + * testsuite/libffi.call/nested_struct2.c: Likewise. + * testsuite/libffi.call/nested_struct3.c: Likewise. + * testsuite/libffi.call/nested_struct4.c: Likewise. + * testsuite/libffi.call/nested_struct5.c: Likewise. + * testsuite/libffi.call/nested_struct6.c: Likewise. + * testsuite/libffi.call/nested_struct7.c: Likewise. + * testsuite/libffi.call/nested_struct8.c: Likewise. + * testsuite/libffi.call/nested_struct9.c: Likewise. + * testsuite/libffi.call/stret_large.c: Likewise. + * testsuite/libffi.call/stret_large2.c: Likewise. + * testsuite/libffi.call/stret_medium.c: Likewise. + * testsuite/libffi.call/stret_medium2.c: Likewise. + * testsuite/libffi.call/struct1.c: Likewise. + * testsuite/libffi.call/struct1_win32.c: Likewise. + * testsuite/libffi.call/struct2.c: Likewise. + * testsuite/libffi.call/struct2_win32.c: Likewise. + * testsuite/libffi.call/struct3.c: Likewise. + * testsuite/libffi.call/struct4.c: Likewise. + * testsuite/libffi.call/struct5.c: Likewise. + * testsuite/libffi.call/struct6.c: Likewise. + * testsuite/libffi.call/struct7.c: Likewise. + * testsuite/libffi.call/struct8.c: Likewise. + * testsuite/libffi.call/struct9.c: Likewise. + * testsuite/libffi.call/testclosure.c: Likewise. + +2012-03-21 Peter Rosin + + * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when + printing doubles (%lf is for long doubles). + (main): Likewise. + +2012-03-21 Peter Rosin + + * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] + (set_ld_library_path_env_vars): Add the library search dir to PATH + (and save PATH for later). + (restore_ld_library_path_env_vars): Restore PATH. + +2012-03-21 Peter Rosin + + * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] + (set_ld_library_path_env_vars): Add the library search dir to PATH + (and save PATH for later). + (restore_ld_library_path_env_vars): Restore PATH. + +2012-03-20 Peter Rosin + + * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. + * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label + visible outside the PROC, so that ffi_closure_THISCALL can see it. + +2012-03-20 Peter Rosin + + * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. + * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label + visible outside the PROC, so that ffi_closure_THISCALL can see it. + +2012-03-19 Alan Hourihane + + * src/m68k/ffi.c: Add MINT support. + * src/m68k/sysv.S: Ditto. + +2012-03-06 Chung-Lin Tang + + * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to + ffi_call_VFP(). + (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of + ffi_closure_VFP. + * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code. + +2012-03-19 chennam + + * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure + support. + +2012-03-13 Kaz Kojima + + * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, + just return FFI_BAD_ABI when things are wrong. + * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto. + +2012-03-09 David Edelsohn + + * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 + change to return value of ffi_closure_helper_DARWIN and load type + from return type. + +2012-03-03 H.J. Lu + + * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned + long. + (ffi_prep_closure_loc): Cast to 64bit address in trampoline. + (ffi_closure_unix64_inner): Cast return pointer to unsigned long + first. + + * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32. + (ffi_arg): Set to unsigned long long for x32. + (ffi_sarg): Set to long long for x32. + +2012-03-03 H.J. Lu + + * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI. + +2012-03-03 Andoni Morales Alastruey + + * configure.ac: Add -no-undefined for both 32- and 64-bit x86 + windows-like hosts. + * configure: Rebuilt. + +2012-02-27 Mikael Pettersson + + PR libffi/52223 + * Makefile.am (FLAGS_TO_PASS): Define. + * Makefile.in: Regenerate. + +2012-02-23 Anthony Green + + * src/*/ffitarget.h: Ensure that users never include ffitarget.h + directly. + +2012-02-23 Kai Tietz + + PR libffi/52221 + * src/x86/ffi.c (ffi_closure_raw_THISCALL): New + prototype. + (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for + thiscall-convention. + (ffi_raw_call): Use ffi_prep_args_raw. + * src/x86/win32.S (ffi_closure_raw_THISCALL): Add + implementation for stub. + +2012-02-10 Kai Tietz + + * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64 + windows target. + * configure: Regenerated. + +2012-02-08 Kai Tietz + + * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 + also FFI_THISCALL. + * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. + (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code. + (ffi_prep_closure_loc): Add FFI_THISCALL support. + * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size. + * src/x86/win32.S (ffi_closure_THISCALL): New closure code + for thiscall-calling convention. + * testsuite/libffi.call/closure_thiscall.c: New test. + +2012-01-28 Kai Tietz + + * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new + argument to prototype for specify calling-convention. + (ffi_call): Add support for stdcall/thiscall convention. + (ffi_prep_args): Likewise. + (ffi_raw_call): Likewise. + * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and + FFI_FASTCALL. + * src/x86/win32.S (_ffi_call_win32): Add support for + fastcall/thiscall calling-convention calls. + * testsuite/libffi.call/fastthis1_win32.c: New test. + * testsuite/libffi.call/fastthis2_win32.c: New test. + * testsuite/libffi.call/fastthis3_win32.c: New test. + * testsuite/libffi.call/strlen2_win32.c: New test. + * testsuite/libffi.call/many2_win32.c: New test. + * testsuite/libffi.call/struct1_win32.c: New test. + * testsuite/libffi.call/struct2_win32.c: New test. + +2012-01-23 Uros Bizjak + + * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. + +2012-01-23 Anthony Green + Chris Young + + * configure.ac: Add Amiga support. + * configure: Rebuilt. + +2012-01-23 Dmitry Nadezhin + + * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. + +2012-01-23 Andreas Schwab + + * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain + mc68000. Test for __HAVE_68881__ in addition to __MC68881__. + +2012-01-19 Jakub Jelinek + + PR rtl-optimization/48496 + * src/ia64/ffi.c (ffi_call): Fix up aliasing violations. + +2012-01-09 Rainer Orth + + * configure.ac (i?86-*-*): Set TARGET to X86_64. + * configure: Regenerate. + +2011-12-07 Andrew Pinski + + PR libffi/50051 + * src/mips/n32.S: Add ".set mips4". + +2011-11-21 Andreas Tobler + + * configure: Regenerate. + +2011-11-12 David Gilbert + + * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h, + man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3, + man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h, + src/cris/ffi.c, src/prep_cif.c, + testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/float_va.c: Many changes to support variadic + function calls. + +2011-11-12 Kyle Moffett + + * src/powerpc/ffi.c, src/powerpc/ffitarget.h, + src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for + softfloat powerpc variants. + +2011-11-12 Petr Salinger + + * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support. + * configure: Rebuilt. + +2011-11-12 Timothy Wall + + * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max + alignment of 4 for wince on ARM. + +2011-11-12 Kyle Moffett + Anthony Green + + * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string + instructions (not available on some cores, like the PPC440). + +2011-11-12 Kimura Wataru + + * m4/ax_enable_builddir: Change from string comparison to numeric + comparison for wc output. + * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS + X 10.7. + * configure: Rebuilt. + +2011-11-12 Anthony Green + + * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly + files with debug info. + * Makefile.in: Rebuilt. + +2011-11-12 Jasper Lievisse Adriaanse + + * README: Update list of supported OpenBSD systems. + +2011-11-12 Anthony Green + + * libtool-version: Update. + * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if + FFI_DEBUG. + (libffi_la_SOURCES): Remove src/debug.c + (EXTRA_DIST): Add src/debug.c + * Makefile.in: Rebuilt. + * README: Update for 3.0.11. + +2011-11-10 Richard Henderson + + * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check. + * configure, aclocal.m4: Rebuild. + +2011-09-04 Iain Sandoe + + PR libffi/49594 + * src/powerpc/darwin_closure.S (stubs): Make the stub binding + helper reference track the architecture pointer size. + +2011-08-25 Andrew Haley + + * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly + instructions. + * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead. + +2011-07-11 Andrew Haley + + * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache. + +2011-06-29 Rainer Orth + + * testsuite/libffi.call/cls_double_va.c: Move PR number to comment. + * testsuite/libffi.call/cls_longdouble_va.c: Likewise. + +2011-06-29 Rainer Orth + + PR libffi/46660 + * testsuite/libffi.call/cls_double_va.c: xfail dg-output on + mips-sgi-irix6*. + * testsuite/libffi.call/cls_longdouble_va.c: Likewise. + +2011-06-14 Rainer Orth + + * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8, + PRId8 instead of %hhu, %hhd. + * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8, + PRIu8): Define. + [__sgi__] (PRId8, PRIu8): Define. + +2011-04-29 Rainer Orth + + * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE): + Define. + Use them to handle ELF vs. ECOFF differences. + [__osf__] (_GLOBAL__F_ffi_call_osf): Define. + +2011-03-30 Timothy Wall + + * src/powerpc/darwin.S: Fix unknown FDE encoding. + * src/powerpc/darwin_closure.S: ditto. + +2011-02-25 Anthony Green + + * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more + 32-bit ABIs. + +2011-02-15 Anthony Green + + * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math. + * configure: Rebuilt. + +2011-02-13 Ralf Wildenhues + + * configure: Regenerate. + +2011-02-13 Anthony Green + + * include/ffi_common.h (UNLIKELY, LIKELY): Define. + * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition. + * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition. + + * src/prep_cif.c (initialize_aggregate): Convert assertion into + FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0. + + * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, + just return FFI_BAD_ABI when things are wrong. + * src/arm/ffi.c (ffi_prep_closure_loc): Ditto. + * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto. + * src/mips/ffi.c (ffi_prep_closure_loc): Ditto. + * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto. + * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto. + +2011-02-11 Anthony Green + + * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, + just return FFI_BAD_ABI when things are wrong. + +2012-02-11 Eric Botcazou + + * src/sparc/v9.S (STACKFRAME): Bump to 176. + +2011-02-09 Stuart Shelton + + http://bugs.gentoo.org/show_bug.cgi?id=286911 + * src/mips/ffitarget.h: Clean up error messages. + * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to + ffi_raw*. + * include/ffi.h.in: Add pragma for SGI compiler. + +2011-02-09 Anthony Green + + * configure.ac: Add powerpc64-*-darwin* support. + +2011-02-09 Anthony Green + + * README: Mention Interix. + +2011-02-09 Jonathan Callen + + * configure.ac: Add Interix to win32/cygwin/mingw case. + * configure: Ditto. + * src/closures.c: Treat Interix like Cygwin, instead of as a + generic win32. + +2011-02-09 Anthony Green + + * testsuite/libffi.call/err_bad_typedef.c: Remove xfail. + * testsuite/libffi.call/err_bad_abi.c: Remove xfail. + * src/x86/ffi64.c (UNLIKELY, LIKELY): Define. + (ffi_prep_closure_loc): Check for bad ABI. + * src/prep_cif.c (UNLIKELY, LIKELY): Define. + (initialize_aggregate): Check for bad types. + +2011-02-09 Landon Fuller + + * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh, + src/arm/trampoline.S. + (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S. + * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define. + * src/arm/ffi.c (ffi_trampoline_table) + (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry) + (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) + (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables) + (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free): + Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS). + (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case + separately. + * src/arm/sysv.S: Handle Apple iOS host. + * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case. + * build-ios.sh: New file. + * fficonfig.h.in, configure, Makefile.in: Rebuilt. + * README: Mention ARM iOS. + +2011-02-08 Oren Held + + * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid + redefinition of mallinfo on HP-UX. + +2011-02-08 Ginn Chen + + * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio + aggregate return ABI. Flush cache. + (ffi_prep_closure_loc): Flush cache. + +2011-02-11 Anthony Green + + From Tom Honermann : + * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on + AIX. Declare .ffi_prep_args. Insert nops after branch + instructions so that the AIX linker can insert TOC reload + instructions. + * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. + +2011-02-08 Ed + + * src/powerpc/asm.h: Fix grammar nit in comment. + +2011-02-08 Uli Link + + * include/ffi.h.in (FFI_64_BIT_MAX): Define and use. + +2011-02-09 Rainer Orth + + PR libffi/46661 + * testsuite/libffi.call/cls_pointer.c (main): Cast void * to + uintptr_t first. + * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise. + +2011-02-08 Rafael Avila de Espindola + + * configure.ac: Fix x86 test for pc related relocs. + * configure: Rebuilt. + +2011-02-07 Joel Sherrill + + * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing. + Handle case when CPU variant does not have long double support. + * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire, + and cores with soft floating point. + +2011-02-07 Joel Sherrill + + * configure.ac: Add mips*-*-rtems* support. + * configure: Regenerate. + * src/mips/ffitarget.h: Ensure needed constants are available + for targets which do not have sgidefs.h. + +2011-01-26 Dave Korn + + PR target/40125 + * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs. + * configure: Regenerate. + +2010-12-18 Iain Sandoe + + PR libffi/29152 + PR libffi/42378 + * src/powerpc/darwin_closure.S: Provide Darwin64 implementation, + update comments. + * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New, + (FFI_TRAMPOLINE_SIZE): Update for Darwin64. + * src/powerpc/darwin.S: Provide Darwin64 implementation, + update comments. + * src/powerpc/ffi_darwin.c: Likewise. + +2010-12-06 Rainer Orth + + * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double + backslashes. + (libffi_cv_as_string_pseudo_op): Likewise. + * configure: Regenerate. + +2010-12-03 Chung-Lin Tang + + * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive. + (ffi_closure_VFP): Same. + (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp' + directive. + +2010-12-01 Rainer Orth + + * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. + (PRIuPTR): Define. + +2010-11-29 Richard Henderson + Rainer Orth + + * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define. + (.eh_frame): Use FDE_ENCODING. + (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE. + +2010-11-22 Jacek Caban + + * configure.ac: Check for symbol underscores on mingw-w64. + * configure: Rebuilt. + * src/x86/win64.S: Correctly access extern symbols in respect to + underscores. + +2010-11-15 Rainer Orth + + * testsuite/lib/libffi-dg.exp: Rename ... + * testsuite/lib/libffi.exp: ... to this. + * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp. + * libffi/testsuite/libffi.special/special.exp: Likewise. + +2010-10-28 Chung-Lin Tang + + * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling + code, new parameter, and return value. Update comments. + (ffi_prep_cif_machdep): Add case for VFP struct return values. Add + call to layout_vfp_args(). + (ffi_call_SYSV): Update declaration. + (ffi_call_VFP): New declaration. + (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP() + when ABI is FFI_VFP. + (ffi_closure_VFP): New declaration. + (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to + ffi_prep_incoming_args_SYSV(). + (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument + case handling. + (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline + construction under VFP hard-float. + (rec_vfp_type_p): New function. + (vfp_type_p): Same. + (place_vfp_arg): Same. + (layout_vfp_args): Same. + * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI + based on __ARM_PCS_VFP. + (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific + fields. + (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code. + (FFI_TYPE_STRUCT_VFP_DOUBLE): Same. + * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to + direct call. Move function pointer load upwards. + (ffi_call_VFP): New function. + (ffi_closure_VFP): Same. + + * testsuite/lib/libffi-dg.exp (check-flags): New function. + (dg-skip-if): New function. + * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-* + and compiler options include -mfloat-abi=hard. + * testsuite/libffi.call/cls_longdouble_va.c: Same. + +2010-10-01 Jakub Jelinek + + PR libffi/45677 + * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is + a multiple of 8. + * testsuite/libffi.call/many2.c: New test. + +2010-08-20 Mark Wielaard + + * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r + returns NULL. + +2010-08-09 Andreas Tobler + + * configure.ac: Add target powerpc64-*-freebsd*. + * configure: Regenerate. + * testsuite/libffi.call/cls_align_longdouble_split.c: Pass + -mlong-double-128 only to linux targets. + * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. + * testsuite/libffi.call/cls_longdouble.c: Likewise. + * testsuite/libffi.call/huge_struct.c: Likewise. + +2010-08-05 Dan Witte + + * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the + debug CRT when --enable-debug is given. + * configure.ac: Define it. + * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately. + +2010-08-04 Dan Witte + + * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64 + platforms. + * src/x86/ffi.c: Remove redundant ifdef checks. + * src/prep_cif.c: Push stack space computation into src/x86/ffi.c + for X86_ANY so return value space doesn't get added twice. + +2010-08-03 Neil Rashbrooke + + * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy. + +2010-07-22 Dan Witte + + * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI. + * src/prep_cif.c: Fix ABI assertion. + * src/cris/ffi.c: Ditto. + +2010-07-10 Evan Phoenix + + * src/closures.c (selinux_enabled_check): Fix strncmp usage bug. + +2010-07-07 Dan Horák + + * include/ffi.h.in: Protect #define with #ifndef. + * src/powerpc/ffitarget.h: Ditto. + * src/s390/ffitarget.h: Ditto. + * src/sparc/ffitarget.h: Ditto. + +2010-07-07 Neil Roberts + + * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to + 16-bytes. + +2010-07-02 Jakub Jelinek + + * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes. + * Makefile.in: Regenerated. + +2010-05-19 Rainer Orth + + * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as + output, too. + (libffi_cv_as_ascii_pseudo_op): Check for .ascii. + (libffi_cv_as_string_pseudo_op): Check for .string. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error. + +2010-05-11 Dan Witte + + * doc/libffi.tex: Document previous change. + +2010-05-11 Makoto Kato + + * src/x86/ffi.c (ffi_call): Don't copy structs passed by value. + +2010-05-05 Michael Kohler + + * src/dlmalloc.c (dlfree): Fix spelling. + * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto. + * configure.ac: Ditto. + * configure: Rebuilt. + +2010-04-13 Dan Witte + + * msvcc.sh: Build with -W3 instead of -Wall. + * src/powerpc/ffi_darwin.c: Remove build warnings. + * src/x86/ffi.c: Ditto. + * src/x86/ffitarget.h: Ditto. + +2010-04-12 Dan Witte + Walter Meinl + + * configure.ac: Add OS/2 support. + * configure: Rebuilt. + * src/closures.c: Ditto. + * src/dlmalloc.c: Ditto. + * src/x86/win32.S: Ditto. + +2010-04-07 Jakub Jelinek + + * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable. + +2010-04-02 Ralf Wildenhues + + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * include/Makefile.in: Regenerate. + * man/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2010-03-30 Dan Witte + + * msvcc.sh: Disable build warnings. + * README (tested): Clarify windows build procedure. + +2010-03-15 Rainer Orth + + * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * libffi/src/x86/unix64.S (.eh_frame) + [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type. + +2010-03-14 Matthias Klose + + * src/x86/ffi64.c: Fix typo in comment. + * src/x86/ffi.c: Use /* ... */ comment style. + +2010-02-24 Rainer Orth + + * doc/libffi.texi (The Closure API): Fix typo. + * doc/libffi.info: Remove. + +2010-02-15 Matthias Klose + + * src/arm/sysv.S (__ARM_ARCH__): Define for processor + __ARM_ARCH_7EM__. + +2010-01-15 Anthony Green + + * README: Add notes on building with Microsoft Visual C++. + +2010-01-15 Daniel Witte + + * msvcc.sh: New file. + + * src/x86/win32.S: Port assembly routines to MSVC and #ifdef. + * src/x86/ffi.c: Tweak function declaration and remove excess + parens. + * include/ffi.h.in: Add __declspec(align(8)) to typedef struct + ffi_closure. + + * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new + function ffi_call_win32 on X86_WIN32. + * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32. + (ffi_call_STDCALL): Remove. + + * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code + to ffi_prep_cif_machdep for x86. + * src/x86/ffi.c (ffi_prep_cif_machdep): To here. + +2010-01-15 Oliver Kiddle + + * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for + Sun Studio compiler compatibility. + +2010-01-12 Conrad Irwin + + * doc/libffi.texi: Add closure example. + +2010-01-07 Rainer Orth + + PR libffi/40701 + * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL, + PRIuLL, PRId64, PRIu64, PRIuPTR): Define. + * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on + alpha*-dec-osf*. + * testsuite/libffi.call/cls_align_uint64.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/return_ll1.c: Likewise. + * testsuite/libffi.call/stret_medium2.c: Likewise. + * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast + MAP_FAILED to char *. + +2010-01-06 Rainer Orth + + * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__. + +2009-12-31 Anthony Green + + * README: Update for libffi 3.0.9. + +2009-12-27 Matthias Klose + + * configure.ac (HAVE_LONG_DOUBLE): Define for mips when + appropriate. + * configure: Rebuilt. + +2009-12-26 Anthony Green + + * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for + avr32*-*-*. + * testsuite/libffi.call/cls_double_va.c: Ditto. + +2009-12-26 Andreas Tobler + + * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h + and inttypes.h. + * testsuite/libffi.special/unwindtest.cc: Ditto. + +2009-12-26 Andreas Tobler + + * configure.ac: Add amd64-*-openbsd*. + * configure: Rebuilt. + * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link + openbsd programs with -lpthread. + +2009-12-26 Anthony Green + + * testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for + mips*-*-* and arm*-*-*. + * testsuite/libffi.call/cls_align_longdouble_split.c, + testsuite/libffi.call/cls_align_longdouble_split2.c, + testsuite/libffi.call/stret_medium2.c, + testsuite/libffi.call/stret_medium.c, + testsuite/libffi.call/stret_large.c, + testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*. + +2009-12-31 Kay Tietz + + * testsuite/libffi.call/ffitest.h, + testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix + definitions. + +2009-12-31 Carlo Bramini + + * configure.ac (AM_LTLDFLAGS): Define for windows hosts. + * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS. + * configure: Rebuilt. + * Makefile.in: Rebuilt. + +2009-12-31 Anthony Green + Blake Chaffin. + + * testsuite/libffi.call/huge_struct.c: New test case from Blake + Chaffin @ Apple. + +2009-12-28 David Edelsohn + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to + local variables. + (aix_adjust_aggregate_sizes): New function. + (ffi_prep_cif_machdep): Call it. + +2009-12-26 Andreas Tobler + + * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets. + * configure: Regenerate. + * fficonfig.h.in: Likewise. + * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for + Solaris/x86. + +2009-12-26 Andreas Schwab + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count + when a float arguments is passed in memory. + (ffi_closure_helper_SYSV): Mark general registers as used up when + a 64bit or soft-float long double argument is passed in memory. + +2009-12-25 Matthias Klose + + * man/ffi_call.3: Fix #include in examples. + * doc/libffi.texi: Add dircategory. + +2009-12-25 Frank Everdij + + * include/ffi.h.in: Placed '__GNUC__' ifdef around + '__attribute__((aligned(8)))' in ffi_closure, fixes compile for + IRIX MIPSPro c99. + * include/ffi_common.h: Added '__sgi' define to non + '__attribute__((__mode__()))' integer typedefs. + * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32, + ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check. + (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added + FFI_LONGDOUBLE support and alignment(N32 only). + * src/mips/ffitarget.h: Corrected '#include ' for IRIX and + fixed non '__attribute__((__mode__()))' integer typedefs. + * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame' + since they are Linux/GNU Assembler specific. + +2009-12-25 Bradley Smith + + * configure.ac, Makefile.am, src/avr32/ffi.c, + src/avr32/ffitarget.h, + src/avr32/sysv.S: Add AVR32 port. + * configure, Makefile.in: Rebuilt. + +2009-12-21 Andreas Tobler + + * configure.ac: Make i?86 build on FreeBSD and OpenBSD. + * configure: Regenerate. + +2009-12-15 John David Anglin + + * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX. + +2009-12-13 John David Anglin + + * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE + type on HP-UX. + +2012-02-13 Kai Tietz + + PR libffi/52221 + * src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall + support for X86_WIN32. + (FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement. + +2009-12-11 Eric Botcazou + + * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long + double' arguments. + +2009-12-11 Eric Botcazou + + * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10. + +2009-12-10 Rainer Orth + + PR libffi/40700 + * src/closures.c [X86_64 && __sun__ && __svr4__] + (FFI_MMAP_EXEC_WRIT): Define. + +2009-12-08 David Daney + + * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-* + * testsuite/libffi.call/cls_align_longdouble_split2.c: Same. + * testsuite/libffi.call/stret_large.c: Same. + * testsuite/libffi.call/cls_align_longdouble_split.c: Same. + * testsuite/libffi.call/stret_large2.c: Same. + * testsuite/libffi.call/stret_medium2.c: Same. + +2009-12-07 David Edelsohn + + * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump + typo. + +2009-12-05 David Edelsohn + + * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64 + code. + * src/powerpc/aix_closure.S: Same. + +2009-12-05 Ralf Wildenhues + + * Makefile.in: Regenerate. + * configure: Regenerate. + * include/Makefile.in: Regenerate. + * man/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2009-12-04 David Edelsohn + + * src/powerpc/aix_closure.S: Reorganize 64-bit code to match + linux64_closure.S. + +2009-12-04 Uros Bizjak + + PR libffi/41908 + * src/x86/ffi64.c (classify_argument): Update from + gcc/config/i386/i386.c. + (ffi_closure_unix64_inner): Do not use the address of two consecutive + SSE registers directly. + * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail + for x86_64 linux targets. + +2009-12-04 David Edelsohn + + * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment + pfr for long double split between fpr13 and stack. + +2009-12-03 David Edelsohn + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and + fparg_count twice for long double. + +2009-12-03 David Edelsohn + + PR libffi/42243 + * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. + +2009-12-03 Uros Bizjak + + * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string. + Remove xfails for x86 linux targets. + +2009-12-02 David Edelsohn + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64 + case. + +2009-12-01 David Edelsohn + + * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard + register usage. Call ffi_prep_args directly. Add long double + return value support. + * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment + applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo. + Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases. + (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit + mode. + (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp + into case. + * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment. + Allocate result area between params and FPRs. + +2009-11-30 David Edelsohn + + PR target/35484 + * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and + AIX64. + * src/powerpc/aix.S: Implement AIX64 version. + * src/powerpc/aix_closure.S: Implement AIX64 version. + (ffi_closure_ASM): Use extsb, lha and displament addresses. + * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 + support. + (ffi_prep_cif_machdep): Same. + (ffi_call): Same. + (ffi_closure_helper_DARWIN): Same. + +2009-11-02 Andreas Tobler + + PR libffi/41908 + * testsuite/libffi.call/testclosure.c: New test. + +2009-09-28 Kai Tietz + + * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu + assembly version use of ___chkstk. + +2009-09-23 Matthias Klose + + PR libffi/40242, PR libffi/41443 + * src/arm/sysv.S (__ARM_ARCH__): Define for processors + __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__, + __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__. + Change the conditionals to __SOFTFP__ || __ARM_EABI__ + for -mfloat-abi=softfp to work. + +2009-09-17 Loren J. Rittle + + PR testsuite/32843 (strikes again) + * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to + enable proper extension on char and short. + +2009-09-15 David Daney + + * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special + handling for FFI_TYPE_POINTER. + * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT, + FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT, + FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT, + FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines. + (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations. + (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float. + * src/mips/n32.S (ffi_call_N32): Add handling for soft-float + structure and pointer returns. + (ffi_closure_N32): Add handling for pointer returns. + * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags, + calc_n32_return_struct_flags): Handle soft-float. + (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling. + (ffi_call_N32): Declare proper argument types. + (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle + soft-float. + +2009-08-24 Ralf Wildenhues + + * configure.ac (AC_PREREQ): Bump to 2.64. + +2009-08-22 Ralf Wildenhues + + * Makefile.am (install-html, install-pdf): Remove. + * Makefile.in: Regenerate. + + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * include/Makefile.in: Regenerate. + * man/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2011-08-22 Jasper Lievisse Adriaanse + + * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support. + * configure: Rebuilt. + +2009-07-30 Ralf Wildenhues + + * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force. + +2009-07-24 Dave Korn + + PR libffi/40807 + * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending + return types for X86_WIN32. + * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types. + (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV, + _ffi_closure_STDCALL): Likewise. + + * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin. + (dlmmap, dlmunmap): Also use these functions on Cygwin. + +2009-07-11 Richard Sandiford + + PR testsuite/40699 + PR testsuite/40707 + PR testsuite/40709 + * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and + 2009-06-30 commits. + +2009-07-01 Richard Sandiford + + * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path + to "" before adding paths. (This reinstates an assignment that + was removed by my 2009-06-30 commit, but changes the initial + value from "." to "".) + +2009-07-01 H.J. Lu + + PR testsuite/40601 + * testsuite/lib/libffi-dg.exp (libffi-init): Properly set + gccdir. Adjust ld_library_path for gcc only if gccdir isn't + empty. + +2009-06-30 Richard Sandiford + + * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "." + to ld_library_path. Use add_path. Add just find_libgcc_s + to ld_library_path, not every libgcc multilib directory. + +2009-06-16 Wim Lewis + + * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are + supposed to be callee-saved. + * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of + return buffer for odd-size structs. + +2009-06-16 Andreas Tobler + + PR libffi/40444 + * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add + allow_stack_execute for Darwin. + +2009-06-16 Andrew Haley + + * configure.ac (TARGETDIR): Add missing blank lines. + * configure: Regenerate. + +2009-06-16 Andrew Haley + + * testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_medium2.c: Fix printf format + specifiers. + * testsuite/libffi.call/ffitest.h, + testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. + +2009-06-15 Andrew Haley + + * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere. + * testsuite/libffi.call/err_bad_abi.c: Likewise. + +2009-06-12 Andrew Haley + + * Makefile.am: Remove info_TEXINFOS. + +2009-06-12 Andrew Haley + + * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_medium2.c: Fix printf format + specifiers. + testsuite/libffi.special/unwindtest.cc: include stdint.h. + +2009-06-11 Timothy Wall + + * Makefile.am, + configure.ac, + include/ffi.h.in, + include/ffi_common.h, + src/closures.c, + src/dlmalloc.c, + src/x86/ffi.c, + src/x86/ffitarget.h, + src/x86/win64.S (new), + README: Added win64 support (mingw or MSVC) + * Makefile.in, + include/Makefile.in, + man/Makefile.in, + testsuite/Makefile.in, + configure, + aclocal.m4: Regenerated + * ltcf-c.sh: properly escape cygwin/w32 path + * man/ffi_call.3: Clarify size requirements for return value. + * src/x86/ffi64.c: Fix filename in comment. + * src/x86/win32.S: Remove unused extern. + + * testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/closure_stdcall.c, + testsuite/libffi.call/cls_12byte.c, + testsuite/libffi.call/cls_16byte.c, + testsuite/libffi.call/cls_18byte.c, + testsuite/libffi.call/cls_19byte.c, + testsuite/libffi.call/cls_1_1byte.c, + testsuite/libffi.call/cls_20byte.c, + testsuite/libffi.call/cls_20byte1.c, + testsuite/libffi.call/cls_24byte.c, + testsuite/libffi.call/cls_2byte.c, + testsuite/libffi.call/cls_3_1byte.c, + testsuite/libffi.call/cls_3byte1.c, + testsuite/libffi.call/cls_3byte2.c, + testsuite/libffi.call/cls_4_1byte.c, + testsuite/libffi.call/cls_4byte.c, + testsuite/libffi.call/cls_5_1_byte.c, + testsuite/libffi.call/cls_5byte.c, + testsuite/libffi.call/cls_64byte.c, + testsuite/libffi.call/cls_6_1_byte.c, + testsuite/libffi.call/cls_6byte.c, + testsuite/libffi.call/cls_7_1_byte.c, + testsuite/libffi.call/cls_7byte.c, + testsuite/libffi.call/cls_8byte.c, + testsuite/libffi.call/cls_9byte1.c, + testsuite/libffi.call/cls_9byte2.c, + testsuite/libffi.call/cls_align_double.c, + testsuite/libffi.call/cls_align_float.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_align_longdouble_split.c, + testsuite/libffi.call/cls_align_longdouble_split2.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_align_sint16.c, + testsuite/libffi.call/cls_align_sint32.c, + testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint16.c, + testsuite/libffi.call/cls_align_uint32.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_dbls_struct.c, + testsuite/libffi.call/cls_double.c, + testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_float.c, + testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_multi_schar.c, + testsuite/libffi.call/cls_multi_sshort.c, + testsuite/libffi.call/cls_multi_sshortchar.c, + testsuite/libffi.call/cls_multi_uchar.c, + testsuite/libffi.call/cls_multi_ushort.c, + testsuite/libffi.call/cls_multi_ushortchar.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c, + testsuite/libffi.call/cls_schar.c, + testsuite/libffi.call/cls_sint.c, + testsuite/libffi.call/cls_sshort.c, + testsuite/libffi.call/cls_uchar.c, + testsuite/libffi.call/cls_uint.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/cls_ushort.c, + testsuite/libffi.call/err_bad_abi.c, + testsuite/libffi.call/err_bad_typedef.c, + testsuite/libffi.call/float2.c, + testsuite/libffi.call/huge_struct.c, + testsuite/libffi.call/nested_struct.c, + testsuite/libffi.call/nested_struct1.c, + testsuite/libffi.call/nested_struct10.c, + testsuite/libffi.call/nested_struct2.c, + testsuite/libffi.call/nested_struct3.c, + testsuite/libffi.call/nested_struct4.c, + testsuite/libffi.call/nested_struct5.c, + testsuite/libffi.call/nested_struct6.c, + testsuite/libffi.call/nested_struct7.c, + testsuite/libffi.call/nested_struct8.c, + testsuite/libffi.call/nested_struct9.c, + testsuite/libffi.call/problem1.c, + testsuite/libffi.call/return_ldl.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_large.c, + testsuite/libffi.call/stret_large2.c, + testsuite/libffi.call/stret_medium.c, + testsuite/libffi.call/stret_medium2.c, + testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead + of checking for MMAP. Use intptr_t instead of long casts. + +2009-06-11 Kaz Kojima + + * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*. + * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*. + * testsuite/libffi.call/err_bad_typedef.c: Likewise. + +2009-06-09 Andrew Haley + + * src/x86/freebsd.S: Add missing file. + +2009-06-08 Andrew Haley + + Import from libffi 3.0.8: + + * doc/libffi.texi: New file. + * doc/libffi.info: Likewise. + * doc/stamp-vti: Likewise. + * man/Makefile.am: New file. + * man/ffi_call.3: New file. + + * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S, + src/dlmalloc.c. + (nodist_libffi_la_SOURCES): Add X86_FREEBSD. + + * configure.ac: Bump version to 3.0.8. + parisc*-*-linux*: Add. + i386-*-freebsd* | i386-*-openbsd*: Add. + powerpc-*-beos*: Add. + AM_CONDITIONAL X86_FREEBSD: Add. + AC_CONFIG_FILES: Add man/Makefile. + + * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void). + +2009-06-08 Andrew Haley + + * README: Import from libffi 3.0.8. + +2009-06-08 Andrew Haley + + * testsuite/libffi.call/err_bad_abi.c: Add xfails. + * testsuite/libffi.call/cls_longdouble_va.c: Add xfails. + * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*. + * testsuite/libffi.call/err_bad_typedef.c: Add xfails. + + * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args. + * testsuite/libffi.call/stret_medium.c: Likewise. + * testsuite/libffi.call/stret_large2.c: Likewise. + * testsuite/libffi.call/stret_large.c: Likewise. + +2008-12-26 Timothy Wall + + * testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_align_longdouble_split.c, + testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected + failures on x86_64 cygwin/mingw. + +2008-12-22 Timothy Wall + + * testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/closure_loc_fn0.c, + testsuite/libffi.call/closure_stdcall.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c: use portable cast from + pointer to integer (intptr_t). + * testsuite/libffi.call/cls_longdouble.c: disable for win64. + +2008-07-24 Anthony Green + + * testsuite/libffi.call/cls_dbls_struct.c, + testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c, + testsuite/libffi.call/err_bad_abi.c: Clean up failures from + compiler warnings. + +2008-03-04 Anthony Green + Blake Chaffin + hos@tamanegi.org + + * testsuite/libffi.call/cls_align_longdouble_split2.c + testsuite/libffi.call/cls_align_longdouble_split.c + testsuite/libffi.call/cls_dbls_struct.c + testsuite/libffi.call/cls_double_va.c + testsuite/libffi.call/cls_longdouble.c + testsuite/libffi.call/cls_longdouble_va.c + testsuite/libffi.call/cls_pointer.c + testsuite/libffi.call/cls_pointer_stack.c + testsuite/libffi.call/err_bad_abi.c + testsuite/libffi.call/err_bad_typedef.c + testsuite/libffi.call/stret_large2.c + testsuite/libffi.call/stret_large.c + testsuite/libffi.call/stret_medium2.c + testsuite/libffi.call/stret_medium.c: New tests from Apple. + +2009-06-05 Andrew Haley + + * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from + libffi. + +2009-06-04 Andrew Haley + + * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out + stdcall changes. + +2008-02-26 Anthony Green + Thomas Heller + + * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C + comment. + +2008-02-03 Timothy Wall + + * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return + offset based on code pointer, not data pointer. + +2008-01-31 Timothy Wall + + * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall + closures. + * src/x86/ffitarget.h: Increase size of trampoline for stdcall + closures. + * src/x86/win32.S: Add assembly for stdcall closure. + * src/x86/ffi.c: Initialize stdcall closure trampoline. + +2009-06-04 Andrew Haley + + * include/ffi.h.in: Change void (*)() to void (*)(void). + * src/x86/ffi.c: Likewise. + +2009-06-04 Andrew Haley + + * src/powerpc/ppc_closure.S: Insert licence header. + * src/powerpc/linux64_closure.S: Likewise. + * src/m68k/sysv.S: Likewise. + + * src/sh64/ffi.c: Change void (*)() to void (*)(void). + * src/powerpc/ffi.c: Likewise. + * src/powerpc/ffi_darwin.c: Likewise. + * src/m32r/ffi.c: Likewise. + * src/sh64/ffi.c: Likewise. + * src/x86/ffi64.c: Likewise. + * src/alpha/ffi.c: Likewise. + * src/alpha/osf.S: Likewise. + * src/frv/ffi.c: Likewise. + * src/s390/ffi.c: Likewise. + * src/pa/ffi.c: Likewise. + * src/pa/hpux32.S: Likewise. + * src/ia64/unix.S: Likewise. + * src/ia64/ffi.c: Likewise. + * src/sparc/ffi.c: Likewise. + * src/mips/ffi.c: Likewise. + * src/sh/ffi.c: Likewise. + +2008-02-15 David Daney + + * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): + Define (conditionally), and use it to include cachectl.h. + (ffi_prep_closure_loc): Fix cache flushing. + * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. + +2009-06-04 Andrew Haley + + include/ffi.h.in, + src/arm/ffitarget.h, + src/arm/ffi.c, + src/arm/sysv.S, + src/powerpc/ffitarget.h, + src/closures.c, + src/sh64/ffitarget.h, + src/sh64/ffi.c, + src/sh64/sysv.S, + src/types.c, + src/x86/ffi64.c, + src/x86/ffitarget.h, + src/x86/win32.S, + src/x86/darwin.S, + src/x86/ffi.c, + src/x86/sysv.S, + src/x86/unix64.S, + src/alpha/ffitarget.h, + src/alpha/ffi.c, + src/alpha/osf.S, + src/m68k/ffitarget.h, + src/frv/ffitarget.h, + src/frv/ffi.c, + src/s390/ffitarget.h, + src/s390/sysv.S, + src/cris/ffitarget.h, + src/pa/linux.S, + src/pa/ffitarget.h, + src/pa/ffi.c, + src/raw_api.c, + src/ia64/ffitarget.h, + src/ia64/unix.S, + src/ia64/ffi.c, + src/ia64/ia64_flags.h, + src/java_raw_api.c, + src/debug.c, + src/sparc/v9.S, + src/sparc/ffitarget.h, + src/sparc/ffi.c, + src/sparc/v8.S, + src/mips/ffitarget.h, + src/mips/n32.S, + src/mips/o32.S, + src/mips/ffi.c, + src/prep_cif.c, + src/sh/ffitarget.h, + src/sh/ffi.c, + src/sh/sysv.S: Update license text. + +2009-05-22 Dave Korn + + * src/x86/win32.S (_ffi_closure_STDCALL): New function. + (.eh_frame): Add FDE for it. + +2009-05-22 Dave Korn + + * configure.ac: Also check if assembler supports pc-relative + relocs on X86_WIN32 targets. + * configure: Regenerate. + * src/x86/win32.S (ffi_prep_args): Declare extern, not global. + (_ffi_call_SYSV): Add missing function type symbol .def and + add EH markup labels. + (_ffi_call_STDCALL): Likewise. + (_ffi_closure_SYSV): Likewise. + (_ffi_closure_raw_SYSV): Likewise. + (.eh_frame): Add hand-crafted EH data. + +2009-04-09 Jakub Jelinek + + * testsuite/lib/libffi-dg.exp: Change copyright header to refer to + version 3 of the GNU General Public License and to point readers + at the COPYING3 file and the FSF's license web page. + * testsuite/libffi.call/call.exp: Likewise. + * testsuite/libffi.special/special.exp: Likewise. + +2009-03-01 Ralf Wildenhues + + * configure: Regenerate. + +2008-12-18 Rainer Orth + + PR libffi/26048 + * configure.ac (HAVE_AS_X86_PCREL): New test. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate + RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET, + RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler. + (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. + * src/x86/unix64.S (.Lstore_table): Move to .text section. + (.Lload_table): Likewise. + (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. + +2008-12-18 Ralf Wildenhues + + * configure: Regenerate. + +2008-11-21 Eric Botcazou + + * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for + signed/unsigned int8/16 return values. + * src/sparc/v8.S (ffi_call_v8): Likewise. + (ffi_closure_v8): Likewise. + +2008-09-26 Peter O'Gorman + Steve Ellcey + + * configure: Regenerate for new libtool. + * Makefile.in: Ditto. + * include/Makefile.in: Ditto. + * aclocal.m4: Ditto. + +2008-08-25 Andreas Tobler + + * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and + FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. + Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. + Adjust copyright notice. + * src/powerpc/ffi.c: Add two new flags to indicate if we have one + register or two register to use for FFI_SYSV structs. + (ffi_prep_cif_machdep): Pass the right register flag introduced above. + (ffi_closure_helper_SYSV): Fix the return type for + FFI_SYSV_TYPE_SMALL_STRUCT. Comment. + Adjust copyright notice. + +2008-07-16 Kaz Kojima + + * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned + int. + +2008-06-17 Ralf Wildenhues + + * configure: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2008-06-07 Joseph Myers + + * configure.ac (parisc*-*-linux*, powerpc-*-sysv*, + powerpc-*-beos*): Remove. + * configure: Regenerate. + +2008-05-09 Julian Brown + + * Makefile.am (LTLDFLAGS): New. + (libffi_la_LDFLAGS): Use above. + * Makefile.in: Regenerate. + +2008-04-18 Paolo Bonzini + + PR bootstrap/35457 + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2008-03-26 Kaz Kojima + + * src/sh/sysv.S: Add .note.GNU-stack on Linux. + * src/sh64/sysv.S: Likewise. + +2008-03-26 Daniel Jacobowitz + + * src/arm/sysv.S: Fix ARM comment marker. + +2008-03-26 Jakub Jelinek + + * src/alpha/osf.S: Add .note.GNU-stack on Linux. + * src/s390/sysv.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + * src/x86/unix64.S: Likewise. + * src/x86/sysv.S: Likewise. + * src/sparc/v8.S: Likewise. + * src/sparc/v9.S: Likewise. + * src/m68k/sysv.S: Likewise. + * src/arm/sysv.S: Likewise. + +2008-03-16 Ralf Wildenhues + + * aclocal.m4: Regenerate. + * configure: Likewise. + * Makefile.in: Likewise. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + +2008-02-12 Bjoern Koenig + Andreas Tobler + + * configure.ac: Add amd64-*-freebsd* target. + * configure: Regenerate. + +2008-01-30 H.J. Lu + + PR libffi/34612 + * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when + returning struct. + + * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" + tests. + +2008-01-24 David Edelsohn + + * configure: Regenerate. + +2008-01-06 Andreas Tobler + + * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko. + +2008-01-05 Andreas Tobler + + PR testsuite/32843 + * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for + signed/unsigned int8/16 for X86_DARWIN. + Updated copyright info. + Handle one and two byte structs with special cif->flags. + * src/x86/ffitarget.h: Add special types for one and two byte structs. + Updated copyright info. + * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like + sysv.S + Remove code to pop args from the stack after call. + Special-case signed/unsigned for int8/16, one and two byte structs. + (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, + FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, + FFI_TYPE_SINT32. + Updated copyright info. + +2007-12-08 David Daney + + * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with + SUBU, add with ADDU and use smaller code sequences. + +2007-12-07 David Daney + + * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return + type. + +2007-12-06 David Daney + + * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already + defined. + (ffi_java_raw): New typedef. + (ffi_java_raw_call, ffi_java_ptrarray_to_raw, + ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to + ffi_java_raw. + (ffi_java_raw_closure) : Same. + (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change + parameter types. + * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with + FFI_SIZEOF_JAVA_RAW. + (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw. + Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use + sizeof(ffi_java_raw) for alignment calculations. + (ffi_java_ptrarray_to_raw): Same. + (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER + if FFI_SIZEOF_JAVA_RAW == 4. + (ffi_java_raw_to_rvalue): Same. + (ffi_java_raw_call): Change type of raw to ffi_java_raw. + (ffi_java_translate_args): Same. + (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change + parameter types. + * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI. + +2007-12-06 David Daney + + * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on + pointer values. + +2007-12-01 Andreas Tobler + + PR libffi/31937 + * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. + Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. + * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and + set the NUM_FPR_ARG_REGISTERS according to. + Add support for potential soft-float support under hard-float + architecture. + (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of + FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according + to the FFI_LINUX_SOFT_FLOAT ABI. + (ffi_prep_cif_machdep): Likewise. + (ffi_closure_helper_SYSV): Likewise. + * src/powerpc/ppc_closure.S: Make sure not to store float/double + on archs where __NO_FPRS__ is true. + Add FFI_TYPE_UINT128 support. + * src/powerpc/sysv.S: Add support for soft-float long-double-128. + Adjust copyright notice. + +2007-11-25 Andreas Tobler + + * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... + * include/ffi_common.h: ... here. + Update copyright. + +2007-11-17 Andreas Tobler + + * src/powerpc/sysv.S: Load correct cr to compare if we have long double. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. + * testsuite/libffi.call/return_ldl.c: New test. + +2007-09-04 + + * src/arm/sysv.S (UNWIND): New. + (Whole file): Conditionally compile unwinder directives. + * src/arm/sysv.S: Add unwinder directives. + + * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes. + Only treat r0 as a struct address if we're actually returning a + struct by address. + Only copy the bytes that are actually within a struct. + (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes + is returned in r0, not passed by address. + (ffi_call): Allocate a word-sized temporary for the case where + a composite is returned in r0. + (ffi_prep_incoming_args_SYSV): Align as necessary. + +2007-08-05 Steven Newbury + + * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of + directly using the sys_cacheflush syscall. + +2007-07-27 Andrew Haley + + * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float. + +2007-09-03 Maciej W. Rozycki + + * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS. + * configure.ac: Likewise. + * Makefile.in: Regenerate. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + * configure: Likewise. + +2007-08-24 David Daney + + * testsuite/libffi.call/return_sl.c: New test. + +2007-08-10 David Daney + + * testsuite/libffi.call/cls_multi_ushort.c, + testsuite/libffi.call/cls_align_uint16.c, + testsuite/libffi.call/nested_struct1.c, + testsuite/libffi.call/nested_struct3.c, + testsuite/libffi.call/cls_7_1_byte.c, + testsuite/libffi.call/nested_struct5.c, + testsuite/libffi.call/cls_double.c, + testsuite/libffi.call/nested_struct7.c, + testsuite/libffi.call/cls_sint.c, + testsuite/libffi.call/nested_struct9.c, + testsuite/libffi.call/cls_20byte1.c, + testsuite/libffi.call/cls_multi_sshortchar.c, + testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_3byte2.c, + testsuite/libffi.call/cls_multi_schar.c, + testsuite/libffi.call/cls_multi_uchar.c, + testsuite/libffi.call/cls_19byte.c, + testsuite/libffi.call/cls_9byte1.c, + testsuite/libffi.call/cls_align_float.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/problem1.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/cls_sshort.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/cls_align_double.c, + testsuite/libffi.call/nested_struct.c, + testsuite/libffi.call/cls_2byte.c, + testsuite/libffi.call/nested_struct10.c, + testsuite/libffi.call/cls_4byte.c, + testsuite/libffi.call/cls_6byte.c, + testsuite/libffi.call/cls_8byte.c, + testsuite/libffi.call/cls_multi_sshort.c, + testsuite/libffi.call/cls_align_sint16.c, + testsuite/libffi.call/cls_align_uint32.c, + testsuite/libffi.call/cls_20byte.c, + testsuite/libffi.call/cls_float.c, + testsuite/libffi.call/nested_struct2.c, + testsuite/libffi.call/cls_5_1_byte.c, + testsuite/libffi.call/nested_struct4.c, + testsuite/libffi.call/cls_24byte.c, + testsuite/libffi.call/nested_struct6.c, + testsuite/libffi.call/cls_64byte.c, + testsuite/libffi.call/nested_struct8.c, + testsuite/libffi.call/cls_uint.c, + testsuite/libffi.call/cls_multi_ushortchar.c, + testsuite/libffi.call/cls_schar.c, + testsuite/libffi.call/cls_uchar.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_1_1byte.c, + testsuite/libffi.call/cls_12byte.c, + testsuite/libffi.call/cls_3_1byte.c, + testsuite/libffi.call/cls_3byte1.c, + testsuite/libffi.call/cls_4_1byte.c, + testsuite/libffi.call/cls_6_1_byte.c, + testsuite/libffi.call/cls_16byte.c, + testsuite/libffi.call/cls_18byte.c, + testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/cls_9byte2.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/cls_ushort.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/cls_5byte.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_7byte.c, + testsuite/libffi.call/cls_align_sint32.c, + testsuite/libffi.special/unwindtest_ffi_call.cc, + testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*. + +2007-08-10 David Daney + + PR libffi/28313 + * configure.ac: Don't treat mips64 as a special case. + * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S. + * configure: Regenerate + * Makefile.in: Ditto. + * fficonfig.h.in: Ditto. + * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent. + (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros. + (FFI_DEFAULT_ABI): Set for n64 case. + (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases. + * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE. + (ffi_closure_N32): New function. + (.eh_frame): New section + * src/mips/o32.S: Clean up comments. + (ffi_closure_O32): Pass ffi_closure parameter in $12. + * src/mips/ffi.c: Use FFI_MIPS_N32 instead of + _MIPS_SIM == _ABIN32 throughout. + (FFI_MIPS_STOP_HERE): New, use in place of + ffi_stop_here. + (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite + to support n32/n64 ABIs. + (calc_n32_struct_flags): Rewrite. + (calc_n32_return_struct_flags): Remove unused variable. Reverse + position of flag bits. + (ffi_prep_cif_machdep): Rewrite n32 portion. + (ffi_call): Enable for n64. Add special handling for small structure + return values. + (ffi_prep_closure_loc): Add n32 and n64 support. + (ffi_closure_mips_inner_O32): Add cast to silence warning. + (copy_struct_N32, ffi_closure_mips_inner_N32): New functions. + +2007-08-08 David Daney + + * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition. + * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type + specifiers. + * testsuite/libffi.call/nested_struct1.c (main): Ditto. + * testsuite/libffi.call/cls_sint.c (main): Ditto. + * testsuite/libffi.call/nested_struct9.c (main): Ditto. + * testsuite/libffi.call/cls_20byte1.c (main): Ditto. + * testsuite/libffi.call/cls_9byte1.c (main): Ditto. + * testsuite/libffi.call/closure_fn1.c (main): Ditto. + * testsuite/libffi.call/closure_fn3.c (main): Ditto. + * testsuite/libffi.call/return_dbl2.c (main): Ditto. + * testsuite/libffi.call/cls_sshort.c (main): Ditto. + * testsuite/libffi.call/return_fl3.c (main): Ditto. + * testsuite/libffi.call/closure_fn5.c (main): Ditto. + * testsuite/libffi.call/nested_struct.c (main): Ditto. + * testsuite/libffi.call/nested_struct10.c (main): Ditto. + * testsuite/libffi.call/return_ll1.c (main): Ditto. + * testsuite/libffi.call/cls_8byte.c (main): Ditto. + * testsuite/libffi.call/cls_align_uint32.c (main): Ditto. + * testsuite/libffi.call/cls_align_sint16.c (main): Ditto. + * testsuite/libffi.call/cls_20byte.c (main): Ditto. + * testsuite/libffi.call/nested_struct2.c (main): Ditto. + * testsuite/libffi.call/cls_24byte.c (main): Ditto. + * testsuite/libffi.call/nested_struct6.c (main): Ditto. + * testsuite/libffi.call/cls_uint.c (main): Ditto. + * testsuite/libffi.call/cls_12byte.c (main): Ditto. + * testsuite/libffi.call/cls_16byte.c (main): Ditto. + * testsuite/libffi.call/closure_fn0.c (main): Ditto. + * testsuite/libffi.call/cls_9byte2.c (main): Ditto. + * testsuite/libffi.call/closure_fn2.c (main): Ditto. + * testsuite/libffi.call/return_dbl1.c (main): Ditto. + * testsuite/libffi.call/closure_fn4.c (main): Ditto. + * testsuite/libffi.call/closure_fn6.c (main): Ditto. + * testsuite/libffi.call/cls_align_sint32.c (main): Ditto. + +2007-08-07 Andrew Haley + + * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous + checkin. + +2007-08-06 Andrew Haley + + PR testsuite/32843 + * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, + FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, + FFI_TYPE_SINT32. + +2007-08-02 David Daney + + * testsuite/libffi.call/return_ul.c (main): Define return type as + ffi_arg. Use proper printf conversion specifier. + +2007-07-30 Andrew Haley + + PR testsuite/32843 + * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for + signed/unsigned int8/16. + * src/x86/sysv.S (ffi_call_SYSV): Rewrite to: + Use a jump table. + Remove code to pop args from the stack after call. + Special-case signed/unsigned int8/16. + * testsuite/libffi.call/return_sc.c (main): Revert. + +2007-07-26 Richard Guenther + + PR testsuite/32843 + * testsuite/libffi.call/return_sc.c (main): Verify call + result as signed char, not ffi_arg. + +2007-07-16 Rainer Orth + + * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64. + * configure: Regenerate. + +2007-07-11 David Daney + + * src/mips/ffi.c: Don't include sys/cachectl.h. + (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of + cacheflush(). + +2007-05-18 Aurelien Jarno + + * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted + from (ffi_prep_closure): ... this. + (FFI_INIT_TRAMPOLINE): Adjust. + +2005-12-31 Phil Blundell + + * src/arm/ffi.c (ffi_prep_incoming_args_SYSV, + ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support. + * src/arm/sysv.S(ffi_closure_SYSV): Likewise. + * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. + (FFI_CLOSURES): Enable closure support. + +2007-07-03 Andrew Haley + + * testsuite/libffi.call/cls_multi_ushort.c, + testsuite/libffi.call/cls_align_uint16.c, + testsuite/libffi.call/nested_struct1.c, + testsuite/libffi.call/nested_struct3.c, + testsuite/libffi.call/cls_7_1_byte.c, + testsuite/libffi.call/cls_double.c, + testsuite/libffi.call/nested_struct5.c, + testsuite/libffi.call/nested_struct7.c, + testsuite/libffi.call/cls_sint.c, + testsuite/libffi.call/nested_struct9.c, + testsuite/libffi.call/cls_20byte1.c, + testsuite/libffi.call/cls_multi_sshortchar.c, + testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_3byte2.c, + testsuite/libffi.call/cls_multi_schar.c, + testsuite/libffi.call/cls_multi_uchar.c, + testsuite/libffi.call/cls_19byte.c, + testsuite/libffi.call/cls_9byte1.c, + testsuite/libffi.call/cls_align_float.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/problem1.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/cls_sshort.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/cls_align_double.c, + testsuite/libffi.call/cls_2byte.c, + testsuite/libffi.call/nested_struct.c, + testsuite/libffi.call/nested_struct10.c, + testsuite/libffi.call/cls_4byte.c, + testsuite/libffi.call/cls_6byte.c, + testsuite/libffi.call/cls_8byte.c, + testsuite/libffi.call/cls_multi_sshort.c, + testsuite/libffi.call/cls_align_uint32.c, + testsuite/libffi.call/cls_align_sint16.c, + testsuite/libffi.call/cls_float.c, + testsuite/libffi.call/cls_20byte.c, + testsuite/libffi.call/cls_5_1_byte.c, + testsuite/libffi.call/nested_struct2.c, + testsuite/libffi.call/cls_24byte.c, + testsuite/libffi.call/nested_struct4.c, + testsuite/libffi.call/nested_struct6.c, + testsuite/libffi.call/cls_64byte.c, + testsuite/libffi.call/nested_struct8.c, + testsuite/libffi.call/cls_uint.c, + testsuite/libffi.call/cls_multi_ushortchar.c, + testsuite/libffi.call/cls_schar.c, + testsuite/libffi.call/cls_uchar.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_1_1byte.c, + testsuite/libffi.call/cls_12byte.c, + testsuite/libffi.call/cls_3_1byte.c, + testsuite/libffi.call/cls_3byte1.c, + testsuite/libffi.call/cls_4_1byte.c, + testsuite/libffi.call/cls_6_1_byte.c, + testsuite/libffi.call/cls_16byte.c, + testsuite/libffi.call/cls_18byte.c, + testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/cls_9byte2.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/cls_ushort.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/cls_5byte.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_7byte.c, + testsuite/libffi.call/cls_align_sint32.c, + testsuite/libffi.special/unwindtest_ffi_call.cc, + testsuite/libffi.special/unwindtest.cc: Enable for ARM. + +2007-07-05 H.J. Lu + + * aclocal.m4: Regenerated. + +2007-06-02 Paolo Bonzini + + * configure: Regenerate. + +2007-05-23 Steve Ellcey + + * Makefile.in: Regenerate. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2007-05-10 Roman Zippel + + * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV, + ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. + * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. + * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. + (FFI_CLOSURES): Enable closure support. + +2007-05-10 Roman Zippel + + * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test. + * configure: Regenerate. + * fficonfig.h.in: Regenerate. + * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC, + CFI_OFFSET,CFI_DEF_CFA): New macros. + (ffi_call_SYSV): Add callframe annotation. + +2007-05-10 Roman Zippel + + * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix + numerous test suite failures. + * src/m68k/sysv.S (ffi_call_SYSV): Likewise. + +2007-04-11 Paolo Bonzini + + * Makefile.am (EXTRA_DIST): Bring up to date. + * Makefile.in: Regenerate. + * src/frv/eabi.S: Remove RCS keyword. + +2007-04-06 Richard Henderson + + * configure.ac: Tidy target case. + (HAVE_LONG_DOUBLE): Allow the target to override. + * configure: Regenerate. + * include/ffi.h.in: Don't define ffi_type_foo if + LIBFFI_HIDE_BASIC_TYPES is defined. + (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define + to ffi_type_double. + * types.c (LIBFFI_HIDE_BASIC_TYPES): Define. + (FFI_TYPEDEF, ffi_type_void): Mark the data const. + (ffi_type_longdouble): Special case for Alpha. Don't define + if long double == double. + + * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value. + (ffi_prep_cif_machdep): Handle it as the 128-bit type. + (ffi_call, ffi_closure_osf_inner): Likewise. + (ffi_closure_osf_inner): Likewise. Mark hidden. + (ffi_call_osf, ffi_closure_osf): Mark hidden. + * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition. + * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden. + (load_table): Handle 128-bit long double. + + * testsuite/libffi.call/float4.c: Add -mieee for alpha. + +2007-04-06 Tom Tromey + + PR libffi/31491: + * README: Fixed bug in example. + +2007-04-03 Jakub Jelinek + + * src/closures.c: Include sys/statfs.h. + (_GNU_SOURCE): Define on Linux. + (FFI_MMAP_EXEC_SELINUX): Define. + (selinux_enabled): New variable. + (selinux_enabled_check): New function. + (is_selinux_enabled): Define. + (dlmmap): Use it. + +2007-03-24 Uros Bizjak + + * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static. + Use 'volatile float sum' to create sum of floats to avoid false + negative due to excess precision on ix86 targets. + (main): Ditto. + +2007-03-08 Alexandre Oliva + + * src/powerpc/ffi.c (flush_icache): Fix left-over from previous + patch. + (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. + +2007-03-07 Alexandre Oliva + + * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. + (ffi_prep_closure_loc): New. + (ffi_prep_raw_closure_loc): New. + (ffi_prep_java_raw_closure_loc): New. + * src/closures.c: New file. + * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): + Replace sflags with exec_offset. + [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, + sub_segment_exec_offset): New macros. + (get_segment_flags, set_segment_flags, check_segment_merge): New + macros. + (is_mmapped_segment, is_extern_segment): Use get_segment_flags. + (add_segment, sys_alloc, create_mspace, create_mspace_with_base, + destroy_mspace): Use new macros. + (sys_alloc): Silence warning. + * Makefile.am (libffi_la_SOURCES): Add src/closures.c. + * Makefile.in: Rebuilt. + * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in + terms of ffi_prep_closure_loc. + * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted + from... + (ffi_prep_raw_closure): ... this. Re-implement in terms of the + renamed version. + * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and + adjusted from... + (ffi_prep_java_raw_closure): ... this. Re-implement in terms of + the renamed version. + * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from + (ffi_prep_closure): ... this. + * src/pa/ffi.c: Likewise. + * src/cris/ffi.c: Likewise. Adjust. + * src/frv/ffi.c: Likewise. + * src/ia64/ffi.c: Likewise. + * src/mips/ffi.c: Likewise. + * src/powerpc/ffi_darwin.c: Likewise. + * src/s390/ffi.c: Likewise. + * src/sh/ffi.c: Likewise. + * src/sh64/ffi.c: Likewise. + * src/sparc/ffi.c: Likewise. + * src/x86/ffi64.c: Likewise. + * src/x86/ffi.c: Likewise. + (FFI_INIT_TRAMPOLINE): Adjust. + (ffi_prep_raw_closure_loc): Renamed and adjusted from... + (ffi_prep_raw_closure): ... this. + * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from + (ffi_prep_closure): ... this. + (flush_icache): Adjust. + +2007-03-07 Alexandre Oliva + + * src/dlmalloc.c: New file, imported version 2.8.3 of Doug + Lea's malloc. + +2007-03-01 Brooks Moses + + * Makefile.am: Add dummy install-pdf target. + * Makefile.in: Regenerate + +2007-02-13 Andreas Krebbel + + * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep, + ffi_closure_helper_SYSV): Add long double handling. + +2007-02-02 Jakub Jelinek + + * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 + immediately after bctrl instruction. + +2007-01-18 Alexandre Oliva + + * Makefile.am (all-recursive, install-recursive, + mostlyclean-recursive, clean-recursive, distclean-recursive, + maintainer-clean-recursive): Add missing targets. + * Makefile.in: Rebuilt. + +2006-12-14 Andreas Tobler + + * configure.ac: Add TARGET for x86_64-*-darwin*. + * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources + for X86_DARWIN. + * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*. + * src/x86/darwin64.S: New file for x86_64-*-darwin* support. + * configure: Regenerate. + * Makefile.in: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for + ffi_call only. + +2006-12-13 Andreas Tobler + + * aclocal.m4: Regenerate with aclocal -I .. as written in the + Makefile.am. + +2006-10-31 Geoffrey Keating + + * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. + (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for + Darwin. + * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. + * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. + +2006-10-10 Paolo Bonzini + Sandro Tolaini + + * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and + conditional. + * configure: Regenerated. + * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case. + (EXTRA_DIST): Add src/x86/darwin.S. + * Makefile.in: Regenerated. + * include/Makefile.in: Regenerated. + * testsuite/Makefile.in: Regenerated. + + * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like + X86_WIN32, and additionally align stack to 16 bytes. + * src/x86/darwin.S: New, based on sysv.S. + * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs. + +2006-09-12 David Daney + + PR libffi/23935 + * include/Makefile.am: Install both ffi.h and ffitarget.h in + $(libdir)/gcc/$(target_alias)/$(gcc_version)/include. + * aclocal.m4: Regenerated for automake 1.9.6. + * Makefile.in: Regenerated. + * include/Makefile.in: Regenerated. + * testsuite/Makefile.in: Regenerated. + +2006-08-17 Andreas Tobler + + * include/ffi_common.h (struct): Revert accidental commit. + +2006-08-15 Andreas Tobler + + * include/ffi_common.h: Remove lint directives. + * include/ffi.h.in: Likewise. + +2006-07-25 Torsten Schoenfeld + + * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly + for 32-bit architectures. + * testsuite/libffi.call/return_ul.c: New test case. + +2006-07-19 David Daney + + * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips, + xfail remains for mips64. + +2006-05-23 Carlos O'Donell + + * Makefile.am: Add install-html target. Add install-html to .PHONY + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2006-05-18 John David Anglin + + * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from + stack slot. + +2006-04-22 Andreas Tobler + + * README: Remove notice about 'Crazy Comments'. + * src/debug.c: Remove lint directives. Cleanup white spaces. + * src/java_raw_api.c: Likewise. + * src/prep_cif.c: Likewise. + * src/raw_api.c: Likewise. + * src/ffitest.c: Delete. No longer needed, all test cases migrated + to the testsuite. + * src/arm/ffi.c: Remove lint directives. + * src/m32r/ffi.c: Likewise. + * src/pa/ffi.c: Likewise. + * src/powerpc/ffi.c: Likewise. + * src/powerpc/ffi_darwin.c: Likewise. + * src/sh/ffi.c: Likewise. + * src/sh64/ffi.c: Likewise. + * src/x86/ffi.c: Likewise. + * testsuite/libffi.call/float2.c: Likewise. + * testsuite/libffi.call/promotion.c: Likewise. + * testsuite/libffi.call/struct1.c: Likewise. + +2006-04-13 Andreas Tobler + + * src/pa/hpux32.S: Correct unwind offset calculation for + ffi_closure_pa32. + * src/pa/linux.S: Likewise. + +2006-04-12 James E Wilson + + PR libgcj/26483 + * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros. + (hfa_type_load): Call stf_spill. + (hfa_type_store): Call ldf_fill. + (ffi_call): Adjust calls to above routines. Add local temps for + macro result. + +2006-04-10 Matthias Klose + + * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib + directory names containing underscores. + +2006-04-07 James E Wilson + + * testsuite/libffi.call/float4.c: New testcase. + +2006-04-05 John David Anglin + Andreas Tobler + + * Makefile.am: Add PA_HPUX port. + * Makefile.in: Regenerate. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + * configure.ac: Add PA_HPUX rules. + * configure: Regenerate. + * src/pa/ffitarget.h: Rename linux target to PA_LINUX. + Add PA_HPUX and PA64_HPUX. + Rename FFI_LINUX ABI to FFI_PA32 ABI. + (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets. + (FFI_TYPE_SMALL_STRUCT2): Define. + (FFI_TYPE_SMALL_STRUCT4): Likewise. + (FFI_TYPE_SMALL_STRUCT8): Likewise. + (FFI_TYPE_SMALL_STRUCT3): Redefine. + (FFI_TYPE_SMALL_STRUCT5): Likewise. + (FFI_TYPE_SMALL_STRUCT6): Likewise. + (FFI_TYPE_SMALL_STRUCT7): Likewise. + * src/pa/ffi.c (ROUND_DOWN): Delete. + (fldw, fstw, fldd, fstd): Use '__asm__'. + (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2, + FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. + (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment. + Simplify incrementing of stack slot variable. Change type of local + 'n' to unsigned int. + (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long + double on PA_HPUX. + (ffi_prep_cif_machdep): Likewise. + (ffi_call): Likewise. + (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change + return type to ffi_status. Simplify incrementing of stack slot + variable. Only copy floating point argument registers when PA_LINUX + is true. Reformat debug statement. + Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and + FFI_TYPE_SMALL_STRUCT8. + (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to + declaration. + (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX. + Add nops to cache flush. Add trampoline for PA_HPUX. + * src/pa/hpux32.S: New file. + * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename + ffi_prep_args_LINUX to ffi_prep_args_pa32. + Localize labels. Add support for 2, 4 and 8-byte small structs. Handle + unaligned destinations in 3, 5, 6 and 7-byte small structs. Order + argument type checks so that common argument types appear first. + (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename + ffi_closure_inner_LINUX to ffi_closure_inner_pa32. + +2006-03-24 Alan Modra + + * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default + for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of + FFI_TYPE_LONGDOUBLE. + (ffi_prep_args64): Assert using IBM extended double. + (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. + Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. + (ffi_call): Handle FFI_LINUX. + (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs + gpr3 return pointer as for struct return. Handle FFI_LINUX + FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" + unnecessarily. + * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 + for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. + Don't use r6 as pointer to results, instead use sp offset. Don't + make a special call to load lr with case table address, instead + use offset from previous call. + * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. + * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double + return. + +2006-03-15 Kaz Kojima + + * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments + passed with FP registers correctly. + (ffi_closure_helper_SYSV): Likewise. + * src/sh64/sysv.S: Likewise. + +2006-03-01 Andreas Tobler + + * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif, + args and userdata unused. + (closure_test_fn1): Mark cif and userdata unused. + (main): Remove unused res. + +2006-02-28 Andreas Tobler + + * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for + -O2, -O3, -Os and the warning flags -W -Wall. + * testsuite/libffi.special/special.exp: Likewise. + * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark + unused parameter unused for gcc or else do nothing. + * testsuite/libffi.special/ffitestcxx.h: Likewise. + * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif + and userdata unused. + * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise. + * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise. + * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise. + * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise. + * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise. + * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise. + * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise. + * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise. + * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise. + * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise. + * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise. + * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise. + * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise. + * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise. + * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise. + * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise. + * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise. + * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise. + * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise. + * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise. + * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise. + * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise. + * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise. + * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast + void* to avoid compiler warning. + (main): Likewise. + (cls_struct_align_gn): Mark cif and userdata unused. + * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn): + Likewise. + * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise. + * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise. + * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and + data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and + data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif + and data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and + data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and + data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif + and data unused. + (main): Cast res_call to silence gcc. + * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and + userdata unused. + (cls_ret_schar_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and + userdata unused. + (cls_ret_sint_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and + userdata unused. + (cls_ret_sshort_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and + userdata unused. + (cls_ret_uchar_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and + userdata unused. + (cls_ret_uint_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif + and userdata unused. + * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and + userdata unused. + (cls_ret_ushort_fn): Cast printf parameter to silence gcc. + * testsuite/libffi.call/float.c (floating): Remove unused parameter e. + * testsuite/libffi.call/float1.c (main): Remove unused variable i. + Cleanup white spaces. + * testsuite/libffi.call/negint.c (checking): Remove unused variable i. + * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark + cif and userdata unused. + * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn): + Likewise. + * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise. + * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf + formatters to silence gcc. + (B_gn): Mark cif and userdata unused. + * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata + unused. + * testsuite/libffi.call/nested_struct4.c: Mention related PR. + (B_gn): Mark cif and userdata unused. + * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata + unused. + * testsuite/libffi.call/nested_struct6.c: Mention related PR. + (B_gn): Mark cif and userdata unused. + * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata + unused. + * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise. + * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise. + * testsuite/libffi.call/problem1.c (stub): Likewise. + * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence + gcc. + * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned + in the last commit for this test case in the test case itself. + * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as + unused. + * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise. + * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise. + * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise. + * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise. + * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise. + * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise. + +2006-02-22 Kaz Kojima + + * src/sh/sysv.S: Fix register numbers in the FDE for + ffi_closure_SYSV. + +2006-02-20 Andreas Tobler + + * testsuite/libffi.call/return_fl2.c (return_fl): Remove static + declaration to avoid a false negative on ix86. See PR323. + +2006-02-18 Kaz Kojima + + * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable + and cast integer to void * if needed. Update the pointer to + the FP register saved area correctly. + +2006-02-17 Andreas Tobler + + * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630 + is fixed. + * testsuite/libffi.call/nested_struct4.c: Likewise. + +2006-02-16 Andreas Tobler + + * testsuite/libffi.call/return_dbl.c: New test case. + * testsuite/libffi.call/return_dbl1.c: Likewise. + * testsuite/libffi.call/return_dbl2.c: Likewise. + * testsuite/libffi.call/return_fl.c: Likewise. + * testsuite/libffi.call/return_fl1.c: Likewise. + * testsuite/libffi.call/return_fl2.c: Likewise. + * testsuite/libffi.call/return_fl3.c: Likewise. + * testsuite/libffi.call/closure_fn6.c: Likewise. + + * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong + definition. + * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition + here to be used by other test cases too. + + * testsuite/libffi.call/nested_struct10.c: New test case. + * testsuite/libffi.call/nested_struct9.c: Likewise. + * testsuite/libffi.call/nested_struct8.c: Likewise. + * testsuite/libffi.call/nested_struct7.c: Likewise. + * testsuite/libffi.call/nested_struct6.c: Likewise. + * testsuite/libffi.call/nested_struct5.c: Likewise. + * testsuite/libffi.call/nested_struct4.c: Likewise. + +2006-01-21 Andreas Tobler + + * configure.ac: Enable libffi for sparc64-*-freebsd*. + * configure: Rebuilt. + +2006-01-18 Jakub Jelinek + + * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, + instead do the shifting inline. + * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 + shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 + and 8 byte structs, for the remaining struct sizes don't call + __lshrdi3, instead do the shifting inline. + +2005-12-07 Thiemo Seufer + + * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add + missing parentheses. + * src/mips/o32.S (ffi_call_O32): Code formatting. Define + and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. + (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, + A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, + V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, + FA_0_0_OFF2. + * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix + endianness bugs. + (ffi_prep_closure): Improve trampoline instruction scheduling. + (ffi_closure_mips_inner_O32): Fix endianness bugs. + +2005-12-03 Alan Modra + + * src/powerpc/ffi.c: Formatting. + (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. + (ffi_prep_args64): Likewise. + +2005-09-30 Geoffrey Keating + + * testsuite/lib/libffi-dg.exp (libffi_target_compile): For + darwin, use -shared-libgcc not -lgcc_s, and explain why. + +2005-09-26 Tom Tromey + + * testsuite/libffi.call/float1.c (value_type): New typedef. + (CANARY): New define. + (main): Check for result buffer overflow. + * src/powerpc/linux64.S: Handle linux64 long double returns. + * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. + (ffi_prep_cif_machdep): Handle linux64 long double returns. + +2005-08-25 Alan Modra + + PR target/23404 + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack + homed fp args. + (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. + +2005-08-11 Jakub Jelinek + + * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. + (AH_BOTTOM): Add FFI_HIDDEN definition. + * configure: Rebuilt. + * fficonfig.h.in: Rebuilt. + * src/powerpc/ffi.c (hidden): Remove. + (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, + ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, + .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. + * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, + add FFI_HIDDEN to its prototype. + (ffi_closure_SYSV_inner): New. + * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. + * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. + +2005-08-10 Alfred M. Szmidt + + PR libffi/21819: + * configure: Rebuilt. + * configure.ac: Handle i*86-*-gnu*. + +2005-08-09 Jakub Jelinek + + * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use + DW_CFA_offset_extended_sf rather than + DW_CFA_GNU_negative_offset_extended. + * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. + +2005-07-22 SUGIOKA Toshinobu + + * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly + on sh3. + (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. + * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is + partially on register. + (ffi_closure_helper_SYSV): Likewise. + (ffi_prep_cif_machdep): Don't set too many cif->flags. + +2005-07-20 Kaz Kojima + + * src/sh/ffi.c (ffi_call): Handle small structures correctly. + Remove empty line. + * src/sh64/ffi.c (simple_type): Remove. + (return_type): Handle small structures correctly. + (ffi_prep_args): Likewise. + (ffi_call): Likewise. + (ffi_closure_helper_SYSV): Likewise. + * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. + Emit position independent code if PIC and remove wrong datalabel + prefixes from EH data. + +2005-07-19 Andreas Tobler + + * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. + * Makefile.in: Regenerate. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + * configure.ac: Add POWERPC_FREEBSD rules. + * configure: Regenerate. + * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. + (FFI_SYSV_TYPE_SMALL_STRUCT): Define. + * src/powerpc/ffi.c: Add flags to handle small structure returns + in ffi_call_SYSV. + (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. + Aka FFI_SYSV. + (ffi_closure_helper_SYSV): Likewise. + * src/powerpc/ppc_closure.S: Add return types for small structures. + * src/powerpc/sysv.S: Add bits to handle small structures for + final SYSV 4 ABI. + +2005-07-10 Andreas Tobler + + * testsuite/libffi.call/cls_5_1_byte.c: New test file. + * testsuite/libffi.call/cls_6_1_byte.c: Likewise. + * testsuite/libffi.call/cls_7_1_byte.c: Likewise. + +2005-07-05 Randolph Chung + + * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 + as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte + structures. Kill compilation warnings. + (ffi_closure_inner_LINUX): Print return values as hex in debug + message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. + Properly handle 5-7 byte structure returns. + * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) + (FFI_TYPE_SMALL_STRUCT2): Remove. + (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) + (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. + * src/pa/linux.S: Mark source file as using PA1.1 assembly. + (checksmst1, checksmst2): Remove. + (checksmst3): Optimize handling of 3-byte struct returns. + (checksmst567): Properly handle 5-7 byte struct returns. + +2005-06-15 Rainer Orth + + PR libgcj/21943 + * src/mips/n32.S: Enforce PIC code. + * src/mips/o32.S: Likewise. + +2005-06-15 Rainer Orth + + * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64. + * configure: Regenerate. + +2005-06-01 Alan Modra + + * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET + to call ffi_closure_helper_SYSV. Append @local instead. + * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. + +2005-05-17 Kelley Cook + + * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. + Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. + * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config. + * aclocal.m4, configure, fficonfig.h.in, Makefile.in, + include/Makefile.in, testsuite/Makefile.in: Regenerate. + +2005-05-09 Mike Stump + + * configure: Regenerate. + +2005-05-08 Richard Henderson + + PR libffi/21285 + * src/alpha/osf.S: Update unwind into to match code. + +2005-05-04 Andreas Degert + Richard Henderson + + * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in + bit 11 of flags. + (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. + (ffi_prep_closure): Set carry bit if sse-used flag set. + * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. + Only load sse registers if ssecount non-zero. + (ffi_closure_unix64): Only save sse registers if carry set on entry. + +2005-04-29 Ralf Corsepius + + * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*, + powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*. + * configure: Regenerate. + +2005-04-20 Hans-Peter Nilsson + + * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use, + have Tcl8.3-compatible intermediate variable. + +2005-04-18 Simon Posnjak + Hans-Peter Nilsson + + * Makefile.am: Add CRIS support. + * configure.ac: Likewise. + * Makefile.in, configure, testsuite/Makefile.in, + include/Makefile.in: Regenerate. + * src/cris: New directory. + * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. + * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. + + * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with + \r?\n in output tests. + +2005-04-12 Mike Stump + + * configure: Regenerate. + +2005-03-30 Hans Boehm + + * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI. + +2005-03-30 Steve Ellcey + + * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute. + (ffi_sarg) Ditto. + * src/ia64/unix.S (ffi_closure_unix): Extend gp + to 64 bits in ILP32 mode. + Load 64 bits even for short data. + +2005-03-23 Mike Stump + + * src/powerpc/darwin.S: Update for -m64 multilib. + * src/powerpc/darwin_closure.S: Likewise. + +2005-03-21 Zack Weinberg + + * configure.ac: Do not invoke TL_AC_GCC_VERSION. + Do not set tool_include_dir. + * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in: + Regenerate. + * include/Makefile.am: Set gcc_version and toollibffidir. + * include/Makefile.in: Regenerate. + +2005-02-22 Andrew Haley + + * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to + odd-numbered register pairs for 64-bit integer types. + +2005-02-23 Andreas Tobler + + PR libffi/20104 + * testsuite/libffi.call/return_ll1.c: New test case. + +2005-02-11 Janis Johnson + + * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options. + * testsuite/libffi.call/float.c: Ditto. + * testsuite/libffi.call/float2.c: Ditto. + * testsuite/libffi.call/float3.c: Ditto. + +2005-02-08 Andreas Tobler + + * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv. + +2005-01-12 Eric Botcazou + + * testsuite/libffi.special/special.exp (cxx_options): Add + -shared-libgcc. + +2004-12-31 Richard Henderson + + * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove. + (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and + offset parameters with a type parameter; deduce size and structure + alignment. Update all users. + +2004-12-31 Richard Henderson + + * src/types.c (FFI_TYPE_POINTER): Define with sizeof. + (FFI_TYPE_LONGDOUBLE): Fix for ia64. + * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move + into ffi_prep_closure. + * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite + from scratch. + +2004-12-27 Richard Henderson + + * src/x86/unix64.S: Fix typo in unwind info. + +2004-12-25 Richard Henderson + + * src/x86/ffi64.c (struct register_args): Rename from stackLayout. + (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS. + (merge_classes): Check for it. + (SSE_CLASS_P): New. + (classify_argument): Pass byte_offset by value; perform all updates + inside struct case. + (examine_argument): Add classes argument; handle + X86_64_COMPLEX_X87_CLASS. + (ffi_prep_args): Merge into ... + (ffi_call): ... here. Share stack frame with ffi_call_unix64. + (ffi_prep_cif_machdep): Setup cif->flags for proper structure return. + (ffi_fill_return_value): Remove. + (ffi_prep_closure): Remove dead assert. + (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner. + Rewrite to use struct register_args instead of va_list. Create + flags for handling structure returns. + * src/x86/unix64.S: Remove dead strings. + (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share + stack frame with ffi_call. Handle structure returns properly. + (float2sse, floatfloat2sse, double2sse): Remove. + (sse2float, sse2double, sse2floatfloat): Remove. + (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite + to handle structure returns properly. + +2004-12-08 David Edelsohn + + * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and + PICFLAG. + * Makefile.in: Regenerated. + +2004-12-02 Richard Sandiford + + * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. + * configure, aclocal.m4, Makefile.in: Regenerate. + * include/Makefile.in, testsuite/Makefile.in: Regenerate. + +2004-11-29 Kelley Cook + + * configure: Regenerate for libtool change. + +2004-11-25 Kelley Cook + + * configure: Regenerate for libtool reversion. + +2004-11-24 Kelley Cook + + * configure: Regenerate for libtool change. + +2004-11-23 John David Anglin + + * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. + +2004-11-23 Richard Sandiford + + * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead + of jal. Use an absolute encoding for the frame information. + +2004-11-23 Kelley Cook + + * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS. + * acinclude.m4: Delete logic for sincludes. + * aclocal.m4, Makefile.in, configure: Regenerate. + * include/Makefile: Likewise. + * testsuite/Makefile: Likewise. + +2004-11-22 Eric Botcazou + + * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers + on a 8-byte boundary. + * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments. + +2004-10-27 Richard Earnshaw + + * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return + long long values. Round stack allocation to a multiple of 8 bytes + for ATPCS compatibility. + * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register + names. Handle returning long long types. Add Thumb and interworking + support. Improve soft-float code. + +2004-10-27 Richard Earnshaw + + * testsuite/lib/libffi-db.exp (load_gcc_lib): New function. + (libffi_exit): New function. + (libffi_init): Build the testglue wrapper if needed. + +2004-10-25 Eric Botcazou + + PR other/18138 + * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc. + +2004-10-25 Kazuhiro Inaoka + + * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0. + +2004-10-20 Kaz Kojima + + * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data. + * testsuite/libffi.call/float3.c: New test case. + +2004-10-18 Kaz Kojima + + * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for + the function returning a structure pointed with R2. + * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to + the structure return value if T bit set. Emit position + independent code and EH data if PIC. + +2004-10-13 Kazuhiro Inaoka + + * Makefile.am: Add m32r support. + * configure.ac: Likewise. + * Makefile.in: Regenerate. + * confiugre: Regenerate. + * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF + (uint64, sint64, double, longdouble) + * src/m32r: New directory. + * src/m32r/ffi.c: New file. + * src/m32r/sysv.S: Likewise. + * src/m32r/ffitarget.h: Likewise. + +2004-10-02 Kaz Kojima + + * testsuite/libffi.call/negint.c: New test case. + +2004-09-14 H.J. Lu + + PR libgcj/17465 + * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path. + Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH, + LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and + DYLD_LIBRARY_PATH. + +2004-09-05 Andreas Tobler + + * testsuite/libffi.call/many_win32.c: Remove whitespaces. + * testsuite/libffi.call/promotion.c: Likewise. + * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup + whitespaces. + * testsuite/libffi.call/return_sc.c: Likewise. + * testsuite/libffi.call/return_uc.c: Likewise. + +2004-09-05 Andreas Tobler + + * src/powerpc/darwin.S: Fix comments and identation. + * src/powerpc/darwin_closure.S: Likewise. + +2004-09-02 Andreas Tobler + + * src/powerpc/ffi_darwin.c: Add flag for longdouble return values. + (ffi_prep_args): Handle longdouble arguments. + (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for + longdouble. + (ffi_closure_helper_DARWIN): Add closure handling for longdouble. + * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble + values. + * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise. + * src/types.c: Defined longdouble size and alignment for darwin. + +2004-09-02 Andreas Tobler + + * src/powerpc/aix.S: Remove whitespaces. + * src/powerpc/aix_closure.S: Likewise. + * src/powerpc/asm.h: Likewise. + * src/powerpc/ffi.c: Likewise. + * src/powerpc/ffitarget.h: Likewise. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/linux64_closure.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + +2004-08-30 Anthony Green + + * Makefile.am: Add frv support. + * Makefile.in, testsuite/Makefile.in: Rebuilt. + * configure.ac: Read configure.host. + * configure.in: Read configure.host. + * configure.host: New file. frv-elf needs libgloss. + * include/ffi.h.in: Force ffi_closure to have a nice big (8) + alignment. This is needed to frv and shouldn't harm the others. + * include/ffi_common.h (ALIGN_DOWN): New macro. + * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files. + +2004-08-24 David Daney + + * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*. + * testsuite/libffi.call/closure_fn1.c: Likewise. + * testsuite/libffi.call/closure_fn2.c Likewise. + * testsuite/libffi.call/closure_fn3.c: Likewise. + * testsuite/libffi.call/closure_fn4.c: Likewise. + * testsuite/libffi.call/closure_fn5.c: Likewise. + * testsuite/libffi.call/cls_18byte.c: Likewise. + * testsuite/libffi.call/cls_19byte.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_20byte1.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_64byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_9byte1.c: Likewise. + * testsuite/libffi.call/cls_9byte2.c: Likewise. + * testsuite/libffi.call/cls_align_double.c: Likewise. + * testsuite/libffi.call/cls_align_float.c: Likewise. + * testsuite/libffi.call/cls_align_longdouble.c: Likewise. + * testsuite/libffi.call/cls_align_pointer.c: Likewise. + * testsuite/libffi.call/cls_align_sint16.c: Likewise. + * testsuite/libffi.call/cls_align_sint32.c: Likewise. + * testsuite/libffi.call/cls_align_sint64.c: Likewise. + * testsuite/libffi.call/cls_align_uint16.c: Likewise. + * testsuite/libffi.call/cls_align_uint32.c: Likewise. + * testsuite/libffi.call/cls_align_uint64.c: Likewise. + * testsuite/libffi.call/cls_double.c: Likewise. + * testsuite/libffi.call/cls_float.c: Likewise. + * testsuite/libffi.call/cls_multi_schar.c: Likewise. + * testsuite/libffi.call/cls_multi_sshort.c: Likewise. + * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. + * testsuite/libffi.call/cls_multi_uchar.c: Likewise. + * testsuite/libffi.call/cls_multi_ushort.c: Likewise. + * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. + * testsuite/libffi.call/cls_schar.c: Likewise. + * testsuite/libffi.call/cls_sint.c: Likewise. + * testsuite/libffi.call/cls_sshort.c: Likewise. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/nested_struct.c: Likewise. + * testsuite/libffi.call/nested_struct1.c: Likewise. + * testsuite/libffi.call/nested_struct2.c: Likewise. + * testsuite/libffi.call/nested_struct3.c: Likewise. + * testsuite/libffi.call/problem1.c: Likewise. + * testsuite/libffi.special/unwindtest.cc: Likewise. + * testsuite/libffi.call/cls_12byte.c: Likewise and set return value + to zero. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + +2004-08-23 David Daney + + PR libgcj/13141 + * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI. + * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation. + (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point + parameters and return types. + (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI. + (ffi_prep_closure): Ditto. + (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix + alignment calculations. + * src/mips/o32.S (ffi_closure_O32): Don't use floating point + instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant. + +2004-08-14 Casey Marshall + + * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to + contain `FFI_TYPE_UINT64' as return type for any 64-bit + integer (O32 ABI only). + (ffi_prep_closure): new function. + (ffi_closure_mips_inner_O32): new function. + * src/mips/ffitarget.h: Define `FFI_CLOSURES' and + `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32. + * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return + 64 bit integers correctly. + (ffi_closure_O32): new function. + Added DWARF-2 unwind info for both functions. + +2004-08-10 Andrew Haley + + * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. + +2004-08-01 Robert Millan + + * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. + * configure: Regenerate. + +2004-07-30 Maciej W. Rozycki + + * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for + and mmap() explicitly instead of relying on preset autoconf cache + variables. + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2004-07-11 Ulrich Weigand + + * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation. + (ffi_check_float_struct): Remove unused prototype. + +2004-06-30 Geoffrey Keating + + * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment + character on Darwin, use '\n\t' instead. + +2004-06-26 Matthias Klose + + * libtool-version: Fix typo in revision/age. + +2004-06-17 Matthias Klose + + * libtool-version: New. + * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname. + * Makefile.in: Regenerate. + +2004-06-15 Paolo Bonzini + + * Makefile.am: Remove useless multilib rules. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate with automake 1.8.5. + * configure.ac: Remove useless multilib configury. + * configure: Regenerate. + +2004-06-15 Paolo Bonzini + + * .cvsignore: New file. + +2004-06-10 Jakub Jelinek + + * src/ia64/unix.S (ffi_call_unix): Insert group barrier break + fp_done. + (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever + changed from 8. + +2004-06-06 Sean McNeil + + * configure.ac: Add x86_64-*-freebsd* support. + * configure: Regenerate. + +2004-04-26 Joe Buck + + Bug 15093 + * configure.ac: Test for existence of mmap and sys/mman.h before + checking blacklist. Fix suggested by Jim Wilson. + * configure: Regenerate. + +2004-04-26 Matt Austern + + * src/powerpc/darwin.S: Go through a non-lazy pointer for initial + FDE location. + * src/powerpc/darwin_closure.S: Likewise. + +2004-04-24 Andreas Tobler + + * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization + error. Reported by Thomas Heller . + * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise. + * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise. + +2004-03-20 Matthias Klose + + * src/pa/linux.S: Fix typo. + +2004-03-19 Matthias Klose + + * Makefile.am: Update. + * Makefile.in: Regenerate. + * src/pa/ffi.h.in: Remove. + * src/pa/ffitarget.h: New file. + +2004-02-10 Randolph Chung + + * Makefile.am: Add PA support. + * Makefile.in: Regenerate. + * include/Makefile.in: Regenerate. + * configure.ac: Add PA target. + * configure: Regenerate. + * src/pa/ffi.c: New file. + * src/pa/ffi.h.in: Add PA support. + * src/pa/linux.S: New file. + * prep_cif.c: Add PA support. + +2004-03-16 Hosaka Yuji + + * src/types.c: Fix alignment size of X86_WIN32 case int64 and + double. + * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type + with ecif->cif->flags. + (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type + with cif->flags. + (ffi_prep_cif_machdep): Add X86_WIN32 struct case. + (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32. + * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b, + sc_retstruct2b): Add for 1 or 2-bytes struct case. + +2004-03-15 Kelley Cook + + * configure.in: Rename file to ... + * configure.ac: ... this. + * fficonfig.h.in: Regenerate. + * Makefile.in: Regenerate. + * include/Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. + +2004-03-12 Matt Austern + + * src/powerpc/darwin.S: Fix EH information so it corresponds to + changes in EH format resulting from addition of linkonce support. + * src/powerpc/darwin_closure.S: Likewise. + +2004-03-11 Andreas Tobler + Paolo Bonzini + + * Makefile.am (AUTOMAKE_OPTIONS): Set them. + Remove VPATH. Remove rules for object files. Remove multilib support. + (AM_CCASFLAGS): Add. + * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER. + (AC_PREREQ): Bump version to 2.59. + (AC_INIT): Fill with version info and bug address. + (ORIGINAL_LD_FOR_MULTILIBS): Remove. + (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE. + De-precious CC so that the right flags are passed down to multilibs. + (AC_MSG_ERROR): Replace obsolete macro AC_ERROR. + (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES. + (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS. + * configure: Rebuilt. + * aclocal.m4: Likewise. + * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise. + * fficonfig.h.in: Likewise. + +2004-03-11 Andreas Schwab + + * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point + arguments from fp registers only for the first 8 parameter slots. + Don't convert a float parameter when passed in memory. + +2004-03-09 Hans-Peter Nilsson + + * configure: Regenerate for config/accross.m4 correction. + +2004-02-25 Matt Kraai + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change + ecif->cif->bytes to bytes. + (ffi_prep_cif_machdep): Add braces around nested if statement. + +2004-02-09 Alan Modra + + * src/types.c (pointer): POWERPC64 has 8 byte pointers. + + * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling. + (ffi_closure_helper_LINUX64): Fix typo. + * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 + for powerpc64-*-*. + * testsuite/libffi.call/float.c: Likewise. + * testsuite/libffi.call/float2.c: Likewise. + +2004-02-08 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_cif_machdep ): Correct + long double function return and long double arg handling. + (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var. + Use "end_pfr" instead of "nf". Correct long double handling. + Localise "temp". + * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double + return value. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate + space for long double return value. Adjust stack frame and offsets. + Load f2 long double return. + +2004-02-07 Alan Modra + + * src/types.c: Use 16 byte long double for POWERPC64. + +2004-01-25 Eric Botcazou + + * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array + when the structure return address is passed in %o0. + (ffi_V9_return_struct): Rename into ffi_v9_layout_struct. + (ffi_v9_layout_struct): Align the field following a nested structure + on a word boundary. Use memmove instead of memcpy. + (ffi_call): Update call to ffi_V9_return_struct. + (ffi_prep_closure): Define 'ctx' only for V8. + (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8 + and ffi_closure_sparc_inner_v9. + (ffi_closure_sparc_inner_v8): Return long doubles by reference. + Always skip the structure return address. For structures and long + doubles, copy the argument directly. + (ffi_closure_sparc_inner_v9): Skip the structure return address only + if required. Shift the maximum floating-point slot accordingly. For + big structures, copy the argument directly; otherwise, left-justify the + argument and call ffi_v9_layout_struct to lay out the structure on + the stack. + * src/sparc/v8.S: Undef STACKFRAME before defining it. + (ffi_closure_v8): Pass the structure return address. Update call to + ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling. + Skip the 'unimp' insn when returning long doubles and structures. + * src/sparc/v9.S: Undef STACKFRAME before defining it. + (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit + FFI_TYPE_INT handling. Load structures both in integers and + floating-point registers on return. + * README: Update status of the SPARC port. + +2004-01-24 Andreas Tobler + + * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value + as of type ffi_arg. + * testsuite/libffi.call/struct3.c (main): Fix CHECK. + +2004-01-22 Ulrich Weigand + + * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result + value as of type ffi_arg, not unsigned int. + +2004-01-21 Michael Ritzert + + * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead + of the LHS. + +2004-01-12 Andreas Tobler + + * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for + Solaris. + +2004-01-08 Rainer Orth + + * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED + to void *. + +2003-12-10 Richard Henderson + + * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to + size_t instead of int. + +2003-12-04 Hosaka Yuji + + * testsuite/libffi.call/many_win32.c: Include . + * testsuite/libffi.call/many_win32.c (main): Replace variable + int i with unsigned long ul. + + * testsuite/libffi.call/cls_align_uint64.c: New test case. + * testsuite/libffi.call/cls_align_sint64.c: Likewise. + * testsuite/libffi.call/cls_align_uint32.c: Likewise. + * testsuite/libffi.call/cls_align_sint32.c: Likewise. + * testsuite/libffi.call/cls_align_uint16.c: Likewise. + * testsuite/libffi.call/cls_align_sint16.c: Likewise. + * testsuite/libffi.call/cls_align_float.c: Likewise. + * testsuite/libffi.call/cls_align_double.c: Likewise. + * testsuite/libffi.call/cls_align_longdouble.c: Likewise. + * testsuite/libffi.call/cls_align_pointer.c: Likewise. + +2003-12-02 Hosaka Yuji + + PR other/13221 + * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): + Align arguments to 32 bits. + +2003-12-01 Andreas Tobler + + PR other/13221 + * testsuite/libffi.call/cls_multi_sshort.c: New test case. + * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. + * testsuite/libffi.call/cls_multi_uchar.c: Likewise. + * testsuite/libffi.call/cls_multi_schar.c: Likewise. + * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. + * testsuite/libffi.call/cls_multi_ushort.c: Likewise. + + * testsuite/libffi.special/unwindtest.cc: Cosmetics. + +2003-11-26 Kaveh R. Ghazi + + * testsuite/libffi.call/ffitest.h: Include . + * testsuite/libffi.special/ffitestcxx.h: Likewise. + +2003-11-22 Andreas Tobler + + * Makefile.in: Rebuilt. + * configure: Likewise. + * testsuite/libffi.special/unwindtest.cc: Convert the mmap to + the right type. + +2003-11-21 Andreas Jaeger + Andreas Tobler + + * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST. + * configure.in: Call AC_FUNC_MMAP_BLACKLIST. + * Makefile.in: Rebuilt. + * aclocal.m4: Likewise. + * configure: Likewise. + * fficonfig.h.in: Likewise. + * testsuite/lib/libffi-dg.exp: Add include dir. + * testsuite/libffi.call/ffitest.h: Add MMAP definitions. + * testsuite/libffi.special/ffitestcxx.h: Likewise. + * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality + for ffi_closure if available. + * testsuite/libffi.call/closure_fn1.c: Likewise. + * testsuite/libffi.call/closure_fn2.c: Likewise. + * testsuite/libffi.call/closure_fn3.c: Likewise. + * testsuite/libffi.call/closure_fn4.c: Likewise. + * testsuite/libffi.call/closure_fn5.c: Likewise. + * testsuite/libffi.call/cls_12byte.c: Likewise. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_18byte.c: Likewise. + * testsuite/libffi.call/cls_19byte.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_20byte1.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + * testsuite/libffi.call/cls_64byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_9byte1.c: Likewise. + * testsuite/libffi.call/cls_9byte2.c: Likewise. + * testsuite/libffi.call/cls_double.c: Likewise. + * testsuite/libffi.call/cls_float.c: Likewise. + * testsuite/libffi.call/cls_schar.c: Likewise. + * testsuite/libffi.call/cls_sint.c: Likewise. + * testsuite/libffi.call/cls_sshort.c: Likewise. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/nested_struct.c: Likewise. + * testsuite/libffi.call/nested_struct1.c: Likewise. + * testsuite/libffi.call/nested_struct2.c: Likewise. + * testsuite/libffi.call/nested_struct3.c: Likewise. + * testsuite/libffi.call/problem1.c: Likewise. + * testsuite/libffi.special/unwindtest.cc: Likewise. + +2003-11-20 Andreas Tobler + + * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional. + +2003-11-19 Andreas Tobler + + * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin. + Add -lgcc_s to additional flags. + +2003-11-12 Andreas Tobler + + * configure.in, include/Makefile.am: PR libgcj/11147, install + the ffitarget.h header file in a gcc versioned and target + dependent place. + * configure: Regenerated. + * Makefile.in, include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + +2003-11-09 Andreas Tobler + + * testsuite/libffi.call/closure_fn0.c: Print result and check + with dg-output to make debugging easier. + * testsuite/libffi.call/closure_fn1.c: Likewise. + * testsuite/libffi.call/closure_fn2.c: Likewise. + * testsuite/libffi.call/closure_fn3.c: Likewise. + * testsuite/libffi.call/closure_fn4.c: Likewise. + * testsuite/libffi.call/closure_fn5.c: Likewise. + * testsuite/libffi.call/cls_12byte.c: Likewise. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_18byte.c: Likewise. + * testsuite/libffi.call/cls_19byte.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_20byte1.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + * testsuite/libffi.call/cls_64byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_9byte1.c: Likewise. + * testsuite/libffi.call/cls_9byte2.c: Likewise. + * testsuite/libffi.call/cls_double.c: Likewise. + * testsuite/libffi.call/cls_float.c: Likewise. + * testsuite/libffi.call/cls_schar.c: Likewise. + * testsuite/libffi.call/cls_sint.c: Likewise. + * testsuite/libffi.call/cls_sshort.c: Likewise. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/problem1.c: Likewise. + + * testsuite/libffi.special/unwindtest.cc: Make ffi_closure + static. + +2003-11-08 Andreas Tobler + + * testsuite/libffi.call/cls_9byte2.c: New test case. + * testsuite/libffi.call/cls_9byte1.c: Likewise. + * testsuite/libffi.call/cls_64byte.c: Likewise. + * testsuite/libffi.call/cls_20byte1.c: Likewise. + * testsuite/libffi.call/cls_19byte.c: Likewise. + * testsuite/libffi.call/cls_18byte.c: Likewise. + * testsuite/libffi.call/closure_fn4.c: Likewise. + * testsuite/libffi.call/closure_fn5.c: Likewise. + * testsuite/libffi.call/cls_schar.c: Likewise. + * testsuite/libffi.call/cls_sint.c: Likewise. + * testsuite/libffi.call/cls_sshort.c: Likewise. + * testsuite/libffi.call/nested_struct2.c: Likewise. + * testsuite/libffi.call/nested_struct3.c: Likewise. + +2003-11-08 Andreas Tobler + + * testsuite/libffi.call/cls_double.c: Do a check on the result. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/return_sc.c: Cleanup whitespaces. + +2003-11-06 Andreas Tobler + + * src/prep_cif.c (ffi_prep_cif): Move the validity check after + the initialization. + +2003-10-23 Andreas Tobler + + * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace + FFI_ASSERT(FALSE) with FFI_ASSERT(0). + +2003-10-22 David Daney + + * src/mips/ffitarget.h: Replace undefined UINT32 and friends with + __attribute__((__mode__(__SI__))) and friends. + +2003-10-22 Andreas Schwab + + * src/ia64/ffi.c: Replace FALSE/TRUE with false/true. + +2003-10-21 Andreas Tobler + + * configure.in: AC_LINK_FILES(ffitarget.h). + * configure: Regenerate. + * Makefile.in: Likewise. + * include/Makefile.in: Likewise. + * testsuite/Makefile.in: Likewise. + * fficonfig.h.in: Likewise. + +2003-10-21 Paolo Bonzini + Richard Henderson + + Avoid that ffi.h includes fficonfig.h. + + * Makefile.am (EXTRA_DIST): Include ffitarget.h files + (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. + (TARGET_SRC_MIPS_SGI): Removed. + (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. + (MIPS_SGI): Removed. + (CLEANFILES): Removed. + (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New + targets. + * acconfig.h: Removed. + * configure.in: Compute sizeofs only for double and long double. + Use them to define and subst HAVE_LONG_DOUBLE. Include comments + into AC_DEFINE instead of using acconfig.h. Create + include/ffitarget.h instead of include/fficonfig.h. Rename + MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. + AC_DEFINE EH_FRAME_FLAGS. + * include/Makefile.am (DISTCLEANFILES): New automake macro. + (hack_DATA): Add ffitarget.h. + * include/ffi.h.in: Remove all system specific definitions. + Declare raw API even if it is not installed, why bother? + Use limits.h instead of SIZEOF_* to define ffi_type_*. Do + not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include + ffitarget.h instead of fficonfig.h. Remove ALIGN macro. + (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. + * include/ffi_common.h (bool): Do not define. + (ffi_assert): Accept failed assertion. + (ffi_type_test): Return void and accept file/line. + (FFI_ASSERT): Pass stringized failed assertion. + (FFI_ASSERT_AT): New macro. + (FFI_ASSERT_VALID_TYPE): New macro. + (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, + UINT64, SINT64): Define here with gcc's __attribute__ macro + instead of in ffi.h + (FLOAT32, ALIGN): Define here instead of in ffi.h + * include/ffi-mips.h: Removed. Its content moved to + src/mips/ffitarget.h after separating assembly and C sections. + * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c + src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, + src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, + src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: + SIZEOF_ARG -> FFI_SIZEOF_ARG. + * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). + * src/debug.c (ffi_assert): Accept stringized failed assertion. + (ffi_type_test): Rewritten. + * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call + FFI_ASSERT_VALID_TYPE. + * src/alpha/ffitarget.h, src/arm/ffitarget.h, + src/ia64/ffitarget.h, src/m68k/ffitarget.h, + src/mips/ffitarget.h, src/powerpc/ffitarget.h, + src/s390/ffitarget.h, src/sh/ffitarget.h, + src/sh64/ffitarget.h, src/sparc/ffitarget.h, + src/x86/ffitarget.h: New files. + * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, + src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, + src/powerpc/aix.S, src/powerpc/darwin.S, + src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, + src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, + src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, + src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, + src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: + include fficonfig.h + +2003-10-20 Rainer Orth + + * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external + _MIPS_SIM_NABI32, _MIPS_SIM_ABI32. + +2003-10-19 Andreas Tobler + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again. + Used when FFI_DEBUG = 1. + +2003-10-14 Alan Modra + + * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size + and align. + +2003-10-06 Rainer Orth + + * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs, + FFI_MIPS_O32 for O32 ABI. + +2003-10-01 Andreas Tobler + + * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for + SPARC64. Cleanup whitespaces. + +2003-09-19 Andreas Tobler + + * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm, + strongarm, xscale. Cleanup whitespaces. + * testsuite/libffi.call/closure_fn1.c: Likewise. + * testsuite/libffi.call/closure_fn2.c: Likewise. + * testsuite/libffi.call/closure_fn3.c: Likewise. + * testsuite/libffi.call/cls_12byte.c: Likewise. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_double.c: Likewise. + * testsuite/libffi.call/cls_float.c: Likewise. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/nested_struct.c: Likewise. + * testsuite/libffi.call/nested_struct1.c: Likewise. + * testsuite/libffi.call/problem1.c: Likewise. + * testsuite/libffi.special/unwindtest.cc: Likewise. + * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces. + +2003-09-18 David Edelsohn + + * src/powerpc/aix.S: Cleanup whitespaces. + * src/powerpc/aix_closure.S: Likewise. + +2003-09-18 Andreas Tobler + + * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting. + * src/powerpc/darwin_closure.S: Likewise. + * src/powerpc/ffi_darwin.c: Likewise. + +2003-09-18 Andreas Tobler + David Edelsohn + + * src/types.c (double): Add AIX and Darwin to the right TYPEDEF. + * src/powerpc/aix_closure.S: Remove the pointer to the outgoing + parameter stack. + * src/powerpc/darwin_closure.S: Likewise. + * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures + according to the Darwin/AIX ABI. + (ffi_prep_cif_machdep): Likewise. + (ffi_closure_helper_DARWIN): Likewise. + Remove the outgoing parameter stack logic. Simplify the evaluation + of the different CASE types. + (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch + statement in the trampoline code. + +2003-09-18 Kaz Kojima + + * src/sh/ffi.c (ffi_prep_args): Take account into the alignement + for the register size. + (ffi_closure_helper_SYSV): Handle the structure return value + address correctly. + (ffi_closure_helper_SYSV): Return the appropriate type when + the registers are used for the structure return value. + * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for + the 64-bit return value. Update copyright years. + +2003-09-17 Rainer Orth + + * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in + srcdir for ffi_mips.h. + +2003-09-12 Alan Modra + + * src/prep_cif.c (initialize_aggregate): Include tail padding in + structure size. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct + placement of float result. + * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct + cast of "resp" for big-endian 64 bit machines. + +2003-09-11 Alan Modra + + * src/types.c (double, longdouble): Merge identical SH and ARM + typedefs, and add POWERPC64. + * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for + struct split over gpr and rest. + (ffi_prep_cif_machdep): Correct intarg_count for structures. + * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. + +2003-09-09 Andreas Tobler + + * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct + passing correctly. + +2003-09-09 Alan Modra + + * configure: Regenerate. + +2003-09-04 Andreas Tobler + + * Makefile.am: Remove build rules for ffitest. + * Makefile.in: Rebuilt. + +2003-09-04 Andreas Tobler + + * src/java_raw_api.c: Include to fix compiler warning + about implicit declaration of abort(). + +2003-09-04 Andreas Tobler + + * Makefile.am: Add dejagnu test framework. Fixes PR other/11411. + * Makefile.in: Rebuilt. + * configure.in: Add dejagnu test framework. + * configure: Rebuilt. + + * testsuite/Makefile.am: New file. + * testsuite/Makefile.in: Built + * testsuite/lib/libffi-dg.exp: New file. + * testsuite/config/default.exp: Likewise. + * testsuite/libffi.call/call.exp: Likewise. + * testsuite/libffi.call/ffitest.h: Likewise. + * testsuite/libffi.call/closure_fn0.c: Likewise. + * testsuite/libffi.call/closure_fn1.c: Likewise. + * testsuite/libffi.call/closure_fn2.c: Likewise. + * testsuite/libffi.call/closure_fn3.c: Likewise. + * testsuite/libffi.call/cls_1_1byte.c: Likewise. + * testsuite/libffi.call/cls_3_1byte.c: Likewise. + * testsuite/libffi.call/cls_4_1byte.c: Likewise. + * testsuite/libffi.call/cls_2byte.c: Likewise. + * testsuite/libffi.call/cls_3byte1.c: Likewise. + * testsuite/libffi.call/cls_3byte2.c: Likewise. + * testsuite/libffi.call/cls_4byte.c: Likewise. + * testsuite/libffi.call/cls_5byte.c: Likewise. + * testsuite/libffi.call/cls_6byte.c: Likewise. + * testsuite/libffi.call/cls_7byte.c: Likewise. + * testsuite/libffi.call/cls_8byte.c: Likewise. + * testsuite/libffi.call/cls_12byte.c: Likewise. + * testsuite/libffi.call/cls_16byte.c: Likewise. + * testsuite/libffi.call/cls_20byte.c: Likewise. + * testsuite/libffi.call/cls_24byte.c: Likewise. + * testsuite/libffi.call/cls_double.c: Likewise. + * testsuite/libffi.call/cls_float.c: Likewise. + * testsuite/libffi.call/cls_uchar.c: Likewise. + * testsuite/libffi.call/cls_uint.c: Likewise. + * testsuite/libffi.call/cls_ulonglong.c: Likewise. + * testsuite/libffi.call/cls_ushort.c: Likewise. + * testsuite/libffi.call/float.c: Likewise. + * testsuite/libffi.call/float1.c: Likewise. + * testsuite/libffi.call/float2.c: Likewise. + * testsuite/libffi.call/many.c: Likewise. + * testsuite/libffi.call/many_win32.c: Likewise. + * testsuite/libffi.call/nested_struct.c: Likewise. + * testsuite/libffi.call/nested_struct1.c: Likewise. + * testsuite/libffi.call/pyobjc-tc.c: Likewise. + * testsuite/libffi.call/problem1.c: Likewise. + * testsuite/libffi.call/promotion.c: Likewise. + * testsuite/libffi.call/return_ll.c: Likewise. + * testsuite/libffi.call/return_sc.c: Likewise. + * testsuite/libffi.call/return_uc.c: Likewise. + * testsuite/libffi.call/strlen.c: Likewise. + * testsuite/libffi.call/strlen_win32.c: Likewise. + * testsuite/libffi.call/struct1.c: Likewise. + * testsuite/libffi.call/struct2.c: Likewise. + * testsuite/libffi.call/struct3.c: Likewise. + * testsuite/libffi.call/struct4.c: Likewise. + * testsuite/libffi.call/struct5.c: Likewise. + * testsuite/libffi.call/struct6.c: Likewise. + * testsuite/libffi.call/struct7.c: Likewise. + * testsuite/libffi.call/struct8.c: Likewise. + * testsuite/libffi.call/struct9.c: Likewise. + * testsuite/libffi.special/special.exp: New file. + * testsuite/libffi.special/ffitestcxx.h: Likewise. + * testsuite/libffi.special/unwindtest.cc: Likewise. + + +2003-08-13 Kaz Kojima + + * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update + copyright years. + +2003-08-02 Alan Modra + + * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc + structure passing. + (ffi_closure_helper_LINUX64): Likewise. + * src/powerpc/linux64.S: Remove code writing to parm save area. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return + address in lr from ffi_closure_helper_LINUX64 call to calculate + table address. Optimize function tail. + +2003-07-28 Andreas Tobler + + * src/sparc/ffi.c: Handle all floating point registers. + * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. + +2003-07-11 Gerald Pfeifer + + * README: Note that libffi is not part of GCC. Update the project + URL and status. + +2003-06-19 Franz Sirl + + * src/powerpc/ppc_closure.S: Include ffi.h. + +2003-06-13 Rainer Orth + + * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives. + Use C style comments. + +2003-06-13 Kaz Kojima + + * Makefile.am: Add SHmedia support. Fix a typo of SH support. + * Makefile.in: Regenerate. + * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target. + * configure: Regenerate. + * include/ffi.h.in: Add SHmedia support. + * src/sh64/ffi.c: New file. + * src/sh64/sysv.S: New file. + +2003-05-16 Jakub Jelinek + + * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section + should be read-only. + * configure: Rebuilt. + * fficonfig.h.in: Rebuilt. + * include/ffi.h.in (EH_FRAME_FLAGS): Define. + * src/alpha/osf.S: Use EH_FRAME_FLAGS. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/linux64_closure.S: Likewise. Include ffi.h. + * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding + if -fpic/-fPIC/-mrelocatable. + * src/powerpc/powerpc_closure.S: Likewise. + * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include + #write in .eh_frame flags. + * src/sparc/v9.S: Likewise. + * src/x86/unix64.S: Use EH_FRAME_FLAGS. + * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC. + * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h. + +2003-05-07 Jeff Sturm + + Fixes PR bootstrap/10656 + * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler + support for .register pseudo-op. + * src/sparc/v8.S: Use it. + * fficonfig.h.in: Rebuilt. + * configure: Rebuilt. + +2003-04-18 Jakub Jelinek + + * include/ffi.h.in (POWERPC64): Define if 64-bit. + (enum ffi_abi): Add FFI_LINUX64 on POWERPC. + Make it the default on POWERPC64. + (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64. + * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*. + * configure: Rebuilt. + * src/powerpc/ffi.c (hidden): Define. + (ffi_prep_args_SYSV): Renamed from + ffi_prep_args. Cast pointers to unsigned long to shut up warnings. + (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64, + ASM_NEEDS_REGISTERS64): New. + (ffi_prep_args64): New function. + (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI. + (ffi_call): Likewise. + (ffi_prep_closure): Likewise. + (flush_icache): Surround by #ifndef POWERPC64. + (ffi_dblfl): New union type. + (ffi_closure_helper_SYSV): Use it to avoid aliasing problems. + (ffi_closure_helper_LINUX64): New function. + * src/powerpc/ppc_closure.S: Surround whole file by #ifndef + __powerpc64__. + * src/powerpc/sysv.S: Likewise. + (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV. + * src/powerpc/linux64.S: New file. + * src/powerpc/linux64_closure.S: New file. + * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and + src/powerpc/linux64_closure.S. + (TARGET_SRC_POWERPC): Likewise. + + * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2, + closure_test_fn3): Fix result printing on big-endian 64-bit + machines. + (main): Print tst2_arg instead of uninitialized tst2_result. + + * src/ffitest.c (main): Hide what closure pointer really points to + from the compiler. + +2003-04-16 Richard Earnshaw + + * configure.in (arm-*-netbsdelf*): Add configuration. + (configure): Regenerated. + +2003-04-04 Loren J. Rittle + + * include/Makefile.in: Regenerate. + +2003-03-21 Zdenek Dvorak + + * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 + bit mode. + * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): + Receive closure pointer through parameter, read args using + __builtin_dwarf_cfa. + (FFI_INIT_TRAMPOLINE): Send closure reference through eax. + +2003-03-12 Andreas Schwab + + * configure.in: Avoid trailing /. in toolexeclibdir. + * configure: Rebuilt. + +2003-03-03 Andreas Tobler + + * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries. + +2003-02-06 Andreas Tobler + + * libffi/src/powerpc/darwin_closure.S: + Fix alignement bug, allocate 8 bytes for the result. + * libffi/src/powerpc/aix_closure.S: + Likewise. + * libffi/src/powerpc/ffi_darwin.c: + Update stackframe description for aix/darwin_closure.S. + +2003-02-06 Jakub Jelinek + + * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility + attribute. + +2003-01-31 Christian Cornelssen , + Andreas Schwab + + * configure.in: Adjust command to source config-ml.in to account + for changes to the libffi_basedir definition. + (libffi_basedir): Remove ${srcdir} from value and include trailing + slash if nonempty. + + * configure: Regenerate. + +2003-01-29 Franz Sirl + + * src/powerpc/ppc_closure.S: Recode to fit shared libs. + +2003-01-28 Andrew Haley + + * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. + * src/x86/ffi64.c (ffi_prep_closure): New. + (ffi_closure_UNIX64_inner): New. + * src/x86/unix64.S (ffi_closure_UNIX64): New. + +2003-01-27 Alexandre Oliva + + * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. + Remove USE_LIBDIR conditional. + * Makefile.am (toolexecdir, toolexeclibdir): Don't override. + * Makefile.in, configure: Rebuilt. + +2003-01027 David Edelsohn + + * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo. + * Makefile.in: Regenerate. + +2003-01-22 Andrew Haley + + * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to + unwind info. + +2003-01-21 Andreas Tobler + + * src/powerpc/darwin.S: Add unwind info. + * src/powerpc/darwin_closure.S: Likewise. + +2003-01-14 Andrew Haley + + * src/x86/ffi64.c (ffi_prep_args): Check for void retval. + (ffi_prep_cif_machdep): Likewise. + * src/x86/unix64.S: Add unwind info. + +2003-01-14 Andreas Jaeger + + * src/ffitest.c (main): Only use ffi_closures if those are + supported. + +2003-01-13 Andreas Tobler + + * libffi/src/ffitest.c + add closure testcases + +2003-01-13 Kevin B. Hendricks + + * libffi/src/powerpc/ffi.c + fix alignment bug for float (4 byte aligned iso 8 byte) + +2003-01-09 Geoffrey Keating + + * src/powerpc/ffi_darwin.c: Remove RCS version string. + * src/powerpc/darwin.S: Remove RCS version string. + +2003-01-03 Jeff Sturm + + * include/ffi.h.in: Add closure defines for SPARC, SPARC64. + * src/ffitest.c (main): Use static storage for closure. + * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. + * src/sparc/v8.S (ffi_closure_v8): New. + * src/sparc/v9.S (ffi_closure_v9): New. + +2002-11-10 Ranjit Mathew + + * include/ffi.h.in: Added FFI_STDCALL ffi_type + enumeration for X86_WIN32. + * src/x86/win32.S: Added ffi_call_STDCALL function + definition. + * src/x86/ffi.c (ffi_call/ffi_raw_call): Added + switch cases for recognising FFI_STDCALL and + calling ffi_call_STDCALL if target is X86_WIN32. + * src/ffitest.c (my_stdcall_strlen/stdcall_many): + stdcall versions of the "my_strlen" and "many" + test functions (for X86_WIN32). + Added test cases to test stdcall invocation using + these functions. + +2002-12-02 Kaz Kojima + + * src/sh/sysv.S: Add DWARF2 unwind info. + +2002-11-27 Ulrich Weigand + + * src/s390/sysv.S (.eh_frame section): Make section read-only. + +2002-11-26 Jim Wilson + + * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. + +2002-11-23 H.J. Lu + + * acinclude.m4: Add dummy AM_PROG_LIBTOOL. + Include ../config/accross.m4. + * aclocal.m4; Rebuild. + * configure: Likewise. + +2002-11-15 Ulrich Weigand + + * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. + +2002-11-11 DJ Delorie + + * configure.in: Look for common files in the right place. + +2002-10-08 Ulrich Weigand + + * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret + raw data as _Jv_word values, not ffi_raw. + (ffi_java_ptrarray_to_raw): Likewise. + (ffi_java_rvalue_to_raw): New function. + (ffi_java_raw_call): Call it. + (ffi_java_raw_to_rvalue): New function. + (ffi_java_translate_args): Call it. + * src/ffitest.c (closure_test_fn): Interpret return value + as ffi_arg, not int. + * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing + FFI_TYPE_POINTER case. + (ffi_closure_helper_SYSV): Likewise. Also, assume return + values extended to word size. + +2002-10-02 Andreas Jaeger + + * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. + +2002-10-01 Bo Thorsen + + * include/ffi.h.in: Fix i386 win32 compilation. + +2002-09-30 Ulrich Weigand + + * configure.in: Add s390x-*-linux-* target. + * configure: Regenerate. + * include/ffi.h.in: Define S390X for s390x targets. + (FFI_CLOSURES): Define for s390/s390x. + (FFI_TRAMPOLINE_SIZE): Likewise. + (FFI_NATIVE_RAW_API): Likewise. + * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. + * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. + * src/s390/ffi.c: Major rework of existing code. Add support for + s390x targets. Add closure support. + * src/s390/sysv.S: Likewise. + +2002-09-29 Richard Earnshaw + + * src/arm/sysv.S: Fix typo. + +2002-09-28 Richard Earnshaw + + * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor + has defined __USER_LABEL_PREFIX__, then use it in CNAME. + (ffi_call_SYSV): Handle soft-float. + +2002-09-27 Bo Thorsen + + * include/ffi.h.in: Fix multilib x86-64 support. + +2002-09-22 Kaveh R. Ghazi + + * Makefile.am (all-multi): Fix multilib parallel build. + +2002-07-19 Kaz Kojima + + * configure.in (sh[34]*-*-linux*): Add brackets. + * configure: Regenerate. + +2002-07-18 Kaz Kojima + + * Makefile.am: Add SH support. + * Makefile.in: Regenerate. + * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. + * configure: Regenerate. + * include/ffi.h.in: Add SH support. + * src/sh/ffi.c: New file. + * src/sh/sysv.S: New file. + * src/types.c: Add SH support. + +2002-07-16 Bo Thorsen + + * src/x86/ffi64.c: New file that adds x86-64 support. + * src/x86/unix64.S: New file that handles argument setup for + x86-64. + * src/x86/sysv.S: Don't use this on x86-64. + * src/x86/ffi.c: Don't use this on x86-64. + Remove unused vars. + * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation + for x86-64. + * src/ffitest.c (struct6): New test that tests a special case in + the x86-64 ABI. + (struct7): Likewise. + (struct8): Likewise. + (struct9): Likewise. + (closure_test_fn): Silence warning about this when it's not used. + (main): Add the new tests. + (main): Fix a couple of wrong casts and silence some compiler warnings. + * include/ffi.h.in: Add x86-64 ABI definition. + * fficonfig.h.in: Regenerate. + * Makefile.am: Add x86-64 support. + * configure.in: Likewise. + * Makefile.in: Regenerate. + * configure: Likewise. + +2002-06-24 Bo Thorsen + + * src/types.c: Merge settings for similar architectures. + Add x86-64 sizes and alignments. + +2002-06-23 Bo Thorsen + + * src/arm/ffi.c (ffi_prep_args): Remove unused vars. + * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. + * src/mips/ffi.c (ffi_prep_args): Likewise. + * src/m68k/ffi.c (ffi_prep_args): Likewise. + +2002-07-18 H.J. Lu (hjl@gnu.org) + + * Makefile.am (TARGET_SRC_MIPS_LINUX): New. + (libffi_la_SOURCES): Support MIPS_LINUX. + (libffi_convenience_la_SOURCES): Likewise. + * Makefile.in: Regenerated. + + * configure.in (mips64*-*): Skip. + (mips*-*-linux*): New. + * configure: Regenerated. + + * src/mips/ffi.c: Include . + +2002-06-06 Ulrich Weigand + + * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. + +2002-05-27 Roger Sayle + + * src/x86/ffi.c (ffi_prep_args): Remove reference to avn. + +2002-05-27 Bo Thorsen + + * src/x86/ffi.c (ffi_prep_args): Remove unused variable and + fix formatting. + +2002-05-13 Andreas Tobler + + * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at + beginning of function (for older apple cc). + +2002-05-08 Alexandre Oliva + + * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at + script entry, and set LD to it when configuring multilibs. + * configure: Rebuilt. + +2002-05-05 Jason Thorpe + + * configure.in (sparc64-*-netbsd*): Add target. + (sparc-*-netbsdelf*): Likewise. + * configure: Regenerate. + +2002-04-28 David S. Miller + + * configure.in, configure: Fix SPARC test in previous change. + +2002-04-29 Gerhard Tonn + + * Makefile.am: Add Linux for S/390 support. + * Makefile.in: Regenerate. + * configure.in: Add Linux for S/390 support. + * configure: Regenerate. + * include/ffi.h.in: Add Linux for S/390 support. + * src/s390/ffi.c: New file from libffi CVS tree. + * src/s390/sysv.S: New file from libffi CVS tree. + +2002-04-28 Jakub Jelinek + + * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working + %r_disp32(). + * src/sparc/v8.S: Use it. + * src/sparc/v9.S: Likewise. + * fficonfig.h.in: Rebuilt. + * configure: Rebuilt. + +2002-04-08 Hans Boehm + + * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE + correctly. + * src/ia64/unix.S: Add unwind information. Fix comments. + Save sp in a way that's compatible with unwind info. + (ffi_call_unix): Correctly restore sp in all cases. + * src/ia64/ffi.c: Add, fix comments. + +2002-04-08 Jakub Jelinek + + * src/sparc/v8.S: Make .eh_frame dependent on target word size. + +2002-04-06 Jason Thorpe + + * configure.in (alpha*-*-netbsd*): Add target. + * configure: Regenerate. + +2002-04-04 Jeff Sturm + + * src/sparc/v8.S: Add unwind info. + * src/sparc/v9.S: Likewise. + +2002-03-30 Krister Walfridsson + + * configure.in: Enable i*86-*-netbsdelf*. + * configure: Rebuilt. + +2002-03-29 David Billinghurst + + PR other/2620 + * src/mips/n32.s: Delete + * src/mips/o32.s: Delete + +2002-03-21 Loren J. Rittle + + * configure.in: Enable alpha*-*-freebsd*. + * configure: Rebuilt. + +2002-03-17 Bryce McKinlay + + * Makefile.am: libfficonvenience -> libffi_convenience. + * Makefile.in: Rebuilt. + + * Makefile.am: Define ffitest_OBJECTS. + * Makefile.in: Rebuilt. + +2002-03-07 Andreas Tobler + David Edelsohn + + * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files. + (TARGET_SRC_POWERPC_AIX): Add aix_closure.S. + (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S. + * Makefile.in: Regenerate. + * include/ffi.h.in: Add AIX and Darwin closure definitions. + * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function. + (flush_icache, flush_range): New functions. + (ffi_closure_helper_DARWIN): New function. + * src/powerpc/aix_closure.S: New file. + * src/powerpc/darwin_closure.S: New file. + +2002-02-24 Jeff Sturm + + * include/ffi.h.in: Add typedef for ffi_arg. + * src/ffitest.c (main): Declare rint with ffi_arg. + +2002-02-21 Andreas Tobler + + * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate + number of GPRs for floating-point arguments. + +2002-01-31 Anthony Green + + * configure: Rebuilt. + * configure.in: Replace CHECK_SIZEOF and endian tests with + cross-compiler friendly macros. + * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New + macros. + +2002-01-18 David Edelsohn + + * src/powerpc/darwin.S (_ffi_call_AIX): New. + * src/powerpc/aix.S (ffi_call_DARWIN): New. + +2002-01-17 David Edelsohn + + * Makefile.am (EXTRA_DIST): Add Darwin and AIX files. + (TARGET_SRC_POWERPC_AIX): New. + (POWERPC_AIX): New stanza. + * Makefile.in: Regenerate. + * configure.in: Add AIX case. + * configure: Regenerate. + * include/ffi.h.in (ffi_abi): Add FFI_AIX. + * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame + size. Fix "long double" support. + (ffi_call): Add FFI_AIX case. + * src/powerpc/aix.S: New. + +2001-10-09 John Hornkvist + + Implement Darwin PowerPC ABI. + * configure.in: Handle powerpc-*-darwin*. + * Makefile.am: Set source files for POWERPC_DARWIN. + * configure: Rebuilt. + * Makefile.in: Rebuilt. + * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for + POWERPC_DARWIN. + * src/powerpc/darwin.S: New file. + * src/powerpc/ffi_darwin.c: New file. + +2001-10-07 Joseph S. Myers + + * src/x86/ffi.c: Fix spelling error of "separate" as "seperate". + +2001-07-16 Rainer Orth + + * src/x86/sysv.S: Avoid gas-only .balign directive. + Use C style comments. + +2001-07-16 Rainer Orth + + * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic. + Fixes PR bootstrap/3563. + +2001-06-26 Rainer Orth + + * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF. + +2001-06-25 Rainer Orth + + * configure.in: Recognize sparc*-sun-* host. + * configure: Regenerate. + +2001-06-06 Andrew Haley + + * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. + +2001-06-03 Andrew Haley + + * src/alpha/osf.S: Add unwind info. + * src/powerpc/sysv.S: Add unwind info. + * src/powerpc/ppc_closure.S: Likewise. + +2000-05-31 Jeff Sturm + + * configure.in: Fix AC_ARG_ENABLE usage. + * configure: Rebuilt. + +2001-05-06 Bryce McKinlay + + * configure.in: Remove warning about beta code. + * configure: Rebuilt. + +2001-04-25 Hans Boehm + + * src/ia64/unix.S: Restore stack pointer when returning from + ffi_closure_UNIX. + * src/ia64/ffi.c: Fix typo in comment. + +2001-04-18 Jim Wilson + + * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2 + to eliminate RAW DV. + +2001-04-12 Bryce McKinlay + + * Makefile.am: Make a libtool convenience library. + * Makefile.in: Rebuilt. + +2001-03-29 Bryce McKinlay + + * configure.in: Use different syntax for subdirectory creation. + * configure: Rebuilt. + +2001-03-27 Jon Beniston + + * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW). + * configure: Rebuilt. + * Makefile.am: Added X86_WIN32 target support. + * Makefile.in: Rebuilt. + + * include/ffi.h.in: Added X86_WIN32 target support. + + * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets. + * src/types.c: Added X86_WIN32 target support. + + * src/x86/win32.S: New file. Based on sysv.S, but with EH + stuff removed and made to work with CygWin's gas. + +2001-03-26 Bryce McKinlay + + * configure.in: Make target subdirectory in build dir. + * Makefile.am: Override suffix based rules to specify correct output + subdirectory. + * Makefile.in: Rebuilt. + * configure: Rebuilt. + +2001-03-23 Kevin B Hendricks + + * src/powerpc/ppc_closure.S: New file. + * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug + involving long long and register pairs. + (ffi_prep_closure): New function. + (flush_icache): Likewise. + (ffi_closure_helper_SYSV): Likewise. + * include/ffi.h.in (FFI_CLOSURES): Define on PPC. + (FFI_TRAMPOLINE_SIZE): Likewise. + (FFI_NATIVE_RAW_API): Likewise. + * Makefile.in: Rebuilt. + * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S. + (TARGET_SRC_POWERPC): Likewise. + +2001-03-19 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.am (ffitest_LDFLAGS): New macro. + +2001-03-02 Nick Clifton + + * include/ffi.h.in: Remove RCS ident string. + * include/ffi_mips.h: Remove RCS ident string. + * src/debug.c: Remove RCS ident string. + * src/ffitest.c: Remove RCS ident string. + * src/prep_cif.c: Remove RCS ident string. + * src/types.c: Remove RCS ident string. + * src/alpha/ffi.c: Remove RCS ident string. + * src/alpha/osf.S: Remove RCS ident string. + * src/arm/ffi.c: Remove RCS ident string. + * src/arm/sysv.S: Remove RCS ident string. + * src/mips/ffi.c: Remove RCS ident string. + * src/mips/n32.S: Remove RCS ident string. + * src/mips/o32.S: Remove RCS ident string. + * src/sparc/ffi.c: Remove RCS ident string. + * src/sparc/v8.S: Remove RCS ident string. + * src/sparc/v9.S: Remove RCS ident string. + * src/x86/ffi.c: Remove RCS ident string. + * src/x86/sysv.S: Remove RCS ident string. + +2001-02-08 Joseph S. Myers + + * include/ffi.h.in: Change sourceware.cygnus.com references to + gcc.gnu.org. + +2000-12-09 Richard Henderson + + * src/alpha/ffi.c (ffi_call): Simplify struct return test. + (ffi_closure_osf_inner): Index rather than increment avalue + and arg_types. Give ffi_closure_osf the raw return value type. + * src/alpha/osf.S (ffi_closure_osf): Handle return value type + promotion. + +2000-12-07 Richard Henderson + + * src/raw_api.c (ffi_translate_args): Fix typo. + (ffi_prep_closure): Likewise. + + * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and + FFI_TRAMPOLINE_SIZE. + * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal + cif->bytes for new ffi_call_osf implementation. + (ffi_prep_args): Absorb into ... + (ffi_call): ... here. Do all stack allocation here and + avoid a callback function. + (ffi_prep_closure, ffi_closure_osf_inner): New. + * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback. + (ffi_closure_osf): New. + +2000-09-10 Alexandre Oliva + + * config.guess, config.sub, install-sh: Removed. + * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise. + * Makefile.in: Rebuilt. + + * acinclude.m4: Include libtool macros from the top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-22 Alexandre Oliva + + * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set. + * configure: Rebuilt. + +2000-05-11 Scott Bambrough + + * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to + memory correctly. Use conditional instructions, not branches where + possible. + +2000-05-04 Tom Tromey + + * configure: Rebuilt. + * configure.in: Match `arm*-*-linux-*'. + From Chris Dornan . + +2000-04-28 Jakub Jelinek + + * Makefile.am (SUBDIRS): Define. + (AM_MAKEFLAGS): Likewise. + (Multilib support.): Add section. + * Makefile.in: Rebuilt. + * ltconfig (extra_compiler_flags, extra_compiler_flags_value): + New variables. Set for gcc using -print-multi-lib. Export them + to libtool. + (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. + * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options + for -shared links. + (extra_compiler_flags_value, extra_compiler_flags): Check these + for extra compiler options which need to be passed down in + compiler_flags. + +2000-04-16 Anthony Green + + * configure: Rebuilt. + * configure.in: Change i*86-pc-linux* to i*86-*-linux*. + +2000-04-14 Jakub Jelinek + + * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. + Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. + * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. + Replace all void * sizeofs with sizeof(int). + Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is + different than DOUBLE. + Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere). + (ffi_prep_args_v9): New function. + (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8. + (ffi_V9_return_struct): New function. + (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from + 32bit code (not yet cross-arch calls). + * src/sparc/v8.S: Add struct return delay nop. + Handle long long. + * src/sparc/v9.S: New file. + * src/prep_cif.c (ffi_prep_cif): Return structure pointer + is used on sparc64 only for structures larger than 32 bytes. + Pass by reference for structures is done for structure arguments + larger than 16 bytes. + * src/ffitest.c (main): Use 64bit rint on sparc64. + Run long long tests on sparc. + * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and + sparc64. + (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits + on sparc64. + * configure.in (sparc-*-linux*): New supported target. + (sparc64-*-linux*): Likewise. + * configure: Rebuilt. + * Makefile.am: Add v9.S to SPARC files. + * Makefile.in: Likewise. + (LINK): Surround $(CCLD) into double quotes, so that multilib + compiles work correctly. + +2000-04-04 Alexandre Petit-Bianco + + * configure: Rebuilt. + * configure.in: (i*86-*-solaris*): New libffi target. Patch + proposed by Bryce McKinlay. + +2000-03-20 Tom Tromey + + * Makefile.in: Hand edit for java_raw_api.lo. + +2000-03-08 Bryce McKinlay + + * config.guess, config.sub: Update from the gcc tree. + Fix for PR libgcj/168. + +2000-03-03 Tom Tromey + + * Makefile.in: Fixed ia64 by hand. + + * configure: Rebuilt. + * configure.in (--enable-multilib): New option. + (libffi_basedir): New subst. + (AC_OUTPUT): Added multilib code. + +2000-03-02 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as + directory name. + +2000-02-25 Hans Boehm + + * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New + files. + * src/raw_api.c (ffi_translate_args): Fixed typo in argument + list. + (ffi_prep_raw_closure): Use ffi_translate_args, not + ffi_closure_translate. + * src/java_raw_api.c: New file. + * src/ffitest.c (closure_test_fn): New function. + (main): Define `rint' as long long on IA64. Added new test when + FFI_CLOSURES is defined. + * include/ffi.h.in (ALIGN): Use size_t, not unsigned. + (ffi_abi): Recognize IA64. + (ffi_raw): Added `flt' field. + Added "Java raw API" code. + * configure.in: Recognize ia64. + * Makefile.am (TARGET_SRC_IA64): New macro. + (libffi_la_common_SOURCES): Added java_raw_api.c. + (libffi_la_SOURCES): Define in IA64 case. + +2000-01-04 Tom Tromey + + * Makefile.in: Rebuilt with newer automake. + +1999-12-31 Tom Tromey + + * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src. + +1999-09-01 Tom Tromey + + * include/ffi.h.in: Removed PACKAGE and VERSION defines and + undefs. + * fficonfig.h.in: Rebuilt. + * configure: Rebuilt. + * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE. + Use AM_PROG_LIBTOOL (automake 1.4 compatibility). + * acconfig.h: Don't #undef PACKAGE or VERSION. + +1999-08-09 Anthony Green + + * include/ffi.h.in: Try to work around messy header problem + with PACKAGE and VERSION. + + * configure: Rebuilt. + * configure.in: Change version to 2.00-beta. + + * fficonfig.h.in: Rebuilt. + * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. + + * src/x86/ffi.c (ffi_raw_call): Rename. + +1999-08-02 Kresten Krab Thorup + + * src/x86/ffi.c (ffi_closure_SYSV): New function. + (ffi_prep_incoming_args_SYSV): Ditto. + (ffi_prep_closure): Ditto. + (ffi_closure_raw_SYSV): Ditto. + (ffi_prep_raw_closure): More ditto. + (ffi_call_raw): Final ditto. + + * include/ffi.h.in: Add definitions for closure and raw API. + + * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for + FFI_TYPE_UINT64. + + * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c + + * src/raw_api.c: New file. + + * include/ffi.h.in (ffi_raw): New type. + (UINT_ARG, SINT_ARG): New defines. + (ffi_closure, ffi_raw_closure): New types. + (ffi_prep_closure, ffi_prep_raw_closure): New declarations. + + * configure.in: Add check for endianness and sizeof void*. + + * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, + instead of directly. + + * configure: Rebuilt. + +Thu Jul 8 14:28:42 1999 Anthony Green + + * configure.in: Add x86 and powerpc BeOS configurations. + From Makoto Kato . + +1999-05-09 Anthony Green + + * configure.in: Add warning about this being beta code. + Remove src/Makefile.am from the picture. + * configure: Rebuilt. + + * Makefile.am: Move logic from src/Makefile.am. Add changes + to support libffi as a target library. + * Makefile.in: Rebuilt. + + * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: + Upgraded to new autoconf, automake, libtool. + + * README: Tweaks. + + * LICENSE: Update copyright date. + + * src/Makefile.am, src/Makefile.in: Removed. + +1998-11-29 Anthony Green + + * include/ChangeLog: Removed. + * src/ChangeLog: Removed. + * src/mips/ChangeLog: Removed. + * src/sparc/ChangeLog: Remboved. + * src/x86/ChangeLog: Removed. + + * ChangeLog.v1: Created. + +============================================================================= +From the old ChangeLog.libffi file.... + +2011-02-08 Andreas Tobler + + * testsuite/lib/libffi.exp: Tweak for stand-alone mode. + +2009-12-25 Samuli Suominen + + * configure.ac: Undefine _AC_ARG_VAR_PRECIOUS for autoconf 2.64. + * configure: Rebuilt. + * fficonfig.h.in: Rebuilt. + +2009-06-16 Andrew Haley + + * testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_medium2.c: Fix printf format + specifiers. + * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs. + * testsuite/libffi.call/float2.c: Fix dg-excess-errors. + * testsuite/libffi.call/ffitest.h, + testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. + +2009-06-12 Andrew Haley + + * testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_medium2.c: Fix printf format + specifiers. + testsuite/libffi.special/unwindtest.cc: include stdint.h. + +2009-06-11 Timothy Wall + + * Makefile.am, + configure.ac, + include/ffi.h.in, + include/ffi_common.h, + src/closures.c, + src/dlmalloc.c, + src/x86/ffi.c, + src/x86/ffitarget.h, + src/x86/win64.S (new), + README: Added win64 support (mingw or MSVC) + * Makefile.in, + include/Makefile.in, + man/Makefile.in, + testsuite/Makefile.in, + configure, + aclocal.m4: Regenerated + * ltcf-c.sh: properly escape cygwin/w32 path + * man/ffi_call.3: Clarify size requirements for return value. + * src/x86/ffi64.c: Fix filename in comment. + * src/x86/win32.S: Remove unused extern. + + * testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/closure_stdcall.c, + testsuite/libffi.call/cls_12byte.c, + testsuite/libffi.call/cls_16byte.c, + testsuite/libffi.call/cls_18byte.c, + testsuite/libffi.call/cls_19byte.c, + testsuite/libffi.call/cls_1_1byte.c, + testsuite/libffi.call/cls_20byte.c, + testsuite/libffi.call/cls_20byte1.c, + testsuite/libffi.call/cls_24byte.c, + testsuite/libffi.call/cls_2byte.c, + testsuite/libffi.call/cls_3_1byte.c, + testsuite/libffi.call/cls_3byte1.c, + testsuite/libffi.call/cls_3byte2.c, + testsuite/libffi.call/cls_4_1byte.c, + testsuite/libffi.call/cls_4byte.c, + testsuite/libffi.call/cls_5_1_byte.c, + testsuite/libffi.call/cls_5byte.c, + testsuite/libffi.call/cls_64byte.c, + testsuite/libffi.call/cls_6_1_byte.c, + testsuite/libffi.call/cls_6byte.c, + testsuite/libffi.call/cls_7_1_byte.c, + testsuite/libffi.call/cls_7byte.c, + testsuite/libffi.call/cls_8byte.c, + testsuite/libffi.call/cls_9byte1.c, + testsuite/libffi.call/cls_9byte2.c, + testsuite/libffi.call/cls_align_double.c, + testsuite/libffi.call/cls_align_float.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_align_longdouble_split.c, + testsuite/libffi.call/cls_align_longdouble_split2.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_align_sint16.c, + testsuite/libffi.call/cls_align_sint32.c, + testsuite/libffi.call/cls_align_sint64.c, + testsuite/libffi.call/cls_align_uint16.c, + testsuite/libffi.call/cls_align_uint32.c, + testsuite/libffi.call/cls_align_uint64.c, + testsuite/libffi.call/cls_dbls_struct.c, + testsuite/libffi.call/cls_double.c, + testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_float.c, + testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_multi_schar.c, + testsuite/libffi.call/cls_multi_sshort.c, + testsuite/libffi.call/cls_multi_sshortchar.c, + testsuite/libffi.call/cls_multi_uchar.c, + testsuite/libffi.call/cls_multi_ushort.c, + testsuite/libffi.call/cls_multi_ushortchar.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c, + testsuite/libffi.call/cls_schar.c, + testsuite/libffi.call/cls_sint.c, + testsuite/libffi.call/cls_sshort.c, + testsuite/libffi.call/cls_uchar.c, + testsuite/libffi.call/cls_uint.c, + testsuite/libffi.call/cls_ulonglong.c, + testsuite/libffi.call/cls_ushort.c, + testsuite/libffi.call/err_bad_abi.c, + testsuite/libffi.call/err_bad_typedef.c, + testsuite/libffi.call/float2.c, + testsuite/libffi.call/huge_struct.c, + testsuite/libffi.call/nested_struct.c, + testsuite/libffi.call/nested_struct1.c, + testsuite/libffi.call/nested_struct10.c, + testsuite/libffi.call/nested_struct2.c, + testsuite/libffi.call/nested_struct3.c, + testsuite/libffi.call/nested_struct4.c, + testsuite/libffi.call/nested_struct5.c, + testsuite/libffi.call/nested_struct6.c, + testsuite/libffi.call/nested_struct7.c, + testsuite/libffi.call/nested_struct8.c, + testsuite/libffi.call/nested_struct9.c, + testsuite/libffi.call/problem1.c, + testsuite/libffi.call/return_ldl.c, + testsuite/libffi.call/return_ll1.c, + testsuite/libffi.call/stret_large.c, + testsuite/libffi.call/stret_large2.c, + testsuite/libffi.call/stret_medium.c, + testsuite/libffi.call/stret_medium2.c, + testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead + of checking for MMAP. Use intptr_t instead of long casts. + +2009-06-04 Andrew Haley + + * src/powerpc/ffitarget.h: Fix misapplied merge from gcc. + +2009-06-04 Andrew Haley + + * src/mips/o32.S, + src/mips/n32.S: Fix licence formatting. + +2009-06-04 Andrew Haley + + * src/x86/darwin.S: Fix licence formatting. + src/x86/win32.S: Likewise. + src/sh64/sysv.S: Likewise. + src/sh/sysv.S: Likewise. + +2009-06-04 Andrew Haley + + * src/sh64/ffi.c: Remove lint directives. Was missing from merge + of Andreas Tobler's patch from 2006-04-22. + +2009-06-04 Andrew Haley + + * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of + 2007-03-07. + +2008-12-26 Timothy Wall + + * testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_align_longdouble.c, + testsuite/libffi.call/cls_align_longdouble_split.c, + testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected + failures on x86_64 cygwin/mingw. + +2008-12-22 Timothy Wall + + * testsuite/libffi.call/closure_fn0.c, + testsuite/libffi.call/closure_fn1.c, + testsuite/libffi.call/closure_fn2.c, + testsuite/libffi.call/closure_fn3.c, + testsuite/libffi.call/closure_fn4.c, + testsuite/libffi.call/closure_fn5.c, + testsuite/libffi.call/closure_fn6.c, + testsuite/libffi.call/closure_loc_fn0.c, + testsuite/libffi.call/closure_stdcall.c, + testsuite/libffi.call/cls_align_pointer.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c: use portable cast from + pointer to integer (intptr_t). + * testsuite/libffi.call/cls_longdouble.c: disable for win64. + +2008-12-19 Anthony Green + + * configure.ac: Bump version to 3.0.8. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-11-11 Anthony Green + + * configure.ac: Bump version to 3.0.7. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-08-25 Andreas Tobler + + * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and + FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. + Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. + Adjust copyright notice. + * src/powerpc/ffi.c: Add two new flags to indicate if we have one + register or two register to use for FFI_SYSV structs. + (ffi_prep_cif_machdep): Pass the right register flag introduced above. + (ffi_closure_helper_SYSV): Fix the return type for + FFI_SYSV_TYPE_SMALL_STRUCT. Comment. + Adjust copyright notice. + +2008-07-24 Anthony Green + + * testsuite/libffi.call/cls_dbls_struct.c, + testsuite/libffi.call/cls_double_va.c, + testsuite/libffi.call/cls_longdouble.c, + testsuite/libffi.call/cls_longdouble_va.c, + testsuite/libffi.call/cls_pointer.c, + testsuite/libffi.call/cls_pointer_stack.c, + testsuite/libffi.call/err_bad_abi.c: Clean up failures from + compiler warnings. + +2008-07-17 Anthony Green + + * configure.ac: Bump version to 3.0.6. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. Add documentation. + * README: Update for new release. + +2008-07-16 Kaz Kojima + + * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned + int. + +2008-07-16 Kaz Kojima + + * src/sh/sysv.S: Add .note.GNU-stack on Linux. + * src/sh64/sysv.S: Likewise. + +2008-04-03 Anthony Green + + * libffi.pc.in (Libs): Add -L${libdir}. + * configure.ac: Bump version to 3.0.5. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-04-03 Anthony Green + Xerces Ranby + + * include/ffi.h.in: Wrap definition of target architecture to + protect from double definitions. + +2008-03-22 Moriyoshi Koizumi + + * src/x86/ffi.c (ffi_prep_closure_loc): Fix for bug revealed in + closure_loc_fn0.c. + * testsuite/libffi.call/closure_loc_fn0.c (closure_loc_test_fn0): + New test. + +2008-03-04 Anthony Green + Blake Chaffin + hos@tamanegi.org + + * testsuite/libffi.call/cls_align_longdouble_split2.c + testsuite/libffi.call/cls_align_longdouble_split.c + testsuite/libffi.call/cls_dbls_struct.c + testsuite/libffi.call/cls_double_va.c + testsuite/libffi.call/cls_longdouble.c + testsuite/libffi.call/cls_longdouble_va.c + testsuite/libffi.call/cls_pointer.c + testsuite/libffi.call/cls_pointer_stack.c + testsuite/libffi.call/err_bad_abi.c + testsuite/libffi.call/err_bad_typedef.c + testsuite/libffi.call/huge_struct.c + testsuite/libffi.call/stret_large2.c + testsuite/libffi.call/stret_large.c + testsuite/libffi.call/stret_medium2.c + testsuite/libffi.call/stret_medium.c: New tests from Apple. + +2008-02-26 Jakub Jelinek + Anthony Green + + * src/alpha/osf.S: Add .note.GNU-stack on Linux. + * src/s390/sysv.S: Likewise. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/linux64_closure.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + * src/x86/unix64.S: Likewise. + * src/x86/sysv.S: Likewise. + * src/sparc/v8.S: Likewise. + * src/sparc/v9.S: Likewise. + * src/m68k/sysv.S: Likewise. + * src/ia64/unix.S: Likewise. + * src/arm/sysv.S: Likewise. + +2008-02-26 Anthony Green + Thomas Heller + + * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C + comment. + +2008-02-26 Anthony Green + Thomas Heller + + * include/ffi.h.in: Change void (*)() to void (*)(void). + +2008-02-26 Anthony Green + Thomas Heller + + * src/alpha/ffi.c: Change void (*)() to void (*)(void). + src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c, + src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c, + src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S, + src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c, + src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c, + src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S, + src/x86/ffi64.c: Ditto. + +2008-02-24 Anthony Green + + * configure.ac: Accept openbsd*, not just openbsd. + Bump version to 3.0.4. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-02-22 Anthony Green + + * README: Clean up list of tested platforms. + +2008-02-22 Anthony Green + + * configure.ac: Bump version to 3.0.3. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. Clean up test docs. + +2008-02-22 Bjoern Koenig + Andreas Tobler + + * configure.ac: Add amd64-*-freebsd* target. + * configure: Regenerate. + +2008-02-22 Thomas Heller + + * configure.ac: Add x86 OpenBSD support. + * configure: Rebuilt. + +2008-02-21 Thomas Heller + + * README: Change "make test" to "make check". + +2008-02-21 Anthony Green + + * configure.ac: Bump version to 3.0.2. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-02-21 Björn König + + * src/x86/freebsd.S: New file. + * configure.ac: Add x86 FreeBSD support. + * Makefile.am: Ditto. + +2008-02-15 Anthony Green + + * configure.ac: Bump version to 3.0.1. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * libtool-version: Increment revision. + * README: Update for new release. + +2008-02-15 David Daney + + * src/mips/ffi.c: Remove extra '>' from include directive. + (ffi_prep_closure_loc): Use clear_location instead of tramp. + +2008-02-15 Anthony Green + + * configure.ac: Bump version to 3.0.0. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + +2008-02-15 David Daney + + * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): + Define (conditionally), and use it to include cachectl.h. + (ffi_prep_closure_loc): Fix cache flushing. + * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. + +2008-02-15 Anthony Green + + * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3: + Update dates and remove all references to ffi_prep_closure. + * configure.ac: Bump version to 2.99.9. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + +2008-02-15 Anthony Green + + * man/ffi_prep_closure.3: Delete. + * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3. + (man_MANS): Ditto. + * man/Makefile.in: Rebuilt. + * configure.ac: Bump version to 2.99.8. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + +2008-02-14 Anthony Green + + * configure.ac: Bump version to 2.99.7. + * configure, doc/stamp-vti, doc/version.texi: Rebuilt. + * include/ffi.h.in LICENSE src/debug.c src/closures.c + src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h + src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c + src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S + src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c + src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c + src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S + src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h + src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c + src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S + src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h + src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h + src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S + src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h + src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S + src/arm/ffitarget.h src/prep_cif.c: Update license text. + +2008-02-14 Anthony Green + + * README: Update tested platforms. + * configure.ac: Bump version to 2.99.6. + * configure: Rebuilt. + +2008-02-14 Anthony Green + + * configure.ac: Bump version to 2.99.5. + * configure: Rebuilt. + * Makefile.am (EXTRA_DIST): Add darwin64.S + * Makefile.in: Rebuilt. + * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree. + * LICENSE: Update WARRANTY. + +2008-02-14 Anthony Green + + * libffi.pc.in (libdir): Fix libdir definition. + * configure.ac: Bump version to 2.99.4. + * configure: Rebuilt. + +2008-02-14 Anthony Green + + * README: Update. + * libffi.info: New file. + * doc/stamp-vti: New file. + * configure.ac: Bump version to 2.99.3. + * configure: Rebuilt. + +2008-02-14 Anthony Green + + * Makefile.am (SUBDIRS): Add man dir. + * Makefile.in: Rebuilt. + * configure.ac: Create Makefile. + * configure: Rebuilt. + * man/ffi_call.3 man/ffi_prep_cif.3 man/ffi_prep_closure.3 + man/Makefile.am man/Makefile.in: New files. + +2008-02-14 Tom Tromey + + * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt. + * mdate-sh, texinfo.tex: New files. + * Makefile.am (info_TEXINFOS): New variable. + * doc/libffi.texi: New file. + * doc/version.texi: Likewise. + +2008-02-14 Anthony Green + + * Makefile.am (AM_CFLAGS): Don't compile with -D$(TARGET). + (lib_LTLIBRARIES): Define. + (toolexeclib_LIBRARIES): Undefine. + * Makefile.in: Rebuilt. + * configure.ac: Reset version to 2.99.1. + * configure.in: Rebuilt. + +2008-02-14 Anthony Green + + * libffi.pc.in: Use @PACKAGE_NAME@ and @PACKAGE_VERSION@. + * configure.ac: Reset version to 2.99.1. + * configure.in: Rebuilt. + * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi. + * Makefile.in: Rebuilt. + * LICENSE: Update copyright notice. + +2008-02-14 Anthony Green + + * include/Makefile.am (nodist_includes_HEADERS): Define. Don't + distribute ffitarget.h or ffi.h from the build include dir. + * Makefile.in: Rebuilt. + +2008-02-14 Anthony Green + + * include/Makefile.am (includesdir): Install headers under libdir. + (pkgconfigdir): Define. Install libffi.pc. + * include/Makefile.in: Rebuilt. + * libffi.pc.in: Create. + * libtool-version: Increment CURRENT + * configure.ac: Add libffi.pc.in + * configure: Rebuilt. + +2008-02-03 Anthony Green + + * include/Makefile.am (includesdir): Fix header install with + DESTDIR. + * include/Makefile.in: Rebuilt. + +2008-02-03 Timothy Wall + + * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return + offset based on code pointer, not data pointer. + +2008-02-01 Anthony Green + + * include/Makefile.am: Fix header installs. + * Makefile.am: Ditto. + * include/Makefile.in: Rebuilt. + * Makefile.in: Ditto. + +2008-02-01 Anthony Green + + * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL, + FFI_INIT_TRAMPOLINE): Revert my broken changes to twall's last + patch. + +2008-01-31 Anthony Green + + * Makefile.am (EXTRA_DIST): Add missing files. + * testsuite/Makefile.am: Ditto. + * Makefile.in, testsuite/Makefile.in: Rebuilt. + +2008-01-31 Timothy Wall + + * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall + closures. + * src/x86/ffitarget.h: Increase size of trampoline for stdcall + closures. + * src/x86/win32.S: Add assembly for stdcall closure. + * src/x86/ffi.c: Initialize stdcall closure trampoline. + +2008-01-30 H.J. Lu + + PR libffi/34612 + * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when + returning struct. + + * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" + tests. + +2008-01-30 Anthony Green + + * Makefile.am, include/Makefile.am: Move headers to + libffi_la_SOURCES for new automake. + * Makefile.in, include/Makefile.in: Rebuilt. + + * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for + execution outside of gcc tree. + * testsuite/lib/target-libpath.exp: Ditto. + + * testsuite/lib/libffi-dg.exp: Many changes to allow for execution + outside of gcc tree. + + +============================================================================= +From the old ChangeLog.libgcj file.... + +2004-01-14 Kelley Cook + + * configure.in: Add in AC_PREREQ(2.13) + +2003-02-20 Alexandre Oliva + + * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to + config.status. + * configure: Rebuilt. + +2002-01-27 Alexandre Oliva + + * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. + Remove USE_LIBDIR conditional. + * Makefile.am (toolexecdir, toolexeclibdir): Don't override. + * Makefile.in, configure: Rebuilt. + +Mon Aug 9 18:33:38 1999 Rainer Orth + + * include/Makefile.in: Rebuilt. + * Makefile.in: Rebuilt + * Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native + builds. + Use USE_LIBDIR. + + * configure: Rebuilt. + * configure.in (USE_LIBDIR): Define for native builds. + Use lowercase in configure --help explanations. + +1999-08-08 Anthony Green + + * include/ffi.h.in (FFI_FN): Remove `...'. + +1999-08-08 Anthony Green + + * Makefile.in: Rebuilt. + * Makefile.am (AM_CFLAGS): Compile with -fexceptions. + + * src/x86/sysv.S: Add exception handling metadata. + + +============================================================================= + +The libffi version 1 ChangeLog archive. + +Version 1 of libffi had per-directory ChangeLogs. Current and future +versions have a single ChangeLog file in the root directory. The +version 1 ChangeLogs have all been concatenated into this file for +future reference only. + +--- libffi ---------------------------------------------------------------- + +Mon Oct 5 02:17:50 1998 Anthony Green + + * configure.in: Boosted rev. + * configure, Makefile.in, aclocal.m4: Rebuilt. + * README: Boosted rev and updated release notes. + +Mon Oct 5 01:03:03 1998 Anthony Green + + * configure.in: Boosted rev. + * configure, Makefile.in, aclocal.m4: Rebuilt. + * README: Boosted rev and updated release notes. + +1998-07-25 Andreas Schwab + + * m68k/ffi.c (ffi_prep_cif_machdep): Use bitmask for cif->flags. + Correctly handle small structures. + (ffi_prep_args): Also handle small structures. + (ffi_call): Pass size of return type to ffi_call_SYSV. + * m68k/sysv.S: Adjust for above changes. Correctly align small + structures in the return value. + + * types.c (uint64, sint64) [M68K]: Change alignment to 4. + +Fri Apr 17 17:26:58 1998 Anthony Green + + * configure.in: Boosted rev. + * configure,Makefile.in,aclocal.m4: Rebuilt. + * README: Boosted rev and added release notes. + +Sun Feb 22 00:50:41 1998 Geoff Keating + + * configure.in: Add PowerPC config bits. + +1998-02-14 Andreas Schwab + + * configure.in: Add m68k config bits. Change AC_CANONICAL_SYSTEM + to AC_CANONICAL_HOST, this is not a compiler. Use $host instead + of $target. Remove AC_CHECK_SIZEOF(char), we already know the + result. Fix argument of AC_ARG_ENABLE. + * configure, fficonfig.h.in: Rebuilt. + +Tue Feb 10 20:53:40 1998 Richard Henderson + + * configure.in: Add Alpha config bits. + +Tue May 13 13:39:20 1997 Anthony Green + + * README: Updated dates and reworded Irix comments. + + * configure.in: Removed AC_PROG_RANLIB. + + * Makefile.in, aclocal.m4, config.guess, config.sub, configure, + ltmain.sh, */Makefile.in: libtoolized again and rebuilt with + automake and autoconf. + +Sat May 10 18:44:50 1997 Tom Tromey + + * configure, aclocal.m4: Rebuilt. + * configure.in: Don't compute EXTRADIST; now handled in + src/Makefile.in. Removed macros implied by AM_INIT_AUTOMAKE. + Don't run AM_MAINTAINER_MODE. + +Thu May 8 14:34:05 1997 Anthony Green + + * missing, ltmain.sh, ltconfig.sh: Created. These are new files + required by automake and libtool. + + * README: Boosted rev to 1.14. Added notes. + + * acconfig.h: Moved PACKAGE and VERSION for new automake. + + * configure.in: Changes for libtool. + + * Makefile.am (check): make test now make check. Uses libtool now. + + * Makefile.in, configure.in, aclocal.h, fficonfig.h.in: Rebuilt. + +Thu May 1 16:27:07 1997 Anthony Green + + * missing: Added file required by new automake. + +Tue Nov 26 14:10:42 1996 Anthony Green + + * acconfig.h: Added USING_PURIFY flag. This is defined when + --enable-purify-safety was used at configure time. + + * configure.in (allsources): Added --enable-purify-safety switch. + (VERSION): Boosted rev to 1.13. + * configure: Rebuilt. + +Fri Nov 22 06:46:12 1996 Anthony Green + + * configure.in (VERSION): Boosted rev to 1.12. + Removed special CFLAGS hack for gcc. + * configure: Rebuilt. + + * README: Boosted rev to 1.12. Added notes. + + * Many files: Cygnus Support changed to Cygnus Solutions. + +Wed Oct 30 11:15:25 1996 Anthony Green + + * configure.in (VERSION): Boosted rev to 1.11. + * configure: Rebuilt. + + * README: Boosted rev to 1.11. Added notes about GNU make. + +Tue Oct 29 12:25:12 1996 Anthony Green + + * configure.in: Fixed -Wall trick. + (VERSION): Boosted rev. + * configure: Rebuilt + + * acconfig.h: Needed for --enable-debug configure switch. + + * README: Boosted rev to 1.09. Added more notes on building + libffi, and LCLint. + + * configure.in: Added --enable-debug switch. Boosted rev to + 1.09. + * configure: Rebuilt + +Tue Oct 15 13:11:28 1996 Anthony Green + + * configure.in (VERSION): Boosted rev to 1.08 + * configure: Rebuilt. + + * README: Added n32 bug fix notes. + + * Makefile.am: Added "make lint" production. + * Makefile.in: Rebuilt. + +Mon Oct 14 10:54:46 1996 Anthony Green + + * README: Added web page reference. + + * configure.in, README: Boosted rev to 1.05 + * configure: Rebuilt. + + * README: Fixed n32 sample code. + +Fri Oct 11 17:09:28 1996 Anthony Green + + * README: Added sparc notes. + + * configure.in, README: Boosted rev to 1.04. + * configure: Rebuilt. + +Thu Oct 10 10:31:03 1996 Anthony Green + + * configure.in, README: Boosted rev to 1.03. + * configure: Rebuilt. + + * README: Added struct notes. + + * Makefile.am (EXTRA_DIST): Added LICENSE to distribution. + * Makefile.in: Rebuilt. + + * README: Removed Linux section. No special notes now + because aggregates arg/return types work. + +Wed Oct 9 16:16:42 1996 Anthony Green + + * README, configure.in (VERSION): Boosted rev to 1.02 + * configure: Rebuilt. + +Tue Oct 8 11:56:33 1996 Anthony Green + + * README (NOTE): Added n32 notes. + + * Makefile.am: Added test production. + * Makefile: Rebuilt + + * README: spell checked! + + * configure.in (VERSION): Boosted rev to 1.01 + * configure: Rebuilt. + +Mon Oct 7 15:50:22 1996 Anthony Green + + * configure.in: Added nasty bit to support SGI tools. + * configure: Rebuilt. + + * README: Added SGI notes. Added note about automake bug. + +Mon Oct 7 11:00:28 1996 Anthony Green + + * README: Rewrote intro, and fixed examples. + +Fri Oct 4 10:19:55 1996 Anthony Green + + * configure.in: -D$TARGET is no longer used as a compiler switch. + It is now inserted into ffi.h at configure time. + * configure: Rebuilt. + + * FFI_ABI and FFI_STATUS are now ffi_abi and ffi_status. + +Thu Oct 3 13:47:34 1996 Anthony Green + + * README, LICENSE: Created. Wrote some docs. + + * configure.in: Don't barf on i586-unknown-linuxaout. + Added EXTRADIST code for "make dist". + * configure: Rebuilt. + + * */Makefile.in: Rebuilt with patched automake. + +Tue Oct 1 17:12:25 1996 Anthony Green + + * Makefile.am, aclocal.m4, config.guess, config.sub, + configure.in, fficonfig.h.in, install-sh, mkinstalldirs, + stamp-h.in: Created + * Makefile.in, configure: Generated + +--- libffi/include -------------------------------------------------------- + +Tue Feb 24 13:09:36 1998 Anthony Green + + * ffi_mips.h: Updated FFI_TYPE_STRUCT_* values based on + ffi.h.in changes. This is a work-around for SGI's "simple" + assembler. + +Sun Feb 22 00:51:55 1998 Geoff Keating + + * ffi.h.in: PowerPC support. + +1998-02-14 Andreas Schwab + + * ffi.h.in: Add m68k support. + (FFI_TYPE_LONGDOUBLE): Make it a separate value. + +Tue Feb 10 20:55:16 1998 Richard Henderson + + * ffi.h.in (SIZEOF_ARG): Use a pointer type by default. + + * ffi.h.in: Alpha support. + +Fri Nov 22 06:48:45 1996 Anthony Green + + * ffi.h.in, ffi_common.h: Cygnus Support -> Cygnus Solutions. + +Wed Nov 20 22:31:01 1996 Anthony Green + + * ffi.h.in: Added ffi_type_void definition. + +Tue Oct 29 12:22:40 1996 Anthony Green + + * Makefile.am (hack_DATA): Always install ffi_mips.h. + + * ffi.h.in: Removed FFI_DEBUG. It's now in the correct + place (acconfig.h). + Added #include for size_t definition. + +Tue Oct 15 17:23:35 1996 Anthony Green + + * ffi.h.in, ffi_common.h, ffi_mips.h: More clean up. + Commented out #define of FFI_DEBUG. + +Tue Oct 15 13:01:06 1996 Anthony Green + + * ffi_common.h: Added bool definition. + + * ffi.h.in, ffi_common.h: Clean up based on LCLint output. + Added funny /*@...@*/ comments to annotate source. + +Mon Oct 14 12:29:23 1996 Anthony Green + + * ffi.h.in: Interface changes based on feedback from Jim + Blandy. + +Fri Oct 11 16:49:35 1996 Anthony Green + + * ffi.h.in: Small change for sparc support. + +Thu Oct 10 14:53:37 1996 Anthony Green + + * ffi_mips.h: Added FFI_TYPE_STRUCT_* definitions for + special structure return types. + +Wed Oct 9 13:55:57 1996 Anthony Green + + * ffi.h.in: Added SIZEOF_ARG definition for X86 + +Tue Oct 8 11:40:36 1996 Anthony Green + + * ffi.h.in (FFI_FN): Added macro for eliminating compiler warnings. + Use it to case your function pointers to the proper type. + + * ffi_mips.h (SIZEOF_ARG): Added magic to fix type promotion bug. + + * Makefile.am (EXTRA_DIST): Added ffi_mips.h to EXTRA_DIST. + * Makefile: Rebuilt. + + * ffi_mips.h: Created. Moved all common mips definitions here. + +Mon Oct 7 10:58:12 1996 Anthony Green + + * ffi.h.in: The SGI assember is very picky about parens. Redefined + some macros to avoid problems. + + * ffi.h.in: Added FFI_DEFAULT_ABI definitions. Also added + externs for pointer, and 64bit integral ffi_types. + +Fri Oct 4 09:51:37 1996 Anthony Green + + * ffi.h.in: Added FFI_ABI member to ffi_cif and changed + function prototypes accordingly. + Added #define @TARGET@. Now programs including ffi.h don't + have to specify this themselves. + +Thu Oct 3 15:36:44 1996 Anthony Green + + * ffi.h.in: Changed ffi_prep_cif's values from void* to void** + + * Makefile.am (EXTRA_DIST): Added EXTRA_DIST for "make dist" + to work. + * Makefile.in: Regenerated. + +Wed Oct 2 10:16:59 1996 Anthony Green + + * Makefile.am: Created + * Makefile.in: Generated + + * ffi_common.h: Added rcsid comment + +Tue Oct 1 17:13:51 1996 Anthony Green + + * ffi.h.in, ffi_common.h: Created + +--- libffi/src ------------------------------------------------------------ + +Mon Oct 5 02:17:50 1998 Anthony Green + + * arm/ffi.c, arm/sysv.S: Created. + + * Makefile.am: Added arm files. + * Makefile.in: Rebuilt. + +Mon Oct 5 01:41:38 1998 Anthony Green + + * Makefile.am (libffi_la_LDFLAGS): Incremented revision. + +Sun Oct 4 16:27:17 1998 Anthony Green + + * alpha/osf.S (ffi_call_osf): Patch for DU assembler. + + * ffitest.c (main): long long and long double return values work + for x86. + +Fri Apr 17 11:50:58 1998 Anthony Green + + * Makefile.in: Rebuilt. + + * ffitest.c (main): Floating point tests not executed for systems + with broken lond double (SunOS 4 w/ GCC). + + * types.c: Fixed x86 alignment info for long long types. + +Thu Apr 16 07:15:28 1998 Anthony Green + + * ffitest.c: Added more notes about GCC bugs under Irix 6. + +Wed Apr 15 08:42:22 1998 Anthony Green + + * ffitest.c (struct5): New test function. + (main): New test with struct5. + +Thu Mar 5 10:48:11 1998 Anthony Green + + * prep_cif.c (initialize_aggregate): Fix assertion for + nested structures. + +Tue Feb 24 16:33:41 1998 Anthony Green + + * prep_cif.c (ffi_prep_cif): Added long double support for sparc. + +Sun Feb 22 00:52:18 1998 Geoff Keating + + * powerpc/asm.h: New file. + * powerpc/ffi.c: New file. + * powerpc/sysv.S: New file. + * Makefile.am: PowerPC port. + * ffitest.c (main): Allow all tests to run even in presence of gcc + bug on PowerPC. + +1998-02-17 Anthony Green + + * mips/ffi.c: Fixed comment typo. + + * x86/ffi.c (ffi_prep_cif_machdep), x86/sysv.S (retfloat): + Fixed x86 long double return handling. + + * types.c: Fixed x86 long double alignment info. + +1998-02-14 Andreas Schwab + + * types.c: Add m68k support. + + * ffitest.c (floating): Add long double parameter. + (return_ll, ldblit): New functions to test long long and long + double return value. + (main): Fix type error in assignment of ts[1-4]_type.elements. + Add tests for long long and long double arguments and return + values. + + * prep_cif.c (ffi_prep_cif) [M68K]: Don't allocate argument for + struct value pointer. + + * m68k/ffi.c, m68k/sysv.S: New files. + * Makefile.am: Add bits for m68k port. Add kludge to work around + automake deficiency. + (test): Don't require "." in $PATH. + * Makefile.in: Rebuilt. + +Wed Feb 11 07:36:50 1998 Anthony Green + + * Makefile.in: Rebuilt. + +Tue Feb 10 20:56:00 1998 Richard Henderson + + * alpha/ffi.c, alpha/osf.S: New files. + * Makefile.am: Alpha port. + +Tue Nov 18 14:12:07 1997 Anthony Green + + * mips/ffi.c (ffi_prep_cif_machdep): Initialize rstruct_flag + for n32. + +Tue Jun 3 17:18:20 1997 Anthony Green + + * ffitest.c (main): Added hack to get structure tests working + correctly. + +Sat May 10 19:06:42 1997 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.am (EXTRA_DIST): Explicitly list all distributable + files in subdirs. + (VERSION, CC): Removed. + +Thu May 8 17:19:01 1997 Anthony Green + + * Makefile.am: Many changes for new automake and libtool. + * Makefile.in: Rebuilt. + +Fri Nov 22 06:57:56 1996 Anthony Green + + * ffitest.c (main): Fixed test case for non mips machines. + +Wed Nov 20 22:31:59 1996 Anthony Green + + * types.c: Added ffi_type_void declaration. + +Tue Oct 29 13:07:19 1996 Anthony Green + + * ffitest.c (main): Fixed character constants. + (main): Emit warning for structure test 3 failure on Sun. + + * Makefile.am (VPATH): Fixed VPATH def'n so automake won't + strip it out. + Moved distdir hack from libffi to automake. + (ffitest): Added missing -c for $(COMPILE) (change in automake). + * Makefile.in: Rebuilt. + +Tue Oct 15 13:08:20 1996 Anthony Green + + * Makefile.am: Added "make lint" production. + * Makefile.in: Rebuilt. + + * prep_cif.c (STACK_ARG_SIZE): Improved STACK_ARG_SIZE macro. + Clean up based on LCLint output. Added funny /*@...@*/ comments to + annotate source. + + * ffitest.c, debug.c: Cleaned up code. + +Mon Oct 14 12:26:56 1996 Anthony Green + + * ffitest.c: Changes based on interface changes. + + * prep_cif.c (ffi_prep_cif): Cleaned up interface based on + feedback from Jim Blandy. + +Fri Oct 11 15:53:18 1996 Anthony Green + + * ffitest.c: Reordered tests while porting to sparc. + Made changes to handle lame structure passing for sparc. + Removed calls to fflush(). + + * prep_cif.c (ffi_prep_cif): Added special case for sparc + aggregate type arguments. + +Thu Oct 10 09:56:51 1996 Anthony Green + + * ffitest.c (main): Added structure passing/returning tests. + + * prep_cif.c (ffi_prep_cif): Perform proper initialization + of structure return types if needed. + (initialize_aggregate): Bug fix + +Wed Oct 9 16:04:20 1996 Anthony Green + + * types.c: Added special definitions for x86 (double doesn't + need double word alignment). + + * ffitest.c: Added many tests + +Tue Oct 8 09:19:22 1996 Anthony Green + + * prep_cif.c (ffi_prep_cif): Fixed assertion. + + * debug.c (ffi_assert): Must return a non void now. + + * Makefile.am: Added test production. + * Makefile: Rebuilt. + + * ffitest.c (main): Created. + + * types.c: Created. Stripped common code out of */ffi.c. + + * prep_cif.c: Added missing stdlib.h include. + + * debug.c (ffi_type_test): Used "a" to eliminate compiler + warnings in non-debug builds. Included ffi_common.h. + +Mon Oct 7 15:36:42 1996 Anthony Green + + * Makefile.am: Added a rule for .s -> .o + This is required by the SGI compiler. + * Makefile: Rebuilt. + +Fri Oct 4 09:51:08 1996 Anthony Green + + * prep_cif.c (initialize_aggregate): Moved abi specification + to ffi_prep_cif(). + +Thu Oct 3 15:37:37 1996 Anthony Green + + * prep_cif.c (ffi_prep_cif): Changed values from void* to void**. + (initialize_aggregate): Fixed aggregate type initialization. + + * Makefile.am (EXTRA_DIST): Added support code for "make dist". + * Makefile.in: Regenerated. + +Wed Oct 2 11:41:57 1996 Anthony Green + + * debug.c, prep_cif: Created. + + * Makefile.am: Added debug.o and prep_cif.o to OBJ. + * Makefile.in: Regenerated. + + * Makefile.am (INCLUDES): Added missing -I../include + * Makefile.in: Regenerated. + +Tue Oct 1 17:11:51 1996 Anthony Green + + * error.c, Makefile.am: Created. + * Makefile.in: Generated. + +--- libffi/src/x86 -------------------------------------------------------- + +Sun Oct 4 16:27:17 1998 Anthony Green + + * sysv.S (retlongdouble): Fixed long long return value support. + * ffi.c (ffi_prep_cif_machdep): Ditto. + +Wed May 13 04:30:33 1998 Anthony Green + + * ffi.c (ffi_prep_cif_machdep): Fixed long double return value + support. + +Wed Apr 15 08:43:20 1998 Anthony Green + + * ffi.c (ffi_prep_args): small struct support was missing. + +Thu May 8 16:53:58 1997 Anthony Green + + * objects.mak: Removed. + +Mon Dec 2 15:12:58 1996 Tom Tromey + + * sysv.S: Use .balign, for a.out Linux boxes. + +Tue Oct 15 13:06:50 1996 Anthony Green + + * ffi.c: Clean up based on LCLint output. + Added funny /*@...@*/ comments to annotate source. + +Fri Oct 11 16:43:38 1996 Anthony Green + + * ffi.c (ffi_call): Added assertion for bad ABIs. + +Wed Oct 9 13:57:27 1996 Anthony Green + + * sysv.S (retdouble): Fixed double return problems. + + * ffi.c (ffi_call): Corrected fn arg definition. + (ffi_prep_cif_machdep): Fixed double return problems + +Tue Oct 8 12:12:49 1996 Anthony Green + + * ffi.c: Moved ffi_type definitions to types.c. + (ffi_prep_args): Fixed type promotion bug. + +Mon Oct 7 15:53:06 1996 Anthony Green + + * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' + +Fri Oct 4 09:54:53 1996 Anthony Green + + * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped + remaining args. + +Wed Oct 2 10:07:05 1996 Anthony Green + + * ffi.c, sysv.S, objects.mak: Created. + (ffi_prep_cif): cif->rvalue no longer initialized to NULL. + (ffi_prep_cif_machdep): Moved machine independent cif processing + to src/prep_cif.c. Introduced ffi_prep_cif_machdep(). + +--- libffi/src/mips ------------------------------------------------------- + +Tue Feb 17 17:18:07 1998 Anthony Green + + * o32.S: Fixed typo in comment. + + * ffi.c (ffi_prep_cif_machdep): Fixed argument processing. + +Thu May 8 16:53:58 1997 Anthony Green + + * o32.s, n32.s: Wrappers for SGI tool support. + + * objects.mak: Removed. + +Tue Oct 29 14:37:45 1996 Anthony Green + + * ffi.c (ffi_prep_args): Changed int z to size_t z. + +Tue Oct 15 13:17:25 1996 Anthony Green + + * n32.S: Fixed bad stack munging. + + * ffi.c: Moved prototypes for ffi_call_?32() to here from + ffi_mips.h because extended_cif is not defined in ffi_mips.h. + +Mon Oct 14 12:42:02 1996 Anthony Green + + * ffi.c: Interface changes based on feedback from Jim Blandy. + +Thu Oct 10 11:22:16 1996 Anthony Green + + * n32.S, ffi.c: Lots of changes to support passing and + returning structures with the n32 calling convention. + + * n32.S: Fixed fn pointer bug. + + * ffi.c (ffi_prep_cif_machdep): Fix for o32 structure + return values. + (ffi_prep_args): Fixed n32 structure passing when structures + partially fit in registers. + +Wed Oct 9 13:49:25 1996 Anthony Green + + * objects.mak: Added n32.o. + + * n32.S: Created. + + * ffi.c (ffi_prep_args): Added magic to support proper + n32 processing. + +Tue Oct 8 10:37:35 1996 Anthony Green + + * ffi.c: Moved ffi_type definitions to types.c. + (ffi_prep_args): Fixed type promotion bug. + + * o32.S: This code is only built for o32 compiles. + A lot of the #define cruft has moved to ffi_mips.h. + + * ffi.c (ffi_prep_cif_machdep): Fixed arg flags. Second arg + is only processed if the first is either a float or double. + +Mon Oct 7 15:33:59 1996 Anthony Green + + * o32.S: Modified to compile under each of o32, n32 and n64. + + * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' + +Fri Oct 4 09:53:25 1996 Anthony Green + + * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped + remaining args. + +Wed Oct 2 17:41:22 1996 Anthony Green + + * o32.S: Removed crufty definitions. + +Wed Oct 2 12:53:42 1996 Anthony Green + + * ffi.c (ffi_prep_cif): cif->rvalue no longer initialized to NULL. + (ffi_prep_cif_machdep): Moved all machine independent cif processing + to src/prep_cif.c. Introduced ffi_prep_cif_machdep. Return types + of FFI_TYPE_STRUCT are no different than FFI_TYPE_INT. + +Tue Oct 1 17:11:02 1996 Anthony Green + + * ffi.c, o32.S, object.mak: Created + +--- libffi/src/sparc ------------------------------------------------------ + +Tue Feb 24 16:33:18 1998 Anthony Green + + * ffi.c (ffi_prep_args): Added long double support. + +Thu May 8 16:53:58 1997 Anthony Green + + * objects.mak: Removed. + +Thu May 1 16:07:56 1997 Anthony Green + + * v8.S: Fixed minor portability problem reported by + Russ McManus . + +Tue Nov 26 14:12:43 1996 Anthony Green + + * v8.S: Used STACKFRAME define elsewhere. + + * ffi.c (ffi_prep_args): Zero out space when USING_PURIFY + is set. + (ffi_prep_cif_machdep): Allocate the correct stack frame + space for functions with < 6 args. + +Tue Oct 29 15:08:55 1996 Anthony Green + + * ffi.c (ffi_prep_args): int z is now size_t z. + +Mon Oct 14 13:31:24 1996 Anthony Green + + * v8.S (ffi_call_V8): Gordon rewrites this again. It looks + great now. + + * ffi.c (ffi_call): The comment about hijacked registers + is no longer valid after gordoni hacked v8.S. + + * v8.S (ffi_call_V8): Rewrote with gordoni. Much simpler. + + * v8.S, ffi.c: ffi_call() had changed to accept more than + two args, so v8.S had to change (because it hijacks incoming + arg registers). + + * ffi.c: Interface changes based on feedback from Jim Blandy. + +Thu Oct 10 17:48:16 1996 Anthony Green + + * ffi.c, v8.S, objects.mak: Created. + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE new file mode 100644 index 0000000..4f0b762 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE @@ -0,0 +1,21 @@ +libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE-BUILDTOOLS b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE-BUILDTOOLS new file mode 100644 index 0000000..d1d626e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/LICENSE-BUILDTOOLS @@ -0,0 +1,353 @@ +The libffi source distribution contains certain code that is not part +of libffi, and is only used as tooling to assist with the building and +testing of libffi. This includes the msvcc.sh script used to wrap the +Microsoft compiler with GNU compatible command-line options, +make_sunver.pl, and the libffi test code distributed in the +testsuite/libffi.bhaible directory. This code is distributed with +libffi for the purpose of convenience only, and libffi is in no way +derived from this code. + +msvcc.sh an testsuite/libffi.bhaible are both distributed under the +terms of the GNU GPL version 2, as below. + + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/Makefile.am b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/Makefile.am new file mode 100644 index 0000000..7654bf5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/Makefile.am @@ -0,0 +1,150 @@ +## Process this with automake to create Makefile.in + +AUTOMAKE_OPTIONS = foreign subdir-objects + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = include testsuite man +if BUILD_DOCS +## This hack is needed because it doesn't seem possible to make a +## conditional info_TEXINFOS in Automake. At least Automake 1.14 +## either gives errors -- if this attempted in the most +## straightforward way -- or simply unconditionally tries to build the +## info file. +SUBDIRS += doc +endif + +EXTRA_DIST = LICENSE ChangeLog.old \ + m4/libtool.m4 m4/lt~obsolete.m4 \ + m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \ + m4/ltversion.m4 src/debug.c msvcc.sh \ + generate-darwin-source-and-headers.py \ + libffi.xcodeproj/project.pbxproj \ + libtool-ldflags libtool-version configure.host README.md \ + libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl + +# local.exp is generated by configure +DISTCLEANFILES = local.exp + +# Subdir rules rely on $(FLAGS_TO_PASS) +FLAGS_TO_PASS = $(AM_MAKEFLAGS) + +MAKEOVERRIDES= + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libffi.pc + +toolexeclib_LTLIBRARIES = libffi.la +noinst_LTLIBRARIES = libffi_convenience.la + +libffi_la_SOURCES = src/prep_cif.c src/types.c \ + src/raw_api.c src/java_raw_api.c src/closures.c + +if FFI_DEBUG +libffi_la_SOURCES += src/debug.c +endif + +noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h \ + src/alpha/ffitarget.h src/alpha/internal.h \ + src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h \ + src/avr32/ffitarget.h src/bfin/ffitarget.h \ + src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h \ + src/ia64/ffitarget.h src/ia64/ia64_flags.h \ + src/m32r/ffitarget.h src/m68k/ffitarget.h \ + src/m88k/ffitarget.h src/metag/ffitarget.h \ + src/microblaze/ffitarget.h src/mips/ffitarget.h \ + src/moxie/ffitarget.h src/nios2/ffitarget.h \ + src/or1k/ffitarget.h src/pa/ffitarget.h \ + src/powerpc/ffitarget.h src/powerpc/asm.h \ + src/powerpc/ffi_powerpc.h src/riscv/ffitarget.h \ + src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h \ + src/sh64/ffitarget.h src/sparc/ffitarget.h \ + src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h \ + src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \ + src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c \ + src/kvx/ffitarget.h + +EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ + src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ + src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ + src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ + src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ + src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ + src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c \ + src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c \ + src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S \ + src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c \ + src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S \ + src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S \ + src/nios2/ffi.c src/nios2/sysv.S src/or1k/ffi.c \ + src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ + src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ + src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ + src/powerpc/linux64.S src/powerpc/linux64_closure.S \ + src/powerpc/ppc_closure.S src/powerpc/aix.S \ + src/powerpc/darwin.S src/powerpc/aix_closure.S \ + src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ + src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ + src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ + src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ + src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ + src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ + src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ + src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ + src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c \ + src/kvx/sysv.S + +TARGET_OBJ = @TARGET_OBJ@ +libffi_la_LIBADD = $(TARGET_OBJ) + +libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) +EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES) +libffi_convenience_la_LIBADD = $(libffi_la_LIBADD) +libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES) +nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) + +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) + +AM_CFLAGS = +if FFI_DEBUG +# Build debug. Define FFI_DEBUG on the commandline so that, when building with +# MSVC, it can link against the debug CRT. +AM_CFLAGS += -DFFI_DEBUG +endif + +if LIBFFI_BUILD_VERSIONED_SHLIB +if LIBFFI_BUILD_VERSIONED_SHLIB_GNU +libffi_version_script = -Wl,--version-script,libffi.map +libffi_version_dep = libffi.map +endif +if LIBFFI_BUILD_VERSIONED_SHLIB_SUN +libffi_version_script = -Wl,-M,libffi.map-sun +libffi_version_dep = libffi.map-sun +libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \ + $(libffi_la_OBJECTS) $(libffi_la_LIBADD) + perl $(top_srcdir)/make_sunver.pl libffi.map \ + `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \ + sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \ + > $@ || (rm -f $@ ; exit 1) +endif +else +libffi_version_script = +libffi_version_dep = +endif +libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` + +libffi.map: $(top_srcdir)/libffi.map.in + $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \ + -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in + +libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) +libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) + +AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src +AM_CCASFLAGS = $(AM_CPPFLAGS) + +dist-hook: + d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc) + if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog + s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/README.md b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/README.md new file mode 100644 index 0000000..4225d85 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/README.md @@ -0,0 +1,486 @@ +Status +====== + +[![Build Status](https://travis-ci.org/libffi/libffi.svg?branch=master)](https://travis-ci.org/libffi/libffi) +[![Build status](https://ci.appveyor.com/api/projects/status/8lko9vagbx4w2kxq?svg=true)](https://ci.appveyor.com/project/atgreen/libffi) + +libffi-3.4 was released on TBD. Check the libffi web +page for updates: . + + +What is libffi? +=============== + +Compilers for high level languages generate code that follow certain +conventions. These conventions are necessary, in part, for separate +compilation to work. One such convention is the "calling +convention". The "calling convention" is essentially a set of +assumptions made by the compiler about where function arguments will +be found on entry to a function. A "calling convention" also specifies +where the return value for a function is found. + +Some programs may not know at the time of compilation what arguments +are to be passed to a function. For instance, an interpreter may be +told at run-time about the number and types of arguments used to call +a given function. Libffi can be used in such programs to provide a +bridge from the interpreter program to compiled code. + +The libffi library provides a portable, high level programming +interface to various calling conventions. This allows a programmer to +call any function specified by a call interface description at run +time. + +FFI stands for Foreign Function Interface. A foreign function +interface is the popular name for the interface that allows code +written in one language to call code written in another language. The +libffi library really only provides the lowest, machine dependent +layer of a fully featured foreign function interface. A layer must +exist above libffi that handles type conversions for values passed +between the two languages. + + +Supported Platforms +=================== + +Libffi has been ported to many different platforms. + +At the time of release, the following basic configurations have been +tested: + +| Architecture | Operating System | Compiler | +| --------------- | ---------------- | ----------------------- | +| AArch64 (ARM64) | iOS | Clang | +| AArch64 | Linux | GCC | +| AArch64 | Windows | MSVC | +| Alpha | Linux | GCC | +| Alpha | Tru64 | GCC | +| ARC | Linux | GCC | +| ARM | Linux | GCC | +| ARM | iOS | GCC | +| ARM | Windows | MSVC | +| AVR32 | Linux | GCC | +| Blackfin | uClinux | GCC | +| CSKY | Linux | GCC | +| HPPA | HPUX | GCC | +| KVX | Linux | GCC | +| IA-64 | Linux | GCC | +| M68K | FreeMiNT | GCC | +| M68K | Linux | GCC | +| M68K | RTEMS | GCC | +| M88K | OpenBSD/mvme88k | GCC | +| Meta | Linux | GCC | +| MicroBlaze | Linux | GCC | +| MIPS | IRIX | GCC | +| MIPS | Linux | GCC | +| MIPS | RTEMS | GCC | +| MIPS64 | Linux | GCC | +| Moxie | Bare metal | GCC | +| Nios II | Linux | GCC | +| OpenRISC | Linux | GCC | +| PowerPC 32-bit | AIX | IBM XL C | +| PowerPC 64-bit | AIX | IBM XL C | +| PowerPC | AMIGA | GCC | +| PowerPC | Linux | GCC | +| PowerPC | Mac OSX | GCC | +| PowerPC | FreeBSD | GCC | +| PowerPC 64-bit | FreeBSD | GCC | +| PowerPC 64-bit | Linux ELFv1 | GCC | +| PowerPC 64-bit | Linux ELFv2 | GCC | +| RISC-V 32-bit | Linux | GCC | +| RISC-V 64-bit | Linux | GCC | +| S390 | Linux | GCC | +| S390X | Linux | GCC | +| SPARC | Linux | GCC | +| SPARC | Solaris | GCC | +| SPARC | Solaris | Oracle Solaris Studio C | +| SPARC64 | Linux | GCC | +| SPARC64 | FreeBSD | GCC | +| SPARC64 | Solaris | Oracle Solaris Studio C | +| TILE-Gx/TILEPro | Linux | GCC | +| VAX | OpenBSD/vax | GCC | +| X86 | FreeBSD | GCC | +| X86 | GNU HURD | GCC | +| X86 | Interix | GCC | +| X86 | kFreeBSD | GCC | +| X86 | Linux | GCC | +| X86 | OpenBSD | GCC | +| X86 | OS/2 | GCC | +| X86 | Solaris | GCC | +| X86 | Solaris | Oracle Solaris Studio C | +| X86 | Windows/Cygwin | GCC | +| X86 | Windows/MingW | GCC | +| X86-64 | FreeBSD | GCC | +| X86-64 | Linux | GCC | +| X86-64 | Linux/x32 | GCC | +| X86-64 | OpenBSD | GCC | +| X86-64 | Solaris | Oracle Solaris Studio C | +| X86-64 | Windows/Cygwin | GCC | +| X86-64 | Windows/MingW | GCC | +| X86-64 | Mac OSX | GCC | +| Xtensa | Linux | GCC | + +Please send additional platform test results to +libffi-discuss@sourceware.org. + +Installing libffi +================= + +First you must configure the distribution for your particular +system. Go to the directory you wish to build libffi in and run the +"configure" program found in the root directory of the libffi source +distribution. Note that building libffi requires a C99 compatible +compiler. + +If you're building libffi directly from git hosted sources, configure +won't exist yet; run ./autogen.sh first. This will require that you +install autoconf, automake and libtool. + +You may want to tell configure where to install the libffi library and +header files. To do that, use the ``--prefix`` configure switch. Libffi +will install under /usr/local by default. + +If you want to enable extra run-time debugging checks use the the +``--enable-debug`` configure switch. This is useful when your program dies +mysteriously while using libffi. + +Another useful configure switch is ``--enable-purify-safety``. Using this +will add some extra code which will suppress certain warnings when you +are using Purify with libffi. Only use this switch when using +Purify, as it will slow down the library. + +If you don't want to build documentation, use the ``--disable-docs`` +configure switch. + +It's also possible to build libffi on Windows platforms with +Microsoft's Visual C++ compiler. In this case, use the msvcc.sh +wrapper script during configuration like so: + + path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL" + +For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and +``CXX="path/to/msvcc.sh -m64"``. You may also need to specify +``--build`` appropriately. + +It is also possible to build libffi on Windows platforms with the LLVM +project's clang-cl compiler, like below: + + path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP" + +When building with MSVC under a MingW environment, you may need to +remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath' +command. ('cygpath' is not present in MingW, and is not required when +using MingW-style paths.) + +To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have + aarch64/Ffi_staticLib.sln + required header files in aarch64/aarch64_include/ + + +SPARC Solaris builds require the use of the GNU assembler and linker. +Point ``AS`` and ``LD`` environment variables at those tool prior to +configuration. + +For iOS builds, the ``libffi.xcodeproj`` Xcode project is available. + +Configure has many other options. Use ``configure --help`` to see them all. + +Once configure has finished, type "make". Note that you must be using +GNU make. You can ftp GNU make from ftp.gnu.org:/pub/gnu/make . + +To ensure that libffi is working as advertised, type "make check". +This will require that you have DejaGNU installed. + +To install the library and header files, type ``make install``. + + +History +======= + +See the git log for details at http://github.com/libffi/libffi. + + 3.4 TBD + Add support for Alibaba's CSKY architecture. + Add support for Intel Control-flow Enforcement Technology (CET). + Add support for ARM Pointer Authentication (PA). + Fix 32-bit PPC regression. + Fix MIPS soft-float problem. + + 3.3 Nov-23-19 + Add RISC-V support. + New API in support of GO closures. + Add IEEE754 binary128 long double support for 64-bit Power + Default to Microsoft's 64 bit long double ABI with Visual C++. + GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI. + Add Windows on ARM64 (WOA) support. + Add Windows 32-bit ARM support. + Raw java (gcj) API deprecated. + Add pre-built PDF documentation to source distribution. + Many new test cases and bug fixes. + + 3.2.1 Nov-12-14 + Build fix for non-iOS AArch64 targets. + + 3.2 Nov-11-14 + Add C99 Complex Type support (currently only supported on + s390). + Add support for PASCAL and REGISTER calling conventions on x86 + Windows/Linux. + Add OpenRISC and Cygwin-64 support. + Bug fixes. + + 3.1 May-19-14 + Add AArch64 (ARM64) iOS support. + Add Nios II support. + Add m88k and DEC VAX support. + Add support for stdcall, thiscall, and fastcall on non-Windows + 32-bit x86 targets such as Linux. + Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi + fixes. + Make the testsuite more robust: eliminate several spurious + failures, and respect the $CC and $CXX environment variables. + Archive off the manually maintained ChangeLog in favor of git + log. + + 3.0.13 Mar-17-13 + Add Meta support. + Add missing Moxie bits. + Fix stack alignment bug on 32-bit x86. + Build fix for m68000 targets. + Build fix for soft-float Power targets. + Fix the install dir location for some platforms when building + with GCC (OS X, Solaris). + Fix Cygwin regression. + + 3.0.12 Feb-11-13 + Add Moxie support. + Add AArch64 support. + Add Blackfin support. + Add TILE-Gx/TILEPro support. + Add MicroBlaze support. + Add Xtensa support. + Add support for PaX enabled kernels with MPROTECT. + Add support for native vendor compilers on + Solaris and AIX. + Work around LLVM/GCC interoperability issue on x86_64. + + 3.0.11 Apr-11-12 + Lots of build fixes. + Add support for variadic functions (ffi_prep_cif_var). + Add Linux/x32 support. + Add thiscall, fastcall and MSVC cdecl support on Windows. + Add Amiga and newer MacOS support. + Add m68k FreeMiNT support. + Integration with iOS' xcode build tools. + Fix Octeon and MC68881 support. + Fix code pessimizations. + + 3.0.10 Aug-23-11 + Add support for Apple's iOS. + Add support for ARM VFP ABI. + Add RTEMS support for MIPS and M68K. + Fix instruction cache clearing problems on + ARM and SPARC. + Fix the N64 build on mips-sgi-irix6.5. + Enable builds with Microsoft's compiler. + Enable x86 builds with Oracle's Solaris compiler. + Fix support for calling code compiled with Oracle's Sparc + Solaris compiler. + Testsuite fixes for Tru64 Unix. + Additional platform support. + + 3.0.9 Dec-31-09 + Add AVR32 and win64 ports. Add ARM softfp support. + Many fixes for AIX, Solaris, HP-UX, *BSD. + Several PowerPC and x86-64 bug fixes. + Build DLL for windows. + + 3.0.8 Dec-19-08 + Add *BSD, BeOS, and PA-Linux support. + + 3.0.7 Nov-11-08 + Fix for ppc FreeBSD. + (thanks to Andreas Tobler) + + 3.0.6 Jul-17-08 + Fix for closures on sh. + Mark the sh/sh64 stack as non-executable. + (both thanks to Kaz Kojima) + + 3.0.5 Apr-3-08 + Fix libffi.pc file. + Fix #define ARM for IcedTea users. + Fix x86 closure bug. + + 3.0.4 Feb-24-08 + Fix x86 OpenBSD configury. + + 3.0.3 Feb-22-08 + Enable x86 OpenBSD thanks to Thomas Heller, and + x86-64 FreeBSD thanks to Björn König and Andreas Tobler. + Clean up test instruction in README. + + 3.0.2 Feb-21-08 + Improved x86 FreeBSD support. + Thanks to Björn König. + + 3.0.1 Feb-15-08 + Fix instruction cache flushing bug on MIPS. + Thanks to David Daney. + + 3.0.0 Feb-15-08 + Many changes, mostly thanks to the GCC project. + Cygnus Solutions is now Red Hat. + + [10 years go by...] + + 1.20 Oct-5-98 + Raffaele Sena produces ARM port. + + 1.19 Oct-5-98 + Fixed x86 long double and long long return support. + m68k bug fixes from Andreas Schwab. + Patch for DU assembler compatibility for the Alpha from Richard + Henderson. + + 1.18 Apr-17-98 + Bug fixes and MIPS configuration changes. + + 1.17 Feb-24-98 + Bug fixes and m68k port from Andreas Schwab. PowerPC port from + Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes. + + 1.16 Feb-11-98 + Richard Henderson produces Alpha port. + + 1.15 Dec-4-97 + Fixed an n32 ABI bug. New libtool, auto* support. + + 1.14 May-13-97 + libtool is now used to generate shared and static libraries. + Fixed a minor portability problem reported by Russ McManus + . + + 1.13 Dec-2-96 + Added --enable-purify-safety to keep Purify from complaining + about certain low level code. + Sparc fix for calling functions with < 6 args. + Linux x86 a.out fix. + + 1.12 Nov-22-96 + Added missing ffi_type_void, needed for supporting void return + types. Fixed test case for non MIPS machines. Cygnus Support + is now Cygnus Solutions. + + 1.11 Oct-30-96 + Added notes about GNU make. + + 1.10 Oct-29-96 + Added configuration fix for non GNU compilers. + + 1.09 Oct-29-96 + Added --enable-debug configure switch. Clean-ups based on LCLint + feedback. ffi_mips.h is always installed. Many configuration + fixes. Fixed ffitest.c for sparc builds. + + 1.08 Oct-15-96 + Fixed n32 problem. Many clean-ups. + + 1.07 Oct-14-96 + Gordon Irlam rewrites v8.S again. Bug fixes. + + 1.06 Oct-14-96 + Gordon Irlam improved the sparc port. + + 1.05 Oct-14-96 + Interface changes based on feedback. + + 1.04 Oct-11-96 + Sparc port complete (modulo struct passing bug). + + 1.03 Oct-10-96 + Passing struct args, and returning struct values works for + all architectures/calling conventions. Expanded tests. + + 1.02 Oct-9-96 + Added SGI n32 support. Fixed bugs in both o32 and Linux support. + Added "make test". + + 1.01 Oct-8-96 + Fixed float passing bug in mips version. Restructured some + of the code. Builds cleanly with SGI tools. + + 1.00 Oct-7-96 + First release. No public announcement. + +Authors & Credits +================= + +libffi was originally written by Anthony Green . + +The developers of the GNU Compiler Collection project have made +innumerable valuable contributions. See the ChangeLog file for +details. + +Some of the ideas behind libffi were inspired by Gianni Mariani's free +gencall library for Silicon Graphics machines. + +The closure mechanism was designed and implemented by Kresten Krab +Thorup. + +Major processor architecture ports were contributed by the following +developers: + + aarch64 Marcus Shawcroft, James Greenhalgh + alpha Richard Henderson + arc Hackers at Synopsis + arm Raffaele Sena + avr32 Bradley Smith + blackfin Alexandre Keunecke I. de Mendonca + cris Simon Posnjak, Hans-Peter Nilsson + csky Ma Jun, Zhang Wenmeng + frv Anthony Green + ia64 Hans Boehm + m32r Kazuhiro Inaoka + m68k Andreas Schwab + m88k Miod Vallat + metag Hackers at Imagination Technologies + microblaze Nathan Rossi + mips Anthony Green, Casey Marshall + mips64 David Daney + moxie Anthony Green + nios ii Sandra Loosemore + openrisc Sebastian Macke + pa Randolph Chung, Dave Anglin, Andreas Tobler + powerpc Geoffrey Keating, Andreas Tobler, + David Edelsohn, John Hornkvist + powerpc64 Jakub Jelinek + riscv Michael Knyszek, Andrew Waterman, Stef O'Rear + s390 Gerhard Tonn, Ulrich Weigand + sh Kaz Kojima + sh64 Kaz Kojima + sparc Anthony Green, Gordon Irlam + tile-gx/tilepro Walter Lee + vax Miod Vallat + x86 Anthony Green, Jon Beniston + x86-64 Bo Thorsen + xtensa Chris Zankel + +Jesper Skov and Andrew Haley both did more than their fair share of +stepping through the code and tracking down bugs. + +Thanks also to Tom Tromey for bug fixes, documentation and +configuration help. + +Thanks to Jim Blandy, who provided some useful feedback on the libffi +interface. + +Andreas Tobler has done a tremendous amount of work on the testsuite. + +Alex Oliva solved the executable page problem for SElinux. + +The list above is almost certainly incomplete and inaccurate. I'm +happy to make corrections or additions upon request. + +If you have a problem, or have found a bug, please send a note to the +author at green@moxielogic.com, or the project mailing list at +libffi-discuss@sourceware.org. diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/acinclude.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/acinclude.m4 new file mode 100644 index 0000000..1a70efb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/acinclude.m4 @@ -0,0 +1,479 @@ +# mmap(2) blacklisting. Some platforms provide the mmap library routine +# but don't support all of the features we need from it. +AC_DEFUN([AC_FUNC_MMAP_BLACKLIST], +[ +AC_CHECK_HEADER([sys/mman.h], + [libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no]) +AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no]) +if test "$libffi_header_sys_mman_h" != yes \ + || test "$libffi_func_mmap" != yes; then + ac_cv_func_mmap_file=no + ac_cv_func_mmap_dev_zero=no + ac_cv_func_mmap_anon=no +else + AC_CACHE_CHECK([whether read-only mmap of a plain file works], + ac_cv_func_mmap_file, + [# Add a system to this blacklist if + # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a + # memory area containing the same data that you'd get if you applied + # read() to the same fd. The only system known to have a problem here + # is VMS, where text files have record structure. + case "$host_os" in + vms* | ultrix*) + ac_cv_func_mmap_file=no ;; + *) + ac_cv_func_mmap_file=yes;; + esac]) + AC_CACHE_CHECK([whether mmap from /dev/zero works], + ac_cv_func_mmap_dev_zero, + [# Add a system to this blacklist if it has mmap() but /dev/zero + # does not exist, or if mmapping /dev/zero does not give anonymous + # zeroed pages with both the following properties: + # 1. If you map N consecutive pages in with one call, and then + # unmap any subset of those pages, the pages that were not + # explicitly unmapped remain accessible. + # 2. If you map two adjacent blocks of memory and then unmap them + # both at once, they must both go away. + # Systems known to be in this category are Windows (all variants), + # VMS, and Darwin. + case "$host_os" in + vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + ac_cv_func_mmap_dev_zero=no ;; + *) + ac_cv_func_mmap_dev_zero=yes;; + esac]) + + # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. + AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon, + [AC_TRY_COMPILE( +[#include +#include +#include + +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif +], +[int n = MAP_ANONYMOUS;], + ac_cv_decl_map_anon=yes, + ac_cv_decl_map_anon=no)]) + + if test $ac_cv_decl_map_anon = no; then + ac_cv_func_mmap_anon=no + else + AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], + ac_cv_func_mmap_anon, + [# Add a system to this blacklist if it has mmap() and MAP_ANON or + # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) + # doesn't give anonymous zeroed pages with the same properties listed + # above for use of /dev/zero. + # Systems known to be in this category are Windows, VMS, and SCO Unix. + case "$host_os" in + vms* | cygwin* | pe | mingw* | sco* | udk* ) + ac_cv_func_mmap_anon=no ;; + *) + ac_cv_func_mmap_anon=yes;; + esac]) + fi +fi + +if test $ac_cv_func_mmap_file = yes; then + AC_DEFINE(HAVE_MMAP_FILE, 1, + [Define if read-only mmap of a plain file works.]) +fi +if test $ac_cv_func_mmap_dev_zero = yes; then + AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, + [Define if mmap of /dev/zero works.]) +fi +if test $ac_cv_func_mmap_anon = yes; then + AC_DEFINE(HAVE_MMAP_ANON, 1, + [Define if mmap with MAP_ANON(YMOUS) works.]) +fi +]) + +dnl ---------------------------------------------------------------------- +dnl This whole bit snagged from libstdc++-v3, via libatomic. + +dnl +dnl LIBFFI_ENABLE +dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING) +dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c) +dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER) +dnl +dnl See docs/html/17_intro/configury.html#enable for documentation. +dnl +m4_define([LIBFFI_ENABLE],[dnl +m4_define([_g_switch],[--enable-$1])dnl +m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl + AC_ARG_ENABLE($1,_g_help, + m4_bmatch([$5], + [^permit ], + [[ + case "$enableval" in + m4_bpatsubst([$5],[permit ])) ;; + *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;; + dnl Idea for future: generate a URL pointing to + dnl "onlinedocs/configopts.html#whatever" + esac + ]], + [^$], + [[ + case "$enableval" in + yes|no) ;; + *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;; + esac + ]], + [[$5]]), + [enable_]m4_bpatsubst([$1],-,_)[=][$2]) +m4_undefine([_g_switch])dnl +m4_undefine([_g_help])dnl +]) + +dnl +dnl If GNU ld is in use, check to see if tricky linker opts can be used. If +dnl the native linker is in use, all variables will be defined to something +dnl safe (like an empty string). +dnl +dnl Defines: +dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible +dnl OPT_LDFLAGS='-Wl,-O1' if possible +dnl LD (as a side effect of testing) +dnl Sets: +dnl with_gnu_ld +dnl libat_ld_is_gold (possibly) +dnl libat_gnu_ld_version (possibly) +dnl +dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will +dnl set libat_gnu_ld_version to 12345. Zeros cause problems. +dnl +AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ + # If we're not using GNU ld, then there's no point in even trying these + # tests. Check for that first. We should have already tested for gld + # by now (in libtool), but require it now just to be safe... + test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' + test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' + AC_REQUIRE([AC_PROG_LD]) + AC_REQUIRE([AC_PROG_AWK]) + + # The name set by libtool depends on the version of libtool. Shame on us + # for depending on an impl detail, but c'est la vie. Older versions used + # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on + # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually + # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't + # set (hence we're using an older libtool), then set it. + if test x${with_gnu_ld+set} != xset; then + if test x${ac_cv_prog_gnu_ld+set} != xset; then + # We got through "ac_require(ac_prog_ld)" and still not set? Huh? + with_gnu_ld=no + else + with_gnu_ld=$ac_cv_prog_gnu_ld + fi + fi + + # Start by getting the version number. I think the libtool test already + # does some of this, but throws away the result. + libat_ld_is_gold=no + if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then + libat_ld_is_gold=yes + fi + changequote(,) + ldver=`$LD --version 2>/dev/null | + sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'` + changequote([,]) + libat_gnu_ld_version=`echo $ldver | \ + $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` + + # Set --gc-sections. + if test "$with_gnu_ld" = "notbroken"; then + # GNU ld it is! Joy and bunny rabbits! + + # All these tests are for C++; save the language and the compiler flags. + # Need to do this so that g++ won't try to link in libstdc++ + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS='-x c++ -Wl,--gc-sections' + + # Check for -Wl,--gc-sections + # XXX This test is broken at the moment, as symbols required for linking + # are now in libsupc++ (not built yet). In addition, this test has + # cored on solaris in the past. In addition, --gc-sections doesn't + # really work at the moment (keeps on discarding used sections, first + # .eh_frame and now some of the glibc sections for iconv). + # Bzzzzt. Thanks for playing, maybe next time. + AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) + AC_TRY_RUN([ + int main(void) + { + try { throw 1; } + catch (...) { }; + return 0; + } + ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes]) + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + else + # this is the suspicious part + CFLAGS='' + fi + if test "$ac_sectionLDflags" = "yes"; then + SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" + fi + AC_MSG_RESULT($ac_sectionLDflags) + fi + + # Set linker optimization flags. + if test x"$with_gnu_ld" = x"yes"; then + OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" + fi + + AC_SUBST(SECTION_LDFLAGS) + AC_SUBST(OPT_LDFLAGS) +]) + + +dnl +dnl If GNU ld is in use, check to see if tricky linker opts can be used. If +dnl the native linker is in use, all variables will be defined to something +dnl safe (like an empty string). +dnl +dnl Defines: +dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible +dnl OPT_LDFLAGS='-Wl,-O1' if possible +dnl LD (as a side effect of testing) +dnl Sets: +dnl with_gnu_ld +dnl libat_ld_is_gold (possibly) +dnl libat_gnu_ld_version (possibly) +dnl +dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will +dnl set libat_gnu_ld_version to 12345. Zeros cause problems. +dnl +AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ + # If we're not using GNU ld, then there's no point in even trying these + # tests. Check for that first. We should have already tested for gld + # by now (in libtool), but require it now just to be safe... + test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' + test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' + AC_REQUIRE([AC_PROG_LD]) + AC_REQUIRE([AC_PROG_AWK]) + + # The name set by libtool depends on the version of libtool. Shame on us + # for depending on an impl detail, but c'est la vie. Older versions used + # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on + # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually + # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't + # set (hence we're using an older libtool), then set it. + if test x${with_gnu_ld+set} != xset; then + if test x${ac_cv_prog_gnu_ld+set} != xset; then + # We got through "ac_require(ac_prog_ld)" and still not set? Huh? + with_gnu_ld=no + else + with_gnu_ld=$ac_cv_prog_gnu_ld + fi + fi + + # Start by getting the version number. I think the libtool test already + # does some of this, but throws away the result. + libat_ld_is_gold=no + if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then + libat_ld_is_gold=yes + fi + libat_ld_is_lld=no + if $LD --version 2>/dev/null | grep 'LLD '> /dev/null 2>&1; then + libat_ld_is_lld=yes + fi + changequote(,) + ldver=`$LD --version 2>/dev/null | + sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'` + changequote([,]) + libat_gnu_ld_version=`echo $ldver | \ + $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` + + # Set --gc-sections. + if test "$with_gnu_ld" = "notbroken"; then + # GNU ld it is! Joy and bunny rabbits! + + # All these tests are for C++; save the language and the compiler flags. + # Need to do this so that g++ won't try to link in libstdc++ + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS='-x c++ -Wl,--gc-sections' + + # Check for -Wl,--gc-sections + # XXX This test is broken at the moment, as symbols required for linking + # are now in libsupc++ (not built yet). In addition, this test has + # cored on solaris in the past. In addition, --gc-sections doesn't + # really work at the moment (keeps on discarding used sections, first + # .eh_frame and now some of the glibc sections for iconv). + # Bzzzzt. Thanks for playing, maybe next time. + AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) + AC_TRY_RUN([ + int main(void) + { + try { throw 1; } + catch (...) { }; + return 0; + } + ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes]) + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + else + # this is the suspicious part + CFLAGS='' + fi + if test "$ac_sectionLDflags" = "yes"; then + SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" + fi + AC_MSG_RESULT($ac_sectionLDflags) + fi + + # Set linker optimization flags. + if test x"$with_gnu_ld" = x"yes"; then + OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" + fi + + AC_SUBST(SECTION_LDFLAGS) + AC_SUBST(OPT_LDFLAGS) +]) + + +dnl +dnl Add version tags to symbols in shared library (or not), additionally +dnl marking other symbols as private/local (or not). +dnl +dnl --enable-symvers=style adds a version script to the linker call when +dnl creating the shared library. The choice of version script is +dnl controlled by 'style'. +dnl --disable-symvers does not. +dnl + Usage: LIBFFI_ENABLE_SYMVERS[(DEFAULT)] +dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to +dnl choose a default style based on linker characteristics. Passing +dnl 'no' disables versioning. +dnl +AC_DEFUN([LIBFFI_ENABLE_SYMVERS], [ + +LIBFFI_ENABLE(symvers,yes,[=STYLE], + [enables symbol versioning of the shared library], + [permit yes|no|gnu*|sun]) + +# If we never went through the LIBFFI_CHECK_LINKER_FEATURES macro, then we +# don't know enough about $LD to do tricks... +AC_REQUIRE([LIBFFI_CHECK_LINKER_FEATURES]) + +# Turn a 'yes' into a suitable default. +if test x$enable_symvers = xyes ; then + # FIXME The following test is too strict, in theory. + if test $enable_shared = no || test "x$LD" = x; then + enable_symvers=no + else + if test $with_gnu_ld = yes ; then + enable_symvers=gnu + else + case ${target_os} in + # Sun symbol versioning exists since Solaris 2.5. + solaris2.[[5-9]]* | solaris2.1[[0-9]]*) + enable_symvers=sun ;; + *) + enable_symvers=no ;; + esac + fi + fi +fi + +# Check if 'sun' was requested on non-Solaris 2 platforms. +if test x$enable_symvers = xsun ; then + case ${target_os} in + solaris2*) + # All fine. + ;; + *) + # Unlikely to work. + AC_MSG_WARN([=== You have requested Sun symbol versioning, but]) + AC_MSG_WARN([=== you are not targetting Solaris 2.]) + AC_MSG_WARN([=== Symbol versioning will be disabled.]) + enable_symvers=no + ;; + esac +fi + +# Check to see if libgcc_s exists, indicating that shared libgcc is possible. +if test $enable_symvers != no; then + AC_MSG_CHECKING([for shared libgcc]) + ac_save_CFLAGS="$CFLAGS" + CFLAGS=' -lgcc_s' + AC_TRY_LINK(, [return 0;], libat_shared_libgcc=yes, libat_shared_libgcc=no) + CFLAGS="$ac_save_CFLAGS" + if test $libat_shared_libgcc = no; then + cat > conftest.c <&1 >/dev/null \ + | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'` +changequote([,])dnl + rm -f conftest.c conftest.so + if test x${libat_libgcc_s_suffix+set} = xset; then + CFLAGS=" -lgcc_s$libat_libgcc_s_suffix" + AC_TRY_LINK(, [return 0;], libat_shared_libgcc=yes) + CFLAGS="$ac_save_CFLAGS" + fi + fi + AC_MSG_RESULT($libat_shared_libgcc) +fi + +# For GNU ld, we need at least this version. The format is described in +# LIBFFI_CHECK_LINKER_FEATURES above. +libat_min_gnu_ld_version=21400 +# XXXXXXXXXXX libat_gnu_ld_version=21390 + +# Check to see if unspecified "yes" value can win, given results above. +# Change "yes" into either "no" or a style name. +if test $enable_symvers != no && test $libat_shared_libgcc = yes; then + if test $with_gnu_ld = yes; then + if test $libat_gnu_ld_version -ge $libat_min_gnu_ld_version ; then + enable_symvers=gnu + elif test $libat_ld_is_gold = yes ; then + enable_symvers=gnu + elif test $libat_ld_is_lld = yes ; then + enable_symvers=gnu + else + # The right tools, the right setup, but too old. Fallbacks? + AC_MSG_WARN(=== Linker version $libat_gnu_ld_version is too old for) + AC_MSG_WARN(=== full symbol versioning support in this release of GCC.) + AC_MSG_WARN(=== You would need to upgrade your binutils to version) + AC_MSG_WARN(=== $libat_min_gnu_ld_version or later and rebuild GCC.) + if test $libat_gnu_ld_version -ge 21200 ; then + # Globbing fix is present, proper block support is not. + dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.]) + dnl enable_symvers=??? + AC_MSG_WARN([=== Symbol versioning will be disabled.]) + enable_symvers=no + else + # 2.11 or older. + AC_MSG_WARN([=== Symbol versioning will be disabled.]) + enable_symvers=no + fi + fi + elif test $enable_symvers = sun; then + : All interesting versions of Sun ld support sun style symbol versioning. + else + # just fail for now + AC_MSG_WARN([=== You have requested some kind of symbol versioning, but]) + AC_MSG_WARN([=== either you are not using a supported linker, or you are]) + AC_MSG_WARN([=== not building a shared libgcc_s (which is required).]) + AC_MSG_WARN([=== Symbol versioning will be disabled.]) + enable_symvers=no + fi +fi +if test $enable_symvers = gnu; then + AC_DEFINE(LIBFFI_GNU_SYMBOL_VERSIONING, 1, + [Define to 1 if GNU symbol versioning is used for libatomic.]) +fi + +AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB, test $enable_symvers != no) +AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu) +AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun) +AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers) +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/autogen.sh b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/autogen.sh new file mode 100755 index 0000000..fb014a3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec autoreconf -v -i diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.guess b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.guess new file mode 100644 index 0000000..e94095c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.guess @@ -0,0 +1,1687 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2020 Free Software Foundation, Inc. + +timestamp='2020-07-12' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2020 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-pc-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + set_cc_for_build + LIBCABI=$LIBC + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + # shellcheck disable=SC2154 + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.sub b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.sub new file mode 100644 index 0000000..14b5150 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/config.sub @@ -0,0 +1,1851 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2020 Free Software Foundation, Inc. + +timestamp='2020-08-05' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2020 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x$basic_os != x ] +then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'` + ;; + nto-qnx*) + kernel=nto + os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + nto-qnx*) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.ac b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.ac new file mode 100644 index 0000000..093b87d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.ac @@ -0,0 +1,415 @@ +dnl Process this with autoconf to create configure + +AC_PREREQ(2.68) + +AC_INIT([libffi], [3.3], [http://github.com/libffi/libffi/issues]) +AC_CONFIG_HEADERS([fficonfig.h]) + +AC_CANONICAL_SYSTEM +target_alias=${target_alias-$host_alias} + +case "${host}" in + frv*-elf) + LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ + ;; +esac + +AX_ENABLE_BUILDDIR + +AM_INIT_AUTOMAKE + +# The same as in boehm-gc and libstdc++. Have to borrow it from there. +# We must force CC to /not/ be precious variables; otherwise +# the wrong, non-multilib-adjusted value will be used in multilibs. +# As a side effect, we have to subst CFLAGS ourselves. +# Also save and restore CFLAGS, since AC_PROG_CC will come up with +# defaults of its own if none are provided. + +m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) +m4_define([_AC_ARG_VAR_PRECIOUS],[]) +save_CFLAGS=$CFLAGS +AC_PROG_CC +AC_PROG_CXX +CFLAGS=$save_CFLAGS +m4_undefine([_AC_ARG_VAR_PRECIOUS]) +m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) + +AC_SUBST(CFLAGS) + +AM_PROG_AS +AM_PROG_CC_C_O +AC_PROG_LIBTOOL +AC_CONFIG_MACRO_DIR([m4]) + +# Test for 64-bit build. +AC_CHECK_SIZEOF([size_t]) + +AX_COMPILER_VENDOR +AX_CC_MAXOPT +# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro +# compiler. +if test "$ax_cv_c_compiler_vendor" != "sun"; then + AX_CFLAGS_WARN_ALL +fi + +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +fi + +cat > local.exp < conftest.s + if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then + libffi_cv_as_x86_pcrel=yes + fi + ]) + if test "x$libffi_cv_as_x86_pcrel" = xyes; then + AC_DEFINE(HAVE_AS_X86_PCREL, 1, + [Define if your assembler supports PC relative relocs.]) + fi + ;; + + S390) + AC_CACHE_CHECK([compiler uses zarch features], + libffi_cv_as_s390_zarch, [ + libffi_cv_as_s390_zarch=no + echo 'void foo(void) { bar(); bar(); }' > conftest.c + if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then + if grep -q brasl conftest.s; then + libffi_cv_as_s390_zarch=yes + fi + fi + ]) + if test "x$libffi_cv_as_s390_zarch" = xyes; then + AC_DEFINE(HAVE_AS_S390_ZARCH, 1, + [Define if the compiler uses zarch features.]) + fi + ;; +esac + +AC_CACHE_CHECK([whether compiler supports pointer authentication], + libffi_cv_as_ptrauth, [ + libffi_cv_as_ptrauth=unknown + AC_TRY_COMPILE(,[ +#ifdef __clang__ +# if __has_feature(ptrauth_calls) +# define HAVE_PTRAUTH 1 +# endif +#endif + +#ifndef HAVE_PTRAUTH +# error Pointer authentication not supported +#endif + ], + [libffi_cv_as_ptrauth=yes], + [libffi_cv_as_ptrauth=no]) +]) +if test "x$libffi_cv_as_ptrauth" = xyes; then + AC_DEFINE(HAVE_PTRAUTH, 1, + [Define if your compiler supports pointer authentication.]) +fi + +# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. +AC_ARG_ENABLE(pax_emutramp, + [ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC], + if test "$enable_pax_emutramp" = "yes"; then + AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1, + [Define this if you want to enable pax emulated trampolines]) + fi) + +LT_SYS_SYMBOL_USCORE +if test "x$sys_symbol_underscore" = xyes; then + AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.]) +fi + +FFI_EXEC_TRAMPOLINE_TABLE=0 +case "$target" in + *arm*-apple-* | aarch64-apple-*) + FFI_EXEC_TRAMPOLINE_TABLE=1 + AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1, + [Cannot use PROT_EXEC on this target, so, we revert to + alternative means]) + ;; + *-apple-* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-linux-android*) + AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1, + [Cannot use malloc on this target, so, we revert to + alternative means]) + ;; +esac +AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1) +AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE) + +if test x$TARGET = xX86_64; then + AC_CACHE_CHECK([toolchain supports unwind section type], + libffi_cv_as_x86_64_unwind_section_type, [ + cat > conftest1.s << EOF +.text +.globl foo +foo: +jmp bar +.section .eh_frame,"a",@unwind +bar: +EOF + + cat > conftest2.c << EOF +extern void foo(); +int main(){foo();} +EOF + + libffi_cv_as_x86_64_unwind_section_type=no + # we ensure that we can compile _and_ link an assembly file containing an @unwind section + # since the compiler can support it and not the linker (ie old binutils) + if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ + $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then + libffi_cv_as_x86_64_unwind_section_type=yes + fi + ]) + if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then + AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1, + [Define if your assembler supports unwind section type.]) + fi +fi + +if test "x$GCC" = "xyes"; then + AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto) + + AC_CACHE_CHECK([whether .eh_frame section should be read-only], + libffi_cv_ro_eh_frame, [ + libffi_cv_ro_eh_frame=yes + echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then + if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then + libffi_cv_ro_eh_frame=no + fi + fi + rm -f conftest.* + ]) + if test "x$libffi_cv_ro_eh_frame" = xyes; then + AC_DEFINE(HAVE_RO_EH_FRAME, 1, + [Define if .eh_frame sections should be read-only.]) + AC_DEFINE(EH_FRAME_FLAGS, "a", + [Define to the flags needed for the .section .eh_frame directive. ]) + else + AC_DEFINE(EH_FRAME_FLAGS, "aw", + [Define to the flags needed for the .section .eh_frame directive. ]) + fi + + AC_CACHE_CHECK([for __attribute__((visibility("hidden")))], + libffi_cv_hidden_visibility_attribute, [ + echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c + libffi_cv_hidden_visibility_attribute=no + if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then + if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then + libffi_cv_hidden_visibility_attribute=yes + fi + fi + rm -f conftest.* + ]) + if test $libffi_cv_hidden_visibility_attribute = yes; then + AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1, + [Define if __attribute__((visibility("hidden"))) is supported.]) + fi +fi + +AC_ARG_ENABLE(docs, + AC_HELP_STRING([--disable-docs], + [Disable building of docs (default: no)]), + [enable_docs=no], + [enable_docs=yes]) +AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes]) + +AH_BOTTOM([ +#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +#ifdef LIBFFI_ASM +#ifdef __APPLE__ +#define FFI_HIDDEN(name) .private_extern name +#else +#define FFI_HIDDEN(name) .hidden name +#endif +#else +#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) +#endif +#else +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) +#else +#define FFI_HIDDEN +#endif +#endif +]) + +AC_SUBST(TARGET) +AC_SUBST(TARGETDIR) + +changequote(<,>) +TARGET_OBJ= +for i in $SOURCES; do + TARGET_OBJ="${TARGET_OBJ} src/${TARGETDIR}/"`echo $i | sed 's/[cS]$/lo/'` +done +changequote([,]) +AC_SUBST(TARGET_OBJ) + +AC_SUBST(SHELL) + +AC_ARG_ENABLE(debug, +[ --enable-debug debugging mode], + if test "$enable_debug" = "yes"; then + AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.]) + fi) +AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes") + +AC_ARG_ENABLE(structs, +[ --disable-structs omit code for struct support], + if test "$enable_structs" = "no"; then + AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.]) + fi) +AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes") + +AC_ARG_ENABLE(raw-api, +[ --disable-raw-api make the raw api unavailable], + if test "$enable_raw_api" = "no"; then + AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.]) + fi) + +AC_ARG_ENABLE(purify-safety, +[ --enable-purify-safety purify-safe mode], + if test "$enable_purify_safety" = "yes"; then + AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) + fi) + +AC_ARG_ENABLE(multi-os-directory, +[ --disable-multi-os-directory + disable use of gcc --print-multi-os-directory to change the library installation directory]) + +# These variables are only ever used when we cross-build to X86_WIN32. +# And we only support this with GCC, so... +if test "x$GCC" = "xyes"; then + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + toolexecdir='${exec_prefix}'/'$(target_alias)' + toolexeclibdir='${toolexecdir}'/lib + else + toolexecdir='${libdir}'/gcc-lib/'$(target_alias)' + toolexeclibdir='${libdir}' + fi + if test x"$enable_multi_os_directory" != x"no"; then + multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; + esac + fi + AC_SUBST(toolexecdir) +else + toolexeclibdir='${libdir}' +fi +AC_SUBST(toolexeclibdir) + +# Check linker support. +LIBFFI_ENABLE_SYMVERS + +AC_CONFIG_COMMANDS(include, [test -d include || mkdir include]) +AC_CONFIG_COMMANDS(src, [ +test -d src || mkdir src +test -d src/$TARGETDIR || mkdir src/$TARGETDIR +], [TARGETDIR="$TARGETDIR"]) + +AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc) + +AC_OUTPUT + +# Copy this file instead of using AC_CONFIG_LINK in order to support +# compiling with MSVC, which won't understand cygwin style symlinks. +cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.host b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.host new file mode 100644 index 0000000..257b784 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/configure.host @@ -0,0 +1,318 @@ +# configure.host +# +# This shell script handles all host based configuration for libffi. +# + +# THIS TABLE IS SORTED. KEEP IT THAT WAY. +# Most of the time we can define all the variables all at once... +case "${host}" in + aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* ) + TARGET=ARM_WIN64; TARGETDIR=aarch64 + if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then + MSVC=1 + fi + ;; + + aarch64*-*-*) + TARGET=AARCH64; TARGETDIR=aarch64 + SOURCES="ffi.c sysv.S" + ;; + + alpha*-*-*) + TARGET=ALPHA; TARGETDIR=alpha; + # Support 128-bit long double, changeable via command-line switch. + HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)' + SOURCES="ffi.c osf.S" + ;; + + arc*-*-*) + TARGET=ARC; TARGETDIR=arc + SOURCES="ffi.c arcompact.S" + ;; + + arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* ) + TARGET=ARM_WIN32; TARGETDIR=arm + MSVC=1 + ;; + + arm*-*-*) + TARGET=ARM; TARGETDIR=arm + SOURCES="ffi.c sysv.S" + ;; + + avr32*-*-*) + TARGET=AVR32; TARGETDIR=avr32 + SOURCES="ffi.c sysv.S" + ;; + + bfin*) + TARGET=BFIN; TARGETDIR=bfin + SOURCES="ffi.c sysv.S" + ;; + + cris-*-*) + TARGET=LIBFFI_CRIS; TARGETDIR=cris + SOURCES="ffi.c sysv.S" + ;; + + csky-*-*) + TARGET=CSKY; TARGETDIR=csky + SOURCES="ffi.c sysv.S" + ;; + + frv-*-*) + TARGET=FRV; TARGETDIR=frv + SOURCES="ffi.c eabi.S" + ;; + + hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*) + TARGET=PA_LINUX; TARGETDIR=pa + SOURCES="ffi.c linux.S" + ;; + hppa*64-*-hpux*) + TARGET=PA64_HPUX; TARGETDIR=pa + ;; + hppa*-*-hpux*) + TARGET=PA_HPUX; TARGETDIR=pa + SOURCES="ffi.c hpux32.S" + ;; + + i?86-*-freebsd* | i?86-*-openbsd*) + TARGET=X86_FREEBSD; TARGETDIR=x86 + ;; + + i?86-*-cygwin* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \ + | x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* ) + TARGETDIR=x86 + if test $ac_cv_sizeof_size_t = 4; then + TARGET=X86_WIN32 + else + TARGET=X86_WIN64 + fi + if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then + MSVC=1 + fi + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native + # or cross-build and select where to install dlls appropriately. + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"'; + else + AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; + fi + ;; + + i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios) + TARGETDIR=x86 + if test $ac_cv_sizeof_size_t = 4; then + TARGET=X86_DARWIN + else + TARGET=X86_64 + fi + ;; + + i?86-*-* | x86_64-*-* | amd64-*) + TARGETDIR=x86 + if test $ac_cv_sizeof_size_t = 4; then + echo 'int foo (void) { return __x86_64__; }' > conftest.c + if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then + TARGET_X32=yes + TARGET=X86_64 + else + TARGET=X86; + fi + rm -f conftest.* + else + TARGET=X86_64; + fi + ;; + + ia64*-*-*) + TARGET=IA64; TARGETDIR=ia64 + SOURCES="ffi.c unix.S" + ;; + + kvx-*-*) + TARGET=KVX; TARGETDIR=kvx + SOURCES="ffi.c sysv.S" + ;; + + m32r*-*-*) + TARGET=M32R; TARGETDIR=m32r + SOURCES="ffi.c sysv.S" + ;; + + m68k-*-*) + TARGET=M68K; TARGETDIR=m68k + SOURCES="ffi.c sysv.S" + ;; + + m88k-*-*) + TARGET=M88K; TARGETDIR=m88k + SOURCES="ffi.c obsd.S" + ;; + + microblaze*-*-*) + TARGET=MICROBLAZE; TARGETDIR=microblaze + SOURCES="ffi.c sysv.S" + ;; + + moxie-*-*) + TARGET=MOXIE; TARGETDIR=moxie + SOURCES="ffi.c eabi.S" + ;; + + metag-*-*) + TARGET=METAG; TARGETDIR=metag + SOURCES="ffi.c sysv.S" + ;; + + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + TARGET=MIPS; TARGETDIR=mips + ;; + mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' + TARGET=MIPS; TARGETDIR=mips + ;; + + nios2*-linux*) + TARGET=NIOS2; TARGETDIR=nios2 + SOURCES="ffi.c sysv.S" + ;; + + or1k*-*-*) + TARGET=OR1K; TARGETDIR=or1k + SOURCES="ffi.c sysv.S" + ;; + + powerpc*-*-linux* | powerpc-*-sysv*) + TARGET=POWERPC; TARGETDIR=powerpc + HAVE_LONG_DOUBLE_VARIANT=1 + ;; + powerpc-*-amigaos*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + powerpc-*-eabi*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + powerpc-*-beos*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + powerpc-*-darwin* | powerpc64-*-darwin*) + TARGET=POWERPC_DARWIN; TARGETDIR=powerpc + ;; + powerpc-*-aix* | rs6000-*-aix*) + TARGET=POWERPC_AIX; TARGETDIR=powerpc + ;; + powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*) + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc + HAVE_LONG_DOUBLE_VARIANT=1 + ;; + powerpcspe-*-freebsd*) + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc + CFLAGS="$CFLAGS -D__NO_FPRS__" + ;; + powerpc64-*-freebsd* | powerpc64le-*-freebsd*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + powerpc*-*-rtems*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + + riscv*-*) + TARGET=RISCV; TARGETDIR=riscv + SOURCES="ffi.c sysv.S" + ;; + + s390-*-* | s390x-*-*) + TARGET=S390; TARGETDIR=s390 + SOURCES="ffi.c sysv.S" + ;; + + sh-*-* | sh[34]*-*-*) + TARGET=SH; TARGETDIR=sh + SOURCES="ffi.c sysv.S" + ;; + sh64-*-* | sh5*-*-*) + TARGET=SH64; TARGETDIR=sh64 + SOURCES="ffi.c sysv.S" + ;; + + sparc*-*-*) + TARGET=SPARC; TARGETDIR=sparc + SOURCES="ffi.c ffi64.c v8.S v9.S" + ;; + + tile*-*) + TARGET=TILE; TARGETDIR=tile + SOURCES="ffi.c tile.S" + ;; + + vax-*-*) + TARGET=VAX; TARGETDIR=vax + SOURCES="ffi.c elfbsd.S" + ;; + + xtensa*-*) + TARGET=XTENSA; TARGETDIR=xtensa + SOURCES="ffi.c sysv.S" + ;; +esac + +# ... but some of the cases above share configury. +case "${TARGET}" in + ARM_WIN32) + SOURCES="ffi.c sysv_msvc_arm32.S" + ;; + ARM_WIN64) + if test "$MSVC" = 1; then + SOURCES="ffi.c win64_armasm.S" + else + SOURCES="ffi.c sysv.S" + fi + ;; + MIPS) + SOURCES="ffi.c o32.S n32.S" + ;; + POWERPC) + SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S" + SOURCES="${SOURCES} linux64.S linux64_closure.S" + ;; + POWERPC_AIX) + SOURCES="ffi_darwin.c aix.S aix_closure.S" + ;; + POWERPC_DARWIN) + SOURCES="ffi_darwin.c darwin.S darwin_closure.S" + ;; + POWERPC_FREEBSD) + SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S" + ;; + X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32) + if test "$MSVC" = 1; then + SOURCES="ffi.c sysv_intel.S" + else + SOURCES="ffi.c sysv.S" + fi + ;; + X86_64) + if test x"$TARGET_X32" = xyes; then + SOURCES="ffi64.c unix64.S" + else + SOURCES="ffi64.c unix64.S ffiw64.c win64.S" + fi + ;; + X86_WIN64) + if test "$MSVC" = 1; then + SOURCES="ffiw64.c win64_intel.S" + else + SOURCES="ffiw64.c win64.S" + fi + ;; +esac + +# If we failed to configure SOURCES, we can't do anything. +if test -z "${SOURCES}"; then + UNSUPPORTED=1 +fi diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/Makefile.am b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/Makefile.am new file mode 100644 index 0000000..43b650a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/Makefile.am @@ -0,0 +1,3 @@ +## Process this with automake to create Makefile.in + +info_TEXINFOS = libffi.texi diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/libffi.texi b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/libffi.texi new file mode 100644 index 0000000..bd30593 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/libffi.texi @@ -0,0 +1,997 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename libffi.info +@include version.texi +@settitle libffi: the portable foreign function interface library +@setchapternewpage off +@c %**end of header + +@c Merge the standard indexes into a single one. +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp + +@copying + +This manual is for libffi, a portable foreign function interface +library. + +Copyright @copyright{} 2008--2019 Anthony Green and Red Hat, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +@end copying + +@dircategory Development +@direntry +* libffi: (libffi). Portable foreign function interface library. +@end direntry + +@titlepage +@title libffi: a foreign function interface library +@subtitle For Version @value{VERSION} of libffi +@author Anthony Green +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + + +@ifnottex +@node Top +@top libffi + +@insertcopying + +@menu +* Introduction:: What is libffi? +* Using libffi:: How to use libffi. +* Missing Features:: Things libffi can't do. +* Index:: Index. +@end menu + +@end ifnottex + + +@node Introduction +@chapter What is libffi? + +Compilers for high level languages generate code that follow certain +conventions. These conventions are necessary, in part, for separate +compilation to work. One such convention is the @dfn{calling +convention}. The calling convention is a set of assumptions made by +the compiler about where function arguments will be found on entry to +a function. A calling convention also specifies where the return +value for a function is found. The calling convention is also +sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}. +@cindex calling convention +@cindex ABI +@cindex Application Binary Interface + +Some programs may not know at the time of compilation what arguments +are to be passed to a function. For instance, an interpreter may be +told at run-time about the number and types of arguments used to call +a given function. @samp{Libffi} can be used in such programs to +provide a bridge from the interpreter program to compiled code. + +The @samp{libffi} library provides a portable, high level programming +interface to various calling conventions. This allows a programmer to +call any function specified by a call interface description at run +time. + +@acronym{FFI} stands for Foreign Function Interface. A foreign +function interface is the popular name for the interface that allows +code written in one language to call code written in another language. +The @samp{libffi} library really only provides the lowest, machine +dependent layer of a fully featured foreign function interface. A +layer must exist above @samp{libffi} that handles type conversions for +values passed between the two languages. +@cindex FFI +@cindex Foreign Function Interface + + +@node Using libffi +@chapter Using libffi + +@menu +* The Basics:: The basic libffi API. +* Simple Example:: A simple example. +* Types:: libffi type descriptions. +* Multiple ABIs:: Different passing styles on one platform. +* The Closure API:: Writing a generic function. +* Closure Example:: A closure example. +* Thread Safety:: Thread safety. +@end menu + + +@node The Basics +@section The Basics + +@samp{Libffi} assumes that you have a pointer to the function you wish +to call and that you know the number and types of arguments to pass +it, as well as the return type of the function. + +The first thing you must do is create an @code{ffi_cif} object that +matches the signature of the function you wish to call. This is a +separate step because it is common to make multiple calls using a +single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for +Call InterFace. To prepare a call interface object, use the function +@code{ffi_prep_cif}. +@cindex cif + +@findex ffi_prep_cif +@defun ffi_status ffi_prep_cif (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes}) +This initializes @var{cif} according to the given parameters. + +@var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what +you want. @ref{Multiple ABIs} for more information. + +@var{nargs} is the number of arguments that this function accepts. + +@var{rtype} is a pointer to an @code{ffi_type} structure that +describes the return type of the function. @xref{Types}. + +@var{argtypes} is a vector of @code{ffi_type} pointers. +@var{argtypes} must have @var{nargs} elements. If @var{nargs} is 0, +this argument is ignored. + +@code{ffi_prep_cif} returns a @code{libffi} status code, of type +@code{ffi_status}. This will be either @code{FFI_OK} if everything +worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type} +objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter +is invalid. +@end defun + +If the function being called is variadic (varargs) then +@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}. + +@findex ffi_prep_cif_var +@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nfixedargs}, unsigned int @var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes}) +This initializes @var{cif} according to the given parameters for +a call to a variadic function. In general its operation is the +same as for @code{ffi_prep_cif} except that: + +@var{nfixedargs} is the number of fixed arguments, prior to any +variadic arguments. It must be greater than zero. + +@var{ntotalargs} the total number of arguments, including variadic +and fixed arguments. @var{argtypes} must have this many elements. + +Note that, different cif's must be prepped for calls to the same +function when different numbers of arguments are passed. + +Also note that a call to @code{ffi_prep_cif_var} with +@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to +@code{ffi_prep_cif}. + +@end defun + +Note that the resulting @code{ffi_cif} holds pointers to all the +@code{ffi_type} objects that were used during initialization. You +must ensure that these type objects have a lifetime at least as long +as that of the @code{ffi_cif}. + +To call a function using an initialized @code{ffi_cif}, use the +@code{ffi_call} function: + +@findex ffi_call +@defun void ffi_call (ffi_cif *@var{cif}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues}) +This calls the function @var{fn} according to the description given in +@var{cif}. @var{cif} must have already been prepared using +@code{ffi_prep_cif}. + +@var{rvalue} is a pointer to a chunk of memory that will hold the +result of the function call. This must be large enough to hold the +result, no smaller than the system register size (generally 32 or 64 +bits), and must be suitably aligned; it is the caller's responsibility +to ensure this. If @var{cif} declares that the function returns +@code{void} (using @code{ffi_type_void}), then @var{rvalue} is +ignored. + +In most situations, @samp{libffi} will handle promotion according to +the ABI. However, for historical reasons, there is a special case +with return values that must be handled by your code. In particular, +for integral (not @code{struct}) types that are narrower than the +system register size, the return value will be widened by +@samp{libffi}. @samp{libffi} provides a type, @code{ffi_arg}, that +can be used as the return type. For example, if the CIF was defined +with a return type of @code{char}, @samp{libffi} will try to store a +full @code{ffi_arg} into the return value. + +@var{avalues} is a vector of @code{void *} pointers that point to the +memory locations holding the argument values for a call. If @var{cif} +declares that the function has no arguments (i.e., @var{nargs} was 0), +then @var{avalues} is ignored. Note that argument values may be +modified by the callee (for instance, structs passed by value); the +burden of copying pass-by-value arguments is placed on the caller. + +Note that while the return value must be register-sized, arguments +should exactly match their declared type. For example, if an argument +is a @code{short}, then the entry in @var{avalues} should point to an +object declared as @code{short}; but if the return type is +@code{short}, then @var{rvalue} should point to an object declared as +a larger type -- usually @code{ffi_arg}. +@end defun + + +@node Simple Example +@section Simple Example + +Here is a trivial example that calls @code{puts} a few times. + +@example +#include +#include + +int main() +@{ + ffi_cif cif; + ffi_type *args[1]; + void *values[1]; + char *s; + ffi_arg rc; + + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; + values[0] = &s; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint, args) == FFI_OK) + @{ + s = "Hello World!"; + ffi_call(&cif, puts, &rc, values); + /* rc now holds the result of the call to puts */ + + /* values holds a pointer to the function's arg, so to + call puts() again all we need to do is change the + value of s */ + s = "This is cool!"; + ffi_call(&cif, puts, &rc, values); + @} + + return 0; +@} +@end example + + +@node Types +@section Types + +@menu +* Primitive Types:: Built-in types. +* Structures:: Structure types. +* Size and Alignment:: Size and alignment of types. +* Arrays Unions Enums:: Arrays, unions, and enumerations. +* Type Example:: Structure type example. +* Complex:: Complex types. +* Complex Type Example:: Complex type example. +@end menu + +@node Primitive Types +@subsection Primitive Types + +@code{Libffi} provides a number of built-in type descriptors that can +be used to describe argument and return types: + +@table @code +@item ffi_type_void +@tindex ffi_type_void +The type @code{void}. This cannot be used for argument types, only +for return values. + +@item ffi_type_uint8 +@tindex ffi_type_uint8 +An unsigned, 8-bit integer type. + +@item ffi_type_sint8 +@tindex ffi_type_sint8 +A signed, 8-bit integer type. + +@item ffi_type_uint16 +@tindex ffi_type_uint16 +An unsigned, 16-bit integer type. + +@item ffi_type_sint16 +@tindex ffi_type_sint16 +A signed, 16-bit integer type. + +@item ffi_type_uint32 +@tindex ffi_type_uint32 +An unsigned, 32-bit integer type. + +@item ffi_type_sint32 +@tindex ffi_type_sint32 +A signed, 32-bit integer type. + +@item ffi_type_uint64 +@tindex ffi_type_uint64 +An unsigned, 64-bit integer type. + +@item ffi_type_sint64 +@tindex ffi_type_sint64 +A signed, 64-bit integer type. + +@item ffi_type_float +@tindex ffi_type_float +The C @code{float} type. + +@item ffi_type_double +@tindex ffi_type_double +The C @code{double} type. + +@item ffi_type_uchar +@tindex ffi_type_uchar +The C @code{unsigned char} type. + +@item ffi_type_schar +@tindex ffi_type_schar +The C @code{signed char} type. (Note that there is not an exact +equivalent to the C @code{char} type in @code{libffi}; ordinarily you +should either use @code{ffi_type_schar} or @code{ffi_type_uchar} +depending on whether @code{char} is signed.) + +@item ffi_type_ushort +@tindex ffi_type_ushort +The C @code{unsigned short} type. + +@item ffi_type_sshort +@tindex ffi_type_sshort +The C @code{short} type. + +@item ffi_type_uint +@tindex ffi_type_uint +The C @code{unsigned int} type. + +@item ffi_type_sint +@tindex ffi_type_sint +The C @code{int} type. + +@item ffi_type_ulong +@tindex ffi_type_ulong +The C @code{unsigned long} type. + +@item ffi_type_slong +@tindex ffi_type_slong +The C @code{long} type. + +@item ffi_type_longdouble +@tindex ffi_type_longdouble +On platforms that have a C @code{long double} type, this is defined. +On other platforms, it is not. + +@item ffi_type_pointer +@tindex ffi_type_pointer +A generic @code{void *} pointer. You should use this for all +pointers, regardless of their real type. + +@item ffi_type_complex_float +@tindex ffi_type_complex_float +The C @code{_Complex float} type. + +@item ffi_type_complex_double +@tindex ffi_type_complex_double +The C @code{_Complex double} type. + +@item ffi_type_complex_longdouble +@tindex ffi_type_complex_longdouble +The C @code{_Complex long double} type. +On platforms that have a C @code{long double} type, this is defined. +On other platforms, it is not. +@end table + +Each of these is of type @code{ffi_type}, so you must take the address +when passing to @code{ffi_prep_cif}. + + +@node Structures +@subsection Structures + +@samp{libffi} is perfectly happy passing structures back and forth. +You must first describe the structure to @samp{libffi} by creating a +new @code{ffi_type} object for it. + +@tindex ffi_type +@deftp {Data type} ffi_type +The @code{ffi_type} has the following members: +@table @code +@item size_t size +This is set by @code{libffi}; you should initialize it to zero. + +@item unsigned short alignment +This is set by @code{libffi}; you should initialize it to zero. + +@item unsigned short type +For a structure, this should be set to @code{FFI_TYPE_STRUCT}. + +@item ffi_type **elements +This is a @samp{NULL}-terminated array of pointers to @code{ffi_type} +objects. There is one element per field of the struct. + +Note that @samp{libffi} has no special support for bit-fields. You +must manage these manually. +@end table +@end deftp + +The @code{size} and @code{alignment} fields will be filled in by +@code{ffi_prep_cif} or @code{ffi_prep_cif_var}, as needed. + +@node Size and Alignment +@subsection Size and Alignment + +@code{libffi} will set the @code{size} and @code{alignment} fields of +an @code{ffi_type} object for you. It does so using its knowledge of +the ABI. + +You might expect that you can simply read these fields for a type that +has been laid out by @code{libffi}. However, there are some caveats. + +@itemize @bullet +@item +The size or alignment of some of the built-in types may vary depending +on the chosen ABI. + +@item +The size and alignment of a new structure type will not be set by +@code{libffi} until it has been passed to @code{ffi_prep_cif} or +@code{ffi_get_struct_offsets}. + +@item +A structure type cannot be shared across ABIs. Instead each ABI needs +its own copy of the structure type. +@end itemize + +So, before examining these fields, it is safest to pass the +@code{ffi_type} object to @code{ffi_prep_cif} or +@code{ffi_get_struct_offsets} first. This function will do all the +needed setup. + +@example +ffi_type *desired_type; +ffi_abi desired_abi; +@dots{} +ffi_cif cif; +if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK) + @{ + size_t size = desired_type->size; + unsigned short alignment = desired_type->alignment; + @} +@end example + +@code{libffi} also provides a way to get the offsets of the members of +a structure. + +@findex ffi_get_struct_offsets +@defun ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets) +Compute the offset of each element of the given structure type. +@var{abi} is the ABI to use; this is needed because in some cases the +layout depends on the ABI. + +@var{offsets} is an out parameter. The caller is responsible for +providing enough space for all the results to be written -- one +element per element type in @var{struct_type}. If @var{offsets} is +@code{NULL}, then the type will be laid out but not otherwise +modified. This can be useful for accessing the type's size or layout, +as mentioned above. + +This function returns @code{FFI_OK} on success; @code{FFI_BAD_ABI} if +@var{abi} is invalid; or @code{FFI_BAD_TYPEDEF} if @var{struct_type} +is invalid in some way. Note that only @code{FFI_STRUCT} types are +valid here. +@end defun + +@node Arrays Unions Enums +@subsection Arrays, Unions, and Enumerations + +@subsubsection Arrays + +@samp{libffi} does not have direct support for arrays or unions. +However, they can be emulated using structures. + +To emulate an array, simply create an @code{ffi_type} using +@code{FFI_TYPE_STRUCT} with as many members as there are elements in +the array. + +@example +ffi_type array_type; +ffi_type **elements +int i; + +elements = malloc ((n + 1) * sizeof (ffi_type *)); +for (i = 0; i < n; ++i) + elements[i] = array_element_type; +elements[n] = NULL; + +array_type.size = array_type.alignment = 0; +array_type.type = FFI_TYPE_STRUCT; +array_type.elements = elements; +@end example + +Note that arrays cannot be passed or returned by value in C -- +structure types created like this should only be used to refer to +members of real @code{FFI_TYPE_STRUCT} objects. + +However, a phony array type like this will not cause any errors from +@samp{libffi} if you use it as an argument or return type. This may +be confusing. + +@subsubsection Unions + +A union can also be emulated using @code{FFI_TYPE_STRUCT}. In this +case, however, you must make sure that the size and alignment match +the real requirements of the union. + +One simple way to do this is to ensue that each element type is laid +out. Then, give the new structure type a single element; the size of +the largest element; and the largest alignment seen as well. + +This example uses the @code{ffi_prep_cif} trick to ensure that each +element type is laid out. + +@example +ffi_abi desired_abi; +ffi_type union_type; +ffi_type **union_elements; + +int i; +ffi_type element_types[2]; + +element_types[1] = NULL; + +union_type.size = union_type.alignment = 0; +union_type.type = FFI_TYPE_STRUCT; +union_type.elements = element_types; + +for (i = 0; union_elements[i]; ++i) + @{ + ffi_cif cif; + if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK) + @{ + if (union_elements[i]->size > union_type.size) + @{ + union_type.size = union_elements[i]; + size = union_elements[i]->size; + @} + if (union_elements[i]->alignment > union_type.alignment) + union_type.alignment = union_elements[i]->alignment; + @} + @} +@end example + +@subsubsection Enumerations + +@code{libffi} does not have any special support for C @code{enum}s. +Although any given @code{enum} is implemented using a specific +underlying integral type, exactly which type will be used cannot be +determined by @code{libffi} -- it may depend on the values in the +enumeration or on compiler flags such as @option{-fshort-enums}. +@xref{Structures unions enumerations and bit-fields implementation, , , gcc}, +for more information about how GCC handles enumerations. + +@node Type Example +@subsection Type Example + +The following example initializes a @code{ffi_type} object +representing the @code{tm} struct from Linux's @file{time.h}. + +Here is how the struct is defined: + +@example +struct tm @{ + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + /* Those are for future use. */ + long int __tm_gmtoff__; + __const char *__tm_zone__; +@}; +@end example + +Here is the corresponding code to describe this struct to +@code{libffi}: + +@example + @{ + ffi_type tm_type; + ffi_type *tm_type_elements[12]; + int i; + + tm_type.size = tm_type.alignment = 0; + tm_type.type = FFI_TYPE_STRUCT; + tm_type.elements = &tm_type_elements; + + for (i = 0; i < 9; i++) + tm_type_elements[i] = &ffi_type_sint; + + tm_type_elements[9] = &ffi_type_slong; + tm_type_elements[10] = &ffi_type_pointer; + tm_type_elements[11] = NULL; + + /* tm_type can now be used to represent tm argument types and + return types for ffi_prep_cif() */ + @} +@end example + +@node Complex +@subsection Complex Types + +@samp{libffi} supports the complex types defined by the C99 +standard (@code{_Complex float}, @code{_Complex double} and +@code{_Complex long double} with the built-in type descriptors +@code{ffi_type_complex_float}, @code{ffi_type_complex_double} and +@code{ffi_type_complex_longdouble}. + +Custom complex types like @code{_Complex int} can also be used. +An @code{ffi_type} object has to be defined to describe the +complex type to @samp{libffi}. + +@tindex ffi_type +@deftp {Data type} ffi_type +@table @code +@item size_t size +This must be manually set to the size of the complex type. + +@item unsigned short alignment +This must be manually set to the alignment of the complex type. + +@item unsigned short type +For a complex type, this must be set to @code{FFI_TYPE_COMPLEX}. + +@item ffi_type **elements + +This is a @samp{NULL}-terminated array of pointers to +@code{ffi_type} objects. The first element is set to the +@code{ffi_type} of the complex's base type. The second element +must be set to @code{NULL}. +@end table +@end deftp + +The section @ref{Complex Type Example} shows a way to determine +the @code{size} and @code{alignment} members in a platform +independent way. + +For platforms that have no complex support in @code{libffi} yet, +the functions @code{ffi_prep_cif} and @code{ffi_prep_args} abort +the program if they encounter a complex type. + +@node Complex Type Example +@subsection Complex Type Example + +This example demonstrates how to use complex types: + +@example +#include +#include +#include + +void complex_fn(_Complex float cf, + _Complex double cd, + _Complex long double cld) +@{ + printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n", + (float)creal (cf), (float)cimag (cf), + (float)creal (cd), (float)cimag (cd), + (float)creal (cld), (float)cimag (cld)); +@} + +int main() +@{ + ffi_cif cif; + ffi_type *args[3]; + void *values[3]; + _Complex float cf; + _Complex double cd; + _Complex long double cld; + + /* Initialize the argument info vectors */ + args[0] = &ffi_type_complex_float; + args[1] = &ffi_type_complex_double; + args[2] = &ffi_type_complex_longdouble; + values[0] = &cf; + values[1] = &cd; + values[2] = &cld; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_void, args) == FFI_OK) + @{ + cf = 1.0 + 20.0 * I; + cd = 300.0 + 4000.0 * I; + cld = 50000.0 + 600000.0 * I; + /* Call the function */ + ffi_call(&cif, (void (*)(void))complex_fn, 0, values); + @} + + return 0; +@} +@end example + +This is an example for defining a custom complex type descriptor +for compilers that support them: + +@example +/* + * This macro can be used to define new complex type descriptors + * in a platform independent way. + * + * name: Name of the new descriptor is ffi_type_complex_. + * type: The C base type of the complex type. + */ +#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \ + static ffi_type *ffi_elements_complex_##name [2] = @{ \ + (ffi_type *)(&ffitype), NULL \ + @}; \ + struct struct_align_complex_##name @{ \ + char c; \ + _Complex type x; \ + @}; \ + ffi_type ffi_type_complex_##name = @{ \ + sizeof(_Complex type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ + @} + +/* Define new complex type descriptors using the macro: */ +/* ffi_type_complex_sint */ +FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint); +/* ffi_type_complex_uchar */ +FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8); +@end example + +The new type descriptors can then be used like one of the built-in +type descriptors in the previous example. + +@node Multiple ABIs +@section Multiple ABIs + +A given platform may provide multiple different ABIs at once. For +instance, the x86 platform has both @samp{stdcall} and @samp{fastcall} +functions. + +@code{libffi} provides some support for this. However, this is +necessarily platform-specific. + +@c FIXME: document the platforms + +@node The Closure API +@section The Closure API + +@code{libffi} also provides a way to write a generic function -- a +function that can accept and decode any combination of arguments. +This can be useful when writing an interpreter, or to provide wrappers +for arbitrary functions. + +This facility is called the @dfn{closure API}. Closures are not +supported on all platforms; you can check the @code{FFI_CLOSURES} +define to determine whether they are supported on the current +platform. +@cindex closures +@cindex closure API +@findex FFI_CLOSURES + +Because closures work by assembling a tiny function at runtime, they +require special allocation on platforms that have a non-executable +heap. Memory management for closures is handled by a pair of +functions: + +@findex ffi_closure_alloc +@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code}) +Allocate a chunk of memory holding @var{size} bytes. This returns a +pointer to the writable address, and sets *@var{code} to the +corresponding executable address. + +@var{size} should be sufficient to hold a @code{ffi_closure} object. +@end defun + +@findex ffi_closure_free +@defun void ffi_closure_free (void *@var{writable}) +Free memory allocated using @code{ffi_closure_alloc}. The argument is +the writable address that was returned. +@end defun + + +Once you have allocated the memory for a closure, you must construct a +@code{ffi_cif} describing the function call. Finally you can prepare +the closure function: + +@findex ffi_prep_closure_loc +@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc}) +Prepare a closure function. The arguments to +@code{ffi_prep_closure_loc} are: + +@table @var +@item closure +The address of a @code{ffi_closure} object; this is the writable +address returned by @code{ffi_closure_alloc}. + +@item cif +The @code{ffi_cif} describing the function parameters. Note that this +object, and the types to which it refers, must be kept alive until the +closure itself is freed. + +@item user_data +An arbitrary datum that is passed, uninterpreted, to your closure +function. + +@item codeloc +The executable address returned by @code{ffi_closure_alloc}. + +@item fun +The function which will be called when the closure is invoked. It is +called with the arguments: + +@table @var +@item cif +The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}. + +@item ret +A pointer to the memory used for the function's return value. + +If the function is declared as returning @code{void}, then this value +is garbage and should not be used. + +Otherwise, @var{fun} must fill the object to which this points, +following the same special promotion behavior as @code{ffi_call}. +That is, in most cases, @var{ret} points to an object of exactly the +size of the type specified when @var{cif} was constructed. However, +integral types narrower than the system register size are widened. In +these cases your program may assume that @var{ret} points to an +@code{ffi_arg} object. + +@item args +A vector of pointers to memory holding the arguments to the function. + +@item user_data +The same @var{user_data} that was passed to +@code{ffi_prep_closure_loc}. +@end table +@end table + +@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything +went ok, and one of the other @code{ffi_status} values on error. + +After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc} +to the appropriate pointer-to-function type. +@end defun + +You may see old code referring to @code{ffi_prep_closure}. This +function is deprecated, as it cannot handle the need for separate +writable and executable addresses. + +@node Closure Example +@section Closure Example + +A trivial example that creates a new @code{puts} by binding +@code{fputs} with @code{stdout}. + +@example +#include +#include + +/* Acts like puts with the file given at time of enclosure. */ +void puts_binding(ffi_cif *cif, void *ret, void* args[], + void *stream) +@{ + *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); +@} + +typedef int (*puts_t)(char *); + +int main() +@{ + ffi_cif cif; + ffi_type *args[1]; + ffi_closure *closure; + + void *bound_puts; + int rc; + + /* Allocate closure and bound_puts */ + closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); + + if (closure) + @{ + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint, args) == FFI_OK) + @{ + /* Initialize the closure, setting stream to stdout */ + if (ffi_prep_closure_loc(closure, &cif, puts_binding, + stdout, bound_puts) == FFI_OK) + @{ + rc = ((puts_t)bound_puts)("Hello World!"); + /* rc now holds the result of the call to fputs */ + @} + @} + @} + + /* Deallocate both closure, and bound_puts */ + ffi_closure_free(closure); + + return 0; +@} + +@end example + +@node Thread Safety +@section Thread Safety + +@code{libffi} is not completely thread-safe. However, many parts are, +and if you follow some simple rules, you can use it safely in a +multi-threaded program. + +@itemize @bullet +@item +@code{ffi_prep_cif} may modify the @code{ffi_type} objects passed to +it. It is best to ensure that only a single thread prepares a given +@code{ffi_cif} at a time. + +@item +On some platforms, @code{ffi_prep_cif} may modify the size and +alignment of some types, depending on the chosen ABI. On these +platforms, if you switch between ABIs, you must ensure that there is +only one call to @code{ffi_prep_cif} at a time. + +Currently the only affected platform is PowerPC and the only affected +type is @code{long double}. +@end itemize + +@node Missing Features +@chapter Missing Features + +@code{libffi} is missing a few features. We welcome patches to add +support for these. + +@itemize @bullet +@item +Variadic closures. + +@item +There is no support for bit fields in structures. + +@item +The ``raw'' API is undocumented. +@c anything else? + +@item +The Go API is undocumented. +@end itemize + +Note that variadic support is very new and tested on a relatively +small number of platforms. + +@node Index +@unnumbered Index + +@printindex cp + +@bye diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/version.texi b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/version.texi new file mode 100644 index 0000000..d9d5094 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/doc/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 22 November 2019 +@set UPDATED-MONTH November 2019 +@set EDITION 3.3 +@set VERSION 3.3 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/generate-darwin-source-and-headers.py b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/generate-darwin-source-and-headers.py new file mode 100755 index 0000000..516464f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/generate-darwin-source-and-headers.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +import subprocess +import os +import errno +import collections +import glob +import argparse + +class Platform(object): + pass + +class simulator_platform(Platform): + directory = 'darwin_ios' + sdk = 'iphonesimulator' + arch = 'i386' + triple = 'i386-apple-darwin11' + version_min = '-miphoneos-version-min=7.0' + + prefix = "#ifdef __i386__\n\n" + suffix = "\n\n#endif" + src_dir = 'x86' + src_files = ['sysv.S', 'ffi.c', 'internal.h'] + + +class simulator64_platform(Platform): + directory = 'darwin_ios' + sdk = 'iphonesimulator' + arch = 'x86_64' + triple = 'x86_64-apple-darwin13' + version_min = '-miphoneos-version-min=7.0' + + prefix = "#ifdef __x86_64__\n\n" + suffix = "\n\n#endif" + src_dir = 'x86' + src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h'] + + +class device_platform(Platform): + directory = 'darwin_ios' + sdk = 'iphoneos' + arch = 'armv7' + triple = 'arm-apple-darwin11' + version_min = '-miphoneos-version-min=7.0' + + prefix = "#ifdef __arm__\n\n" + suffix = "\n\n#endif" + src_dir = 'arm' + src_files = ['sysv.S', 'ffi.c', 'internal.h'] + + +class device64_platform(Platform): + directory = 'darwin_ios' + sdk = 'iphoneos' + arch = 'arm64' + triple = 'aarch64-apple-darwin13' + version_min = '-miphoneos-version-min=7.0' + + prefix = "#ifdef __arm64__\n\n" + suffix = "\n\n#endif" + src_dir = 'aarch64' + src_files = ['sysv.S', 'ffi.c', 'internal.h'] + + +class desktop32_platform(Platform): + directory = 'darwin_osx' + sdk = 'macosx' + arch = 'i386' + triple = 'i386-apple-darwin10' + version_min = '-mmacosx-version-min=10.6' + src_dir = 'x86' + src_files = ['sysv.S', 'ffi.c', 'internal.h'] + + prefix = "#ifdef __i386__\n\n" + suffix = "\n\n#endif" + + +class desktop64_platform(Platform): + directory = 'darwin_osx' + sdk = 'macosx' + arch = 'x86_64' + triple = 'x86_64-apple-darwin10' + version_min = '-mmacosx-version-min=10.6' + + prefix = "#ifdef __x86_64__\n\n" + suffix = "\n\n#endif" + src_dir = 'x86' + src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h'] + + +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno != errno.EEXIST: + raise + + +def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''): + mkdir_p(dst_dir) + out_filename = filename + + if file_suffix: + if filename in ['internal64.h', 'asmnames.h', 'internal.h']: + out_filename = filename + else: + split_name = os.path.splitext(filename) + out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1]) + + with open(os.path.join(src_dir, filename)) as in_file: + with open(os.path.join(dst_dir, out_filename), 'w') as out_file: + if prefix: + out_file.write(prefix) + + out_file.write(in_file.read()) + + if suffix: + out_file.write(suffix) + + +def list_files(src_dir, pattern=None, filelist=None): + if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern)) + for file in filelist: + yield os.path.basename(file) + + +def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None): + for filename in list_files(src_dir, pattern=pattern, filelist=filelist): + move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix) + + +def copy_src_platform_files(platform): + src_dir = os.path.join('src', platform.src_dir) + dst_dir = os.path.join(platform.directory, 'src', platform.src_dir) + copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix) + + +def build_target(platform, platform_headers): + def xcrun_cmd(cmd): + return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch) + + tag='%s-%s' % (platform.sdk, platform.arch) + build_dir = 'build_%s' % tag + mkdir_p(build_dir) + env = dict(CC=xcrun_cmd('clang'), + LD=xcrun_cmd('ld'), + CFLAGS='%s -fembed-bitcode' % (platform.version_min)) + working_dir = os.getcwd() + try: + os.chdir(build_dir) + subprocess.check_call(['../configure', '-host', platform.triple], env=env) + finally: + os.chdir(working_dir) + + for src_dir in [build_dir, os.path.join(build_dir, 'include')]: + copy_files(src_dir, + os.path.join(platform.directory, 'include'), + pattern='*.h', + file_suffix=platform.arch, + prefix=platform.prefix, + suffix=platform.suffix) + + for filename in list_files(src_dir, pattern='*.h'): + platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix)) + + +def generate_source_and_headers(generate_osx=True, generate_ios=True): + copy_files('src', 'darwin_common/src', pattern='*.c') + copy_files('include', 'darwin_common/include', pattern='*.h') + + if generate_ios: + copy_src_platform_files(simulator_platform) + copy_src_platform_files(simulator64_platform) + copy_src_platform_files(device_platform) + copy_src_platform_files(device64_platform) + if generate_osx: + copy_src_platform_files(desktop64_platform) + + platform_headers = collections.defaultdict(set) + + if generate_ios: + build_target(simulator_platform, platform_headers) + build_target(simulator64_platform, platform_headers) + build_target(device_platform, platform_headers) + build_target(device64_platform, platform_headers) + if generate_osx: + build_target(desktop64_platform, platform_headers) + + mkdir_p('darwin_common/include') + for header_name, tag_tuples in platform_headers.items(): + basename, suffix = os.path.splitext(header_name) + with open(os.path.join('darwin_common/include', header_name), 'w') as header: + for tag_tuple in tag_tuples: + header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2])) + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--only-ios', action='store_true', default=False) + parser.add_argument('--only-osx', action='store_true', default=False) + args = parser.parse_args() + + generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/Makefile.am b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/Makefile.am new file mode 100644 index 0000000..c59df9f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/Makefile.am @@ -0,0 +1,9 @@ +## Process this with automake to create Makefile.in + +AUTOMAKE_OPTIONS=foreign + +DISTCLEANFILES=ffitarget.h +noinst_HEADERS=ffi_common.h ffi_cfi.h +EXTRA_DIST=ffi.h.in + +nodist_include_HEADERS = ffi.h ffitarget.h diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi.h.in b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi.h.in new file mode 100644 index 0000000..38885b0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi.h.in @@ -0,0 +1,523 @@ +/* -----------------------------------------------------------------*-C-*- + libffi @VERSION@ - Copyright (c) 2011, 2014, 2019 Anthony Green + - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------- + Most of the API is documented in doc/libffi.texi. + + The raw API is designed to bypass some of the argument packing and + unpacking on architectures for which it can be avoided. Routines + are provided to emulate the raw API if the underlying platform + doesn't allow faster implementation. + + More details on the raw API can be found in: + + http://gcc.gnu.org/ml/java/1999-q3/msg00138.html + + and + + http://gcc.gnu.org/ml/java/1999-q3/msg00174.html + -------------------------------------------------------------------- */ + +#ifndef LIBFFI_H +#define LIBFFI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Specify which architecture libffi is configured for. */ +#ifndef @TARGET@ +#define @TARGET@ +#endif + +/* ---- System configuration information --------------------------------- */ + +#include + +#ifndef LIBFFI_ASM + +#if defined(_MSC_VER) && !defined(__clang__) +#define __attribute__(X) +#endif + +#include +#include + +/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). + But we can find it either under the correct ANSI name, or under GNU + C's internal name. */ + +#define FFI_64_BIT_MAX 9223372036854775807 + +#ifdef LONG_LONG_MAX +# define FFI_LONG_LONG_MAX LONG_LONG_MAX +#else +# ifdef LLONG_MAX +# define FFI_LONG_LONG_MAX LLONG_MAX +# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif /* _AIX52 or newer */ +# else +# ifdef __GNUC__ +# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ +# endif +# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ +# ifndef __PPC64__ +# if defined (__IBMC__) || defined (__IBMCPP__) +# define FFI_LONG_LONG_MAX LONGLONG_MAX +# endif +# endif /* __PPC64__ */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif +# endif +#endif + +/* The closure code assumes that this works on pointers, i.e. a size_t + can hold a pointer. */ + +typedef struct _ffi_type +{ + size_t size; + unsigned short alignment; + unsigned short type; + struct _ffi_type **elements; +} ffi_type; + +/* Need minimal decorations for DLLs to work on Windows. GCC has + autoimport and autoexport. Always mark externally visible symbols + as dllimport for MSVC clients, even if it means an extra indirection + when using the static version of the library. + Besides, as a workaround, they can define FFI_BUILDING if they + *know* they are going to link with the static library. */ +#if defined _MSC_VER +# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ +# define FFI_API __declspec(dllexport) +# elif !defined FFI_BUILDING /* Importing libffi.DLL */ +# define FFI_API __declspec(dllimport) +# else /* Building/linking static library */ +# define FFI_API +# endif +#else +# define FFI_API +#endif + +/* The externally visible type declarations also need the MSVC DLL + decorations, or they will not be exported from the object file. */ +#if defined LIBFFI_HIDE_BASIC_TYPES +# define FFI_EXTERN FFI_API +#else +# define FFI_EXTERN extern FFI_API +#endif + +#ifndef LIBFFI_HIDE_BASIC_TYPES +#if SCHAR_MAX == 127 +# define ffi_type_uchar ffi_type_uint8 +# define ffi_type_schar ffi_type_sint8 +#else + #error "char size not supported" +#endif + +#if SHRT_MAX == 32767 +# define ffi_type_ushort ffi_type_uint16 +# define ffi_type_sshort ffi_type_sint16 +#elif SHRT_MAX == 2147483647 +# define ffi_type_ushort ffi_type_uint32 +# define ffi_type_sshort ffi_type_sint32 +#else + #error "short size not supported" +#endif + +#if INT_MAX == 32767 +# define ffi_type_uint ffi_type_uint16 +# define ffi_type_sint ffi_type_sint16 +#elif INT_MAX == 2147483647 +# define ffi_type_uint ffi_type_uint32 +# define ffi_type_sint ffi_type_sint32 +#elif INT_MAX == 9223372036854775807 +# define ffi_type_uint ffi_type_uint64 +# define ffi_type_sint ffi_type_sint64 +#else + #error "int size not supported" +#endif + +#if LONG_MAX == 2147483647 +# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX + #error "no 64-bit data type supported" +# endif +#elif LONG_MAX != FFI_64_BIT_MAX + #error "long size not supported" +#endif + +#if LONG_MAX == 2147483647 +# define ffi_type_ulong ffi_type_uint32 +# define ffi_type_slong ffi_type_sint32 +#elif LONG_MAX == FFI_64_BIT_MAX +# define ffi_type_ulong ffi_type_uint64 +# define ffi_type_slong ffi_type_sint64 +#else + #error "long size not supported" +#endif + +/* These are defined in types.c. */ +FFI_EXTERN ffi_type ffi_type_void; +FFI_EXTERN ffi_type ffi_type_uint8; +FFI_EXTERN ffi_type ffi_type_sint8; +FFI_EXTERN ffi_type ffi_type_uint16; +FFI_EXTERN ffi_type ffi_type_sint16; +FFI_EXTERN ffi_type ffi_type_uint32; +FFI_EXTERN ffi_type ffi_type_sint32; +FFI_EXTERN ffi_type ffi_type_uint64; +FFI_EXTERN ffi_type ffi_type_sint64; +FFI_EXTERN ffi_type ffi_type_float; +FFI_EXTERN ffi_type ffi_type_double; +FFI_EXTERN ffi_type ffi_type_pointer; + +#if @HAVE_LONG_DOUBLE@ +FFI_EXTERN ffi_type ffi_type_longdouble; +#else +#define ffi_type_longdouble ffi_type_double +#endif + +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE +FFI_EXTERN ffi_type ffi_type_complex_float; +FFI_EXTERN ffi_type ffi_type_complex_double; +#if @HAVE_LONG_DOUBLE@ +FFI_EXTERN ffi_type ffi_type_complex_longdouble; +#else +#define ffi_type_complex_longdouble ffi_type_complex_double +#endif +#endif +#endif /* LIBFFI_HIDE_BASIC_TYPES */ + +typedef enum { + FFI_OK = 0, + FFI_BAD_TYPEDEF, + FFI_BAD_ABI +} ffi_status; + +typedef struct { + ffi_abi abi; + unsigned nargs; + ffi_type **arg_types; + ffi_type *rtype; + unsigned bytes; + unsigned flags; +#ifdef FFI_EXTRA_CIF_FIELDS + FFI_EXTRA_CIF_FIELDS; +#endif +} ffi_cif; + +/* ---- Definitions for the raw API -------------------------------------- */ + +#ifndef FFI_SIZEOF_ARG +# if LONG_MAX == 2147483647 +# define FFI_SIZEOF_ARG 4 +# elif LONG_MAX == FFI_64_BIT_MAX +# define FFI_SIZEOF_ARG 8 +# endif +#endif + +#ifndef FFI_SIZEOF_JAVA_RAW +# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG +#endif + +typedef union { + ffi_sarg sint; + ffi_arg uint; + float flt; + char data[FFI_SIZEOF_ARG]; + void* ptr; +} ffi_raw; + +#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 +/* This is a special case for mips64/n32 ABI (and perhaps others) where + sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ +typedef union { + signed int sint; + unsigned int uint; + float flt; + char data[FFI_SIZEOF_JAVA_RAW]; + void* ptr; +} ffi_java_raw; +#else +typedef ffi_raw ffi_java_raw; +#endif + + +FFI_API +void ffi_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_raw *avalue); + +FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +FFI_API size_t ffi_raw_size (ffi_cif *cif); + +/* This is analogous to the raw API, except it uses Java parameter + packing, even on 64-bit machines. I.e. on 64-bit machines longs + and doubles are followed by an empty 64-bit word. */ + +#if !FFI_NATIVE_RAW_API +FFI_API +void ffi_java_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_java_raw *avalue) __attribute__((deprecated)); +#endif + +FFI_API +void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated)); +FFI_API +void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated)); +FFI_API +size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated)); + +/* ---- Definitions for closures ----------------------------------------- */ + +#if FFI_CLOSURES + +#ifdef _MSC_VER +__declspec(align(8)) +#endif +typedef struct { +#if @FFI_EXEC_TRAMPOLINE_TABLE@ + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); + void *user_data; +} ffi_closure +#ifdef __GNUC__ + __attribute__((aligned (8))) +#endif + ; + +#ifndef __GNUC__ +# ifdef __sgi +# pragma pack 0 +# endif +#endif + +FFI_API void *ffi_closure_alloc (size_t size, void **code); +FFI_API void ffi_closure_free (void *); + +#if defined(PA_LINUX) || defined(PA_HPUX) +#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2)) +#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3)) +#else +#define FFI_CLOSURE_PTR(X) (X) +#define FFI_RESTORE_PTR(X) (X) +#endif + +FFI_API ffi_status +ffi_prep_closure (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data) +#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) + __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) +#elif defined(__GNUC__) && __GNUC__ >= 3 + __attribute__((deprecated)) +#endif + ; + +FFI_API ffi_status +ffi_prep_closure_loc (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void*codeloc); + +#ifdef __sgi +# pragma pack 8 +#endif +typedef struct { +#if @FFI_EXEC_TRAMPOLINE_TABLE@ + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_raw*,void*); + void *user_data; + +} ffi_raw_closure; + +typedef struct { +#if @FFI_EXEC_TRAMPOLINE_TABLE@ + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the translation, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); + void *user_data; + +} ffi_java_raw_closure; + +FFI_API ffi_status +ffi_prep_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +FFI_API ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc); + +#if !FFI_NATIVE_RAW_API +FFI_API ffi_status +ffi_prep_java_raw_closure (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data) __attribute__((deprecated)); + +FFI_API ffi_status +ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data, + void *codeloc) __attribute__((deprecated)); +#endif + +#endif /* FFI_CLOSURES */ + +#if FFI_GO_CLOSURES + +typedef struct { + void *tramp; + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); +} ffi_go_closure; + +FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*)); + +FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure); + +#endif /* FFI_GO_CLOSURES */ + +/* ---- Public interface definition -------------------------------------- */ + +FFI_API +ffi_status ffi_prep_cif(ffi_cif *cif, + ffi_abi abi, + unsigned int nargs, + ffi_type *rtype, + ffi_type **atypes); + +FFI_API +ffi_status ffi_prep_cif_var(ffi_cif *cif, + ffi_abi abi, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes); + +FFI_API +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue); + +FFI_API +ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, + size_t *offsets); + +/* Useful for eliminating compiler warnings. */ +#define FFI_FN(f) ((void (*)(void))f) + +/* ---- Definitions shared with assembly code ---------------------------- */ + +#endif + +/* If these change, update src/mips/ffitarget.h. */ +#define FFI_TYPE_VOID 0 +#define FFI_TYPE_INT 1 +#define FFI_TYPE_FLOAT 2 +#define FFI_TYPE_DOUBLE 3 +#if @HAVE_LONG_DOUBLE@ +#define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE +#endif +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 +#define FFI_TYPE_UINT16 7 +#define FFI_TYPE_SINT16 8 +#define FFI_TYPE_UINT32 9 +#define FFI_TYPE_SINT32 10 +#define FFI_TYPE_UINT64 11 +#define FFI_TYPE_SINT64 12 +#define FFI_TYPE_STRUCT 13 +#define FFI_TYPE_POINTER 14 +#define FFI_TYPE_COMPLEX 15 + +/* This should always refer to the last type code (for sanity checks). */ +#define FFI_TYPE_LAST FFI_TYPE_COMPLEX + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_cfi.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_cfi.h new file mode 100644 index 0000000..244ce57 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_cfi.h @@ -0,0 +1,55 @@ +/* ----------------------------------------------------------------------- + ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc. + + Conditionally assemble cfi directives. Only necessary for building libffi. + ----------------------------------------------------------------------- */ + +#ifndef FFI_CFI_H +#define FFI_CFI_H + +#ifdef HAVE_AS_CFI_PSEUDO_OP + +# define cfi_startproc .cfi_startproc +# define cfi_endproc .cfi_endproc +# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off +# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg +# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off +# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off +# define cfi_offset(reg, off) .cfi_offset reg, off +# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off +# define cfi_register(r1, r2) .cfi_register r1, r2 +# define cfi_return_column(reg) .cfi_return_column reg +# define cfi_restore(reg) .cfi_restore reg +# define cfi_same_value(reg) .cfi_same_value reg +# define cfi_undefined(reg) .cfi_undefined reg +# define cfi_remember_state .cfi_remember_state +# define cfi_restore_state .cfi_restore_state +# define cfi_window_save .cfi_window_save +# define cfi_personality(enc, exp) .cfi_personality enc, exp +# define cfi_lsda(enc, exp) .cfi_lsda enc, exp +# define cfi_escape(...) .cfi_escape __VA_ARGS__ + +#else + +# define cfi_startproc +# define cfi_endproc +# define cfi_def_cfa(reg, off) +# define cfi_def_cfa_register(reg) +# define cfi_def_cfa_offset(off) +# define cfi_adjust_cfa_offset(off) +# define cfi_offset(reg, off) +# define cfi_rel_offset(reg, off) +# define cfi_register(r1, r2) +# define cfi_return_column(reg) +# define cfi_restore(reg) +# define cfi_same_value(reg) +# define cfi_undefined(reg) +# define cfi_remember_state +# define cfi_restore_state +# define cfi_window_save +# define cfi_personality(enc, exp) +# define cfi_lsda(enc, exp) +# define cfi_escape(...) + +#endif /* HAVE_AS_CFI_PSEUDO_OP */ +#endif /* FFI_CFI_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_common.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_common.h new file mode 100644 index 0000000..76b9dd6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/include/ffi_common.h @@ -0,0 +1,153 @@ +/* ----------------------------------------------------------------------- + ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green + Copyright (C) 2007 Free Software Foundation, Inc + Copyright (c) 1996 Red Hat, Inc. + + Common internal definitions and macros. Only necessary for building + libffi. + ----------------------------------------------------------------------- */ + +#ifndef FFI_COMMON_H +#define FFI_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Do not move this. Some versions of AIX are very picky about where + this is positioned. */ +#ifdef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else + /* mingw64 defines this already in malloc.h. */ +# ifndef alloca +# define alloca __builtin_alloca +# endif +# endif +# define MAYBE_UNUSED __attribute__((__unused__)) +#else +# define MAYBE_UNUSED +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX +# pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# ifdef _MSC_VER +# define alloca _alloca +# else +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +/* Check for the existence of memcpy. */ +#if STDC_HEADERS +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#if defined(FFI_DEBUG) +#include +#endif + +#ifdef FFI_DEBUG +void ffi_assert(char *expr, char *file, int line); +void ffi_stop_here(void); +void ffi_type_test(ffi_type *a, char *file, int line); + +#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__)) +#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l))) +#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__) +#else +#define FFI_ASSERT(x) +#define FFI_ASSERT_AT(x, f, l) +#define FFI_ASSERT_VALID_TYPE(x) +#endif + +/* v cast to size_t and aligned up to a multiple of a */ +#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) +/* v cast to size_t and aligned down to a multiple of a */ +#define FFI_ALIGN_DOWN(v, a) (((size_t) (v)) & -a) + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif); +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned int nfixedargs, unsigned int ntotalargs); + + +#if HAVE_LONG_DOUBLE_VARIANT +/* Used to adjust size/alignment of ffi types. */ +void ffi_prep_types (ffi_abi abi); +#endif + +/* Used internally, but overridden by some architectures */ +ffi_status ffi_prep_cif_core(ffi_cif *cif, + ffi_abi abi, + unsigned int isvariadic, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes); + +/* Translate a data pointer to a code pointer. Needed for closures on + some targets. */ +void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; + +/* Extended cif, used in callback from assembly routine */ +typedef struct +{ + ffi_cif *cif; + void *rvalue; + void **avalue; +} extended_cif; + +/* Terse sized type definitions. */ +#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C) +typedef unsigned char UINT8; +typedef signed char SINT8; +typedef unsigned short UINT16; +typedef signed short SINT16; +typedef unsigned int UINT32; +typedef signed int SINT32; +# ifdef _MSC_VER +typedef unsigned __int64 UINT64; +typedef signed __int64 SINT64; +# else +# include +typedef uint64_t UINT64; +typedef int64_t SINT64; +# endif +#else +typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); +typedef signed int SINT8 __attribute__((__mode__(__QI__))); +typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); +typedef signed int SINT16 __attribute__((__mode__(__HI__))); +typedef unsigned int UINT32 __attribute__((__mode__(__SI__))); +typedef signed int SINT32 __attribute__((__mode__(__SI__))); +typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); +typedef signed int SINT64 __attribute__((__mode__(__DI__))); +#endif + +typedef float FLOAT32; + +#ifndef __GNUC__ +#define __builtin_expect(x, expected_value) (x) +#endif +#define LIKELY(x) __builtin_expect(!!(x),1) +#define UNLIKELY(x) __builtin_expect((x)!=0,0) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.map.in b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.map.in new file mode 100644 index 0000000..de8778a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.map.in @@ -0,0 +1,76 @@ +#define LIBFFI_ASM +#define LIBFFI_H +#include +#include + +/* These version numbers correspond to the libtool-version abi numbers, + not to the libffi release numbers. */ + +LIBFFI_BASE_8.0 { + global: + /* Exported data variables. */ + ffi_type_void; + ffi_type_uint8; + ffi_type_sint8; + ffi_type_uint16; + ffi_type_sint16; + ffi_type_uint32; + ffi_type_sint32; + ffi_type_uint64; + ffi_type_sint64; + ffi_type_float; + ffi_type_double; + ffi_type_longdouble; + ffi_type_pointer; + + /* Exported functions. */ + ffi_call; + ffi_prep_cif; + ffi_prep_cif_var; + + ffi_raw_call; + ffi_ptrarray_to_raw; + ffi_raw_to_ptrarray; + ffi_raw_size; + + ffi_java_raw_call; + ffi_java_ptrarray_to_raw; + ffi_java_raw_to_ptrarray; + ffi_java_raw_size; + + ffi_get_struct_offsets; + local: + *; +}; + +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE +LIBFFI_COMPLEX_8.0 { + global: + /* Exported data variables. */ + ffi_type_complex_float; + ffi_type_complex_double; + ffi_type_complex_longdouble; +} LIBFFI_BASE_8.0; +#endif + +#if FFI_CLOSURES +LIBFFI_CLOSURE_8.0 { + global: + ffi_closure_alloc; + ffi_closure_free; + ffi_prep_closure; + ffi_prep_closure_loc; + ffi_prep_raw_closure; + ffi_prep_raw_closure_loc; + ffi_prep_java_raw_closure; + ffi_prep_java_raw_closure_loc; +} LIBFFI_BASE_8.0; +#endif + +#if FFI_GO_CLOSURES +LIBFFI_GO_CLOSURE_8.0 { + global: + ffi_call_go; + ffi_prep_go_closure; +} LIBFFI_CLOSURE_8.0; +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.pc.in b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.pc.in new file mode 100644 index 0000000..6fad83b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +toolexeclibdir=@toolexeclibdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: Library supporting Foreign Function Interfaces +Version: @PACKAGE_VERSION@ +Libs: -L${toolexeclibdir} -lffi +Cflags: -I${includedir} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj new file mode 100644 index 0000000..480c4a4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj @@ -0,0 +1,997 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; }; + 43B5D3FA1D3547CE00D1E1FD /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */; }; + 43E9A5C81D352C1500926A8F /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; }; + DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; + DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; }; + DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7140187F1D8600A76262 /* fficonfig.h */; }; + DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; + DBFA714E187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; + DBFA714F187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; + DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; + DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; + DBFA7158187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; + DBFA7159187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; + DBFA715A187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; + DBFA715B187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; + DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; }; + DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; }; + DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; }; + DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; }; + DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; }; + DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; }; + DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; }; + DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; }; + DBFA7194187F1DA100A76262 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* unix64_x86_64.S */; }; + DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; }; + FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; }; + FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; }; + FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; }; + FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; + FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; }; + FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; }; + FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; + FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; + FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; }; + FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; + FDB52FBF1F6144FA00AA92E6 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; }; + FDB52FC01F6144FA00AA92E6 /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */; }; + FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; + FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; }; + FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715F187F1D9B00A76262 /* ffi_armv7.h */; }; + FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */; }; + FDB52FD51F614AE200AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; + FDB52FD61F614AEA00AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; }; + FDB52FD71F614AED00AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */; }; + FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; + FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; }; + FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */; }; + FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */; }; + FDB52FDE1F6155E300AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; + FDB52FDF1F6155EA00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; }; + FDB52FE01F6155EF00AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */; }; + FDB52FE21F6156FA00AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; + FDB52FE31F61571A00AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; }; + FDB52FE41F61571D00AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; + FDB52FE61F61573100AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; }; + FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; }; + FDDB2F461F5D691E00EF414E /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F441F5D68C900EF414E /* win64_x86_64.S */; }; + FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; }; + FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; + FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; }; + FDDB2F4F1F5D846400EF414E /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; + FDDB2F501F5D846400EF414E /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; + FDDB2F511F5D846400EF414E /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; + FDDB2F521F5D846400EF414E /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* unix64_x86_64.S */; }; + FDDB2F531F5D846400EF414E /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F441F5D68C900EF414E /* win64_x86_64.S */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + DB13B1641849DF1E0010F42D /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */, + FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */, + FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */, + FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */, + FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */, + FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */, + FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */, + FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB52FC11F6144FA00AA92E6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + FDB52FD51F614AE200AA92E6 /* ffi.h in CopyFiles */, + FDB52FD61F614AEA00AA92E6 /* ffi_arm64.h in CopyFiles */, + FDB52FD71F614AED00AA92E6 /* ffi_x86_64.h in CopyFiles */, + FDB52FDE1F6155E300AA92E6 /* ffitarget.h in CopyFiles */, + FDB52FDF1F6155EA00AA92E6 /* ffitarget_arm64.h in CopyFiles */, + FDB52FE01F6155EF00AA92E6 /* ffitarget_x86_64.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB52FE11F6156E000AA92E6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + FDB52FE21F6156FA00AA92E6 /* ffi.h in CopyFiles */, + FDB52FE31F61571A00AA92E6 /* ffi_x86_64.h in CopyFiles */, + FDB52FE41F61571D00AA92E6 /* ffitarget.h in CopyFiles */, + FDB52FE61F61573100AA92E6 /* ffitarget_x86_64.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = ""; }; + 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = win64_x86_64.S; sourceTree = ""; }; + 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = ""; }; + 43E9A5DA1D35373600926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + 43E9A5DB1D35374400926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + 43E9A5DC1D35375400926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + 43E9A5DD1D35375400926A8F /* internal64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal64.h; sourceTree = ""; }; + DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; + DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = ""; }; + DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = ""; }; + DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = ""; }; + DBFA7141187F1D8600A76262 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = ""; }; + DBFA7143187F1D8600A76262 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = ""; }; + DBFA7145187F1D8600A76262 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = ""; }; + DBFA7147187F1D8600A76262 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = ""; }; + DBFA7148187F1D8600A76262 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = ""; }; + DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = ""; }; + DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = ""; }; + DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = ""; }; + DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; + DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = ""; }; + DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = ""; }; + DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; + DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = ""; }; + DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = ""; }; + DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; + DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = ""; }; + DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = ""; }; + DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = ""; }; + DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = ""; }; + DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; + DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; + DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; + DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; + DBFA718A187F1DA100A76262 /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = ""; }; + DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; + FDB52FC51F6144FA00AA92E6 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FDDB2F3E1F5D61BC00EF414E /* asmnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asmnames.h; sourceTree = ""; }; + FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = ""; }; + FDDB2F421F5D68C900EF414E /* internal64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal64.h; sourceTree = ""; }; + FDDB2F431F5D68C900EF414E /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + FDDB2F441F5D68C900EF414E /* win64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = win64_x86_64.S; sourceTree = ""; }; + FDDB2F621F5D846400EF414E /* libffi.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + DB13B15B1849DEB70010F42D = { + isa = PBXGroup; + children = ( + DBFA713C187F1D8600A76262 /* darwin_common */, + DBFA715C187F1D9B00A76262 /* darwin_ios */, + DBFA7180187F1DA100A76262 /* darwin_osx */, + DB13B1671849DF1E0010F42D /* Products */, + ); + sourceTree = ""; + }; + DB13B1671849DF1E0010F42D /* Products */ = { + isa = PBXGroup; + children = ( + DB13B1661849DF1E0010F42D /* libffi.a */, + DB13B1911849DF510010F42D /* ffi.dylib */, + FDDB2F621F5D846400EF414E /* libffi.a */, + FDB52FC51F6144FA00AA92E6 /* libffi.a */, + ); + name = Products; + sourceTree = ""; + }; + DBFA713C187F1D8600A76262 /* darwin_common */ = { + isa = PBXGroup; + children = ( + DBFA713D187F1D8600A76262 /* include */, + DBFA7142187F1D8600A76262 /* src */, + ); + path = darwin_common; + sourceTree = ""; + }; + DBFA713D187F1D8600A76262 /* include */ = { + isa = PBXGroup; + children = ( + DBFA713E187F1D8600A76262 /* ffi.h */, + DBFA713F187F1D8600A76262 /* ffi_common.h */, + DBFA7140187F1D8600A76262 /* fficonfig.h */, + DBFA7141187F1D8600A76262 /* ffitarget.h */, + ); + path = include; + sourceTree = ""; + }; + DBFA7142187F1D8600A76262 /* src */ = { + isa = PBXGroup; + children = ( + DBFA7143187F1D8600A76262 /* closures.c */, + DBFA7145187F1D8600A76262 /* dlmalloc.c */, + DBFA7147187F1D8600A76262 /* prep_cif.c */, + DBFA7148187F1D8600A76262 /* raw_api.c */, + DBFA7149187F1D8600A76262 /* types.c */, + ); + path = src; + sourceTree = ""; + }; + DBFA715C187F1D9B00A76262 /* darwin_ios */ = { + isa = PBXGroup; + children = ( + DBFA715D187F1D9B00A76262 /* include */, + DBFA716A187F1D9B00A76262 /* src */, + ); + path = darwin_ios; + sourceTree = ""; + }; + DBFA715D187F1D9B00A76262 /* include */ = { + isa = PBXGroup; + children = ( + DBFA715E187F1D9B00A76262 /* ffi_arm64.h */, + DBFA715F187F1D9B00A76262 /* ffi_armv7.h */, + DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */, + DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */, + DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */, + DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */, + DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */, + DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */, + DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */, + ); + path = include; + sourceTree = ""; + }; + DBFA716A187F1D9B00A76262 /* src */ = { + isa = PBXGroup; + children = ( + DBFA716B187F1D9B00A76262 /* aarch64 */, + DBFA716E187F1D9B00A76262 /* arm */, + DBFA7172187F1D9B00A76262 /* x86 */, + ); + path = src; + sourceTree = ""; + }; + DBFA716B187F1D9B00A76262 /* aarch64 */ = { + isa = PBXGroup; + children = ( + 43E9A5DA1D35373600926A8F /* internal.h */, + DBFA716C187F1D9B00A76262 /* ffi_arm64.c */, + DBFA716D187F1D9B00A76262 /* sysv_arm64.S */, + ); + path = aarch64; + sourceTree = ""; + }; + DBFA716E187F1D9B00A76262 /* arm */ = { + isa = PBXGroup; + children = ( + 43E9A5DB1D35374400926A8F /* internal.h */, + DBFA716F187F1D9B00A76262 /* ffi_armv7.c */, + DBFA7170187F1D9B00A76262 /* sysv_armv7.S */, + ); + path = arm; + sourceTree = ""; + }; + DBFA7172187F1D9B00A76262 /* x86 */ = { + isa = PBXGroup; + children = ( + 43E9A5DC1D35375400926A8F /* internal.h */, + 43E9A5DD1D35375400926A8F /* internal64.h */, + DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */, + 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */, + 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */, + 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */, + ); + path = x86; + sourceTree = ""; + }; + DBFA7180187F1DA100A76262 /* darwin_osx */ = { + isa = PBXGroup; + children = ( + DBFA7181187F1DA100A76262 /* include */, + DBFA7188187F1DA100A76262 /* src */, + ); + path = darwin_osx; + sourceTree = ""; + }; + DBFA7181187F1DA100A76262 /* include */ = { + isa = PBXGroup; + children = ( + DBFA7183187F1DA100A76262 /* ffi_x86_64.h */, + DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */, + DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */, + ); + path = include; + sourceTree = ""; + }; + DBFA7188187F1DA100A76262 /* src */ = { + isa = PBXGroup; + children = ( + DBFA7189187F1DA100A76262 /* x86 */, + ); + path = src; + sourceTree = ""; + }; + DBFA7189187F1DA100A76262 /* x86 */ = { + isa = PBXGroup; + children = ( + FDDB2F431F5D68C900EF414E /* internal.h */, + FDDB2F421F5D68C900EF414E /* internal64.h */, + FDDB2F3E1F5D61BC00EF414E /* asmnames.h */, + DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */, + FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */, + DBFA718A187F1DA100A76262 /* unix64_x86_64.S */, + FDDB2F441F5D68C900EF414E /* win64_x86_64.S */, + ); + path = x86; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + DB13B18F1849DF510010F42D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */, + DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */, + DBFA714A187F1D8600A76262 /* ffi.h in Headers */, + DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */, + DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */, + DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */, + DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + DB13B1651849DF1E0010F42D /* libffi-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */; + buildPhases = ( + 43B5D3FB1D35480D00D1E1FD /* Run Script */, + DB13B1621849DF1E0010F42D /* Sources */, + DB13B1641849DF1E0010F42D /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libffi-iOS"; + productName = ffi; + productReference = DB13B1661849DF1E0010F42D /* libffi.a */; + productType = "com.apple.product-type.library.static"; + }; + DB13B1901849DF510010F42D /* libffi-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */; + buildPhases = ( + DB13B3061849E0490010F42D /* ShellScript */, + DB13B18D1849DF510010F42D /* Sources */, + DB13B18F1849DF510010F42D /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libffi-Mac"; + productName = ffi; + productReference = DB13B1911849DF510010F42D /* ffi.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; + FDB52FB01F6144FA00AA92E6 /* libffi-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDB52FC21F6144FA00AA92E6 /* Build configuration list for PBXNativeTarget "libffi-tvOS" */; + buildPhases = ( + FDB52FB11F6144FA00AA92E6 /* Run Script */, + FDB52FB21F6144FA00AA92E6 /* Sources */, + FDB52FC11F6144FA00AA92E6 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libffi-tvOS"; + productName = ffi; + productReference = FDB52FC51F6144FA00AA92E6 /* libffi.a */; + productType = "com.apple.product-type.library.static"; + }; + FDDB2F471F5D846400EF414E /* libffi-static-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDDB2F5F1F5D846400EF414E /* Build configuration list for PBXNativeTarget "libffi-static-Mac" */; + buildPhases = ( + FDDB2F481F5D846400EF414E /* ShellScript */, + FDDB2F491F5D846400EF414E /* Sources */, + FDB52FE11F6156E000AA92E6 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libffi-static-Mac"; + productName = ffi; + productReference = FDDB2F621F5D846400EF414E /* libffi.a */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + DB13B15C1849DEB70010F42D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0830; + }; + buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = DB13B15B1849DEB70010F42D; + productRefGroup = DB13B1671849DF1E0010F42D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + DB13B1651849DF1E0010F42D /* libffi-iOS */, + FDB52FB01F6144FA00AA92E6 /* libffi-tvOS */, + DB13B1901849DF510010F42D /* libffi-Mac */, + FDDB2F471F5D846400EF414E /* libffi-static-Mac */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 43B5D3FB1D35480D00D1E1FD /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-ios\nfi"; + }; + DB13B3061849E0490010F42D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-osx\nfi"; + }; + FDB52FB11F6144FA00AA92E6 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-ios\nfi"; + }; + FDDB2F481F5D846400EF414E /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ ! -f \"./compile\" ]\nthen\nautoreconf -i -f -v\nif [ -f \"../ltmain.sh\" ]\nthen\necho \"fixing ltmain.sh for some reason\"\nmv ../ltmain.sh ./\nautoreconf -i -f -v\nfi\n/usr/bin/python generate-darwin-source-and-headers.py --only-osx\nfi"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + DB13B1621849DF1E0010F42D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 43E9A5C81D352C1500926A8F /* unix64_x86_64.S in Sources */, + DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */, + DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */, + DBFA714E187F1D8600A76262 /* closures.c in Sources */, + DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */, + 43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c in Sources */, + DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */, + DBFA7158187F1D8600A76262 /* raw_api.c in Sources */, + DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */, + DBFA715A187F1D8600A76262 /* types.c in Sources */, + DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */, + 43B5D3FA1D3547CE00D1E1FD /* win64_x86_64.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB13B18D1849DF510010F42D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */, + DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */, + FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.c in Sources */, + DBFA715B187F1D8600A76262 /* types.c in Sources */, + DBFA7159187F1D8600A76262 /* raw_api.c in Sources */, + DBFA714F187F1D8600A76262 /* closures.c in Sources */, + DBFA7194187F1DA100A76262 /* unix64_x86_64.S in Sources */, + FDDB2F461F5D691E00EF414E /* win64_x86_64.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB52FB21F6144FA00AA92E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */, + FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */, + FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */, + FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */, + FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */, + FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */, + FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */, + FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */, + FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */, + FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */, + FDB52FBF1F6144FA00AA92E6 /* ffi_arm64.c in Sources */, + FDB52FC01F6144FA00AA92E6 /* win64_x86_64.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDDB2F491F5D846400EF414E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */, + FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */, + FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */, + FDDB2F4F1F5D846400EF414E /* types.c in Sources */, + FDDB2F501F5D846400EF414E /* raw_api.c in Sources */, + FDDB2F511F5D846400EF414E /* closures.c in Sources */, + FDDB2F521F5D846400EF414E /* unix64_x86_64.S in Sources */, + FDDB2F531F5D846400EF414E /* win64_x86_64.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + DB13B1601849DEB70010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_common/include, + ); + ONLY_ACTIVE_ARCH = YES; + }; + name = Debug; + }; + DB13B1611849DEB70010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_common/include, + ); + }; + name = Release; + }; + DB13B1871849DF1E0010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DSTROOT = /tmp/ffi.dst; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_ios/include, + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = ffi; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALID_ARCHS = "arm64 armv7 armv7s x86_64"; + }; + name = Debug; + }; + DB13B1881849DF1E0010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DSTROOT = /tmp/ffi.dst; + ENABLE_NS_ASSERTIONS = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_ios/include, + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = ffi; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + VALID_ARCHS = "arm64 armv7 armv7s x86_64"; + }; + name = Release; + }; + DB13B1B11849DF520010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_osx/include, + ); + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-Wl,-no_compact_unwind"; + PRODUCT_NAME = ffi; + SDKROOT = macosx; + }; + name = Debug; + }; + DB13B1B21849DF520010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_osx/include, + ); + MACOSX_DEPLOYMENT_TARGET = 10.6; + OTHER_LDFLAGS = "-Wl,-no_compact_unwind"; + PRODUCT_NAME = ffi; + SDKROOT = macosx; + }; + name = Release; + }; + FDB52FC31F6144FA00AA92E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_ios/include, + ); + PRODUCT_NAME = ffi; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + FDB52FC41F6144FA00AA92E6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_ios/include, + ); + PRODUCT_NAME = ffi; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FDDB2F601F5D846400EF414E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + EXECUTABLE_EXTENSION = a; + EXECUTABLE_PREFIX = lib; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_osx/include, + ); + MACH_O_TYPE = staticlib; + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = ffi; + SDKROOT = macosx; + }; + name = Debug; + }; + FDDB2F611F5D846400EF414E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + EXECUTABLE_EXTENSION = a; + EXECUTABLE_PREFIX = lib; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + darwin_osx/include, + ); + MACH_O_TYPE = staticlib; + MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_NAME = ffi; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DB13B1601849DEB70010F42D /* Debug */, + DB13B1611849DEB70010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DB13B1871849DF1E0010F42D /* Debug */, + DB13B1881849DF1E0010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DB13B1B11849DF520010F42D /* Debug */, + DB13B1B21849DF520010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDB52FC21F6144FA00AA92E6 /* Build configuration list for PBXNativeTarget "libffi-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDB52FC31F6144FA00AA92E6 /* Debug */, + FDB52FC41F6144FA00AA92E6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDDB2F5F1F5D846400EF414E /* Build configuration list for PBXNativeTarget "libffi-static-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDDB2F601F5D846400EF414E /* Debug */, + FDDB2F611F5D846400EF414E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = DB13B15C1849DEB70010F42D /* Project object */; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libtool-version b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libtool-version new file mode 100644 index 0000000..607fee5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/libtool-version @@ -0,0 +1,29 @@ +# This file is used to maintain libtool version info for libffi. See +# the libtool manual to understand the meaning of the fields. This is +# a separate file so that version updates don't involve re-running +# automake. +# +# Here are a set of rules to help you update your library version +# information: +# +# 1. Start with version information of `0:0:0' for each libtool library. +# +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. +# +# 3. If the library source code has changed at all since the last +# update, then increment revision (`c:r:a' becomes `c:r+1:a'). +# +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment current, and set revision to 0. +# +# 5. If any interfaces have been added since the last public release, +# then increment age. +# +# 6. If any interfaces have been removed since the last public +# release, then set age to 0. +# +# CURRENT:REVISION:AGE +9:0:1 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/asmcfi.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/asmcfi.m4 new file mode 100644 index 0000000..3e28602 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/asmcfi.m4 @@ -0,0 +1,13 @@ +AC_DEFUN([GCC_AS_CFI_PSEUDO_OP], +[AC_CACHE_CHECK([assembler .cfi pseudo-op support], + gcc_cv_as_cfi_pseudo_op, [ + gcc_cv_as_cfi_pseudo_op=unknown + AC_TRY_COMPILE([asm (".cfi_sections\n\t.cfi_startproc\n\t.cfi_endproc");],, + [gcc_cv_as_cfi_pseudo_op=yes], + [gcc_cv_as_cfi_pseudo_op=no]) + ]) + if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then + AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1, + [Define if your assembler supports .cfi_* directives.]) + fi +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_append_flag.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_append_flag.m4 new file mode 100644 index 0000000..dd6d8b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_append_flag.m4 @@ -0,0 +1,50 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 8 + +AC_DEFUN([AX_APPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + AS_VAR_APPEND(FLAGS,[" $1"]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 new file mode 100644 index 0000000..9e7f1ee --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 @@ -0,0 +1,194 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CC_MAXOPT +# +# DESCRIPTION +# +# Try to turn on "good" C optimization flags for various compilers and +# architectures, for some definition of "good". (In our case, good for +# FFTW and hopefully for other scientific codes. Modify as needed.) +# +# The user can override the flags by setting the CFLAGS environment +# variable. The user can also specify --enable-portable-binary in order to +# disable any optimization flags that might result in a binary that only +# runs on the host architecture. +# +# Note also that the flags assume that ANSI C aliasing rules are followed +# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point +# computations can be re-ordered as needed. +# +# Requires macros: AX_CHECK_COMPILE_FLAG, AX_COMPILER_VENDOR, +# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 17 + +AC_DEFUN([AX_CC_MAXOPT], +[ +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AX_COMPILER_VENDOR]) +AC_REQUIRE([AC_CANONICAL_HOST]) + +AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])], + acx_maxopt_portable=$enableval, acx_maxopt_portable=no) + +# Try to determine "good" native compiler flags if none specified via CFLAGS +if test "$ac_test_CFLAGS" != "set"; then + CFLAGS="" + case $ax_cv_c_compiler_vendor in + dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + if test "x$acx_maxopt_portable" = xno; then + CFLAGS="$CFLAGS -arch host" + fi;; + + sun) CFLAGS="-native -fast -xO5 -dalign" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS -xarch=generic" + fi;; + + hp) CFLAGS="+Oall +Optrs_ansi +DSnative" + if test "x$acx_maxopt_portable" = xyes; then + CFLAGS="$CFLAGS +DAportable" + fi;; + + ibm) if test "x$acx_maxopt_portable" = xno; then + xlc_opt="-qarch=auto -qtune=auto" + else + xlc_opt="-qtune=auto" + fi + AX_CHECK_COMPILE_FLAG($xlc_opt, + CFLAGS="-O3 -qansialias -w $xlc_opt", + [CFLAGS="-O3 -qansialias -w" + echo "******************************************************" + echo "* You seem to have the IBM C compiler. It is *" + echo "* recommended for best performance that you use: *" + echo "* *" + echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" + echo "* ^^^ ^^^ *" + echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" + echo "* CPU you have. (Set the CFLAGS environment var. *" + echo "* and re-run configure.) For more info, man cc. *" + echo "******************************************************"]) + ;; + + intel) CFLAGS="-O3 -ansi_alias" + if test "x$acx_maxopt_portable" = xno; then + icc_archflag=unknown + icc_flags="" + case $host_cpu in + i686*|x86_64*) + # icc accepts gcc assembly syntax, so these should work: + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG + *:756e6547:6c65746e:49656e69) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) icc_flags="-xK" ;; + *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) icc_flags="-xSSE2 -xB -xK" ;; + *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) icc_flags="-xSSE3 -xP -xO -xB -xK" ;; + *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) icc_flags="-xSSSE3 -xT -xB -xK" ;; + *1?6[[7d]]?:*:*:*) icc_flags="-xSSE4.1 -xS -xT -xB -xK" ;; + *1?6[[aef]]?:*:*:*|*2?6[[5cef]]?:*:*:*) icc_flags="-xSSE4.2 -xS -xT -xB -xK" ;; + *2?6[[ad]]?:*:*:*) icc_flags="-xAVX -SSE4.2 -xS -xT -xB -xK" ;; + *3?6[[ae]]?:*:*:*) icc_flags="-xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; + *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) icc_flags="-xCORE-AVX2 -xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; + *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) icc_flags="-xSSE3 -xP -xO -xN -xW -xK" ;; + *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) icc_flags="-xSSE2 -xN -xW -xK" ;; + esac ;; + esac ;; + esac + if test "x$icc_flags" != x; then + for flag in $icc_flags; do + AX_CHECK_COMPILE_FLAG($flag, [icc_archflag=$flag; break]) + done + fi + AC_MSG_CHECKING([for icc architecture flag]) + AC_MSG_RESULT($icc_archflag) + if test "x$icc_archflag" != xunknown; then + CFLAGS="$CFLAGS $icc_archflag" + fi + fi + ;; + + gnu) + # default optimization flags for gcc on all systems + CFLAGS="-O3 -fomit-frame-pointer" + + # -malign-double for x86 systems + # libffi local change -- don't align double, as it changes the ABI + # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") + + # -fstrict-aliasing for gcc-2.95+ + AX_CHECK_COMPILE_FLAG(-fstrict-aliasing, + CFLAGS="$CFLAGS -fstrict-aliasing") + + # note that we enable "unsafe" fp optimization with other compilers, too + AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math") + + AX_GCC_ARCHFLAG($acx_maxopt_portable) + ;; + + microsoft) + # default optimization flags for MSVC opt builds + CFLAGS="-O2" + ;; + esac + + if test -z "$CFLAGS"; then + echo "" + echo "********************************************************" + echo "* WARNING: Don't know the best CFLAGS for this system *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" + echo "********************************************************" + echo "" + CFLAGS="-O3" + fi + + AX_CHECK_COMPILE_FLAG($CFLAGS, [], [ + echo "" + echo "********************************************************" + echo "* WARNING: The guessed CFLAGS don't seem to work with *" + echo "* your compiler. *" + echo "* Use ./configure CFLAGS=... to specify your own flags *" + echo "********************************************************" + echo "" + CFLAGS="" + ]) + +fi +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 new file mode 100644 index 0000000..094577e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 @@ -0,0 +1,122 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# +# DESCRIPTION +# +# Try to find a compiler option that enables most reasonable warnings. +# +# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result +# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default. +# +# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX, +# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and +# Intel compilers. For a given compiler, the Fortran flags are much more +# experimental than their C equivalents. +# +# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS +# - $2 add-value-if-not-found : nothing +# - $3 action-if-found : add value to shellvariable +# - $4 action-if-not-found : nothing +# +# NOTE: These macros depend on AX_APPEND_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2010 Rhys Ulerich +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 16 + +AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl +AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl +AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl +AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], +VAR,[VAR="no, unknown" +ac_save_[]FLAGS="$[]FLAGS" +for ac_arg dnl +in "-warn all % -warn all" dnl Intel + "-pedantic % -Wall" dnl GCC + "-xstrconst % -v" dnl Solaris C + "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix + "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX + "-ansi -ansiE % -fullwarn" dnl IRIX + "+ESlit % +w1" dnl HP-UX C + "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) + "-h conform % -h msglevel 2" dnl Cray C (Unicos) + # +do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) +done +FLAGS="$ac_save_[]FLAGS" +]) +AS_VAR_POPDEF([FLAGS])dnl +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) +case ".$VAR" in + .ok|.ok,*) m4_ifvaln($3,$3) ;; + .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; + *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; +esac +AS_VAR_POPDEF([VAR])dnl +])dnl AX_FLAGS_WARN_ALL +dnl implementation tactics: +dnl the for-argument contains a list of options. The first part of +dnl these does only exist to detect the compiler - usually it is +dnl a global option to enable -ansi or -extrawarnings. All other +dnl compilers will fail about it. That was needed since a lot of +dnl compilers will give false positives for some option-syntax +dnl like -Woption or -Xoption as they think of it is a pass-through +dnl to later compile stages or something. The "%" is used as a +dnl delimiter. A non-option comment can be given after "%%" marks +dnl which will be shown but not added to the respective C/CXXFLAGS. + +AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl +AC_LANG_PUSH([C]) +AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) +AC_LANG_POP([C]) +]) + +AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl +AC_LANG_PUSH([C++]) +AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) +AC_LANG_POP([C++]) +]) + +AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl +AC_LANG_PUSH([Fortran]) +AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) +AC_LANG_POP([Fortran]) +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 new file mode 100644 index 0000000..bd753b3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 @@ -0,0 +1,53 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 new file mode 100644 index 0000000..73efdb0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 @@ -0,0 +1,88 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VENDOR +# +# DESCRIPTION +# +# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, +# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, +# watcom, etc. The vendor is returned in the cache variable +# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 17 + +AC_DEFUN([AX_COMPILER_VENDOR], +[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + dnl Please add if possible support to ax_compiler_version.m4 + [# note: don't check for gcc first since some other compilers define __GNUC__ + vendors="intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC, __SDCC + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + portland: __PGI + tcc: __TINYC__ + unknown: UNKNOWN" + for ventest in $vendors; do + case $ventest in + *:) vendor=$ventest; continue ;; + *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; + esac + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ + #if !($vencpp) + thisisanerror; + #endif + ])], [break]) + done + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` + ]) +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_configure_args.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_configure_args.m4 new file mode 100644 index 0000000..9237efe --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_configure_args.m4 @@ -0,0 +1,49 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_configure_args.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CONFIGURE_ARGS +# +# DESCRIPTION +# +# Helper macro for AX_ENABLE_BUILDDIR. +# +# The traditional way of starting a subdir-configure is running the script +# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have +# to rely on eval'ing $ac_configure_args however some old autoconf +# versions do not provide that. To ensure maximum portability of autoconf +# extension macros this helper can be AC_REQUIRE'd so that +# $ac_configure_args will always be present. +# +# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is +# spoiled now and must be replaced by "eval + exit $?". +# +# Example: +# +# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl +# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl +# eval $SHELL $ac_configure_args || exit $? +# ...]) +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 14 + +AC_DEFUN([AX_CONFIGURE_ARGS],[ + # [$]@ is unusable in 2.60+ but earlier autoconf had no ac_configure_args + if test "${ac_configure_args+set}" != "set" ; then + ac_configure_args= + for ac_arg in ${1+"[$]@"}; do + ac_configure_args="$ac_configure_args '$ac_arg'" + done + fi +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 new file mode 100644 index 0000000..710384d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 @@ -0,0 +1,302 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])] +# +# DESCRIPTION +# +# If the current configure was run within the srcdir then we move all +# configure-files into a subdir and let the configure steps continue +# there. We provide an option --disable-builddir to suppress the move into +# a separate builddir. +# +# Defaults: +# +# $1 = $host (overridden with $HOST) +# $2 = Makefile.mk +# $3 = -all +# +# This macro must be called before AM_INIT_AUTOMAKE. It creates a default +# toplevel srcdir Makefile from the information found in the created +# toplevel builddir Makefile. It just copies the variables and +# rule-targets, each extended with a default rule-execution that recurses +# into the build directory of the current "HOST". You can override the +# auto-detection through `config.guess` and build-time of course, as in +# +# make HOST=i386-mingw-cross +# +# which can of course set at configure time as well using +# +# configure --host=i386-mingw-cross +# +# After the default has been created, additional rules can be appended +# that will not just recurse into the subdirectories and only ever exist +# in the srcdir toplevel makefile - these parts are read from the $2 = +# Makefile.mk file +# +# The automatic rules are usually scanning the toplevel Makefile for lines +# like '#### $host |$builddir' to recognize the place where to recurse +# into. Usually, the last one is the only one used. However, almost all +# targets have an additional "*-all" rule which makes the script to +# recurse into _all_ variants of the current HOST (!!) setting. The "-all" +# suffix can be overridden for the macro as well. +# +# a special rule is only given for things like "dist" that will copy the +# tarball from the builddir to the sourcedir (or $(PUB)) for reason of +# convenience. +# +# LICENSE +# +# Copyright (c) 2009 Guido U. Draheim +# Copyright (c) 2009 Alan Jenkins +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 30 + +AC_DEFUN([AX_ENABLE_BUILDDIR],[ +AC_REQUIRE([AC_CANONICAL_HOST])[]dnl +AC_REQUIRE([AC_CANONICAL_TARGET])[]dnl +AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl +AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl +AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl +AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl +AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl +SUB="." +AC_ARG_ENABLE([builddir], AS_HELP_STRING( + [--disable-builddir],[disable automatic build in subdir of sources]) + ,[SUB="$enableval"], [SUB="auto"]) +if test ".$ac_srcdir_defaulted" != ".no" ; then +if test ".$srcdir" = ".." ; then + if test -f config.status ; then + AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build) + else + test ".$SUB" = "." && SUB="." + test ".$SUB" = ".no" && SUB="." + test ".$TARGET" = "." && TARGET="$target" + test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])" + if test ".$SUB" != ".." ; then # we know where to go and + AS_MKDIR_P([$SUB]) + echo __.$SUB.__ > $SUB/conftest.tmp + cd $SUB + if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then + rm conftest.tmp + AC_MSG_RESULT([continue configure in default builddir "./$SUB"]) + else + AC_MSG_ERROR([could not change to default builddir "./$SUB"]) + fi + srcdir=`echo "$SUB" | + sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'` + # going to restart from subdirectory location + test -f $srcdir/config.log && mv $srcdir/config.log . + test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . + test -f $srcdir/conftest.log && mv $srcdir/conftest.log . + test -f $srcdir/$cache_file && mv $srcdir/$cache_file . + AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"}) + case "[$]0" in # restart + [[\\/]]* | ?:[[\\/]]*) # Absolute name + eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; + *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; + esac ; exit $? + fi + fi +fi fi +test ".$SUB" = ".auto" && SUB="." +dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec" +AC_PATH_PROG(SED,gsed sed, sed) +AUX="$am_aux_dir" +AS_VAR_POPDEF([SED])dnl +AS_VAR_POPDEF([AUX])dnl +AS_VAR_POPDEF([SUB])dnl +AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status .............. +AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl +AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl +AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl +AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl +AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl +pushdef([END],[Makefile.mk])dnl +pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl + SRC="$ax_enable_builddir_srcdir" + if test ".$SUB" = ".." ; then + if test -f "$TOP/Makefile" ; then + AC_MSG_NOTICE([skipping TOP/Makefile - left untouched]) + else + AC_MSG_NOTICE([skipping TOP/Makefile - not created]) + fi + else + if test -f "$SRC/Makefile" ; then + a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile` + test "$a" != "$b" && rm "$SRC/Makefile" + fi + if test -f "$SRC/Makefile" ; then + echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk + echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk + eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" + if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null + then rm $SRC/Makefile ; fi + cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING + fi + if test ! -f "$SRC/Makefile" ; then + AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile]) + x='`' ; cat >$tmp/conftemp.sed <<_EOF +/^\$/n +x +/^\$/bS +x +/\\\\\$/{H;d;} +{H;s/.*//;x;} +bM +:S +x +/\\\\\$/{h;d;} +{h;s/.*//;x;} +:M +s/\\(\\n\\) /\\1 /g +/^ /d +/^[[ ]]*[[\\#]]/d +/^VPATH *=/d +s/^srcdir *=.*/srcdir = ./ +s/^top_srcdir *=.*/top_srcdir = ./ +/[[:=]]/!d +/^\\./d +dnl Now handle rules (i.e. lines containing ":" but not " = "). +/ = /b +/ .= /b +/:/!b +s/:.*/:/ +s/ / /g +s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g +s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/ +s/ / /g +/^all all[]_ALL[[ :]]/i\\ +all-configured : all[]_ALL +dnl dist-all exists... and would make for dist-all-all +s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g +/[]_ALL[]_ALL/d +a\\ + @ HOST="\$(HOST)\" \\\\\\ + ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ + ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ + ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ + ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ + ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ + ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ + ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ + ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ + ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done +dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree) +/dist[]_ALL *:/a\\ + @ HOST="\$(HOST)\" \\\\\\ + ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ + ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ + ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ + ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ + ; if test "\$\$found" -eq "0" ; then : \\\\\\ + ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ + ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ + ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ + ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done +dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree) +/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\ + @ HOST="\$(HOST)\" \\\\\\ + ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ + ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ + ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ + ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ + ; if test "\$\$found" -eq "0" ; then : \\\\\\ + ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ + ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ + ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ + ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done +dnl special rule add-on: "distclean" removes all local builddirs completely +/distclean[]_ALL *:/a\\ + @ HOST="\$(HOST)\" \\\\\\ + ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ + ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ + ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ + ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ + ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ + ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ + ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ + ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ + ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ + ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ + ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile +_EOF + cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING + $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile + if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then + AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])]) + cat $SRC/END >>$SRC/Makefile + fi ; xxxx="####" + echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile + # sanity check + if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then + AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts]) + $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \ + >$SRC/Makefile~ + (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null + fi + else + xxxx="\\#\\#\\#\\#" + # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed + echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed + $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp + cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING + cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING + if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then + AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure]) + rm "$tmp/mkfile.tmp" + else + AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure]) + mv "$tmp/mkfile.tmp" "$SRC/Makefile" + fi + fi + AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)]) + xxxx="####" + echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile + fi +popdef([END])dnl +AS_VAR_POPDEF([SED])dnl +AS_VAR_POPDEF([AUX])dnl +AS_VAR_POPDEF([SRC])dnl +AS_VAR_POPDEF([TOP])dnl +AS_VAR_POPDEF([SUB])dnl +],[dnl +ax_enable_builddir_srcdir="$srcdir" # $srcdir +ax_enable_builddir_host="$HOST" # $HOST / $host +ax_enable_builddir_version="$VERSION" # $VERSION +ax_enable_builddir_package="$PACKAGE" # $PACKAGE +ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX +ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED +ax_enable_builddir="$ax_enable_builddir" # $SUB +])dnl +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 new file mode 100644 index 0000000..c52b9b2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 @@ -0,0 +1,267 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# This macro tries to guess the "native" arch corresponding to the target +# architecture for use with gcc's -march=arch or -mtune=arch flags. If +# found, the cache variable $ax_cv_gcc_archflag is set to this flag and +# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to +# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is +# to add $ax_cv_gcc_archflag to the end of $CFLAGS. +# +# PORTABLE? should be either [yes] (default) or [no]. In the former case, +# the flag is set to -mtune (or equivalent) so that the architecture is +# only used for tuning, but the instruction set used is still portable. In +# the latter case, the flag is set to -march (or equivalent) so that +# architecture-specific instructions are enabled. +# +# The user can specify --with-gcc-arch= in order to override the +# macro's choice of architecture, or --without-gcc-arch to disable this. +# +# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is +# called unless the user specified --with-gcc-arch manually. +# +# Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID +# +# (The main emphasis here is on recent CPUs, on the principle that doing +# high-performance computing on old hardware is uncommon.) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2014 Tsukasa Oi +# Copyright (c) 2017-2018 Alexey Kopytov +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 22 + +AC_DEFUN([AX_GCC_ARCHFLAG], +[AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_SED]) +AC_REQUIRE([AX_COMPILER_VENDOR]) + +AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=], [use architecture for gcc -march/-mtune, instead of guessing])], + ax_gcc_arch=$withval, ax_gcc_arch=yes) + +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT([]) +AC_CACHE_VAL(ax_cv_gcc_archflag, +[ +ax_cv_gcc_archflag="unknown" + +if test "$GCC" = yes; then + +if test "x$ax_gcc_arch" = xyes; then +ax_gcc_arch="" +if test "$cross_compiling" = no; then +case $host_cpu in + i[[3456]]86*|x86_64*|amd64*) # use cpuid codes + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in + *:756e6547:6c65746e:49656e69) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *5[[4578]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; + *5[[123]]?:*:*:*) ax_gcc_arch=pentium ;; + *0?61?:*:*:*|?61?:*:*:*|61?:*:*:*) ax_gcc_arch=pentiumpro ;; + *0?6[[356]]?:*:*:*|?6[[356]]?:*:*:*|6[[356]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; + *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) ax_gcc_arch="yonah pentium-m pentium3 pentiumpro" ;; + *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;; + *1?6[[7d]]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;; + *1?6[[aef]]?:*:*:*|*2?6e?:*:*:*) ax_gcc_arch="nehalem corei7 core2 pentium-m pentium3 pentiumpro" ;; + *2?6[[5cf]]?:*:*:*) ax_gcc_arch="westmere corei7 core2 pentium-m pentium3 pentiumpro" ;; + *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; + *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; + *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; + *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) ax_gcc_arch="nocona prescott pentium4 pentiumpro" ;; + # fallback + *5??:*:*:*) ax_gcc_arch=pentium ;; + *??6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;; + *6??:*:*:*) ax_gcc_arch=pentiumpro ;; + *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; + esac ;; + *:68747541:444d4163:69746e65) # AMD + case $ax_cv_gcc_x86_cpuid_1 in + *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; + *5[[8]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; + *5[[9d]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; + *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; + *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; + *6[[678a]]?:*:*:*) ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; + *000?f[[4578bcef]]?:*:*:*|?f[[4578bcef]]?:*:*:*|f[[4578bcef]]?:*:*:*|*001?f[[4578bcf]]?:*:*:*|1?f[[4578bcf]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; + *002?f[[13457bcf]]?:*:*:*|2?f[[13457bcf]]?:*:*:*|*004?f[[138bcf]]?:*:*:*|4?f[[138bcf]]?:*:*:*|*005?f[[df]]?:*:*:*|5?f[[df]]?:*:*:*|*006?f[[8bcf]]?:*:*:*|6?f[[8bcf]]?:*:*:*|*007?f[[cf]]?:*:*:*|7?f[[cf]]?:*:*:*|*00c?f1?:*:*:*|c?f1?:*:*:*|*020?f3?:*:*:*|20?f3?:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; + *010?f[[245689a]]?:*:*:*|10?f[[245689a]]?:*:*:*|*030?f1?:*:*:*|30?f1?:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; + *050?f[[12]]?:*:*:*|50?f[[12]]?:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; + *060?f1?:*:*:*|60?f1?:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; + *060?f2?:*:*:*|60?f2?:*:*:*|*061?f[[03]]?:*:*:*|61?f[[03]]?:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; + *063?f0?:*:*:*|63?f0?:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; + *07[[03]]?f0?:*:*:*|7[[03]]?f0?:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; + # fallback + *0[[13]]??f??:*:*:*|[[13]]??f??:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; + *020?f??:*:*:*|20?f??:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; + *05??f??:*:*:*|5??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; + *060?f??:*:*:*|60?f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; + *061?f??:*:*:*|61?f??:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; + *06??f??:*:*:*|6??f??:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; + *070?f??:*:*:*|70?f??:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; + *???f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;; + esac ;; + *:746e6543:736c7561:48727561) # IDT / VIA (Centaur) + case $ax_cv_gcc_x86_cpuid_1 in + *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; + *5[[89]]?:*:*:*) ax_gcc_arch=winchip2 ;; + *66?:*:*:*) ax_gcc_arch=winchip2 ;; + *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; + *6[[9adf]]?:*:*:*) ax_gcc_arch="c3-2 c3" ;; + esac ;; + esac + if test x"$ax_gcc_arch" = x; then # fallback + case $host_cpu in + i586*) ax_gcc_arch=pentium ;; + i686*) ax_gcc_arch=pentiumpro ;; + esac + fi + ;; + + sparc*) + AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` + cputype=`echo "$cputype" | tr -d ' -' | $SED 's/SPARCIIi/SPARCII/' |tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; + *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; + *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; + *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; + *cypress*) ax_gcc_arch=cypress ;; + esac ;; + + alphaev5) ax_gcc_arch=ev5 ;; + alphaev56) ax_gcc_arch=ev56 ;; + alphapca56) ax_gcc_arch="pca56 ev56" ;; + alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; + alphaev6) ax_gcc_arch=ev6 ;; + alphaev67) ax_gcc_arch=ev67 ;; + alphaev68) ax_gcc_arch="ev68 ev67" ;; + alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; + alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; + alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; + + powerpc*) + cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | $SED 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` + cputype=`echo $cputype | $SED -e 's/ppc//g;s/ *//g'` + case $cputype in + *750*) ax_gcc_arch="750 G3" ;; + *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; + *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; + *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; + *970*) ax_gcc_arch="970 G5 power4";; + *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; + *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; + 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *POWER7*) ax_gcc_arch="power7";; + *POWER8*) ax_gcc_arch="power8";; + *POWER9*) ax_gcc_arch="power9";; + *POWER10*) ax_gcc_arch="power10";; + *) ax_gcc_arch=$cputype ;; + esac + ax_gcc_arch="$ax_gcc_arch powerpc" + ;; + aarch64) + cpuimpl=`grep 'CPU implementer' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` + cpuarch=`grep 'CPU architecture' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` + cpuvar=`grep 'CPU variant' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` + case $cpuimpl in + 0x42) case $cpuarch in + 8) case $cpuvar in + 0x0) ax_gcc_arch="thunderx2t99 vulcan armv8.1-a armv8-a+lse armv8-a native" ;; + esac + ;; + esac + ;; + 0x43) case $cpuarch in + 8) case $cpuvar in + 0x0) ax_gcc_arch="thunderx armv8-a native" ;; + 0x1) ax_gcc_arch="thunderx+lse armv8.1-a armv8-a+lse armv8-a native" ;; + esac + ;; + esac + ;; + esac + ;; +esac +fi # not cross-compiling +fi # guess arch + +if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then +if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code + flag_prefixes="-mtune=" + if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then flag_prefixes="-march="; fi + # -mcpu=$arch and m$arch generate nonportable code on every arch except + # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. + case $host_cpu in i*86|x86_64*|amd64*) flag_prefixes="$flag_prefixes -mcpu= -m";; esac +else + flag_prefixes="-march= -mcpu= -m" +fi +for flag_prefix in $flag_prefixes; do + for arch in $ax_gcc_arch; do + flag="$flag_prefix$arch" + AX_CHECK_COMPILE_FLAG($flag, [if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then + if test "x[]m4_default([$1],yes)" = xyes; then + if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi + fi + fi; ax_cv_gcc_archflag=$flag; break]) + done + test "x$ax_cv_gcc_archflag" = xunknown || break +done +fi + +fi # $GCC=yes +]) +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT($ax_cv_gcc_archflag) +if test "x$ax_cv_gcc_archflag" = xunknown; then + m4_default([$3],:) +else + m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) +fi +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 new file mode 100644 index 0000000..df95465 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 @@ -0,0 +1,89 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_X86_CPUID(OP) +# AX_GCC_X86_CPUID_COUNT(OP, COUNT) +# +# DESCRIPTION +# +# On Pentium and later x86 processors, with gcc or a compiler that has a +# compatible syntax for inline assembly instructions, run a small program +# that executes the cpuid instruction with input OP. This can be used to +# detect the CPU type. AX_GCC_X86_CPUID_COUNT takes an additional COUNT +# parameter that gets passed into register ECX before calling cpuid. +# +# On output, the values of the eax, ebx, ecx, and edx registers are stored +# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable +# ax_cv_gcc_x86_cpuid_OP. +# +# If the cpuid instruction fails (because you are running a +# cross-compiler, or because you are not using gcc, or because you are on +# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP +# is set to the string "unknown". +# +# This macro mainly exists to be used in AX_GCC_ARCHFLAG. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2015 Michael Petch +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 10 + +AC_DEFUN([AX_GCC_X86_CPUID], +[AX_GCC_X86_CPUID_COUNT($1, 0) +]) + +AC_DEFUN([AX_GCC_X86_CPUID_COUNT], +[AC_REQUIRE([AC_PROG_CC]) +AC_LANG_PUSH([C]) +AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, + [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ + int op = $1, level = $2, eax, ebx, ecx, edx; + FILE *f; + __asm__ __volatile__ ("xchg %%ebx, %1\n" + "cpuid\n" + "xchg %%ebx, %1\n" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op), "2" (level)); + + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; +])], + [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown])]) +AC_LANG_POP([C]) +]) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_require_defined.m4 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_require_defined.m4 new file mode 100644 index 0000000..17c3eab --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/m4/ax_require_defined.m4 @@ -0,0 +1,37 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_REQUIRE_DEFINED(MACRO) +# +# DESCRIPTION +# +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have +# been defined and thus are available for use. This avoids random issues +# where a macro isn't expanded. Instead the configure script emits a +# non-fatal: +# +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found +# +# It's like AC_REQUIRE except it doesn't expand the required macro. +# +# Here's an example: +# +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +# +# LICENSE +# +# Copyright (c) 2014 Mike Frysinger +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) +])dnl AX_REQUIRE_DEFINED diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/make_sunver.pl b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/make_sunver.pl new file mode 100644 index 0000000..8a90b1f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/make_sunver.pl @@ -0,0 +1,333 @@ +#!/usr/bin/perl -w + +# make_sunver.pl +# +# This script takes at least two arguments, a GNU style version script and +# a list of object and archive files, and generates a corresponding Sun +# style version script as follows: +# +# Each glob pattern, C++ mangled pattern or literal in the input script is +# matched against all global symbols in the input objects, emitting those +# that matched (or nothing if no match was found). +# A comment with the original pattern and its type is left in the output +# file to make it easy to understand the matches. +# +# It uses elfdump when present (native), GNU readelf otherwise. +# It depends on the GNU version of c++filt, since it must understand the +# GNU mangling style. + +use FileHandle; +use IPC::Open2; + +# Enforce C locale. +$ENV{'LC_ALL'} = "C"; +$ENV{'LANG'} = "C"; + +# Input version script, GNU style. +my $symvers = shift; + +########## +# Get all the symbols from the library, match them, and add them to a hash. + +my %sym_hash = (); + +# List of objects and archives to process. +my @OBJECTS = (); + +# List of shared objects to omit from processing. +my @SHAREDOBJS = (); + +# Filter out those input archives that have corresponding shared objects to +# avoid adding all symbols matched in the archive to the output map. +foreach $file (@ARGV) { + if (($so = $file) =~ s/\.a$/.so/ && -e $so) { + printf STDERR "omitted $file -> $so\n"; + push (@SHAREDOBJS, $so); + } else { + push (@OBJECTS, $file); + } +} + +# We need to detect and ignore hidden symbols. Solaris nm can only detect +# this in the harder to parse default output format, and GNU nm not at all, +# so use elfdump -s in the native case and GNU readelf -s otherwise. +# GNU objdump -t cannot be used since it produces a variable number of +# columns. + +# The path to elfdump. +my $elfdump = "/usr/ccs/bin/elfdump"; + +if (-f $elfdump) { + open ELFDUMP,$elfdump.' -s '.(join ' ',@OBJECTS).'|' or die $!; + my $skip_arsym = 0; + + while () { + chomp; + + # Ignore empty lines. + if (/^$/) { + # End of archive symbol table, stop skipping. + $skip_arsym = 0 if $skip_arsym; + next; + } + + # Keep skipping until end of archive symbol table. + next if ($skip_arsym); + + # Ignore object name header for individual objects and archives. + next if (/:$/); + + # Ignore table header lines. + next if (/^Symbol Table Section:/); + next if (/index.*value.*size/); + + # Start of archive symbol table: start skipping. + if (/^Symbol Table: \(archive/) { + $skip_arsym = 1; + next; + } + + # Split table. + (undef, undef, undef, undef, $bind, $oth, undef, $shndx, $name) = split; + + # Error out for unknown input. + die "unknown input line:\n$_" unless defined($bind); + + # Ignore local symbols. + next if ($bind eq "LOCL"); + # Ignore hidden symbols. + next if ($oth eq "H"); + # Ignore undefined symbols. + next if ($shndx eq "UNDEF"); + # Error out for unhandled cases. + if ($bind !~ /^(GLOB|WEAK)/ or $oth ne "D") { + die "unhandled symbol:\n$_"; + } + + # Remember symbol. + $sym_hash{$name}++; + } + close ELFDUMP or die "$elfdump error"; +} else { + open READELF, 'readelf -s -W '.(join ' ',@OBJECTS).'|' or die $!; + # Process each symbol. + while () { + chomp; + + # Ignore empty lines. + next if (/^$/); + + # Ignore object name header. + next if (/^File: .*$/); + + # Ignore table header lines. + next if (/^Symbol table.*contains.*:/); + next if (/Num:.*Value.*Size/); + + # Split table. + (undef, undef, undef, undef, $bind, $vis, $ndx, $name) = split; + + # Error out for unknown input. + die "unknown input line:\n$_" unless defined($bind); + + # Ignore local symbols. + next if ($bind eq "LOCAL"); + # Ignore hidden symbols. + next if ($vis eq "HIDDEN"); + # Ignore undefined symbols. + next if ($ndx eq "UND"); + # Error out for unhandled cases. + if ($bind !~ /^(GLOBAL|WEAK)/ or $vis ne "DEFAULT") { + die "unhandled symbol:\n$_"; + } + + # Remember symbol. + $sym_hash{$name}++; + } + close READELF or die "readelf error"; +} + +########## +# The various types of glob patterns. +# +# A glob pattern that is to be applied to the demangled name: 'cxx'. +# A glob patterns that applies directly to the name in the .o files: 'glob'. +# This pattern is ignored; used for local variables (usually just '*'): 'ign'. + +# The type of the current pattern. +my $glob = 'glob'; + +# We're currently inside `extern "C++"', which Sun ld doesn't understand. +my $in_extern = 0; + +# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio +# c++filt doesn't handle the GNU mangling style. +my $cxxfilt = $ENV{'CXXFILT'} || "c++filt"; + +# The current version name. +my $current_version = ""; + +# Was there any attempt to match a symbol to this version? +my $matches_attempted; + +# The number of versions which matched this symbol. +my $matched_symbols; + +open F,$symvers or die $!; + +# Print information about generating this file +print "# This file was generated by make_sunver.pl. DO NOT EDIT!\n"; +print "# It was generated by:\n"; +printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV); +printf "# Omitted archives with corresponding shared libraries: %s\n", + (join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0; +print "#\n\n"; + +while () { + # Lines of the form '};' + if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) { + $glob = 'glob'; + if ($in_extern) { + $in_extern--; + print "$1##$2\n"; + } else { + print; + } + next; + } + + # Lines of the form '} SOME_VERSION_NAME_1.0;' + if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) { + $glob = 'glob'; + # We tried to match symbols agains this version, but none matched. + # Emit dummy hidden symbol to avoid marking this version WEAK. + if ($matches_attempted && $matched_symbols == 0) { + print " hidden:\n"; + print " .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n"; + } + print; next; + } + + # Comment and blank lines + if (/^[ \t]*\#/) { print; next; } + if (/^[ \t]*$/) { print; next; } + + # Lines of the form '{' + if (/^([ \t]*){$/) { + if ($in_extern) { + print "$1##{\n"; + } else { + print; + } + next; + } + + # Lines of the form 'SOME_VERSION_NAME_1.1 {' + if (/^([A-Z0-9_.]+)[ \t]+{$/) { + # Record version name. + $current_version = $1; + # Reset match attempts, #matched symbols for this version. + $matches_attempted = 0; + $matched_symbols = 0; + print; + next; + } + + # Ignore 'global:' + if (/^[ \t]*global:$/) { print; next; } + + # After 'local:', globs should be ignored, they won't be exported. + if (/^[ \t]*local:$/) { + $glob = 'ign'; + print; + next; + } + + # After 'extern "C++"', globs are C++ patterns + if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) { + $in_extern++; + $glob = 'cxx'; + # Need to comment, Sun ld cannot handle this. + print "$1##$2\n"; next; + } + + # Chomp newline now we're done with passing through the input file. + chomp; + + # Catch globs. Note that '{}' is not allowed in globs by this script, + # so only '*' and '[]' are available. + if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) { + my $ws = $1; + my $ptn = $2; + # Turn the glob into a regex by replacing '*' with '.*', '?' with '.'. + # Keep $ptn so we can still print the original form. + ($pattern = $ptn) =~ s/\*/\.\*/g; + $pattern =~ s/\?/\./g; + + if ($glob eq 'ign') { + # We're in a local: * section; just continue. + print "$_\n"; + next; + } + + # Print the glob commented for human readers. + print "$ws##$ptn ($glob)\n"; + # We tried to match a symbol to this version. + $matches_attempted++; + + if ($glob eq 'glob') { + my %ptn_syms = (); + + # Match ptn against symbols in %sym_hash. + foreach my $sym (keys %sym_hash) { + # Maybe it matches one of the patterns based on the symbol in + # the .o file. + $ptn_syms{$sym}++ if ($sym =~ /^$pattern$/); + } + + foreach my $sym (sort keys(%ptn_syms)) { + $matched_symbols++; + print "$ws$sym;\n"; + } + } elsif ($glob eq 'cxx') { + my %dem_syms = (); + + # Verify that we're actually using GNU c++filt. Other versions + # most likely cannot handle GNU style symbol mangling. + my $cxxout = `$cxxfilt --version 2>&1`; + $cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function"; + + # Talk to c++filt through a pair of file descriptors. + # Need to start a fresh instance per pattern, otherwise the + # process grows to 500+ MB. + my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!; + + # Match ptn against symbols in %sym_hash. + foreach my $sym (keys %sym_hash) { + # No? Well, maybe its demangled form matches one of those + # patterns. + printf FILTOUT "%s\n",$sym; + my $dem = ; + chomp $dem; + $dem_syms{$sym}++ if ($dem =~ /^$pattern$/); + } + + close FILTOUT or die "c++filt error"; + close FILTIN or die "c++filt error"; + # Need to wait for the c++filt process to avoid lots of zombies. + waitpid $pid, 0; + + foreach my $sym (sort keys(%dem_syms)) { + $matched_symbols++; + print "$ws$sym;\n"; + } + } else { + # No? Well, then ignore it. + } + next; + } + # Important sanity check. This script can't handle lots of formats + # that GNU ld can, so be sure to error out if one is seen! + die "strange line `$_'"; +} +close F; diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/Makefile.am b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/Makefile.am new file mode 100644 index 0000000..afcbfb6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/Makefile.am @@ -0,0 +1,8 @@ +## Process this with automake to create Makefile.in + +AUTOMAKE_OPTIONS=foreign + +EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3 + +man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi.3 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi.3 new file mode 100644 index 0000000..1f1d303 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi.3 @@ -0,0 +1,41 @@ +.Dd February 15, 2008 +.Dt FFI 3 +.Sh NAME +.Nm FFI +.Nd Foreign Function Interface +.Sh LIBRARY +libffi, -lffi +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Ft void +.Fo ffi_prep_cif_var +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nfixedargs" +.Fa "unsigned int ntotalargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Ft void +.Fo ffi_call +.Fa "ffi_cif *cif" +.Fa "void (*fn)(void)" +.Fa "void *rvalue" +.Fa "void **avalue" +.Fc +.Sh DESCRIPTION +The foreign function interface provides a mechanism by which a function can +generate a call to another function at runtime without requiring knowledge of +the called function's interface at compile time. +.Sh SEE ALSO +.Xr ffi_prep_cif 3 , +.Xr ffi_prep_cif_var 3 , +.Xr ffi_call 3 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_call.3 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_call.3 new file mode 100644 index 0000000..5351513 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_call.3 @@ -0,0 +1,103 @@ +.Dd February 15, 2008 +.Dt ffi_call 3 +.Sh NAME +.Nm ffi_call +.Nd Invoke a foreign function. +.Sh SYNOPSIS +.In ffi.h +.Ft void +.Fo ffi_call +.Fa "ffi_cif *cif" +.Fa "void (*fn)(void)" +.Fa "void *rvalue" +.Fa "void **avalue" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_call +function provides a simple mechanism for invoking a function without +requiring knowledge of the function's interface at compile time. +.Fa fn +is called with the values retrieved from the pointers in the +.Fa avalue +array. The return value from +.Fa fn +is placed in storage pointed to by +.Fa rvalue . +.Fa cif +contains information describing the data types, sizes and alignments of the +arguments to and return value from +.Fa fn , +and must be initialized with +.Nm ffi_prep_cif +before it is used with +.Nm ffi_call . +.Pp +.Fa rvalue +must point to storage that is sizeof(ffi_arg) or larger for non-floating point +types. For smaller-sized return value types, the +.Nm ffi_arg +or +.Nm ffi_sarg +integral type must be used to hold +the return value. +.Sh EXAMPLES +.Bd -literal +#include +#include + +unsigned char +foo(unsigned int, float); + +int +main(int argc, const char **argv) +{ + ffi_cif cif; + ffi_type *arg_types[2]; + void *arg_values[2]; + ffi_status status; + + // Because the return value from foo() is smaller than sizeof(long), it + // must be passed as ffi_arg or ffi_sarg. + ffi_arg result; + + // Specify the data type of each argument. Available types are defined + // in . + arg_types[0] = &ffi_type_uint; + arg_types[1] = &ffi_type_float; + + // Prepare the ffi_cif structure. + if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, + 2, &ffi_type_uint8, arg_types)) != FFI_OK) + { + // Handle the ffi_status error. + } + + // Specify the values of each argument. + unsigned int arg1 = 42; + float arg2 = 5.1; + + arg_values[0] = &arg1; + arg_values[1] = &arg2; + + // Invoke the function. + ffi_call(&cif, FFI_FN(foo), &result, arg_values); + + // The ffi_arg 'result' now contains the unsigned char returned from foo(), + // which can be accessed by a typecast. + printf("result is %hhu", (unsigned char)result); + + return 0; +} + +// The target function. +unsigned char +foo(unsigned int x, float y) +{ + unsigned char result = x - y; + return result; +} +.Ed +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_prep_cif 3 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif.3 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif.3 new file mode 100644 index 0000000..ab2be8a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif.3 @@ -0,0 +1,68 @@ +.Dd February 15, 2008 +.Dt ffi_prep_cif 3 +.Sh NAME +.Nm ffi_prep_cif +.Nd Prepare a +.Nm ffi_cif +structure for use with +.Nm ffi_call +. +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_prep_cif +function prepares a +.Nm ffi_cif +structure for use with +.Nm ffi_call +. +.Fa abi +specifies a set of calling conventions to use. +.Fa atypes +is an array of +.Fa nargs +pointers to +.Nm ffi_type +structs that describe the data type, size and alignment of each argument. +.Fa rtype +points to an +.Nm ffi_type +that describes the data type, size and alignment of the +return value. Note that to call a variadic function +.Nm ffi_prep_cif_var +must be used instead. +.Sh RETURN VALUES +Upon successful completion, +.Nm ffi_prep_cif +returns +.Nm FFI_OK . +It will return +.Nm FFI_BAD_TYPEDEF +if +.Fa cif +is +.Nm NULL +or +.Fa atypes +or +.Fa rtype +is malformed. If +.Fa abi +does not refer to a valid ABI, +.Nm FFI_BAD_ABI +will be returned. Available ABIs are +defined in +.Nm . +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_call 3 , +.Xr ffi_prep_cif_var 3 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 new file mode 100644 index 0000000..7e19d0b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 @@ -0,0 +1,73 @@ +.Dd January 25, 2011 +.Dt ffi_prep_cif_var 3 +.Sh NAME +.Nm ffi_prep_cif_var +.Nd Prepare a +.Nm ffi_cif +structure for use with +.Nm ffi_call +for variadic functions. +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif_var +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nfixedargs" +.Fa "unsigned int ntotalargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_prep_cif_var +function prepares a +.Nm ffi_cif +structure for use with +.Nm ffi_call +for variadic functions. +.Fa abi +specifies a set of calling conventions to use. +.Fa atypes +is an array of +.Fa ntotalargs +pointers to +.Nm ffi_type +structs that describe the data type, size and alignment of each argument. +.Fa rtype +points to an +.Nm ffi_type +that describes the data type, size and alignment of the +return value. +.Fa nfixedargs +must contain the number of fixed (non-variadic) arguments. +Note that to call a non-variadic function +.Nm ffi_prep_cif +must be used. +.Sh RETURN VALUES +Upon successful completion, +.Nm ffi_prep_cif_var +returns +.Nm FFI_OK . +It will return +.Nm FFI_BAD_TYPEDEF +if +.Fa cif +is +.Nm NULL +or +.Fa atypes +or +.Fa rtype +is malformed. If +.Fa abi +does not refer to a valid ABI, +.Nm FFI_BAD_ABI +will be returned. Available ABIs are +defined in +.Nm +. +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_call 3 , +.Xr ffi_prep_cif 3 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln new file mode 100644 index 0000000..d9119df --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28302.56 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ffi_staticLib_arm64", "Ffi_staticLib.vcxproj", "{115502C0-BE05-4767-BF19-5C87D805FAD6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Debug|ARM64.Build.0 = Debug|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Debug|x64.ActiveCfg = Debug|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Debug|x86.ActiveCfg = Debug|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Release|ARM64.ActiveCfg = Release|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Release|ARM64.Build.0 = Release|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Release|x64.ActiveCfg = Release|ARM64 + {115502C0-BE05-4767-BF19-5C87D805FAD6}.Release|x86.ActiveCfg = Release|ARM64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {241C54C7-20DD-4897-9376-E6B6D1B43BD5} + EndGlobalSection +EndGlobal diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj new file mode 100644 index 0000000..3187699 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj @@ -0,0 +1,130 @@ + + + + + Debug + ARM64 + + + Release + ARM64 + + + + 15.0 + {115502C0-BE05-4767-BF19-5C87D805FAD6} + Win32Proj + FfistaticLib + 10.0.17763.0 + Ffi_staticLib_arm64 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + true + + + false + + + + NotUsing + Level3 + Disabled + true + FFI_BUILDING_DLL;_DEBUG;_LIB;USE_DL_PREFIX;ARM64;_M_ARM64;NDEBUG;%(PreprocessorDefinitions) + true + ..\..\include;.\aarch64_include;..\..\src\aarch64;%(AdditionalIncludeDirectories) + false + true + + + false + + + Windows + true + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + FFI_BUILDING_DLL;USE_DL_PREFIX;ARM64;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + ..\..\include;.\aarch64_include;..\..\src\aarch64;%(AdditionalIncludeDirectories) + true + Speed + true + ..\..\src;..\..\src\aarch64;%(AdditionalUsingDirectories) + + + Windows + true + true + true + + + true + + + + + + + + + + + + + + + + + + + + + + + cl /FA /EP /nologo /I"..\..\include" /I".\aarch64_include" /I"..\..\src\aarch64" "%(FullPath)" > $(IntDir)win64_armasm.i + armasm64 $(IntDir)win64_armasm.i /I"src\" /I"..\..\include" /I"..\..\src\aarch64" -o "$(IntDir)win64_armasm.obj" + + win64_armasm.obj;%(Outputs) + + + + + + \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters new file mode 100644 index 0000000..1f8c6e1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters @@ -0,0 +1,57 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + + \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h new file mode 100644 index 0000000..02f26a2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h @@ -0,0 +1,511 @@ +/* -----------------------------------------------------------------*-C-*- + libffi 3.3-rc0 - Copyright (c) 2011, 2014 Anthony Green + - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------- + Most of the API is documented in doc/libffi.texi. + + The raw API is designed to bypass some of the argument packing and + unpacking on architectures for which it can be avoided. Routines + are provided to emulate the raw API if the underlying platform + doesn't allow faster implementation. + + More details on the raw API can be found in: + + http://gcc.gnu.org/ml/java/1999-q3/msg00138.html + + and + + http://gcc.gnu.org/ml/java/1999-q3/msg00174.html + -------------------------------------------------------------------- */ + +#ifndef LIBFFI_H +#define LIBFFI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Specify which architecture libffi is configured for. */ +#ifndef AARCH64 +#define AARCH64 +#endif + +/* ---- System configuration information --------------------------------- */ + +#include + +#ifndef LIBFFI_ASM + +#if defined(_MSC_VER) && !defined(__clang__) +#define __attribute__(X) +#endif + +#include +#include + +/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). + But we can find it either under the correct ANSI name, or under GNU + C's internal name. */ + +#define FFI_64_BIT_MAX 9223372036854775807 + +#ifdef LONG_LONG_MAX +# define FFI_LONG_LONG_MAX LONG_LONG_MAX +#else +# ifdef LLONG_MAX +# define FFI_LONG_LONG_MAX LLONG_MAX +# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif /* _AIX52 or newer */ +# else +# ifdef __GNUC__ +# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ +# endif +# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ +# ifndef __PPC64__ +# if defined (__IBMC__) || defined (__IBMCPP__) +# define FFI_LONG_LONG_MAX LONGLONG_MAX +# endif +# endif /* __PPC64__ */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif +# endif +#endif + +/* The closure code assumes that this works on pointers, i.e. a size_t + can hold a pointer. */ + +typedef struct _ffi_type +{ + size_t size; + unsigned short alignment; + unsigned short type; + struct _ffi_type **elements; +} ffi_type; + +/* Need minimal decorations for DLLs to work on Windows. GCC has + autoimport and autoexport. Always mark externally visible symbols + as dllimport for MSVC clients, even if it means an extra indirection + when using the static version of the library. + Besides, as a workaround, they can define FFI_BUILDING if they + *know* they are going to link with the static library. */ +#if defined _MSC_VER +# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ +# define FFI_API __declspec(dllexport) +# elif !defined FFI_BUILDING /* Importing libffi.DLL */ +# define FFI_API __declspec(dllimport) +# else /* Building/linking static library */ +# define FFI_API +# endif +#else +# define FFI_API +#endif + +/* The externally visible type declarations also need the MSVC DLL + decorations, or they will not be exported from the object file. */ +#if defined LIBFFI_HIDE_BASIC_TYPES +# define FFI_EXTERN FFI_API +#else +# define FFI_EXTERN extern FFI_API +#endif + +#ifndef LIBFFI_HIDE_BASIC_TYPES +#if SCHAR_MAX == 127 +# define ffi_type_uchar ffi_type_uint8 +# define ffi_type_schar ffi_type_sint8 +#else + #error "char size not supported" +#endif + +#if SHRT_MAX == 32767 +# define ffi_type_ushort ffi_type_uint16 +# define ffi_type_sshort ffi_type_sint16 +#elif SHRT_MAX == 2147483647 +# define ffi_type_ushort ffi_type_uint32 +# define ffi_type_sshort ffi_type_sint32 +#else + #error "short size not supported" +#endif + +#if INT_MAX == 32767 +# define ffi_type_uint ffi_type_uint16 +# define ffi_type_sint ffi_type_sint16 +#elif INT_MAX == 2147483647 +# define ffi_type_uint ffi_type_uint32 +# define ffi_type_sint ffi_type_sint32 +#elif INT_MAX == 9223372036854775807 +# define ffi_type_uint ffi_type_uint64 +# define ffi_type_sint ffi_type_sint64 +#else + #error "int size not supported" +#endif + +#if LONG_MAX == 2147483647 +# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX + #error "no 64-bit data type supported" +# endif +#elif LONG_MAX != FFI_64_BIT_MAX + #error "long size not supported" +#endif + +#if LONG_MAX == 2147483647 +# define ffi_type_ulong ffi_type_uint32 +# define ffi_type_slong ffi_type_sint32 +#elif LONG_MAX == FFI_64_BIT_MAX +# define ffi_type_ulong ffi_type_uint64 +# define ffi_type_slong ffi_type_sint64 +#else + #error "long size not supported" +#endif + +/* These are defined in types.c. */ +FFI_EXTERN ffi_type ffi_type_void; +FFI_EXTERN ffi_type ffi_type_uint8; +FFI_EXTERN ffi_type ffi_type_sint8; +FFI_EXTERN ffi_type ffi_type_uint16; +FFI_EXTERN ffi_type ffi_type_sint16; +FFI_EXTERN ffi_type ffi_type_uint32; +FFI_EXTERN ffi_type ffi_type_sint32; +FFI_EXTERN ffi_type ffi_type_uint64; +FFI_EXTERN ffi_type ffi_type_sint64; +FFI_EXTERN ffi_type ffi_type_float; +FFI_EXTERN ffi_type ffi_type_double; +FFI_EXTERN ffi_type ffi_type_pointer; + +#ifndef _M_ARM64 +FFI_EXTERN ffi_type ffi_type_longdouble; +#else +#define ffi_type_longdouble ffi_type_double +#endif + +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE +FFI_EXTERN ffi_type ffi_type_complex_float; +FFI_EXTERN ffi_type ffi_type_complex_double; +#if 1 +FFI_EXTERN ffi_type ffi_type_complex_longdouble; +#else +#define ffi_type_complex_longdouble ffi_type_complex_double +#endif +#endif +#endif /* LIBFFI_HIDE_BASIC_TYPES */ + +typedef enum { + FFI_OK = 0, + FFI_BAD_TYPEDEF, + FFI_BAD_ABI +} ffi_status; + +typedef struct { + ffi_abi abi; + unsigned nargs; + ffi_type **arg_types; + ffi_type *rtype; + unsigned bytes; + unsigned flags; +#ifdef FFI_EXTRA_CIF_FIELDS + FFI_EXTRA_CIF_FIELDS; +#endif +} ffi_cif; + +/* ---- Definitions for the raw API -------------------------------------- */ + +#ifndef FFI_SIZEOF_ARG +# if LONG_MAX == 2147483647 +# define FFI_SIZEOF_ARG 4 +# elif LONG_MAX == FFI_64_BIT_MAX +# define FFI_SIZEOF_ARG 8 +# endif +#endif + +#ifndef FFI_SIZEOF_JAVA_RAW +# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG +#endif + +typedef union { + ffi_sarg sint; + ffi_arg uint; + float flt; + char data[FFI_SIZEOF_ARG]; + void* ptr; +} ffi_raw; + +#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 +/* This is a special case for mips64/n32 ABI (and perhaps others) where + sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ +typedef union { + signed int sint; + unsigned int uint; + float flt; + char data[FFI_SIZEOF_JAVA_RAW]; + void* ptr; +} ffi_java_raw; +#else +typedef ffi_raw ffi_java_raw; +#endif + + +FFI_API +void ffi_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_raw *avalue); + +FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +FFI_API size_t ffi_raw_size (ffi_cif *cif); + +/* This is analogous to the raw API, except it uses Java parameter + packing, even on 64-bit machines. I.e. on 64-bit machines longs + and doubles are followed by an empty 64-bit word. */ + +FFI_API +void ffi_java_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_java_raw *avalue); + +FFI_API +void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw); +FFI_API +void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args); +FFI_API +size_t ffi_java_raw_size (ffi_cif *cif); + +/* ---- Definitions for closures ----------------------------------------- */ + +#if FFI_CLOSURES + +#ifdef _MSC_VER +__declspec(align(8)) +#endif +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); + void *user_data; +} ffi_closure +#ifdef __GNUC__ + __attribute__((aligned (8))) +#endif + ; + +#ifndef __GNUC__ +# ifdef __sgi +# pragma pack 0 +# endif +#endif + +FFI_API void *ffi_closure_alloc (size_t size, void **code); +FFI_API void ffi_closure_free (void *); + +FFI_API ffi_status +ffi_prep_closure (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data) +#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) + __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) +#elif defined(__GNUC__) && __GNUC__ >= 3 + __attribute__((deprecated)) +#endif + ; + +FFI_API ffi_status +ffi_prep_closure_loc (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void*codeloc); + +#ifdef __sgi +# pragma pack 8 +#endif +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_raw*,void*); + void *user_data; + +} ffi_raw_closure; + +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the translation, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); + void *user_data; + +} ffi_java_raw_closure; + +FFI_API ffi_status +ffi_prep_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +FFI_API ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc); + +FFI_API ffi_status +ffi_prep_java_raw_closure (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data); + +FFI_API ffi_status +ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data, + void *codeloc); + +#endif /* FFI_CLOSURES */ + +#if FFI_GO_CLOSURES + +typedef struct { + void *tramp; + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); +} ffi_go_closure; + +FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*)); + +FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure); + +#endif /* FFI_GO_CLOSURES */ + +/* ---- Public interface definition -------------------------------------- */ + +FFI_API +ffi_status ffi_prep_cif(ffi_cif *cif, + ffi_abi abi, + unsigned int nargs, + ffi_type *rtype, + ffi_type **atypes); + +FFI_API +ffi_status ffi_prep_cif_var(ffi_cif *cif, + ffi_abi abi, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes); + +FFI_API +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue); + +FFI_API +ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, + size_t *offsets); + +/* Useful for eliminating compiler warnings. */ +#define FFI_FN(f) ((void (*)(void))f) + +/* ---- Definitions shared with assembly code ---------------------------- */ + +#endif + +/* If these change, update src/mips/ffitarget.h. */ +#define FFI_TYPE_VOID 0 +#define FFI_TYPE_INT 1 +#define FFI_TYPE_FLOAT 2 +#define FFI_TYPE_DOUBLE 3 +#ifndef _M_ARM64 +#define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE +#endif +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 +#define FFI_TYPE_UINT16 7 +#define FFI_TYPE_SINT16 8 +#define FFI_TYPE_UINT32 9 +#define FFI_TYPE_SINT32 10 +#define FFI_TYPE_UINT64 11 +#define FFI_TYPE_SINT64 12 +#define FFI_TYPE_STRUCT 13 +#define FFI_TYPE_POINTER 14 +#define FFI_TYPE_COMPLEX 15 +/* This should always refer to the last type code (for sanity checks). */ +#define FFI_TYPE_LAST FFI_TYPE_COMPLEX + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvcc.sh b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvcc.sh new file mode 100755 index 0000000..7cfc509 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/msvcc.sh @@ -0,0 +1,353 @@ +#!/bin/sh + +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the MSVC wrappificator. +# +# The Initial Developer of the Original Code is +# Timothy Wall . +# Portions created by the Initial Developer are Copyright (C) 2009 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Daniel Witte +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC +# format and translated into something sensible for cl or ml. +# + +args_orig=$@ +args="-nologo -W3" +linkargs= +static_crt= +debug_crt= +cl="cl" +ml="ml" +safeseh="-safeseh" +output= +libpaths= +libversion=7 +verbose= + +while [ $# -gt 0 ] +do + case $1 + in + --verbose) + verbose=1 + shift 1 + ;; + --version) + args="-help" + shift 1 + ;; + -fexceptions) + # Don't enable exceptions for now. + #args="$args -EHac" + shift 1 + ;; + -m32) + shift 1 + ;; + -m64) + ml="ml64" # "$MSVC/x86_amd64/ml64" + safeseh= + shift 1 + ;; + -marm) + ml='armasm' + safeseh= + shift 1 + ;; + -marm64) + ml='armasm64' + safeseh= + shift 1 + ;; + -clang-cl) + cl="clang-cl" + shift 1 + ;; + -O0) + args="$args -Od" + shift 1 + ;; + -O*) + # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG + # case below) are not compatible with optimization flags and will + # cause the build to fail. Therefore, drop the optimization flag if + # -DFFI_DEBUG is also set. + case $args_orig in + *-DFFI_DEBUG*) + args="$args" + ;; + *) + # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive + # project doesn't support MSVC and therefore ends up trying to + # use -O3. Use the equivalent "max optimization" flag for MSVC + # instead of erroring out. + case $1 in + -O3) + args="$args -O2" + ;; + *) + args="$args $1" + ;; + esac + opt="true" + ;; + esac + shift 1 + ;; + -g) + # Enable debug symbol generation. + args="$args -Zi" + shift 1 + ;; + -DFFI_DEBUG) + # Enable runtime error checks. + args="$args -RTC1" + defines="$defines $1" + shift 1 + ;; + -DUSE_STATIC_RTL) + # Link against static CRT. + static_crt=1 + shift 1 + ;; + -DUSE_DEBUG_RTL) + # Link against debug CRT. + debug_crt=1 + shift 1 + ;; + -c) + args="$args -c" + args="$(echo $args | sed 's%/Fe%/Fo%g')" + single="-c" + shift 1 + ;; + -D*=*) + name="$(echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g')" + value="$(echo $1|sed 's/-D[^=][^=]*=//g')" + args="$args -D${name}='$value'" + defines="$defines -D${name}='$value'" + shift 1 + ;; + -D*) + args="$args $1" + defines="$defines $1" + shift 1 + ;; + -I) + p=$(cygpath -ma "$2") + args="$args -I\"$p\"" + includes="$includes -I\"$p\"" + shift 2 + ;; + -I*) + p=$(cygpath -ma "${1#-I}") + args="$args -I\"$p\"" + includes="$includes -I\"$p\"" + shift 1 + ;; + -L) + p=$(cygpath -ma $2) + linkargs="$linkargs -LIBPATH:$p" + shift 2 + ;; + -L*) + p=$(cygpath -ma ${1#-L}) + linkargs="$linkargs -LIBPATH:$p" + shift 1 + ;; + -link) + # add next argument verbatim to linker args + linkargs="$linkargs $2" + shift 2 + ;; + -l*) + case $1 + in + -lffi) + linkargs="$linkargs lib${1#-l}-${libversion}.lib" + ;; + *) + # ignore other libraries like -lm, hope they are + # covered by MSVCRT + # linkargs="$linkargs ${1#-l}.lib" + ;; + esac + shift 1 + ;; + -W|-Wextra) + # TODO map extra warnings + shift 1 + ;; + -Wall) + # -Wall on MSVC is overzealous, and we already build with -W3. Nothing + # to do here. + shift 1 + ;; + -pedantic) + # libffi tests -pedantic with -Wall, so drop it also. + shift 1 + ;; + -warn) + # ignore -warn all from libtool as well. + if test "$2" = "all"; then + shift 2 + else + args="$args -warn" + shift 1 + fi + ;; + -Werror) + args="$args -WX" + shift 1 + ;; + -W*) + # TODO map specific warnings + shift 1 + ;; + -S) + args="$args -FAs" + shift 1 + ;; + -o) + outdir="$(dirname $2)" + base="$(basename $2|sed 's/\.[^.]*//g')" + if [ -n "$single" ]; then + output="-Fo$2" + else + output="-Fe$2" + fi + armasm_output="-o $2" + if [ -n "$assembly" ]; then + args="$args $output" + else + args="$args $output -Fd$outdir/$base -Fp$outdir/$base -Fa$outdir/$base" + fi + shift 2 + ;; + *.S) + src="$(cygpath -ma $1)" + assembly="true" + shift 1 + ;; + *.c) + args="$args $(cygpath -ma $1)" + shift 1 + ;; + *) + # Assume it's an MSVC argument, and pass it through. + args="$args $1" + shift 1 + ;; + esac +done + +if [ -n "$linkargs" ]; then + + # If -Zi is specified, certain optimizations are implicitly disabled + # by MSVC. Add back those optimizations if this is an optimized build. + # NOTE: These arguments must come after all others. + if [ -n "$opt" ]; then + linkargs="$linkargs -OPT:REF -OPT:ICF -INCREMENTAL:NO" + fi + + args="$args -link $linkargs" +fi + +if [ -n "$static_crt" ]; then + md=-MT +else + md=-MD +fi + +if [ -n "$debug_crt" ]; then + md="${md}d" +fi + +if [ -n "$assembly" ]; then + if [ -z "$outdir" ]; then + outdir="." + fi + ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')" + + if [ $ml = "armasm" ]; then + defines="$defines -D_M_ARM" + fi + + if [ $ml = "armasm64" ]; then + defines="$defines -D_M_ARM64" + fi + + if test -n "$verbose"; then + echo "$cl -nologo -EP $includes $defines $src > $ppsrc" + fi + + eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $? + output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')" + if [ $ml = "armasm" ]; then + args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt" + elif [ $ml = "armasm64" ]; then + args="-nologo -g $armasm_output $ppsrc -errorReport:prompt" + else + args="-nologo $safeseh $single $output $ppsrc" + fi + + if test -n "$verbose"; then + echo "$ml $args" + fi + + eval "\"$ml\" $args" + result=$? + + # required to fix ml64 broken output? + #mv *.obj $outdir +else + args="$md $args" + + if test -n "$verbose"; then + echo "$cl $args" + fi + # Return an error code of 1 if an invalid command line parameter is passed + # instead of just ignoring it. Any output that is not a warning or an + # error is filtered so this command behaves more like gcc. cl.exe prints + # the name of the compiled file otherwise, which breaks the dejagnu checks + # for excess warnings and errors. + eval "(\"$cl\" $args 2>&1 1>&3 | \ + awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1 | \ + awk '/warning|error/'" + result=$? +fi + +exit $result + +# vim: noai:ts=4:sw=4 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffi.c new file mode 100644 index 0000000..ef09f4d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffi.c @@ -0,0 +1,1025 @@ +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64) +#include +#include +#include +#include +#include +#include +#include "internal.h" +#ifdef _WIN32 +#include /* FlushInstructionCache */ +#endif + +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 128-bit type. */ +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + +union _d +{ + UINT64 d; + UINT32 s[2]; +}; + +struct _v +{ + union _d d[2] __attribute__((aligned(16))); +}; + +struct call_context +{ + struct _v v[N_V_ARG_REG]; + UINT64 x[N_X_ARG_REG]; +}; + +#if FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#ifdef HAVE_PTRAUTH +#include +#endif +#include +#endif + +#else + +#if defined (__clang__) && defined (__APPLE__) +extern void sys_icache_invalidate (void *start, size_t len); +#endif + +static inline void +ffi_clear_cache (void *start, void *end) +{ +#if defined (__clang__) && defined (__APPLE__) + sys_icache_invalidate (start, (char *)end - (char *)start); +#elif defined (__GNUC__) + __builtin___clear_cache (start, end); +#elif defined (_WIN32) + FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start); +#else +#error "Missing builtin to flush instruction cache" +#endif +} + +#endif + +/* A subroutine of is_vfp_type. Given a structure type, return the type code + of the first non-structure element. Recurse for structure elements. + Return -1 if the structure is in fact empty, i.e. no nested elements. */ + +static int +is_hfa0 (const ffi_type *ty) +{ + ffi_type **elements = ty->elements; + int i, ret = -1; + + if (elements != NULL) + for (i = 0; elements[i]; ++i) + { + ret = elements[i]->type; + if (ret == FFI_TYPE_STRUCT || ret == FFI_TYPE_COMPLEX) + { + ret = is_hfa0 (elements[i]); + if (ret < 0) + continue; + } + break; + } + + return ret; +} + +/* A subroutine of is_vfp_type. Given a structure type, return true if all + of the non-structure elements are the same as CANDIDATE. */ + +static int +is_hfa1 (const ffi_type *ty, int candidate) +{ + ffi_type **elements = ty->elements; + int i; + + if (elements != NULL) + for (i = 0; elements[i]; ++i) + { + int t = elements[i]->type; + if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) + { + if (!is_hfa1 (elements[i], candidate)) + return 0; + } + else if (t != candidate) + return 0; + } + + return 1; +} + +/* Determine if TY may be allocated to the FP registers. This is both an + fp scalar type as well as an homogenous floating point aggregate (HFA). + That is, a structure consisting of 1 to 4 members of all the same type, + where that type is an fp scalar. + + Returns non-zero iff TY is an HFA. The result is the AARCH64_RET_* + constant for the type. */ + +static int +is_vfp_type (const ffi_type *ty) +{ + ffi_type **elements; + int candidate, i; + size_t size, ele_count; + + /* Quickest tests first. */ + candidate = ty->type; + switch (candidate) + { + default: + return 0; + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + ele_count = 1; + goto done; + case FFI_TYPE_COMPLEX: + candidate = ty->elements[0]->type; + switch (candidate) + { + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + ele_count = 2; + goto done; + } + return 0; + case FFI_TYPE_STRUCT: + break; + } + + /* No HFA types are smaller than 4 bytes, or larger than 64 bytes. */ + size = ty->size; + if (size < 4 || size > 64) + return 0; + + /* Find the type of the first non-structure member. */ + elements = ty->elements; + candidate = elements[0]->type; + if (candidate == FFI_TYPE_STRUCT || candidate == FFI_TYPE_COMPLEX) + { + for (i = 0; ; ++i) + { + candidate = is_hfa0 (elements[i]); + if (candidate >= 0) + break; + } + } + + /* If the first member is not a floating point type, it's not an HFA. + Also quickly re-check the size of the structure. */ + switch (candidate) + { + case FFI_TYPE_FLOAT: + ele_count = size / sizeof(float); + if (size != ele_count * sizeof(float)) + return 0; + break; + case FFI_TYPE_DOUBLE: + ele_count = size / sizeof(double); + if (size != ele_count * sizeof(double)) + return 0; + break; + case FFI_TYPE_LONGDOUBLE: + ele_count = size / sizeof(long double); + if (size != ele_count * sizeof(long double)) + return 0; + break; + default: + return 0; + } + if (ele_count > 4) + return 0; + + /* Finally, make sure that all scalar elements are the same type. */ + for (i = 0; elements[i]; ++i) + { + int t = elements[i]->type; + if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) + { + if (!is_hfa1 (elements[i], candidate)) + return 0; + } + else if (t != candidate) + return 0; + } + + /* All tests succeeded. Encode the result. */ + done: + return candidate * 4 + (4 - (int)ele_count); +} + +/* Representation of the procedure call argument marshalling + state. + + The terse state variable names match the names used in the AARCH64 + PCS. */ + +struct arg_state +{ + unsigned ngrn; /* Next general-purpose register number. */ + unsigned nsrn; /* Next vector register number. */ + size_t nsaa; /* Next stack offset. */ + +#if defined (__APPLE__) + unsigned allocating_variadic; +#endif +}; + +/* Initialize a procedure call argument marshalling state. */ +static void +arg_init (struct arg_state *state) +{ + state->ngrn = 0; + state->nsrn = 0; + state->nsaa = 0; +#if defined (__APPLE__) + state->allocating_variadic = 0; +#endif +} + +/* Allocate an aligned slot on the stack and return a pointer to it. */ +static void * +allocate_to_stack (struct arg_state *state, void *stack, + size_t alignment, size_t size) +{ + size_t nsaa = state->nsaa; + + /* Round up the NSAA to the larger of 8 or the natural + alignment of the argument's type. */ +#if defined (__APPLE__) + if (state->allocating_variadic && alignment < 8) + alignment = 8; +#else + if (alignment < 8) + alignment = 8; +#endif + + nsaa = FFI_ALIGN (nsaa, alignment); + state->nsaa = nsaa + size; + + return (char *)stack + nsaa; +} + +static ffi_arg +extend_integer_type (void *source, int type) +{ + switch (type) + { + case FFI_TYPE_UINT8: + return *(UINT8 *) source; + case FFI_TYPE_SINT8: + return *(SINT8 *) source; + case FFI_TYPE_UINT16: + return *(UINT16 *) source; + case FFI_TYPE_SINT16: + return *(SINT16 *) source; + case FFI_TYPE_UINT32: + return *(UINT32 *) source; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + return *(SINT32 *) source; + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + return *(UINT64 *) source; + break; + case FFI_TYPE_POINTER: + return *(uintptr_t *) source; + default: + abort(); + } +} + +#if defined(_MSC_VER) +void extend_hfa_type (void *dest, void *src, int h); +#else +static void +extend_hfa_type (void *dest, void *src, int h) +{ + ssize_t f = h - AARCH64_RET_S4; + void *x0; + + asm volatile ( + "adr %0, 0f\n" +" add %0, %0, %1\n" +" br %0\n" +"0: ldp s16, s17, [%3]\n" /* S4 */ +" ldp s18, s19, [%3, #8]\n" +" b 4f\n" +" ldp s16, s17, [%3]\n" /* S3 */ +" ldr s18, [%3, #8]\n" +" b 3f\n" +" ldp s16, s17, [%3]\n" /* S2 */ +" b 2f\n" +" nop\n" +" ldr s16, [%3]\n" /* S1 */ +" b 1f\n" +" nop\n" +" ldp d16, d17, [%3]\n" /* D4 */ +" ldp d18, d19, [%3, #16]\n" +" b 4f\n" +" ldp d16, d17, [%3]\n" /* D3 */ +" ldr d18, [%3, #16]\n" +" b 3f\n" +" ldp d16, d17, [%3]\n" /* D2 */ +" b 2f\n" +" nop\n" +" ldr d16, [%3]\n" /* D1 */ +" b 1f\n" +" nop\n" +" ldp q16, q17, [%3]\n" /* Q4 */ +" ldp q18, q19, [%3, #32]\n" +" b 4f\n" +" ldp q16, q17, [%3]\n" /* Q3 */ +" ldr q18, [%3, #32]\n" +" b 3f\n" +" ldp q16, q17, [%3]\n" /* Q2 */ +" b 2f\n" +" nop\n" +" ldr q16, [%3]\n" /* Q1 */ +" b 1f\n" +"4: str q19, [%2, #48]\n" +"3: str q18, [%2, #32]\n" +"2: str q17, [%2, #16]\n" +"1: str q16, [%2]" + : "=&r"(x0) + : "r"(f * 12), "r"(dest), "r"(src) + : "memory", "v16", "v17", "v18", "v19"); +} +#endif + +#if defined(_MSC_VER) +void* compress_hfa_type (void *dest, void *src, int h); +#else +static void * +compress_hfa_type (void *dest, void *reg, int h) +{ + switch (h) + { + case AARCH64_RET_S1: + if (dest == reg) + { +#ifdef __AARCH64EB__ + dest += 12; +#endif + } + else + *(float *)dest = *(float *)reg; + break; + case AARCH64_RET_S2: + asm ("ldp q16, q17, [%1]\n\t" + "st2 { v16.s, v17.s }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17"); + break; + case AARCH64_RET_S3: + asm ("ldp q16, q17, [%1]\n\t" + "ldr q18, [%1, #32]\n\t" + "st3 { v16.s, v17.s, v18.s }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18"); + break; + case AARCH64_RET_S4: + asm ("ldp q16, q17, [%1]\n\t" + "ldp q18, q19, [%1, #32]\n\t" + "st4 { v16.s, v17.s, v18.s, v19.s }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18", "v19"); + break; + + case AARCH64_RET_D1: + if (dest == reg) + { +#ifdef __AARCH64EB__ + dest += 8; +#endif + } + else + *(double *)dest = *(double *)reg; + break; + case AARCH64_RET_D2: + asm ("ldp q16, q17, [%1]\n\t" + "st2 { v16.d, v17.d }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17"); + break; + case AARCH64_RET_D3: + asm ("ldp q16, q17, [%1]\n\t" + "ldr q18, [%1, #32]\n\t" + "st3 { v16.d, v17.d, v18.d }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18"); + break; + case AARCH64_RET_D4: + asm ("ldp q16, q17, [%1]\n\t" + "ldp q18, q19, [%1, #32]\n\t" + "st4 { v16.d, v17.d, v18.d, v19.d }[0], [%0]" + : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18", "v19"); + break; + + default: + if (dest != reg) + return memcpy (dest, reg, 16 * (4 - (h & 3))); + break; + } + return dest; +} +#endif + +/* Either allocate an appropriate register for the argument type, or if + none are available, allocate a stack slot and return a pointer + to the allocated space. */ + +static void * +allocate_int_to_reg_or_stack (struct call_context *context, + struct arg_state *state, + void *stack, size_t size) +{ + if (state->ngrn < N_X_ARG_REG) + return &context->x[state->ngrn++]; + + state->ngrn = N_X_ARG_REG; + return allocate_to_stack (state, stack, size, size); +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep (ffi_cif *cif) +{ + ffi_type *rtype = cif->rtype; + size_t bytes = cif->bytes; + int flags, i, n; + + switch (rtype->type) + { + case FFI_TYPE_VOID: + flags = AARCH64_RET_VOID; + break; + case FFI_TYPE_UINT8: + flags = AARCH64_RET_UINT8; + break; + case FFI_TYPE_UINT16: + flags = AARCH64_RET_UINT16; + break; + case FFI_TYPE_UINT32: + flags = AARCH64_RET_UINT32; + break; + case FFI_TYPE_SINT8: + flags = AARCH64_RET_SINT8; + break; + case FFI_TYPE_SINT16: + flags = AARCH64_RET_SINT16; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + flags = AARCH64_RET_SINT32; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + flags = AARCH64_RET_INT64; + break; + case FFI_TYPE_POINTER: + flags = (sizeof(void *) == 4 ? AARCH64_RET_UINT32 : AARCH64_RET_INT64); + break; + + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + flags = is_vfp_type (rtype); + if (flags == 0) + { + size_t s = rtype->size; + if (s > 16) + { + flags = AARCH64_RET_VOID | AARCH64_RET_IN_MEM; + bytes += 8; + } + else if (s == 16) + flags = AARCH64_RET_INT128; + else if (s == 8) + flags = AARCH64_RET_INT64; + else + flags = AARCH64_RET_INT128 | AARCH64_RET_NEED_COPY; + } + break; + + default: + abort(); + } + + for (i = 0, n = cif->nargs; i < n; i++) + if (is_vfp_type (cif->arg_types[i])) + { + flags |= AARCH64_FLAG_ARG_V; + break; + } + + /* Round the stack up to a multiple of the stack alignment requirement. */ + cif->bytes = (unsigned) FFI_ALIGN(bytes, 16); + cif->flags = flags; +#if defined (__APPLE__) + cif->aarch64_nfixedargs = 0; +#endif + + return FFI_OK; +} + +#if defined (__APPLE__) +/* Perform Apple-specific cif processing for variadic calls */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, + unsigned int ntotalargs) +{ + ffi_status status = ffi_prep_cif_machdep (cif); + cif->aarch64_nfixedargs = nfixedargs; + return status; +} +#else +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs) +{ + ffi_status status = ffi_prep_cif_machdep (cif); + cif->flags |= AARCH64_FLAG_VARARG; + return status; +} +#endif /* __APPLE__ */ + +extern void ffi_call_SYSV (struct call_context *context, void *frame, + void (*fn)(void), void *rvalue, int flags, + void *closure) FFI_HIDDEN; + +/* Call a function with the provided arguments and capture the return + value. */ +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, + void **avalue, void *closure) +{ + struct call_context *context; + void *stack, *frame, *rvalue; + struct arg_state state; + size_t stack_bytes, rtype_size, rsize; + int i, nargs, flags, isvariadic = 0; + ffi_type *rtype; + + flags = cif->flags; + rtype = cif->rtype; + rtype_size = rtype->size; + stack_bytes = cif->bytes; + + if (flags & AARCH64_FLAG_VARARG) + { + isvariadic = 1; + flags &= ~AARCH64_FLAG_VARARG; + } + + /* If the target function returns a structure via hidden pointer, + then we cannot allow a null rvalue. Otherwise, mash a null + rvalue to void return type. */ + rsize = 0; + if (flags & AARCH64_RET_IN_MEM) + { + if (orig_rvalue == NULL) + rsize = rtype_size; + } + else if (orig_rvalue == NULL) + flags &= AARCH64_FLAG_ARG_V; + else if (flags & AARCH64_RET_NEED_COPY) + rsize = 16; + + /* Allocate consectutive stack for everything we'll need. */ + context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize); + stack = context + 1; + frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes); + rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue); + + arg_init (&state); + for (i = 0, nargs = cif->nargs; i < nargs; i++) + { + ffi_type *ty = cif->arg_types[i]; + size_t s = ty->size; + void *a = avalue[i]; + int h, t; + + t = ty->type; + switch (t) + { + case FFI_TYPE_VOID: + FFI_ASSERT (0); + break; + + /* If the argument is a basic type the argument is allocated to an + appropriate register, or if none are available, to the stack. */ + case FFI_TYPE_INT: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + do_pointer: + { + ffi_arg ext = extend_integer_type (a, t); + if (state.ngrn < N_X_ARG_REG) + context->x[state.ngrn++] = ext; + else + { + void *d = allocate_to_stack (&state, stack, ty->alignment, s); + state.ngrn = N_X_ARG_REG; + /* Note that the default abi extends each argument + to a full 64-bit slot, while the iOS abi allocates + only enough space. */ +#ifdef __APPLE__ + memcpy(d, a, s); +#else + *(ffi_arg *)d = ext; +#endif + } + } + break; + + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + { + void *dest; + + h = is_vfp_type (ty); + if (h) + { + int elems = 4 - (h & 3); + if (cif->abi == FFI_WIN64 && isvariadic) + { + if (state.ngrn + elems <= N_X_ARG_REG) + { + dest = &context->x[state.ngrn]; + state.ngrn += elems; + extend_hfa_type(dest, a, h); + break; + } + state.nsrn = N_X_ARG_REG; + dest = allocate_to_stack(&state, stack, ty->alignment, s); + } + else + { + if (state.nsrn + elems <= N_V_ARG_REG) + { + dest = &context->v[state.nsrn]; + state.nsrn += elems; + extend_hfa_type (dest, a, h); + break; + } + state.nsrn = N_V_ARG_REG; + dest = allocate_to_stack (&state, stack, ty->alignment, s); + } + } + else if (s > 16) + { + /* If the argument is a composite type that is larger than 16 + bytes, then the argument has been copied to memory, and + the argument is replaced by a pointer to the copy. */ + a = &avalue[i]; + t = FFI_TYPE_POINTER; + s = sizeof (void *); + goto do_pointer; + } + else + { + size_t n = (s + 7) / 8; + if (state.ngrn + n <= N_X_ARG_REG) + { + /* If the argument is a composite type and the size in + double-words is not more than the number of available + X registers, then the argument is copied into + consecutive X registers. */ + dest = &context->x[state.ngrn]; + state.ngrn += (unsigned int)n; + } + else + { + /* Otherwise, there are insufficient X registers. Further + X register allocations are prevented, the NSAA is + adjusted and the argument is copied to memory at the + adjusted NSAA. */ + state.ngrn = N_X_ARG_REG; + dest = allocate_to_stack (&state, stack, ty->alignment, s); + } + } + memcpy (dest, a, s); + } + break; + + default: + abort(); + } + +#if defined (__APPLE__) + if (i + 1 == cif->aarch64_nfixedargs) + { + state.ngrn = N_X_ARG_REG; + state.nsrn = N_V_ARG_REG; + state.allocating_variadic = 1; + } +#endif + } + + ffi_call_SYSV (context, frame, fn, rvalue, flags, closure); + + if (flags & AARCH64_RET_NEED_COPY) + memcpy (orig_rvalue, rvalue, rtype_size); +} + +void +ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +#ifdef FFI_GO_CLOSURES +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} +#endif /* FFI_GO_CLOSURES */ + +/* Build a trampoline. */ + +extern void ffi_closure_SYSV (void) FFI_HIDDEN; +extern void ffi_closure_SYSV_V (void) FFI_HIDDEN; + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + void (*start)(void); + + if (cif->flags & AARCH64_FLAG_ARG_V) + start = ffi_closure_SYSV_V; + else + start = ffi_closure_SYSV; + +#if FFI_EXEC_TRAMPOLINE_TABLE +#ifdef __MACH__ +#ifdef HAVE_PTRAUTH + codeloc = ptrauth_strip (codeloc, ptrauth_key_asia); +#endif + void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); + config[0] = closure; + config[1] = start; +#endif +#else + static const unsigned char trampoline[16] = { + 0x90, 0x00, 0x00, 0x58, /* ldr x16, tramp+16 */ + 0xf1, 0xff, 0xff, 0x10, /* adr x17, tramp+0 */ + 0x00, 0x02, 0x1f, 0xd6 /* br x16 */ + }; + char *tramp = closure->tramp; + + memcpy (tramp, trampoline, sizeof(trampoline)); + + *(UINT64 *)(tramp + 16) = (uintptr_t)start; + + ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE); + + /* Also flush the cache for code mapping. */ +#ifdef _WIN32 + // Not using dlmalloc.c for Windows ARM64 builds + // so calling ffi_data_to_code_pointer() isn't necessary + unsigned char *tramp_code = tramp; + #else + unsigned char *tramp_code = ffi_data_to_code_pointer (tramp); + #endif + ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +#ifdef FFI_GO_CLOSURES +extern void ffi_go_closure_SYSV (void) FFI_HIDDEN; +extern void ffi_go_closure_SYSV_V (void) FFI_HIDDEN; + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*)) +{ + void (*start)(void); + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + if (cif->flags & AARCH64_FLAG_ARG_V) + start = ffi_go_closure_SYSV_V; + else + start = ffi_go_closure_SYSV; + + closure->tramp = start; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} +#endif /* FFI_GO_CLOSURES */ + +/* Primary handler to setup and invoke a function within a closure. + + A closure when invoked enters via the assembler wrapper + ffi_closure_SYSV(). The wrapper allocates a call context on the + stack, saves the interesting registers (from the perspective of + the calling convention) into the context then passes control to + ffi_closure_SYSV_inner() passing the saved context and a pointer to + the stack at the point ffi_closure_SYSV() was invoked. + + On the return path the assembler wrapper will reload call context + registers. + + ffi_closure_SYSV_inner() marshalls the call context into ffi value + descriptors, invokes the wrapped function, then marshalls the return + value back into the call context. */ + +int FFI_HIDDEN +ffi_closure_SYSV_inner (ffi_cif *cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + struct call_context *context, + void *stack, void *rvalue, void *struct_rvalue) +{ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + int i, h, nargs, flags; + struct arg_state state; + + arg_init (&state); + + for (i = 0, nargs = cif->nargs; i < nargs; i++) + { + ffi_type *ty = cif->arg_types[i]; + int t = ty->type; + size_t n, s = ty->size; + + switch (t) + { + case FFI_TYPE_VOID: + FFI_ASSERT (0); + break; + + case FFI_TYPE_INT: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + avalue[i] = allocate_int_to_reg_or_stack (context, &state, stack, s); + break; + + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + h = is_vfp_type (ty); + if (h) + { + n = 4 - (h & 3); +#ifdef _WIN32 /* for handling armasm calling convention */ + if (cif->is_variadic) + { + if (state.ngrn + n <= N_X_ARG_REG) + { + void *reg = &context->x[state.ngrn]; + state.ngrn += (unsigned int)n; + + /* Eeek! We need a pointer to the structure, however the + homogeneous float elements are being passed in individual + registers, therefore for float and double the structure + is not represented as a contiguous sequence of bytes in + our saved register context. We don't need the original + contents of the register storage, so we reformat the + structure into the same memory. */ + avalue[i] = compress_hfa_type(reg, reg, h); + } + else + { + state.ngrn = N_X_ARG_REG; + state.nsrn = N_V_ARG_REG; + avalue[i] = allocate_to_stack(&state, stack, + ty->alignment, s); + } + } + else + { +#endif /* for handling armasm calling convention */ + if (state.nsrn + n <= N_V_ARG_REG) + { + void *reg = &context->v[state.nsrn]; + state.nsrn += (unsigned int)n; + avalue[i] = compress_hfa_type(reg, reg, h); + } + else + { + state.nsrn = N_V_ARG_REG; + avalue[i] = allocate_to_stack(&state, stack, + ty->alignment, s); + } +#ifdef _WIN32 /* for handling armasm calling convention */ + } +#endif /* for handling armasm calling convention */ + } + else if (s > 16) + { + /* Replace Composite type of size greater than 16 with a + pointer. */ + avalue[i] = *(void **) + allocate_int_to_reg_or_stack (context, &state, stack, + sizeof (void *)); + } + else + { + n = (s + 7) / 8; + if (state.ngrn + n <= N_X_ARG_REG) + { + avalue[i] = &context->x[state.ngrn]; + state.ngrn += (unsigned int)n; + } + else + { + state.ngrn = N_X_ARG_REG; + avalue[i] = allocate_to_stack(&state, stack, + ty->alignment, s); + } + } + break; + + default: + abort(); + } + +#if defined (__APPLE__) + if (i + 1 == cif->aarch64_nfixedargs) + { + state.ngrn = N_X_ARG_REG; + state.nsrn = N_V_ARG_REG; + state.allocating_variadic = 1; + } +#endif + } + + flags = cif->flags; + if (flags & AARCH64_RET_IN_MEM) + rvalue = struct_rvalue; + + fun (cif, rvalue, avalue, user_data); + + return flags; +} + +#endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffitarget.h new file mode 100644 index 0000000..d5622e1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/ffitarget.h @@ -0,0 +1,97 @@ +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +#ifdef __ILP32__ +#define FFI_SIZEOF_ARG 8 +#define FFI_SIZEOF_JAVA_RAW 4 +typedef unsigned long long ffi_arg; +typedef signed long long ffi_sarg; +#elif defined(_WIN32) +#define FFI_SIZEOF_ARG 8 +typedef unsigned long long ffi_arg; +typedef signed long long ffi_sarg; +#else +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; +#endif + +typedef enum ffi_abi + { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_WIN64, + FFI_LAST_ABI, +#if defined(_WIN32) + FFI_DEFAULT_ABI = FFI_WIN64 +#else + FFI_DEFAULT_ABI = FFI_SYSV +#endif + } ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#define FFI_TRAMPOLINE_SIZE 16 +#define FFI_TRAMPOLINE_CLOSURE_OFFSET 16 +#else +#error "No trampoline table implementation" +#endif + +#else +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE +#endif + +#ifdef _WIN32 +#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic +#endif +#define FFI_TARGET_SPECIFIC_VARIADIC + +/* ---- Internal ---- */ + +#if defined (__APPLE__) +#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs +#elif !defined(_WIN32) +/* iOS and Windows reserve x18 for the system. Disable Go closures until + a new static chain is chosen. */ +#define FFI_GO_CLOSURES 1 +#endif + +#ifndef _WIN32 +/* No complex type on Windows */ +#define FFI_TARGET_HAS_COMPLEX_TYPE +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/internal.h new file mode 100644 index 0000000..3d4d035 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/internal.h @@ -0,0 +1,68 @@ +/* +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define AARCH64_RET_VOID 0 +#define AARCH64_RET_INT64 1 +#define AARCH64_RET_INT128 2 + +#define AARCH64_RET_UNUSED3 3 +#define AARCH64_RET_UNUSED4 4 +#define AARCH64_RET_UNUSED5 5 +#define AARCH64_RET_UNUSED6 6 +#define AARCH64_RET_UNUSED7 7 + +/* Note that FFI_TYPE_FLOAT == 2, _DOUBLE == 3, _LONGDOUBLE == 4, + so _S4 through _Q1 are layed out as (TYPE * 4) + (4 - COUNT). */ +#define AARCH64_RET_S4 8 +#define AARCH64_RET_S3 9 +#define AARCH64_RET_S2 10 +#define AARCH64_RET_S1 11 + +#define AARCH64_RET_D4 12 +#define AARCH64_RET_D3 13 +#define AARCH64_RET_D2 14 +#define AARCH64_RET_D1 15 + +#define AARCH64_RET_Q4 16 +#define AARCH64_RET_Q3 17 +#define AARCH64_RET_Q2 18 +#define AARCH64_RET_Q1 19 + +/* Note that each of the sub-64-bit integers gets two entries. */ +#define AARCH64_RET_UINT8 20 +#define AARCH64_RET_UINT16 22 +#define AARCH64_RET_UINT32 24 + +#define AARCH64_RET_SINT8 26 +#define AARCH64_RET_SINT16 28 +#define AARCH64_RET_SINT32 30 + +#define AARCH64_RET_MASK 31 + +#define AARCH64_RET_IN_MEM (1 << 5) +#define AARCH64_RET_NEED_COPY (1 << 6) + +#define AARCH64_FLAG_ARG_V_BIT 7 +#define AARCH64_FLAG_ARG_V (1 << AARCH64_FLAG_ARG_V_BIT) +#define AARCH64_FLAG_VARARG (1 << 8) + +#define N_X_ARG_REG 8 +#define N_V_ARG_REG 8 +#define CALL_CONTEXT_SIZE (N_V_ARG_REG * 16 + N_X_ARG_REG * 8) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/sysv.S new file mode 100644 index 0000000..b720a92 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/sysv.S @@ -0,0 +1,451 @@ +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__aarch64__) || defined(__arm64__) +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" + +#ifdef HAVE_MACHINE_ASM_H +#include +#else +#ifdef __USER_LABEL_PREFIX__ +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ +#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) +#else +#define CNAME(x) x +#endif +#endif + +#ifdef __AARCH64EB__ +# define BE(X) X +#else +# define BE(X) 0 +#endif + +#ifdef __ILP32__ +#define PTR_REG(n) w##n +#else +#define PTR_REG(n) x##n +#endif + +#ifdef __ILP32__ +#define PTR_SIZE 4 +#else +#define PTR_SIZE 8 +#endif + +#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH) +# define BR(r) braaz r +# define BLR(r) blraaz r +#else +# define BR(r) br r +# define BLR(r) blr r +#endif + + .text + .align 4 + +/* ffi_call_SYSV + extern void ffi_call_SYSV (void *stack, void *frame, + void (*fn)(void), void *rvalue, + int flags, void *closure); + + Therefore on entry we have: + + x0 stack + x1 frame + x2 fn + x3 rvalue + x4 flags + x5 closure +*/ + + cfi_startproc +CNAME(ffi_call_SYSV): + /* Use a stack frame allocated by our caller. */ + cfi_def_cfa(x1, 32); + stp x29, x30, [x1] + mov x29, x1 + mov sp, x0 + cfi_def_cfa_register(x29) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) + + mov x9, x2 /* save fn */ + mov x8, x3 /* install structure return */ +#ifdef FFI_GO_CLOSURES + mov x18, x5 /* install static chain */ +#endif + stp x3, x4, [x29, #16] /* save rvalue and flags */ + + /* Load the vector argument passing registers, if necessary. */ + tbz w4, #AARCH64_FLAG_ARG_V_BIT, 1f + ldp q0, q1, [sp, #0] + ldp q2, q3, [sp, #32] + ldp q4, q5, [sp, #64] + ldp q6, q7, [sp, #96] +1: + /* Load the core argument passing registers, including + the structure return pointer. */ + ldp x0, x1, [sp, #16*N_V_ARG_REG + 0] + ldp x2, x3, [sp, #16*N_V_ARG_REG + 16] + ldp x4, x5, [sp, #16*N_V_ARG_REG + 32] + ldp x6, x7, [sp, #16*N_V_ARG_REG + 48] + + /* Deallocate the context, leaving the stacked arguments. */ + add sp, sp, #CALL_CONTEXT_SIZE + + BLR(x9) /* call fn */ + + ldp x3, x4, [x29, #16] /* reload rvalue and flags */ + + /* Partially deconstruct the stack frame. */ + mov sp, x29 + cfi_def_cfa_register (sp) + ldp x29, x30, [x29] + + /* Save the return value as directed. */ + adr x5, 0f + and w4, w4, #AARCH64_RET_MASK + add x5, x5, x4, lsl #3 + br x5 + + /* Note that each table entry is 2 insns, and thus 8 bytes. + For integer data, note that we're storing into ffi_arg + and therefore we want to extend to 64 bits; these types + have two consecutive entries allocated for them. */ + .align 4 +0: ret /* VOID */ + nop +1: str x0, [x3] /* INT64 */ + ret +2: stp x0, x1, [x3] /* INT128 */ + ret +3: brk #1000 /* UNUSED */ + ret +4: brk #1000 /* UNUSED */ + ret +5: brk #1000 /* UNUSED */ + ret +6: brk #1000 /* UNUSED */ + ret +7: brk #1000 /* UNUSED */ + ret +8: st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */ + ret +9: st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */ + ret +10: stp s0, s1, [x3] /* S2 */ + ret +11: str s0, [x3] /* S1 */ + ret +12: st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */ + ret +13: st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */ + ret +14: stp d0, d1, [x3] /* D2 */ + ret +15: str d0, [x3] /* D1 */ + ret +16: str q3, [x3, #48] /* Q4 */ + nop +17: str q2, [x3, #32] /* Q3 */ + nop +18: stp q0, q1, [x3] /* Q2 */ + ret +19: str q0, [x3] /* Q1 */ + ret +20: uxtb w0, w0 /* UINT8 */ + str x0, [x3] +21: ret /* reserved */ + nop +22: uxth w0, w0 /* UINT16 */ + str x0, [x3] +23: ret /* reserved */ + nop +24: mov w0, w0 /* UINT32 */ + str x0, [x3] +25: ret /* reserved */ + nop +26: sxtb x0, w0 /* SINT8 */ + str x0, [x3] +27: ret /* reserved */ + nop +28: sxth x0, w0 /* SINT16 */ + str x0, [x3] +29: ret /* reserved */ + nop +30: sxtw x0, w0 /* SINT32 */ + str x0, [x3] +31: ret /* reserved */ + nop + + cfi_endproc + + .globl CNAME(ffi_call_SYSV) + FFI_HIDDEN(CNAME(ffi_call_SYSV)) +#ifdef __ELF__ + .type CNAME(ffi_call_SYSV), #function + .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) +#endif + +/* ffi_closure_SYSV + + Closure invocation glue. This is the low level code invoked directly by + the closure trampoline to setup and call a closure. + + On entry x17 points to a struct ffi_closure, x16 has been clobbered + all other registers are preserved. + + We allocate a call context and save the argument passing registers, + then invoked the generic C ffi_closure_SYSV_inner() function to do all + the real work, on return we load the result passing registers back from + the call context. +*/ + +#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64) + + .align 4 +CNAME(ffi_closure_SYSV_V): + cfi_startproc + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) + + /* Save the argument passing vector registers. */ + stp q0, q1, [sp, #16 + 0] + stp q2, q3, [sp, #16 + 32] + stp q4, q5, [sp, #16 + 64] + stp q6, q7, [sp, #16 + 96] + b 0f + cfi_endproc + + .globl CNAME(ffi_closure_SYSV_V) + FFI_HIDDEN(CNAME(ffi_closure_SYSV_V)) +#ifdef __ELF__ + .type CNAME(ffi_closure_SYSV_V), #function + .size CNAME(ffi_closure_SYSV_V), . - CNAME(ffi_closure_SYSV_V) +#endif + + .align 4 + cfi_startproc +CNAME(ffi_closure_SYSV): + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) +0: + mov x29, sp + + /* Save the argument passing core registers. */ + stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] + stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] + stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] + stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] + + /* Load ffi_closure_inner arguments. */ + ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ + ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ +.Ldo_closure: + add x3, sp, #16 /* load context */ + add x4, sp, #ffi_closure_SYSV_FS /* load stack */ + add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ + mov x6, x8 /* load struct_rval */ + bl CNAME(ffi_closure_SYSV_inner) + + /* Load the return value as directed. */ +#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH) + autiza x1 +#endif + adr x1, 0f + and w0, w0, #AARCH64_RET_MASK + add x1, x1, x0, lsl #3 + add x3, sp, #16+CALL_CONTEXT_SIZE + br x1 + + /* Note that each table entry is 2 insns, and thus 8 bytes. */ + .align 4 +0: b 99f /* VOID */ + nop +1: ldr x0, [x3] /* INT64 */ + b 99f +2: ldp x0, x1, [x3] /* INT128 */ + b 99f +3: brk #1000 /* UNUSED */ + nop +4: brk #1000 /* UNUSED */ + nop +5: brk #1000 /* UNUSED */ + nop +6: brk #1000 /* UNUSED */ + nop +7: brk #1000 /* UNUSED */ + nop +8: ldr s3, [x3, #12] /* S4 */ + nop +9: ldr s2, [x3, #8] /* S3 */ + nop +10: ldp s0, s1, [x3] /* S2 */ + b 99f +11: ldr s0, [x3] /* S1 */ + b 99f +12: ldr d3, [x3, #24] /* D4 */ + nop +13: ldr d2, [x3, #16] /* D3 */ + nop +14: ldp d0, d1, [x3] /* D2 */ + b 99f +15: ldr d0, [x3] /* D1 */ + b 99f +16: ldr q3, [x3, #48] /* Q4 */ + nop +17: ldr q2, [x3, #32] /* Q3 */ + nop +18: ldp q0, q1, [x3] /* Q2 */ + b 99f +19: ldr q0, [x3] /* Q1 */ + b 99f +20: ldrb w0, [x3, #BE(7)] /* UINT8 */ + b 99f +21: brk #1000 /* reserved */ + nop +22: ldrh w0, [x3, #BE(6)] /* UINT16 */ + b 99f +23: brk #1000 /* reserved */ + nop +24: ldr w0, [x3, #BE(4)] /* UINT32 */ + b 99f +25: brk #1000 /* reserved */ + nop +26: ldrsb x0, [x3, #BE(7)] /* SINT8 */ + b 99f +27: brk #1000 /* reserved */ + nop +28: ldrsh x0, [x3, #BE(6)] /* SINT16 */ + b 99f +29: brk #1000 /* reserved */ + nop +30: ldrsw x0, [x3, #BE(4)] /* SINT32 */ + nop +31: /* reserved */ +99: ldp x29, x30, [sp], #ffi_closure_SYSV_FS + cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS) + cfi_restore (x29) + cfi_restore (x30) + ret + cfi_endproc + + .globl CNAME(ffi_closure_SYSV) + FFI_HIDDEN(CNAME(ffi_closure_SYSV)) +#ifdef __ELF__ + .type CNAME(ffi_closure_SYSV), #function + .size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV) +#endif + +#if FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#include + .align PAGE_MAX_SHIFT +CNAME(ffi_closure_trampoline_table_page): + .rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE + adr x16, -PAGE_MAX_SIZE + ldp x17, x16, [x16] + BR(x16) + nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */ + .endr + + .globl CNAME(ffi_closure_trampoline_table_page) + FFI_HIDDEN(CNAME(ffi_closure_trampoline_table_page)) + #ifdef __ELF__ + .type CNAME(ffi_closure_trampoline_table_page), #function + .size CNAME(ffi_closure_trampoline_table_page), . - CNAME(ffi_closure_trampoline_table_page) + #endif +#endif + +#endif /* FFI_EXEC_TRAMPOLINE_TABLE */ + +#ifdef FFI_GO_CLOSURES + .align 4 +CNAME(ffi_go_closure_SYSV_V): + cfi_startproc + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) + + /* Save the argument passing vector registers. */ + stp q0, q1, [sp, #16 + 0] + stp q2, q3, [sp, #16 + 32] + stp q4, q5, [sp, #16 + 64] + stp q6, q7, [sp, #16 + 96] + b 0f + cfi_endproc + + .globl CNAME(ffi_go_closure_SYSV_V) + FFI_HIDDEN(CNAME(ffi_go_closure_SYSV_V)) +#ifdef __ELF__ + .type CNAME(ffi_go_closure_SYSV_V), #function + .size CNAME(ffi_go_closure_SYSV_V), . - CNAME(ffi_go_closure_SYSV_V) +#endif + + .align 4 + cfi_startproc +CNAME(ffi_go_closure_SYSV): + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) +0: + mov x29, sp + + /* Save the argument passing core registers. */ + stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] + stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] + stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] + stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] + + /* Load ffi_closure_inner arguments. */ + ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */ + mov x2, x18 /* load user_data */ + b .Ldo_closure + cfi_endproc + + .globl CNAME(ffi_go_closure_SYSV) + FFI_HIDDEN(CNAME(ffi_go_closure_SYSV)) +#ifdef __ELF__ + .type CNAME(ffi_go_closure_SYSV), #function + .size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV) +#endif +#endif /* FFI_GO_CLOSURES */ +#endif /* __arm64__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/win64_armasm.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/win64_armasm.S new file mode 100644 index 0000000..7fc185b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/aarch64/win64_armasm.S @@ -0,0 +1,506 @@ +/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" + + OPT 2 /*disable listing */ +/* For some macros to add unwind information */ +#include "ksarm64.h" + OPT 1 /*re-enable listing */ + +#define BE(X) 0 +#define PTR_REG(n) x##n +#define PTR_SIZE 8 + + IMPORT ffi_closure_SYSV_inner + EXPORT ffi_call_SYSV + EXPORT ffi_closure_SYSV_V + EXPORT ffi_closure_SYSV + EXPORT extend_hfa_type + EXPORT compress_hfa_type +#ifdef FFI_GO_CLOSURES + EXPORT ffi_go_closure_SYSV_V + EXPORT ffi_go_closure_SYSV +#endif + + TEXTAREA, ALIGN=8 + +/* ffi_call_SYSV + extern void ffi_call_SYSV (void *stack, void *frame, + void (*fn)(void), void *rvalue, + int flags, void *closure); + Therefore on entry we have: + x0 stack + x1 frame + x2 fn + x3 rvalue + x4 flags + x5 closure +*/ + + NESTED_ENTRY ffi_call_SYSV_fake + + /* For unwind information, Windows has to store fp and lr */ + PROLOG_SAVE_REG_PAIR x29, x30, #-32! + + ALTERNATE_ENTRY ffi_call_SYSV + /* Use a stack frame allocated by our caller. */ + stp x29, x30, [x1] + mov x29, x1 + mov sp, x0 + + mov x9, x2 /* save fn */ + mov x8, x3 /* install structure return */ +#ifdef FFI_GO_CLOSURES + /*mov x18, x5 install static chain */ +#endif + stp x3, x4, [x29, #16] /* save rvalue and flags */ + + /* Load the vector argument passing registers, if necessary. */ + tbz x4, #AARCH64_FLAG_ARG_V_BIT, ffi_call_SYSV_L1 + ldp q0, q1, [sp, #0] + ldp q2, q3, [sp, #32] + ldp q4, q5, [sp, #64] + ldp q6, q7, [sp, #96] + +ffi_call_SYSV_L1 + /* Load the core argument passing registers, including + the structure return pointer. */ + ldp x0, x1, [sp, #16*N_V_ARG_REG + 0] + ldp x2, x3, [sp, #16*N_V_ARG_REG + 16] + ldp x4, x5, [sp, #16*N_V_ARG_REG + 32] + ldp x6, x7, [sp, #16*N_V_ARG_REG + 48] + + /* Deallocate the context, leaving the stacked arguments. */ + add sp, sp, #CALL_CONTEXT_SIZE + + blr x9 /* call fn */ + + ldp x3, x4, [x29, #16] /* reload rvalue and flags */ + + /* Partially deconstruct the stack frame. */ + mov sp, x29 + ldp x29, x30, [x29] + + /* Save the return value as directed. */ + adr x5, ffi_call_SYSV_return + and w4, w4, #AARCH64_RET_MASK + add x5, x5, x4, lsl #3 + br x5 + + /* Note that each table entry is 2 insns, and thus 8 bytes. + For integer data, note that we're storing into ffi_arg + and therefore we want to extend to 64 bits; these types + have two consecutive entries allocated for them. */ + ALIGN 4 +ffi_call_SYSV_return + ret /* VOID */ + nop + str x0, [x3] /* INT64 */ + ret + stp x0, x1, [x3] /* INT128 */ + ret + brk #1000 /* UNUSED */ + ret + brk #1000 /* UNUSED */ + ret + brk #1000 /* UNUSED */ + ret + brk #1000 /* UNUSED */ + ret + brk #1000 /* UNUSED */ + ret + st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */ + ret + st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */ + ret + stp s0, s1, [x3] /* S2 */ + ret + str s0, [x3] /* S1 */ + ret + st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */ + ret + st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */ + ret + stp d0, d1, [x3] /* D2 */ + ret + str d0, [x3] /* D1 */ + ret + str q3, [x3, #48] /* Q4 */ + nop + str q2, [x3, #32] /* Q3 */ + nop + stp q0, q1, [x3] /* Q2 */ + ret + str q0, [x3] /* Q1 */ + ret + uxtb w0, w0 /* UINT8 */ + str x0, [x3] + ret /* reserved */ + nop + uxth w0, w0 /* UINT16 */ + str x0, [x3] + ret /* reserved */ + nop + mov w0, w0 /* UINT32 */ + str x0, [x3] + ret /* reserved */ + nop + sxtb x0, w0 /* SINT8 */ + str x0, [x3] + ret /* reserved */ + nop + sxth x0, w0 /* SINT16 */ + str x0, [x3] + ret /* reserved */ + nop + sxtw x0, w0 /* SINT32 */ + str x0, [x3] + ret /* reserved */ + nop + + + NESTED_END ffi_call_SYSV_fake + + +/* ffi_closure_SYSV + Closure invocation glue. This is the low level code invoked directly by + the closure trampoline to setup and call a closure. + On entry x17 points to a struct ffi_closure, x16 has been clobbered + all other registers are preserved. + We allocate a call context and save the argument passing registers, + then invoked the generic C ffi_closure_SYSV_inner() function to do all + the real work, on return we load the result passing registers back from + the call context. +*/ + +#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64) + + NESTED_ENTRY ffi_closure_SYSV_V + PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! + + /* Save the argument passing vector registers. */ + stp q0, q1, [sp, #16 + 0] + stp q2, q3, [sp, #16 + 32] + stp q4, q5, [sp, #16 + 64] + stp q6, q7, [sp, #16 + 96] + + b ffi_closure_SYSV_save_argument + NESTED_END ffi_closure_SYSV_V + + NESTED_ENTRY ffi_closure_SYSV + PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! + +ffi_closure_SYSV_save_argument + /* Save the argument passing core registers. */ + stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] + stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] + stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] + stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] + + /* Load ffi_closure_inner arguments. */ + ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ + ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ + +do_closure + add x3, sp, #16 /* load context */ + add x4, sp, #ffi_closure_SYSV_FS /* load stack */ + add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ + mov x6, x8 /* load struct_rval */ + + bl ffi_closure_SYSV_inner + + /* Load the return value as directed. */ + adr x1, ffi_closure_SYSV_return_base + and w0, w0, #AARCH64_RET_MASK + add x1, x1, x0, lsl #3 + add x3, sp, #16+CALL_CONTEXT_SIZE + br x1 + + /* Note that each table entry is 2 insns, and thus 8 bytes. */ + ALIGN 8 +ffi_closure_SYSV_return_base + b ffi_closure_SYSV_epilog /* VOID */ + nop + ldr x0, [x3] /* INT64 */ + b ffi_closure_SYSV_epilog + ldp x0, x1, [x3] /* INT128 */ + b ffi_closure_SYSV_epilog + brk #1000 /* UNUSED */ + nop + brk #1000 /* UNUSED */ + nop + brk #1000 /* UNUSED */ + nop + brk #1000 /* UNUSED */ + nop + brk #1000 /* UNUSED */ + nop + ldr s3, [x3, #12] /* S4 */ + nop + ldr s2, [x3, #8] /* S3 */ + nop + ldp s0, s1, [x3] /* S2 */ + b ffi_closure_SYSV_epilog + ldr s0, [x3] /* S1 */ + b ffi_closure_SYSV_epilog + ldr d3, [x3, #24] /* D4 */ + nop + ldr d2, [x3, #16] /* D3 */ + nop + ldp d0, d1, [x3] /* D2 */ + b ffi_closure_SYSV_epilog + ldr d0, [x3] /* D1 */ + b ffi_closure_SYSV_epilog + ldr q3, [x3, #48] /* Q4 */ + nop + ldr q2, [x3, #32] /* Q3 */ + nop + ldp q0, q1, [x3] /* Q2 */ + b ffi_closure_SYSV_epilog + ldr q0, [x3] /* Q1 */ + b ffi_closure_SYSV_epilog + ldrb w0, [x3, #BE(7)] /* UINT8 */ + b ffi_closure_SYSV_epilog + brk #1000 /* reserved */ + nop + ldrh w0, [x3, #BE(6)] /* UINT16 */ + b ffi_closure_SYSV_epilog + brk #1000 /* reserved */ + nop + ldr w0, [x3, #BE(4)] /* UINT32 */ + b ffi_closure_SYSV_epilog + brk #1000 /* reserved */ + nop + ldrsb x0, [x3, #BE(7)] /* SINT8 */ + b ffi_closure_SYSV_epilog + brk #1000 /* reserved */ + nop + ldrsh x0, [x3, #BE(6)] /* SINT16 */ + b ffi_closure_SYSV_epilog + brk #1000 /* reserved */ + nop + ldrsw x0, [x3, #BE(4)] /* SINT32 */ + nop + /* reserved */ + +ffi_closure_SYSV_epilog + EPILOG_RESTORE_REG_PAIR x29, x30, #ffi_closure_SYSV_FS! + EPILOG_RETURN + NESTED_END ffi_closure_SYSV + + +#ifdef FFI_GO_CLOSURES + NESTED_ENTRY ffi_go_closure_SYSV_V + PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! + + /* Save the argument passing vector registers. */ + stp q0, q1, [sp, #16 + 0] + stp q2, q3, [sp, #16 + 32] + stp q4, q5, [sp, #16 + 64] + stp q6, q7, [sp, #16 + 96] + b ffi_go_closure_SYSV_save_argument + NESTED_END ffi_go_closure_SYSV_V + + NESTED_ENTRY ffi_go_closure_SYSV + PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! + +ffi_go_closure_SYSV_save_argument + /* Save the argument passing core registers. */ + stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] + stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] + stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] + stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] + + /* Load ffi_closure_inner arguments. */ + ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */ + mov x2, x18 /* load user_data */ + b do_closure + NESTED_END ffi_go_closure_SYSV + +#endif /* FFI_GO_CLOSURES */ + + +/* void extend_hfa_type (void *dest, void *src, int h) */ + + LEAF_ENTRY extend_hfa_type + + adr x3, extend_hfa_type_jump_base + and w2, w2, #AARCH64_RET_MASK + sub x2, x2, #AARCH64_RET_S4 + add x3, x3, x2, lsl #4 + br x3 + + ALIGN 4 +extend_hfa_type_jump_base + ldp s16, s17, [x1] /* S4 */ + ldp s18, s19, [x1, #8] + b extend_hfa_type_store_4 + nop + + ldp s16, s17, [x1] /* S3 */ + ldr s18, [x1, #8] + b extend_hfa_type_store_3 + nop + + ldp s16, s17, [x1] /* S2 */ + b extend_hfa_type_store_2 + nop + nop + + ldr s16, [x1] /* S1 */ + b extend_hfa_type_store_1 + nop + nop + + ldp d16, d17, [x1] /* D4 */ + ldp d18, d19, [x1, #16] + b extend_hfa_type_store_4 + nop + + ldp d16, d17, [x1] /* D3 */ + ldr d18, [x1, #16] + b extend_hfa_type_store_3 + nop + + ldp d16, d17, [x1] /* D2 */ + b extend_hfa_type_store_2 + nop + nop + + ldr d16, [x1] /* D1 */ + b extend_hfa_type_store_1 + nop + nop + + ldp q16, q17, [x1] /* Q4 */ + ldp q18, q19, [x1, #16] + b extend_hfa_type_store_4 + nop + + ldp q16, q17, [x1] /* Q3 */ + ldr q18, [x1, #16] + b extend_hfa_type_store_3 + nop + + ldp q16, q17, [x1] /* Q2 */ + b extend_hfa_type_store_2 + nop + nop + + ldr q16, [x1] /* Q1 */ + b extend_hfa_type_store_1 + +extend_hfa_type_store_4 + str q19, [x0, #48] +extend_hfa_type_store_3 + str q18, [x0, #32] +extend_hfa_type_store_2 + str q17, [x0, #16] +extend_hfa_type_store_1 + str q16, [x0] + ret + + LEAF_END extend_hfa_type + + +/* void compress_hfa_type (void *dest, void *reg, int h) */ + + LEAF_ENTRY compress_hfa_type + + adr x3, compress_hfa_type_jump_base + and w2, w2, #AARCH64_RET_MASK + sub x2, x2, #AARCH64_RET_S4 + add x3, x3, x2, lsl #4 + br x3 + + ALIGN 4 +compress_hfa_type_jump_base + ldp q16, q17, [x1] /* S4 */ + ldp q18, q19, [x1, #32] + st4 { v16.s, v17.s, v18.s, v19.s }[0], [x0] + ret + + ldp q16, q17, [x1] /* S3 */ + ldr q18, [x1, #32] + st3 { v16.s, v17.s, v18.s }[0], [x0] + ret + + ldp q16, q17, [x1] /* S2 */ + st2 { v16.s, v17.s }[0], [x0] + ret + nop + + ldr q16, [x1] /* S1 */ + st1 { v16.s }[0], [x0] + ret + nop + + ldp q16, q17, [x1] /* D4 */ + ldp q18, q19, [x1, #32] + st4 { v16.d, v17.d, v18.d, v19.d }[0], [x0] + ret + + ldp q16, q17, [x1] /* D3 */ + ldr q18, [x1, #32] + st3 { v16.d, v17.d, v18.d }[0], [x0] + ret + + ldp q16, q17, [x1] /* D2 */ + st2 { v16.d, v17.d }[0], [x0] + ret + nop + + ldr q16, [x1] /* D1 */ + st1 { v16.d }[0], [x0] + ret + nop + + ldp q16, q17, [x1] /* Q4 */ + ldp q18, q19, [x1, #32] + b compress_hfa_type_store_q4 + nop + + ldp q16, q17, [x1] /* Q3 */ + ldr q18, [x1, #32] + b compress_hfa_type_store_q3 + nop + + ldp q16, q17, [x1] /* Q2 */ + stp q16, q17, [x0] + ret + nop + + ldr q16, [x1] /* Q1 */ + str q16, [x0] + ret + +compress_hfa_type_store_q4 + str q19, [x0, #48] +compress_hfa_type_store_q3 + str q18, [x0, #32] + stp q16, q17, [x0] + ret + + LEAF_END compress_hfa_type + + END \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffi.c new file mode 100644 index 0000000..7a95e97 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffi.c @@ -0,0 +1,521 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2012 Anthony Green + Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc. + + Alpha Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include +#include "internal.h" + +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 128-bit type. */ +#if defined(__LONG_DOUBLE_128__) +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + +extern void ffi_call_osf(void *stack, void *frame, unsigned flags, + void *raddr, void (*fn)(void), void *closure) + FFI_HIDDEN; +extern void ffi_closure_osf(void) FFI_HIDDEN; +extern void ffi_go_closure_osf(void) FFI_HIDDEN; + +/* Promote a float value to its in-register double representation. + Unlike actually casting to double, this does not trap on NaN. */ +static inline UINT64 lds(void *ptr) +{ + UINT64 ret; + asm("lds %0,%1" : "=f"(ret) : "m"(*(UINT32 *)ptr)); + return ret; +} + +/* And the reverse. */ +static inline void sts(void *ptr, UINT64 val) +{ + asm("sts %1,%0" : "=m"(*(UINT32 *)ptr) : "f"(val)); +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep(ffi_cif *cif) +{ + size_t bytes = 0; + int flags, i, avn; + ffi_type *rtype, *itype; + + if (cif->abi != FFI_OSF) + return FFI_BAD_ABI; + + /* Compute the size of the argument area. */ + for (i = 0, avn = cif->nargs; i < avn; i++) + { + itype = cif->arg_types[i]; + switch (itype->type) + { + case FFI_TYPE_INT: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + /* All take one 8 byte slot. */ + bytes += 8; + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + /* Passed by value in N slots. */ + bytes += FFI_ALIGN(itype->size, FFI_SIZEOF_ARG); + break; + + case FFI_TYPE_COMPLEX: + /* _Complex long double passed by reference; others in 2 slots. */ + if (itype->elements[0]->type == FFI_TYPE_LONGDOUBLE) + bytes += 8; + else + bytes += 16; + break; + + default: + abort(); + } + } + + /* Set the return type flag */ + rtype = cif->rtype; + switch (rtype->type) + { + case FFI_TYPE_VOID: + flags = ALPHA_FLAGS(ALPHA_ST_VOID, ALPHA_LD_VOID); + break; + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT32); + break; + case FFI_TYPE_FLOAT: + flags = ALPHA_FLAGS(ALPHA_ST_FLOAT, ALPHA_LD_FLOAT); + break; + case FFI_TYPE_DOUBLE: + flags = ALPHA_FLAGS(ALPHA_ST_DOUBLE, ALPHA_LD_DOUBLE); + break; + case FFI_TYPE_UINT8: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_UINT8); + break; + case FFI_TYPE_SINT8: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_SINT8); + break; + case FFI_TYPE_UINT16: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_UINT16); + break; + case FFI_TYPE_SINT16: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_SINT16); + break; + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT64); + break; + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_STRUCT: + /* Passed in memory, with a hidden pointer. */ + flags = ALPHA_RET_IN_MEM; + break; + case FFI_TYPE_COMPLEX: + itype = rtype->elements[0]; + switch (itype->type) + { + case FFI_TYPE_FLOAT: + flags = ALPHA_FLAGS(ALPHA_ST_CPLXF, ALPHA_LD_CPLXF); + break; + case FFI_TYPE_DOUBLE: + flags = ALPHA_FLAGS(ALPHA_ST_CPLXD, ALPHA_LD_CPLXD); + break; + default: + if (rtype->size <= 8) + flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT64); + else + flags = ALPHA_RET_IN_MEM; + break; + } + break; + default: + abort(); + } + cif->flags = flags; + + /* Include the hidden structure pointer in args requirement. */ + if (flags == ALPHA_RET_IN_MEM) + bytes += 8; + /* Minimum size is 6 slots, so that ffi_call_osf can pop them. */ + if (bytes < 6*8) + bytes = 6*8; + cif->bytes = bytes; + + return FFI_OK; +} + +static unsigned long +extend_basic_type(void *valp, int type, int argn) +{ + switch (type) + { + case FFI_TYPE_SINT8: + return *(SINT8 *)valp; + case FFI_TYPE_UINT8: + return *(UINT8 *)valp; + case FFI_TYPE_SINT16: + return *(SINT16 *)valp; + case FFI_TYPE_UINT16: + return *(UINT16 *)valp; + + case FFI_TYPE_FLOAT: + if (argn < 6) + return lds(valp); + /* FALLTHRU */ + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + /* Note that unsigned 32-bit quantities are sign extended. */ + return *(SINT32 *)valp; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + case FFI_TYPE_DOUBLE: + return *(UINT64 *)valp; + + default: + abort(); + } +} + +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + unsigned long *argp; + long i, avn, argn, flags = cif->flags; + ffi_type **arg_types; + void *frame; + + /* If the return value is a struct and we don't have a return + value address then we need to make one. */ + if (rvalue == NULL && flags == ALPHA_RET_IN_MEM) + rvalue = alloca(cif->rtype->size); + + /* Allocate the space for the arguments, plus 4 words of temp + space for ffi_call_osf. */ + argp = frame = alloca(cif->bytes + 4*FFI_SIZEOF_ARG); + frame += cif->bytes; + + argn = 0; + if (flags == ALPHA_RET_IN_MEM) + argp[argn++] = (unsigned long)rvalue; + + avn = cif->nargs; + arg_types = cif->arg_types; + + for (i = 0, avn = cif->nargs; i < avn; i++) + { + ffi_type *ty = arg_types[i]; + void *valp = avalue[i]; + int type = ty->type; + size_t size; + + switch (type) + { + case FFI_TYPE_INT: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + argp[argn] = extend_basic_type(valp, type, argn); + argn++; + break; + + case FFI_TYPE_LONGDOUBLE: + by_reference: + /* Note that 128-bit long double is passed by reference. */ + argp[argn++] = (unsigned long)valp; + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + size = ty->size; + memcpy(argp + argn, valp, size); + argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + break; + + case FFI_TYPE_COMPLEX: + type = ty->elements[0]->type; + if (type == FFI_TYPE_LONGDOUBLE) + goto by_reference; + + /* Most complex types passed as two separate arguments. */ + size = ty->elements[0]->size; + argp[argn] = extend_basic_type(valp, type, argn); + argp[argn + 1] = extend_basic_type(valp + size, type, argn + 1); + argn += 2; + break; + + default: + abort(); + } + } + + flags = (flags >> ALPHA_ST_SHIFT) & 0xff; + ffi_call_osf(argp, frame, flags, rvalue, fn, closure); +} + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int(cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int(cif, fn, rvalue, avalue, closure); +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp; + + if (cif->abi != FFI_OSF) + return FFI_BAD_ABI; + + tramp = (unsigned int *) &closure->tramp[0]; + tramp[0] = 0x47fb0401; /* mov $27,$1 */ + tramp[1] = 0xa77b0010; /* ldq $27,16($27) */ + tramp[2] = 0x6bfb0000; /* jmp $31,($27),0 */ + tramp[3] = 0x47ff041f; /* nop */ + *(void **) &tramp[4] = ffi_closure_osf; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Flush the Icache. + + Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal + instead, since both Compaq as and gas can handle it. + + 0x86 is PAL_imb in Tru64 UNIX . */ + asm volatile ("call_pal 0x86" : : : "memory"); + + return FFI_OK; +} + +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ + if (cif->abi != FFI_OSF) + return FFI_BAD_ABI; + + closure->tramp = (void *)ffi_go_closure_osf; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +long FFI_HIDDEN +ffi_closure_osf_inner (ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *rvalue, unsigned long *argp) +{ + void **avalue; + ffi_type **arg_types; + long i, avn, argn, flags; + + avalue = alloca(cif->nargs * sizeof(void *)); + flags = cif->flags; + argn = 0; + + /* Copy the caller's structure return address to that the closure + returns the data directly to the caller. */ + if (flags == ALPHA_RET_IN_MEM) + { + rvalue = (void *) argp[0]; + argn = 1; + } + + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0, avn = cif->nargs; i < avn; i++) + { + ffi_type *ty = arg_types[i]; + int type = ty->type; + void *valp = &argp[argn]; + size_t size; + + switch (type) + { + case FFI_TYPE_INT: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + argn += 1; + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + size = ty->size; + argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + break; + + case FFI_TYPE_FLOAT: + /* Floats coming from registers need conversion from double + back to float format. */ + if (argn < 6) + { + valp = &argp[argn - 6]; + sts(valp, argp[argn - 6]); + } + argn += 1; + break; + + case FFI_TYPE_DOUBLE: + if (argn < 6) + valp = &argp[argn - 6]; + argn += 1; + break; + + case FFI_TYPE_LONGDOUBLE: + by_reference: + /* 128-bit long double is passed by reference. */ + valp = (void *)argp[argn]; + argn += 1; + break; + + case FFI_TYPE_COMPLEX: + type = ty->elements[0]->type; + switch (type) + { + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + /* Passed as separate arguments, but they wind up sequential. */ + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + /* Passed as separate arguments. Disjoint, but there's room + enough in one slot to hold the pair. */ + size = ty->elements[0]->size; + memcpy(valp + size, valp + 8, size); + break; + + case FFI_TYPE_FLOAT: + /* Passed as separate arguments. Disjoint, and each piece + may need conversion back to float. */ + if (argn < 6) + { + valp = &argp[argn - 6]; + sts(valp, argp[argn - 6]); + } + if (argn + 1 < 6) + sts(valp + 4, argp[argn + 1 - 6]); + else + *(UINT32 *)(valp + 4) = argp[argn + 1]; + break; + + case FFI_TYPE_DOUBLE: + /* Passed as separate arguments. Only disjoint if one part + is in fp regs and the other is on the stack. */ + if (argn < 5) + valp = &argp[argn - 6]; + else if (argn == 5) + { + valp = alloca(16); + ((UINT64 *)valp)[0] = argp[5 - 6]; + ((UINT64 *)valp)[1] = argp[6]; + } + break; + + case FFI_TYPE_LONGDOUBLE: + goto by_reference; + + default: + abort(); + } + argn += 2; + break; + + default: + abort (); + } + + avalue[i] = valp; + } + + /* Invoke the closure. */ + fun (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_osf how to perform return type promotions. */ + return (flags >> ALPHA_LD_SHIFT) & 0xff; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffitarget.h new file mode 100644 index 0000000..a02dbd0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/ffitarget.h @@ -0,0 +1,57 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for Alpha. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_OSF, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_OSF +} ffi_abi; +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +#define FFI_TARGET_HAS_COMPLEX_TYPE + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/internal.h new file mode 100644 index 0000000..44da192 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/internal.h @@ -0,0 +1,23 @@ +#define ALPHA_ST_VOID 0 +#define ALPHA_ST_INT 1 +#define ALPHA_ST_FLOAT 2 +#define ALPHA_ST_DOUBLE 3 +#define ALPHA_ST_CPLXF 4 +#define ALPHA_ST_CPLXD 5 + +#define ALPHA_LD_VOID 0 +#define ALPHA_LD_INT64 1 +#define ALPHA_LD_INT32 2 +#define ALPHA_LD_UINT16 3 +#define ALPHA_LD_SINT16 4 +#define ALPHA_LD_UINT8 5 +#define ALPHA_LD_SINT8 6 +#define ALPHA_LD_FLOAT 7 +#define ALPHA_LD_DOUBLE 8 +#define ALPHA_LD_CPLXF 9 +#define ALPHA_LD_CPLXD 10 + +#define ALPHA_ST_SHIFT 0 +#define ALPHA_LD_SHIFT 8 +#define ALPHA_RET_IN_MEM 0x10000 +#define ALPHA_FLAGS(S, L) (((L) << ALPHA_LD_SHIFT) | (S)) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/osf.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/osf.S new file mode 100644 index 0000000..b031828 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/alpha/osf.S @@ -0,0 +1,282 @@ +/* ----------------------------------------------------------------------- + osf.S - Copyright (c) 1998, 2001, 2007, 2008, 2011, 2014 Red Hat + + Alpha/OSF Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" + + .arch ev6 + .text + +/* Aid in building a direct addressed jump table, 4 insns per entry. */ +.macro E index + .align 4 + .org 99b + \index * 16 +.endm + +/* ffi_call_osf (void *stack, void *frame, unsigned flags, + void *raddr, void (*fnaddr)(void), void *closure) + + Bit o trickiness here -- FRAME is the base of the stack frame + for this function. This has been allocated by ffi_call. We also + deallocate some of the stack that has been alloca'd. */ + + .align 4 + .globl ffi_call_osf + .ent ffi_call_osf + FFI_HIDDEN(ffi_call_osf) + +ffi_call_osf: + cfi_startproc + cfi_def_cfa($17, 32) + mov $16, $30 + stq $26, 0($17) + stq $15, 8($17) + mov $17, $15 + .prologue 0 + cfi_def_cfa_register($15) + cfi_rel_offset($26, 0) + cfi_rel_offset($15, 8) + + stq $18, 16($17) # save flags into frame + stq $19, 24($17) # save rvalue into frame + mov $20, $27 # fn into place for call + mov $21, $1 # closure into static chain + + # Load up all of the (potential) argument registers. + ldq $16, 0($30) + ldt $f16, 0($30) + ldt $f17, 8($30) + ldq $17, 8($30) + ldt $f18, 16($30) + ldq $18, 16($30) + ldt $f19, 24($30) + ldq $19, 24($30) + ldt $f20, 32($30) + ldq $20, 32($30) + ldt $f21, 40($30) + ldq $21, 40($30) + + # Deallocate the register argument area. + lda $30, 48($30) + + jsr $26, ($27), 0 +0: + ldah $29, 0($26) !gpdisp!1 + ldq $2, 24($15) # reload rvalue + lda $29, 0($29) !gpdisp!1 + ldq $3, 16($15) # reload flags + lda $1, 99f-0b($26) + ldq $26, 0($15) + ldq $15, 8($15) + cfi_restore($26) + cfi_restore($15) + cfi_def_cfa($sp, 0) + cmoveq $2, ALPHA_ST_VOID, $3 # mash null rvalue to void + addq $3, $3, $3 + s8addq $3, $1, $1 # 99f + stcode * 16 + jmp $31, ($1), $st_int + + .align 4 +99: +E ALPHA_ST_VOID + ret +E ALPHA_ST_INT +$st_int: + stq $0, 0($2) + ret +E ALPHA_ST_FLOAT + sts $f0, 0($2) + ret +E ALPHA_ST_DOUBLE + stt $f0, 0($2) + ret +E ALPHA_ST_CPLXF + sts $f0, 0($2) + sts $f1, 4($2) + ret +E ALPHA_ST_CPLXD + stt $f0, 0($2) + stt $f1, 8($2) + ret + + cfi_endproc + .end ffi_call_osf + +/* ffi_closure_osf(...) + + Receives the closure argument in $1. */ + +#define CLOSURE_FS (16*8) + + .align 4 + .globl ffi_go_closure_osf + .ent ffi_go_closure_osf + FFI_HIDDEN(ffi_go_closure_osf) + +ffi_go_closure_osf: + cfi_startproc + ldgp $29, 0($27) + subq $30, CLOSURE_FS, $30 + cfi_adjust_cfa_offset(CLOSURE_FS) + stq $26, 0($30) + .prologue 1 + cfi_rel_offset($26, 0) + + stq $16, 10*8($30) + stq $17, 11*8($30) + stq $18, 12*8($30) + + ldq $16, 8($1) # load cif + ldq $17, 16($1) # load fun + mov $1, $18 # closure is user_data + br $do_closure + + cfi_endproc + .end ffi_go_closure_osf + + .align 4 + .globl ffi_closure_osf + .ent ffi_closure_osf + FFI_HIDDEN(ffi_closure_osf) + +ffi_closure_osf: + cfi_startproc + ldgp $29, 0($27) + subq $30, CLOSURE_FS, $30 + cfi_adjust_cfa_offset(CLOSURE_FS) + stq $26, 0($30) + .prologue 1 + cfi_rel_offset($26, 0) + + # Store all of the potential argument registers in va_list format. + stq $16, 10*8($30) + stq $17, 11*8($30) + stq $18, 12*8($30) + + ldq $16, 24($1) # load cif + ldq $17, 32($1) # load fun + ldq $18, 40($1) # load user_data + +$do_closure: + stq $19, 13*8($30) + stq $20, 14*8($30) + stq $21, 15*8($30) + stt $f16, 4*8($30) + stt $f17, 5*8($30) + stt $f18, 6*8($30) + stt $f19, 7*8($30) + stt $f20, 8*8($30) + stt $f21, 9*8($30) + + # Call ffi_closure_osf_inner to do the bulk of the work. + lda $19, 2*8($30) + lda $20, 10*8($30) + jsr $26, ffi_closure_osf_inner +0: + ldah $29, 0($26) !gpdisp!2 + lda $2, 99f-0b($26) + s4addq $0, 0, $1 # ldcode * 4 + ldq $0, 16($30) # preload return value + s4addq $1, $2, $1 # 99f + ldcode * 16 + lda $29, 0($29) !gpdisp!2 + ldq $26, 0($30) + cfi_restore($26) + jmp $31, ($1), $load_32 + +.macro epilogue + addq $30, CLOSURE_FS, $30 + cfi_adjust_cfa_offset(-CLOSURE_FS) + ret + .align 4 + cfi_adjust_cfa_offset(CLOSURE_FS) +.endm + + .align 4 +99: +E ALPHA_LD_VOID + epilogue + +E ALPHA_LD_INT64 + epilogue + +E ALPHA_LD_INT32 +$load_32: + sextl $0, $0 + epilogue + +E ALPHA_LD_UINT16 + zapnot $0, 3, $0 + epilogue + +E ALPHA_LD_SINT16 +#ifdef __alpha_bwx__ + sextw $0, $0 +#else + sll $0, 48, $0 + sra $0, 48, $0 +#endif + epilogue + +E ALPHA_LD_UINT8 + and $0, 0xff, $0 + epilogue + +E ALPHA_LD_SINT8 +#ifdef __alpha_bwx__ + sextb $0, $0 +#else + sll $0, 56, $0 + sra $0, 56, $0 +#endif + epilogue + +E ALPHA_LD_FLOAT + lds $f0, 16($sp) + epilogue + +E ALPHA_LD_DOUBLE + ldt $f0, 16($sp) + epilogue + +E ALPHA_LD_CPLXF + lds $f0, 16($sp) + lds $f1, 20($sp) + epilogue + +E ALPHA_LD_CPLXD + ldt $f0, 16($sp) + ldt $f1, 24($sp) + epilogue + + cfi_endproc + .end ffi_closure_osf + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/arcompact.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/arcompact.S new file mode 100644 index 0000000..03715fd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/arcompact.S @@ -0,0 +1,135 @@ +/* ----------------------------------------------------------------------- + arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com) + + ARCompact Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#ifdef HAVE_MACHINE_ASM_H +#include +#else +#define CNAME(x) x +#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x): +#endif + +.text + + /* R0: ffi_prep_args */ + /* R1: &ecif */ + /* R2: cif->bytes */ + /* R3: fig->flags */ + /* R4: ecif.rvalue */ + /* R5: fn */ +ENTRY(ffi_call_ARCompact) + /* Save registers. */ + st.a fp, [sp, -4] /* fp + 20, fp */ + push_s blink /* fp + 16, blink */ + st.a r4, [sp, -4] /* fp + 12, ecif.rvalue */ + push_s r3 /* fp + 8, fig->flags */ + st.a r5, [sp, -4] /* fp + 4, fn */ + push_s r2 /* fp + 0, cif->bytes */ + mov fp, sp + + /* Make room for all of the new args. */ + sub sp, sp, r2 + + /* Place all of the ffi_prep_args in position. */ + /* ffi_prep_args(char *stack, extended_cif *ecif) */ + /* R1 already set. */ + + /* And call. */ + jl_s.d [r0] + mov_s r0, sp + + ld.ab r12, [fp, 4] /* cif->bytes */ + ld.ab r11, [fp, 4] /* fn */ + + /* Move first 8 parameters in registers... */ + ld_s r0, [sp] + ld_s r1, [sp, 4] + ld_s r2, [sp, 8] + ld_s r3, [sp, 12] + ld r4, [sp, 16] + ld r5, [sp, 20] + ld r6, [sp, 24] + ld r7, [sp, 28] + + /* ...and adjust the stack. */ + min r12, r12, 32 + + /* Call the function. */ + jl.d [r11] + add sp, sp, r12 + + mov sp, fp + pop_s r3 /* fig->flags, return type */ + pop_s r2 /* ecif.rvalue, pointer for return value */ + + /* If the return value pointer is NULL, assume no return value. */ + breq.d r2, 0, epilogue + pop_s blink + + /* Return INT. */ + brne r3, FFI_TYPE_INT, return_double + b.d epilogue + st_s r0, [r2] + +return_double: + brne r3, FFI_TYPE_DOUBLE, epilogue + st_s r0, [r2] + st_s r1, [r2,4] + +epilogue: + j_s.d [blink] + ld.ab fp, [sp, 4] + +ENTRY(ffi_closure_ARCompact) + st.a r0, [sp, -32] + st_s r1, [sp, 4] + st_s r2, [sp, 8] + st_s r3, [sp, 12] + st r4, [sp, 16] + st r5, [sp, 20] + st r6, [sp, 24] + st r7, [sp, 28] + + /* pointer to arguments */ + mov_s r2, sp + + /* return value goes here */ + sub sp, sp, 8 + mov_s r1, sp + + push_s blink + + bl.d ffi_closure_inner_ARCompact + mov_s r0, r8 /* codeloc, set by trampoline */ + + pop_s blink + + /* set return value to r1:r0 */ + pop_s r0 + pop_s r1 + j_s.d [blink] + add_s sp, sp, 32 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffi.c new file mode 100644 index 0000000..4d10b21 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffi.c @@ -0,0 +1,266 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) + + ARC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include + +#include + +/* for little endian ARC, the code is in fact stored as mixed endian for + performance reasons */ +#if __BIG_ENDIAN__ +#define CODE_ENDIAN(x) (x) +#else +#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16)) +#endif + +/* ffi_prep_args is called by the assembly routine once stack + space has been allocated for the function's arguments. */ + +void +ffi_prep_args (char *stack, extended_cif * ecif) +{ + unsigned int i; + void **p_argv; + char *argp; + ffi_type **p_arg; + + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += 4; + } + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); i--, p_arg++) + { + size_t z; + int alignment; + + /* align alignment to 4 */ + alignment = (((*p_arg)->alignment - 1) | 3) + 1; + + /* Align if necessary. */ + if ((alignment - 1) & (unsigned) argp) + argp = (char *) FFI_ALIGN (argp, alignment); + + z = (*p_arg)->size; + if (z < sizeof (int)) + { + z = sizeof (int); + + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv); + break; + + case FFI_TYPE_STRUCT: + memcpy (argp, *p_argv, (*p_arg)->size); + break; + + default: + FFI_ASSERT (0); + } + } + else if (z == sizeof (int)) + { + *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); + } + else + { + if ((*p_arg)->type == FFI_TYPE_STRUCT) + { + memcpy (argp, *p_argv, z); + } + else + { + /* Double or long long 64bit. */ + memcpy (argp, *p_argv, z); + } + } + p_argv++; + argp += z; + } + + return; +} + +/* Perform machine dependent cif processing. */ +ffi_status +ffi_prep_cif_machdep (ffi_cif * cif) +{ + /* Set the return type flag. */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_STRUCT: + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + cif->flags = FFI_TYPE_DOUBLE; + break; + + case FFI_TYPE_FLOAT: + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +extern void ffi_call_ARCompact (void (*)(char *, extended_cif *), + extended_cif *, unsigned, unsigned, + unsigned *, void (*fn) (void)); + +void +ffi_call (ffi_cif * cif, void (*fn) (void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have + a return value address then we need to make one. */ + if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca (cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_ARCOMPACT: + ffi_call_ARCompact (ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT (0); + break; + } +} + +int +ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue, + ffi_arg * args) +{ + void **arg_area, **p_argv; + ffi_cif *cif = closure->cif; + char *argp = (char *) args; + ffi_type **p_argt; + int i; + + arg_area = (void **) alloca (cif->nargs * sizeof (void *)); + + /* handle hidden argument */ + if (cif->flags == FFI_TYPE_STRUCT) + { + rvalue = *(void **) argp; + argp += 4; + } + + p_argv = arg_area; + + for (i = 0, p_argt = cif->arg_types; i < cif->nargs; + i++, p_argt++, p_argv++) + { + size_t z; + int alignment; + + /* align alignment to 4 */ + alignment = (((*p_argt)->alignment - 1) | 3) + 1; + + /* Align if necessary. */ + if ((alignment - 1) & (unsigned) argp) + argp = (char *) FFI_ALIGN (argp, alignment); + + z = (*p_argt)->size; + *p_argv = (void *) argp; + argp += z; + } + + (closure->fun) (cif, rvalue, arg_area, closure->user_data); + + return cif->flags; +} + +extern void ffi_closure_ARCompact (void); + +ffi_status +ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, void *codeloc) +{ + uint32_t *tramp = (uint32_t *) & (closure->tramp[0]); + + switch (cif->abi) + { + case FFI_ARCOMPACT: + FFI_ASSERT (tramp == codeloc); + tramp[0] = CODE_ENDIAN (0x200a1fc0); /* mov r8, pcl */ + tramp[1] = CODE_ENDIAN (0x20200f80); /* j [long imm] */ + tramp[2] = CODE_ENDIAN (ffi_closure_ARCompact); + break; + + default: + return FFI_BAD_ABI; + } + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE); + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffitarget.h new file mode 100644 index 0000000..bf8311b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arc/ffitarget.h @@ -0,0 +1,53 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) + Target configuration macros for ARC. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi +{ + FFI_FIRST_ABI = 0, + FFI_ARCOMPACT, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_ARCOMPACT +} ffi_abi; +#endif + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 12 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffi.c new file mode 100644 index 0000000..0058390 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffi.c @@ -0,0 +1,876 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2011 Timothy Wall + Copyright (c) 2011 Plausible Labs Cooperative, Inc. + Copyright (c) 2011 Anthony Green + Copyright (c) 2011 Free Software Foundation + Copyright (c) 1998, 2008, 2011 Red Hat, Inc. + + ARM Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if defined(__arm__) || defined(_M_ARM) +#include +#include +#include +#include +#include +#include "internal.h" + +#if defined(_MSC_VER) && defined(_M_ARM) +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#if FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#include +#endif + +#else +#ifndef _M_ARM +extern unsigned int ffi_arm_trampoline[2] FFI_HIDDEN; +#else +extern unsigned int ffi_arm_trampoline[3] FFI_HIDDEN; +#endif +#endif + +#if defined(__FreeBSD__) && defined(__arm__) +#include +#include +#endif + +/* Forward declares. */ +static int vfp_type_p (const ffi_type *); +static void layout_vfp_args (ffi_cif *); + +static void * +ffi_align (ffi_type *ty, void *p) +{ + /* Align if necessary */ + size_t alignment; +#ifdef _WIN32_WCE + alignment = 4; +#else + alignment = ty->alignment; + if (alignment < 4) + alignment = 4; +#endif + return (void *) FFI_ALIGN (p, alignment); +} + +static size_t +ffi_put_arg (ffi_type *ty, void *src, void *dst) +{ + size_t z = ty->size; + + switch (ty->type) + { + case FFI_TYPE_SINT8: + *(UINT32 *)dst = *(SINT8 *)src; + break; + case FFI_TYPE_UINT8: + *(UINT32 *)dst = *(UINT8 *)src; + break; + case FFI_TYPE_SINT16: + *(UINT32 *)dst = *(SINT16 *)src; + break; + case FFI_TYPE_UINT16: + *(UINT32 *)dst = *(UINT16 *)src; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: +#ifndef _MSC_VER + case FFI_TYPE_FLOAT: +#endif + *(UINT32 *)dst = *(UINT32 *)src; + break; + +#ifdef _MSC_VER + // casting a float* to a UINT32* doesn't work on Windows + case FFI_TYPE_FLOAT: + *(uintptr_t *)dst = 0; + *(float *)dst = *(float *)src; + break; +#endif + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + *(UINT64 *)dst = *(UINT64 *)src; + break; + + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + memcpy (dst, src, z); + break; + + default: + abort(); + } + + return FFI_ALIGN (z, 4); +} + +/* ffi_prep_args is called once stack space has been allocated + for the function's arguments. + + The vfp_space parameter is the load area for VFP regs, the return + value is cif->vfp_used (word bitset of VFP regs used for passing + arguments). These are only used for the VFP hard-float ABI. +*/ +static void +ffi_prep_args_SYSV (ffi_cif *cif, int flags, void *rvalue, + void **avalue, char *argp) +{ + ffi_type **arg_types = cif->arg_types; + int i, n; + + if (flags == ARM_TYPE_STRUCT) + { + *(void **) argp = rvalue; + argp += 4; + } + + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *ty = arg_types[i]; + argp = ffi_align (ty, argp); + argp += ffi_put_arg (ty, avalue[i], argp); + } +} + +static void +ffi_prep_args_VFP (ffi_cif *cif, int flags, void *rvalue, + void **avalue, char *stack, char *vfp_space) +{ + ffi_type **arg_types = cif->arg_types; + int i, n, vi = 0; + char *argp, *regp, *eo_regp; + char stack_used = 0; + char done_with_regs = 0; + + /* The first 4 words on the stack are used for values + passed in core registers. */ + regp = stack; + eo_regp = argp = regp + 16; + + /* If the function returns an FFI_TYPE_STRUCT in memory, + that address is passed in r0 to the function. */ + if (flags == ARM_TYPE_STRUCT) + { + *(void **) regp = rvalue; + regp += 4; + } + + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *ty = arg_types[i]; + void *a = avalue[i]; + int is_vfp_type = vfp_type_p (ty); + + /* Allocated in VFP registers. */ + if (vi < cif->vfp_nargs && is_vfp_type) + { + char *vfp_slot = vfp_space + cif->vfp_args[vi++] * 4; + ffi_put_arg (ty, a, vfp_slot); + continue; + } + /* Try allocating in core registers. */ + else if (!done_with_regs && !is_vfp_type) + { + char *tregp = ffi_align (ty, regp); + size_t size = ty->size; + size = (size < 4) ? 4 : size; // pad + /* Check if there is space left in the aligned register + area to place the argument. */ + if (tregp + size <= eo_regp) + { + regp = tregp + ffi_put_arg (ty, a, tregp); + done_with_regs = (regp == argp); + // ensure we did not write into the stack area + FFI_ASSERT (regp <= argp); + continue; + } + /* In case there are no arguments in the stack area yet, + the argument is passed in the remaining core registers + and on the stack. */ + else if (!stack_used) + { + stack_used = 1; + done_with_regs = 1; + argp = tregp + ffi_put_arg (ty, a, tregp); + FFI_ASSERT (eo_regp < argp); + continue; + } + } + /* Base case, arguments are passed on the stack */ + stack_used = 1; + argp = ffi_align (ty, argp); + argp += ffi_put_arg (ty, a, argp); + } +} + +/* Perform machine dependent cif processing */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep (ffi_cif *cif) +{ + int flags = 0, cabi = cif->abi; + size_t bytes = cif->bytes; + + /* Map out the register placements of VFP register args. The VFP + hard-float calling conventions are slightly more sophisticated + than the base calling conventions, so we do it here instead of + in ffi_prep_args(). */ + if (cabi == FFI_VFP) + layout_vfp_args (cif); + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + flags = ARM_TYPE_VOID; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + flags = ARM_TYPE_INT; + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + flags = ARM_TYPE_INT64; + break; + + case FFI_TYPE_FLOAT: + flags = (cabi == FFI_VFP ? ARM_TYPE_VFP_S : ARM_TYPE_INT); + break; + case FFI_TYPE_DOUBLE: + flags = (cabi == FFI_VFP ? ARM_TYPE_VFP_D : ARM_TYPE_INT64); + break; + + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + if (cabi == FFI_VFP) + { + int h = vfp_type_p (cif->rtype); + + flags = ARM_TYPE_VFP_N; + if (h == 0x100 + FFI_TYPE_FLOAT) + flags = ARM_TYPE_VFP_S; + if (h == 0x100 + FFI_TYPE_DOUBLE) + flags = ARM_TYPE_VFP_D; + if (h != 0) + break; + } + + /* A Composite Type not larger than 4 bytes is returned in r0. + A Composite Type larger than 4 bytes, or whose size cannot + be determined statically ... is stored in memory at an + address passed [in r0]. */ + if (cif->rtype->size <= 4) + flags = ARM_TYPE_INT; + else + { + flags = ARM_TYPE_STRUCT; + bytes += 4; + } + break; + + default: + abort(); + } + + /* Round the stack up to a multiple of 8 bytes. This isn't needed + everywhere, but it is on some platforms, and it doesn't harm anything + when it isn't needed. */ + bytes = FFI_ALIGN (bytes, 8); + + /* Minimum stack space is the 4 register arguments that we pop. */ + if (bytes < 4*4) + bytes = 4*4; + + cif->bytes = bytes; + cif->flags = flags; + + return FFI_OK; +} + +/* Perform machine dependent cif processing for variadic calls */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var (ffi_cif * cif, + unsigned int nfixedargs, unsigned int ntotalargs) +{ + /* VFP variadic calls actually use the SYSV ABI */ + if (cif->abi == FFI_VFP) + cif->abi = FFI_SYSV; + + return ffi_prep_cif_machdep (cif); +} + +/* Prototypes for assembly functions, in sysv.S. */ + +struct call_frame +{ + void *fp; + void *lr; + void *rvalue; + int flags; + void *closure; +}; + +extern void ffi_call_SYSV (void *stack, struct call_frame *, + void (*fn) (void)) FFI_HIDDEN; +extern void ffi_call_VFP (void *vfp_space, struct call_frame *, + void (*fn) (void), unsigned vfp_used) FFI_HIDDEN; + +static void +ffi_call_int (ffi_cif * cif, void (*fn) (void), void *rvalue, + void **avalue, void *closure) +{ + int flags = cif->flags; + ffi_type *rtype = cif->rtype; + size_t bytes, rsize, vfp_size; + char *stack, *vfp_space, *new_rvalue; + struct call_frame *frame; + + rsize = 0; + if (rvalue == NULL) + { + /* If the return value is a struct and we don't have a return + value address then we need to make one. Otherwise the return + value is in registers and we can ignore them. */ + if (flags == ARM_TYPE_STRUCT) + rsize = rtype->size; + else + flags = ARM_TYPE_VOID; + } + else if (flags == ARM_TYPE_VFP_N) + { + /* Largest case is double x 4. */ + rsize = 32; + } + else if (flags == ARM_TYPE_INT && rtype->type == FFI_TYPE_STRUCT) + rsize = 4; + + /* Largest case. */ + vfp_size = (cif->abi == FFI_VFP && cif->vfp_used ? 8*8: 0); + + bytes = cif->bytes; + stack = alloca (vfp_size + bytes + sizeof(struct call_frame) + rsize); + + vfp_space = NULL; + if (vfp_size) + { + vfp_space = stack; + stack += vfp_size; + } + + frame = (struct call_frame *)(stack + bytes); + + new_rvalue = rvalue; + if (rsize) + new_rvalue = (void *)(frame + 1); + + frame->rvalue = new_rvalue; + frame->flags = flags; + frame->closure = closure; + + if (vfp_space) + { + ffi_prep_args_VFP (cif, flags, new_rvalue, avalue, stack, vfp_space); + ffi_call_VFP (vfp_space, frame, fn, cif->vfp_used); + } + else + { + ffi_prep_args_SYSV (cif, flags, new_rvalue, avalue, stack); + ffi_call_SYSV (stack, frame, fn); + } + + if (rvalue && rvalue != new_rvalue) + memcpy (rvalue, new_rvalue, rtype->size); +} + +void +ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +#ifdef FFI_GO_CLOSURES +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} +#endif + +static void * +ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue, + char *argp, void **avalue) +{ + ffi_type **arg_types = cif->arg_types; + int i, n; + + if (cif->flags == ARM_TYPE_STRUCT) + { + rvalue = *(void **) argp; + argp += 4; + } + else + { + if (cif->rtype->size && cif->rtype->size < 4) + *(uint32_t *) rvalue = 0; + } + + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *ty = arg_types[i]; + size_t z = ty->size; + + argp = ffi_align (ty, argp); + avalue[i] = (void *) argp; + argp += z; + } + + return rvalue; +} + +static void * +ffi_prep_incoming_args_VFP (ffi_cif *cif, void *rvalue, char *stack, + char *vfp_space, void **avalue) +{ + ffi_type **arg_types = cif->arg_types; + int i, n, vi = 0; + char *argp, *regp, *eo_regp; + char done_with_regs = 0; + char stack_used = 0; + + regp = stack; + eo_regp = argp = regp + 16; + + if (cif->flags == ARM_TYPE_STRUCT) + { + rvalue = *(void **) regp; + regp += 4; + } + + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *ty = arg_types[i]; + int is_vfp_type = vfp_type_p (ty); + size_t z = ty->size; + + if (vi < cif->vfp_nargs && is_vfp_type) + { + avalue[i] = vfp_space + cif->vfp_args[vi++] * 4; + continue; + } + else if (!done_with_regs && !is_vfp_type) + { + char *tregp = ffi_align (ty, regp); + + z = (z < 4) ? 4 : z; // pad + + /* If the arguments either fits into the registers or uses registers + and stack, while we haven't read other things from the stack */ + if (tregp + z <= eo_regp || !stack_used) + { + /* Because we're little endian, this is what it turns into. */ + avalue[i] = (void *) tregp; + regp = tregp + z; + + /* If we read past the last core register, make sure we + have not read from the stack before and continue + reading after regp. */ + if (regp > eo_regp) + { + FFI_ASSERT (!stack_used); + argp = regp; + } + if (regp >= eo_regp) + { + done_with_regs = 1; + stack_used = 1; + } + continue; + } + } + + stack_used = 1; + argp = ffi_align (ty, argp); + avalue[i] = (void *) argp; + argp += z; + } + + return rvalue; +} + +struct closure_frame +{ + char vfp_space[8*8] __attribute__((aligned(8))); + char result[8*4]; + char argp[]; +}; + +int FFI_HIDDEN +ffi_closure_inner_SYSV (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + struct closure_frame *frame) +{ + void **avalue = (void **) alloca (cif->nargs * sizeof (void *)); + void *rvalue = ffi_prep_incoming_args_SYSV (cif, frame->result, + frame->argp, avalue); + fun (cif, rvalue, avalue, user_data); + return cif->flags; +} + +int FFI_HIDDEN +ffi_closure_inner_VFP (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + struct closure_frame *frame) +{ + void **avalue = (void **) alloca (cif->nargs * sizeof (void *)); + void *rvalue = ffi_prep_incoming_args_VFP (cif, frame->result, frame->argp, + frame->vfp_space, avalue); + fun (cif, rvalue, avalue, user_data); + return cif->flags; +} + +void ffi_closure_SYSV (void) FFI_HIDDEN; +void ffi_closure_VFP (void) FFI_HIDDEN; + +#ifdef FFI_GO_CLOSURES +void ffi_go_closure_SYSV (void) FFI_HIDDEN; +void ffi_go_closure_VFP (void) FFI_HIDDEN; +#endif + +/* the cif must already be prep'ed */ + +#if defined(__FreeBSD__) && defined(__arm__) +#define __clear_cache(start, end) do { \ + struct arm_sync_icache_args ua; \ + \ + ua.addr = (uintptr_t)(start); \ + ua.len = (char *)(end) - (char *)start; \ + sysarch(ARM_SYNC_ICACHE, &ua); \ + } while (0); +#endif + +ffi_status +ffi_prep_closure_loc (ffi_closure * closure, + ffi_cif * cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, void *codeloc) +{ + void (*closure_func) (void) = ffi_closure_SYSV; + + if (cif->abi == FFI_VFP) + { + /* We only need take the vfp path if there are vfp arguments. */ + if (cif->vfp_used) + closure_func = ffi_closure_VFP; + } + else if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + +#if FFI_EXEC_TRAMPOLINE_TABLE + void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); + config[0] = closure; + config[1] = closure_func; +#else + +#ifndef _M_ARM + memcpy(closure->tramp, ffi_arm_trampoline, 8); +#else + // cast away function type so MSVC doesn't set the lower bit of the function pointer + memcpy(closure->tramp, (void*)((uintptr_t)ffi_arm_trampoline & 0xFFFFFFFE), FFI_TRAMPOLINE_CLOSURE_OFFSET); +#endif + +#if defined (__QNX__) + msync(closure->tramp, 8, 0x1000000); /* clear data map */ + msync(codeloc, 8, 0x1000000); /* clear insn map */ +#elif defined(_MSC_VER) + FlushInstructionCache(GetCurrentProcess(), closure->tramp, FFI_TRAMPOLINE_SIZE); +#else + __clear_cache(closure->tramp, closure->tramp + 8); /* clear data map */ + __clear_cache(codeloc, codeloc + 8); /* clear insn map */ +#endif +#ifdef _M_ARM + *(void(**)(void))(closure->tramp + FFI_TRAMPOLINE_CLOSURE_FUNCTION) = closure_func; +#else + *(void (**)(void))(closure->tramp + 8) = closure_func; +#endif +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +#ifdef FFI_GO_CLOSURES +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *)) +{ + void (*closure_func) (void) = ffi_go_closure_SYSV; + + if (cif->abi == FFI_VFP) + { + /* We only need take the vfp path if there are vfp arguments. */ + if (cif->vfp_used) + closure_func = ffi_go_closure_VFP; + } + else if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + closure->tramp = closure_func; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} +#endif + +/* Below are routines for VFP hard-float support. */ + +/* A subroutine of vfp_type_p. Given a structure type, return the type code + of the first non-structure element. Recurse for structure elements. + Return -1 if the structure is in fact empty, i.e. no nested elements. */ + +static int +is_hfa0 (const ffi_type *ty) +{ + ffi_type **elements = ty->elements; + int i, ret = -1; + + if (elements != NULL) + for (i = 0; elements[i]; ++i) + { + ret = elements[i]->type; + if (ret == FFI_TYPE_STRUCT || ret == FFI_TYPE_COMPLEX) + { + ret = is_hfa0 (elements[i]); + if (ret < 0) + continue; + } + break; + } + + return ret; +} + +/* A subroutine of vfp_type_p. Given a structure type, return true if all + of the non-structure elements are the same as CANDIDATE. */ + +static int +is_hfa1 (const ffi_type *ty, int candidate) +{ + ffi_type **elements = ty->elements; + int i; + + if (elements != NULL) + for (i = 0; elements[i]; ++i) + { + int t = elements[i]->type; + if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) + { + if (!is_hfa1 (elements[i], candidate)) + return 0; + } + else if (t != candidate) + return 0; + } + + return 1; +} + +/* Determine if TY is an homogenous floating point aggregate (HFA). + That is, a structure consisting of 1 to 4 members of all the same type, + where that type is a floating point scalar. + + Returns non-zero iff TY is an HFA. The result is an encoded value where + bits 0-7 contain the type code, and bits 8-10 contain the element count. */ + +static int +vfp_type_p (const ffi_type *ty) +{ + ffi_type **elements; + int candidate, i; + size_t size, ele_count; + + /* Quickest tests first. */ + candidate = ty->type; + switch (ty->type) + { + default: + return 0; + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + ele_count = 1; + goto done; + case FFI_TYPE_COMPLEX: + candidate = ty->elements[0]->type; + if (candidate != FFI_TYPE_FLOAT && candidate != FFI_TYPE_DOUBLE) + return 0; + ele_count = 2; + goto done; + case FFI_TYPE_STRUCT: + break; + } + + /* No HFA types are smaller than 4 bytes, or larger than 32 bytes. */ + size = ty->size; + if (size < 4 || size > 32) + return 0; + + /* Find the type of the first non-structure member. */ + elements = ty->elements; + candidate = elements[0]->type; + if (candidate == FFI_TYPE_STRUCT || candidate == FFI_TYPE_COMPLEX) + { + for (i = 0; ; ++i) + { + candidate = is_hfa0 (elements[i]); + if (candidate >= 0) + break; + } + } + + /* If the first member is not a floating point type, it's not an HFA. + Also quickly re-check the size of the structure. */ + switch (candidate) + { + case FFI_TYPE_FLOAT: + ele_count = size / sizeof(float); + if (size != ele_count * sizeof(float)) + return 0; + break; + case FFI_TYPE_DOUBLE: + ele_count = size / sizeof(double); + if (size != ele_count * sizeof(double)) + return 0; + break; + default: + return 0; + } + if (ele_count > 4) + return 0; + + /* Finally, make sure that all scalar elements are the same type. */ + for (i = 0; elements[i]; ++i) + { + int t = elements[i]->type; + if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) + { + if (!is_hfa1 (elements[i], candidate)) + return 0; + } + else if (t != candidate) + return 0; + } + + /* All tests succeeded. Encode the result. */ + done: + return (ele_count << 8) | candidate; +} + +static int +place_vfp_arg (ffi_cif *cif, int h) +{ + unsigned short reg = cif->vfp_reg_free; + int align = 1, nregs = h >> 8; + + if ((h & 0xff) == FFI_TYPE_DOUBLE) + align = 2, nregs *= 2; + + /* Align register number. */ + if ((reg & 1) && align == 2) + reg++; + + while (reg + nregs <= 16) + { + int s, new_used = 0; + for (s = reg; s < reg + nregs; s++) + { + new_used |= (1 << s); + if (cif->vfp_used & (1 << s)) + { + reg += align; + goto next_reg; + } + } + /* Found regs to allocate. */ + cif->vfp_used |= new_used; + cif->vfp_args[cif->vfp_nargs++] = (signed char)reg; + + /* Update vfp_reg_free. */ + if (cif->vfp_used & (1 << cif->vfp_reg_free)) + { + reg += nregs; + while (cif->vfp_used & (1 << reg)) + reg += 1; + cif->vfp_reg_free = reg; + } + return 0; + next_reg:; + } + // done, mark all regs as used + cif->vfp_reg_free = 16; + cif->vfp_used = 0xFFFF; + return 1; +} + +static void +layout_vfp_args (ffi_cif * cif) +{ + unsigned int i; + /* Init VFP fields */ + cif->vfp_used = 0; + cif->vfp_nargs = 0; + cif->vfp_reg_free = 0; + memset (cif->vfp_args, -1, 16); /* Init to -1. */ + + for (i = 0; i < cif->nargs; i++) + { + int h = vfp_type_p (cif->arg_types[i]); + if (h && place_vfp_arg (cif, h) == 1) + break; + } +} + +#endif /* __arm__ or _M_ARM */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffitarget.h new file mode 100644 index 0000000..cb57b84 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/ffitarget.h @@ -0,0 +1,89 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2010 CodeSourcery + Copyright (c) 1996-2003 Red Hat, Inc. + + Target configuration macros for ARM. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_VFP, + FFI_LAST_ABI, +#if defined(__ARM_PCS_VFP) || defined(_M_ARM) + FFI_DEFAULT_ABI = FFI_VFP, +#else + FFI_DEFAULT_ABI = FFI_SYSV, +#endif +} ffi_abi; +#endif + +#define FFI_EXTRA_CIF_FIELDS \ + int vfp_used; \ + unsigned short vfp_reg_free, vfp_nargs; \ + signed char vfp_args[16] \ + +#define FFI_TARGET_SPECIFIC_VARIADIC +#ifndef _M_ARM +#define FFI_TARGET_HAS_COMPLEX_TYPE +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#define FFI_TRAMPOLINE_SIZE 12 +#define FFI_TRAMPOLINE_CLOSURE_OFFSET 8 +#else +#error "No trampoline table implementation" +#endif + +#else +#ifdef _MSC_VER +#define FFI_TRAMPOLINE_SIZE 16 +#define FFI_TRAMPOLINE_CLOSURE_FUNCTION 12 +#else +#define FFI_TRAMPOLINE_SIZE 12 +#endif +#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/internal.h new file mode 100644 index 0000000..6cf0b2a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/internal.h @@ -0,0 +1,7 @@ +#define ARM_TYPE_VFP_S 0 +#define ARM_TYPE_VFP_D 1 +#define ARM_TYPE_VFP_N 2 +#define ARM_TYPE_INT64 3 +#define ARM_TYPE_INT 4 +#define ARM_TYPE_VOID 5 +#define ARM_TYPE_STRUCT 6 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv.S new file mode 100644 index 0000000..74bc53f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv.S @@ -0,0 +1,385 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc. + Copyright (c) 2011 Plausible Labs Cooperative, Inc. + + ARM Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifdef __arm__ +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" + +/* GCC 4.8 provides __ARM_ARCH; construct it otherwise. */ +#ifndef __ARM_ARCH +# if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ + || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ + || defined(__ARM_ARCH_7EM__) +# define __ARM_ARCH 7 +# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ + || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ + || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \ + || defined(__ARM_ARCH_6M__) +# define __ARM_ARCH 6 +# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \ + || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \ + || defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH 5 +# else +# define __ARM_ARCH 4 +# endif +#endif + +/* Conditionally compile unwinder directives. */ +#ifdef __ARM_EABI__ +# define UNWIND(...) __VA_ARGS__ +#else +# define UNWIND(...) +#endif + +#if defined(HAVE_AS_CFI_PSEUDO_OP) && defined(__ARM_EABI__) + .cfi_sections .debug_frame +#endif + +#define CONCAT(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +#ifdef __USER_LABEL_PREFIX__ +# define CNAME(X) CONCAT (__USER_LABEL_PREFIX__, X) +#else +# define CNAME(X) X +#endif +#ifdef __ELF__ +# define SIZE(X) .size CNAME(X), . - CNAME(X) +# define TYPE(X, Y) .type CNAME(X), Y +#else +# define SIZE(X) +# define TYPE(X, Y) +#endif + +#define ARM_FUNC_START_LOCAL(name) \ + .align 3; \ + TYPE(CNAME(name), %function); \ + CNAME(name): + +#define ARM_FUNC_START(name) \ + .globl CNAME(name); \ + FFI_HIDDEN(CNAME(name)); \ + ARM_FUNC_START_LOCAL(name) + +#define ARM_FUNC_END(name) \ + SIZE(name) + +/* Aid in defining a jump table with 8 bytes between entries. */ +/* ??? The clang assembler doesn't handle .if with symbolic expressions. */ +#ifdef __clang__ +# define E(index) +#else +# define E(index) \ + .if . - 0b - 8*index; \ + .error "type table out of sync"; \ + .endif +#endif + + .text + .syntax unified + .arm + +#ifndef __clang__ + /* We require interworking on LDM, which implies ARMv5T, + which implies the existance of BLX. */ + .arch armv5t +#endif + + /* Note that we use STC and LDC to encode VFP instructions, + so that we do not need ".fpu vfp", nor get that added to + the object file attributes. These will not be executed + unless the FFI_VFP abi is used. */ + + @ r0: stack + @ r1: frame + @ r2: fn + @ r3: vfp_used + +ARM_FUNC_START(ffi_call_VFP) + UNWIND(.fnstart) + cfi_startproc + + cmp r3, #3 @ load only d0 if possible +#ifdef __clang__ + vldrle d0, [r0] + vldmgt r0, {d0-d7} +#else + ldcle p11, cr0, [r0] @ vldrle d0, [r0] + ldcgt p11, cr0, [r0], {16} @ vldmgt r0, {d0-d7} +#endif + add r0, r0, #64 @ discard the vfp register args + /* FALLTHRU */ +ARM_FUNC_END(ffi_call_VFP) + +ARM_FUNC_START(ffi_call_SYSV) + stm r1, {fp, lr} + mov fp, r1 + + @ This is a bit of a lie wrt the origin of the unwind info, but + @ now we've got the usual frame pointer and two saved registers. + UNWIND(.save {fp,lr}) + UNWIND(.setfp fp, sp) + cfi_def_cfa(fp, 8) + cfi_rel_offset(fp, 0) + cfi_rel_offset(lr, 4) + + mov sp, r0 @ install the stack pointer + mov lr, r2 @ move the fn pointer out of the way + ldr ip, [fp, #16] @ install the static chain + ldmia sp!, {r0-r3} @ move first 4 parameters in registers. + blx lr @ call fn + + @ Load r2 with the pointer to storage for the return value + @ Load r3 with the return type code + ldr r2, [fp, #8] + ldr r3, [fp, #12] + + @ Deallocate the stack with the arguments. + mov sp, fp + cfi_def_cfa_register(sp) + + @ Store values stored in registers. + .align 3 + add pc, pc, r3, lsl #3 + nop +0: +E(ARM_TYPE_VFP_S) +#ifdef __clang__ + vstr s0, [r2] +#else + stc p10, cr0, [r2] @ vstr s0, [r2] +#endif + pop {fp,pc} +E(ARM_TYPE_VFP_D) +#ifdef __clang__ + vstr d0, [r2] +#else + stc p11, cr0, [r2] @ vstr d0, [r2] +#endif + pop {fp,pc} +E(ARM_TYPE_VFP_N) +#ifdef __clang__ + vstm r2, {d0-d3} +#else + stc p11, cr0, [r2], {8} @ vstm r2, {d0-d3} +#endif + pop {fp,pc} +E(ARM_TYPE_INT64) + str r1, [r2, #4] + nop +E(ARM_TYPE_INT) + str r0, [r2] + pop {fp,pc} +E(ARM_TYPE_VOID) + pop {fp,pc} + nop +E(ARM_TYPE_STRUCT) + pop {fp,pc} + + cfi_endproc + UNWIND(.fnend) +ARM_FUNC_END(ffi_call_SYSV) + + +/* + int ffi_closure_inner_* (cif, fun, user_data, frame) +*/ + +ARM_FUNC_START(ffi_go_closure_SYSV) + cfi_startproc + stmdb sp!, {r0-r3} @ save argument regs + cfi_adjust_cfa_offset(16) + ldr r0, [ip, #4] @ load cif + ldr r1, [ip, #8] @ load fun + mov r2, ip @ load user_data + b 0f + cfi_endproc +ARM_FUNC_END(ffi_go_closure_SYSV) + +ARM_FUNC_START(ffi_closure_SYSV) + UNWIND(.fnstart) + cfi_startproc + stmdb sp!, {r0-r3} @ save argument regs + cfi_adjust_cfa_offset(16) + +#if FFI_EXEC_TRAMPOLINE_TABLE + ldr ip, [ip] @ ip points to the config page, dereference to get the ffi_closure* +#endif + ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] @ load cif + ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] @ load fun + ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] @ load user_data +0: + add ip, sp, #16 @ compute entry sp + sub sp, sp, #64+32 @ allocate frame + cfi_adjust_cfa_offset(64+32) + stmdb sp!, {ip,lr} + + /* Remember that EABI unwind info only applies at call sites. + We need do nothing except note the save of the stack pointer + and the link registers. */ + UNWIND(.save {sp,lr}) + cfi_adjust_cfa_offset(8) + cfi_rel_offset(lr, 4) + + add r3, sp, #8 @ load frame + bl CNAME(ffi_closure_inner_SYSV) + + @ Load values returned in registers. + add r2, sp, #8+64 @ load result + adr r3, CNAME(ffi_closure_ret) + add pc, r3, r0, lsl #3 + cfi_endproc + UNWIND(.fnend) +ARM_FUNC_END(ffi_closure_SYSV) + +ARM_FUNC_START(ffi_go_closure_VFP) + cfi_startproc + stmdb sp!, {r0-r3} @ save argument regs + cfi_adjust_cfa_offset(16) + ldr r0, [ip, #4] @ load cif + ldr r1, [ip, #8] @ load fun + mov r2, ip @ load user_data + b 0f + cfi_endproc +ARM_FUNC_END(ffi_go_closure_VFP) + +ARM_FUNC_START(ffi_closure_VFP) + UNWIND(.fnstart) + cfi_startproc + stmdb sp!, {r0-r3} @ save argument regs + cfi_adjust_cfa_offset(16) + +#if FFI_EXEC_TRAMPOLINE_TABLE + ldr ip, [ip] @ ip points to the config page, dereference to get the ffi_closure* +#endif + ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] @ load cif + ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] @ load fun + ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] @ load user_data +0: + add ip, sp, #16 + sub sp, sp, #64+32 @ allocate frame + cfi_adjust_cfa_offset(64+32) +#ifdef __clang__ + vstm sp, {d0-d7} +#else + stc p11, cr0, [sp], {16} @ vstm sp, {d0-d7} +#endif + stmdb sp!, {ip,lr} + + /* See above. */ + UNWIND(.save {sp,lr}) + cfi_adjust_cfa_offset(8) + cfi_rel_offset(lr, 4) + + add r3, sp, #8 @ load frame + bl CNAME(ffi_closure_inner_VFP) + + @ Load values returned in registers. + add r2, sp, #8+64 @ load result + adr r3, CNAME(ffi_closure_ret) + add pc, r3, r0, lsl #3 + cfi_endproc + UNWIND(.fnend) +ARM_FUNC_END(ffi_closure_VFP) + +/* Load values returned in registers for both closure entry points. + Note that we use LDM with SP in the register set. This is deprecated + by ARM, but not yet unpredictable. */ + +ARM_FUNC_START_LOCAL(ffi_closure_ret) + cfi_startproc + cfi_rel_offset(sp, 0) + cfi_rel_offset(lr, 4) +0: +E(ARM_TYPE_VFP_S) +#ifdef __clang__ + vldr s0, [r2] +#else + ldc p10, cr0, [r2] @ vldr s0, [r2] +#endif + ldm sp, {sp,pc} +E(ARM_TYPE_VFP_D) +#ifdef __clang__ + vldr d0, [r2] +#else + ldc p11, cr0, [r2] @ vldr d0, [r2] +#endif + ldm sp, {sp,pc} +E(ARM_TYPE_VFP_N) +#ifdef __clang__ + vldm r2, {d0-d3} +#else + ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} +#endif + ldm sp, {sp,pc} +E(ARM_TYPE_INT64) + ldr r1, [r2, #4] + nop +E(ARM_TYPE_INT) + ldr r0, [r2] + ldm sp, {sp,pc} +E(ARM_TYPE_VOID) + ldm sp, {sp,pc} + nop +E(ARM_TYPE_STRUCT) + ldm sp, {sp,pc} + cfi_endproc +ARM_FUNC_END(ffi_closure_ret) + +#if FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ +#include + +.align PAGE_MAX_SHIFT +ARM_FUNC_START(ffi_closure_trampoline_table_page) +.rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE + adr ip, #-PAGE_MAX_SIZE @ the config page is PAGE_MAX_SIZE behind the trampoline page + sub ip, #8 @ account for pc bias + ldr pc, [ip, #4] @ jump to ffi_closure_SYSV or ffi_closure_VFP +.endr +ARM_FUNC_END(ffi_closure_trampoline_table_page) +#endif + +#else + +ARM_FUNC_START(ffi_arm_trampoline) +0: adr ip, 0b + ldr pc, 1f +1: .long 0 +ARM_FUNC_END(ffi_arm_trampoline) + +#endif /* FFI_EXEC_TRAMPOLINE_TABLE */ +#endif /* __arm__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S new file mode 100644 index 0000000..5c99d02 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S @@ -0,0 +1,311 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc. + Copyright (c) 2011 Plausible Labs Cooperative, Inc. + Copyright (c) 2019 Microsoft Corporation. + + ARM Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" +#include "ksarm.h" + + + ; 8 byte aligned AREA to support 8 byte aligned jump tables + MACRO + NESTED_ENTRY_FFI $FuncName, $AreaName, $ExceptHandler + + ; compute the function's labels + __DeriveFunctionLabels $FuncName + + ; determine the area we will put the function into +__FuncArea SETS "|.text|" + IF "$AreaName" != "" +__FuncArea SETS "$AreaName" + ENDIF + + ; set up the exception handler itself +__FuncExceptionHandler SETS "" + IF "$ExceptHandler" != "" +__FuncExceptionHandler SETS "|$ExceptHandler|" + ENDIF + + ; switch to the specified area, jump tables require 8 byte alignment + AREA $__FuncArea,CODE,CODEALIGN,ALIGN=3,READONLY + + ; export the function name + __ExportProc $FuncName + + ; flush any pending literal pool stuff + ROUT + + ; reset the state of the unwind code tracking + __ResetUnwindState + + MEND + +; MACRO +; TABLE_ENTRY $Type, $Table +;$Type_$Table +; MEND + +#define E(index,table) return_##index##_##table + + ; r0: stack + ; r1: frame + ; r2: fn + ; r3: vfp_used + + ; fake entry point exists only to generate exists only to + ; generate .pdata for exception unwinding + NESTED_ENTRY_FFI ffi_call_VFP_fake + PROLOG_PUSH {r11, lr} ; save fp and lr for unwind + + ALTERNATE_ENTRY ffi_call_VFP + cmp r3, #3 ; load only d0 if possible + vldrle d0, [r0] + vldmgt r0, {d0-d7} + add r0, r0, #64 ; discard the vfp register args + b ffi_call_SYSV + NESTED_END ffi_call_VFP_fake + + ; fake entry point exists only to generate exists only to + ; generate .pdata for exception unwinding + NESTED_ENTRY_FFI ffi_call_SYSV_fake + PROLOG_PUSH {r11, lr} ; save fp and lr for unwind + + ALTERNATE_ENTRY ffi_call_SYSV + stm r1, {fp, lr} + mov fp, r1 + + mov sp, r0 ; install the stack pointer + mov lr, r2 ; move the fn pointer out of the way + ldr ip, [fp, #16] ; install the static chain + ldmia sp!, {r0-r3} ; move first 4 parameters in registers. + blx lr ; call fn + + ; Load r2 with the pointer to storage for the return value + ; Load r3 with the return type code + ldr r2, [fp, #8] + ldr r3, [fp, #12] + + ; Deallocate the stack with the arguments. + mov sp, fp + + ; Store values stored in registers. + ALIGN 8 + lsl r3, #3 + add r3, r3, pc + add r3, #8 + mov pc, r3 + + +E(ARM_TYPE_VFP_S, ffi_call) + ALIGN 8 + vstr s0, [r2] + pop {fp,pc} +E(ARM_TYPE_VFP_D, ffi_call) + ALIGN 8 + vstr d0, [r2] + pop {fp,pc} +E(ARM_TYPE_VFP_N, ffi_call) + ALIGN 8 + vstm r2, {d0-d3} + pop {fp,pc} +E(ARM_TYPE_INT64, ffi_call) + ALIGN 8 + str r1, [r2, #4] + nop +E(ARM_TYPE_INT, ffi_call) + ALIGN 8 + str r0, [r2] + pop {fp,pc} +E(ARM_TYPE_VOID, ffi_call) + ALIGN 8 + pop {fp,pc} + nop +E(ARM_TYPE_STRUCT, ffi_call) + ALIGN 8 + cmp r3, #ARM_TYPE_STRUCT + pop {fp,pc} + NESTED_END ffi_call_SYSV_fake + + IMPORT |ffi_closure_inner_SYSV| + /* + int ffi_closure_inner_SYSV + ( + cif, ; r0 + fun, ; r1 + user_data, ; r2 + frame ; r3 + ) + */ + + NESTED_ENTRY_FFI ffi_go_closure_SYSV + stmdb sp!, {r0-r3} ; save argument regs + ldr r0, [ip, #4] ; load cif + ldr r1, [ip, #8] ; load fun + mov r2, ip ; load user_data + b ffi_go_closure_SYSV_0 + NESTED_END ffi_go_closure_SYSV + + ; r3: ffi_closure + + ; fake entry point exists only to generate exists only to + ; generate .pdata for exception unwinding + NESTED_ENTRY_FFI ffi_closure_SYSV_fake + PROLOG_PUSH {r11, lr} ; save fp and lr for unwind + ALTERNATE_ENTRY ffi_closure_SYSV + ldmfd sp!, {ip,r0} ; restore fp (r0 is used for stack alignment) + stmdb sp!, {r0-r3} ; save argument regs + + ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] ; ffi_closure->cif + ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] ; ffi_closure->fun + ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] ; ffi_closure->user_data + + ALTERNATE_ENTRY ffi_go_closure_SYSV_0 + add ip, sp, #16 ; compute entry sp + + sub sp, sp, #64+32 ; allocate frame parameter (sizeof(vfp_space) = 64, sizeof(result) = 32) + mov r3, sp ; set frame parameter + stmdb sp!, {ip,lr} + + bl ffi_closure_inner_SYSV ; call the Python closure + + ; Load values returned in registers. + add r2, sp, #64+8 ; address of closure_frame->result + bl ffi_closure_ret ; move result to correct register or memory for type + + ldmfd sp!, {ip,lr} + mov sp, ip ; restore stack pointer + mov pc, lr + NESTED_END ffi_closure_SYSV_fake + + IMPORT |ffi_closure_inner_VFP| + /* + int ffi_closure_inner_VFP + ( + cif, ; r0 + fun, ; r1 + user_data, ; r2 + frame ; r3 + ) + */ + + NESTED_ENTRY_FFI ffi_go_closure_VFP + stmdb sp!, {r0-r3} ; save argument regs + ldr r0, [ip, #4] ; load cif + ldr r1, [ip, #8] ; load fun + mov r2, ip ; load user_data + b ffi_go_closure_VFP_0 + NESTED_END ffi_go_closure_VFP + + ; fake entry point exists only to generate exists only to + ; generate .pdata for exception unwinding + ; r3: closure + NESTED_ENTRY_FFI ffi_closure_VFP_fake + PROLOG_PUSH {r11, lr} ; save fp and lr for unwind + + ALTERNATE_ENTRY ffi_closure_VFP + ldmfd sp!, {ip,r0} ; restore fp (r0 is used for stack alignment) + stmdb sp!, {r0-r3} ; save argument regs + + ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] ; load cif + ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] ; load fun + ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] ; load user_data + + ALTERNATE_ENTRY ffi_go_closure_VFP_0 + add ip, sp, #16 ; compute entry sp + sub sp, sp, #32 ; save space for closure_frame->result + vstmdb sp!, {d0-d7} ; push closure_frame->vfp_space + + mov r3, sp ; save closure_frame + stmdb sp!, {ip,lr} + + bl ffi_closure_inner_VFP + + ; Load values returned in registers. + add r2, sp, #64+8 ; load result + bl ffi_closure_ret + ldmfd sp!, {ip,lr} + mov sp, ip ; restore stack pointer + mov pc, lr + NESTED_END ffi_closure_VFP_fake + +/* Load values returned in registers for both closure entry points. + Note that we use LDM with SP in the register set. This is deprecated + by ARM, but not yet unpredictable. */ + + NESTED_ENTRY_FFI ffi_closure_ret + stmdb sp!, {fp,lr} + + ALIGN 8 + lsl r0, #3 + add r0, r0, pc + add r0, #8 + mov pc, r0 + +E(ARM_TYPE_VFP_S, ffi_closure) + ALIGN 8 + vldr s0, [r2] + b call_epilogue +E(ARM_TYPE_VFP_D, ffi_closure) + ALIGN 8 + vldr d0, [r2] + b call_epilogue +E(ARM_TYPE_VFP_N, ffi_closure) + ALIGN 8 + vldm r2, {d0-d3} + b call_epilogue +E(ARM_TYPE_INT64, ffi_closure) + ALIGN 8 + ldr r1, [r2, #4] + nop +E(ARM_TYPE_INT, ffi_closure) + ALIGN 8 + ldr r0, [r2] + b call_epilogue +E(ARM_TYPE_VOID, ffi_closure) + ALIGN 8 + b call_epilogue + nop +E(ARM_TYPE_STRUCT, ffi_closure) + ALIGN 8 + b call_epilogue +call_epilogue + ldmfd sp!, {fp,pc} + NESTED_END ffi_closure_ret + + AREA |.trampoline|, DATA, THUMB, READONLY + EXPORT |ffi_arm_trampoline| +|ffi_arm_trampoline| DATA +thisproc adr ip, thisproc + stmdb sp!, {ip, r0} + ldr pc, [pc, #0] + DCD 0 + ;ENDP + + END \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffi.c new file mode 100644 index 0000000..3d43397 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffi.c @@ -0,0 +1,423 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2011 Anthony Green + Copyright (c) 2009 Bradley Smith + + AVR32 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include +#include +#include + +/* #define DEBUG */ + +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, + unsigned int, unsigned int, unsigned int*, unsigned int, + void (*fn)(void)); +extern void ffi_closure_SYSV (ffi_closure *); + +unsigned int pass_struct_on_stack(ffi_type *type) +{ + if(type->type != FFI_TYPE_STRUCT) + return 0; + + if(type->alignment < type->size && + !(type->size == 4 || type->size == 8) && + !(type->size == 8 && type->alignment >= 4)) + return 1; + + if(type->size == 3 || type->size == 5 || type->size == 6 || + type->size == 7) + return 1; + + return 0; +} + +/* ffi_prep_args is called by the assembly routine once stack space + * has been allocated for the function's arguments + * + * This is annoyingly complex since we need to keep track of used + * registers. + */ + +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + unsigned int i; + void **p_argv; + ffi_type **p_arg; + char *reg_base = stack; + char *stack_base = stack + 20; + unsigned int stack_offset = 0; + unsigned int reg_mask = 0; + + p_argv = ecif->avalue; + + /* If cif->flags is struct then we know it's not passed in registers */ + if(ecif->cif->flags == FFI_TYPE_STRUCT) + { + *(void**)reg_base = ecif->rvalue; + reg_mask |= 1; + } + + for(i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; + i++, p_arg++) + { + size_t z = (*p_arg)->size; + int alignment = (*p_arg)->alignment; + int type = (*p_arg)->type; + char *addr = 0; + + if(z % 4 != 0) + z += (4 - z % 4); + + if(reg_mask != 0x1f) + { + if(pass_struct_on_stack(*p_arg)) + { + addr = stack_base + stack_offset; + stack_offset += z; + } + else if(z == sizeof(int)) + { + char index = 0; + + while((reg_mask >> index) & 1) + index++; + + addr = reg_base + (index * 4); + reg_mask |= (1 << index); + } + else if(z == 2 * sizeof(int)) + { + if(!((reg_mask >> 1) & 1)) + { + addr = reg_base + 4; + reg_mask |= (3 << 1); + } + else if(!((reg_mask >> 3) & 1)) + { + addr = reg_base + 12; + reg_mask |= (3 << 3); + } + } + } + + if(!addr) + { + addr = stack_base + stack_offset; + stack_offset += z; + } + + if(type == FFI_TYPE_STRUCT && (*p_arg)->elements[1] == NULL) + type = (*p_arg)->elements[0]->type; + + switch(type) + { + case FFI_TYPE_UINT8: + *(unsigned int *)addr = (unsigned int)*(UINT8 *)(*p_argv); + break; + case FFI_TYPE_SINT8: + *(signed int *)addr = (signed int)*(SINT8 *)(*p_argv); + break; + case FFI_TYPE_UINT16: + *(unsigned int *)addr = (unsigned int)*(UINT16 *)(*p_argv); + break; + case FFI_TYPE_SINT16: + *(signed int *)addr = (signed int)*(SINT16 *)(*p_argv); + break; + default: + memcpy(addr, *p_argv, z); + } + + p_argv++; + } + +#ifdef DEBUG + /* Debugging */ + for(i = 0; i < 5; i++) + { + if((reg_mask & (1 << i)) == 0) + printf("r%d: (unused)\n", 12 - i); + else + printf("r%d: 0x%08x\n", 12 - i, ((unsigned int*)reg_base)[i]); + } + + for(i = 0; i < stack_offset / 4; i++) + { + printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack_base)[i]); + } +#endif +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Round the stack up to a multiple of 8 bytes. This isn't needed + * everywhere, but it is on some platforms, and it doesn't harm + * anything when it isn't needed. */ + cif->bytes = (cif->bytes + 7) & ~7; + + /* Flag to indicate that he return value is in fact a struct */ + cif->rstruct_flag = 0; + + /* Set the return type flag */ + switch(cif->rtype->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + cif->flags = (unsigned)FFI_TYPE_UINT8; + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + cif->flags = (unsigned)FFI_TYPE_UINT16; + break; + case FFI_TYPE_FLOAT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + cif->flags = (unsigned)FFI_TYPE_UINT32; + break; + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = (unsigned)FFI_TYPE_UINT64; + break; + case FFI_TYPE_STRUCT: + cif->rstruct_flag = 1; + if(!pass_struct_on_stack(cif->rtype)) + { + if(cif->rtype->size <= 1) + cif->flags = (unsigned)FFI_TYPE_UINT8; + else if(cif->rtype->size <= 2) + cif->flags = (unsigned)FFI_TYPE_UINT16; + else if(cif->rtype->size <= 4) + cif->flags = (unsigned)FFI_TYPE_UINT32; + else if(cif->rtype->size <= 8) + cif->flags = (unsigned)FFI_TYPE_UINT64; + else + cif->flags = (unsigned)cif->rtype->type; + } + else + cif->flags = (unsigned)cif->rtype->type; + break; + default: + cif->flags = (unsigned)cif->rtype->type; + break; + } + + return FFI_OK; +} + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + unsigned int size = 0, i = 0; + ffi_type **p_arg; + + ecif.cif = cif; + ecif.avalue = avalue; + + for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) + size += (*p_arg)->size + (4 - (*p_arg)->size % 4); + + /* If the return value is a struct and we don't have a return value + * address then we need to make one */ + + /* If cif->flags is struct then it's not suitable for registers */ + if((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT)) + ecif.rvalue = alloca(cif->rtype->size); + else + ecif.rvalue = rvalue; + + switch(cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, size, cif->flags, + ecif.rvalue, cif->rstruct_flag, fn); + break; + default: + FFI_ASSERT(0); + break; + } +} + +static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif) +{ + register unsigned int i, reg_mask = 0; + register void **p_argv; + register ffi_type **p_arg; + register char *reg_base = stack; + register char *stack_base = stack + 20; + register unsigned int stack_offset = 0; + +#ifdef DEBUG + /* Debugging */ + for(i = 0; i < cif->nargs + 7; i++) + { + printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack)[i]); + } +#endif + + /* If cif->flags is struct then we know it's not passed in registers */ + if(cif->flags == FFI_TYPE_STRUCT) + { + *rvalue = *(void **)reg_base; + reg_mask |= 1; + } + + p_argv = avalue; + + for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) + { + size_t z = (*p_arg)->size; + int alignment = (*p_arg)->alignment; + + *p_argv = 0; + + if(z % 4 != 0) + z += (4 - z % 4); + + if(reg_mask != 0x1f) + { + if(pass_struct_on_stack(*p_arg)) + { + *p_argv = (void*)stack_base + stack_offset; + stack_offset += z; + } + else if(z <= sizeof(int)) + { + char index = 0; + + while((reg_mask >> index) & 1) + index++; + + *p_argv = (void*)reg_base + (index * 4); + reg_mask |= (1 << index); + } + else if(z == 2 * sizeof(int)) + { + if(!((reg_mask >> 1) & 1)) + { + *p_argv = (void*)reg_base + 4; + reg_mask |= (3 << 1); + } + else if(!((reg_mask >> 3) & 1)) + { + *p_argv = (void*)reg_base + 12; + reg_mask |= (3 << 3); + } + } + } + + if(!*p_argv) + { + *p_argv = (void*)stack_base + stack_offset; + stack_offset += z; + } + + if((*p_arg)->type != FFI_TYPE_STRUCT || + (*p_arg)->elements[1] == NULL) + { + if(alignment == 1) + **(unsigned int**)p_argv <<= 24; + else if(alignment == 2) + **(unsigned int**)p_argv <<= 16; + } + + p_argv++; + } + +#ifdef DEBUG + /* Debugging */ + for(i = 0; i < cif->nargs; i++) + { + printf("sp+%d: 0x%08x\n", i*4, *(((unsigned int**)avalue)[i])); + } +#endif +} + +/* This function is jumped to by the trampoline */ + +unsigned int ffi_closure_SYSV_inner(ffi_closure *closure, void **respp, + void *args) +{ + ffi_cif *cif; + void **arg_area; + unsigned int i, size = 0; + ffi_type **p_arg; + + cif = closure->cif; + + for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) + size += (*p_arg)->size + (4 - (*p_arg)->size % 4); + + arg_area = (void **)alloca(size); + + /* this call will initialize ARG_AREA, such that each element in that + * array points to the corresponding value on the stack; and if the + * function returns a structure, it will re-set RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); + + (closure->fun)(cif, *respp, arg_area, closure->user_data); + + return cif->flags; +} + +ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), void *user_data, + void *codeloc) +{ + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]); + unsigned int __fun = (unsigned int)(&ffi_closure_SYSV); + unsigned int __ctx = (unsigned int)(codeloc); + unsigned int __rstruct_flag = (unsigned int)(cif->rstruct_flag); + unsigned int __inner = (unsigned int)(&ffi_closure_SYSV_inner); + *(unsigned int*) &__tramp[0] = 0xebcd1f00; /* pushm r8-r12 */ + *(unsigned int*) &__tramp[4] = 0xfefc0010; /* ld.w r12, pc[16] */ + *(unsigned int*) &__tramp[8] = 0xfefb0010; /* ld.w r11, pc[16] */ + *(unsigned int*) &__tramp[12] = 0xfefa0010; /* ld.w r10, pc[16] */ + *(unsigned int*) &__tramp[16] = 0xfeff0010; /* ld.w pc, pc[16] */ + *(unsigned int*) &__tramp[20] = __ctx; + *(unsigned int*) &__tramp[24] = __rstruct_flag; + *(unsigned int*) &__tramp[28] = __inner; + *(unsigned int*) &__tramp[32] = __fun; + syscall(__NR_cacheflush, 0, (&__tramp[0]), 36); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffitarget.h new file mode 100644 index 0000000..d0c7586 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/ffitarget.h @@ -0,0 +1,55 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2009 Bradley Smith + Target configuration macros for AVR32. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +#define FFI_EXTRA_CIF_FIELDS unsigned int rstruct_flag + +/* Definitions for closures */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 36 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/sysv.S new file mode 100644 index 0000000..a984b3c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/avr32/sysv.S @@ -0,0 +1,208 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2009 Bradley Smith + + AVR32 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + /* r12: ffi_prep_args + * r11: &ecif + * r10: size + * r9: cif->flags + * r8: ecif.rvalue + * sp+0: cif->rstruct_flag + * sp+4: fn */ + + .text + .align 1 + .globl ffi_call_SYSV + .type ffi_call_SYSV, @function +ffi_call_SYSV: + stm --sp, r0,r1,lr + stm --sp, r8-r12 + mov r0, sp + + /* Make room for all of the new args. */ + sub sp, r10 + /* Pad to make way for potential skipped registers */ + sub sp, 20 + + /* Call ffi_prep_args(stack, &ecif). */ + /* r11 already set */ + mov r1, r12 + mov r12, sp + icall r1 + + /* Save new argument size */ + mov r1, r12 + + /* Move first 5 parameters in registers. */ + ldm sp++, r8-r12 + + /* call (fn) (...). */ + ld.w r1, r0[36] + icall r1 + + /* Remove the space we pushed for the args. */ + mov sp, r0 + + /* Load r1 with the rstruct flag. */ + ld.w r1, sp[32] + + /* Load r9 with the return type code. */ + ld.w r9, sp[12] + + /* Load r8 with the return value pointer. */ + ld.w r8, sp[16] + + /* If the return value pointer is NULL, assume no return value. */ + cp.w r8, 0 + breq .Lend + + /* Check if return type is actually a struct */ + cp.w r1, 0 + breq 1f + + /* Return 8bit */ + cp.w r9, FFI_TYPE_UINT8 + breq .Lstore8 + + /* Return 16bit */ + cp.w r9, FFI_TYPE_UINT16 + breq .Lstore16 + +1: + /* Return 32bit */ + cp.w r9, FFI_TYPE_UINT32 + breq .Lstore32 + cp.w r9, FFI_TYPE_UINT16 + breq .Lstore32 + cp.w r9, FFI_TYPE_UINT8 + breq .Lstore32 + + /* Return 64bit */ + cp.w r9, FFI_TYPE_UINT64 + breq .Lstore64 + + /* Didn't match anything */ + bral .Lend + +.Lstore64: + st.w r8[0], r11 + st.w r8[4], r10 + bral .Lend + +.Lstore32: + st.w r8[0], r12 + bral .Lend + +.Lstore16: + st.h r8[0], r12 + bral .Lend + +.Lstore8: + st.b r8[0], r12 + bral .Lend + +.Lend: + sub sp, -20 + ldm sp++, r0,r1,pc + + .size ffi_call_SYSV, . - ffi_call_SYSV + + + /* r12: __ctx + * r11: __rstruct_flag + * r10: __inner */ + + .align 1 + .globl ffi_closure_SYSV + .type ffi_closure_SYSV, @function +ffi_closure_SYSV: + stm --sp, r0,lr + mov r0, r11 + mov r8, r10 + sub r10, sp, -8 + sub sp, 12 + st.w sp[8], sp + sub r11, sp, -8 + icall r8 + + /* Check if return type is actually a struct */ + cp.w r0, 0 + breq 1f + + /* Return 8bit */ + cp.w r12, FFI_TYPE_UINT8 + breq .Lget8 + + /* Return 16bit */ + cp.w r12, FFI_TYPE_UINT16 + breq .Lget16 + +1: + /* Return 32bit */ + cp.w r12, FFI_TYPE_UINT32 + breq .Lget32 + cp.w r12, FFI_TYPE_UINT16 + breq .Lget32 + cp.w r12, FFI_TYPE_UINT8 + breq .Lget32 + + /* Return 64bit */ + cp.w r12, FFI_TYPE_UINT64 + breq .Lget64 + + /* Didn't match anything */ + bral .Lclend + +.Lget64: + ld.w r11, sp[0] + ld.w r10, sp[4] + bral .Lclend + +.Lget32: + ld.w r12, sp[0] + bral .Lclend + +.Lget16: + ld.uh r12, sp[0] + bral .Lclend + +.Lget8: + ld.ub r12, sp[0] + bral .Lclend + +.Lclend: + sub sp, -12 + ldm sp++, r0,lr + sub sp, -20 + mov pc, lr + + .size ffi_closure_SYSV, . - ffi_closure_SYSV + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffi.c new file mode 100644 index 0000000..22a2acd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffi.c @@ -0,0 +1,196 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca , + Paulo Pizarro + + Blackfin Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ +#include +#include + +#include +#include + +/* Maximum number of GPRs available for argument passing. */ +#define MAX_GPRARGS 3 + +/* + * Return types + */ +#define FFIBFIN_RET_VOID 0 +#define FFIBFIN_RET_BYTE 1 +#define FFIBFIN_RET_HALFWORD 2 +#define FFIBFIN_RET_INT64 3 +#define FFIBFIN_RET_INT32 4 + +/*====================================================================*/ +/* PROTOTYPE * + /*====================================================================*/ +void ffi_prep_args(unsigned char *, extended_cif *); + +/*====================================================================*/ +/* Externals */ +/* (Assembly) */ +/*====================================================================*/ + +extern void ffi_call_SYSV(unsigned, extended_cif *, void(*)(unsigned char *, extended_cif *), unsigned, void *, void(*fn)(void)); + +/*====================================================================*/ +/* Implementation */ +/* */ +/*====================================================================*/ + + +/* + * This function calculates the return type (size) based on type. + */ + +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* --------------------------------------* + * Return handling * + * --------------------------------------*/ + switch (cif->rtype->type) { + case FFI_TYPE_VOID: + cif->flags = FFIBFIN_RET_VOID; + break; + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + cif->flags = FFIBFIN_RET_HALFWORD; + break; + case FFI_TYPE_UINT8: + cif->flags = FFIBFIN_RET_BYTE; + break; + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_POINTER: + case FFI_TYPE_SINT8: + cif->flags = FFIBFIN_RET_INT32; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + cif->flags = FFIBFIN_RET_INT64; + break; + case FFI_TYPE_STRUCT: + if (cif->rtype->size <= 4){ + cif->flags = FFIBFIN_RET_INT32; + }else if (cif->rtype->size == 8){ + cif->flags = FFIBFIN_RET_INT64; + }else{ + //it will return via a hidden pointer in P0 + cif->flags = FFIBFIN_RET_VOID; + } + break; + default: + FFI_ASSERT(0); + break; + } + return FFI_OK; +} + +/* + * This will prepare the arguments and will call the assembly routine + * cif = the call interface + * fn = the function to be called + * rvalue = the return value + * avalue = the arguments + */ +void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue) +{ + int ret_type = cif->flags; + extended_cif ecif; + ecif.cif = cif; + ecif.avalue = avalue; + ecif.rvalue = rvalue; + + switch (cif->abi) { + case FFI_SYSV: + ffi_call_SYSV(cif->bytes, &ecif, ffi_prep_args, ret_type, ecif.rvalue, fn); + break; + default: + FFI_ASSERT(0); + break; + } +} + + +/* +* This function prepares the parameters (copies them from the ecif to the stack) +* to call the function (ffi_prep_args is called by the assembly routine in file +* sysv.S, which also calls the actual function) +*/ +void ffi_prep_args(unsigned char *stack, extended_cif *ecif) +{ + register unsigned int i = 0; + void **p_argv; + unsigned char *argp; + ffi_type **p_arg; + argp = stack; + p_argv = ecif->avalue; + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); + i--, p_arg++) { + size_t z; + z = (*p_arg)->size; + if (z < sizeof(int)) { + z = sizeof(int); + switch ((*p_arg)->type) { + case FFI_TYPE_SINT8: { + signed char v = *(SINT8 *)(* p_argv); + signed int t = v; + *(signed int *) argp = t; + } + break; + case FFI_TYPE_UINT8: { + unsigned char v = *(UINT8 *)(* p_argv); + unsigned int t = v; + *(unsigned int *) argp = t; + } + break; + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) * (SINT16 *)(* p_argv); + break; + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) * (UINT16 *)(* p_argv); + break; + case FFI_TYPE_STRUCT: + memcpy(argp, *p_argv, (*p_arg)->size); + break; + default: + FFI_ASSERT(0); + break; + } + } else if (z == sizeof(int)) { + *(unsigned int *) argp = (unsigned int) * (UINT32 *)(* p_argv); + } else { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + } +} + + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffitarget.h new file mode 100644 index 0000000..2175c01 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/ffitarget.h @@ -0,0 +1,43 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2012 Alexandre K. I. de Mendonca + + Blackfin Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/sysv.S new file mode 100644 index 0000000..f4278be --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/bfin/sysv.S @@ -0,0 +1,179 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca , + Paulo Pizarro + + Blackfin Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +.text +.align 4 + + /* + There is a "feature" in the bfin toolchain that it puts a _ before function names + that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV + */ + .global _ffi_call_SYSV; + .type _ffi_call_SYSV, STT_FUNC; + .func ffi_call_SYSV + + /* + cif->bytes = R0 (fp+8) + &ecif = R1 (fp+12) + ffi_prep_args = R2 (fp+16) + ret_type = stack (fp+20) + ecif.rvalue = stack (fp+24) + fn = stack (fp+28) + got (fp+32) + + There is room for improvement here (we can use temporary registers + instead of saving the values in the memory) + REGS: + P5 => Stack pointer (function arguments) + R5 => cif->bytes + R4 => ret->type + + FP-20 = P3 + FP-16 = SP (parameters area) + FP-12 = SP (temp) + FP-08 = function return part 1 [R0] + FP-04 = function return part 2 [R1] + */ + +_ffi_call_SYSV: +.prologue: + LINK 20; + [FP-20] = P3; + [FP+8] = R0; + [FP+12] = R1; + [FP+16] = R2; + +.allocate_stack: + //alocate cif->bytes into the stack + R1 = [FP+8]; + R0 = SP; + R0 = R0 - R1; + R1 = 4; + R0 = R0 - R1; + [FP-12] = SP; + SP = R0; + [FP-16] = SP; + +.call_prep_args: + //get the addr of prep_args + P0 = [P3 + _ffi_prep_args@FUNCDESC_GOT17M4]; + P1 = [P0]; + P3 = [P0+4]; + R0 = [FP-16];//SP (parameter area) + R1 = [FP+12];//ecif + call (P1); + +.call_user_function: + //ajust SP so as to allow the user function access the parameters on the stack + SP = [FP-16]; //point to function parameters + R0 = [SP]; + R1 = [SP+4]; + R2 = [SP+8]; + //load user function address + P0 = FP; + P0 +=28; + P1 = [P0]; + P1 = [P1]; + P3 = [P0+4]; + /* + For functions returning aggregate values (struct) occupying more than 8 bytes, + the caller allocates the return value object on the stack and the address + of this object is passed to the callee as a hidden argument in register P0. + */ + P0 = [FP+24]; + + call (P1); + SP = [FP-12]; +.compute_return: + P2 = [FP-20]; + [FP-8] = R0; + [FP-4] = R1; + + R0 = [FP+20]; + R1 = R0 << 2; + + R0 = [P2+.rettable@GOT17M4]; + R0 = R1 + R0; + P2 = R0; + R1 = [P2]; + + P2 = [FP+-20]; + R0 = [P2+.rettable@GOT17M4]; + R0 = R1 + R0; + P2 = R0; + R0 = [FP-8]; + R1 = [FP-4]; + jump (P2); + +/* +#define FFIBFIN_RET_VOID 0 +#define FFIBFIN_RET_BYTE 1 +#define FFIBFIN_RET_HALFWORD 2 +#define FFIBFIN_RET_INT64 3 +#define FFIBFIN_RET_INT32 4 +*/ +.align 4 +.align 4 +.rettable: + .dd .epilogue - .rettable + .dd .rbyte - .rettable; + .dd .rhalfword - .rettable; + .dd .rint64 - .rettable; + .dd .rint32 - .rettable; + +.rbyte: + P0 = [FP+24]; + R0 = R0.B (Z); + [P0] = R0; + JUMP .epilogue +.rhalfword: + P0 = [FP+24]; + R0 = R0.L; + [P0] = R0; + JUMP .epilogue +.rint64: + P0 = [FP+24];// &rvalue + [P0] = R0; + [P0+4] = R1; + JUMP .epilogue +.rint32: + P0 = [FP+24]; + [P0] = R0; +.epilogue: + R0 = [FP+8]; + R1 = [FP+12]; + R2 = [FP+16]; + P3 = [FP-20]; + UNLINK; + RTS; + +.size _ffi_call_SYSV,.-_ffi_call_SYSV; +.endfunc diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/closures.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/closures.c new file mode 100644 index 0000000..dfc2f68 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/closures.c @@ -0,0 +1,1021 @@ +/* ----------------------------------------------------------------------- + closures.c - Copyright (c) 2019 Anthony Green + Copyright (c) 2007, 2009, 2010 Red Hat, Inc. + Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc + Copyright (c) 2011 Plausible Labs Cooperative, Inc. + + Code to allocate and deallocate memory for closures. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if defined __linux__ && !defined _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +#include +#include +#include + +#ifdef __NetBSD__ +#include +#endif + +#if __NetBSD_Version__ - 0 >= 799007200 +/* NetBSD with PROT_MPROTECT */ +#include + +#include +#include +#ifdef HAVE_SYS_MEMFD_H +#include +#endif + +static const size_t overhead = + (sizeof(max_align_t) > sizeof(void *) + sizeof(size_t)) ? + sizeof(max_align_t) + : sizeof(void *) + sizeof(size_t); + +#define ADD_TO_POINTER(p, d) ((void *)((uintptr_t)(p) + (d))) + +void * +ffi_closure_alloc (size_t size, void **code) +{ + static size_t page_size; + size_t rounded_size; + void *codeseg, *dataseg; + int prot; + + /* Expect that PAX mprotect is active and a separate code mapping is necessary. */ + if (!code) + return NULL; + + /* Obtain system page size. */ + if (!page_size) + page_size = sysconf(_SC_PAGESIZE); + + /* Round allocation size up to the next page, keeping in mind the size field and pointer to code map. */ + rounded_size = (size + overhead + page_size - 1) & ~(page_size - 1); + + /* Primary mapping is RW, but request permission to switch to PROT_EXEC later. */ + prot = PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC); + dataseg = mmap(NULL, rounded_size, prot, MAP_ANON | MAP_PRIVATE, -1, 0); + if (dataseg == MAP_FAILED) + return NULL; + + /* Create secondary mapping and switch it to RX. */ + codeseg = mremap(dataseg, rounded_size, NULL, rounded_size, MAP_REMAPDUP); + if (codeseg == MAP_FAILED) { + munmap(dataseg, rounded_size); + return NULL; + } + if (mprotect(codeseg, rounded_size, PROT_READ | PROT_EXEC) == -1) { + munmap(codeseg, rounded_size); + munmap(dataseg, rounded_size); + return NULL; + } + + /* Remember allocation size and location of the secondary mapping for ffi_closure_free. */ + memcpy(dataseg, &rounded_size, sizeof(rounded_size)); + memcpy(ADD_TO_POINTER(dataseg, sizeof(size_t)), &codeseg, sizeof(void *)); + *code = ADD_TO_POINTER(codeseg, overhead); + return ADD_TO_POINTER(dataseg, overhead); +} + +void +ffi_closure_free (void *ptr) +{ + void *codeseg, *dataseg; + size_t rounded_size; + + dataseg = ADD_TO_POINTER(ptr, -overhead); + memcpy(&rounded_size, dataseg, sizeof(rounded_size)); + memcpy(&codeseg, ADD_TO_POINTER(dataseg, sizeof(size_t)), sizeof(void *)); + munmap(dataseg, rounded_size); + munmap(codeseg, rounded_size); +} +#else /* !NetBSD with PROT_MPROTECT */ + +#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE +# if __linux__ && !defined(__ANDROID__) +/* This macro indicates it may be forbidden to map anonymous memory + with both write and execute permission. Code compiled when this + option is defined will attempt to map such pages once, but if it + fails, it falls back to creating a temporary file in a writable and + executable filesystem and mapping pages from it into separate + locations in the virtual memory space, one location writable and + another executable. */ +# define FFI_MMAP_EXEC_WRIT 1 +# define HAVE_MNTENT 1 +# endif +# if defined(_WIN32) || defined(__OS2__) +/* Windows systems may have Data Execution Protection (DEP) enabled, + which requires the use of VirtualMalloc/VirtualFree to alloc/free + executable memory. */ +# define FFI_MMAP_EXEC_WRIT 1 +# endif +#endif + +#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX +# if defined(__linux__) && !defined(__ANDROID__) +/* When defined to 1 check for SELinux and if SELinux is active, + don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that + might cause audit messages. */ +# define FFI_MMAP_EXEC_SELINUX 1 +# endif +#endif + +#if FFI_CLOSURES + +#if FFI_EXEC_TRAMPOLINE_TABLE + +#ifdef __MACH__ + +#include +#include +#ifdef HAVE_PTRAUTH +#include +#endif +#include +#include + +extern void *ffi_closure_trampoline_table_page; + +typedef struct ffi_trampoline_table ffi_trampoline_table; +typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry; + +struct ffi_trampoline_table +{ + /* contiguous writable and executable pages */ + vm_address_t config_page; + vm_address_t trampoline_page; + + /* free list tracking */ + uint16_t free_count; + ffi_trampoline_table_entry *free_list; + ffi_trampoline_table_entry *free_list_pool; + + ffi_trampoline_table *prev; + ffi_trampoline_table *next; +}; + +struct ffi_trampoline_table_entry +{ + void *(*trampoline) (void); + ffi_trampoline_table_entry *next; +}; + +/* Total number of trampolines that fit in one trampoline table */ +#define FFI_TRAMPOLINE_COUNT (PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE) + +static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER; +static ffi_trampoline_table *ffi_trampoline_tables = NULL; + +static ffi_trampoline_table * +ffi_trampoline_table_alloc (void) +{ + ffi_trampoline_table *table; + vm_address_t config_page; + vm_address_t trampoline_page; + vm_address_t trampoline_page_template; + vm_prot_t cur_prot; + vm_prot_t max_prot; + kern_return_t kt; + uint16_t i; + + /* Allocate two pages -- a config page and a placeholder page */ + config_page = 0x0; + kt = vm_allocate (mach_task_self (), &config_page, PAGE_MAX_SIZE * 2, + VM_FLAGS_ANYWHERE); + if (kt != KERN_SUCCESS) + return NULL; + + /* Remap the trampoline table on top of the placeholder page */ + trampoline_page = config_page + PAGE_MAX_SIZE; + trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page; +#ifdef __arm__ + /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */ + trampoline_page_template &= ~1UL; +#endif + kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_MAX_SIZE, 0x0, + VM_FLAGS_OVERWRITE, mach_task_self (), trampoline_page_template, + FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE); + if (kt != KERN_SUCCESS) + { + vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); + return NULL; + } + + /* We have valid trampoline and config pages */ + table = calloc (1, sizeof (ffi_trampoline_table)); + table->free_count = FFI_TRAMPOLINE_COUNT; + table->config_page = config_page; + table->trampoline_page = trampoline_page; + + /* Create and initialize the free list */ + table->free_list_pool = + calloc (FFI_TRAMPOLINE_COUNT, sizeof (ffi_trampoline_table_entry)); + + for (i = 0; i < table->free_count; i++) + { + ffi_trampoline_table_entry *entry = &table->free_list_pool[i]; + entry->trampoline = + (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); + + if (i < table->free_count - 1) + entry->next = &table->free_list_pool[i + 1]; + } + + table->free_list = table->free_list_pool; + + return table; +} + +static void +ffi_trampoline_table_free (ffi_trampoline_table *table) +{ + /* Remove from the list */ + if (table->prev != NULL) + table->prev->next = table->next; + + if (table->next != NULL) + table->next->prev = table->prev; + + /* Deallocate pages */ + vm_deallocate (mach_task_self (), table->config_page, PAGE_MAX_SIZE * 2); + + /* Deallocate free list */ + free (table->free_list_pool); + free (table); +} + +void * +ffi_closure_alloc (size_t size, void **code) +{ + /* Create the closure */ + ffi_closure *closure = malloc (size); + if (closure == NULL) + return NULL; + + pthread_mutex_lock (&ffi_trampoline_lock); + + /* Check for an active trampoline table with available entries. */ + ffi_trampoline_table *table = ffi_trampoline_tables; + if (table == NULL || table->free_list == NULL) + { + table = ffi_trampoline_table_alloc (); + if (table == NULL) + { + pthread_mutex_unlock (&ffi_trampoline_lock); + free (closure); + return NULL; + } + + /* Insert the new table at the top of the list */ + table->next = ffi_trampoline_tables; + if (table->next != NULL) + table->next->prev = table; + + ffi_trampoline_tables = table; + } + + /* Claim the free entry */ + ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list; + ffi_trampoline_tables->free_list = entry->next; + ffi_trampoline_tables->free_count--; + entry->next = NULL; + + pthread_mutex_unlock (&ffi_trampoline_lock); + + /* Initialize the return values */ + *code = entry->trampoline; +#ifdef HAVE_PTRAUTH + *code = ptrauth_sign_unauthenticated (*code, ptrauth_key_asia, 0); +#endif + closure->trampoline_table = table; + closure->trampoline_table_entry = entry; + + return closure; +} + +void +ffi_closure_free (void *ptr) +{ + ffi_closure *closure = ptr; + + pthread_mutex_lock (&ffi_trampoline_lock); + + /* Fetch the table and entry references */ + ffi_trampoline_table *table = closure->trampoline_table; + ffi_trampoline_table_entry *entry = closure->trampoline_table_entry; + + /* Return the entry to the free list */ + entry->next = table->free_list; + table->free_list = entry; + table->free_count++; + + /* If all trampolines within this table are free, and at least one other table exists, deallocate + * the table */ + if (table->free_count == FFI_TRAMPOLINE_COUNT + && ffi_trampoline_tables != table) + { + ffi_trampoline_table_free (table); + } + else if (ffi_trampoline_tables != table) + { + /* Otherwise, bump this table to the top of the list */ + table->prev = NULL; + table->next = ffi_trampoline_tables; + if (ffi_trampoline_tables != NULL) + ffi_trampoline_tables->prev = table; + + ffi_trampoline_tables = table; + } + + pthread_mutex_unlock (&ffi_trampoline_lock); + + /* Free the closure */ + free (closure); +} + +#endif + +// Per-target implementation; It's unclear what can reasonable be shared between two OS/architecture implementations. + +#elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */ + +#define USE_LOCKS 1 +#define USE_DL_PREFIX 1 +#ifdef __GNUC__ +#ifndef USE_BUILTIN_FFS +#define USE_BUILTIN_FFS 1 +#endif +#endif + +/* We need to use mmap, not sbrk. */ +#define HAVE_MORECORE 0 + +/* We could, in theory, support mremap, but it wouldn't buy us anything. */ +#define HAVE_MREMAP 0 + +/* We have no use for this, so save some code and data. */ +#define NO_MALLINFO 1 + +/* We need all allocations to be in regular segments, otherwise we + lose track of the corresponding code address. */ +#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T + +/* Don't allocate more than a page unless needed. */ +#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize) + +#include +#include +#include +#include +#ifndef _MSC_VER +#include +#endif +#include +#include +#if !defined(_WIN32) +#ifdef HAVE_MNTENT +#include +#endif /* HAVE_MNTENT */ +#include +#include + +/* We don't want sys/mman.h to be included after we redefine mmap and + dlmunmap. */ +#include +#define LACKS_SYS_MMAN_H 1 + +#if FFI_MMAP_EXEC_SELINUX +#include +#include + +static int selinux_enabled = -1; + +static int +selinux_enabled_check (void) +{ + struct statfs sfs; + FILE *f; + char *buf = NULL; + size_t len = 0; + + if (statfs ("/selinux", &sfs) >= 0 + && (unsigned int) sfs.f_type == 0xf97cff8cU) + return 1; + f = fopen ("/proc/mounts", "r"); + if (f == NULL) + return 0; + while (getline (&buf, &len, f) >= 0) + { + char *p = strchr (buf, ' '); + if (p == NULL) + break; + p = strchr (p + 1, ' '); + if (p == NULL) + break; + if (strncmp (p + 1, "selinuxfs ", 10) == 0) + { + free (buf); + fclose (f); + return 1; + } + } + free (buf); + fclose (f); + return 0; +} + +#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \ + : (selinux_enabled = selinux_enabled_check ())) + +#else + +#define is_selinux_enabled() 0 + +#endif /* !FFI_MMAP_EXEC_SELINUX */ + +/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */ +#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX +#include + +static int emutramp_enabled = -1; + +static int +emutramp_enabled_check (void) +{ + char *buf = NULL; + size_t len = 0; + FILE *f; + int ret; + f = fopen ("/proc/self/status", "r"); + if (f == NULL) + return 0; + ret = 0; + + while (getline (&buf, &len, f) != -1) + if (!strncmp (buf, "PaX:", 4)) + { + char emutramp; + if (sscanf (buf, "%*s %*c%c", &emutramp) == 1) + ret = (emutramp == 'E'); + break; + } + free (buf); + fclose (f); + return ret; +} + +#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \ + : (emutramp_enabled = emutramp_enabled_check ())) +#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +#elif defined (__CYGWIN__) || defined(__INTERIX) + +#include + +/* Cygwin is Linux-like, but not quite that Linux-like. */ +#define is_selinux_enabled() 0 + +#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */ + +#ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX +#define is_emutramp_enabled() 0 +#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +/* Declare all functions defined in dlmalloc.c as static. */ +static void *dlmalloc(size_t); +static void dlfree(void*); +static void *dlcalloc(size_t, size_t) MAYBE_UNUSED; +static void *dlrealloc(void *, size_t) MAYBE_UNUSED; +static void *dlmemalign(size_t, size_t) MAYBE_UNUSED; +static void *dlvalloc(size_t) MAYBE_UNUSED; +static int dlmallopt(int, int) MAYBE_UNUSED; +static size_t dlmalloc_footprint(void) MAYBE_UNUSED; +static size_t dlmalloc_max_footprint(void) MAYBE_UNUSED; +static void** dlindependent_calloc(size_t, size_t, void**) MAYBE_UNUSED; +static void** dlindependent_comalloc(size_t, size_t*, void**) MAYBE_UNUSED; +static void *dlpvalloc(size_t) MAYBE_UNUSED; +static int dlmalloc_trim(size_t) MAYBE_UNUSED; +static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED; +static void dlmalloc_stats(void) MAYBE_UNUSED; + +#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) +/* Use these for mmap and munmap within dlmalloc.c. */ +static void *dlmmap(void *, size_t, int, int, int, off_t); +static int dlmunmap(void *, size_t); +#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ + +#define mmap dlmmap +#define munmap dlmunmap + +#include "dlmalloc.c" + +#undef mmap +#undef munmap + +#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) + +/* A mutex used to synchronize access to *exec* variables in this file. */ +static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER; + +/* A file descriptor of a temporary file from which we'll map + executable pages. */ +static int execfd = -1; + +/* The amount of space already allocated from the temporary file. */ +static size_t execsize = 0; + +#ifdef HAVE_MEMFD_CREATE +/* Open a temporary file name, and immediately unlink it. */ +static int +open_temp_exec_file_memfd (const char *name) +{ + int fd; + fd = memfd_create (name, MFD_CLOEXEC); + return fd; +} +#endif + +/* Open a temporary file name, and immediately unlink it. */ +static int +open_temp_exec_file_name (char *name, int flags) +{ + int fd; + +#ifdef HAVE_MKOSTEMP + fd = mkostemp (name, flags); +#else + fd = mkstemp (name); +#endif + + if (fd != -1) + unlink (name); + + return fd; +} + +/* Open a temporary file in the named directory. */ +static int +open_temp_exec_file_dir (const char *dir) +{ + static const char suffix[] = "/ffiXXXXXX"; + int lendir, flags; + char *tempname; +#ifdef O_TMPFILE + int fd; +#endif + +#ifdef O_CLOEXEC + flags = O_CLOEXEC; +#else + flags = 0; +#endif + +#ifdef O_TMPFILE + fd = open (dir, flags | O_RDWR | O_EXCL | O_TMPFILE, 0700); + /* If the running system does not support the O_TMPFILE flag then retry without it. */ + if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != EOPNOTSUPP)) { + return fd; + } else { + errno = 0; + } +#endif + + lendir = (int) strlen (dir); + tempname = __builtin_alloca (lendir + sizeof (suffix)); + + if (!tempname) + return -1; + + memcpy (tempname, dir, lendir); + memcpy (tempname + lendir, suffix, sizeof (suffix)); + + return open_temp_exec_file_name (tempname, flags); +} + +/* Open a temporary file in the directory in the named environment + variable. */ +static int +open_temp_exec_file_env (const char *envvar) +{ + const char *value = getenv (envvar); + + if (!value) + return -1; + + return open_temp_exec_file_dir (value); +} + +#ifdef HAVE_MNTENT +/* Open a temporary file in an executable and writable mount point + listed in the mounts file. Subsequent calls with the same mounts + keep searching for mount points in the same file. Providing NULL + as the mounts file closes the file. */ +static int +open_temp_exec_file_mnt (const char *mounts) +{ + static const char *last_mounts; + static FILE *last_mntent; + + if (mounts != last_mounts) + { + if (last_mntent) + endmntent (last_mntent); + + last_mounts = mounts; + + if (mounts) + last_mntent = setmntent (mounts, "r"); + else + last_mntent = NULL; + } + + if (!last_mntent) + return -1; + + for (;;) + { + int fd; + struct mntent mnt; + char buf[MAXPATHLEN * 3]; + + if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)) == NULL) + return -1; + + if (hasmntopt (&mnt, "ro") + || hasmntopt (&mnt, "noexec") + || access (mnt.mnt_dir, W_OK)) + continue; + + fd = open_temp_exec_file_dir (mnt.mnt_dir); + + if (fd != -1) + return fd; + } +} +#endif /* HAVE_MNTENT */ + +/* Instructions to look for a location to hold a temporary file that + can be mapped in for execution. */ +static struct +{ + int (*func)(const char *); + const char *arg; + int repeat; +} open_temp_exec_file_opts[] = { +#ifdef HAVE_MEMFD_CREATE + { open_temp_exec_file_memfd, "libffi", 0 }, +#endif + { open_temp_exec_file_env, "TMPDIR", 0 }, + { open_temp_exec_file_dir, "/tmp", 0 }, + { open_temp_exec_file_dir, "/var/tmp", 0 }, + { open_temp_exec_file_dir, "/dev/shm", 0 }, + { open_temp_exec_file_env, "HOME", 0 }, +#ifdef HAVE_MNTENT + { open_temp_exec_file_mnt, "/etc/mtab", 1 }, + { open_temp_exec_file_mnt, "/proc/mounts", 1 }, +#endif /* HAVE_MNTENT */ +}; + +/* Current index into open_temp_exec_file_opts. */ +static int open_temp_exec_file_opts_idx = 0; + +/* Reset a current multi-call func, then advances to the next entry. + If we're at the last, go back to the first and return nonzero, + otherwise return zero. */ +static int +open_temp_exec_file_opts_next (void) +{ + if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) + open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL); + + open_temp_exec_file_opts_idx++; + if (open_temp_exec_file_opts_idx + == (sizeof (open_temp_exec_file_opts) + / sizeof (*open_temp_exec_file_opts))) + { + open_temp_exec_file_opts_idx = 0; + return 1; + } + + return 0; +} + +/* Return a file descriptor of a temporary zero-sized file in a + writable and executable filesystem. */ +static int +open_temp_exec_file (void) +{ + int fd; + + do + { + fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func + (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg); + + if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat + || fd == -1) + { + if (open_temp_exec_file_opts_next ()) + break; + } + } + while (fd == -1); + + return fd; +} + +/* We need to allocate space in a file that will be backing a writable + mapping. Several problems exist with the usual approaches: + - fallocate() is Linux-only + - posix_fallocate() is not available on all platforms + - ftruncate() does not allocate space on filesystems with sparse files + Failure to allocate the space will cause SIGBUS to be thrown when + the mapping is subsequently written to. */ +static int +allocate_space (int fd, off_t offset, off_t len) +{ + static size_t page_size; + + /* Obtain system page size. */ + if (!page_size) + page_size = sysconf(_SC_PAGESIZE); + + unsigned char buf[page_size]; + memset (buf, 0, page_size); + + while (len > 0) + { + off_t to_write = (len < page_size) ? len : page_size; + if (write (fd, buf, to_write) < to_write) + return -1; + len -= to_write; + } + + return 0; +} + +/* Map in a chunk of memory from the temporary exec file into separate + locations in the virtual memory address space, one writable and one + executable. Returns the address of the writable portion, after + storing an offset to the corresponding executable portion at the + last word of the requested chunk. */ +static void * +dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset) +{ + void *ptr; + + if (execfd == -1) + { + open_temp_exec_file_opts_idx = 0; + retry_open: + execfd = open_temp_exec_file (); + if (execfd == -1) + return MFAIL; + } + + offset = execsize; + + if (allocate_space (execfd, offset, length)) + return MFAIL; + + flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS); + flags |= MAP_SHARED; + + ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC, + flags, execfd, offset); + if (ptr == MFAIL) + { + if (!offset) + { + close (execfd); + goto retry_open; + } + if (ftruncate (execfd, offset) != 0) + { + /* Fixme : Error logs can be added here. Returning an error for + * ftruncte() will not add any advantage as it is being + * validating in the error case. */ + } + + return MFAIL; + } + else if (!offset + && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) + open_temp_exec_file_opts_next (); + + start = mmap (start, length, prot, flags, execfd, offset); + + if (start == MFAIL) + { + munmap (ptr, length); + if (ftruncate (execfd, offset) != 0) + { + /* Fixme : Error logs can be added here. Returning an error for + * ftruncte() will not add any advantage as it is being + * validating in the error case. */ + } + return start; + } + + mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start; + + execsize += length; + + return start; +} + +/* Map in a writable and executable chunk of memory if possible. + Failing that, fall back to dlmmap_locked. */ +static void * +dlmmap (void *start, size_t length, int prot, + int flags, int fd, off_t offset) +{ + void *ptr; + + assert (start == NULL && length % malloc_getpagesize == 0 + && prot == (PROT_READ | PROT_WRITE) + && flags == (MAP_PRIVATE | MAP_ANONYMOUS) + && fd == -1 && offset == 0); + + if (execfd == -1 && is_emutramp_enabled ()) + { + ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); + return ptr; + } + + if (execfd == -1 && !is_selinux_enabled ()) + { + ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); + + if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) + /* Cool, no need to mess with separate segments. */ + return ptr; + + /* If MREMAP_DUP is ever introduced and implemented, try mmap + with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with + MREMAP_DUP and prot at this point. */ + } + + if (execsize == 0 || execfd == -1) + { + pthread_mutex_lock (&open_temp_exec_file_mutex); + ptr = dlmmap_locked (start, length, prot, flags, offset); + pthread_mutex_unlock (&open_temp_exec_file_mutex); + + return ptr; + } + + return dlmmap_locked (start, length, prot, flags, offset); +} + +/* Release memory at the given address, as well as the corresponding + executable page if it's separate. */ +static int +dlmunmap (void *start, size_t length) +{ + /* We don't bother decreasing execsize or truncating the file, since + we can't quite tell whether we're unmapping the end of the file. + We don't expect frequent deallocation anyway. If we did, we + could locate pages in the file by writing to the pages being + deallocated and checking that the file contents change. + Yuck. */ + msegmentptr seg = segment_holding (gm, start); + void *code; + + if (seg && (code = add_segment_exec_offset (start, seg)) != start) + { + int ret = munmap (code, length); + if (ret) + return ret; + } + + return munmap (start, length); +} + +#if FFI_CLOSURE_FREE_CODE +/* Return segment holding given code address. */ +static msegmentptr +segment_holding_code (mstate m, char* addr) +{ + msegmentptr sp = &m->seg; + for (;;) { + if (addr >= add_segment_exec_offset (sp->base, sp) + && addr < add_segment_exec_offset (sp->base, sp) + sp->size) + return sp; + if ((sp = sp->next) == 0) + return 0; + } +} +#endif + +#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ + +/* Allocate a chunk of memory with the given size. Returns a pointer + to the writable address, and sets *CODE to the executable + corresponding virtual address. */ +void * +ffi_closure_alloc (size_t size, void **code) +{ + void *ptr; + + if (!code) + return NULL; + + ptr = FFI_CLOSURE_PTR (dlmalloc (size)); + + if (ptr) + { + msegmentptr seg = segment_holding (gm, ptr); + + *code = add_segment_exec_offset (ptr, seg); + } + + return ptr; +} + +void * +ffi_data_to_code_pointer (void *data) +{ + msegmentptr seg = segment_holding (gm, data); + /* We expect closures to be allocated with ffi_closure_alloc(), in + which case seg will be non-NULL. However, some users take on the + burden of managing this memory themselves, in which case this + we'll just return data. */ + if (seg) + return add_segment_exec_offset (data, seg); + else + return data; +} + +/* Release a chunk of memory allocated with ffi_closure_alloc. If + FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the + writable or the executable address given. Otherwise, only the + writable address can be provided here. */ +void +ffi_closure_free (void *ptr) +{ +#if FFI_CLOSURE_FREE_CODE + msegmentptr seg = segment_holding_code (gm, ptr); + + if (seg) + ptr = sub_segment_exec_offset (ptr, seg); +#endif + + dlfree (FFI_RESTORE_PTR (ptr)); +} + +# else /* ! FFI_MMAP_EXEC_WRIT */ + +/* On many systems, memory returned by malloc is writable and + executable, so just use it. */ + +#include + +void * +ffi_closure_alloc (size_t size, void **code) +{ + if (!code) + return NULL; + + return *code = FFI_CLOSURE_PTR (malloc (size)); +} + +void +ffi_closure_free (void *ptr) +{ + free (FFI_RESTORE_PTR (ptr)); +} + +void * +ffi_data_to_code_pointer (void *data) +{ + return data; +} + +# endif /* ! FFI_MMAP_EXEC_WRIT */ +#endif /* FFI_CLOSURES */ + +#endif /* NetBSD with PROT_MPROTECT */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffi.c new file mode 100644 index 0000000..9011fde --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffi.c @@ -0,0 +1,386 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 1998 Cygnus Solutions + Copyright (c) 2004 Simon Posnjak + Copyright (c) 2005 Axis Communications AB + Copyright (C) 2007 Free Software Foundation, Inc. + + CRIS Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG) + +static ffi_status +initialize_aggregate_packed_struct (ffi_type * arg) +{ + ffi_type **ptr; + + FFI_ASSERT (arg != NULL); + + FFI_ASSERT (arg->elements != NULL); + FFI_ASSERT (arg->size == 0); + FFI_ASSERT (arg->alignment == 0); + + ptr = &(arg->elements[0]); + + while ((*ptr) != NULL) + { + if (((*ptr)->size == 0) + && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + FFI_ASSERT (ffi_type_test ((*ptr))); + + arg->size += (*ptr)->size; + + arg->alignment = (arg->alignment > (*ptr)->alignment) ? + arg->alignment : (*ptr)->alignment; + + ptr++; + } + + if (arg->size == 0) + return FFI_BAD_TYPEDEF; + else + return FFI_OK; +} + +int +ffi_prep_args (char *stack, extended_cif * ecif) +{ + unsigned int i; + unsigned int struct_count = 0; + void **p_argv; + char *argp; + ffi_type **p_arg; + + argp = stack; + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); i--, p_arg++) + { + size_t z; + + switch ((*p_arg)->type) + { + case FFI_TYPE_STRUCT: + { + z = (*p_arg)->size; + if (z <= 4) + { + memcpy (argp, *p_argv, z); + z = 4; + } + else if (z <= 8) + { + memcpy (argp, *p_argv, z); + z = 8; + } + else + { + unsigned int uiLocOnStack; + z = sizeof (void *); + uiLocOnStack = 4 * ecif->cif->nargs + struct_count; + struct_count = struct_count + (*p_arg)->size; + *(unsigned int *) argp = + (unsigned int) (UINT32 *) (stack + uiLocOnStack); + memcpy ((stack + uiLocOnStack), *p_argv, (*p_arg)->size); + } + break; + } + default: + z = (*p_arg)->size; + if (z < sizeof (int)) + { + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = + (unsigned int) *(UINT8 *) (*p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = + (unsigned int) *(UINT16 *) (*p_argv); + break; + + default: + FFI_ASSERT (0); + } + z = sizeof (int); + } + else if (z == sizeof (int)) + *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); + else + memcpy (argp, *p_argv, z); + break; + } + p_argv++; + argp += z; + } + + return (struct_count); +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_core (ffi_cif * cif, + ffi_abi abi, unsigned int isvariadic, + unsigned int nfixedargs, unsigned int ntotalargs, + ffi_type * rtype, ffi_type ** atypes) +{ + unsigned bytes = 0; + unsigned int i; + ffi_type **ptr; + + FFI_ASSERT (cif != NULL); + FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); + FFI_ASSERT(nfixedargs <= ntotalargs); + FFI_ASSERT (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI); + + cif->abi = abi; + cif->arg_types = atypes; + cif->nargs = ntotalargs; + cif->rtype = rtype; + + cif->flags = 0; + + if ((cif->rtype->size == 0) + && (initialize_aggregate_packed_struct (cif->rtype) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + FFI_ASSERT_VALID_TYPE (cif->rtype); + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + if (((*ptr)->size == 0) + && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + FFI_ASSERT_VALID_TYPE (*ptr); + + if (((*ptr)->alignment - 1) & bytes) + bytes = FFI_ALIGN (bytes, (*ptr)->alignment); + if ((*ptr)->type == FFI_TYPE_STRUCT) + { + if ((*ptr)->size > 8) + { + bytes += (*ptr)->size; + bytes += sizeof (void *); + } + else + { + if ((*ptr)->size > 4) + bytes += 8; + else + bytes += 4; + } + } + else + bytes += STACK_ARG_SIZE ((*ptr)->size); + } + + cif->bytes = bytes; + + return ffi_prep_cif_machdep (cif); +} + +ffi_status +ffi_prep_cif_machdep (ffi_cif * cif) +{ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = (unsigned) cif->rtype->type; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +extern void ffi_call_SYSV (int (*)(char *, extended_cif *), + extended_cif *, + unsigned, unsigned, unsigned *, void (*fn) ()) + __attribute__ ((__visibility__ ("hidden"))); + +void +ffi_call (ffi_cif * cif, void (*fn) (), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca (cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + default: + FFI_ASSERT (0); + break; + } +} + +/* Because the following variables are not exported outside libffi, we + mark them hidden. */ + +/* Assembly code for the jump stub. */ +extern const char ffi_cris_trampoline_template[] + __attribute__ ((__visibility__ ("hidden"))); + +/* Offset into ffi_cris_trampoline_template of where to put the + ffi_prep_closure_inner function. */ +extern const int ffi_cris_trampoline_fn_offset + __attribute__ ((__visibility__ ("hidden"))); + +/* Offset into ffi_cris_trampoline_template of where to put the + closure data. */ +extern const int ffi_cris_trampoline_closure_offset + __attribute__ ((__visibility__ ("hidden"))); + +/* This function is sibling-called (jumped to) by the closure + trampoline. We get R10..R13 at PARAMS[0..3] and a copy of [SP] at + PARAMS[4] to simplify handling of a straddling parameter. A copy + of R9 is at PARAMS[5] and SP at PARAMS[6]. These parameters are + put at the appropriate place in CLOSURE which is then executed and + the return value is passed back to the caller. */ + +static unsigned long long +ffi_prep_closure_inner (void **params, ffi_closure* closure) +{ + char *register_args = (char *) params; + void *struct_ret = params[5]; + char *stack_args = params[6]; + char *ptr = register_args; + ffi_cif *cif = closure->cif; + ffi_type **arg_types = cif->arg_types; + + /* Max room needed is number of arguments as 64-bit values. */ + void **avalue = alloca (closure->cif->nargs * sizeof(void *)); + int i; + int doing_regs; + long long llret = 0; + + /* Find the address of each argument. */ + for (i = 0, doing_regs = 1; i < cif->nargs; i++) + { + /* Types up to and including 8 bytes go by-value. */ + if (arg_types[i]->size <= 4) + { + avalue[i] = ptr; + ptr += 4; + } + else if (arg_types[i]->size <= 8) + { + avalue[i] = ptr; + ptr += 8; + } + else + { + FFI_ASSERT (arg_types[i]->type == FFI_TYPE_STRUCT); + + /* Passed by-reference, so copy the pointer. */ + avalue[i] = *(void **) ptr; + ptr += 4; + } + + /* If we've handled more arguments than fit in registers, start + looking at the those passed on the stack. Step over the + first one if we had a straddling parameter. */ + if (doing_regs && ptr >= register_args + 4*4) + { + ptr = stack_args + ((ptr > register_args + 4*4) ? 4 : 0); + doing_regs = 0; + } + } + + /* Invoke the closure. */ + (closure->fun) (cif, + + cif->rtype->type == FFI_TYPE_STRUCT + /* The caller allocated space for the return + structure, and passed a pointer to this space in + R9. */ + ? struct_ret + + /* We take advantage of being able to ignore that + the high part isn't set if the return value is + not in R10:R11, but in R10 only. */ + : (void *) &llret, + + avalue, closure->user_data); + + return llret; +} + +/* API function: Prepare the trampoline. */ + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif *, void *, void **, void*), + void *user_data, + void *codeloc) +{ + void *innerfn = ffi_prep_closure_inner; + FFI_ASSERT (cif->abi == FFI_SYSV); + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + memcpy (closure->tramp, ffi_cris_trampoline_template, + FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE); + memcpy (closure->tramp + ffi_cris_trampoline_fn_offset, + &innerfn, sizeof (void *)); + memcpy (closure->tramp + ffi_cris_trampoline_closure_offset, + &codeloc, sizeof (void *)); + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffitarget.h new file mode 100644 index 0000000..b837e97 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/ffitarget.h @@ -0,0 +1,56 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for CRIS. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE 36 +#define FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE (7*4) +#define FFI_TRAMPOLINE_SIZE \ + (FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE + FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE) +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/sysv.S new file mode 100644 index 0000000..79abaee --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/cris/sysv.S @@ -0,0 +1,215 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2004 Simon Posnjak + Copyright (c) 2005 Axis Communications AB + + CRIS Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#define CONCAT(x,y) x ## y +#define XCONCAT(x,y) CONCAT (x, y) +#define L(x) XCONCAT (__USER_LABEL_PREFIX__, x) + + .text + + ;; OK, when we get called we should have this (according to + ;; AXIS ETRAX 100LX Programmer's Manual chapter 6.3). + ;; + ;; R10: ffi_prep_args (func. pointer) + ;; R11: &ecif + ;; R12: cif->bytes + ;; R13: fig->flags + ;; sp+0: ecif.rvalue + ;; sp+4: fn (function pointer to the function that we need to call) + + .globl L(ffi_call_SYSV) + .type L(ffi_call_SYSV),@function + .hidden L(ffi_call_SYSV) + +L(ffi_call_SYSV): + ;; Save the regs to the stack. + push $srp + ;; Used for stack pointer saving. + push $r6 + ;; Used for function address pointer. + push $r7 + ;; Used for stack pointer saving. + push $r8 + ;; We save fig->flags to stack we will need them after we + ;; call The Function. + push $r13 + + ;; Saving current stack pointer. + move.d $sp,$r8 + move.d $sp,$r6 + + ;; Move address of ffi_prep_args to r13. + move.d $r10,$r13 + + ;; Make room on the stack for the args of fn. + sub.d $r12,$sp + + ;; Function void ffi_prep_args(char *stack, extended_cif *ecif) parameters are: + ;; r10 <-- stack pointer + ;; r11 <-- &ecif (already there) + move.d $sp,$r10 + + ;; Call the function. + jsr $r13 + + ;; Save the size of the structures which are passed on stack. + move.d $r10,$r7 + + ;; Move first four args in to r10..r13. + move.d [$sp+0],$r10 + move.d [$sp+4],$r11 + move.d [$sp+8],$r12 + move.d [$sp+12],$r13 + + ;; Adjust the stack and check if any parameters are given on stack. + addq 16,$sp + sub.d $r7,$r6 + cmp.d $sp,$r6 + + bpl go_on + nop + +go_on_no_params_on_stack: + move.d $r6,$sp + +go_on: + ;; Discover if we need to put rval address in to r9. + move.d [$r8+0],$r7 + cmpq FFI_TYPE_STRUCT,$r7 + bne call_now + nop + + ;; Move rval address to $r9. + move.d [$r8+20],$r9 + +call_now: + ;; Move address of The Function in to r7. + move.d [$r8+24],$r7 + + ;; Call The Function. + jsr $r7 + + ;; Reset stack. + move.d $r8,$sp + + ;; Load rval type (fig->flags) in to r13. + pop $r13 + + ;; Detect rval type. + cmpq FFI_TYPE_VOID,$r13 + beq epilogue + + cmpq FFI_TYPE_STRUCT,$r13 + beq epilogue + + cmpq FFI_TYPE_DOUBLE,$r13 + beq return_double_or_longlong + + cmpq FFI_TYPE_UINT64,$r13 + beq return_double_or_longlong + + cmpq FFI_TYPE_SINT64,$r13 + beq return_double_or_longlong + nop + + ;; Just return the 32 bit value. + ba return + nop + +return_double_or_longlong: + ;; Load half of the rval to r10 and the other half to r11. + move.d [$sp+16],$r13 + move.d $r10,[$r13] + addq 4,$r13 + move.d $r11,[$r13] + ba epilogue + nop + +return: + ;; Load the rval to r10. + move.d [$sp+16],$r13 + move.d $r10,[$r13] + +epilogue: + pop $r8 + pop $r7 + pop $r6 + Jump [$sp+] + + .size ffi_call_SYSV,.-ffi_call_SYSV + +/* Save R10..R13 into an array, somewhat like varargs. Copy the next + argument too, to simplify handling of any straddling parameter. + Save R9 and SP after those. Jump to function handling the rest. + Since this is a template, copied and the main function filled in by + the user. */ + + .globl L(ffi_cris_trampoline_template) + .type L(ffi_cris_trampoline_template),@function + .hidden L(ffi_cris_trampoline_template) + +L(ffi_cris_trampoline_template): +0: + /* The value we get for "PC" is right after the prefix instruction, + two bytes from the beginning, i.e. 0b+2. */ + move.d $r10,[$pc+2f-(0b+2)] + move.d $pc,$r10 +1: + addq 2f-1b+4,$r10 + move.d $r11,[$r10+] + move.d $r12,[$r10+] + move.d $r13,[$r10+] + move.d [$sp],$r11 + move.d $r11,[$r10+] + move.d $r9,[$r10+] + move.d $sp,[$r10+] + subq FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE,$r10 + move.d 0,$r11 +3: + jump 0 +2: + .size ffi_cris_trampoline_template,.-0b + +/* This macro create a constant usable as "extern const int \name" in + C from within libffi, when \name has no prefix decoration. */ + + .macro const name,value + .globl \name + .type \name,@object + .hidden \name +\name: + .dword \value + .size \name,4 + .endm + +/* Constants for offsets within the trampoline. We could do this with + just symbols, avoiding memory contents and memory accesses, but the + C usage code would look a bit stranger. */ + + const L(ffi_cris_trampoline_fn_offset),2b-4-0b + const L(ffi_cris_trampoline_closure_offset),3b-4-0b diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffi.c new file mode 100644 index 0000000..af50b7c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffi.c @@ -0,0 +1,395 @@ +/* ----------------------------------------------------------------------- + ffi.c + + CSKY Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments +*/ +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { + *(void **) argp = ecif->rvalue; + argp += 4; + } + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); + i--, p_arg++) + { + size_t z; + size_t alignment; + + /* Align if necessary */ + alignment = (*p_arg)->alignment; +#ifdef __CSKYABIV1__ + /* + * Adapt ABIV1 bug. + * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. + */ + if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { + alignment = 4; + } +#endif + + if ((alignment - 1) & (unsigned) argp) { + argp = (char *) FFI_ALIGN(argp, alignment); + } + + if ((*p_arg)->type == FFI_TYPE_STRUCT) + argp = (char *) FFI_ALIGN(argp, 4); + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: +#ifdef __CSKYBE__ + memcpy((argp + 4 - (*p_arg)->size), *p_argv, (*p_arg)->size); +#else + memcpy(argp, *p_argv, (*p_arg)->size); +#endif + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof(int)) + { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + } + + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Round the stack up to a multiple of 8 bytes. This isn't needed + everywhere, but it is on some platforms, and it doesn't hcsky anything + when it isn't needed. */ + cif->bytes = (cif->bytes + 7) & ~7; + + /* Set the return type flag */ + switch (cif->rtype->type) + { + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = (unsigned) FFI_TYPE_SINT64; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->size <= 4) + /* A Composite Type not larger than 4 bytes is returned in r0. */ + cif->flags = (unsigned)FFI_TYPE_INT; + else if (cif->rtype->size <= 8) + /* A Composite Type not larger than 8 bytes is returned in r0, r1. */ + cif->flags = (unsigned)FFI_TYPE_SINT64; + else + /* A Composite Type larger than 8 bytes, or whose size cannot + be determined statically ... is stored in memory at an + address passed [in r0]. */ + cif->flags = (unsigned)FFI_TYPE_STRUCT; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +/* Perform machine dependent cif processing for variadic calls */ +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned int nfixedargs, + unsigned int ntotalargs) +{ + return ffi_prep_cif_machdep(cif); +} + +/* Prototypes for assembly functions, in sysv.S */ +extern void ffi_call_SYSV (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *); + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + int small_struct = (cif->flags == FFI_TYPE_INT + && cif->rtype->type == FFI_TYPE_STRUCT); + + ecif.cif = cif; + ecif.avalue = avalue; + + unsigned int temp; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->flags == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else if (small_struct) + ecif.rvalue = &temp; + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); + break; + + default: + FFI_ASSERT(0); + break; + } + if (small_struct) +#ifdef __CSKYBE__ + memcpy (rvalue, ((unsigned char *)&temp + (4 - cif->rtype->size)), cif->rtype->size); +#else + memcpy (rvalue, &temp, cif->rtype->size); +#endif +} + +/** private members **/ + +static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif); + +void ffi_closure_SYSV (ffi_closure *); + +/* This function is jumped to by the trampoline */ + +unsigned int +ffi_closure_SYSV_inner (closure, respp, args) + ffi_closure *closure; + void **respp; + void *args; +{ + // our various things... + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); + + (closure->fun) (cif, *respp, arg_area, closure->user_data); + +#ifdef __CSKYBE__ + if (cif->flags == FFI_TYPE_INT && cif->rtype->type == FFI_TYPE_STRUCT) { + unsigned int tmp = 0; + tmp = *(unsigned int *)(*respp); + *(unsigned int *)(*respp) = (tmp >> ((4 - cif->rtype->size) * 8)); + } +#endif + + return cif->flags; +} + + +static void +ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if ( cif->flags == FFI_TYPE_STRUCT ) { + *rvalue = *(void **) argp; + argp += 4; + } + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + size_t alignment; + + alignment = (*p_arg)->alignment; + if (alignment < 4) + alignment = 4; + +#ifdef __CSKYABIV1__ + /* + * Adapt ABIV1 bug. + * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. + */ + if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { + alignment = 4; + } +#endif + + /* Align if necessary */ + if ((alignment - 1) & (unsigned) argp) { + argp = (char *) FFI_ALIGN(argp, alignment); + } + + z = (*p_arg)->size; + +#ifdef __CSKYBE__ + unsigned int tmp = 0; + if ((*p_arg)->size < 4) { + tmp = *(unsigned int *)argp; + memcpy(argp, ((unsigned char *)&tmp + (4 - (*p_arg)->size)), (*p_arg)->size); + } +#else + /* because we're little endian, this is what it turns into. */ +#endif + *p_argv = (void*) argp; + + p_argv++; + argp += z; + } + + return; +} + +/* How to make a trampoline. */ + +extern unsigned char ffi_csky_trampoline[TRAMPOLINE_SIZE]; + +/* + * Since there is no __clear_cache in libgcc in csky toolchain. + * define ffi_csky_cacheflush in sysv.S. + * void ffi_csky_cacheflush(uint32 start_addr, uint32 size, int cache) + */ +#define CACHEFLUSH_IN_FFI 1 +#if CACHEFLUSH_IN_FFI +extern void ffi_csky_cacheflush(unsigned char *__tramp, unsigned int k, + int i); +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned char *insns = (unsigned char *)(CTX); \ + memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ + ffi_csky_cacheflush(&__tramp[0], TRAMPOLINE_SIZE, 3); /* Clear data mapping. */ \ + ffi_csky_cacheflush(insns, TRAMPOLINE_SIZE, 3); \ + /* Clear instruction \ + mapping. */ \ + }) +#else +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned char *insns = (unsigned char *)(CTX); \ + memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ + __clear_cache((&__tramp[0]), (&__tramp[TRAMPOLINE_SIZE-1])); /* Clear data mapping. */ \ + __clear_cache(insns, insns + TRAMPOLINE_SIZE); \ + /* Clear instruction \ + mapping. */ \ + }) +#endif + +/* the cif must already be prep'ed */ + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + void (*closure_func)(ffi_closure*) = NULL; + + if (cif->abi == FFI_SYSV) + closure_func = &ffi_closure_SYSV; + else + return FFI_BAD_ABI; + + FFI_INIT_TRAMPOLINE (&closure->tramp[0], \ + closure_func, \ + codeloc); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffitarget.h new file mode 100644 index 0000000..f770aac --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/ffitarget.h @@ -0,0 +1,63 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2010 CodeSourcery + Copyright (c) 1996-2003 Red Hat, Inc. + + Target configuration macros for CSKY. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV, +} ffi_abi; +#endif + +#ifdef __CSKYABIV2__ +#define FFI_ASM_ARGREG_SIZE 16 +#define TRAMPOLINE_SIZE 16 +#define FFI_TRAMPOLINE_SIZE 24 +#else +#define FFI_ASM_ARGREG_SIZE 24 +#define TRAMPOLINE_SIZE 20 +#define FFI_TRAMPOLINE_SIZE 28 +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/sysv.S new file mode 100644 index 0000000..21670bf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/csky/sysv.S @@ -0,0 +1,371 @@ +/* ----------------------------------------------------------------------- + sysv.S + + CSKY Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +.macro CSKY_FUNC_START name + .text + .align 2 + .globl \name + .type \name, @function + \name: +.endm + +#ifdef __CSKYABIV2__ + + /* + * a0: fn + * a1: &ecif + * a2: cif->bytes + * a3: fig->flags + * sp+0: ecif.rvalue + */ +CSKY_FUNC_START ffi_call_SYSV + /* Save registers */ + .cfi_startproc + subi sp, 28 + .cfi_def_cfa_offset 28 + stw a0, (sp, 0x0) + .cfi_offset 0, -28 + stw a1, (sp, 0x4) + .cfi_offset 1, -24 + stw a2, (sp, 0x8) + .cfi_offset 2, -20 + stw a3, (sp, 0xC) + .cfi_offset 3, -16 + stw l0, (sp, 0x10) + .cfi_offset 4, -12 + stw l1, (sp, 0x14) + .cfi_offset 5, -8 + stw lr, (sp, 0x18) + .cfi_offset 15, -4 + + mov l0, sp + .cfi_def_cfa_register 4 + + /* Make room for all of the new args. */ + subu sp, sp, a2 + + /* Place all of the ffi_prep_args in position */ + mov a0, sp + /* a1 already set */ + + /* Call ffi_prep_args(stack, &ecif) */ + jsri ffi_prep_args + + /* move first 4 parameters in registers */ + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + + /* and adjust stack */ + subu lr, l0, sp /* cif->bytes == l0 - sp */ + cmphsi lr, 16 + movi l1, 16 + movt lr, l1 + addu sp, sp, lr + + ldw l1, (l0, 0) /* load fn() in advance */ + + /* call (fn) (...) */ + jsr l1 + + /* Remove the space we pushed for the args */ + mov sp, l0 + + /* Load r2 with the pointer to storage for the return value */ + ldw a2, (sp, 0x1C) + + /* Load r3 with the return type code */ + ldw a3, (sp, 0xC) + + /* If the return value pointer is NULL, assume no return value. */ + cmpnei a2, 0 + bf .Lepilogue + + cmpnei a3, FFI_TYPE_STRUCT + bf .Lepilogue + + /* return INT64 */ + cmpnei a3, FFI_TYPE_SINT64 + bt .Lretint + /* stw a0, (a2, 0x0) at .Lretint */ + stw a1, (a2, 0x4) + +.Lretint: + /* return INT */ + stw a0, (a2, 0x0) + +.Lepilogue: + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw l0, (sp, 0x10) + ldw l1, (sp, 0x14) + ldw lr, (sp, 0x18) + addi sp, sp, 28 + rts + .cfi_endproc + .size ffi_call_SYSV, .-ffi_call_SYSV + + + /* + * unsigned int FFI_HIDDEN + * ffi_closure_SYSV_inner (closure, respp, args) + * ffi_closure *closure; + * void **respp; + * void *args; + */ +CSKY_FUNC_START ffi_closure_SYSV + .cfi_startproc + mov a2, sp + addi a1, sp, 16 + subi sp, sp, 24 + .cfi_def_cfa_offset 40 + stw a1, (sp, 0x10) + .cfi_offset 1, -24 + stw lr, (sp, 0x14) + .cfi_offset 15, -20 + stw sp, (sp, 0x8) + addi a1, sp, 8 + jsri ffi_closure_SYSV_inner + ldw a0, (sp, 0x0) + /* + * if FFI_TYPE_SINT64, need a1. + * if FFI_TYPE_INT, ignore a1. + */ + ldw a1, (sp, 0x4) + + ldw lr, (sp, 0x14) + addi sp, sp, 40 + rts + .cfi_endproc + .size ffi_closure_SYSV, .-ffi_closure_SYSV + +CSKY_FUNC_START ffi_csky_trampoline + subi sp, sp, 16 + stw a0, (sp, 0x0) + stw a1, (sp, 0x4) + stw a2, (sp, 0x8) + stw a3, (sp, 0xC) + lrw a0, [.Lctx] + lrw a1, [.Lfun] + jmp a1 +.Lctx: + mov a0, a0 + mov a0, a0 +.Lfun: + + .size ffi_csky_trampoline, .-ffi_csky_trampoline + +CSKY_FUNC_START ffi_csky_cacheflush + mov t0, r7 + movi r7, 123 + trap 0 + mov r7, t0 + rts + + .size ffi_csky_cacheflush, .-ffi_csky_cacheflush + +#else /* !__CSKYABIV2__ */ + + /* + * a0: fn + * a1: &ecif + * a2: cif->bytes + * a3: fig->flags + * a4: ecif.rvalue + */ +CSKY_FUNC_START ffi_call_SYSV + /* Save registers */ + .cfi_startproc + subi sp, 32 + subi sp, 8 + .cfi_def_cfa_offset 40 + stw a0, (sp, 0x0) + .cfi_offset 2, -40 + stw a1, (sp, 0x4) + .cfi_offset 3, -36 + stw a2, (sp, 0x8) + .cfi_offset 4, -32 + stw a3, (sp, 0xC) + .cfi_offset 5, -28 + stw a4, (sp, 0x10) + .cfi_offset 6, -24 + stw a5, (sp, 0x14) + .cfi_offset 7, -20 + stw l0, (sp, 0x18) + .cfi_offset 8, -16 + stw l1, (sp, 0x1C) + .cfi_offset 9, -12 + stw lr, (sp, 0x20) + .cfi_offset 15, -8 + + mov l0, sp + .cfi_def_cfa_register 8 + + /* Make room for all of the new args. */ + subu sp, sp, a2 + + /* Place all of the ffi_prep_args in position */ + mov a0, sp + /* a1 already set */ + + /* Call ffi_prep_args(stack, &ecif) */ + jsri ffi_prep_args + + /* move first 4 parameters in registers */ + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw a4, (sp, 0x10) + ldw a5, (sp, 0x14) + + /* and adjust stack */ + mov lr, l0 + subu lr, sp /* cif->bytes == l0 - sp */ + movi l1, 24 + cmphs lr, l1 + movt lr, l1 + addu sp, sp, lr + + ldw l1, (l0, 0) /* load fn() in advance */ + + /* call (fn) (...) */ + jsr l1 + + /* Remove the space we pushed for the args */ + mov sp, l0 + + /* Load r2 with the pointer to storage for the return value */ + ldw a2, (sp, 0x10) + + /* Load r3 with the return type code */ + ldw a3, (sp, 0xC) + + /* If the return value pointer is NULL, assume no return value. */ + cmpnei a2, 0 + bf .Lepilogue + + cmpnei a3, FFI_TYPE_STRUCT + bf .Lepilogue + + /* return INT64 */ + cmpnei a3, FFI_TYPE_SINT64 + bt .Lretint + /* stw a0, (a2, 0x0) at .Lretint */ + stw a1, (a2, 0x4) + +.Lretint: + /* return INT */ + stw a0, (a2, 0x0) + +.Lepilogue: + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw a4, (sp, 0x10) + ldw a5, (sp, 0x14) + ldw l0, (sp, 0x18) + ldw l1, (sp, 0x1C) + ldw lr, (sp, 0x20) + addi sp, sp, 32 + addi sp, sp, 8 + rts + .cfi_endproc + + .size ffi_call_SYSV, .-ffi_call_SYSV + + + /* + * unsigned int FFI_HIDDEN + * ffi_closure_SYSV_inner (closure, respp, args) + * ffi_closure *closure; + * void **respp; + * void *args; + */ +CSKY_FUNC_START ffi_closure_SYSV + .cfi_startproc + mov a2, sp + mov a1, sp + addi a1, 24 + subi sp, sp, 24 + .cfi_def_cfa_offset 48 + stw a1, (sp, 0x10) + .cfi_offset 3, -32 + stw lr, (sp, 0x14) + .cfi_offset 15, -28 + stw sp, (sp, 0x8) + mov a1, sp + addi a1, 8 + jsri ffi_closure_SYSV_inner + ldw a0, (sp, 0x0) + /* + * if FFI_TYPE_SINT64, need a1. + * if FFI_TYPE_INT, ignore a1. + */ + ldw a1, (sp, 0x4) + + ldw lr, (sp, 0x14) + addi sp, sp, 24 + addi sp, sp, 24 + rts + .cfi_endproc + + .size ffi_closure_SYSV, .-ffi_closure_SYSV + +CSKY_FUNC_START ffi_csky_trampoline + subi sp, 24 + stw a0, (sp, 0x0) + stw a1, (sp, 0x4) + stw a2, (sp, 0x8) + stw a3, (sp, 0xC) + stw a4, (sp, 0x10) + stw a5, (sp, 0x14) + lrw a0, [.Lctx] + lrw a1, [.Lfun] + jmp a1 +.Lctx: + mov a0, a0 + mov a0, a0 +.Lfun: + + .size ffi_csky_trampoline, .-ffi_csky_trampoline + +CSKY_FUNC_START ffi_csky_cacheflush + lrw r1, 123 + trap 0 + rts + + .size ffi_csky_cacheflush, .-ffi_csky_cacheflush + +#endif /* __CSKYABIV2__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/debug.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/debug.c new file mode 100644 index 0000000..f3172b1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/debug.c @@ -0,0 +1,64 @@ +/* ----------------------------------------------------------------------- + debug.c - Copyright (c) 1996 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include +#include + +/* General debugging routines */ + +void ffi_stop_here(void) +{ + /* This function is only useful for debugging purposes. + Place a breakpoint on ffi_stop_here to be notified of + significant events. */ +} + +/* This function should only be called via the FFI_ASSERT() macro */ + +void ffi_assert(char *expr, char *file, int line) +{ + fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line); + ffi_stop_here(); + abort(); +} + +/* Perform a sanity check on an ffi_type structure */ + +void ffi_type_test(ffi_type *a, char *file, int line) +{ + FFI_ASSERT_AT(a != NULL, file, line); + + FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line); + FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line); + FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line); + FFI_ASSERT_AT((a->type != FFI_TYPE_STRUCT && a->type != FFI_TYPE_COMPLEX) + || a->elements != NULL, file, line); + FFI_ASSERT_AT(a->type != FFI_TYPE_COMPLEX + || (a->elements != NULL + && a->elements[0] != NULL && a->elements[1] == NULL), + file, line); + +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/dlmalloc.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/dlmalloc.c new file mode 100644 index 0000000..1aba657 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/dlmalloc.c @@ -0,0 +1,5166 @@ +/* + This is a version (aka dlmalloc) of malloc/free/realloc written by + Doug Lea and released to the public domain, as explained at + http://creativecommons.org/licenses/publicdomain. Send questions, + comments, complaints, performance data, etc to dl@cs.oswego.edu + +* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee) + + Note: There may be an updated version of this malloc obtainable at + ftp://gee.cs.oswego.edu/pub/misc/malloc.c + Check before installing! + +* Quickstart + + This library is all in one file to simplify the most common usage: + ftp it, compile it (-O3), and link it into another program. All of + the compile-time options default to reasonable values for use on + most platforms. You might later want to step through various + compile-time and dynamic tuning options. + + For convenience, an include file for code using this malloc is at: + ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h + You don't really need this .h file unless you call functions not + defined in your system include files. The .h file contains only the + excerpts from this file needed for using this malloc on ANSI C/C++ + systems, so long as you haven't changed compile-time options about + naming and tuning parameters. If you do, then you can create your + own malloc.h that does include all settings by cutting at the point + indicated below. Note that you may already by default be using a C + library containing a malloc that is based on some version of this + malloc (for example in linux). You might still want to use the one + in this file to customize settings or to avoid overheads associated + with library versions. + +* Vital statistics: + + Supported pointer/size_t representation: 4 or 8 bytes + size_t MUST be an unsigned type of the same width as + pointers. (If you are using an ancient system that declares + size_t as a signed type, or need it to be a different width + than pointers, you can use a previous release of this malloc + (e.g. 2.7.2) supporting these.) + + Alignment: 8 bytes (default) + This suffices for nearly all current machines and C compilers. + However, you can define MALLOC_ALIGNMENT to be wider than this + if necessary (up to 128bytes), at the expense of using more space. + + Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes) + 8 or 16 bytes (if 8byte sizes) + Each malloced chunk has a hidden word of overhead holding size + and status information, and additional cross-check word + if FOOTERS is defined. + + Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead) + 8-byte ptrs: 32 bytes (including overhead) + + Even a request for zero bytes (i.e., malloc(0)) returns a + pointer to something of the minimum allocatable size. + The maximum overhead wastage (i.e., number of extra bytes + allocated than were requested in malloc) is less than or equal + to the minimum size, except for requests >= mmap_threshold that + are serviced via mmap(), where the worst case wastage is about + 32 bytes plus the remainder from a system page (the minimal + mmap unit); typically 4096 or 8192 bytes. + + Security: static-safe; optionally more or less + The "security" of malloc refers to the ability of malicious + code to accentuate the effects of errors (for example, freeing + space that is not currently malloc'ed or overwriting past the + ends of chunks) in code that calls malloc. This malloc + guarantees not to modify any memory locations below the base of + heap, i.e., static variables, even in the presence of usage + errors. The routines additionally detect most improper frees + and reallocs. All this holds as long as the static bookkeeping + for malloc itself is not corrupted by some other means. This + is only one aspect of security -- these checks do not, and + cannot, detect all possible programming errors. + + If FOOTERS is defined nonzero, then each allocated chunk + carries an additional check word to verify that it was malloced + from its space. These check words are the same within each + execution of a program using malloc, but differ across + executions, so externally crafted fake chunks cannot be + freed. This improves security by rejecting frees/reallocs that + could corrupt heap memory, in addition to the checks preventing + writes to statics that are always on. This may further improve + security at the expense of time and space overhead. (Note that + FOOTERS may also be worth using with MSPACES.) + + By default detected errors cause the program to abort (calling + "abort()"). You can override this to instead proceed past + errors by defining PROCEED_ON_ERROR. In this case, a bad free + has no effect, and a malloc that encounters a bad address + caused by user overwrites will ignore the bad address by + dropping pointers and indices to all known memory. This may + be appropriate for programs that should continue if at all + possible in the face of programming errors, although they may + run out of memory because dropped memory is never reclaimed. + + If you don't like either of these options, you can define + CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything + else. And if if you are sure that your program using malloc has + no errors or vulnerabilities, you can define INSECURE to 1, + which might (or might not) provide a small performance improvement. + + Thread-safety: NOT thread-safe unless USE_LOCKS defined + When USE_LOCKS is defined, each public call to malloc, free, + etc is surrounded with either a pthread mutex or a win32 + spinlock (depending on WIN32). This is not especially fast, and + can be a major bottleneck. It is designed only to provide + minimal protection in concurrent environments, and to provide a + basis for extensions. If you are using malloc in a concurrent + program, consider instead using ptmalloc, which is derived from + a version of this malloc. (See http://www.malloc.de). + + System requirements: Any combination of MORECORE and/or MMAP/MUNMAP + This malloc can use unix sbrk or any emulation (invoked using + the CALL_MORECORE macro) and/or mmap/munmap or any emulation + (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system + memory. On most unix systems, it tends to work best if both + MORECORE and MMAP are enabled. On Win32, it uses emulations + based on VirtualAlloc. It also uses common C library functions + like memset. + + Compliance: I believe it is compliant with the Single Unix Specification + (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably + others as well. + +* Overview of algorithms + + This is not the fastest, most space-conserving, most portable, or + most tunable malloc ever written. However it is among the fastest + while also being among the most space-conserving, portable and + tunable. Consistent balance across these factors results in a good + general-purpose allocator for malloc-intensive programs. + + In most ways, this malloc is a best-fit allocator. Generally, it + chooses the best-fitting existing chunk for a request, with ties + broken in approximately least-recently-used order. (This strategy + normally maintains low fragmentation.) However, for requests less + than 256bytes, it deviates from best-fit when there is not an + exactly fitting available chunk by preferring to use space adjacent + to that used for the previous small request, as well as by breaking + ties in approximately most-recently-used order. (These enhance + locality of series of small allocations.) And for very large requests + (>= 256Kb by default), it relies on system memory mapping + facilities, if supported. (This helps avoid carrying around and + possibly fragmenting memory used only for large chunks.) + + All operations (except malloc_stats and mallinfo) have execution + times that are bounded by a constant factor of the number of bits in + a size_t, not counting any clearing in calloc or copying in realloc, + or actions surrounding MORECORE and MMAP that have times + proportional to the number of non-contiguous regions returned by + system allocation routines, which is often just 1. + + The implementation is not very modular and seriously overuses + macros. Perhaps someday all C compilers will do as good a job + inlining modular code as can now be done by brute-force expansion, + but now, enough of them seem not to. + + Some compilers issue a lot of warnings about code that is + dead/unreachable only on some platforms, and also about intentional + uses of negation on unsigned types. All known cases of each can be + ignored. + + For a longer but out of date high-level description, see + http://gee.cs.oswego.edu/dl/html/malloc.html + +* MSPACES + If MSPACES is defined, then in addition to malloc, free, etc., + this file also defines mspace_malloc, mspace_free, etc. These + are versions of malloc routines that take an "mspace" argument + obtained using create_mspace, to control all internal bookkeeping. + If ONLY_MSPACES is defined, only these versions are compiled. + So if you would like to use this allocator for only some allocations, + and your system malloc for others, you can compile with + ONLY_MSPACES and then do something like... + static mspace mymspace = create_mspace(0,0); // for example + #define mymalloc(bytes) mspace_malloc(mymspace, bytes) + + (Note: If you only need one instance of an mspace, you can instead + use "USE_DL_PREFIX" to relabel the global malloc.) + + You can similarly create thread-local allocators by storing + mspaces as thread-locals. For example: + static __thread mspace tlms = 0; + void* tlmalloc(size_t bytes) { + if (tlms == 0) tlms = create_mspace(0, 0); + return mspace_malloc(tlms, bytes); + } + void tlfree(void* mem) { mspace_free(tlms, mem); } + + Unless FOOTERS is defined, each mspace is completely independent. + You cannot allocate from one and free to another (although + conformance is only weakly checked, so usage errors are not always + caught). If FOOTERS is defined, then each chunk carries around a tag + indicating its originating mspace, and frees are directed to their + originating spaces. + + ------------------------- Compile-time options --------------------------- + +Be careful in setting #define values for numerical constants of type +size_t. On some systems, literal values are not automatically extended +to size_t precision unless they are explicitly casted. + +WIN32 default: defined if _WIN32 defined + Defining WIN32 sets up defaults for MS environment and compilers. + Otherwise defaults are for unix. + +MALLOC_ALIGNMENT default: (size_t)8 + Controls the minimum alignment for malloc'ed chunks. It must be a + power of two and at least 8, even on machines for which smaller + alignments would suffice. It may be defined as larger than this + though. Note however that code and data structures are optimized for + the case of 8-byte alignment. + +MSPACES default: 0 (false) + If true, compile in support for independent allocation spaces. + This is only supported if HAVE_MMAP is true. + +ONLY_MSPACES default: 0 (false) + If true, only compile in mspace versions, not regular versions. + +USE_LOCKS default: 0 (false) + Causes each call to each public routine to be surrounded with + pthread or WIN32 mutex lock/unlock. (If set true, this can be + overridden on a per-mspace basis for mspace versions.) + +FOOTERS default: 0 + If true, provide extra checking and dispatching by placing + information in the footers of allocated chunks. This adds + space and time overhead. + +INSECURE default: 0 + If true, omit checks for usage errors and heap space overwrites. + +USE_DL_PREFIX default: NOT defined + Causes compiler to prefix all public routines with the string 'dl'. + This can be useful when you only want to use this malloc in one part + of a program, using your regular system malloc elsewhere. + +ABORT default: defined as abort() + Defines how to abort on failed checks. On most systems, a failed + check cannot die with an "assert" or even print an informative + message, because the underlying print routines in turn call malloc, + which will fail again. Generally, the best policy is to simply call + abort(). It's not very useful to do more than this because many + errors due to overwriting will show up as address faults (null, odd + addresses etc) rather than malloc-triggered checks, so will also + abort. Also, most compilers know that abort() does not return, so + can better optimize code conditionally calling it. + +PROCEED_ON_ERROR default: defined as 0 (false) + Controls whether detected bad addresses cause them to bypassed + rather than aborting. If set, detected bad arguments to free and + realloc are ignored. And all bookkeeping information is zeroed out + upon a detected overwrite of freed heap space, thus losing the + ability to ever return it from malloc again, but enabling the + application to proceed. If PROCEED_ON_ERROR is defined, the + static variable malloc_corruption_error_count is compiled in + and can be examined to see if errors have occurred. This option + generates slower code than the default abort policy. + +DEBUG default: NOT defined + The DEBUG setting is mainly intended for people trying to modify + this code or diagnose problems when porting to new platforms. + However, it may also be able to better isolate user errors than just + using runtime checks. The assertions in the check routines spell + out in more detail the assumptions and invariants underlying the + algorithms. The checking is fairly extensive, and will slow down + execution noticeably. Calling malloc_stats or mallinfo with DEBUG + set will attempt to check every non-mmapped allocated and free chunk + in the course of computing the summaries. + +ABORT_ON_ASSERT_FAILURE default: defined as 1 (true) + Debugging assertion failures can be nearly impossible if your + version of the assert macro causes malloc to be called, which will + lead to a cascade of further failures, blowing the runtime stack. + ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(), + which will usually make debugging easier. + +MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32 + The action to take before "return 0" when malloc fails to be able to + return memory because there is none available. + +HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES + True if this system supports sbrk or an emulation of it. + +MORECORE default: sbrk + The name of the sbrk-style system routine to call to obtain more + memory. See below for guidance on writing custom MORECORE + functions. The type of the argument to sbrk/MORECORE varies across + systems. It cannot be size_t, because it supports negative + arguments, so it is normally the signed type of the same width as + size_t (sometimes declared as "intptr_t"). It doesn't much matter + though. Internally, we only call it with arguments less than half + the max value of a size_t, which should work across all reasonable + possibilities, although sometimes generating compiler warnings. See + near the end of this file for guidelines for creating a custom + version of MORECORE. + +MORECORE_CONTIGUOUS default: 1 (true) + If true, take advantage of fact that consecutive calls to MORECORE + with positive arguments always return contiguous increasing + addresses. This is true of unix sbrk. It does not hurt too much to + set it true anyway, since malloc copes with non-contiguities. + Setting it false when definitely non-contiguous saves time + and possibly wasted space it would take to discover this though. + +MORECORE_CANNOT_TRIM default: NOT defined + True if MORECORE cannot release space back to the system when given + negative arguments. This is generally necessary only if you are + using a hand-crafted MORECORE function that cannot handle negative + arguments. + +HAVE_MMAP default: 1 (true) + True if this system supports mmap or an emulation of it. If so, and + HAVE_MORECORE is not true, MMAP is used for all system + allocation. If set and HAVE_MORECORE is true as well, MMAP is + primarily used to directly allocate very large blocks. It is also + used as a backup strategy in cases where MORECORE fails to provide + space from system. Note: A single call to MUNMAP is assumed to be + able to unmap memory that may have be allocated using multiple calls + to MMAP, so long as they are adjacent. + +HAVE_MREMAP default: 1 on linux, else 0 + If true realloc() uses mremap() to re-allocate large blocks and + extend or shrink allocation spaces. + +MMAP_CLEARS default: 1 on unix + True if mmap clears memory so calloc doesn't need to. This is true + for standard unix mmap using /dev/zero. + +USE_BUILTIN_FFS default: 0 (i.e., not used) + Causes malloc to use the builtin ffs() function to compute indices. + Some compilers may recognize and intrinsify ffs to be faster than the + supplied C version. Also, the case of x86 using gcc is special-cased + to an asm instruction, so is already as fast as it can be, and so + this setting has no effect. (On most x86s, the asm version is only + slightly faster than the C version.) + +malloc_getpagesize default: derive from system includes, or 4096. + The system page size. To the extent possible, this malloc manages + memory from the system in page-size units. This may be (and + usually is) a function rather than a constant. This is ignored + if WIN32, where page size is determined using getSystemInfo during + initialization. + +USE_DEV_RANDOM default: 0 (i.e., not used) + Causes malloc to use /dev/random to initialize secure magic seed for + stamping footers. Otherwise, the current time is used. + +NO_MALLINFO default: 0 + If defined, don't compile "mallinfo". This can be a simple way + of dealing with mismatches between system declarations and + those in this file. + +MALLINFO_FIELD_TYPE default: size_t + The type of the fields in the mallinfo struct. This was originally + defined as "int" in SVID etc, but is more usefully defined as + size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set + +REALLOC_ZERO_BYTES_FREES default: not defined + This should be set if a call to realloc with zero bytes should + be the same as a call to free. Some people think it should. Otherwise, + since this malloc returns a unique pointer for malloc(0), so does + realloc(p, 0). + +LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H +LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H +LACKS_STDLIB_H default: NOT defined unless on WIN32 + Define these if your system does not have these header files. + You might need to manually insert some of the declarations they provide. + +DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS, + system_info.dwAllocationGranularity in WIN32, + otherwise 64K. + Also settable using mallopt(M_GRANULARITY, x) + The unit for allocating and deallocating memory from the system. On + most systems with contiguous MORECORE, there is no reason to + make this more than a page. However, systems with MMAP tend to + either require or encourage larger granularities. You can increase + this value to prevent system allocation functions to be called so + often, especially if they are slow. The value must be at least one + page and must be a power of two. Setting to 0 causes initialization + to either page size or win32 region size. (Note: In previous + versions of malloc, the equivalent of this option was called + "TOP_PAD") + +DEFAULT_TRIM_THRESHOLD default: 2MB + Also settable using mallopt(M_TRIM_THRESHOLD, x) + The maximum amount of unused top-most memory to keep before + releasing via malloc_trim in free(). Automatic trimming is mainly + useful in long-lived programs using contiguous MORECORE. Because + trimming via sbrk can be slow on some systems, and can sometimes be + wasteful (in cases where programs immediately afterward allocate + more large chunks) the value should be high enough so that your + overall system performance would improve by releasing this much + memory. As a rough guide, you might set to a value close to the + average size of a process (program) running on your system. + Releasing this much memory would allow such a process to run in + memory. Generally, it is worth tuning trim thresholds when a + program undergoes phases where several large chunks are allocated + and released in ways that can reuse each other's storage, perhaps + mixed with phases where there are no such chunks at all. The trim + value must be greater than page size to have any useful effect. To + disable trimming completely, you can set to MAX_SIZE_T. Note that the trick + some people use of mallocing a huge space and then freeing it at + program startup, in an attempt to reserve system memory, doesn't + have the intended effect under automatic trimming, since that memory + will immediately be returned to the system. + +DEFAULT_MMAP_THRESHOLD default: 256K + Also settable using mallopt(M_MMAP_THRESHOLD, x) + The request size threshold for using MMAP to directly service a + request. Requests of at least this size that cannot be allocated + using already-existing space will be serviced via mmap. (If enough + normal freed space already exists it is used instead.) Using mmap + segregates relatively large chunks of memory so that they can be + individually obtained and released from the host system. A request + serviced through mmap is never reused by any other request (at least + not directly; the system may just so happen to remap successive + requests to the same locations). Segregating space in this way has + the benefits that: Mmapped space can always be individually released + back to the system, which helps keep the system level memory demands + of a long-lived program low. Also, mapped memory doesn't become + `locked' between other chunks, as can happen with normally allocated + chunks, which means that even trimming via malloc_trim would not + release them. However, it has the disadvantage that the space + cannot be reclaimed, consolidated, and then used to service later + requests, as happens with normal chunks. The advantages of mmap + nearly always outweigh disadvantages for "large" chunks, but the + value of "large" may vary across systems. The default is an + empirically derived value that works well in most systems. You can + disable mmap by setting to MAX_SIZE_T. + +*/ + +#if defined __linux__ && !defined _GNU_SOURCE +/* mremap() on Linux requires this via sys/mman.h */ +#define _GNU_SOURCE 1 +#endif + +#ifndef WIN32 +#ifdef _WIN32 +#define WIN32 1 +#endif /* _WIN32 */ +#endif /* WIN32 */ +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#define HAVE_MMAP 1 +#define HAVE_MORECORE 0 +#define LACKS_UNISTD_H +#define LACKS_SYS_PARAM_H +#define LACKS_SYS_MMAN_H +#define LACKS_STRING_H +#define LACKS_STRINGS_H +#define LACKS_SYS_TYPES_H +#define LACKS_ERRNO_H +#define MALLOC_FAILURE_ACTION +#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ +#endif /* WIN32 */ + +#ifdef __OS2__ +#define INCL_DOS +#include +#define HAVE_MMAP 1 +#define HAVE_MORECORE 0 +#define LACKS_SYS_MMAN_H +#endif /* __OS2__ */ + +#if defined(DARWIN) || defined(_DARWIN) +/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */ +#ifndef HAVE_MORECORE +#define HAVE_MORECORE 0 +#define HAVE_MMAP 1 +#endif /* HAVE_MORECORE */ +#endif /* DARWIN */ + +#ifndef LACKS_SYS_TYPES_H +#include /* For size_t */ +#endif /* LACKS_SYS_TYPES_H */ + +/* The maximum possible size_t value has all bits set */ +#define MAX_SIZE_T (~(size_t)0) + +#ifndef ONLY_MSPACES +#define ONLY_MSPACES 0 +#endif /* ONLY_MSPACES */ +#ifndef MSPACES +#if ONLY_MSPACES +#define MSPACES 1 +#else /* ONLY_MSPACES */ +#define MSPACES 0 +#endif /* ONLY_MSPACES */ +#endif /* MSPACES */ +#ifndef MALLOC_ALIGNMENT +#define MALLOC_ALIGNMENT ((size_t)8U) +#endif /* MALLOC_ALIGNMENT */ +#ifndef FOOTERS +#define FOOTERS 0 +#endif /* FOOTERS */ +#ifndef ABORT +#define ABORT abort() +#endif /* ABORT */ +#ifndef ABORT_ON_ASSERT_FAILURE +#define ABORT_ON_ASSERT_FAILURE 1 +#endif /* ABORT_ON_ASSERT_FAILURE */ +#ifndef PROCEED_ON_ERROR +#define PROCEED_ON_ERROR 0 +#endif /* PROCEED_ON_ERROR */ +#ifndef USE_LOCKS +#define USE_LOCKS 0 +#endif /* USE_LOCKS */ +#ifndef INSECURE +#define INSECURE 0 +#endif /* INSECURE */ +#ifndef HAVE_MMAP +#define HAVE_MMAP 1 +#endif /* HAVE_MMAP */ +#ifndef MMAP_CLEARS +#define MMAP_CLEARS 1 +#endif /* MMAP_CLEARS */ +#ifndef HAVE_MREMAP +#ifdef linux +#define HAVE_MREMAP 1 +#else /* linux */ +#define HAVE_MREMAP 0 +#endif /* linux */ +#endif /* HAVE_MREMAP */ +#ifndef MALLOC_FAILURE_ACTION +#define MALLOC_FAILURE_ACTION errno = ENOMEM; +#endif /* MALLOC_FAILURE_ACTION */ +#ifndef HAVE_MORECORE +#if ONLY_MSPACES +#define HAVE_MORECORE 0 +#else /* ONLY_MSPACES */ +#define HAVE_MORECORE 1 +#endif /* ONLY_MSPACES */ +#endif /* HAVE_MORECORE */ +#if !HAVE_MORECORE +#define MORECORE_CONTIGUOUS 0 +#else /* !HAVE_MORECORE */ +#ifndef MORECORE +#define MORECORE sbrk +#endif /* MORECORE */ +#ifndef MORECORE_CONTIGUOUS +#define MORECORE_CONTIGUOUS 1 +#endif /* MORECORE_CONTIGUOUS */ +#endif /* HAVE_MORECORE */ +#ifndef DEFAULT_GRANULARITY +#if MORECORE_CONTIGUOUS +#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ +#else /* MORECORE_CONTIGUOUS */ +#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) +#endif /* MORECORE_CONTIGUOUS */ +#endif /* DEFAULT_GRANULARITY */ +#ifndef DEFAULT_TRIM_THRESHOLD +#ifndef MORECORE_CANNOT_TRIM +#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) +#else /* MORECORE_CANNOT_TRIM */ +#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T +#endif /* MORECORE_CANNOT_TRIM */ +#endif /* DEFAULT_TRIM_THRESHOLD */ +#ifndef DEFAULT_MMAP_THRESHOLD +#if HAVE_MMAP +#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) +#else /* HAVE_MMAP */ +#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T +#endif /* HAVE_MMAP */ +#endif /* DEFAULT_MMAP_THRESHOLD */ +#ifndef USE_BUILTIN_FFS +#define USE_BUILTIN_FFS 0 +#endif /* USE_BUILTIN_FFS */ +#ifndef USE_DEV_RANDOM +#define USE_DEV_RANDOM 0 +#endif /* USE_DEV_RANDOM */ +#ifndef NO_MALLINFO +#define NO_MALLINFO 0 +#endif /* NO_MALLINFO */ +#ifndef MALLINFO_FIELD_TYPE +#define MALLINFO_FIELD_TYPE size_t +#endif /* MALLINFO_FIELD_TYPE */ + +/* + mallopt tuning options. SVID/XPG defines four standard parameter + numbers for mallopt, normally defined in malloc.h. None of these + are used in this malloc, so setting them has no effect. But this + malloc does support the following options. +*/ + +#define M_TRIM_THRESHOLD (-1) +#define M_GRANULARITY (-2) +#define M_MMAP_THRESHOLD (-3) + +/* ------------------------ Mallinfo declarations ------------------------ */ + +#if !NO_MALLINFO +/* + This version of malloc supports the standard SVID/XPG mallinfo + routine that returns a struct containing usage properties and + statistics. It should work on any system that has a + /usr/include/malloc.h defining struct mallinfo. The main + declaration needed is the mallinfo struct that is returned (by-copy) + by mallinfo(). The malloinfo struct contains a bunch of fields that + are not even meaningful in this version of malloc. These fields are + are instead filled by mallinfo() with other numbers that might be of + interest. + + HAVE_USR_INCLUDE_MALLOC_H should be set if you have a + /usr/include/malloc.h file that includes a declaration of struct + mallinfo. If so, it is included; else a compliant version is + declared below. These must be precisely the same for mallinfo() to + work. The original SVID version of this struct, defined on most + systems with mallinfo, declares all fields as ints. But some others + define as unsigned long. If your system defines the fields using a + type of different width than listed here, you MUST #include your + system version and #define HAVE_USR_INCLUDE_MALLOC_H. +*/ + +/* #define HAVE_USR_INCLUDE_MALLOC_H */ + +#ifdef HAVE_USR_INCLUDE_MALLOC_H +#include "/usr/include/malloc.h" +#else /* HAVE_USR_INCLUDE_MALLOC_H */ + +/* HP-UX's stdlib.h redefines mallinfo unless _STRUCT_MALLINFO is defined */ +#define _STRUCT_MALLINFO + +struct mallinfo { + MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ + MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ + MALLINFO_FIELD_TYPE smblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ + MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ + MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ + MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ + MALLINFO_FIELD_TYPE fordblks; /* total free space */ + MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ +}; + +#endif /* HAVE_USR_INCLUDE_MALLOC_H */ +#endif /* NO_MALLINFO */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#if !ONLY_MSPACES + +/* ------------------- Declarations of public routines ------------------- */ + +#ifndef USE_DL_PREFIX +#define dlcalloc calloc +#define dlfree free +#define dlmalloc malloc +#define dlmemalign memalign +#define dlrealloc realloc +#define dlvalloc valloc +#define dlpvalloc pvalloc +#define dlmallinfo mallinfo +#define dlmallopt mallopt +#define dlmalloc_trim malloc_trim +#define dlmalloc_stats malloc_stats +#define dlmalloc_usable_size malloc_usable_size +#define dlmalloc_footprint malloc_footprint +#define dlmalloc_max_footprint malloc_max_footprint +#define dlindependent_calloc independent_calloc +#define dlindependent_comalloc independent_comalloc +#endif /* USE_DL_PREFIX */ + + +/* + malloc(size_t n) + Returns a pointer to a newly allocated chunk of at least n bytes, or + null if no space is available, in which case errno is set to ENOMEM + on ANSI C systems. + + If n is zero, malloc returns a minimum-sized chunk. (The minimum + size is 16 bytes on most 32bit systems, and 32 bytes on 64bit + systems.) Note that size_t is an unsigned type, so calls with + arguments that would be negative if signed are interpreted as + requests for huge amounts of space, which will often fail. The + maximum supported value of n differs across systems, but is in all + cases less than the maximum representable value of a size_t. +*/ +void* dlmalloc(size_t); + +/* + free(void* p) + Releases the chunk of memory pointed to by p, that had been previously + allocated using malloc or a related routine such as realloc. + It has no effect if p is null. If p was not malloced or already + freed, free(p) will by default cause the current program to abort. +*/ +void dlfree(void*); + +/* + calloc(size_t n_elements, size_t element_size); + Returns a pointer to n_elements * element_size bytes, with all locations + set to zero. +*/ +void* dlcalloc(size_t, size_t); + +/* + realloc(void* p, size_t n) + Returns a pointer to a chunk of size n that contains the same data + as does chunk p up to the minimum of (n, p's size) bytes, or null + if no space is available. + + The returned pointer may or may not be the same as p. The algorithm + prefers extending p in most cases when possible, otherwise it + employs the equivalent of a malloc-copy-free sequence. + + If p is null, realloc is equivalent to malloc. + + If space is not available, realloc returns null, errno is set (if on + ANSI) and p is NOT freed. + + if n is for fewer bytes than already held by p, the newly unused + space is lopped off and freed if possible. realloc with a size + argument of zero (re)allocates a minimum-sized chunk. + + The old unix realloc convention of allowing the last-free'd chunk + to be used as an argument to realloc is not supported. +*/ + +void* dlrealloc(void*, size_t); + +/* + memalign(size_t alignment, size_t n); + Returns a pointer to a newly allocated chunk of n bytes, aligned + in accord with the alignment argument. + + The alignment argument should be a power of two. If the argument is + not a power of two, the nearest greater power is used. + 8-byte alignment is guaranteed by normal malloc calls, so don't + bother calling memalign with an argument of 8 or less. + + Overreliance on memalign is a sure way to fragment space. +*/ +void* dlmemalign(size_t, size_t); + +/* + valloc(size_t n); + Equivalent to memalign(pagesize, n), where pagesize is the page + size of the system. If the pagesize is unknown, 4096 is used. +*/ +void* dlvalloc(size_t); + +/* + mallopt(int parameter_number, int parameter_value) + Sets tunable parameters The format is to provide a + (parameter-number, parameter-value) pair. mallopt then sets the + corresponding parameter to the argument value if it can (i.e., so + long as the value is meaningful), and returns 1 if successful else + 0. SVID/XPG/ANSI defines four standard param numbers for mallopt, + normally defined in malloc.h. None of these are use in this malloc, + so setting them has no effect. But this malloc also supports other + options in mallopt. See below for details. Briefly, supported + parameters are as follows (listed defaults are for "typical" + configurations). + + Symbol param # default allowed param values + M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables) + M_GRANULARITY -2 page size any power of 2 >= page size + M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) +*/ +int dlmallopt(int, int); + +/* + malloc_footprint(); + Returns the number of bytes obtained from the system. The total + number of bytes allocated by malloc, realloc etc., is less than this + value. Unlike mallinfo, this function returns only a precomputed + result, so can be called frequently to monitor memory consumption. + Even if locks are otherwise defined, this function does not use them, + so results might not be up to date. +*/ +size_t dlmalloc_footprint(void); + +/* + malloc_max_footprint(); + Returns the maximum number of bytes obtained from the system. This + value will be greater than current footprint if deallocated space + has been reclaimed by the system. The peak number of bytes allocated + by malloc, realloc etc., is less than this value. Unlike mallinfo, + this function returns only a precomputed result, so can be called + frequently to monitor memory consumption. Even if locks are + otherwise defined, this function does not use them, so results might + not be up to date. +*/ +size_t dlmalloc_max_footprint(void); + +#if !NO_MALLINFO +/* + mallinfo() + Returns (by copy) a struct containing various summary statistics: + + arena: current total non-mmapped bytes allocated from system + ordblks: the number of free chunks + smblks: always zero. + hblks: current number of mmapped regions + hblkhd: total bytes held in mmapped regions + usmblks: the maximum total allocated space. This will be greater + than current total if trimming has occurred. + fsmblks: always zero + uordblks: current total allocated space (normal or mmapped) + fordblks: total free space + keepcost: the maximum number of bytes that could ideally be released + back to system via malloc_trim. ("ideally" means that + it ignores page restrictions etc.) + + Because these fields are ints, but internal bookkeeping may + be kept as longs, the reported values may wrap around zero and + thus be inaccurate. +*/ +struct mallinfo dlmallinfo(void); +#endif /* NO_MALLINFO */ + +/* + independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); + + independent_calloc is similar to calloc, but instead of returning a + single cleared space, it returns an array of pointers to n_elements + independent elements that can hold contents of size elem_size, each + of which starts out cleared, and can be independently freed, + realloc'ed etc. The elements are guaranteed to be adjacently + allocated (this is not guaranteed to occur with multiple callocs or + mallocs), which may also improve cache locality in some + applications. + + The "chunks" argument is optional (i.e., may be null, which is + probably the most typical usage). If it is null, the returned array + is itself dynamically allocated and should also be freed when it is + no longer needed. Otherwise, the chunks array must be of at least + n_elements in length. It is filled in with the pointers to the + chunks. + + In either case, independent_calloc returns this pointer array, or + null if the allocation failed. If n_elements is zero and "chunks" + is null, it returns a chunk representing an array with zero elements + (which should be freed if not wanted). + + Each element must be individually freed when it is no longer + needed. If you'd like to instead be able to free all at once, you + should instead use regular calloc and assign pointers into this + space to represent elements. (In this case though, you cannot + independently free elements.) + + independent_calloc simplifies and speeds up implementations of many + kinds of pools. It may also be useful when constructing large data + structures that initially have a fixed number of fixed-sized nodes, + but the number is not known at compile time, and some of the nodes + may later need to be freed. For example: + + struct Node { int item; struct Node* next; }; + + struct Node* build_list() { + struct Node** pool; + int n = read_number_of_nodes_needed(); + if (n <= 0) return 0; + pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); + if (pool == 0) die(); + // organize into a linked list... + struct Node* first = pool[0]; + for (i = 0; i < n-1; ++i) + pool[i]->next = pool[i+1]; + free(pool); // Can now free the array (or not, if it is needed later) + return first; + } +*/ +void** dlindependent_calloc(size_t, size_t, void**); + +/* + independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); + + independent_comalloc allocates, all at once, a set of n_elements + chunks with sizes indicated in the "sizes" array. It returns + an array of pointers to these elements, each of which can be + independently freed, realloc'ed etc. The elements are guaranteed to + be adjacently allocated (this is not guaranteed to occur with + multiple callocs or mallocs), which may also improve cache locality + in some applications. + + The "chunks" argument is optional (i.e., may be null). If it is null + the returned array is itself dynamically allocated and should also + be freed when it is no longer needed. Otherwise, the chunks array + must be of at least n_elements in length. It is filled in with the + pointers to the chunks. + + In either case, independent_comalloc returns this pointer array, or + null if the allocation failed. If n_elements is zero and chunks is + null, it returns a chunk representing an array with zero elements + (which should be freed if not wanted). + + Each element must be individually freed when it is no longer + needed. If you'd like to instead be able to free all at once, you + should instead use a single regular malloc, and assign pointers at + particular offsets in the aggregate space. (In this case though, you + cannot independently free elements.) + + independent_comallac differs from independent_calloc in that each + element may have a different size, and also that it does not + automatically clear elements. + + independent_comalloc can be used to speed up allocation in cases + where several structs or objects must always be allocated at the + same time. For example: + + struct Head { ... } + struct Foot { ... } + + void send_message(char* msg) { + int msglen = strlen(msg); + size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; + void* chunks[3]; + if (independent_comalloc(3, sizes, chunks) == 0) + die(); + struct Head* head = (struct Head*)(chunks[0]); + char* body = (char*)(chunks[1]); + struct Foot* foot = (struct Foot*)(chunks[2]); + // ... + } + + In general though, independent_comalloc is worth using only for + larger values of n_elements. For small values, you probably won't + detect enough difference from series of malloc calls to bother. + + Overuse of independent_comalloc can increase overall memory usage, + since it cannot reuse existing noncontiguous small chunks that + might be available for some of the elements. +*/ +void** dlindependent_comalloc(size_t, size_t*, void**); + + +/* + pvalloc(size_t n); + Equivalent to valloc(minimum-page-that-holds(n)), that is, + round up n to nearest pagesize. + */ +void* dlpvalloc(size_t); + +/* + malloc_trim(size_t pad); + + If possible, gives memory back to the system (via negative arguments + to sbrk) if there is unused memory at the `high' end of the malloc + pool or in unused MMAP segments. You can call this after freeing + large blocks of memory to potentially reduce the system-level memory + requirements of a program. However, it cannot guarantee to reduce + memory. Under some allocation patterns, some large free blocks of + memory will be locked between two used chunks, so they cannot be + given back to the system. + + The `pad' argument to malloc_trim represents the amount of free + trailing space to leave untrimmed. If this argument is zero, only + the minimum amount of memory to maintain internal data structures + will be left. Non-zero arguments can be supplied to maintain enough + trailing space to service future expected allocations without having + to re-obtain memory from the system. + + Malloc_trim returns 1 if it actually released any memory, else 0. +*/ +int dlmalloc_trim(size_t); + +/* + malloc_usable_size(void* p); + + Returns the number of bytes you can actually use in + an allocated chunk, which may be more than you requested (although + often not) due to alignment and minimum size constraints. + You can use this many bytes without worrying about + overwriting other allocated objects. This is not a particularly great + programming practice. malloc_usable_size can be more useful in + debugging and assertions, for example: + + p = malloc(n); + assert(malloc_usable_size(p) >= 256); +*/ +size_t dlmalloc_usable_size(void*); + +/* + malloc_stats(); + Prints on stderr the amount of space obtained from the system (both + via sbrk and mmap), the maximum amount (which may be more than + current if malloc_trim and/or munmap got called), and the current + number of bytes allocated via malloc (or realloc, etc) but not yet + freed. Note that this is the number of bytes allocated, not the + number requested. It will be larger than the number requested + because of alignment and bookkeeping overhead. Because it includes + alignment wastage as being in use, this figure may be greater than + zero even when no user-level chunks are allocated. + + The reported current and maximum system memory can be inaccurate if + a program makes other calls to system memory allocation functions + (normally sbrk) outside of malloc. + + malloc_stats prints only the most commonly interesting statistics. + More information can be obtained by calling mallinfo. +*/ +void dlmalloc_stats(void); + +#endif /* ONLY_MSPACES */ + +#if MSPACES + +/* + mspace is an opaque type representing an independent + region of space that supports mspace_malloc, etc. +*/ +typedef void* mspace; + +/* + create_mspace creates and returns a new independent space with the + given initial capacity, or, if 0, the default granularity size. It + returns null if there is no system memory available to create the + space. If argument locked is non-zero, the space uses a separate + lock to control access. The capacity of the space will grow + dynamically as needed to service mspace_malloc requests. You can + control the sizes of incremental increases of this space by + compiling with a different DEFAULT_GRANULARITY or dynamically + setting with mallopt(M_GRANULARITY, value). +*/ +mspace create_mspace(size_t capacity, int locked); + +/* + destroy_mspace destroys the given space, and attempts to return all + of its memory back to the system, returning the total number of + bytes freed. After destruction, the results of access to all memory + used by the space become undefined. +*/ +size_t destroy_mspace(mspace msp); + +/* + create_mspace_with_base uses the memory supplied as the initial base + of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this + space is used for bookkeeping, so the capacity must be at least this + large. (Otherwise 0 is returned.) When this initial space is + exhausted, additional memory will be obtained from the system. + Destroying this space will deallocate all additionally allocated + space (if possible) but not the initial base. +*/ +mspace create_mspace_with_base(void* base, size_t capacity, int locked); + +/* + mspace_malloc behaves as malloc, but operates within + the given space. +*/ +void* mspace_malloc(mspace msp, size_t bytes); + +/* + mspace_free behaves as free, but operates within + the given space. + + If compiled with FOOTERS==1, mspace_free is not actually needed. + free may be called instead of mspace_free because freed chunks from + any space are handled by their originating spaces. +*/ +void mspace_free(mspace msp, void* mem); + +/* + mspace_realloc behaves as realloc, but operates within + the given space. + + If compiled with FOOTERS==1, mspace_realloc is not actually + needed. realloc may be called instead of mspace_realloc because + realloced chunks from any space are handled by their originating + spaces. +*/ +void* mspace_realloc(mspace msp, void* mem, size_t newsize); + +/* + mspace_calloc behaves as calloc, but operates within + the given space. +*/ +void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); + +/* + mspace_memalign behaves as memalign, but operates within + the given space. +*/ +void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); + +/* + mspace_independent_calloc behaves as independent_calloc, but + operates within the given space. +*/ +void** mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void* chunks[]); + +/* + mspace_independent_comalloc behaves as independent_comalloc, but + operates within the given space. +*/ +void** mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void* chunks[]); + +/* + mspace_footprint() returns the number of bytes obtained from the + system for this space. +*/ +size_t mspace_footprint(mspace msp); + +/* + mspace_max_footprint() returns the peak number of bytes obtained from the + system for this space. +*/ +size_t mspace_max_footprint(mspace msp); + + +#if !NO_MALLINFO +/* + mspace_mallinfo behaves as mallinfo, but reports properties of + the given space. +*/ +struct mallinfo mspace_mallinfo(mspace msp); +#endif /* NO_MALLINFO */ + +/* + mspace_malloc_stats behaves as malloc_stats, but reports + properties of the given space. +*/ +void mspace_malloc_stats(mspace msp); + +/* + mspace_trim behaves as malloc_trim, but + operates within the given space. +*/ +int mspace_trim(mspace msp, size_t pad); + +/* + An alias for mallopt. +*/ +int mspace_mallopt(int, int); + +#endif /* MSPACES */ + +#ifdef __cplusplus +}; /* end of extern "C" */ +#endif /* __cplusplus */ + +/* + ======================================================================== + To make a fully customizable malloc.h header file, cut everything + above this line, put into file malloc.h, edit to suit, and #include it + on the next line, as well as in programs that use this malloc. + ======================================================================== +*/ + +/* #include "malloc.h" */ + +/*------------------------------ internal #includes ---------------------- */ + +#ifdef _MSC_VER +#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ +#endif /* _MSC_VER */ + +#include /* for printing in malloc_stats */ + +#ifndef LACKS_ERRNO_H +#include /* for MALLOC_FAILURE_ACTION */ +#endif /* LACKS_ERRNO_H */ +#if FOOTERS +#include /* for magic initialization */ +#endif /* FOOTERS */ +#ifndef LACKS_STDLIB_H +#include /* for abort() */ +#endif /* LACKS_STDLIB_H */ +#ifdef DEBUG +#if ABORT_ON_ASSERT_FAILURE +#define assert(x) if(!(x)) ABORT +#else /* ABORT_ON_ASSERT_FAILURE */ +#include +#endif /* ABORT_ON_ASSERT_FAILURE */ +#else /* DEBUG */ +#define assert(x) +#endif /* DEBUG */ +#ifndef LACKS_STRING_H +#include /* for memset etc */ +#endif /* LACKS_STRING_H */ +#if USE_BUILTIN_FFS +#ifndef LACKS_STRINGS_H +#include /* for ffs */ +#endif /* LACKS_STRINGS_H */ +#endif /* USE_BUILTIN_FFS */ +#if HAVE_MMAP +#ifndef LACKS_SYS_MMAN_H +#include /* for mmap */ +#endif /* LACKS_SYS_MMAN_H */ +#ifndef LACKS_FCNTL_H +#include +#endif /* LACKS_FCNTL_H */ +#endif /* HAVE_MMAP */ +#if HAVE_MORECORE +#ifndef LACKS_UNISTD_H +#include /* for sbrk */ +#else /* LACKS_UNISTD_H */ +#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) +extern void* sbrk(ptrdiff_t); +#endif /* FreeBSD etc */ +#endif /* LACKS_UNISTD_H */ +#endif /* HAVE_MMAP */ + +#ifndef WIN32 +#ifndef malloc_getpagesize +# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ +# ifndef _SC_PAGE_SIZE +# define _SC_PAGE_SIZE _SC_PAGESIZE +# endif +# endif +# ifdef _SC_PAGE_SIZE +# define malloc_getpagesize sysconf(_SC_PAGE_SIZE) +# else +# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) + extern size_t getpagesize(); +# define malloc_getpagesize getpagesize() +# else +# ifdef WIN32 /* use supplied emulation of getpagesize */ +# define malloc_getpagesize getpagesize() +# else +# ifndef LACKS_SYS_PARAM_H +# include +# endif +# ifdef EXEC_PAGESIZE +# define malloc_getpagesize EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define malloc_getpagesize NBPG +# else +# define malloc_getpagesize (NBPG * CLSIZE) +# endif +# else +# ifdef NBPC +# define malloc_getpagesize NBPC +# else +# ifdef PAGESIZE +# define malloc_getpagesize PAGESIZE +# else /* just guess */ +# define malloc_getpagesize ((size_t)4096U) +# endif +# endif +# endif +# endif +# endif +# endif +# endif +#endif +#endif + +/* ------------------- size_t and alignment properties -------------------- */ + +/* The byte and bit size of a size_t */ +#define SIZE_T_SIZE (sizeof(size_t)) +#define SIZE_T_BITSIZE (sizeof(size_t) << 3) + +/* Some constants coerced to size_t */ +/* Annoying but necessary to avoid errors on some platforms */ +#define SIZE_T_ZERO ((size_t)0) +#define SIZE_T_ONE ((size_t)1) +#define SIZE_T_TWO ((size_t)2) +#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) +#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) +#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) +#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) + +/* The bit mask value corresponding to MALLOC_ALIGNMENT */ +#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) + +/* True if address a has acceptable alignment */ +#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) + +/* the number of bytes to offset an address to align it */ +#define align_offset(A)\ + ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ + ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK)) + +/* -------------------------- MMAP preliminaries ------------------------- */ + +/* + If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and + checks to fail so compiler optimizer can delete code rather than + using so many "#if"s. +*/ + + +/* MORECORE and MMAP must return MFAIL on failure */ +#define MFAIL ((void*)(MAX_SIZE_T)) +#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ + +#if !HAVE_MMAP +#define IS_MMAPPED_BIT (SIZE_T_ZERO) +#define USE_MMAP_BIT (SIZE_T_ZERO) +#define CALL_MMAP(s) MFAIL +#define CALL_MUNMAP(a, s) (-1) +#define DIRECT_MMAP(s) MFAIL + +#else /* HAVE_MMAP */ +#define IS_MMAPPED_BIT (SIZE_T_ONE) +#define USE_MMAP_BIT (SIZE_T_ONE) + +#if !defined(WIN32) && !defined (__OS2__) +#define CALL_MUNMAP(a, s) munmap((a), (s)) +#define MMAP_PROT (PROT_READ|PROT_WRITE) +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) +#define MAP_ANONYMOUS MAP_ANON +#endif /* MAP_ANON */ +#ifdef MAP_ANONYMOUS +#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS) +#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0) +#else /* MAP_ANONYMOUS */ +/* + Nearly all versions of mmap support MAP_ANONYMOUS, so the following + is unlikely to be needed, but is supplied just in case. +*/ +#define MMAP_FLAGS (MAP_PRIVATE) +static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ +#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \ + (dev_zero_fd = open("/dev/zero", O_RDWR), \ + mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ + mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) +#endif /* MAP_ANONYMOUS */ + +#define DIRECT_MMAP(s) CALL_MMAP(s) + +#elif defined(__OS2__) + +/* OS/2 MMAP via DosAllocMem */ +static void* os2mmap(size_t size) { + void* ptr; + if (DosAllocMem(&ptr, size, OBJ_ANY|PAG_COMMIT|PAG_READ|PAG_WRITE) && + DosAllocMem(&ptr, size, PAG_COMMIT|PAG_READ|PAG_WRITE)) + return MFAIL; + return ptr; +} + +#define os2direct_mmap(n) os2mmap(n) + +/* This function supports releasing coalesed segments */ +static int os2munmap(void* ptr, size_t size) { + while (size) { + ULONG ulSize = size; + ULONG ulFlags = 0; + if (DosQueryMem(ptr, &ulSize, &ulFlags) != 0) + return -1; + if ((ulFlags & PAG_BASE) == 0 ||(ulFlags & PAG_COMMIT) == 0 || + ulSize > size) + return -1; + if (DosFreeMem(ptr) != 0) + return -1; + ptr = ( void * ) ( ( char * ) ptr + ulSize ); + size -= ulSize; + } + return 0; +} + +#define CALL_MMAP(s) os2mmap(s) +#define CALL_MUNMAP(a, s) os2munmap((a), (s)) +#define DIRECT_MMAP(s) os2direct_mmap(s) + +#else /* WIN32 */ + +/* Win32 MMAP via VirtualAlloc */ +static void* win32mmap(size_t size) { + void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE); + return (ptr != 0)? ptr: MFAIL; +} + +/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ +static void* win32direct_mmap(size_t size) { + void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, + PAGE_EXECUTE_READWRITE); + return (ptr != 0)? ptr: MFAIL; +} + +/* This function supports releasing coalesed segments */ +static int win32munmap(void* ptr, size_t size) { + MEMORY_BASIC_INFORMATION minfo; + char* cptr = ptr; + while (size) { + if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) + return -1; + if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || + minfo.State != MEM_COMMIT || minfo.RegionSize > size) + return -1; + if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) + return -1; + cptr += minfo.RegionSize; + size -= minfo.RegionSize; + } + return 0; +} + +#define CALL_MMAP(s) win32mmap(s) +#define CALL_MUNMAP(a, s) win32munmap((a), (s)) +#define DIRECT_MMAP(s) win32direct_mmap(s) +#endif /* WIN32 */ +#endif /* HAVE_MMAP */ + +#if HAVE_MMAP && HAVE_MREMAP +#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) +#else /* HAVE_MMAP && HAVE_MREMAP */ +#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL +#endif /* HAVE_MMAP && HAVE_MREMAP */ + +#if HAVE_MORECORE +#define CALL_MORECORE(S) MORECORE(S) +#else /* HAVE_MORECORE */ +#define CALL_MORECORE(S) MFAIL +#endif /* HAVE_MORECORE */ + +/* mstate bit set if contiguous morecore disabled or failed */ +#define USE_NONCONTIGUOUS_BIT (4U) + +/* segment bit set in create_mspace_with_base */ +#define EXTERN_BIT (8U) + + +/* --------------------------- Lock preliminaries ------------------------ */ + +#if USE_LOCKS + +/* + When locks are defined, there are up to two global locks: + + * If HAVE_MORECORE, morecore_mutex protects sequences of calls to + MORECORE. In many cases sys_alloc requires two calls, that should + not be interleaved with calls by other threads. This does not + protect against direct calls to MORECORE by other threads not + using this lock, so there is still code to cope the best we can on + interference. + + * magic_init_mutex ensures that mparams.magic and other + unique mparams values are initialized only once. +*/ + +#if !defined(WIN32) && !defined(__OS2__) +/* By default use posix locks */ +#include +#define MLOCK_T pthread_mutex_t +#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL) +#define ACQUIRE_LOCK(l) pthread_mutex_lock(l) +#define RELEASE_LOCK(l) pthread_mutex_unlock(l) + +#if HAVE_MORECORE +static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif /* HAVE_MORECORE */ + +static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER; + +#elif defined(__OS2__) +#define MLOCK_T HMTX +#define INITIAL_LOCK(l) DosCreateMutexSem(0, l, 0, FALSE) +#define ACQUIRE_LOCK(l) DosRequestMutexSem(*l, SEM_INDEFINITE_WAIT) +#define RELEASE_LOCK(l) DosReleaseMutexSem(*l) +#if HAVE_MORECORE +static MLOCK_T morecore_mutex; +#endif /* HAVE_MORECORE */ +static MLOCK_T magic_init_mutex; + +#else /* WIN32 */ +/* + Because lock-protected regions have bounded times, and there + are no recursive lock calls, we can use simple spinlocks. +*/ + +#define MLOCK_T long +static int win32_acquire_lock (MLOCK_T *sl) { + for (;;) { +#ifdef InterlockedCompareExchangePointer + if (!InterlockedCompareExchange(sl, 1, 0)) + return 0; +#else /* Use older void* version */ + if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0)) + return 0; +#endif /* InterlockedCompareExchangePointer */ + Sleep (0); + } +} + +static void win32_release_lock (MLOCK_T *sl) { + InterlockedExchange (sl, 0); +} + +#define INITIAL_LOCK(l) *(l)=0 +#define ACQUIRE_LOCK(l) win32_acquire_lock(l) +#define RELEASE_LOCK(l) win32_release_lock(l) +#if HAVE_MORECORE +static MLOCK_T morecore_mutex; +#endif /* HAVE_MORECORE */ +static MLOCK_T magic_init_mutex; +#endif /* WIN32 */ + +#define USE_LOCK_BIT (2U) +#else /* USE_LOCKS */ +#define USE_LOCK_BIT (0U) +#define INITIAL_LOCK(l) +#endif /* USE_LOCKS */ + +#if USE_LOCKS && HAVE_MORECORE +#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex); +#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex); +#else /* USE_LOCKS && HAVE_MORECORE */ +#define ACQUIRE_MORECORE_LOCK() +#define RELEASE_MORECORE_LOCK() +#endif /* USE_LOCKS && HAVE_MORECORE */ + +#if USE_LOCKS +#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex); +#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex); +#else /* USE_LOCKS */ +#define ACQUIRE_MAGIC_INIT_LOCK() +#define RELEASE_MAGIC_INIT_LOCK() +#endif /* USE_LOCKS */ + + +/* ----------------------- Chunk representations ------------------------ */ + +/* + (The following includes lightly edited explanations by Colin Plumb.) + + The malloc_chunk declaration below is misleading (but accurate and + necessary). It declares a "view" into memory allowing access to + necessary fields at known offsets from a given base. + + Chunks of memory are maintained using a `boundary tag' method as + originally described by Knuth. (See the paper by Paul Wilson + ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such + techniques.) Sizes of free chunks are stored both in the front of + each chunk and at the end. This makes consolidating fragmented + chunks into bigger chunks fast. The head fields also hold bits + representing whether chunks are free or in use. + + Here are some pictures to make it clearer. They are "exploded" to + show that the state of a chunk can be thought of as extending from + the high 31 bits of the head field of its header through the + prev_foot and PINUSE_BIT bit of the following chunk header. + + A chunk that's in use looks like: + + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of previous chunk (if P = 1) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| + | Size of this chunk 1| +-+ + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | + +- -+ + | | + +- -+ + | : + +- size - sizeof(size_t) available payload bytes -+ + : | + chunk-> +- -+ + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1| + | Size of next chunk (may or may not be in use) | +-+ + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + And if it's free, it looks like this: + + chunk-> +- -+ + | User payload (must be in use, or we would have merged!) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| + | Size of this chunk 0| +-+ + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Next pointer | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Prev pointer | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | : + +- size - sizeof(struct chunk) unused bytes -+ + : | + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of this chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| + | Size of next chunk (must be in use, or we would have merged)| +-+ + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | : + +- User payload -+ + : | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0| + +-+ + Note that since we always merge adjacent free chunks, the chunks + adjacent to a free chunk must be in use. + + Given a pointer to a chunk (which can be derived trivially from the + payload pointer) we can, in O(1) time, find out whether the adjacent + chunks are free, and if so, unlink them from the lists that they + are on and merge them with the current chunk. + + Chunks always begin on even word boundaries, so the mem portion + (which is returned to the user) is also on an even word boundary, and + thus at least double-word aligned. + + The P (PINUSE_BIT) bit, stored in the unused low-order bit of the + chunk size (which is always a multiple of two words), is an in-use + bit for the *previous* chunk. If that bit is *clear*, then the + word before the current chunk size contains the previous chunk + size, and can be used to find the front of the previous chunk. + The very first chunk allocated always has this bit set, preventing + access to non-existent (or non-owned) memory. If pinuse is set for + any given chunk, then you CANNOT determine the size of the + previous chunk, and might even get a memory addressing fault when + trying to do so. + + The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of + the chunk size redundantly records whether the current chunk is + inuse. This redundancy enables usage checks within free and realloc, + and reduces indirection when freeing and consolidating chunks. + + Each freshly allocated chunk must have both cinuse and pinuse set. + That is, each allocated chunk borders either a previously allocated + and still in-use chunk, or the base of its memory arena. This is + ensured by making all allocations from the the `lowest' part of any + found chunk. Further, no free chunk physically borders another one, + so each free chunk is known to be preceded and followed by either + inuse chunks or the ends of memory. + + Note that the `foot' of the current chunk is actually represented + as the prev_foot of the NEXT chunk. This makes it easier to + deal with alignments etc but can be very confusing when trying + to extend or adapt this code. + + The exceptions to all this are + + 1. The special chunk `top' is the top-most available chunk (i.e., + the one bordering the end of available memory). It is treated + specially. Top is never included in any bin, is used only if + no other chunk is available, and is released back to the + system if it is very large (see M_TRIM_THRESHOLD). In effect, + the top chunk is treated as larger (and thus less well + fitting) than any other available chunk. The top chunk + doesn't update its trailing size field since there is no next + contiguous chunk that would have to index off it. However, + space is still allocated for it (TOP_FOOT_SIZE) to enable + separation or merging when space is extended. + + 3. Chunks allocated via mmap, which have the lowest-order bit + (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set + PINUSE_BIT in their head fields. Because they are allocated + one-by-one, each must carry its own prev_foot field, which is + also used to hold the offset this chunk has within its mmapped + region, which is needed to preserve alignment. Each mmapped + chunk is trailed by the first two fields of a fake next-chunk + for sake of usage checks. + +*/ + +struct malloc_chunk { + size_t prev_foot; /* Size of previous chunk (if free). */ + size_t head; /* Size and inuse bits. */ + struct malloc_chunk* fd; /* double links -- used only if free. */ + struct malloc_chunk* bk; +}; + +typedef struct malloc_chunk mchunk; +typedef struct malloc_chunk* mchunkptr; +typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ +typedef size_t bindex_t; /* Described below */ +typedef unsigned int binmap_t; /* Described below */ +typedef unsigned int flag_t; /* The type of various bit flag sets */ + +/* ------------------- Chunks sizes and alignments ----------------------- */ + +#define MCHUNK_SIZE (sizeof(mchunk)) + +#if FOOTERS +#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) +#else /* FOOTERS */ +#define CHUNK_OVERHEAD (SIZE_T_SIZE) +#endif /* FOOTERS */ + +/* MMapped chunks need a second word of overhead ... */ +#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) +/* ... and additional padding for fake next-chunk at foot */ +#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) + +/* The smallest size we can malloc is an aligned minimal chunk */ +#define MIN_CHUNK_SIZE\ + ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) + +/* conversion from malloc headers to user pointers, and back */ +#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) +#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) +/* chunk associated with aligned address A */ +#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) + +/* Bounds on request (not chunk) sizes. */ +#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) +#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) + +/* pad request bytes into a usable size */ +#define pad_request(req) \ + (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) + +/* pad request, checking for minimum (but not maximum) */ +#define request2size(req) \ + (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) + + +/* ------------------ Operations on head and foot fields ----------------- */ + +/* + The head field of a chunk is or'ed with PINUSE_BIT when previous + adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in + use. If the chunk was obtained with mmap, the prev_foot field has + IS_MMAPPED_BIT set, otherwise holding the offset of the base of the + mmapped region to the base of the chunk. +*/ + +#define PINUSE_BIT (SIZE_T_ONE) +#define CINUSE_BIT (SIZE_T_TWO) +#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) + +/* Head value for fenceposts */ +#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) + +/* extraction of fields from head words */ +#define cinuse(p) ((p)->head & CINUSE_BIT) +#define pinuse(p) ((p)->head & PINUSE_BIT) +#define chunksize(p) ((p)->head & ~(INUSE_BITS)) + +#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) +#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT) + +/* Treat space at ptr +/- offset as a chunk */ +#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) +#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) + +/* Ptr to next or previous physical malloc_chunk. */ +#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) +#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) + +/* extract next chunk's pinuse bit */ +#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) + +/* Get/set size at footer */ +#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) +#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) + +/* Set size, pinuse bit, and foot */ +#define set_size_and_pinuse_of_free_chunk(p, s)\ + ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) + +/* Set size, pinuse bit, foot, and clear next pinuse */ +#define set_free_with_pinuse(p, s, n)\ + (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) + +#define is_mmapped(p)\ + (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) + +/* Get the internal overhead associated with chunk p */ +#define overhead_for(p)\ + (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) + +/* Return true if malloced space is not necessarily cleared */ +#if MMAP_CLEARS +#define calloc_must_clear(p) (!is_mmapped(p)) +#else /* MMAP_CLEARS */ +#define calloc_must_clear(p) (1) +#endif /* MMAP_CLEARS */ + +/* ---------------------- Overlaid data structures ----------------------- */ + +/* + When chunks are not in use, they are treated as nodes of either + lists or trees. + + "Small" chunks are stored in circular doubly-linked lists, and look + like this: + + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of previous chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `head:' | Size of chunk, in bytes |P| + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Forward pointer to next chunk in list | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Back pointer to previous chunk in list | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Unused space (may be 0 bytes long) . + . . + . | +nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `foot:' | Size of chunk, in bytes | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Larger chunks are kept in a form of bitwise digital trees (aka + tries) keyed on chunksizes. Because malloc_tree_chunks are only for + free chunks greater than 256 bytes, their size doesn't impose any + constraints on user chunk sizes. Each node looks like: + + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of previous chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `head:' | Size of chunk, in bytes |P| + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Forward pointer to next chunk of same size | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Back pointer to previous chunk of same size | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Pointer to left child (child[0]) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Pointer to right child (child[1]) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Pointer to parent | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | bin index of this chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Unused space . + . | +nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `foot:' | Size of chunk, in bytes | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Each tree holding treenodes is a tree of unique chunk sizes. Chunks + of the same size are arranged in a circularly-linked list, with only + the oldest chunk (the next to be used, in our FIFO ordering) + actually in the tree. (Tree members are distinguished by a non-null + parent pointer.) If a chunk with the same size an an existing node + is inserted, it is linked off the existing node using pointers that + work in the same way as fd/bk pointers of small chunks. + + Each tree contains a power of 2 sized range of chunk sizes (the + smallest is 0x100 <= x < 0x180), which is is divided in half at each + tree level, with the chunks in the smaller half of the range (0x100 + <= x < 0x140 for the top nose) in the left subtree and the larger + half (0x140 <= x < 0x180) in the right subtree. This is, of course, + done by inspecting individual bits. + + Using these rules, each node's left subtree contains all smaller + sizes than its right subtree. However, the node at the root of each + subtree has no particular ordering relationship to either. (The + dividing line between the subtree sizes is based on trie relation.) + If we remove the last chunk of a given size from the interior of the + tree, we need to replace it with a leaf node. The tree ordering + rules permit a node to be replaced by any leaf below it. + + The smallest chunk in a tree (a common operation in a best-fit + allocator) can be found by walking a path to the leftmost leaf in + the tree. Unlike a usual binary tree, where we follow left child + pointers until we reach a null, here we follow the right child + pointer any time the left one is null, until we reach a leaf with + both child pointers null. The smallest chunk in the tree will be + somewhere along that path. + + The worst case number of steps to add, find, or remove a node is + bounded by the number of bits differentiating chunks within + bins. Under current bin calculations, this ranges from 6 up to 21 + (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case + is of course much better. +*/ + +struct malloc_tree_chunk { + /* The first four fields must be compatible with malloc_chunk */ + size_t prev_foot; + size_t head; + struct malloc_tree_chunk* fd; + struct malloc_tree_chunk* bk; + + struct malloc_tree_chunk* child[2]; + struct malloc_tree_chunk* parent; + bindex_t index; +}; + +typedef struct malloc_tree_chunk tchunk; +typedef struct malloc_tree_chunk* tchunkptr; +typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ + +/* A little helper macro for trees */ +#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) + +/* ----------------------------- Segments -------------------------------- */ + +/* + Each malloc space may include non-contiguous segments, held in a + list headed by an embedded malloc_segment record representing the + top-most space. Segments also include flags holding properties of + the space. Large chunks that are directly allocated by mmap are not + included in this list. They are instead independently created and + destroyed without otherwise keeping track of them. + + Segment management mainly comes into play for spaces allocated by + MMAP. Any call to MMAP might or might not return memory that is + adjacent to an existing segment. MORECORE normally contiguously + extends the current space, so this space is almost always adjacent, + which is simpler and faster to deal with. (This is why MORECORE is + used preferentially to MMAP when both are available -- see + sys_alloc.) When allocating using MMAP, we don't use any of the + hinting mechanisms (inconsistently) supported in various + implementations of unix mmap, or distinguish reserving from + committing memory. Instead, we just ask for space, and exploit + contiguity when we get it. It is probably possible to do + better than this on some systems, but no general scheme seems + to be significantly better. + + Management entails a simpler variant of the consolidation scheme + used for chunks to reduce fragmentation -- new adjacent memory is + normally prepended or appended to an existing segment. However, + there are limitations compared to chunk consolidation that mostly + reflect the fact that segment processing is relatively infrequent + (occurring only when getting memory from system) and that we + don't expect to have huge numbers of segments: + + * Segments are not indexed, so traversal requires linear scans. (It + would be possible to index these, but is not worth the extra + overhead and complexity for most programs on most platforms.) + * New segments are only appended to old ones when holding top-most + memory; if they cannot be prepended to others, they are held in + different segments. + + Except for the top-most segment of an mstate, each segment record + is kept at the tail of its segment. Segments are added by pushing + segment records onto the list headed by &mstate.seg for the + containing mstate. + + Segment flags control allocation/merge/deallocation policies: + * If EXTERN_BIT set, then we did not allocate this segment, + and so should not try to deallocate or merge with others. + (This currently holds only for the initial segment passed + into create_mspace_with_base.) + * If IS_MMAPPED_BIT set, the segment may be merged with + other surrounding mmapped segments and trimmed/de-allocated + using munmap. + * If neither bit is set, then the segment was obtained using + MORECORE so can be merged with surrounding MORECORE'd segments + and deallocated/trimmed using MORECORE with negative arguments. +*/ + +struct malloc_segment { + char* base; /* base address */ + size_t size; /* allocated size */ + struct malloc_segment* next; /* ptr to next segment */ +#if FFI_MMAP_EXEC_WRIT + /* The mmap magic is supposed to store the address of the executable + segment at the very end of the requested block. */ + +# define mmap_exec_offset(b,s) (*(ptrdiff_t*)((b)+(s)-sizeof(ptrdiff_t))) + + /* We can only merge segments if their corresponding executable + segments are at identical offsets. */ +# define check_segment_merge(S,b,s) \ + (mmap_exec_offset((b),(s)) == (S)->exec_offset) + +# define add_segment_exec_offset(p,S) ((char*)(p) + (S)->exec_offset) +# define sub_segment_exec_offset(p,S) ((char*)(p) - (S)->exec_offset) + + /* The removal of sflags only works with HAVE_MORECORE == 0. */ + +# define get_segment_flags(S) (IS_MMAPPED_BIT) +# define set_segment_flags(S,v) \ + (((v) != IS_MMAPPED_BIT) ? (ABORT, (v)) : \ + (((S)->exec_offset = \ + mmap_exec_offset((S)->base, (S)->size)), \ + (mmap_exec_offset((S)->base + (S)->exec_offset, (S)->size) != \ + (S)->exec_offset) ? (ABORT, (v)) : \ + (mmap_exec_offset((S)->base, (S)->size) = 0), (v))) + + /* We use an offset here, instead of a pointer, because then, when + base changes, we don't have to modify this. On architectures + with segmented addresses, this might not work. */ + ptrdiff_t exec_offset; +#else + +# define get_segment_flags(S) ((S)->sflags) +# define set_segment_flags(S,v) ((S)->sflags = (v)) +# define check_segment_merge(S,b,s) (1) + + flag_t sflags; /* mmap and extern flag */ +#endif +}; + +#define is_mmapped_segment(S) (get_segment_flags(S) & IS_MMAPPED_BIT) +#define is_extern_segment(S) (get_segment_flags(S) & EXTERN_BIT) + +typedef struct malloc_segment msegment; +typedef struct malloc_segment* msegmentptr; + +/* ---------------------------- malloc_state ----------------------------- */ + +/* + A malloc_state holds all of the bookkeeping for a space. + The main fields are: + + Top + The topmost chunk of the currently active segment. Its size is + cached in topsize. The actual size of topmost space is + topsize+TOP_FOOT_SIZE, which includes space reserved for adding + fenceposts and segment records if necessary when getting more + space from the system. The size at which to autotrim top is + cached from mparams in trim_check, except that it is disabled if + an autotrim fails. + + Designated victim (dv) + This is the preferred chunk for servicing small requests that + don't have exact fits. It is normally the chunk split off most + recently to service another small request. Its size is cached in + dvsize. The link fields of this chunk are not maintained since it + is not kept in a bin. + + SmallBins + An array of bin headers for free chunks. These bins hold chunks + with sizes less than MIN_LARGE_SIZE bytes. Each bin contains + chunks of all the same size, spaced 8 bytes apart. To simplify + use in double-linked lists, each bin header acts as a malloc_chunk + pointing to the real first node, if it exists (else pointing to + itself). This avoids special-casing for headers. But to avoid + waste, we allocate only the fd/bk pointers of bins, and then use + repositioning tricks to treat these as the fields of a chunk. + + TreeBins + Treebins are pointers to the roots of trees holding a range of + sizes. There are 2 equally spaced treebins for each power of two + from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything + larger. + + Bin maps + There is one bit map for small bins ("smallmap") and one for + treebins ("treemap). Each bin sets its bit when non-empty, and + clears the bit when empty. Bit operations are then used to avoid + bin-by-bin searching -- nearly all "search" is done without ever + looking at bins that won't be selected. The bit maps + conservatively use 32 bits per map word, even if on 64bit system. + For a good description of some of the bit-based techniques used + here, see Henry S. Warren Jr's book "Hacker's Delight" (and + supplement at http://hackersdelight.org/). Many of these are + intended to reduce the branchiness of paths through malloc etc, as + well as to reduce the number of memory locations read or written. + + Segments + A list of segments headed by an embedded malloc_segment record + representing the initial space. + + Address check support + The least_addr field is the least address ever obtained from + MORECORE or MMAP. Attempted frees and reallocs of any address less + than this are trapped (unless INSECURE is defined). + + Magic tag + A cross-check field that should always hold same value as mparams.magic. + + Flags + Bits recording whether to use MMAP, locks, or contiguous MORECORE + + Statistics + Each space keeps track of current and maximum system memory + obtained via MORECORE or MMAP. + + Locking + If USE_LOCKS is defined, the "mutex" lock is acquired and released + around every public call using this mspace. +*/ + +/* Bin types, widths and sizes */ +#define NSMALLBINS (32U) +#define NTREEBINS (32U) +#define SMALLBIN_SHIFT (3U) +#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) +#define TREEBIN_SHIFT (8U) +#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) +#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) +#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) + +struct malloc_state { + binmap_t smallmap; + binmap_t treemap; + size_t dvsize; + size_t topsize; + char* least_addr; + mchunkptr dv; + mchunkptr top; + size_t trim_check; + size_t magic; + mchunkptr smallbins[(NSMALLBINS+1)*2]; + tbinptr treebins[NTREEBINS]; + size_t footprint; + size_t max_footprint; + flag_t mflags; +#if USE_LOCKS + MLOCK_T mutex; /* locate lock among fields that rarely change */ +#endif /* USE_LOCKS */ + msegment seg; +}; + +typedef struct malloc_state* mstate; + +/* ------------- Global malloc_state and malloc_params ------------------- */ + +/* + malloc_params holds global properties, including those that can be + dynamically set using mallopt. There is a single instance, mparams, + initialized in init_mparams. +*/ + +struct malloc_params { + size_t magic; + size_t page_size; + size_t granularity; + size_t mmap_threshold; + size_t trim_threshold; + flag_t default_mflags; +}; + +static struct malloc_params mparams; + +/* The global malloc_state used for all non-"mspace" calls */ +static struct malloc_state _gm_; +#define gm (&_gm_) +#define is_global(M) ((M) == &_gm_) +#define is_initialized(M) ((M)->top != 0) + +/* -------------------------- system alloc setup ------------------------- */ + +/* Operations on mflags */ + +#define use_lock(M) ((M)->mflags & USE_LOCK_BIT) +#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) +#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) + +#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT) +#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) +#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) + +#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) +#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) + +#define set_lock(M,L)\ + ((M)->mflags = (L)?\ + ((M)->mflags | USE_LOCK_BIT) :\ + ((M)->mflags & ~USE_LOCK_BIT)) + +/* page-align a size */ +#define page_align(S)\ + (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE)) + +/* granularity-align a size */ +#define granularity_align(S)\ + (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE)) + +#define is_page_aligned(S)\ + (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) +#define is_granularity_aligned(S)\ + (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) + +/* True if segment S holds address A */ +#define segment_holds(S, A)\ + ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) + +/* Return segment holding given address */ +static msegmentptr segment_holding(mstate m, char* addr) { + msegmentptr sp = &m->seg; + for (;;) { + if (addr >= sp->base && addr < sp->base + sp->size) + return sp; + if ((sp = sp->next) == 0) + return 0; + } +} + +/* Return true if segment contains a segment link */ +static int has_segment_link(mstate m, msegmentptr ss) { + msegmentptr sp = &m->seg; + for (;;) { + if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) + return 1; + if ((sp = sp->next) == 0) + return 0; + } +} + +#ifndef MORECORE_CANNOT_TRIM +#define should_trim(M,s) ((s) > (M)->trim_check) +#else /* MORECORE_CANNOT_TRIM */ +#define should_trim(M,s) (0) +#endif /* MORECORE_CANNOT_TRIM */ + +/* + TOP_FOOT_SIZE is padding at the end of a segment, including space + that may be needed to place segment records and fenceposts when new + noncontiguous segments are added. +*/ +#define TOP_FOOT_SIZE\ + (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) + + +/* ------------------------------- Hooks -------------------------------- */ + +/* + PREACTION should be defined to return 0 on success, and nonzero on + failure. If you are not using locking, you can redefine these to do + anything you like. +*/ + +#if USE_LOCKS + +/* Ensure locks are initialized */ +#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams()) + +#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0) +#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); } +#else /* USE_LOCKS */ + +#ifndef PREACTION +#define PREACTION(M) (0) +#endif /* PREACTION */ + +#ifndef POSTACTION +#define POSTACTION(M) +#endif /* POSTACTION */ + +#endif /* USE_LOCKS */ + +/* + CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses. + USAGE_ERROR_ACTION is triggered on detected bad frees and + reallocs. The argument p is an address that might have triggered the + fault. It is ignored by the two predefined actions, but might be + useful in custom actions that try to help diagnose errors. +*/ + +#if PROCEED_ON_ERROR + +/* A count of the number of corruption errors causing resets */ +int malloc_corruption_error_count; + +/* default corruption action */ +static void reset_on_error(mstate m); + +#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m) +#define USAGE_ERROR_ACTION(m, p) + +#else /* PROCEED_ON_ERROR */ + +#ifndef CORRUPTION_ERROR_ACTION +#define CORRUPTION_ERROR_ACTION(m) ABORT +#endif /* CORRUPTION_ERROR_ACTION */ + +#ifndef USAGE_ERROR_ACTION +#define USAGE_ERROR_ACTION(m,p) ABORT +#endif /* USAGE_ERROR_ACTION */ + +#endif /* PROCEED_ON_ERROR */ + +/* -------------------------- Debugging setup ---------------------------- */ + +#if ! DEBUG + +#define check_free_chunk(M,P) +#define check_inuse_chunk(M,P) +#define check_malloced_chunk(M,P,N) +#define check_mmapped_chunk(M,P) +#define check_malloc_state(M) +#define check_top_chunk(M,P) + +#else /* DEBUG */ +#define check_free_chunk(M,P) do_check_free_chunk(M,P) +#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P) +#define check_top_chunk(M,P) do_check_top_chunk(M,P) +#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N) +#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) +#define check_malloc_state(M) do_check_malloc_state(M) + +static void do_check_any_chunk(mstate m, mchunkptr p); +static void do_check_top_chunk(mstate m, mchunkptr p); +static void do_check_mmapped_chunk(mstate m, mchunkptr p); +static void do_check_inuse_chunk(mstate m, mchunkptr p); +static void do_check_free_chunk(mstate m, mchunkptr p); +static void do_check_malloced_chunk(mstate m, void* mem, size_t s); +static void do_check_tree(mstate m, tchunkptr t); +static void do_check_treebin(mstate m, bindex_t i); +static void do_check_smallbin(mstate m, bindex_t i); +static void do_check_malloc_state(mstate m); +static int bin_find(mstate m, mchunkptr x); +static size_t traverse_and_check(mstate m); +#endif /* DEBUG */ + +/* ---------------------------- Indexing Bins ---------------------------- */ + +#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) +#define small_index(s) ((s) >> SMALLBIN_SHIFT) +#define small_index2size(i) ((i) << SMALLBIN_SHIFT) +#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) + +/* addressing by index. See above about smallbin repositioning */ +#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) +#define treebin_at(M,i) (&((M)->treebins[i])) + +/* assign tree index for size S to variable I */ +#if defined(__GNUC__) && defined(__i386__) +#define compute_tree_index(S, I)\ +{\ + size_t X = S >> TREEBIN_SHIFT;\ + if (X == 0)\ + I = 0;\ + else if (X > 0xFFFF)\ + I = NTREEBINS-1;\ + else {\ + unsigned int K;\ + __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\ + I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ + }\ +} +#else /* GNUC */ +#define compute_tree_index(S, I)\ +{\ + size_t X = S >> TREEBIN_SHIFT;\ + if (X == 0)\ + I = 0;\ + else if (X > 0xFFFF)\ + I = NTREEBINS-1;\ + else {\ + unsigned int Y = (unsigned int)X;\ + unsigned int N = ((Y - 0x100) >> 16) & 8;\ + unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\ + N += K;\ + N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\ + K = 14 - N + ((Y <<= K) >> 15);\ + I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\ + }\ +} +#endif /* GNUC */ + +/* Bit representing maximum resolved size in a treebin at i */ +#define bit_for_tree_index(i) \ + (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) + +/* Shift placing maximum resolved bit in a treebin at i as sign bit */ +#define leftshift_for_tree_index(i) \ + ((i == NTREEBINS-1)? 0 : \ + ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2))) + +/* The size of the smallest chunk held in bin with index i */ +#define minsize_for_tree_index(i) \ + ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \ + (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1))) + + +/* ------------------------ Operations on bin maps ----------------------- */ + +/* bit corresponding to given index */ +#define idx2bit(i) ((binmap_t)(1) << (i)) + +/* Mark/Clear bits with given index */ +#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i)) +#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i)) +#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i)) + +#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i)) +#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i)) +#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) + +/* index corresponding to given bit */ + +#if defined(__GNUC__) && defined(__i386__) +#define compute_bit2idx(X, I)\ +{\ + unsigned int J;\ + __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\ + I = (bindex_t)J;\ +} + +#else /* GNUC */ +#if USE_BUILTIN_FFS +#define compute_bit2idx(X, I) I = __builtin_ffs(X)-1 + +#else /* USE_BUILTIN_FFS */ +#define compute_bit2idx(X, I)\ +{\ + unsigned int Y = X - 1;\ + unsigned int K = Y >> (16-4) & 16;\ + unsigned int N = K; Y >>= K;\ + N += K = Y >> (8-3) & 8; Y >>= K;\ + N += K = Y >> (4-2) & 4; Y >>= K;\ + N += K = Y >> (2-1) & 2; Y >>= K;\ + N += K = Y >> (1-0) & 1; Y >>= K;\ + I = (bindex_t)(N + Y);\ +} +#endif /* USE_BUILTIN_FFS */ +#endif /* GNUC */ + +/* isolate the least set bit of a bitmap */ +#define least_bit(x) ((x) & -(x)) + +/* mask with all bits to left of least bit of x on */ +#define left_bits(x) ((x<<1) | -(x<<1)) + +/* mask with all bits to left of or equal to least bit of x on */ +#define same_or_left_bits(x) ((x) | -(x)) + + +/* ----------------------- Runtime Check Support ------------------------- */ + +/* + For security, the main invariant is that malloc/free/etc never + writes to a static address other than malloc_state, unless static + malloc_state itself has been corrupted, which cannot occur via + malloc (because of these checks). In essence this means that we + believe all pointers, sizes, maps etc held in malloc_state, but + check all of those linked or offsetted from other embedded data + structures. These checks are interspersed with main code in a way + that tends to minimize their run-time cost. + + When FOOTERS is defined, in addition to range checking, we also + verify footer fields of inuse chunks, which can be used guarantee + that the mstate controlling malloc/free is intact. This is a + streamlined version of the approach described by William Robertson + et al in "Run-time Detection of Heap-based Overflows" LISA'03 + http://www.usenix.org/events/lisa03/tech/robertson.html The footer + of an inuse chunk holds the xor of its mstate and a random seed, + that is checked upon calls to free() and realloc(). This is + (probablistically) unguessable from outside the program, but can be + computed by any code successfully malloc'ing any chunk, so does not + itself provide protection against code that has already broken + security through some other means. Unlike Robertson et al, we + always dynamically check addresses of all offset chunks (previous, + next, etc). This turns out to be cheaper than relying on hashes. +*/ + +#if !INSECURE +/* Check if address a is at least as high as any from MORECORE or MMAP */ +#define ok_address(M, a) ((char*)(a) >= (M)->least_addr) +/* Check if address of next chunk n is higher than base chunk p */ +#define ok_next(p, n) ((char*)(p) < (char*)(n)) +/* Check if p has its cinuse bit on */ +#define ok_cinuse(p) cinuse(p) +/* Check if p has its pinuse bit on */ +#define ok_pinuse(p) pinuse(p) + +#else /* !INSECURE */ +#define ok_address(M, a) (1) +#define ok_next(b, n) (1) +#define ok_cinuse(p) (1) +#define ok_pinuse(p) (1) +#endif /* !INSECURE */ + +#if (FOOTERS && !INSECURE) +/* Check if (alleged) mstate m has expected magic field */ +#define ok_magic(M) ((M)->magic == mparams.magic) +#else /* (FOOTERS && !INSECURE) */ +#define ok_magic(M) (1) +#endif /* (FOOTERS && !INSECURE) */ + + +/* In gcc, use __builtin_expect to minimize impact of checks */ +#if !INSECURE +#if defined(__GNUC__) && __GNUC__ >= 3 +#define RTCHECK(e) __builtin_expect(e, 1) +#else /* GNUC */ +#define RTCHECK(e) (e) +#endif /* GNUC */ +#else /* !INSECURE */ +#define RTCHECK(e) (1) +#endif /* !INSECURE */ + +/* macros to set up inuse chunks with or without footers */ + +#if !FOOTERS + +#define mark_inuse_foot(M,p,s) + +/* Set cinuse bit and pinuse bit of next chunk */ +#define set_inuse(M,p,s)\ + ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ + ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) + +/* Set cinuse and pinuse of this chunk and pinuse of next chunk */ +#define set_inuse_and_pinuse(M,p,s)\ + ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ + ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) + +/* Set size, cinuse and pinuse bit of this chunk */ +#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ + ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) + +#else /* FOOTERS */ + +/* Set foot of inuse chunk to be xor of mstate and seed */ +#define mark_inuse_foot(M,p,s)\ + (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic)) + +#define get_mstate_for(p)\ + ((mstate)(((mchunkptr)((char*)(p) +\ + (chunksize(p))))->prev_foot ^ mparams.magic)) + +#define set_inuse(M,p,s)\ + ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ + (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \ + mark_inuse_foot(M,p,s)) + +#define set_inuse_and_pinuse(M,p,s)\ + ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ + (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\ + mark_inuse_foot(M,p,s)) + +#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ + ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ + mark_inuse_foot(M, p, s)) + +#endif /* !FOOTERS */ + +/* ---------------------------- setting mparams -------------------------- */ + +/* Initialize mparams */ +static int init_mparams(void) { + if (mparams.page_size == 0) { + size_t s; + + mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; + mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; +#if MORECORE_CONTIGUOUS + mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; +#else /* MORECORE_CONTIGUOUS */ + mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; +#endif /* MORECORE_CONTIGUOUS */ + +#if (FOOTERS && !INSECURE) + { +#if USE_DEV_RANDOM + int fd; + unsigned char buf[sizeof(size_t)]; + /* Try to use /dev/urandom, else fall back on using time */ + if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && + read(fd, buf, sizeof(buf)) == sizeof(buf)) { + s = *((size_t *) buf); + close(fd); + } + else +#endif /* USE_DEV_RANDOM */ + s = (size_t)(time(0) ^ (size_t)0x55555555U); + + s |= (size_t)8U; /* ensure nonzero */ + s &= ~(size_t)7U; /* improve chances of fault for bad values */ + + } +#else /* (FOOTERS && !INSECURE) */ + s = (size_t)0x58585858U; +#endif /* (FOOTERS && !INSECURE) */ + ACQUIRE_MAGIC_INIT_LOCK(); + if (mparams.magic == 0) { + mparams.magic = s; + /* Set up lock for main malloc area */ + INITIAL_LOCK(&gm->mutex); + gm->mflags = mparams.default_mflags; + } + RELEASE_MAGIC_INIT_LOCK(); + +#if !defined(WIN32) && !defined(__OS2__) + mparams.page_size = malloc_getpagesize; + mparams.granularity = ((DEFAULT_GRANULARITY != 0)? + DEFAULT_GRANULARITY : mparams.page_size); +#elif defined (__OS2__) + /* if low-memory is used, os2munmap() would break + if it were anything other than 64k */ + mparams.page_size = 4096u; + mparams.granularity = 65536u; +#else /* WIN32 */ + { + SYSTEM_INFO system_info; + GetSystemInfo(&system_info); + mparams.page_size = system_info.dwPageSize; + mparams.granularity = system_info.dwAllocationGranularity; + } +#endif /* WIN32 */ + + /* Sanity-check configuration: + size_t must be unsigned and as wide as pointer type. + ints must be at least 4 bytes. + alignment must be at least 8. + Alignment, min chunk size, and page size must all be powers of 2. + */ + if ((sizeof(size_t) != sizeof(char*)) || + (MAX_SIZE_T < MIN_CHUNK_SIZE) || + (sizeof(int) < 4) || + (MALLOC_ALIGNMENT < (size_t)8U) || + ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || + ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || + ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) || + ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0)) + ABORT; + } + return 0; +} + +/* support for mallopt */ +static int change_mparam(int param_number, int value) { + size_t val = (size_t)value; + init_mparams(); + switch(param_number) { + case M_TRIM_THRESHOLD: + mparams.trim_threshold = val; + return 1; + case M_GRANULARITY: + if (val >= mparams.page_size && ((val & (val-1)) == 0)) { + mparams.granularity = val; + return 1; + } + else + return 0; + case M_MMAP_THRESHOLD: + mparams.mmap_threshold = val; + return 1; + default: + return 0; + } +} + +#if DEBUG +/* ------------------------- Debugging Support --------------------------- */ + +/* Check properties of any chunk, whether free, inuse, mmapped etc */ +static void do_check_any_chunk(mstate m, mchunkptr p) { + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); +} + +/* Check properties of top chunk */ +static void do_check_top_chunk(mstate m, mchunkptr p) { + msegmentptr sp = segment_holding(m, (char*)p); + size_t sz = chunksize(p); + assert(sp != 0); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(sz == m->topsize); + assert(sz > 0); + assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); + assert(pinuse(p)); + assert(!next_pinuse(p)); +} + +/* Check properties of (inuse) mmapped chunks */ +static void do_check_mmapped_chunk(mstate m, mchunkptr p) { + size_t sz = chunksize(p); + size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); + assert(is_mmapped(p)); + assert(use_mmap(m)); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(!is_small(sz)); + assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); + assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); + assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); +} + +/* Check properties of inuse chunks */ +static void do_check_inuse_chunk(mstate m, mchunkptr p) { + do_check_any_chunk(m, p); + assert(cinuse(p)); + assert(next_pinuse(p)); + /* If not pinuse and not mmapped, previous chunk has OK offset */ + assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); + if (is_mmapped(p)) + do_check_mmapped_chunk(m, p); +} + +/* Check properties of free chunks */ +static void do_check_free_chunk(mstate m, mchunkptr p) { + size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); + mchunkptr next = chunk_plus_offset(p, sz); + do_check_any_chunk(m, p); + assert(!cinuse(p)); + assert(!next_pinuse(p)); + assert (!is_mmapped(p)); + if (p != m->dv && p != m->top) { + if (sz >= MIN_CHUNK_SIZE) { + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(is_aligned(chunk2mem(p))); + assert(next->prev_foot == sz); + assert(pinuse(p)); + assert (next == m->top || cinuse(next)); + assert(p->fd->bk == p); + assert(p->bk->fd == p); + } + else /* markers are always of size SIZE_T_SIZE */ + assert(sz == SIZE_T_SIZE); + } +} + +/* Check properties of malloced chunks at the point they are malloced */ +static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); + do_check_inuse_chunk(m, p); + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(sz >= MIN_CHUNK_SIZE); + assert(sz >= s); + /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ + assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); + } +} + +/* Check a tree and its subtrees. */ +static void do_check_tree(mstate m, tchunkptr t) { + tchunkptr head = 0; + tchunkptr u = t; + bindex_t tindex = t->index; + size_t tsize = chunksize(t); + bindex_t idx; + compute_tree_index(tsize, idx); + assert(tindex == idx); + assert(tsize >= MIN_LARGE_SIZE); + assert(tsize >= minsize_for_tree_index(idx)); + assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); + + do { /* traverse through chain of same-sized nodes */ + do_check_any_chunk(m, ((mchunkptr)u)); + assert(u->index == tindex); + assert(chunksize(u) == tsize); + assert(!cinuse(u)); + assert(!next_pinuse(u)); + assert(u->fd->bk == u); + assert(u->bk->fd == u); + if (u->parent == 0) { + assert(u->child[0] == 0); + assert(u->child[1] == 0); + } + else { + assert(head == 0); /* only one node on chain has parent */ + head = u; + assert(u->parent != u); + assert (u->parent->child[0] == u || + u->parent->child[1] == u || + *((tbinptr*)(u->parent)) == u); + if (u->child[0] != 0) { + assert(u->child[0]->parent == u); + assert(u->child[0] != u); + do_check_tree(m, u->child[0]); + } + if (u->child[1] != 0) { + assert(u->child[1]->parent == u); + assert(u->child[1] != u); + do_check_tree(m, u->child[1]); + } + if (u->child[0] != 0 && u->child[1] != 0) { + assert(chunksize(u->child[0]) < chunksize(u->child[1])); + } + } + u = u->fd; + } while (u != t); + assert(head != 0); +} + +/* Check all the chunks in a treebin. */ +static void do_check_treebin(mstate m, bindex_t i) { + tbinptr* tb = treebin_at(m, i); + tchunkptr t = *tb; + int empty = (m->treemap & (1U << i)) == 0; + if (t == 0) + assert(empty); + if (!empty) + do_check_tree(m, t); +} + +/* Check all the chunks in a smallbin. */ +static void do_check_smallbin(mstate m, bindex_t i) { + sbinptr b = smallbin_at(m, i); + mchunkptr p = b->bk; + unsigned int empty = (m->smallmap & (1U << i)) == 0; + if (p == b) + assert(empty); + if (!empty) { + for (; p != b; p = p->bk) { + size_t size = chunksize(p); + mchunkptr q; + /* each chunk claims to be free */ + do_check_free_chunk(m, p); + /* chunk belongs in bin */ + assert(small_index(size) == i); + assert(p->bk == b || chunksize(p->bk) == chunksize(p)); + /* chunk is followed by an inuse chunk */ + q = next_chunk(p); + if (q->head != FENCEPOST_HEAD) + do_check_inuse_chunk(m, q); + } + } +} + +/* Find x in a bin. Used in other check functions. */ +static int bin_find(mstate m, mchunkptr x) { + size_t size = chunksize(x); + if (is_small(size)) { + bindex_t sidx = small_index(size); + sbinptr b = smallbin_at(m, sidx); + if (smallmap_is_marked(m, sidx)) { + mchunkptr p = b; + do { + if (p == x) + return 1; + } while ((p = p->fd) != b); + } + } + else { + bindex_t tidx; + compute_tree_index(size, tidx); + if (treemap_is_marked(m, tidx)) { + tchunkptr t = *treebin_at(m, tidx); + size_t sizebits = size << leftshift_for_tree_index(tidx); + while (t != 0 && chunksize(t) != size) { + t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; + sizebits <<= 1; + } + if (t != 0) { + tchunkptr u = t; + do { + if (u == (tchunkptr)x) + return 1; + } while ((u = u->fd) != t); + } + } + } + return 0; +} + +/* Traverse each chunk and check it; return total */ +static size_t traverse_and_check(mstate m) { + size_t sum = 0; + if (is_initialized(m)) { + msegmentptr s = &m->seg; + sum += m->topsize + TOP_FOOT_SIZE; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + mchunkptr lastq = 0; + assert(pinuse(q)); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + sum += chunksize(q); + if (cinuse(q)) { + assert(!bin_find(m, q)); + do_check_inuse_chunk(m, q); + } + else { + assert(q == m->dv || bin_find(m, q)); + assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ + do_check_free_chunk(m, q); + } + lastq = q; + q = next_chunk(q); + } + s = s->next; + } + } + return sum; +} + +/* Check all properties of malloc_state. */ +static void do_check_malloc_state(mstate m) { + bindex_t i; + size_t total; + /* check bins */ + for (i = 0; i < NSMALLBINS; ++i) + do_check_smallbin(m, i); + for (i = 0; i < NTREEBINS; ++i) + do_check_treebin(m, i); + + if (m->dvsize != 0) { /* check dv chunk */ + do_check_any_chunk(m, m->dv); + assert(m->dvsize == chunksize(m->dv)); + assert(m->dvsize >= MIN_CHUNK_SIZE); + assert(bin_find(m, m->dv) == 0); + } + + if (m->top != 0) { /* check top chunk */ + do_check_top_chunk(m, m->top); + assert(m->topsize == chunksize(m->top)); + assert(m->topsize > 0); + assert(bin_find(m, m->top) == 0); + } + + total = traverse_and_check(m); + assert(total <= m->footprint); + assert(m->footprint <= m->max_footprint); +} +#endif /* DEBUG */ + +/* ----------------------------- statistics ------------------------------ */ + +#if !NO_MALLINFO +static struct mallinfo internal_mallinfo(mstate m) { + struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + if (!PREACTION(m)) { + check_malloc_state(m); + if (is_initialized(m)) { + size_t nfree = SIZE_T_ONE; /* top always free */ + size_t mfree = m->topsize + TOP_FOOT_SIZE; + size_t sum = mfree; + msegmentptr s = &m->seg; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + size_t sz = chunksize(q); + sum += sz; + if (!cinuse(q)) { + mfree += sz; + ++nfree; + } + q = next_chunk(q); + } + s = s->next; + } + + nm.arena = sum; + nm.ordblks = nfree; + nm.hblkhd = m->footprint - sum; + nm.usmblks = m->max_footprint; + nm.uordblks = m->footprint - mfree; + nm.fordblks = mfree; + nm.keepcost = m->topsize; + } + + POSTACTION(m); + } + return nm; +} +#endif /* !NO_MALLINFO */ + +static void internal_malloc_stats(mstate m) { + if (!PREACTION(m)) { + size_t maxfp = 0; + size_t fp = 0; + size_t used = 0; + check_malloc_state(m); + if (is_initialized(m)) { + msegmentptr s = &m->seg; + maxfp = m->max_footprint; + fp = m->footprint; + used = fp - (m->topsize + TOP_FOOT_SIZE); + + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + if (!cinuse(q)) + used -= chunksize(q); + q = next_chunk(q); + } + s = s->next; + } + } + + fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); + fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); + fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); + + POSTACTION(m); + } +} + +/* ----------------------- Operations on smallbins ----------------------- */ + +/* + Various forms of linking and unlinking are defined as macros. Even + the ones for trees, which are very long but have very short typical + paths. This is ugly but reduces reliance on inlining support of + compilers. +*/ + +/* Link a free chunk into a smallbin */ +#define insert_small_chunk(M, P, S) {\ + bindex_t I = small_index(S);\ + mchunkptr B = smallbin_at(M, I);\ + mchunkptr F = B;\ + assert(S >= MIN_CHUNK_SIZE);\ + if (!smallmap_is_marked(M, I))\ + mark_smallmap(M, I);\ + else if (RTCHECK(ok_address(M, B->fd)))\ + F = B->fd;\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + B->fd = P;\ + F->bk = P;\ + P->fd = F;\ + P->bk = B;\ +} + +/* Unlink a chunk from a smallbin */ +#define unlink_small_chunk(M, P, S) {\ + mchunkptr F = P->fd;\ + mchunkptr B = P->bk;\ + bindex_t I = small_index(S);\ + assert(P != B);\ + assert(P != F);\ + assert(chunksize(P) == small_index2size(I));\ + if (F == B)\ + clear_smallmap(M, I);\ + else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\ + (B == smallbin_at(M,I) || ok_address(M, B)))) {\ + F->bk = B;\ + B->fd = F;\ + }\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + }\ +} + +/* Unlink the first chunk from a smallbin */ +#define unlink_first_small_chunk(M, B, P, I) {\ + mchunkptr F = P->fd;\ + assert(P != B);\ + assert(P != F);\ + assert(chunksize(P) == small_index2size(I));\ + if (B == F)\ + clear_smallmap(M, I);\ + else if (RTCHECK(ok_address(M, F))) {\ + B->fd = F;\ + F->bk = B;\ + }\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + }\ +} + +/* Replace dv node, binning the old one */ +/* Used only when dvsize known to be small */ +#define replace_dv(M, P, S) {\ + size_t DVS = M->dvsize;\ + if (DVS != 0) {\ + mchunkptr DV = M->dv;\ + assert(is_small(DVS));\ + insert_small_chunk(M, DV, DVS);\ + }\ + M->dvsize = S;\ + M->dv = P;\ +} + +/* ------------------------- Operations on trees ------------------------- */ + +/* Insert chunk into tree */ +#define insert_large_chunk(M, X, S) {\ + tbinptr* H;\ + bindex_t I;\ + compute_tree_index(S, I);\ + H = treebin_at(M, I);\ + X->index = I;\ + X->child[0] = X->child[1] = 0;\ + if (!treemap_is_marked(M, I)) {\ + mark_treemap(M, I);\ + *H = X;\ + X->parent = (tchunkptr)H;\ + X->fd = X->bk = X;\ + }\ + else {\ + tchunkptr T = *H;\ + size_t K = S << leftshift_for_tree_index(I);\ + for (;;) {\ + if (chunksize(T) != S) {\ + tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\ + K <<= 1;\ + if (*C != 0)\ + T = *C;\ + else if (RTCHECK(ok_address(M, C))) {\ + *C = X;\ + X->parent = T;\ + X->fd = X->bk = X;\ + break;\ + }\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + break;\ + }\ + }\ + else {\ + tchunkptr F = T->fd;\ + if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\ + T->fd = F->bk = X;\ + X->fd = F;\ + X->bk = T;\ + X->parent = 0;\ + break;\ + }\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + break;\ + }\ + }\ + }\ + }\ +} + +/* + Unlink steps: + + 1. If x is a chained node, unlink it from its same-sized fd/bk links + and choose its bk node as its replacement. + 2. If x was the last node of its size, but not a leaf node, it must + be replaced with a leaf node (not merely one with an open left or + right), to make sure that lefts and rights of descendants + correspond properly to bit masks. We use the rightmost descendant + of x. We could use any other leaf, but this is easy to locate and + tends to counteract removal of leftmosts elsewhere, and so keeps + paths shorter than minimally guaranteed. This doesn't loop much + because on average a node in a tree is near the bottom. + 3. If x is the base of a chain (i.e., has parent links) relink + x's parent and children to x's replacement (or null if none). +*/ + +#define unlink_large_chunk(M, X) {\ + tchunkptr XP = X->parent;\ + tchunkptr R;\ + if (X->bk != X) {\ + tchunkptr F = X->fd;\ + R = X->bk;\ + if (RTCHECK(ok_address(M, F))) {\ + F->bk = R;\ + R->fd = F;\ + }\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + }\ + else {\ + tchunkptr* RP;\ + if (((R = *(RP = &(X->child[1]))) != 0) ||\ + ((R = *(RP = &(X->child[0]))) != 0)) {\ + tchunkptr* CP;\ + while ((*(CP = &(R->child[1])) != 0) ||\ + (*(CP = &(R->child[0])) != 0)) {\ + R = *(RP = CP);\ + }\ + if (RTCHECK(ok_address(M, RP)))\ + *RP = 0;\ + else {\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + }\ + }\ + if (XP != 0) {\ + tbinptr* H = treebin_at(M, X->index);\ + if (X == *H) {\ + if ((*H = R) == 0) \ + clear_treemap(M, X->index);\ + }\ + else if (RTCHECK(ok_address(M, XP))) {\ + if (XP->child[0] == X) \ + XP->child[0] = R;\ + else \ + XP->child[1] = R;\ + }\ + else\ + CORRUPTION_ERROR_ACTION(M);\ + if (R != 0) {\ + if (RTCHECK(ok_address(M, R))) {\ + tchunkptr C0, C1;\ + R->parent = XP;\ + if ((C0 = X->child[0]) != 0) {\ + if (RTCHECK(ok_address(M, C0))) {\ + R->child[0] = C0;\ + C0->parent = R;\ + }\ + else\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + if ((C1 = X->child[1]) != 0) {\ + if (RTCHECK(ok_address(M, C1))) {\ + R->child[1] = C1;\ + C1->parent = R;\ + }\ + else\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + }\ + else\ + CORRUPTION_ERROR_ACTION(M);\ + }\ + }\ +} + +/* Relays to large vs small bin operations */ + +#define insert_chunk(M, P, S)\ + if (is_small(S)) insert_small_chunk(M, P, S)\ + else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); } + +#define unlink_chunk(M, P, S)\ + if (is_small(S)) unlink_small_chunk(M, P, S)\ + else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); } + + +/* Relays to internal calls to malloc/free from realloc, memalign etc */ + +#if ONLY_MSPACES +#define internal_malloc(m, b) mspace_malloc(m, b) +#define internal_free(m, mem) mspace_free(m,mem); +#else /* ONLY_MSPACES */ +#if MSPACES +#define internal_malloc(m, b)\ + (m == gm)? dlmalloc(b) : mspace_malloc(m, b) +#define internal_free(m, mem)\ + if (m == gm) dlfree(mem); else mspace_free(m,mem); +#else /* MSPACES */ +#define internal_malloc(m, b) dlmalloc(b) +#define internal_free(m, mem) dlfree(mem) +#endif /* MSPACES */ +#endif /* ONLY_MSPACES */ + +/* ----------------------- Direct-mmapping chunks ----------------------- */ + +/* + Directly mmapped chunks are set up with an offset to the start of + the mmapped region stored in the prev_foot field of the chunk. This + allows reconstruction of the required argument to MUNMAP when freed, + and also allows adjustment of the returned chunk to meet alignment + requirements (especially in memalign). There is also enough space + allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain + the PINUSE bit so frees can be checked. +*/ + +/* Malloc using mmap */ +static void* mmap_alloc(mstate m, size_t nb) { + size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + if (mmsize > nb) { /* Check for wrap around 0 */ + char* mm = (char*)(DIRECT_MMAP(mmsize)); + if (mm != CMFAIL) { + size_t offset = align_offset(chunk2mem(mm)); + size_t psize = mmsize - offset - MMAP_FOOT_PAD; + mchunkptr p = (mchunkptr)(mm + offset); + p->prev_foot = offset | IS_MMAPPED_BIT; + (p)->head = (psize|CINUSE_BIT); + mark_inuse_foot(m, p, psize); + chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; + + if (mm < m->least_addr) + m->least_addr = mm; + if ((m->footprint += mmsize) > m->max_footprint) + m->max_footprint = m->footprint; + assert(is_aligned(chunk2mem(p))); + check_mmapped_chunk(m, p); + return chunk2mem(p); + } + } + return 0; +} + +/* Realloc using mmap */ +static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) { + size_t oldsize = chunksize(oldp); + if (is_small(nb)) /* Can't shrink mmap regions below small size */ + return 0; + /* Keep old chunk if big enough but not too big */ + if (oldsize >= nb + SIZE_T_SIZE && + (oldsize - nb) <= (mparams.granularity << 1)) + return oldp; + else { + size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; + size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; + size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + + CHUNK_ALIGN_MASK); + char* cp = (char*)CALL_MREMAP((char*)oldp - offset, + oldmmsize, newmmsize, 1); + if (cp != CMFAIL) { + mchunkptr newp = (mchunkptr)(cp + offset); + size_t psize = newmmsize - offset - MMAP_FOOT_PAD; + newp->head = (psize|CINUSE_BIT); + mark_inuse_foot(m, newp, psize); + chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; + + if (cp < m->least_addr) + m->least_addr = cp; + if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) + m->max_footprint = m->footprint; + check_mmapped_chunk(m, newp); + return newp; + } + } + return 0; +} + +/* -------------------------- mspace management -------------------------- */ + +/* Initialize top chunk and its size */ +static void init_top(mstate m, mchunkptr p, size_t psize) { + /* Ensure alignment */ + size_t offset = align_offset(chunk2mem(p)); + p = (mchunkptr)((char*)p + offset); + psize -= offset; + + m->top = p; + m->topsize = psize; + p->head = psize | PINUSE_BIT; + /* set size of fake trailing chunk holding overhead space only once */ + chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; + m->trim_check = mparams.trim_threshold; /* reset on each update */ +} + +/* Initialize bins for a new mstate that is otherwise zeroed out */ +static void init_bins(mstate m) { + /* Establish circular links for smallbins */ + bindex_t i; + for (i = 0; i < NSMALLBINS; ++i) { + sbinptr bin = smallbin_at(m,i); + bin->fd = bin->bk = bin; + } +} + +#if PROCEED_ON_ERROR + +/* default corruption action */ +static void reset_on_error(mstate m) { + int i; + ++malloc_corruption_error_count; + /* Reinitialize fields to forget about all memory */ + m->smallbins = m->treebins = 0; + m->dvsize = m->topsize = 0; + m->seg.base = 0; + m->seg.size = 0; + m->seg.next = 0; + m->top = m->dv = 0; + for (i = 0; i < NTREEBINS; ++i) + *treebin_at(m, i) = 0; + init_bins(m); +} +#endif /* PROCEED_ON_ERROR */ + +/* Allocate chunk and prepend remainder with chunk in successor base. */ +static void* prepend_alloc(mstate m, char* newbase, char* oldbase, + size_t nb) { + mchunkptr p = align_as_chunk(newbase); + mchunkptr oldfirst = align_as_chunk(oldbase); + size_t psize = (char*)oldfirst - (char*)p; + mchunkptr q = chunk_plus_offset(p, nb); + size_t qsize = psize - nb; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + + assert((char*)oldfirst > (char*)q); + assert(pinuse(oldfirst)); + assert(qsize >= MIN_CHUNK_SIZE); + + /* consolidate remainder with first chunk of old base */ + if (oldfirst == m->top) { + size_t tsize = m->topsize += qsize; + m->top = q; + q->head = tsize | PINUSE_BIT; + check_top_chunk(m, q); + } + else if (oldfirst == m->dv) { + size_t dsize = m->dvsize += qsize; + m->dv = q; + set_size_and_pinuse_of_free_chunk(q, dsize); + } + else { + if (!cinuse(oldfirst)) { + size_t nsize = chunksize(oldfirst); + unlink_chunk(m, oldfirst, nsize); + oldfirst = chunk_plus_offset(oldfirst, nsize); + qsize += nsize; + } + set_free_with_pinuse(q, qsize, oldfirst); + insert_chunk(m, q, qsize); + check_free_chunk(m, q); + } + + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); +} + + +/* Add a segment to hold a new noncontiguous region */ +static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { + /* Determine locations and sizes of segment, fenceposts, old top */ + char* old_top = (char*)m->top; + msegmentptr oldsp = segment_holding(m, old_top); + char* old_end = oldsp->base + oldsp->size; + size_t ssize = pad_request(sizeof(struct malloc_segment)); + char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + size_t offset = align_offset(chunk2mem(rawsp)); + char* asp = rawsp + offset; + char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; + mchunkptr sp = (mchunkptr)csp; + msegmentptr ss = (msegmentptr)(chunk2mem(sp)); + mchunkptr tnext = chunk_plus_offset(sp, ssize); + mchunkptr p = tnext; + int nfences = 0; + + /* reset top to new space */ + init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); + + /* Set up segment record */ + assert(is_aligned(ss)); + set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); + *ss = m->seg; /* Push current record */ + m->seg.base = tbase; + m->seg.size = tsize; + (void)set_segment_flags(&m->seg, mmapped); + m->seg.next = ss; + + /* Insert trailing fenceposts */ + for (;;) { + mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); + p->head = FENCEPOST_HEAD; + ++nfences; + if ((char*)(&(nextp->head)) < old_end) + p = nextp; + else + break; + } + assert(nfences >= 2); + + /* Insert the rest of old top into a bin as an ordinary free chunk */ + if (csp != old_top) { + mchunkptr q = (mchunkptr)old_top; + size_t psize = csp - old_top; + mchunkptr tn = chunk_plus_offset(q, psize); + set_free_with_pinuse(q, psize, tn); + insert_chunk(m, q, psize); + } + + check_top_chunk(m, m->top); +} + +/* -------------------------- System allocation -------------------------- */ + +/* Get memory from system using MORECORE or MMAP */ +static void* sys_alloc(mstate m, size_t nb) { + char* tbase = CMFAIL; + size_t tsize = 0; + flag_t mmap_flag = 0; + + init_mparams(); + + /* Directly map large chunks */ + if (use_mmap(m) && nb >= mparams.mmap_threshold) { + void* mem = mmap_alloc(m, nb); + if (mem != 0) + return mem; + } + + /* + Try getting memory in any of three ways (in most-preferred to + least-preferred order): + 1. A call to MORECORE that can normally contiguously extend memory. + (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or + or main space is mmapped or a previous contiguous call failed) + 2. A call to MMAP new space (disabled if not HAVE_MMAP). + Note that under the default settings, if MORECORE is unable to + fulfill a request, and HAVE_MMAP is true, then mmap is + used as a noncontiguous system allocator. This is a useful backup + strategy for systems with holes in address spaces -- in this case + sbrk cannot contiguously expand the heap, but mmap may be able to + find space. + 3. A call to MORECORE that cannot usually contiguously extend memory. + (disabled if not HAVE_MORECORE) + */ + + if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { + char* br = CMFAIL; + msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); + size_t asize = 0; + ACQUIRE_MORECORE_LOCK(); + + if (ss == 0) { /* First time through or recovery */ + char* base = (char*)CALL_MORECORE(0); + if (base != CMFAIL) { + asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); + /* Adjust to end on a page boundary */ + if (!is_page_aligned(base)) + asize += (page_align((size_t)base) - (size_t)base); + /* Can't call MORECORE if size is negative when treated as signed */ + if (asize < HALF_MAX_SIZE_T && + (br = (char*)(CALL_MORECORE(asize))) == base) { + tbase = base; + tsize = asize; + } + } + } + else { + /* Subtract out existing available top space from MORECORE request. */ + asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE); + /* Use mem here only if it did continuously extend old space */ + if (asize < HALF_MAX_SIZE_T && + (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) { + tbase = br; + tsize = asize; + } + } + + if (tbase == CMFAIL) { /* Cope with partial failure */ + if (br != CMFAIL) { /* Try to use/extend the space we did get */ + if (asize < HALF_MAX_SIZE_T && + asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { + size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize); + if (esize < HALF_MAX_SIZE_T) { + char* end = (char*)CALL_MORECORE(esize); + if (end != CMFAIL) + asize += esize; + else { /* Can't use; try to release */ + (void)CALL_MORECORE(-asize); + br = CMFAIL; + } + } + } + } + if (br != CMFAIL) { /* Use the space we did get */ + tbase = br; + tsize = asize; + } + else + disable_contiguous(m); /* Don't try contiguous path in the future */ + } + + RELEASE_MORECORE_LOCK(); + } + + if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ + size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE; + size_t rsize = granularity_align(req); + if (rsize > nb) { /* Fail if wraps around zero */ + char* mp = (char*)(CALL_MMAP(rsize)); + if (mp != CMFAIL) { + tbase = mp; + tsize = rsize; + mmap_flag = IS_MMAPPED_BIT; + } + } + } + + if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ + size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); + if (asize < HALF_MAX_SIZE_T) { + char* br = CMFAIL; + char* end = CMFAIL; + ACQUIRE_MORECORE_LOCK(); + br = (char*)(CALL_MORECORE(asize)); + end = (char*)(CALL_MORECORE(0)); + RELEASE_MORECORE_LOCK(); + if (br != CMFAIL && end != CMFAIL && br < end) { + size_t ssize = end - br; + if (ssize > nb + TOP_FOOT_SIZE) { + tbase = br; + tsize = ssize; + } + } + } + } + + if (tbase != CMFAIL) { + + if ((m->footprint += tsize) > m->max_footprint) + m->max_footprint = m->footprint; + + if (!is_initialized(m)) { /* first-time initialization */ + m->seg.base = m->least_addr = tbase; + m->seg.size = tsize; + (void)set_segment_flags(&m->seg, mmap_flag); + m->magic = mparams.magic; + init_bins(m); + if (is_global(m)) + init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); + else { + /* Offset top by embedded malloc_state */ + mchunkptr mn = next_chunk(mem2chunk(m)); + init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); + } + } + + else { + /* Try to merge with an existing segment */ + msegmentptr sp = &m->seg; + while (sp != 0 && tbase != sp->base + sp->size) + sp = sp->next; + if (sp != 0 && + !is_extern_segment(sp) && + check_segment_merge(sp, tbase, tsize) && + (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag && + segment_holds(sp, m->top)) { /* append */ + sp->size += tsize; + init_top(m, m->top, m->topsize + tsize); + } + else { + if (tbase < m->least_addr) + m->least_addr = tbase; + sp = &m->seg; + while (sp != 0 && sp->base != tbase + tsize) + sp = sp->next; + if (sp != 0 && + !is_extern_segment(sp) && + check_segment_merge(sp, tbase, tsize) && + (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag) { + char* oldbase = sp->base; + sp->base = tbase; + sp->size += tsize; + return prepend_alloc(m, tbase, oldbase, nb); + } + else + add_segment(m, tbase, tsize, mmap_flag); + } + } + + if (nb < m->topsize) { /* Allocate from new or extended top space */ + size_t rsize = m->topsize -= nb; + mchunkptr p = m->top; + mchunkptr r = m->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + check_top_chunk(m, m->top); + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); + } + } + + MALLOC_FAILURE_ACTION; + return 0; +} + +/* ----------------------- system deallocation -------------------------- */ + +/* Unmap and unlink any mmapped segments that don't contain used chunks */ +static size_t release_unused_segments(mstate m) { + size_t released = 0; + msegmentptr pred = &m->seg; + msegmentptr sp = pred->next; + while (sp != 0) { + char* base = sp->base; + size_t size = sp->size; + msegmentptr next = sp->next; + if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { + mchunkptr p = align_as_chunk(base); + size_t psize = chunksize(p); + /* Can unmap if first chunk holds entire segment and not pinned */ + if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { + tchunkptr tp = (tchunkptr)p; + assert(segment_holds(sp, (char*)sp)); + if (p == m->dv) { + m->dv = 0; + m->dvsize = 0; + } + else { + unlink_large_chunk(m, tp); + } + if (CALL_MUNMAP(base, size) == 0) { + released += size; + m->footprint -= size; + /* unlink obsoleted record */ + sp = pred; + sp->next = next; + } + else { /* back out if cannot unmap */ + insert_large_chunk(m, tp, psize); + } + } + } + pred = sp; + sp = next; + } + return released; +} + +static int sys_trim(mstate m, size_t pad) { + size_t released = 0; + if (pad < MAX_REQUEST && is_initialized(m)) { + pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ + + if (m->topsize > pad) { + /* Shrink top space in granularity-size units, keeping at least one */ + size_t unit = mparams.granularity; + size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - + SIZE_T_ONE) * unit; + msegmentptr sp = segment_holding(m, (char*)m->top); + + if (!is_extern_segment(sp)) { + if (is_mmapped_segment(sp)) { + if (HAVE_MMAP && + sp->size >= extra && + !has_segment_link(m, sp)) { /* can't shrink if pinned */ + size_t newsize = sp->size - extra; + /* Prefer mremap, fall back to munmap */ + if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || + (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { + released = extra; + } + } + } + else if (HAVE_MORECORE) { + if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ + extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; + ACQUIRE_MORECORE_LOCK(); + { + /* Make sure end of memory is where we last set it. */ + char* old_br = (char*)(CALL_MORECORE(0)); + if (old_br == sp->base + sp->size) { + char* rel_br = (char*)(CALL_MORECORE(-extra)); + char* new_br = (char*)(CALL_MORECORE(0)); + if (rel_br != CMFAIL && new_br < old_br) + released = old_br - new_br; + } + } + RELEASE_MORECORE_LOCK(); + } + } + + if (released != 0) { + sp->size -= released; + m->footprint -= released; + init_top(m, m->top, m->topsize - released); + check_top_chunk(m, m->top); + } + } + + /* Unmap any unused mmapped segments */ + if (HAVE_MMAP) + released += release_unused_segments(m); + + /* On failure, disable autotrim to avoid repeated failed future calls */ + if (released == 0) + m->trim_check = MAX_SIZE_T; + } + + return (released != 0)? 1 : 0; +} + +/* ---------------------------- malloc support --------------------------- */ + +/* allocate a large request from the best fitting chunk in a treebin */ +static void* tmalloc_large(mstate m, size_t nb) { + tchunkptr v = 0; + size_t rsize = -nb; /* Unsigned negation */ + tchunkptr t; + bindex_t idx; + compute_tree_index(nb, idx); + + if ((t = *treebin_at(m, idx)) != 0) { + /* Traverse tree for this bin looking for node with size == nb */ + size_t sizebits = nb << leftshift_for_tree_index(idx); + tchunkptr rst = 0; /* The deepest untaken right subtree */ + for (;;) { + tchunkptr rt; + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + v = t; + if ((rsize = trem) == 0) + break; + } + rt = t->child[1]; + t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; + if (rt != 0 && rt != t) + rst = rt; + if (t == 0) { + t = rst; /* set t to least subtree holding sizes > nb */ + break; + } + sizebits <<= 1; + } + } + + if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ + binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; + if (leftbits != 0) { + bindex_t i; + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + t = *treebin_at(m, i); + } + } + + while (t != 0) { /* find smallest of tree or subtree */ + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; + } + t = leftmost_child(t); + } + + /* If dv is a better fit, return 0 so malloc will use it */ + if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { + if (RTCHECK(ok_address(m, v))) { /* split */ + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + insert_chunk(m, r, rsize); + } + return chunk2mem(v); + } + } + CORRUPTION_ERROR_ACTION(m); + } + return 0; +} + +/* allocate a small request from the best fitting chunk in a treebin */ +static void* tmalloc_small(mstate m, size_t nb) { + tchunkptr t, v; + size_t rsize; + bindex_t i; + binmap_t leastbit = least_bit(m->treemap); + compute_bit2idx(leastbit, i); + + v = t = *treebin_at(m, i); + rsize = chunksize(t) - nb; + + while ((t = leftmost_child(t)) != 0) { + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; + } + } + + if (RTCHECK(ok_address(m, v))) { + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(m, r, rsize); + } + return chunk2mem(v); + } + } + + CORRUPTION_ERROR_ACTION(m); + return 0; +} + +/* --------------------------- realloc support --------------------------- */ + +static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { + if (bytes >= MAX_REQUEST) { + MALLOC_FAILURE_ACTION; + return 0; + } + if (!PREACTION(m)) { + mchunkptr oldp = mem2chunk(oldmem); + size_t oldsize = chunksize(oldp); + mchunkptr next = chunk_plus_offset(oldp, oldsize); + mchunkptr newp = 0; + void* extra = 0; + + /* Try to either shrink or extend into top. Else malloc-copy-free */ + + if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && + ok_next(oldp, next) && ok_pinuse(next))) { + size_t nb = request2size(bytes); + if (is_mmapped(oldp)) + newp = mmap_resize(m, oldp, nb); + else if (oldsize >= nb) { /* already big enough */ + size_t rsize = oldsize - nb; + newp = oldp; + if (rsize >= MIN_CHUNK_SIZE) { + mchunkptr remainder = chunk_plus_offset(newp, nb); + set_inuse(m, newp, nb); + set_inuse(m, remainder, rsize); + extra = chunk2mem(remainder); + } + } + else if (next == m->top && oldsize + m->topsize > nb) { + /* Expand into top */ + size_t newsize = oldsize + m->topsize; + size_t newtopsize = newsize - nb; + mchunkptr newtop = chunk_plus_offset(oldp, nb); + set_inuse(m, oldp, nb); + newtop->head = newtopsize |PINUSE_BIT; + m->top = newtop; + m->topsize = newtopsize; + newp = oldp; + } + } + else { + USAGE_ERROR_ACTION(m, oldmem); + POSTACTION(m); + return 0; + } + + POSTACTION(m); + + if (newp != 0) { + if (extra != 0) { + internal_free(m, extra); + } + check_inuse_chunk(m, newp); + return chunk2mem(newp); + } + else { + void* newmem = internal_malloc(m, bytes); + if (newmem != 0) { + size_t oc = oldsize - overhead_for(oldp); + memcpy(newmem, oldmem, (oc < bytes)? oc : bytes); + internal_free(m, oldmem); + } + return newmem; + } + } + return 0; +} + +/* --------------------------- memalign support -------------------------- */ + +static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { + if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ + return internal_malloc(m, bytes); + if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ + alignment = MIN_CHUNK_SIZE; + if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ + size_t a = MALLOC_ALIGNMENT << 1; + while (a < alignment) a <<= 1; + alignment = a; + } + + if (bytes >= MAX_REQUEST - alignment) { + if (m != 0) { /* Test isn't needed but avoids compiler warning */ + MALLOC_FAILURE_ACTION; + } + } + else { + size_t nb = request2size(bytes); + size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; + char* mem = (char*)internal_malloc(m, req); + if (mem != 0) { + void* leader = 0; + void* trailer = 0; + mchunkptr p = mem2chunk(mem); + + if (PREACTION(m)) return 0; + if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */ + /* + Find an aligned spot inside chunk. Since we need to give + back leading space in a chunk of at least MIN_CHUNK_SIZE, if + the first calculation places us at a spot with less than + MIN_CHUNK_SIZE leader, we can move to the next aligned spot. + We've allocated enough total room so that this is always + possible. + */ + char* br = (char*)mem2chunk((size_t)(((size_t)(mem + + alignment - + SIZE_T_ONE)) & + -alignment)); + char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? + br : br+alignment; + mchunkptr newp = (mchunkptr)pos; + size_t leadsize = pos - (char*)(p); + size_t newsize = chunksize(p) - leadsize; + + if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ + newp->prev_foot = p->prev_foot + leadsize; + newp->head = (newsize|CINUSE_BIT); + } + else { /* Otherwise, give back leader, use the rest */ + set_inuse(m, newp, newsize); + set_inuse(m, p, leadsize); + leader = chunk2mem(p); + } + p = newp; + } + + /* Give back spare room at the end */ + if (!is_mmapped(p)) { + size_t size = chunksize(p); + if (size > nb + MIN_CHUNK_SIZE) { + size_t remainder_size = size - nb; + mchunkptr remainder = chunk_plus_offset(p, nb); + set_inuse(m, p, nb); + set_inuse(m, remainder, remainder_size); + trailer = chunk2mem(remainder); + } + } + + assert (chunksize(p) >= nb); + assert((((size_t)(chunk2mem(p))) % alignment) == 0); + check_inuse_chunk(m, p); + POSTACTION(m); + if (leader != 0) { + internal_free(m, leader); + } + if (trailer != 0) { + internal_free(m, trailer); + } + return chunk2mem(p); + } + } + return 0; +} + +/* ------------------------ comalloc/coalloc support --------------------- */ + +static void** ialloc(mstate m, + size_t n_elements, + size_t* sizes, + int opts, + void* chunks[]) { + /* + This provides common support for independent_X routines, handling + all of the combinations that can result. + + The opts arg has: + bit 0 set if all elements are same size (using sizes[0]) + bit 1 set if elements should be zeroed + */ + + size_t element_size; /* chunksize of each element, if all same */ + size_t contents_size; /* total size of elements */ + size_t array_size; /* request size of pointer array */ + void* mem; /* malloced aggregate space */ + mchunkptr p; /* corresponding chunk */ + size_t remainder_size; /* remaining bytes while splitting */ + void** marray; /* either "chunks" or malloced ptr array */ + mchunkptr array_chunk; /* chunk for malloced ptr array */ + flag_t was_enabled; /* to disable mmap */ + size_t size; + size_t i; + + /* compute array length, if needed */ + if (chunks != 0) { + if (n_elements == 0) + return chunks; /* nothing to do */ + marray = chunks; + array_size = 0; + } + else { + /* if empty req, must still return chunk representing empty array */ + if (n_elements == 0) + return (void**)internal_malloc(m, 0); + marray = 0; + array_size = request2size(n_elements * (sizeof(void*))); + } + + /* compute total element size */ + if (opts & 0x1) { /* all-same-size */ + element_size = request2size(*sizes); + contents_size = n_elements * element_size; + } + else { /* add up all the sizes */ + element_size = 0; + contents_size = 0; + for (i = 0; i != n_elements; ++i) + contents_size += request2size(sizes[i]); + } + + size = contents_size + array_size; + + /* + Allocate the aggregate chunk. First disable direct-mmapping so + malloc won't use it, since we would not be able to later + free/realloc space internal to a segregated mmap region. + */ + was_enabled = use_mmap(m); + disable_mmap(m); + mem = internal_malloc(m, size - CHUNK_OVERHEAD); + if (was_enabled) + enable_mmap(m); + if (mem == 0) + return 0; + + if (PREACTION(m)) return 0; + p = mem2chunk(mem); + remainder_size = chunksize(p); + + assert(!is_mmapped(p)); + + if (opts & 0x2) { /* optionally clear the elements */ + memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); + } + + /* If not provided, allocate the pointer array as final part of chunk */ + if (marray == 0) { + size_t array_chunk_size; + array_chunk = chunk_plus_offset(p, contents_size); + array_chunk_size = remainder_size - contents_size; + marray = (void**) (chunk2mem(array_chunk)); + set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); + remainder_size = contents_size; + } + + /* split out elements */ + for (i = 0; ; ++i) { + marray[i] = chunk2mem(p); + if (i != n_elements-1) { + if (element_size != 0) + size = element_size; + else + size = request2size(sizes[i]); + remainder_size -= size; + set_size_and_pinuse_of_inuse_chunk(m, p, size); + p = chunk_plus_offset(p, size); + } + else { /* the final element absorbs any overallocation slop */ + set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); + break; + } + } + +#if DEBUG + if (marray != chunks) { + /* final element must have exactly exhausted chunk */ + if (element_size != 0) { + assert(remainder_size == element_size); + } + else { + assert(remainder_size == request2size(sizes[i])); + } + check_inuse_chunk(m, mem2chunk(marray)); + } + for (i = 0; i != n_elements; ++i) + check_inuse_chunk(m, mem2chunk(marray[i])); + +#endif /* DEBUG */ + + POSTACTION(m); + return marray; +} + + +/* -------------------------- public routines ---------------------------- */ + +#if !ONLY_MSPACES + +void* dlmalloc(size_t bytes) { + /* + Basic algorithm: + If a small request (< 256 bytes minus per-chunk overhead): + 1. If one exists, use a remainderless chunk in associated smallbin. + (Remainderless means that there are too few excess bytes to + represent as a chunk.) + 2. If it is big enough, use the dv chunk, which is normally the + chunk adjacent to the one used for the most recent small request. + 3. If one exists, split the smallest available chunk in a bin, + saving remainder in dv. + 4. If it is big enough, use the top chunk. + 5. If available, get memory from system and use it + Otherwise, for a large request: + 1. Find the smallest available binned chunk that fits, and use it + if it is better fitting than dv chunk, splitting if necessary. + 2. If better fitting than any binned chunk, use the dv chunk. + 3. If it is big enough, use the top chunk. + 4. If request size >= mmap threshold, try to directly mmap this chunk. + 5. If available, get memory from system and use it + + The ugly goto's here ensure that postaction occurs along all paths. + */ + + if (!PREACTION(gm)) { + void* mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = gm->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(gm, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(gm, b, p, idx); + set_inuse_and_pinuse(gm, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + + else if (nb > gm->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(gm, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(gm, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(gm, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(gm, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + + else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + } + } + else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + } + + if (nb <= gm->dvsize) { + size_t rsize = gm->dvsize - nb; + mchunkptr p = gm->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = gm->dv = chunk_plus_offset(p, nb); + gm->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + } + else { /* exhaust dv */ + size_t dvs = gm->dvsize; + gm->dvsize = 0; + gm->dv = 0; + set_inuse_and_pinuse(gm, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + + else if (nb < gm->topsize) { /* Split top */ + size_t rsize = gm->topsize -= nb; + mchunkptr p = gm->top; + mchunkptr r = gm->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + mem = chunk2mem(p); + check_top_chunk(gm, gm->top); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + + mem = sys_alloc(gm, nb); + + postaction: + POSTACTION(gm); + return mem; + } + + return 0; +} + +void dlfree(void* mem) { + /* + Consolidate freed chunks with preceding or succeeding bordering + free chunks, if they exist, and then place in a bin. Intermixed + with special cases for top, dv, mmapped chunks, and usage errors. + */ + + if (mem != 0) { + mchunkptr p = mem2chunk(mem); +#if FOOTERS + mstate fm = get_mstate_for(p); + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; + } +#else /* FOOTERS */ +#define fm gm +#endif /* FOOTERS */ + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } + else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } + else if ((next->head & INUSE_BITS) == INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } + else + goto erroraction; + } + } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; + } + else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } + else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } + } + } + else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; + } + } + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); + } + } +#if !FOOTERS +#undef fm +#endif /* FOOTERS */ +} + +void* dlcalloc(size_t n_elements, size_t elem_size) { + void* mem; + size_t req = 0; + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t)0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = dlmalloc(req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; +} + +void* dlrealloc(void* oldmem, size_t bytes) { + if (oldmem == 0) + return dlmalloc(bytes); +#ifdef REALLOC_ZERO_BYTES_FREES + if (bytes == 0) { + dlfree(oldmem); + return 0; + } +#endif /* REALLOC_ZERO_BYTES_FREES */ + else { +#if ! FOOTERS + mstate m = gm; +#else /* FOOTERS */ + mstate m = get_mstate_for(mem2chunk(oldmem)); + if (!ok_magic(m)) { + USAGE_ERROR_ACTION(m, oldmem); + return 0; + } +#endif /* FOOTERS */ + return internal_realloc(m, oldmem, bytes); + } +} + +void* dlmemalign(size_t alignment, size_t bytes) { + return internal_memalign(gm, alignment, bytes); +} + +void** dlindependent_calloc(size_t n_elements, size_t elem_size, + void* chunks[]) { + size_t sz = elem_size; /* serves as 1-element array */ + return ialloc(gm, n_elements, &sz, 3, chunks); +} + +void** dlindependent_comalloc(size_t n_elements, size_t sizes[], + void* chunks[]) { + return ialloc(gm, n_elements, sizes, 0, chunks); +} + +void* dlvalloc(size_t bytes) { + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, bytes); +} + +void* dlpvalloc(size_t bytes) { + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); +} + +int dlmalloc_trim(size_t pad) { + int result = 0; + if (!PREACTION(gm)) { + result = sys_trim(gm, pad); + POSTACTION(gm); + } + return result; +} + +size_t dlmalloc_footprint(void) { + return gm->footprint; +} + +size_t dlmalloc_max_footprint(void) { + return gm->max_footprint; +} + +#if !NO_MALLINFO +struct mallinfo dlmallinfo(void) { + return internal_mallinfo(gm); +} +#endif /* NO_MALLINFO */ + +void dlmalloc_stats() { + internal_malloc_stats(gm); +} + +size_t dlmalloc_usable_size(void* mem) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + if (cinuse(p)) + return chunksize(p) - overhead_for(p); + } + return 0; +} + +int dlmallopt(int param_number, int value) { + return change_mparam(param_number, value); +} + +#endif /* !ONLY_MSPACES */ + +/* ----------------------------- user mspaces ---------------------------- */ + +#if MSPACES + +static mstate init_user_mstate(char* tbase, size_t tsize) { + size_t msize = pad_request(sizeof(struct malloc_state)); + mchunkptr mn; + mchunkptr msp = align_as_chunk(tbase); + mstate m = (mstate)(chunk2mem(msp)); + memset(m, 0, msize); + INITIAL_LOCK(&m->mutex); + msp->head = (msize|PINUSE_BIT|CINUSE_BIT); + m->seg.base = m->least_addr = tbase; + m->seg.size = m->footprint = m->max_footprint = tsize; + m->magic = mparams.magic; + m->mflags = mparams.default_mflags; + disable_contiguous(m); + init_bins(m); + mn = next_chunk(mem2chunk(m)); + init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); + check_top_chunk(m, m->top); + return m; +} + +mspace create_mspace(size_t capacity, int locked) { + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + size_t rs = ((capacity == 0)? mparams.granularity : + (capacity + TOP_FOOT_SIZE + msize)); + size_t tsize = granularity_align(rs); + char* tbase = (char*)(CALL_MMAP(tsize)); + if (tbase != CMFAIL) { + m = init_user_mstate(tbase, tsize); + set_segment_flags(&m->seg, IS_MMAPPED_BIT); + set_lock(m, locked); + } + } + return (mspace)m; +} + +mspace create_mspace_with_base(void* base, size_t capacity, int locked) { + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity > msize + TOP_FOOT_SIZE && + capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + m = init_user_mstate((char*)base, capacity); + set_segment_flags(&m->seg, EXTERN_BIT); + set_lock(m, locked); + } + return (mspace)m; +} + +size_t destroy_mspace(mspace msp) { + size_t freed = 0; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + msegmentptr sp = &ms->seg; + while (sp != 0) { + char* base = sp->base; + size_t size = sp->size; + flag_t flag = get_segment_flags(sp); + sp = sp->next; + if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && + CALL_MUNMAP(base, size) == 0) + freed += size; + } + } + else { + USAGE_ERROR_ACTION(ms,ms); + } + return freed; +} + +/* + mspace versions of routines are near-clones of the global + versions. This is not so nice but better than the alternatives. +*/ + + +void* mspace_malloc(mspace msp, size_t bytes) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + if (!PREACTION(ms)) { + void* mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = ms->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(ms, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(ms, b, p, idx); + set_inuse_and_pinuse(ms, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + + else if (nb > ms->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(ms, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(ms, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(ms, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(ms, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + + else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + } + } + else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + } + + if (nb <= ms->dvsize) { + size_t rsize = ms->dvsize - nb; + mchunkptr p = ms->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = ms->dv = chunk_plus_offset(p, nb); + ms->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + } + else { /* exhaust dv */ + size_t dvs = ms->dvsize; + ms->dvsize = 0; + ms->dv = 0; + set_inuse_and_pinuse(ms, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + + else if (nb < ms->topsize) { /* Split top */ + size_t rsize = ms->topsize -= nb; + mchunkptr p = ms->top; + mchunkptr r = ms->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + mem = chunk2mem(p); + check_top_chunk(ms, ms->top); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + + mem = sys_alloc(ms, nb); + + postaction: + POSTACTION(ms); + return mem; + } + + return 0; +} + +void mspace_free(mspace msp, void* mem) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); +#if FOOTERS + mstate fm = get_mstate_for(p); +#else /* FOOTERS */ + mstate fm = (mstate)msp; +#endif /* FOOTERS */ + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; + } + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } + else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } + else if ((next->head & INUSE_BITS) == INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } + else + goto erroraction; + } + } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; + } + else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } + else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } + } + } + else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; + } + } + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); + } + } +} + +void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { + void* mem; + size_t req = 0; + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t)0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = internal_malloc(ms, req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; +} + +void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { + if (oldmem == 0) + return mspace_malloc(msp, bytes); +#ifdef REALLOC_ZERO_BYTES_FREES + if (bytes == 0) { + mspace_free(msp, oldmem); + return 0; + } +#endif /* REALLOC_ZERO_BYTES_FREES */ + else { +#if FOOTERS + mchunkptr p = mem2chunk(oldmem); + mstate ms = get_mstate_for(p); +#else /* FOOTERS */ + mstate ms = (mstate)msp; +#endif /* FOOTERS */ + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return internal_realloc(ms, oldmem, bytes); + } +} + +void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return internal_memalign(ms, alignment, bytes); +} + +void** mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void* chunks[]) { + size_t sz = elem_size; /* serves as 1-element array */ + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return ialloc(ms, n_elements, &sz, 3, chunks); +} + +void** mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void* chunks[]) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return ialloc(ms, n_elements, sizes, 0, chunks); +} + +int mspace_trim(mspace msp, size_t pad) { + int result = 0; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + if (!PREACTION(ms)) { + result = sys_trim(ms, pad); + POSTACTION(ms); + } + } + else { + USAGE_ERROR_ACTION(ms,ms); + } + return result; +} + +void mspace_malloc_stats(mspace msp) { + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + internal_malloc_stats(ms); + } + else { + USAGE_ERROR_ACTION(ms,ms); + } +} + +size_t mspace_footprint(mspace msp) { + size_t result; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + result = ms->footprint; + } + USAGE_ERROR_ACTION(ms,ms); + return result; +} + + +size_t mspace_max_footprint(mspace msp) { + size_t result; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + result = ms->max_footprint; + } + USAGE_ERROR_ACTION(ms,ms); + return result; +} + + +#if !NO_MALLINFO +struct mallinfo mspace_mallinfo(mspace msp) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + } + return internal_mallinfo(ms); +} +#endif /* NO_MALLINFO */ + +int mspace_mallopt(int param_number, int value) { + return change_mparam(param_number, value); +} + +#endif /* MSPACES */ + +/* -------------------- Alternative MORECORE functions ------------------- */ + +/* + Guidelines for creating a custom version of MORECORE: + + * For best performance, MORECORE should allocate in multiples of pagesize. + * MORECORE may allocate more memory than requested. (Or even less, + but this will usually result in a malloc failure.) + * MORECORE must not allocate memory when given argument zero, but + instead return one past the end address of memory from previous + nonzero call. + * For best performance, consecutive calls to MORECORE with positive + arguments should return increasing addresses, indicating that + space has been contiguously extended. + * Even though consecutive calls to MORECORE need not return contiguous + addresses, it must be OK for malloc'ed chunks to span multiple + regions in those cases where they do happen to be contiguous. + * MORECORE need not handle negative arguments -- it may instead + just return MFAIL when given negative arguments. + Negative arguments are always multiples of pagesize. MORECORE + must not misinterpret negative args as large positive unsigned + args. You can suppress all such calls from even occurring by defining + MORECORE_CANNOT_TRIM, + + As an example alternative MORECORE, here is a custom allocator + kindly contributed for pre-OSX macOS. It uses virtually but not + necessarily physically contiguous non-paged memory (locked in, + present and won't get swapped out). You can use it by uncommenting + this section, adding some #includes, and setting up the appropriate + defines above: + + #define MORECORE osMoreCore + + There is also a shutdown routine that should somehow be called for + cleanup upon program exit. + + #define MAX_POOL_ENTRIES 100 + #define MINIMUM_MORECORE_SIZE (64 * 1024U) + static int next_os_pool; + void *our_os_pools[MAX_POOL_ENTRIES]; + + void *osMoreCore(int size) + { + void *ptr = 0; + static void *sbrk_top = 0; + + if (size > 0) + { + if (size < MINIMUM_MORECORE_SIZE) + size = MINIMUM_MORECORE_SIZE; + if (CurrentExecutionLevel() == kTaskLevel) + ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0); + if (ptr == 0) + { + return (void *) MFAIL; + } + // save ptrs so they can be freed during cleanup + our_os_pools[next_os_pool] = ptr; + next_os_pool++; + ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK); + sbrk_top = (char *) ptr + size; + return ptr; + } + else if (size < 0) + { + // we don't currently support shrink behavior + return (void *) MFAIL; + } + else + { + return sbrk_top; + } + } + + // cleanup any allocated memory pools + // called as last thing before shutting down driver + + void osCleanupMem(void) + { + void **ptr; + + for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++) + if (*ptr) + { + PoolDeallocate(*ptr); + *ptr = 0; + } + } + +*/ + + +/* ----------------------------------------------------------------------- +History: + V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee) + * Add max_footprint functions + * Ensure all appropriate literals are size_t + * Fix conditional compilation problem for some #define settings + * Avoid concatenating segments with the one provided + in create_mspace_with_base + * Rename some variables to avoid compiler shadowing warnings + * Use explicit lock initialization. + * Better handling of sbrk interference. + * Simplify and fix segment insertion, trimming and mspace_destroy + * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x + * Thanks especially to Dennis Flanagan for help on these. + + V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee) + * Fix memalign brace error. + + V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee) + * Fix improper #endif nesting in C++ + * Add explicit casts needed for C++ + + V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee) + * Use trees for large bins + * Support mspaces + * Use segments to unify sbrk-based and mmap-based system allocation, + removing need for emulation on most platforms without sbrk. + * Default safety checks + * Optional footer checks. Thanks to William Robertson for the idea. + * Internal code refactoring + * Incorporate suggestions and platform-specific changes. + Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas, + Aaron Bachmann, Emery Berger, and others. + * Speed up non-fastbin processing enough to remove fastbins. + * Remove useless cfree() to avoid conflicts with other apps. + * Remove internal memcpy, memset. Compilers handle builtins better. + * Remove some options that no one ever used and rename others. + + V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee) + * Fix malloc_state bitmap array misdeclaration + + V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee) + * Allow tuning of FIRST_SORTED_BIN_SIZE + * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte. + * Better detection and support for non-contiguousness of MORECORE. + Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger + * Bypass most of malloc if no frees. Thanks To Emery Berger. + * Fix freeing of old top non-contiguous chunk im sysmalloc. + * Raised default trim and map thresholds to 256K. + * Fix mmap-related #defines. Thanks to Lubos Lunak. + * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield. + * Branch-free bin calculation + * Default trim and mmap thresholds now 256K. + + V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) + * Introduce independent_comalloc and independent_calloc. + Thanks to Michael Pachos for motivation and help. + * Make optional .h file available + * Allow > 2GB requests on 32bit systems. + * new WIN32 sbrk, mmap, munmap, lock code from . + Thanks also to Andreas Mueller , + and Anonymous. + * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for + helping test this.) + * memalign: check alignment arg + * realloc: don't try to shift chunks backwards, since this + leads to more fragmentation in some programs and doesn't + seem to help in any others. + * Collect all cases in malloc requiring system memory into sysmalloc + * Use mmap as backup to sbrk + * Place all internal state in malloc_state + * Introduce fastbins (although similar to 2.5.1) + * Many minor tunings and cosmetic improvements + * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK + * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS + Thanks to Tony E. Bennett and others. + * Include errno.h to support default failure action. + + V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee) + * return null for negative arguments + * Added Several WIN32 cleanups from Martin C. Fong + * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h' + (e.g. WIN32 platforms) + * Cleanup header file inclusion for WIN32 platforms + * Cleanup code to avoid Microsoft Visual C++ compiler complaints + * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing + memory allocation routines + * Set 'malloc_getpagesize' for WIN32 platforms (needs more work) + * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to + usage of 'assert' in non-WIN32 code + * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to + avoid infinite loop + * Always call 'fREe()' rather than 'free()' + + V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee) + * Fixed ordering problem with boundary-stamping + + V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) + * Added pvalloc, as recommended by H.J. Liu + * Added 64bit pointer support mainly from Wolfram Gloger + * Added anonymously donated WIN32 sbrk emulation + * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen + * malloc_extend_top: fix mask error that caused wastage after + foreign sbrks + * Add linux mremap support code from HJ Liu + + V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) + * Integrated most documentation with the code. + * Add support for mmap, with help from + Wolfram Gloger (Gloger@lrz.uni-muenchen.de). + * Use last_remainder in more cases. + * Pack bins using idea from colin@nyx10.cs.du.edu + * Use ordered bins instead of best-fit threshold + * Eliminate block-local decls to simplify tracing and debugging. + * Support another case of realloc via move into top + * Fix error occurring when initial sbrk_base not word-aligned. + * Rely on page size for units instead of SBRK_UNIT to + avoid surprises about sbrk alignment conventions. + * Add mallinfo, mallopt. Thanks to Raymond Nijssen + (raymond@es.ele.tue.nl) for the suggestion. + * Add `pad' argument to malloc_trim and top_pad mallopt parameter. + * More precautions for cases where other routines call sbrk, + courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). + * Added macros etc., allowing use in linux libc from + H.J. Lu (hjl@gnu.ai.mit.edu) + * Inverted this history list + + V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) + * Re-tuned and fixed to behave more nicely with V2.6.0 changes. + * Removed all preallocation code since under current scheme + the work required to undo bad preallocations exceeds + the work saved in good cases for most test programs. + * No longer use return list or unconsolidated bins since + no scheme using them consistently outperforms those that don't + given above changes. + * Use best fit for very large chunks to prevent some worst-cases. + * Added some support for debugging + + V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) + * Removed footers when chunks are in use. Thanks to + Paul Wilson (wilson@cs.texas.edu) for the suggestion. + + V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) + * Added malloc_trim, with help from Wolfram Gloger + (wmglo@Dent.MED.Uni-Muenchen.DE). + + V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) + + V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) + * realloc: try to expand in both directions + * malloc: swap order of clean-bin strategy; + * realloc: only conditionally expand backwards + * Try not to scavenge used bins + * Use bin counts as a guide to preallocation + * Occasionally bin return list chunks in first scan + * Add a few optimizations from colin@nyx10.cs.du.edu + + V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) + * faster bin computation & slightly different binning + * merged all consolidations to one part of malloc proper + (eliminating old malloc_find_space & malloc_clean_bin) + * Scan 2 returns chunks (not just 1) + * Propagate failure in realloc if malloc returns 0 + * Add stuff to allow compilation on non-ANSI compilers + from kpv@research.att.com + + V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) + * removed potential for odd address access in prev_chunk + * removed dependency on getpagesize.h + * misc cosmetics and a bit more internal documentation + * anticosmetics: mangled names in macros to evade debugger strangeness + * tested on sparc, hp-700, dec-mips, rs6000 + with gcc & native cc (hp, dec only) allowing + Detlefs & Zorn comparison study (in SIGPLAN Notices.) + + Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) + * Based loosely on libg++-1.2X malloc. (It retains some of the overall + structure of old version, but most details differ.) + +*/ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/eabi.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/eabi.S new file mode 100644 index 0000000..379ea4b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/eabi.S @@ -0,0 +1,128 @@ +/* ----------------------------------------------------------------------- + eabi.S - Copyright (c) 2004 Anthony Green + + FR-V Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + .globl ffi_prep_args_EABI + + .text + .p2align 4 + .globl ffi_call_EABI + .type ffi_call_EABI, @function + + # gr8 : ffi_prep_args + # gr9 : &ecif + # gr10: cif->bytes + # gr11: fig->flags + # gr12: ecif.rvalue + # gr13: fn + +ffi_call_EABI: + addi sp, #-80, sp + sti fp, @(sp, #24) + addi sp, #24, fp + movsg lr, gr5 + + /* Make room for the new arguments. */ + /* subi sp, fp, gr10 */ + + /* Store return address and incoming args on stack. */ + sti gr5, @(fp, #8) + sti gr8, @(fp, #-4) + sti gr9, @(fp, #-8) + sti gr10, @(fp, #-12) + sti gr11, @(fp, #-16) + sti gr12, @(fp, #-20) + sti gr13, @(fp, #-24) + + sub sp, gr10, sp + + /* Call ffi_prep_args. */ + ldi @(fp, #-4), gr4 + addi sp, #0, gr8 + ldi @(fp, #-8), gr9 +#ifdef __FRV_FDPIC__ + ldd @(gr4, gr0), gr14 + calll @(gr14, gr0) +#else + calll @(gr4, gr0) +#endif + + /* ffi_prep_args returns the new stack pointer. */ + mov gr8, gr4 + + ldi @(sp, #0), gr8 + ldi @(sp, #4), gr9 + ldi @(sp, #8), gr10 + ldi @(sp, #12), gr11 + ldi @(sp, #16), gr12 + ldi @(sp, #20), gr13 + + /* Always copy the return value pointer into the hidden + parameter register. This is only strictly necessary + when we're returning an aggregate type, but it doesn't + hurt to do this all the time, and it saves a branch. */ + ldi @(fp, #-20), gr3 + + /* Use the ffi_prep_args return value for the new sp. */ + mov gr4, sp + + /* Call the target function. */ + ldi @(fp, -24), gr4 +#ifdef __FRV_FDPIC__ + ldd @(gr4, gr0), gr14 + calll @(gr14, gr0) +#else + calll @(gr4, gr0) +#endif + + /* Store the result. */ + ldi @(fp, #-16), gr10 /* fig->flags */ + ldi @(fp, #-20), gr4 /* ecif.rvalue */ + + /* Is the return value stored in two registers? */ + cmpi gr10, #8, icc0 + bne icc0, 0, .L2 + /* Yes, save them. */ + sti gr8, @(gr4, #0) + sti gr9, @(gr4, #4) + bra .L3 +.L2: + /* Is the return value a structure? */ + cmpi gr10, #-1, icc0 + beq icc0, 0, .L3 + /* No, save a 4 byte return value. */ + sti gr8, @(gr4, #0) +.L3: + + /* Restore the stack, and return. */ + ldi @(fp, 8), gr5 + ld @(fp, gr0), fp + addi sp,#80,sp + jmpl @(gr5,gr0) + .size ffi_call_EABI, .-ffi_call_EABI + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffi.c new file mode 100644 index 0000000..ed1c65a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffi.c @@ -0,0 +1,292 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (C) 2004 Anthony Green + Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2008 Red Hat, Inc. + + FR-V Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void *ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + register int count = 0; + + p_argv = ecif->avalue; + argp = stack; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); + i--, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + + if ((*p_arg)->type == FFI_TYPE_STRUCT) + { + z = sizeof(void*); + *(void **) argp = *p_argv; + } + /* if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (count > 24) + { + // This is going on the stack. Turn it into a double. + *(double *) argp = (double) *(float*)(* p_argv); + z = sizeof(double); + } + else + *(void **) argp = *(void **)(* p_argv); + } */ + else if (z < sizeof(int)) + { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof(int)) + { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + count += z; + } + + return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8))); +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + if (cif->rtype->type == FFI_TYPE_STRUCT) + cif->flags = -1; + else + cif->flags = cif->rtype->size; + + cif->bytes = FFI_ALIGN (cif->bytes, 8); + + return FFI_OK; +} + +extern void ffi_call_EABI(void *(*)(char *, extended_cif *), + extended_cif *, + unsigned, unsigned, + unsigned *, + void (*fn)(void)); + +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { + case FFI_EABI: + ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + default: + FFI_ASSERT(0); + break; + } +} + +void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, + unsigned arg4, unsigned arg5, unsigned arg6) +{ + /* This function is called by a trampoline. The trampoline stows a + pointer to the ffi_closure object in gr7. We must save this + pointer in a place that will persist while we do our work. */ + register ffi_closure *creg __asm__ ("gr7"); + ffi_closure *closure = creg; + + /* Arguments that don't fit in registers are found on the stack + at a fixed offset above the current frame pointer. */ + register char *frame_pointer __asm__ ("fp"); + char *stack_args = frame_pointer + 16; + + /* Lay the register arguments down in a continuous chunk of memory. */ + unsigned register_args[6] = + { arg1, arg2, arg3, arg4, arg5, arg6 }; + + ffi_cif *cif = closure->cif; + ffi_type **arg_types = cif->arg_types; + void **avalue = alloca (cif->nargs * sizeof(void *)); + char *ptr = (char *) register_args; + int i; + + /* Find the address of each argument. */ + for (i = 0; i < cif->nargs; i++) + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = ptr + 3; + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = ptr + 2; + break; + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + avalue[i] = ptr; + break; + case FFI_TYPE_STRUCT: + avalue[i] = *(void**)ptr; + break; + default: + /* This is an 8-byte value. */ + avalue[i] = ptr; + ptr += 4; + break; + } + ptr += 4; + + /* If we've handled more arguments than fit in registers, + start looking at the those passed on the stack. */ + if (ptr == ((char *)register_args + (6*4))) + ptr = stack_args; + } + + /* Invoke the closure. */ + if (cif->rtype->type == FFI_TYPE_STRUCT) + { + /* The caller allocates space for the return structure, and + passes a pointer to this space in gr3. Use this value directly + as the return value. */ + register void *return_struct_ptr __asm__("gr3"); + (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data); + } + else + { + /* Allocate space for the return value and call the function. */ + long long rvalue; + (closure->fun) (cif, &rvalue, avalue, closure->user_data); + + /* Functions return 4-byte or smaller results in gr8. 8-byte + values also use gr9. We fill the both, even for small return + values, just to avoid a branch. */ + asm ("ldi @(%0, #0), gr8" : : "r" (&rvalue)); + asm ("ldi @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1])); + } +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + unsigned long fn = (long) ffi_closure_eabi; + unsigned long cls = (long) codeloc; +#ifdef __FRV_FDPIC__ + register void *got __asm__("gr15"); +#endif + int i; + + fn = (unsigned long) ffi_closure_eabi; + +#ifdef __FRV_FDPIC__ + tramp[0] = &((unsigned int *)codeloc)[2]; + tramp[1] = got; + tramp[2] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ + tramp[3] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ + tramp[4] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ + tramp[5] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ + tramp[6] = 0x9cc86000; /* ldi @(gr6, #0), gr14 */ + tramp[7] = 0x8030e000; /* jmpl @(gr14, gr0) */ +#else + tramp[0] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ + tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ + tramp[2] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ + tramp[3] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ + tramp[4] = 0x80300006; /* jmpl @(gr0, gr6) */ +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Cache flushing. */ + for (i = 0; i < FFI_TRAMPOLINE_SIZE; i++) + __asm__ volatile ("dcf @(%0,%1)\n\tici @(%2,%1)" :: "r" (tramp), "r" (i), + "r" (codeloc)); + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffitarget.h new file mode 100644 index 0000000..d42540e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/frv/ffitarget.h @@ -0,0 +1,62 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2004 Red Hat, Inc. + Target configuration macros for FR-V + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_EABI, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_EABI +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#ifdef __FRV_FDPIC__ +/* Trampolines are 8 4-byte instructions long. */ +#define FFI_TRAMPOLINE_SIZE (8*4) +#else +/* Trampolines are 5 4-byte instructions long. */ +#define FFI_TRAMPOLINE_SIZE (5*4) +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffi.c new file mode 100644 index 0000000..b1d04c3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffi.c @@ -0,0 +1,604 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc. + Copyright (c) 2000 Hewlett Packard Company + Copyright (c) 2011 Anthony Green + + IA64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include +#include + +#include "ia64_flags.h" + +/* A 64-bit pointer value. In LP64 mode, this is effectively a plain + pointer. In ILP32 mode, it's a pointer that's been extended to + 64 bits by "addp4". */ +typedef void *PTR64 __attribute__((mode(DI))); + +/* Memory image of fp register contents. This is the implementation + specific format used by ldf.fill/stf.spill. All we care about is + that it wants a 16 byte aligned slot. */ +typedef struct +{ + UINT64 x[2] __attribute__((aligned(16))); +} fpreg; + + +/* The stack layout given to ffi_call_unix and ffi_closure_unix_inner. */ + +struct ia64_args +{ + fpreg fp_regs[8]; /* Contents of 8 fp arg registers. */ + UINT64 gp_regs[8]; /* Contents of 8 gp arg registers. */ + UINT64 other_args[]; /* Arguments passed on stack, variable size. */ +}; + + +/* Adjust ADDR, a pointer to an 8 byte slot, to point to the low LEN bytes. */ + +static inline void * +endian_adjust (void *addr, size_t len) +{ +#ifdef __BIG_ENDIAN__ + return addr + (8 - len); +#else + return addr; +#endif +} + +/* Store VALUE to ADDR in the current cpu implementation's fp spill format. + This is a macro instead of a function, so that it works for all 3 floating + point types without type conversions. Type conversion to long double breaks + the denorm support. */ + +#define stf_spill(addr, value) \ + asm ("stf.spill %0 = %1%P0" : "=m" (*addr) : "f"(value)); + +/* Load a value from ADDR, which is in the current cpu implementation's + fp spill format. As above, this must also be a macro. */ + +#define ldf_fill(result, addr) \ + asm ("ldf.fill %0 = %1%P1" : "=f"(result) : "m"(*addr)); + +/* Return the size of the C type associated with with TYPE. Which will + be one of the FFI_IA64_TYPE_HFA_* values. */ + +static size_t +hfa_type_size (int type) +{ + switch (type) + { + case FFI_IA64_TYPE_HFA_FLOAT: + return sizeof(float); + case FFI_IA64_TYPE_HFA_DOUBLE: + return sizeof(double); + case FFI_IA64_TYPE_HFA_LDOUBLE: + return sizeof(__float80); + default: + abort (); + } +} + +/* Load from ADDR a value indicated by TYPE. Which will be one of + the FFI_IA64_TYPE_HFA_* values. */ + +static void +hfa_type_load (fpreg *fpaddr, int type, void *addr) +{ + switch (type) + { + case FFI_IA64_TYPE_HFA_FLOAT: + stf_spill (fpaddr, *(float *) addr); + return; + case FFI_IA64_TYPE_HFA_DOUBLE: + stf_spill (fpaddr, *(double *) addr); + return; + case FFI_IA64_TYPE_HFA_LDOUBLE: + stf_spill (fpaddr, *(__float80 *) addr); + return; + default: + abort (); + } +} + +/* Load VALUE into ADDR as indicated by TYPE. Which will be one of + the FFI_IA64_TYPE_HFA_* values. */ + +static void +hfa_type_store (int type, void *addr, fpreg *fpaddr) +{ + switch (type) + { + case FFI_IA64_TYPE_HFA_FLOAT: + { + float result; + ldf_fill (result, fpaddr); + *(float *) addr = result; + break; + } + case FFI_IA64_TYPE_HFA_DOUBLE: + { + double result; + ldf_fill (result, fpaddr); + *(double *) addr = result; + break; + } + case FFI_IA64_TYPE_HFA_LDOUBLE: + { + __float80 result; + ldf_fill (result, fpaddr); + *(__float80 *) addr = result; + break; + } + default: + abort (); + } +} + +/* Is TYPE a struct containing floats, doubles, or extended doubles, + all of the same fp type? If so, return the element type. Return + FFI_TYPE_VOID if not. */ + +static int +hfa_element_type (ffi_type *type, int nested) +{ + int element = FFI_TYPE_VOID; + + switch (type->type) + { + case FFI_TYPE_FLOAT: + /* We want to return VOID for raw floating-point types, but the + synthetic HFA type if we're nested within an aggregate. */ + if (nested) + element = FFI_IA64_TYPE_HFA_FLOAT; + break; + + case FFI_TYPE_DOUBLE: + /* Similarly. */ + if (nested) + element = FFI_IA64_TYPE_HFA_DOUBLE; + break; + + case FFI_TYPE_LONGDOUBLE: + /* Similarly, except that that HFA is true for double extended, + but not quad precision. Both have sizeof == 16, so tell the + difference based on the precision. */ + if (LDBL_MANT_DIG == 64 && nested) + element = FFI_IA64_TYPE_HFA_LDOUBLE; + break; + + case FFI_TYPE_STRUCT: + { + ffi_type **ptr = &type->elements[0]; + + for (ptr = &type->elements[0]; *ptr ; ptr++) + { + int sub_element = hfa_element_type (*ptr, 1); + if (sub_element == FFI_TYPE_VOID) + return FFI_TYPE_VOID; + + if (element == FFI_TYPE_VOID) + element = sub_element; + else if (element != sub_element) + return FFI_TYPE_VOID; + } + } + break; + + default: + return FFI_TYPE_VOID; + } + + return element; +} + + +/* Perform machine dependent cif processing. */ + +static ffi_status +ffi_prep_cif_machdep_core(ffi_cif *cif) +{ + int flags; + + /* Adjust cif->bytes to include space for the bits of the ia64_args frame + that precedes the integer register portion. The estimate that the + generic bits did for the argument space required is good enough for the + integer component. */ + cif->bytes += offsetof(struct ia64_args, gp_regs[0]); + if (cif->bytes < sizeof(struct ia64_args)) + cif->bytes = sizeof(struct ia64_args); + + /* Set the return type flag. */ + flags = cif->rtype->type; + switch (cif->rtype->type) + { + case FFI_TYPE_LONGDOUBLE: + /* Leave FFI_TYPE_LONGDOUBLE as meaning double extended precision, + and encode quad precision as a two-word integer structure. */ + if (LDBL_MANT_DIG != 64) + flags = FFI_IA64_TYPE_SMALL_STRUCT | (16 << 8); + break; + + case FFI_TYPE_STRUCT: + { + size_t size = cif->rtype->size; + int hfa_type = hfa_element_type (cif->rtype, 0); + + if (hfa_type != FFI_TYPE_VOID) + { + size_t nelts = size / hfa_type_size (hfa_type); + if (nelts <= 8) + flags = hfa_type | (size << 8); + } + else + { + if (size <= 32) + flags = FFI_IA64_TYPE_SMALL_STRUCT | (size << 8); + } + } + break; + + default: + break; + } + cif->flags = flags; + + return FFI_OK; +} + +ffi_status +ffi_prep_cif_machdep(ffi_cif *cif) +{ + cif->nfixedargs = cif->nargs; + return ffi_prep_cif_machdep_core(cif); +} + +ffi_status +ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned int nfixedargs, + unsigned int ntotalargs MAYBE_UNUSED) +{ + cif->nfixedargs = nfixedargs; + return ffi_prep_cif_machdep_core(cif); +} + +extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64); + +void +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + struct ia64_args *stack; + long i, avn, gpcount, fpcount; + ffi_type **p_arg; + + FFI_ASSERT (cif->abi == FFI_UNIX); + + /* If we have no spot for a return value, make one. */ + if (rvalue == NULL && cif->rtype->type != FFI_TYPE_VOID) + rvalue = alloca (cif->rtype->size); + + /* Allocate the stack frame. */ + stack = alloca (cif->bytes); + + gpcount = fpcount = 0; + avn = cif->nargs; + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + stack->gp_regs[gpcount++] = *(SINT8 *)avalue[i]; + break; + case FFI_TYPE_UINT8: + stack->gp_regs[gpcount++] = *(UINT8 *)avalue[i]; + break; + case FFI_TYPE_SINT16: + stack->gp_regs[gpcount++] = *(SINT16 *)avalue[i]; + break; + case FFI_TYPE_UINT16: + stack->gp_regs[gpcount++] = *(UINT16 *)avalue[i]; + break; + case FFI_TYPE_SINT32: + stack->gp_regs[gpcount++] = *(SINT32 *)avalue[i]; + break; + case FFI_TYPE_UINT32: + stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i]; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; + break; + + case FFI_TYPE_POINTER: + stack->gp_regs[gpcount++] = (UINT64)(PTR64) *(void **)avalue[i]; + break; + + case FFI_TYPE_FLOAT: + if (gpcount < 8 && fpcount < 8) + stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]); + { + UINT32 tmp; + memcpy (&tmp, avalue[i], sizeof (UINT32)); + stack->gp_regs[gpcount++] = tmp; + } + break; + + case FFI_TYPE_DOUBLE: + if (gpcount < 8 && fpcount < 8) + stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]); + memcpy (&stack->gp_regs[gpcount++], avalue[i], sizeof (UINT64)); + break; + + case FFI_TYPE_LONGDOUBLE: + if (gpcount & 1) + gpcount++; + if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8) + stf_spill (&stack->fp_regs[fpcount++], *(__float80 *)avalue[i]); + memcpy (&stack->gp_regs[gpcount], avalue[i], 16); + gpcount += 2; + break; + + case FFI_TYPE_STRUCT: + { + size_t size = (*p_arg)->size; + size_t align = (*p_arg)->alignment; + int hfa_type = hfa_element_type (*p_arg, 0); + + FFI_ASSERT (align <= 16); + if (align == 16 && (gpcount & 1)) + gpcount++; + + if (hfa_type != FFI_TYPE_VOID) + { + size_t hfa_size = hfa_type_size (hfa_type); + size_t offset = 0; + size_t gp_offset = gpcount * 8; + + while (fpcount < 8 + && offset < size + && gp_offset < 8 * 8) + { + hfa_type_load (&stack->fp_regs[fpcount], hfa_type, + avalue[i] + offset); + offset += hfa_size; + gp_offset += hfa_size; + fpcount += 1; + } + } + + memcpy (&stack->gp_regs[gpcount], avalue[i], size); + gpcount += (size + 7) / 8; + } + break; + + default: + abort (); + } + } + + ffi_call_unix (stack, rvalue, fn, cif->flags); +} + +/* Closures represent a pair consisting of a function pointer, and + some user data. A closure is invoked by reinterpreting the closure + as a function pointer, and branching to it. Thus we can make an + interpreted function callable as a C function: We turn the + interpreter itself, together with a pointer specifying the + interpreted procedure, into a closure. + + For IA64, function pointer are already pairs consisting of a code + pointer, and a gp pointer. The latter is needed to access global + variables. Here we set up such a pair as the first two words of + the closure (in the "trampoline" area), but we replace the gp + pointer with a pointer to the closure itself. We also add the real + gp pointer to the closure. This allows the function entry code to + both retrieve the user data, and to restore the correct gp pointer. */ + +extern void ffi_closure_unix (); + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + /* The layout of a function descriptor. A C function pointer really + points to one of these. */ + struct ia64_fd + { + UINT64 code_pointer; + UINT64 gp; + }; + + struct ffi_ia64_trampoline_struct + { + UINT64 code_pointer; /* Pointer to ffi_closure_unix. */ + UINT64 fake_gp; /* Pointer to closure, installed as gp. */ + UINT64 real_gp; /* Real gp value. */ + }; + + struct ffi_ia64_trampoline_struct *tramp; + struct ia64_fd *fd; + + if (cif->abi != FFI_UNIX) + return FFI_BAD_ABI; + + tramp = (struct ffi_ia64_trampoline_struct *)closure->tramp; + fd = (struct ia64_fd *)(void *)ffi_closure_unix; + + tramp->code_pointer = fd->code_pointer; + tramp->real_gp = fd->gp; + tramp->fake_gp = (UINT64)(PTR64)codeloc; + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + + +UINT64 +ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack, + void *rvalue, void *r8) +{ + ffi_cif *cif; + void **avalue; + ffi_type **p_arg; + long i, avn, gpcount, fpcount, nfixedargs; + + cif = closure->cif; + avn = cif->nargs; + nfixedargs = cif->nfixedargs; + avalue = alloca (avn * sizeof (void *)); + + /* If the structure return value is passed in memory get that location + from r8 so as to pass the value directly back to the caller. */ + if (cif->flags == FFI_TYPE_STRUCT) + rvalue = r8; + + gpcount = fpcount = 0; + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + int named = i < nfixedargs; + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 1); + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 2); + break; + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 4); + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + avalue[i] = &stack->gp_regs[gpcount++]; + break; + case FFI_TYPE_POINTER: + avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], sizeof(void*)); + break; + + case FFI_TYPE_FLOAT: + if (named && gpcount < 8 && fpcount < 8) + { + fpreg *addr = &stack->fp_regs[fpcount++]; + float result; + avalue[i] = addr; + ldf_fill (result, addr); + *(float *)addr = result; + } + else + avalue[i] = endian_adjust(&stack->gp_regs[gpcount], 4); + gpcount++; + break; + + case FFI_TYPE_DOUBLE: + if (named && gpcount < 8 && fpcount < 8) + { + fpreg *addr = &stack->fp_regs[fpcount++]; + double result; + avalue[i] = addr; + ldf_fill (result, addr); + *(double *)addr = result; + } + else + avalue[i] = &stack->gp_regs[gpcount]; + gpcount++; + break; + + case FFI_TYPE_LONGDOUBLE: + if (gpcount & 1) + gpcount++; + if (LDBL_MANT_DIG == 64 && named && gpcount < 8 && fpcount < 8) + { + fpreg *addr = &stack->fp_regs[fpcount++]; + __float80 result; + avalue[i] = addr; + ldf_fill (result, addr); + *(__float80 *)addr = result; + } + else + avalue[i] = &stack->gp_regs[gpcount]; + gpcount += 2; + break; + + case FFI_TYPE_STRUCT: + { + size_t size = (*p_arg)->size; + size_t align = (*p_arg)->alignment; + int hfa_type = hfa_element_type (*p_arg, 0); + + FFI_ASSERT (align <= 16); + if (align == 16 && (gpcount & 1)) + gpcount++; + + if (hfa_type != FFI_TYPE_VOID) + { + size_t hfa_size = hfa_type_size (hfa_type); + size_t offset = 0; + size_t gp_offset = gpcount * 8; + void *addr = alloca (size); + + avalue[i] = addr; + + while (fpcount < 8 + && offset < size + && gp_offset < 8 * 8) + { + hfa_type_store (hfa_type, addr + offset, + &stack->fp_regs[fpcount]); + offset += hfa_size; + gp_offset += hfa_size; + fpcount += 1; + } + + if (offset < size) + memcpy (addr + offset, (char *)stack->gp_regs + gp_offset, + size - offset); + } + else + avalue[i] = &stack->gp_regs[gpcount]; + + gpcount += (size + 7) / 8; + } + break; + + default: + abort (); + } + } + + closure->fun (cif, rvalue, avalue, closure->user_data); + + return cif->flags; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffitarget.h new file mode 100644 index 0000000..fd5b9a0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ffitarget.h @@ -0,0 +1,56 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for IA-64. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long long ffi_arg; +typedef signed long long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_UNIX, /* Linux and all Unix variants use the same conventions */ + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_UNIX +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */ + /* can be interpreted as a C function */ + /* descriptor: */ +#define FFI_TARGET_SPECIFIC_VARIADIC 1 +#define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ia64_flags.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ia64_flags.h new file mode 100644 index 0000000..9d652ce --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/ia64_flags.h @@ -0,0 +1,40 @@ +/* ----------------------------------------------------------------------- + ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company + + IA64/unix Foreign Function Interface + + Original author: Hans Boehm, HP Labs + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* "Type" codes used between assembly and C. When used as a part of + a cfi->flags value, the low byte will be these extra type codes, + and bits 8-31 will be the actual size of the type. */ + +/* Small structures containing N words in integer registers. */ +#define FFI_IA64_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 1) + +/* Homogeneous Floating Point Aggregates (HFAs) which are returned + in FP registers. */ +#define FFI_IA64_TYPE_HFA_FLOAT (FFI_TYPE_LAST + 2) +#define FFI_IA64_TYPE_HFA_DOUBLE (FFI_TYPE_LAST + 3) +#define FFI_IA64_TYPE_HFA_LDOUBLE (FFI_TYPE_LAST + 4) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/unix.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/unix.S new file mode 100644 index 0000000..e2547e0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/ia64/unix.S @@ -0,0 +1,567 @@ +/* ----------------------------------------------------------------------- + unix.S - Copyright (c) 1998, 2008 Red Hat, Inc. + Copyright (c) 2000 Hewlett Packard Company + + IA64/unix Foreign Function Interface + + Primary author: Hans Boehm, HP Labs + + Loosely modeled on Cygnus code for other platforms. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include "ia64_flags.h" + + .pred.safe_across_calls p1-p5,p16-p63 +.text + +/* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue, + void (*fn)(void), int flags); + */ + + .align 16 + .global ffi_call_unix + .proc ffi_call_unix +ffi_call_unix: + .prologue + /* Bit o trickiness. We actually share a stack frame with ffi_call. + Rely on the fact that ffi_call uses a vframe and don't bother + tracking one here at all. */ + .fframe 0 + .save ar.pfs, r36 // loc0 + alloc loc0 = ar.pfs, 4, 3, 8, 0 + .save rp, loc1 + mov loc1 = b0 + .body + add r16 = 16, in0 + mov loc2 = gp + mov r8 = in1 + ;; + + /* Load up all of the argument registers. */ + ldf.fill f8 = [in0], 32 + ldf.fill f9 = [r16], 32 + ;; + ldf.fill f10 = [in0], 32 + ldf.fill f11 = [r16], 32 + ;; + ldf.fill f12 = [in0], 32 + ldf.fill f13 = [r16], 32 + ;; + ldf.fill f14 = [in0], 32 + ldf.fill f15 = [r16], 24 + ;; + ld8 out0 = [in0], 16 + ld8 out1 = [r16], 16 + ;; + ld8 out2 = [in0], 16 + ld8 out3 = [r16], 16 + ;; + ld8 out4 = [in0], 16 + ld8 out5 = [r16], 16 + ;; + ld8 out6 = [in0] + ld8 out7 = [r16] + ;; + + /* Deallocate the register save area from the stack frame. */ + mov sp = in0 + + /* Call the target function. */ + ld8 r16 = [in2], 8 + ;; + ld8 gp = [in2] + mov b6 = r16 + br.call.sptk.many b0 = b6 + ;; + + /* Dispatch to handle return value. */ + mov gp = loc2 + zxt1 r16 = in3 + ;; + mov ar.pfs = loc0 + addl r18 = @ltoffx(.Lst_table), gp + ;; + ld8.mov r18 = [r18], .Lst_table + mov b0 = loc1 + ;; + shladd r18 = r16, 3, r18 + ;; + ld8 r17 = [r18] + shr in3 = in3, 8 + ;; + add r17 = r17, r18 + ;; + mov b6 = r17 + br b6 + ;; + +.Lst_void: + br.ret.sptk.many b0 + ;; +.Lst_uint8: + zxt1 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_sint8: + sxt1 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_uint16: + zxt2 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_sint16: + sxt2 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_uint32: + zxt4 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_sint32: + sxt4 r8 = r8 + ;; + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_int64: + st8 [in1] = r8 + br.ret.sptk.many b0 + ;; +.Lst_float: + stfs [in1] = f8 + br.ret.sptk.many b0 + ;; +.Lst_double: + stfd [in1] = f8 + br.ret.sptk.many b0 + ;; +.Lst_ldouble: + stfe [in1] = f8 + br.ret.sptk.many b0 + ;; + +.Lst_small_struct: + cmp.lt p6, p0 = 8, in3 + cmp.lt p7, p0 = 16, in3 + cmp.lt p8, p0 = 24, in3 + ;; + add r16 = 8, sp + add r17 = 16, sp + add r18 = 24, sp + ;; + st8 [sp] = r8 +(p6) st8 [r16] = r9 + mov out0 = in1 +(p7) st8 [r17] = r10 +(p8) st8 [r18] = r11 + mov out1 = sp + mov out2 = in3 + ;; + // ia64 software calling convention requires + // top 16 bytes of stack to be scratch space + // PLT resolver uses that scratch space at + // 'memcpy' symbol reolution time + add sp = -16, sp + br.call.sptk.many b0 = memcpy# + ;; + mov ar.pfs = loc0 + mov b0 = loc1 + mov gp = loc2 + br.ret.sptk.many b0 + +.Lst_hfa_float: + add r16 = 4, in1 + cmp.lt p6, p0 = 4, in3 + ;; + stfs [in1] = f8, 8 +(p6) stfs [r16] = f9, 8 + cmp.lt p7, p0 = 8, in3 + cmp.lt p8, p0 = 12, in3 + ;; +(p7) stfs [in1] = f10, 8 +(p8) stfs [r16] = f11, 8 + cmp.lt p9, p0 = 16, in3 + cmp.lt p10, p0 = 20, in3 + ;; +(p9) stfs [in1] = f12, 8 +(p10) stfs [r16] = f13, 8 + cmp.lt p6, p0 = 24, in3 + cmp.lt p7, p0 = 28, in3 + ;; +(p6) stfs [in1] = f14 +(p7) stfs [r16] = f15 + br.ret.sptk.many b0 + ;; + +.Lst_hfa_double: + add r16 = 8, in1 + cmp.lt p6, p0 = 8, in3 + ;; + stfd [in1] = f8, 16 +(p6) stfd [r16] = f9, 16 + cmp.lt p7, p0 = 16, in3 + cmp.lt p8, p0 = 24, in3 + ;; +(p7) stfd [in1] = f10, 16 +(p8) stfd [r16] = f11, 16 + cmp.lt p9, p0 = 32, in3 + cmp.lt p10, p0 = 40, in3 + ;; +(p9) stfd [in1] = f12, 16 +(p10) stfd [r16] = f13, 16 + cmp.lt p6, p0 = 48, in3 + cmp.lt p7, p0 = 56, in3 + ;; +(p6) stfd [in1] = f14 +(p7) stfd [r16] = f15 + br.ret.sptk.many b0 + ;; + +.Lst_hfa_ldouble: + add r16 = 16, in1 + cmp.lt p6, p0 = 16, in3 + ;; + stfe [in1] = f8, 32 +(p6) stfe [r16] = f9, 32 + cmp.lt p7, p0 = 32, in3 + cmp.lt p8, p0 = 48, in3 + ;; +(p7) stfe [in1] = f10, 32 +(p8) stfe [r16] = f11, 32 + cmp.lt p9, p0 = 64, in3 + cmp.lt p10, p0 = 80, in3 + ;; +(p9) stfe [in1] = f12, 32 +(p10) stfe [r16] = f13, 32 + cmp.lt p6, p0 = 96, in3 + cmp.lt p7, p0 = 112, in3 + ;; +(p6) stfe [in1] = f14 +(p7) stfe [r16] = f15 + br.ret.sptk.many b0 + ;; + + .endp ffi_call_unix + + .align 16 + .global ffi_closure_unix + .proc ffi_closure_unix + +#define FRAME_SIZE (8*16 + 8*8 + 8*16) + +ffi_closure_unix: + .prologue + .save ar.pfs, r40 // loc0 + alloc loc0 = ar.pfs, 8, 4, 4, 0 + .fframe FRAME_SIZE + add r12 = -FRAME_SIZE, r12 + .save rp, loc1 + mov loc1 = b0 + .save ar.unat, loc2 + mov loc2 = ar.unat + .body + + /* Retrieve closure pointer and real gp. */ +#ifdef _ILP32 + addp4 out0 = 0, gp + addp4 gp = 16, gp +#else + mov out0 = gp + add gp = 16, gp +#endif + ;; + ld8 gp = [gp] + + /* Spill all of the possible argument registers. */ + add r16 = 16 + 8*16, sp + add r17 = 16 + 8*16 + 16, sp + ;; + stf.spill [r16] = f8, 32 + stf.spill [r17] = f9, 32 + mov loc3 = gp + ;; + stf.spill [r16] = f10, 32 + stf.spill [r17] = f11, 32 + ;; + stf.spill [r16] = f12, 32 + stf.spill [r17] = f13, 32 + ;; + stf.spill [r16] = f14, 32 + stf.spill [r17] = f15, 24 + ;; + .mem.offset 0, 0 + st8.spill [r16] = in0, 16 + .mem.offset 8, 0 + st8.spill [r17] = in1, 16 + add out1 = 16 + 8*16, sp + ;; + .mem.offset 0, 0 + st8.spill [r16] = in2, 16 + .mem.offset 8, 0 + st8.spill [r17] = in3, 16 + add out2 = 16, sp + ;; + .mem.offset 0, 0 + st8.spill [r16] = in4, 16 + .mem.offset 8, 0 + st8.spill [r17] = in5, 16 + mov out3 = r8 + ;; + .mem.offset 0, 0 + st8.spill [r16] = in6 + .mem.offset 8, 0 + st8.spill [r17] = in7 + + /* Invoke ffi_closure_unix_inner for the hard work. */ + br.call.sptk.many b0 = ffi_closure_unix_inner + ;; + + /* Dispatch to handle return value. */ + mov gp = loc3 + zxt1 r16 = r8 + ;; + addl r18 = @ltoffx(.Lld_table), gp + mov ar.pfs = loc0 + ;; + ld8.mov r18 = [r18], .Lld_table + mov b0 = loc1 + ;; + shladd r18 = r16, 3, r18 + mov ar.unat = loc2 + ;; + ld8 r17 = [r18] + shr r8 = r8, 8 + ;; + add r17 = r17, r18 + add r16 = 16, sp + ;; + mov b6 = r17 + br b6 + ;; + .label_state 1 + +.Lld_void: + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; +.Lld_int: + .body + .copy_state 1 + ld8 r8 = [r16] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; +.Lld_float: + .body + .copy_state 1 + ldfs f8 = [r16] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; +.Lld_double: + .body + .copy_state 1 + ldfd f8 = [r16] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; +.Lld_ldouble: + .body + .copy_state 1 + ldfe f8 = [r16] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; + +.Lld_small_struct: + .body + .copy_state 1 + add r17 = 8, r16 + cmp.lt p6, p0 = 8, r8 + cmp.lt p7, p0 = 16, r8 + cmp.lt p8, p0 = 24, r8 + ;; + ld8 r8 = [r16], 16 +(p6) ld8 r9 = [r17], 16 + ;; +(p7) ld8 r10 = [r16] +(p8) ld8 r11 = [r17] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; + +.Lld_hfa_float: + .body + .copy_state 1 + add r17 = 4, r16 + cmp.lt p6, p0 = 4, r8 + ;; + ldfs f8 = [r16], 8 +(p6) ldfs f9 = [r17], 8 + cmp.lt p7, p0 = 8, r8 + cmp.lt p8, p0 = 12, r8 + ;; +(p7) ldfs f10 = [r16], 8 +(p8) ldfs f11 = [r17], 8 + cmp.lt p9, p0 = 16, r8 + cmp.lt p10, p0 = 20, r8 + ;; +(p9) ldfs f12 = [r16], 8 +(p10) ldfs f13 = [r17], 8 + cmp.lt p6, p0 = 24, r8 + cmp.lt p7, p0 = 28, r8 + ;; +(p6) ldfs f14 = [r16] +(p7) ldfs f15 = [r17] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; + +.Lld_hfa_double: + .body + .copy_state 1 + add r17 = 8, r16 + cmp.lt p6, p0 = 8, r8 + ;; + ldfd f8 = [r16], 16 +(p6) ldfd f9 = [r17], 16 + cmp.lt p7, p0 = 16, r8 + cmp.lt p8, p0 = 24, r8 + ;; +(p7) ldfd f10 = [r16], 16 +(p8) ldfd f11 = [r17], 16 + cmp.lt p9, p0 = 32, r8 + cmp.lt p10, p0 = 40, r8 + ;; +(p9) ldfd f12 = [r16], 16 +(p10) ldfd f13 = [r17], 16 + cmp.lt p6, p0 = 48, r8 + cmp.lt p7, p0 = 56, r8 + ;; +(p6) ldfd f14 = [r16] +(p7) ldfd f15 = [r17] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; + +.Lld_hfa_ldouble: + .body + .copy_state 1 + add r17 = 16, r16 + cmp.lt p6, p0 = 16, r8 + ;; + ldfe f8 = [r16], 32 +(p6) ldfe f9 = [r17], 32 + cmp.lt p7, p0 = 32, r8 + cmp.lt p8, p0 = 48, r8 + ;; +(p7) ldfe f10 = [r16], 32 +(p8) ldfe f11 = [r17], 32 + cmp.lt p9, p0 = 64, r8 + cmp.lt p10, p0 = 80, r8 + ;; +(p9) ldfe f12 = [r16], 32 +(p10) ldfe f13 = [r17], 32 + cmp.lt p6, p0 = 96, r8 + cmp.lt p7, p0 = 112, r8 + ;; +(p6) ldfe f14 = [r16] +(p7) ldfe f15 = [r17] + .restore sp + add sp = FRAME_SIZE, sp + br.ret.sptk.many b0 + ;; + + .endp ffi_closure_unix + + .section .rodata + .align 8 +.Lst_table: + data8 @pcrel(.Lst_void) // FFI_TYPE_VOID + data8 @pcrel(.Lst_sint32) // FFI_TYPE_INT + data8 @pcrel(.Lst_float) // FFI_TYPE_FLOAT + data8 @pcrel(.Lst_double) // FFI_TYPE_DOUBLE + data8 @pcrel(.Lst_ldouble) // FFI_TYPE_LONGDOUBLE + data8 @pcrel(.Lst_uint8) // FFI_TYPE_UINT8 + data8 @pcrel(.Lst_sint8) // FFI_TYPE_SINT8 + data8 @pcrel(.Lst_uint16) // FFI_TYPE_UINT16 + data8 @pcrel(.Lst_sint16) // FFI_TYPE_SINT16 + data8 @pcrel(.Lst_uint32) // FFI_TYPE_UINT32 + data8 @pcrel(.Lst_sint32) // FFI_TYPE_SINT32 + data8 @pcrel(.Lst_int64) // FFI_TYPE_UINT64 + data8 @pcrel(.Lst_int64) // FFI_TYPE_SINT64 + data8 @pcrel(.Lst_void) // FFI_TYPE_STRUCT + data8 @pcrel(.Lst_int64) // FFI_TYPE_POINTER + data8 @pcrel(.Lst_void) // FFI_TYPE_COMPLEX (not implemented) + data8 @pcrel(.Lst_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT + data8 @pcrel(.Lst_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT + data8 @pcrel(.Lst_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE + data8 @pcrel(.Lst_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE + +.Lld_table: + data8 @pcrel(.Lld_void) // FFI_TYPE_VOID + data8 @pcrel(.Lld_int) // FFI_TYPE_INT + data8 @pcrel(.Lld_float) // FFI_TYPE_FLOAT + data8 @pcrel(.Lld_double) // FFI_TYPE_DOUBLE + data8 @pcrel(.Lld_ldouble) // FFI_TYPE_LONGDOUBLE + data8 @pcrel(.Lld_int) // FFI_TYPE_UINT8 + data8 @pcrel(.Lld_int) // FFI_TYPE_SINT8 + data8 @pcrel(.Lld_int) // FFI_TYPE_UINT16 + data8 @pcrel(.Lld_int) // FFI_TYPE_SINT16 + data8 @pcrel(.Lld_int) // FFI_TYPE_UINT32 + data8 @pcrel(.Lld_int) // FFI_TYPE_SINT32 + data8 @pcrel(.Lld_int) // FFI_TYPE_UINT64 + data8 @pcrel(.Lld_int) // FFI_TYPE_SINT64 + data8 @pcrel(.Lld_void) // FFI_TYPE_STRUCT + data8 @pcrel(.Lld_int) // FFI_TYPE_POINTER + data8 @pcrel(.Lld_void) // FFI_TYPE_COMPLEX (not implemented) + data8 @pcrel(.Lld_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT + data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT + data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE + data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/java_raw_api.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/java_raw_api.c new file mode 100644 index 0000000..114d3e4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/java_raw_api.c @@ -0,0 +1,374 @@ +/* ----------------------------------------------------------------------- + java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc. + + Cloned from raw_api.c + + Raw_api.c author: Kresten Krab Thorup + Java_raw_api.c author: Hans-J. Boehm + + $Id $ + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* This defines a Java- and 64-bit specific variant of the raw API. */ +/* It assumes that "raw" argument blocks look like Java stacks on a */ +/* 64-bit machine. Arguments that can be stored in a single stack */ +/* stack slots (longs, doubles) occupy 128 bits, but only the first */ +/* 64 bits are actually used. */ + +#include +#include +#include + +#if !defined(NO_JAVA_RAW_API) + +size_t +ffi_java_raw_size (ffi_cif *cif) +{ + size_t result = 0; + int i; + + ffi_type **at = cif->arg_types; + + for (i = cif->nargs-1; i >= 0; i--, at++) + { + switch((*at) -> type) { + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_DOUBLE: + result += 2 * FFI_SIZEOF_JAVA_RAW; + break; + case FFI_TYPE_STRUCT: + /* No structure parameters in Java. */ + abort(); + case FFI_TYPE_COMPLEX: + /* Not supported yet. */ + abort(); + default: + result += FFI_SIZEOF_JAVA_RAW; + } + } + + return result; +} + + +void +ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + +#if WORDS_BIGENDIAN + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + *args = (void*) ((char*)(raw++) + 3); + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + *args = (void*) ((char*)(raw++) + 2); + break; + +#if FFI_SIZEOF_JAVA_RAW == 8 + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_DOUBLE: + *args = (void *)raw; + raw += 2; + break; +#endif + + case FFI_TYPE_POINTER: + *args = (void*) &(raw++)->ptr; + break; + + case FFI_TYPE_COMPLEX: + /* Not supported yet. */ + abort(); + + default: + *args = raw; + raw += + FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); + } + } + +#else /* WORDS_BIGENDIAN */ + +#if !PDP + + /* then assume little endian */ + for (i = 0; i < cif->nargs; i++, tp++, args++) + { +#if FFI_SIZEOF_JAVA_RAW == 8 + switch((*tp)->type) { + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_DOUBLE: + *args = (void*) raw; + raw += 2; + break; + case FFI_TYPE_COMPLEX: + /* Not supported yet. */ + abort(); + default: + *args = (void*) raw++; + } +#else /* FFI_SIZEOF_JAVA_RAW != 8 */ + *args = (void*) raw; + raw += + FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); +#endif /* FFI_SIZEOF_JAVA_RAW == 8 */ + } + +#else +#error "pdp endian not supported" +#endif /* ! PDP */ + +#endif /* WORDS_BIGENDIAN */ +} + +void +ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: +#if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT8*) (*args); +#else + (raw++)->uint = *(UINT8*) (*args); +#endif + break; + + case FFI_TYPE_SINT8: +#if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT8*) (*args); +#else + (raw++)->sint = *(SINT8*) (*args); +#endif + break; + + case FFI_TYPE_UINT16: +#if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT16*) (*args); +#else + (raw++)->uint = *(UINT16*) (*args); +#endif + break; + + case FFI_TYPE_SINT16: +#if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT16*) (*args); +#else + (raw++)->sint = *(SINT16*) (*args); +#endif + break; + + case FFI_TYPE_UINT32: +#if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT32*) (*args); +#else + (raw++)->uint = *(UINT32*) (*args); +#endif + break; + + case FFI_TYPE_SINT32: +#if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT32*) (*args); +#else + (raw++)->sint = *(SINT32*) (*args); +#endif + break; + + case FFI_TYPE_FLOAT: + (raw++)->flt = *(FLOAT32*) (*args); + break; + +#if FFI_SIZEOF_JAVA_RAW == 8 + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_DOUBLE: + raw->uint = *(UINT64*) (*args); + raw += 2; + break; +#endif + + case FFI_TYPE_POINTER: + (raw++)->ptr = **(void***) args; + break; + + default: +#if FFI_SIZEOF_JAVA_RAW == 8 + FFI_ASSERT(0); /* Should have covered all cases */ +#else + memcpy ((void*) raw->data, (void*)*args, (*tp)->size); + raw += + FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); +#endif + } + } +} + +#if !FFI_NATIVE_RAW_API + +static void +ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) +{ +#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 + switch (cif->rtype->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + *(UINT64 *)rvalue <<= 32; + break; + + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_INT: +#if FFI_SIZEOF_JAVA_RAW == 4 + case FFI_TYPE_POINTER: +#endif + *(SINT64 *)rvalue <<= 32; + break; + + case FFI_TYPE_COMPLEX: + /* Not supported yet. */ + abort(); + + default: + break; + } +#endif +} + +static void +ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) +{ +#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 + switch (cif->rtype->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + *(UINT64 *)rvalue >>= 32; + break; + + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_INT: + *(SINT64 *)rvalue >>= 32; + break; + + case FFI_TYPE_COMPLEX: + /* Not supported yet. */ + abort(); + + default: + break; + } +#endif +} + +/* This is a generic definition of ffi_raw_call, to be used if the + * native system does not provide a machine-specific implementation. + * Having this, allows code to be written for the raw API, without + * the need for system-specific code to handle input in that format; + * these following couple of functions will handle the translation forth + * and back automatically. */ + +void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, + ffi_java_raw *raw) +{ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + ffi_java_raw_to_ptrarray (cif, raw, avalue); + ffi_call (cif, fn, rvalue, avalue); + ffi_java_rvalue_to_raw (cif, rvalue); +} + +#if FFI_CLOSURES /* base system provides closures */ + +static void +ffi_java_translate_args (ffi_cif *cif, void *rvalue, + void **avalue, void *user_data) +{ + ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif)); + ffi_raw_closure *cl = (ffi_raw_closure*)user_data; + + ffi_java_ptrarray_to_raw (cif, avalue, raw); + (*cl->fun) (cif, rvalue, (ffi_raw*)raw, cl->user_data); + ffi_java_raw_to_rvalue (cif, rvalue); +} + +ffi_status +ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data, + void *codeloc) +{ + ffi_status status; + + status = ffi_prep_closure_loc ((ffi_closure*) cl, + cif, + &ffi_java_translate_args, + codeloc, + codeloc); + if (status == FFI_OK) + { + cl->fun = fun; + cl->user_data = user_data; + } + + return status; +} + +/* Again, here is the generic version of ffi_prep_raw_closure, which + * will install an intermediate "hub" for translation of arguments from + * the pointer-array format, to the raw format */ + +ffi_status +ffi_prep_java_raw_closure (ffi_java_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data) +{ + return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl); +} + +#endif /* FFI_CLOSURES */ +#endif /* !FFI_NATIVE_RAW_API */ +#endif /* !NO_JAVA_RAW_API */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/asm.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/asm.h new file mode 100644 index 0000000..4edba41 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/asm.h @@ -0,0 +1,5 @@ +/* args are passed on registers from r0 up to r11 => 12*8 bytes */ +#define REG_ARGS_SIZE (12*8) +#define KVX_REGISTER_SIZE (8) +#define KVX_ABI_SLOT_SIZE (KVX_REGISTER_SIZE) +#define KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE (4*KVX_ABI_SLOT_SIZE) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffi.c new file mode 100644 index 0000000..58f6aef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffi.c @@ -0,0 +1,273 @@ +/* Copyright (c) 2020 Kalray + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__kvx__) +#include +#include +#include +#include +#include +#include "ffi_common.h" +#include "asm.h" + +#define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1) +#define ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) +#define KVX_ABI_STACK_ALIGNMENT (32) +#define KVX_ABI_STACK_ARG_ALIGNMENT (8) +#define max(a,b) ((a) > (b) ? (a) : (b)) + +#ifdef FFI_DEBUG +#define DEBUG_PRINT(...) do{ fprintf( stderr, __VA_ARGS__ ); } while(0) +#else +#define DEBUG_PRINT(...) +#endif + +struct ret_value { + unsigned long int r0; + unsigned long int r1; + unsigned long int r2; + unsigned long int r3; +}; + +extern struct ret_value ffi_call_SYSV(unsigned total_size, + unsigned size, + extended_cif *ecif, + unsigned *rvalue_addr, + void *fn, + unsigned int_ext_method); + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + cif->flags = cif->rtype->size; + return FFI_OK; +} + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void *ffi_prep_args(char *stack, unsigned int arg_slots_size, extended_cif *ecif) +{ + char *stacktemp = stack; + char *current_arg_passed_by_value = stack + arg_slots_size; + int i, s; + ffi_type **arg; + int count = 0; + ffi_cif *cif = ecif->cif; + void **argv = ecif->avalue; + + arg = cif->arg_types; + + DEBUG_PRINT("stack: %p\n", stack); + DEBUG_PRINT("arg_slots_size: %u\n", arg_slots_size); + DEBUG_PRINT("current_arg_passed_by_value: %p\n", current_arg_passed_by_value); + DEBUG_PRINT("ecif: %p\n", ecif); + DEBUG_PRINT("ecif->avalue: %p\n", ecif->avalue); + + for (i = 0; i < cif->nargs; i++) { + + s = KVX_ABI_SLOT_SIZE; + switch((*arg)->type) { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + DEBUG_PRINT("INT64/32/16/8/FLOAT/DOUBLE or POINTER @%p\n", stack); + *(uint64_t *) stack = *(uint64_t *)(* argv); + break; + + case FFI_TYPE_COMPLEX: + if ((*arg)->size == 8) + *(_Complex float *) stack = *(_Complex float *)(* argv); + else if ((*arg)->size == 16) { + *(_Complex double *) stack = *(_Complex double *)(* argv); + s = 16; + } else + abort(); + break; + case FFI_TYPE_STRUCT: { + char *value; + unsigned int written_size = 0; + DEBUG_PRINT("struct by value @%p\n", stack); + if ((*arg)->size > KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { + DEBUG_PRINT("big struct\n"); + *(uint64_t *) stack = (uintptr_t)current_arg_passed_by_value; + value = current_arg_passed_by_value; + current_arg_passed_by_value += (*arg)->size; + written_size = KVX_ABI_SLOT_SIZE; + } else { + value = stack; + written_size = (*arg)->size; + } + memcpy(value, *argv, (*arg)->size); + s = ALIGN(written_size, KVX_ABI_STACK_ARG_ALIGNMENT); + break; + } + default: + printf("Error: unsupported arg type %d\n", (*arg)->type); + abort(); + break; + + } + stack += s; + count += s; + argv++; + arg++; + } +#ifdef FFI_DEBUG + FFI_ASSERT(((intptr_t)(stacktemp + REG_ARGS_SIZE) & (KVX_ABI_STACK_ALIGNMENT-1)) == 0); +#endif + return stacktemp + REG_ARGS_SIZE; +} + +/* Perform machine dependent cif processing when we have a variadic function */ + +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, + unsigned int ntotalargs) +{ + cif->flags = cif->rtype->size; + return FFI_OK; +} + +static unsigned long handle_small_int_ext(kvx_intext_method *int_ext_method, + const ffi_type *rtype) +{ + switch (rtype->type) { + case FFI_TYPE_SINT8: + *int_ext_method = KVX_RET_SXBD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_SINT16: + *int_ext_method = KVX_RET_SXHD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_SINT32: + *int_ext_method = KVX_RET_SXWD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT8: + *int_ext_method = KVX_RET_ZXBD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT16: + *int_ext_method = KVX_RET_ZXHD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT32: + *int_ext_method = KVX_RET_ZXWD; + return KVX_REGISTER_SIZE; + + default: + *int_ext_method = KVX_RET_NONE; + return rtype->size; + } +} + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + int i; + unsigned long int slot_fitting_args_size = 0; + unsigned long int total_size = 0; + unsigned long int big_struct_size = 0; + kvx_intext_method int_extension_method; + ffi_type **arg; + struct ret_value local_rvalue = {0}; + size_t wb_size; + + + /* Calculate size to allocate on stack */ + for (i = 0, arg = cif->arg_types; i < cif->nargs; i++, arg++) { + DEBUG_PRINT("argument %d, type %d, size %lu\n", i, (*arg)->type, (*arg)->size); + if (((*arg)->type == FFI_TYPE_STRUCT) || ((*arg)->type == FFI_TYPE_COMPLEX)) { + if ((*arg)->size <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { + slot_fitting_args_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); + } else { + slot_fitting_args_size += KVX_ABI_SLOT_SIZE; /* aggregate passed by reference */ + big_struct_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); + } + } else if ((*arg)->size <= KVX_ABI_SLOT_SIZE) { + slot_fitting_args_size += KVX_ABI_SLOT_SIZE; + } else { + printf("Error: unsupported arg size %ld arg type %d\n", (*arg)->size, (*arg)->type); + abort(); /* should never happen? */ + } + } + + extended_cif ecif; + ecif.cif = cif; + ecif.avalue = avalue; + ecif.rvalue = rvalue; + + /* This implementation allocates anyway for all register based args */ + slot_fitting_args_size = max(slot_fitting_args_size, REG_ARGS_SIZE); + total_size = slot_fitting_args_size + big_struct_size; + total_size = ALIGN(total_size, KVX_ABI_STACK_ALIGNMENT); + + /* wb_size: write back size, the size we will need to write back to user + * provided buffer. In theory it should always be cif->flags which is + * cif->rtype->size. But libffi API mandates that for integral types + * of size <= system register size, then we *MUST* write back + * the size of system register size. + * in our case, if size <= 8 bytes we must write back 8 bytes. + * floats, complex and structs are not affected, only integrals. + */ + wb_size = handle_small_int_ext(&int_extension_method, cif->rtype); + + switch (cif->abi) { + case FFI_SYSV: + DEBUG_PRINT("total_size: %lu\n", total_size); + DEBUG_PRINT("slot fitting args size: %lu\n", slot_fitting_args_size); + DEBUG_PRINT("rvalue: %p\n", rvalue); + DEBUG_PRINT("fn: %p\n", fn); + DEBUG_PRINT("rsize: %u\n", cif->flags); + DEBUG_PRINT("wb_size: %u\n", wb_size); + DEBUG_PRINT("int_extension_method: %u\n", int_extension_method); + local_rvalue = ffi_call_SYSV(total_size, slot_fitting_args_size, + &ecif, rvalue, fn, int_extension_method); + if ((cif->flags <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) + && (cif->rtype->type != FFI_TYPE_VOID)) + memcpy(rvalue, &local_rvalue, wb_size); + break; + default: + abort(); + break; + } +} + +/* Closures not supported yet */ +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + return FFI_BAD_ABI; +} + +#endif /* (__kvx__) */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffitarget.h new file mode 100644 index 0000000..8df8735 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/ffitarget.h @@ -0,0 +1,75 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2020 Kalray + + KVX Target configuration macros + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; + +/* Those values are set depending on return type + * they are used in the assembly code in sysv.S + */ +typedef enum kvx_intext_method { + KVX_RET_NONE = 0, + KVX_RET_SXBD = 1, + KVX_RET_SXHD = 2, + KVX_RET_SXWD = 3, + KVX_RET_ZXBD = 4, + KVX_RET_ZXHD = 5, + KVX_RET_ZXWD = 6 +} kvx_intext_method; + +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +/* This is only to allow Python to compile + * but closures are not supported yet + */ +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 0 + +#define FFI_NATIVE_RAW_API 0 +#define FFI_TARGET_SPECIFIC_VARIADIC 1 +#define FFI_TARGET_HAS_COMPLEX_TYPE + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/sysv.S new file mode 100644 index 0000000..952afc7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/kvx/sysv.S @@ -0,0 +1,127 @@ +/* Copyright (c) 2020 Kalray + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__kvx__) +#define LIBFFI_ASM +#include +#include +#include +#include + +.text +.global ffi_call_SYSV +.type ffi_call_SYSV, @function +.type ffi_prep_args, @function +.align 8 + +/* ffi_call_SYSV + + r0: total size to allocate on stack + r1: size of arg slots + r2: extended cif structure, DO NOT REMOVE: it is used by ffi_prep_args() + r3: return value address + r4: function to call + r5: integer sign extension method to be used +*/ +ffi_call_SYSV: + addd $r12 = $r12, -64 + so (-32)[$r12] = $r20r21r22r23 + ;; + sd (0)[$r12] = $r24 + ;; + get $r23 = $ra + copyd $r20 = $r12 + sbfd $r12 = $r0, $r12 + ;; + copyd $r0 = $r12 + copyd $r21 = $r3 + copyd $r22 = $r4 + copyd $r24 = $r5 + call ffi_prep_args + ;; + lo $r8r9r10r11 = (64)[$r12] + ;; + lo $r4r5r6r7 = (32)[$r12] + ;; + lo $r0r1r2r3 = (0)[$r12] + copyd $r12 = $r0 + /* $r15 is the register used by the ABI to return big (>32 bytes) + * structs by value. + * It is also referred to as the "struct register" in the ABI. + */ + copyd $r15 = $r21 + icall $r22 + ;; + pcrel $r4 = @pcrel(.Ltable) + cb.deqz $r24 ? .Lend + ;; + addx8d $r24 = $r24, $r4 + ;; + igoto $r24 + ;; +.Ltable: +0: /* we should never arrive here */ + goto .Lerror + nop + ;; +1: /* Sign extend byte to double */ + sxbd $r0 = $r0 + goto .Lend + ;; +2: /* Sign extend half to double */ + sxhd $r0 = $r0 + goto .Lend + ;; +3: /* Sign extend word to double */ + sxwd $r0 = $r0 + goto .Lend + ;; +4: /* Zero extend byte to double */ + zxbd $r0 = $r0 + goto .Lend + ;; +5: /* Zero extend half to double */ + zxhd $r0 = $r0 + goto .Lend + ;; +6: /* Zero extend word to double */ + zxwd $r0 = $r0 + /* Fallthrough to .Lend */ + ;; +.Lend: + ld $r24 = (0)[$r12] + ;; + set $ra = $r23 + lo $r20r21r22r23 = (32)[$r20] + addd $r12 = $r20, 64 + ;; + ret + ;; +.Lerror: + errop + ;; + +#endif /* __kvx__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffi.c new file mode 100644 index 0000000..ab8fc4e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffi.c @@ -0,0 +1,232 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2004 Renesas Technology + Copyright (c) 2008 Red Hat, Inc. + + M32R Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +/* ffi_prep_args is called by the assembly routine once stack + space has been allocated for the function's arguments. */ + +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + unsigned int i; + int tmp; + unsigned int avn; + void **p_argv; + char *argp; + ffi_type **p_arg; + + tmp = 0; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8) + { + *(void **) argp = ecif->rvalue; + argp += 4; + } + + avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0) && (avn != 0); + i--, p_arg++) + { + size_t z; + + /* Align if necessary. */ + if (((*p_arg)->alignment - 1) & (unsigned) argp) + argp = (char *) FFI_ALIGN (argp, (*p_arg)->alignment); + + if (avn != 0) + { + avn--; + z = (*p_arg)->size; + if (z < sizeof (int)) + { + z = sizeof (int); + + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + z = (*p_arg)->size; + if ((*p_arg)->alignment != 1) + memcpy (argp, *p_argv, z); + else + memcpy (argp + 4 - z, *p_argv, z); + z = sizeof (int); + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof (int)) + { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } + else + { + if ((*p_arg)->type == FFI_TYPE_STRUCT) + { + if (z > 8) + { + *(unsigned int *) argp = (unsigned int)(void *)(* p_argv); + z = sizeof(void *); + } + else + { + memcpy(argp, *p_argv, z); + z = 8; + } + } + else + { + /* Double or long long 64bit. */ + memcpy (argp, *p_argv, z); + } + } + p_argv++; + argp += z; + } + } + + return; +} + +/* Perform machine dependent cif processing. */ +ffi_status +ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Set the return type flag. */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->size <= 4) + cif->flags = FFI_TYPE_INT; + + else if (cif->rtype->size <= 8) + cif->flags = FFI_TYPE_DOUBLE; + + else + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + cif->flags = FFI_TYPE_DOUBLE; + break; + + case FFI_TYPE_FLOAT: + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have + a return value address then we need to make one. */ + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca (cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + if (cif->rtype->type == FFI_TYPE_STRUCT) + { + int size = cif->rtype->size; + int align = cif->rtype->alignment; + + if (size < 4) + { + if (align == 1) + *(unsigned long *)(ecif.rvalue) <<= (4 - size) * 8; + } + else if (4 < size && size < 8) + { + if (align == 1) + { + memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); + } + else if (align == 2) + { + if (size & 1) + size += 1; + + if (size != 8) + memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); + } + } + } + break; + + default: + FFI_ASSERT(0); + break; + } +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffitarget.h new file mode 100644 index 0000000..6c34801 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/ffitarget.h @@ -0,0 +1,53 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2004 Renesas Technology. + Target configuration macros for M32R. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi + { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV + } ffi_abi; +#endif + +#define FFI_CLOSURES 0 +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/sysv.S new file mode 100644 index 0000000..06b75c2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m32r/sysv.S @@ -0,0 +1,121 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2004 Renesas Technology + + M32R Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#ifdef HAVE_MACHINE_ASM_H +#include +#else +/* XXX these lose for some platforms, I'm sure. */ +#define CNAME(x) x +#define ENTRY(x) .globl CNAME(x)! .type CNAME(x),%function! CNAME(x): +#endif + +.text + + /* R0: ffi_prep_args */ + /* R1: &ecif */ + /* R2: cif->bytes */ + /* R3: fig->flags */ + /* sp+0: ecif.rvalue */ + /* sp+4: fn */ + + /* This assumes we are using gas. */ +ENTRY(ffi_call_SYSV) + /* Save registers. */ + push fp + push lr + push r3 + push r2 + push r1 + push r0 + mv fp, sp + + /* Make room for all of the new args. */ + sub sp, r2 + + /* Place all of the ffi_prep_args in position. */ + mv lr, r0 + mv r0, sp + /* R1 already set. */ + + /* And call. */ + jl lr + + /* Move first 4 parameters in registers... */ + ld r0, @(0,sp) + ld r1, @(4,sp) + ld r2, @(8,sp) + ld r3, @(12,sp) + + /* ...and adjust the stack. */ + ld lr, @(8,fp) + cmpi lr, #16 + bc adjust_stack + ldi lr, #16 +adjust_stack: + add sp, lr + + /* Call the function. */ + ld lr, @(28,fp) + jl lr + + /* Remove the space we pushed for the args. */ + mv sp, fp + + /* Load R2 with the pointer to storage for the return value. */ + ld r2, @(24,sp) + + /* Load R3 with the return type code. */ + ld r3, @(12,sp) + + /* If the return value pointer is NULL, assume no return value. */ + beqz r2, epilogue + + /* Return INT. */ + ldi r4, #FFI_TYPE_INT + bne r3, r4, return_double + st r0, @r2 + bra epilogue + +return_double: + /* Return DOUBLE or LONGDOUBLE. */ + ldi r4, #FFI_TYPE_DOUBLE + bne r3, r4, epilogue + st r0, @r2 + st r1, @(4,r2) + +epilogue: + pop r0 + pop r1 + pop r2 + pop r3 + pop lr + pop fp + jmp lr + +.ffi_call_SYSV_end: + .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffi.c new file mode 100644 index 0000000..0330184 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffi.c @@ -0,0 +1,362 @@ +/* ----------------------------------------------------------------------- + ffi.c + + m68k Foreign Function Interface + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include +#ifdef __rtems__ +void rtems_cache_flush_multiple_data_lines( const void *, size_t ); +#else +#include +#ifdef __MINT__ +#include +#include +#else +#include +#endif +#endif + +void ffi_call_SYSV (extended_cif *, + unsigned, unsigned, + void *, void (*fn) ()); +void *ffi_prep_args (void *stack, extended_cif *ecif); +void ffi_closure_SYSV (ffi_closure *); +void ffi_closure_struct_SYSV (ffi_closure *); +unsigned int ffi_closure_SYSV_inner (ffi_closure *closure, + void *resp, void *args); + +/* ffi_prep_args is called by the assembly routine once stack space has + been allocated for the function's arguments. */ + +void * +ffi_prep_args (void *stack, extended_cif *ecif) +{ + unsigned int i; + void **p_argv; + char *argp; + ffi_type **p_arg; + void *struct_value_ptr; + + argp = stack; + + if ( +#ifdef __MINT__ + (ecif->cif->rtype->type == FFI_TYPE_LONGDOUBLE) || +#endif + (((ecif->cif->rtype->type == FFI_TYPE_STRUCT) + && !ecif->cif->flags))) + struct_value_ptr = ecif->rvalue; + else + struct_value_ptr = NULL; + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + i != 0; + i--, p_arg++) + { + size_t z = (*p_arg)->size; + int type = (*p_arg)->type; + + if (z < sizeof (int)) + { + switch (type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; + break; + + case FFI_TYPE_STRUCT: +#ifdef __MINT__ + if (z == 1 || z == 2) + memcpy (argp + 2, *p_argv, z); + else + memcpy (argp, *p_argv, z); +#else + memcpy (argp + sizeof (int) - z, *p_argv, z); +#endif + break; + + default: + FFI_ASSERT (0); + } + z = sizeof (int); + } + else + { + memcpy (argp, *p_argv, z); + + /* Align if necessary. */ + if ((sizeof(int) - 1) & z) + z = FFI_ALIGN(z, sizeof(int)); + } + + p_argv++; + argp += z; + } + + return struct_value_ptr; +} + +#define CIF_FLAGS_INT 1 +#define CIF_FLAGS_DINT 2 +#define CIF_FLAGS_FLOAT 4 +#define CIF_FLAGS_DOUBLE 8 +#define CIF_FLAGS_LDOUBLE 16 +#define CIF_FLAGS_POINTER 32 +#define CIF_FLAGS_STRUCT1 64 +#define CIF_FLAGS_STRUCT2 128 +#define CIF_FLAGS_SINT8 256 +#define CIF_FLAGS_SINT16 512 + +/* Perform machine dependent cif processing */ +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + cif->flags = 0; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT && + cif->rtype->elements[1]) + { + cif->flags = 0; + break; + } + + switch (cif->rtype->size) + { + case 1: +#ifdef __MINT__ + cif->flags = CIF_FLAGS_STRUCT2; +#else + cif->flags = CIF_FLAGS_STRUCT1; +#endif + break; + case 2: + cif->flags = CIF_FLAGS_STRUCT2; + break; +#ifdef __MINT__ + case 3: +#endif + case 4: + cif->flags = CIF_FLAGS_INT; + break; +#ifdef __MINT__ + case 7: +#endif + case 8: + cif->flags = CIF_FLAGS_DINT; + break; + default: + cif->flags = 0; + break; + } + break; + + case FFI_TYPE_FLOAT: + cif->flags = CIF_FLAGS_FLOAT; + break; + + case FFI_TYPE_DOUBLE: + cif->flags = CIF_FLAGS_DOUBLE; + break; + +#if (FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE) + case FFI_TYPE_LONGDOUBLE: +#ifdef __MINT__ + cif->flags = 0; +#else + cif->flags = CIF_FLAGS_LDOUBLE; +#endif + break; +#endif + + case FFI_TYPE_POINTER: + cif->flags = CIF_FLAGS_POINTER; + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = CIF_FLAGS_DINT; + break; + + case FFI_TYPE_SINT16: + cif->flags = CIF_FLAGS_SINT16; + break; + + case FFI_TYPE_SINT8: + cif->flags = CIF_FLAGS_SINT8; + break; + + default: + cif->flags = CIF_FLAGS_INT; + break; + } + + return FFI_OK; +} + +void +ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return value + address then we need to make one. */ + + if (rvalue == NULL + && cif->rtype->type == FFI_TYPE_STRUCT + && cif->rtype->size > 8) + ecif.rvalue = alloca (cif->rtype->size); + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV (&ecif, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; + + default: + FFI_ASSERT (0); + break; + } +} + +static void +ffi_prep_incoming_args_SYSV (char *stack, void **avalue, ffi_cif *cif) +{ + unsigned int i; + void **p_argv; + char *argp; + ffi_type **p_arg; + + argp = stack; + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + + z = (*p_arg)->size; +#ifdef __MINT__ + if (cif->flags && + cif->rtype->type == FFI_TYPE_STRUCT && + (z == 1 || z == 2)) + { + *p_argv = (void *) (argp + 2); + + z = 4; + } + else + if (cif->flags && + cif->rtype->type == FFI_TYPE_STRUCT && + (z == 3 || z == 4)) + { + *p_argv = (void *) (argp); + + z = 4; + } + else +#endif + if (z <= 4) + { + *p_argv = (void *) (argp + 4 - z); + + z = 4; + } + else + { + *p_argv = (void *) argp; + + /* Align if necessary */ + if ((sizeof(int) - 1) & z) + z = FFI_ALIGN(z, sizeof(int)); + } + + p_argv++; + argp += z; + } +} + +unsigned int +ffi_closure_SYSV_inner (ffi_closure *closure, void *resp, void *args) +{ + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void *)); + + ffi_prep_incoming_args_SYSV(args, arg_area, cif); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + return cif->flags; +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + *(unsigned short *)closure->tramp = 0x207c; + *(void **)(closure->tramp + 2) = codeloc; + *(unsigned short *)(closure->tramp + 6) = 0x4ef9; + + if ( +#ifdef __MINT__ + (cif->rtype->type == FFI_TYPE_LONGDOUBLE) || +#endif + (((cif->rtype->type == FFI_TYPE_STRUCT) + && !cif->flags))) + *(void **)(closure->tramp + 8) = ffi_closure_struct_SYSV; + else + *(void **)(closure->tramp + 8) = ffi_closure_SYSV; + +#ifdef __rtems__ + rtems_cache_flush_multiple_data_lines( codeloc, FFI_TRAMPOLINE_SIZE ); +#elif defined(__MINT__) + Ssystem(S_FLUSHCACHE, codeloc, FFI_TRAMPOLINE_SIZE); +#else + syscall(SYS_cacheflush, codeloc, FLUSH_SCOPE_LINE, + FLUSH_CACHE_BOTH, FFI_TRAMPOLINE_SIZE); +#endif + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffitarget.h new file mode 100644 index 0000000..e81dde2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/ffitarget.h @@ -0,0 +1,54 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for Motorola 68K. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 16 +#define FFI_NATIVE_RAW_API 0 + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/sysv.S new file mode 100644 index 0000000..ea40f11 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m68k/sysv.S @@ -0,0 +1,357 @@ +/* ----------------------------------------------------------------------- + + sysv.S - Copyright (c) 2012 Alan Hourihane + Copyright (c) 1998, 2012 Andreas Schwab + Copyright (c) 2008 Red Hat, Inc. + Copyright (c) 2012, 2016 Thorsten Glaser + + m68k Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +#ifdef HAVE_AS_CFI_PSEUDO_OP +#define CFI_STARTPROC() .cfi_startproc +#define CFI_OFFSET(reg,off) .cfi_offset reg,off +#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off +#define CFI_ENDPROC() .cfi_endproc +#else +#define CFI_STARTPROC() +#define CFI_OFFSET(reg,off) +#define CFI_DEF_CFA(reg,off) +#define CFI_ENDPROC() +#endif + +#ifdef __MINT__ +#define CALLFUNC(funcname) _ ## funcname +#else +#define CALLFUNC(funcname) funcname +#endif + + .text + + .globl CALLFUNC(ffi_call_SYSV) + .type CALLFUNC(ffi_call_SYSV),@function + .align 4 + +CALLFUNC(ffi_call_SYSV): + CFI_STARTPROC() + link %fp,#0 + CFI_OFFSET(14,-8) + CFI_DEF_CFA(14,8) + move.l %d2,-(%sp) + CFI_OFFSET(2,-12) + + | Make room for all of the new args. + sub.l 12(%fp),%sp + + | Call ffi_prep_args + move.l 8(%fp),-(%sp) + pea 4(%sp) +#if !defined __PIC__ + jsr CALLFUNC(ffi_prep_args) +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) + move.l _current_shared_library_a5_offset_(%a5),%a0 + move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0 + jsr (%a0) +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 + lea (-6,%pc,%a0),%a0 + move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0 + jsr (%a0) +#else + bsr.l CALLFUNC(ffi_prep_args@PLTPC) +#endif + addq.l #8,%sp + + | Pass pointer to struct value, if any +#ifdef __MINT__ + move.l %d0,%a1 +#else + move.l %a0,%a1 +#endif + + | Call the function + move.l 24(%fp),%a0 + jsr (%a0) + + | Remove the space we pushed for the args + add.l 12(%fp),%sp + + | Load the pointer to storage for the return value + move.l 20(%fp),%a1 + + | Load the return type code + move.l 16(%fp),%d2 + + | If the return value pointer is NULL, assume no return value. + | NOTE: On the mc68000, tst on an address register is not supported. +#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) + cmp.w #0, %a1 +#else + tst.l %a1 +#endif + jbeq noretval + + btst #0,%d2 + jbeq retlongint + move.l %d0,(%a1) + jbra epilogue + +retlongint: + btst #1,%d2 + jbeq retfloat + move.l %d0,(%a1) + move.l %d1,4(%a1) + jbra epilogue + +retfloat: + btst #2,%d2 + jbeq retdouble +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.s %fp0,(%a1) +#else + move.l %d0,(%a1) +#endif + jbra epilogue + +retdouble: + btst #3,%d2 + jbeq retlongdouble +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.d %fp0,(%a1) +#else + move.l %d0,(%a1)+ + move.l %d1,(%a1) +#endif + jbra epilogue + +retlongdouble: + btst #4,%d2 + jbeq retpointer +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.x %fp0,(%a1) +#else + move.l %d0,(%a1)+ + move.l %d1,(%a1)+ + move.l %d2,(%a1) +#endif + jbra epilogue + +retpointer: + btst #5,%d2 + jbeq retstruct1 +#ifdef __MINT__ + move.l %d0,(%a1) +#else + move.l %a0,(%a1) +#endif + jbra epilogue + +retstruct1: + btst #6,%d2 + jbeq retstruct2 + move.b %d0,(%a1) + jbra epilogue + +retstruct2: + btst #7,%d2 + jbeq retsint8 + move.w %d0,(%a1) + jbra epilogue + +retsint8: + btst #8,%d2 + jbeq retsint16 + | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32. +#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) + ext.w %d0 + ext.l %d0 +#else + extb.l %d0 +#endif + move.l %d0,(%a1) + jbra epilogue + +retsint16: + btst #9,%d2 + jbeq noretval + ext.l %d0 + move.l %d0,(%a1) + +noretval: +epilogue: + move.l (%sp)+,%d2 + unlk %fp + rts + CFI_ENDPROC() + .size CALLFUNC(ffi_call_SYSV),.-CALLFUNC(ffi_call_SYSV) + + .globl CALLFUNC(ffi_closure_SYSV) + .type CALLFUNC(ffi_closure_SYSV), @function + .align 4 + +CALLFUNC(ffi_closure_SYSV): + CFI_STARTPROC() + link %fp,#-12 + CFI_OFFSET(14,-8) + CFI_DEF_CFA(14,8) + move.l %sp,-12(%fp) + pea 8(%fp) + pea -12(%fp) + move.l %a0,-(%sp) +#if !defined __PIC__ + jsr CALLFUNC(ffi_closure_SYSV_inner) +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) + move.l _current_shared_library_a5_offset_(%a5),%a0 + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 + jsr (%a0) +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 + lea (-6,%pc,%a0),%a0 + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 + jsr (%a0) +#else + bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC) +#endif + + lsr.l #1,%d0 + jne 1f + jcc .Lcls_epilogue + | CIF_FLAGS_INT + move.l -12(%fp),%d0 +.Lcls_epilogue: + | no CIF_FLAGS_* + unlk %fp + rts +1: + lea -12(%fp),%a0 + lsr.l #2,%d0 + jne 1f + jcs .Lcls_ret_float + | CIF_FLAGS_DINT + move.l (%a0)+,%d0 + move.l (%a0),%d1 + jra .Lcls_epilogue +.Lcls_ret_float: +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.s (%a0),%fp0 +#else + move.l (%a0),%d0 +#endif + jra .Lcls_epilogue +1: + lsr.l #2,%d0 + jne 1f + jcs .Lcls_ret_ldouble + | CIF_FLAGS_DOUBLE +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.d (%a0),%fp0 +#else + move.l (%a0)+,%d0 + move.l (%a0),%d1 +#endif + jra .Lcls_epilogue +.Lcls_ret_ldouble: +#if defined(__MC68881__) || defined(__HAVE_68881__) + fmove.x (%a0),%fp0 +#else + move.l (%a0)+,%d0 + move.l (%a0)+,%d1 + move.l (%a0),%d2 +#endif + jra .Lcls_epilogue +1: + lsr.l #2,%d0 + jne 1f + jcs .Lcls_ret_struct1 + | CIF_FLAGS_POINTER + move.l (%a0),%a0 + move.l %a0,%d0 + jra .Lcls_epilogue +.Lcls_ret_struct1: + move.b (%a0),%d0 + jra .Lcls_epilogue +1: + lsr.l #2,%d0 + jne 1f + jcs .Lcls_ret_sint8 + | CIF_FLAGS_STRUCT2 + move.w (%a0),%d0 + jra .Lcls_epilogue +.Lcls_ret_sint8: + move.l (%a0),%d0 + | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32. +#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) + ext.w %d0 + ext.l %d0 +#else + extb.l %d0 +#endif + jra .Lcls_epilogue +1: + | CIF_FLAGS_SINT16 + move.l (%a0),%d0 + ext.l %d0 + jra .Lcls_epilogue + CFI_ENDPROC() + + .size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV) + + .globl CALLFUNC(ffi_closure_struct_SYSV) + .type CALLFUNC(ffi_closure_struct_SYSV), @function + .align 4 + +CALLFUNC(ffi_closure_struct_SYSV): + CFI_STARTPROC() + link %fp,#0 + CFI_OFFSET(14,-8) + CFI_DEF_CFA(14,8) + move.l %sp,-12(%fp) + pea 8(%fp) + move.l %a1,-(%sp) + move.l %a0,-(%sp) +#if !defined __PIC__ + jsr CALLFUNC(ffi_closure_SYSV_inner) +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) + move.l _current_shared_library_a5_offset_(%a5),%a0 + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 + jsr (%a0) +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 + lea (-6,%pc,%a0),%a0 + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 + jsr (%a0) +#else + bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC) +#endif + unlk %fp + rts + CFI_ENDPROC() + .size CALLFUNC(ffi_closure_struct_SYSV),.-CALLFUNC(ffi_closure_struct_SYSV) + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffi.c new file mode 100644 index 0000000..57b344f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffi.c @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * m88k Foreign Function Interface + * + * This file attempts to provide all the FFI entry points which can reliably + * be implemented in C. + * + * Only OpenBSD/m88k is currently supported; other platforms (such as + * Motorola's SysV/m88k) could be supported with the following tweaks: + * + * - non-OpenBSD systems use an `outgoing parameter area' as part of the + * 88BCS calling convention, which is not supported under OpenBSD from + * release 3.6 onwards. Supporting it should be as easy as taking it + * into account when adjusting the stack, in the assembly code. + * + * - the logic deciding whether a function argument gets passed through + * registers, or on the stack, has changed several times in OpenBSD in + * edge cases (especially for structs larger than 32 bytes being passed + * by value). The code below attemps to match the logic used by the + * system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend + * fixes. + */ + +#include +#include + +#include +#include + +void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *, + void (*fn) ()); +void *ffi_prep_args (void *, extended_cif *); +void ffi_closure_OBSD (ffi_closure *); +void ffi_closure_struct_OBSD (ffi_closure *); +unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *, + char *); +void ffi_cacheflush_OBSD (unsigned int, unsigned int); + +#define CIF_FLAGS_INT (1 << 0) +#define CIF_FLAGS_DINT (1 << 1) + +/* + * Foreign Function Interface API + */ + +/* ffi_prep_args is called by the assembly routine once stack space has + been allocated for the function's arguments. */ + +void * +ffi_prep_args (void *stack, extended_cif *ecif) +{ + unsigned int i; + void **p_argv; + char *argp, *stackp; + unsigned int *regp; + unsigned int regused; + ffi_type **p_arg; + void *struct_value_ptr; + + regp = (unsigned int *)stack; + stackp = (char *)(regp + 8); + regused = 0; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT + && !ecif->cif->flags) + struct_value_ptr = ecif->rvalue; + else + struct_value_ptr = NULL; + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++) + { + size_t z; + unsigned short t, a; + + z = (*p_arg)->size; + t = (*p_arg)->type; + a = (*p_arg)->alignment; + + /* + * Figure out whether the argument can be passed through registers + * or on the stack. + * The rule is that registers can only receive simple types not larger + * than 64 bits, or structs the exact size of a register and aligned to + * the size of a register. + */ + if (t == FFI_TYPE_STRUCT) + { + if (z == sizeof (int) && a == sizeof (int) && regused < 8) + argp = (char *)regp; + else + argp = stackp; + } + else + { + if (z > sizeof (int) && regused < 8 - 1) + { + /* align to an even register pair */ + if (regused & 1) + { + regp++; + regused++; + } + } + if (regused < 8) + argp = (char *)regp; + else + argp = stackp; + } + + /* Enforce proper stack alignment of 64-bit types */ + if (argp == stackp && a > sizeof (int)) + { + stackp = (char *) FFI_ALIGN(stackp, a); + argp = stackp; + } + + switch (t) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_FLOAT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + *(unsigned int *) argp = *(unsigned int *) *p_argv; + break; + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_STRUCT: + memcpy (argp, *p_argv, z); + break; + + default: + FFI_ASSERT (0); + } + + /* Align if necessary. */ + if ((sizeof (int) - 1) & z) + z = FFI_ALIGN(z, sizeof (int)); + + p_argv++; + + /* Be careful, once all registers are filled, and about to continue + on stack, regp == stackp. Therefore the check for regused as well. */ + if (argp == (char *)regp && regused < 8) + { + regp += z / sizeof (int); + regused += z / sizeof (int); + } + else + stackp += z; + } + + return struct_value_ptr; +} + +/* Perform machine dependent cif processing */ +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + cif->flags = 0; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->size == sizeof (int) && + cif->rtype->alignment == sizeof (int)) + cif->flags = CIF_FLAGS_INT; + else + cif->flags = 0; + break; + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = CIF_FLAGS_DINT; + break; + + default: + cif->flags = CIF_FLAGS_INT; + break; + } + + return FFI_OK; +} + +void +ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return value + address then we need to make one. */ + + if (rvalue == NULL + && cif->rtype->type == FFI_TYPE_STRUCT + && (cif->rtype->size != sizeof (int) + || cif->rtype->alignment != sizeof (int))) + ecif.rvalue = alloca (cif->rtype->size); + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_OBSD: + ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT (0); + break; + } +} + +/* + * Closure API + */ + +static void +ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp, + char *stackp) +{ + unsigned int i; + void **p_argv; + char *argp; + unsigned int regused; + ffi_type **p_arg; + + regused = 0; + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) + { + size_t z; + unsigned short t, a; + + z = (*p_arg)->size; + t = (*p_arg)->type; + a = (*p_arg)->alignment; + + /* + * Figure out whether the argument has been passed through registers + * or on the stack. + * The rule is that registers can only receive simple types not larger + * than 64 bits, or structs the exact size of a register and aligned to + * the size of a register. + */ + if (t == FFI_TYPE_STRUCT) + { + if (z == sizeof (int) && a == sizeof (int) && regused < 8) + argp = (char *)regp; + else + argp = stackp; + } + else + { + if (z > sizeof (int) && regused < 8 - 1) + { + /* align to an even register pair */ + if (regused & 1) + { + regp++; + regused++; + } + } + if (regused < 8) + argp = (char *)regp; + else + argp = stackp; + } + + /* Enforce proper stack alignment of 64-bit types */ + if (argp == stackp && a > sizeof (int)) + { + stackp = (char *) FFI_ALIGN(stackp, a); + argp = stackp; + } + + if (z < sizeof (int) && t != FFI_TYPE_STRUCT) + *p_argv = (void *) (argp + sizeof (int) - z); + else + *p_argv = (void *) argp; + + /* Align if necessary */ + if ((sizeof (int) - 1) & z) + z = FFI_ALIGN(z, sizeof (int)); + + p_argv++; + + /* Be careful, once all registers are exhausted, and about to fetch from + stack, regp == stackp. Therefore the check for regused as well. */ + if (argp == (char *)regp && regused < 8) + { + regp += z / sizeof (int); + regused += z / sizeof (int); + } + else + stackp += z; + } +} + +unsigned int +ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp, + char *stackp) +{ + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void *)); + + ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + return cif->flags; +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, void *codeloc) +{ + unsigned int *tramp = (unsigned int *) codeloc; + void *fn; + + FFI_ASSERT (cif->abi == FFI_OBSD); + + if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags) + fn = &ffi_closure_struct_OBSD; + else + fn = &ffi_closure_OBSD; + + /* or.u %r10, %r0, %hi16(fn) */ + tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16); + /* or.u %r13, %r0, %hi16(closure) */ + tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16); + /* or %r10, %r10, %lo16(fn) */ + tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff); + /* jmp.n %r10 */ + tramp[3] = 0xf400c40a; + /* or %r13, %r13, %lo16(closure) */ + tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff); + + ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffitarget.h new file mode 100644 index 0000000..e52bf9f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/ffitarget.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * m88k Foreign Function Interface + */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_OBSD, + FFI_DEFAULT_ABI = FFI_OBSD, + FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 0x14 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/obsd.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/obsd.S new file mode 100644 index 0000000..1944a23 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/m88k/obsd.S @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * m88k Foreign Function Interface + */ + +#define LIBFFI_ASM +#include +#include + + .text + +/* + * ffi_cacheflush_OBSD(unsigned int addr, %r2 + * unsigned int size); %r3 + */ + .align 4 + .globl ffi_cacheflush_OBSD + .type ffi_cacheflush_OBSD,@function +ffi_cacheflush_OBSD: + tb0 0, %r0, 451 + or %r0, %r0, %r0 + jmp %r1 + .size ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD + +/* + * ffi_call_OBSD(unsigned bytes, %r2 + * extended_cif *ecif, %r3 + * unsigned flags, %r4 + * void *rvalue, %r5 + * void (*fn)()); %r6 + */ + .align 4 + .globl ffi_call_OBSD + .type ffi_call_OBSD,@function +ffi_call_OBSD: + subu %r31, %r31, 32 + st %r30, %r31, 4 + st %r1, %r31, 0 + addu %r30, %r31, 32 + + | Save the few arguments we'll need after ffi_prep_args() + st.d %r4, %r31, 8 + st %r6, %r31, 16 + + | Allocate room for the image of r2-r9, and the stack space for + | the args (rounded to a 16-byte boundary) + addu %r2, %r2, (8 * 4) + 15 + clr %r2, %r2, 4<0> + subu %r31, %r31, %r2 + + | Fill register and stack image + or %r2, %r31, %r0 +#ifdef PIC + bsr ffi_prep_args#plt +#else + bsr ffi_prep_args +#endif + + | Save pointer to return struct address, if any + or %r12, %r2, %r0 + + | Get function pointer + subu %r4, %r30, 32 + ld %r1, %r4, 16 + + | Fetch the register arguments + ld.d %r2, %r31, (0 * 4) + ld.d %r4, %r31, (2 * 4) + ld.d %r6, %r31, (4 * 4) + ld.d %r8, %r31, (6 * 4) + addu %r31, %r31, (8 * 4) + + | Invoke the function + jsr %r1 + + | Restore stack now that we don't need the args anymore + subu %r31, %r30, 32 + + | Figure out what to return as the function's return value + ld %r5, %r31, 12 | rvalue + ld %r4, %r31, 8 | flags + + bcnd eq0, %r5, 9f + + bb0 0, %r4, 1f | CIF_FLAGS_INT + st %r2, %r5, 0 + br 9f + +1: + bb0 1, %r4, 1f | CIF_FLAGS_DINT + st.d %r2, %r5, 0 + br 9f + +1: +9: + ld %r1, %r31, 0 + ld %r30, %r31, 4 + jmp.n %r1 + addu %r31, %r31, 32 + .size ffi_call_OBSD, . - ffi_call_OBSD + +/* + * ffi_closure_OBSD(ffi_closure *closure); %r13 + */ + .align 4 + .globl ffi_closure_OBSD + .type ffi_closure_OBSD, @function +ffi_closure_OBSD: + subu %r31, %r31, 16 + st %r30, %r31, 4 + st %r1, %r31, 0 + addu %r30, %r31, 16 + + | Make room on the stack for saved register arguments and return + | value + subu %r31, %r31, (8 * 4) + (2 * 4) + st.d %r2, %r31, (0 * 4) + st.d %r4, %r31, (2 * 4) + st.d %r6, %r31, (4 * 4) + st.d %r8, %r31, (6 * 4) + + | Invoke the closure function + or %r5, %r30, 0 | calling stack + addu %r4, %r31, 0 | saved registers + addu %r3, %r31, (8 * 4) | return value + or %r2, %r13, %r0 | closure +#ifdef PIC + bsr ffi_closure_OBSD_inner#plt +#else + bsr ffi_closure_OBSD_inner +#endif + + | Figure out what to return as the function's return value + bb0 0, %r2, 1f | CIF_FLAGS_INT + ld %r2, %r31, (8 * 4) + br 9f + +1: + bb0 1, %r2, 1f | CIF_FLAGS_DINT + ld.d %r2, %r31, (8 * 4) + br 9f + +1: +9: + subu %r31, %r30, 16 + ld %r1, %r31, 0 + ld %r30, %r31, 4 + jmp.n %r1 + addu %r31, %r31, 16 + .size ffi_closure_OBSD,.-ffi_closure_OBSD + +/* + * ffi_closure_struct_OBSD(ffi_closure *closure); %r13 + */ + .align 4 + .globl ffi_closure_struct_OBSD + .type ffi_closure_struct_OBSD, @function +ffi_closure_struct_OBSD: + subu %r31, %r31, 16 + st %r30, %r31, 4 + st %r1, %r31, 0 + addu %r30, %r31, 16 + + | Make room on the stack for saved register arguments + subu %r31, %r31, (8 * 4) + st.d %r2, %r31, (0 * 4) + st.d %r4, %r31, (2 * 4) + st.d %r6, %r31, (4 * 4) + st.d %r8, %r31, (6 * 4) + + | Invoke the closure function + or %r5, %r30, 0 | calling stack + addu %r4, %r31, 0 | saved registers + or %r3, %r12, 0 | return value + or %r2, %r13, %r0 | closure +#ifdef PIC + bsr ffi_closure_OBSD_inner#plt +#else + bsr ffi_closure_OBSD_inner +#endif + + subu %r31, %r30, 16 + ld %r1, %r31, 0 + ld %r30, %r31, 4 + jmp.n %r1 + addu %r31, %r31, 16 + .size ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffi.c new file mode 100644 index 0000000..3aecb0b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffi.c @@ -0,0 +1,330 @@ +/* ---------------------------------------------------------------------- + ffi.c - Copyright (c) 2013 Imagination Technologies + + Meta Foreign Function Interface + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + `Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED `AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +----------------------------------------------------------------------- */ + +#include +#include + +#include + +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +/* + * ffi_prep_args is called by the assembly routine once stack space has been + * allocated for the function's arguments + */ + +unsigned int ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + /* Store return value */ + if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { + argp -= 4; + *(void **) argp = ecif->rvalue; + } + + p_argv = ecif->avalue; + + /* point to next location */ + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++, p_argv++) + { + size_t z; + + /* Move argp to address of argument */ + z = (*p_arg)->size; + argp -= z; + + /* Align if necessary */ + argp = (char *) FFI_ALIGN_DOWN(FFI_ALIGN_DOWN(argp, (*p_arg)->alignment), 4); + + if (z < sizeof(int)) { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + case FFI_TYPE_STRUCT: + memcpy(argp, *p_argv, (*p_arg)->size); + break; + default: + FFI_ASSERT(0); + } + } else if ( z == sizeof(int)) { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } else { + memcpy(argp, *p_argv, z); + } + } + + /* return the size of the arguments to be passed in registers, + padded to an 8 byte boundary to preserve stack alignment */ + return FFI_ALIGN(MIN(stack - argp, 6*4), 8); +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + ffi_type **ptr; + unsigned i, bytes = 0; + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { + if ((*ptr)->size == 0) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type, do this + check after the initialization. */ + FFI_ASSERT_VALID_TYPE(*ptr); + + /* Add any padding if necessary */ + if (((*ptr)->alignment - 1) & bytes) + bytes = FFI_ALIGN(bytes, (*ptr)->alignment); + + bytes += FFI_ALIGN((*ptr)->size, 4); + } + + /* Ensure arg space is aligned to an 8-byte boundary */ + bytes = FFI_ALIGN(bytes, 8); + + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT) { + bytes += sizeof(void*); + + /* Ensure stack is aligned to an 8-byte boundary */ + bytes = FFI_ALIGN(bytes, 8); + } + + cif->bytes = bytes; + + /* Set the return type flag */ + switch (cif->rtype->type) { + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags = (unsigned) cif->rtype->type; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = (unsigned) FFI_TYPE_SINT64; + break; + case FFI_TYPE_STRUCT: + /* Meta can store return values which are <= 64 bits */ + if (cif->rtype->size <= 4) + /* Returned to D0Re0 as 32-bit value */ + cif->flags = (unsigned)FFI_TYPE_INT; + else if ((cif->rtype->size > 4) && (cif->rtype->size <= 8)) + /* Returned valued is stored to D1Re0|R0Re0 */ + cif->flags = (unsigned)FFI_TYPE_DOUBLE; + else + /* value stored in memory */ + cif->flags = (unsigned)FFI_TYPE_STRUCT; + break; + default: + cif->flags = (unsigned)FFI_TYPE_INT; + break; + } + return FFI_OK; +} + +extern void ffi_call_SYSV(void (*fn)(void), extended_cif *, unsigned, unsigned, double *); + +/* + * Exported in API. Entry point + * cif -> ffi_cif object + * fn -> function pointer + * rvalue -> pointer to return value + * avalue -> vector of void * pointers pointing to memory locations holding the + * arguments + */ +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + int small_struct = (((cif->flags == FFI_TYPE_INT) || (cif->flags == FFI_TYPE_DOUBLE)) && (cif->rtype->type == FFI_TYPE_STRUCT)); + ecif.cif = cif; + ecif.avalue = avalue; + + double temp; + + /* + * If the return value is a struct and we don't have a return value address + * then we need to make one + */ + + if ((rvalue == NULL ) && (cif->flags == FFI_TYPE_STRUCT)) + ecif.rvalue = alloca(cif->rtype->size); + else if (small_struct) + ecif.rvalue = &temp; + else + ecif.rvalue = rvalue; + + switch (cif->abi) { + case FFI_SYSV: + ffi_call_SYSV(fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); + break; + default: + FFI_ASSERT(0); + break; + } + + if (small_struct) + memcpy (rvalue, &temp, cif->rtype->size); +} + +/* private members */ + +static void ffi_prep_incoming_args_SYSV (char *, void **, void **, + ffi_cif*, float *); + +void ffi_closure_SYSV (ffi_closure *); + +/* Do NOT change that without changing the FFI_TRAMPOLINE_SIZE */ +extern unsigned int ffi_metag_trampoline[10]; /* 10 instructions */ + +/* end of private members */ + +/* + * __tramp: trampoline memory location + * __fun: assembly routine + * __ctx: memory location for wrapper + * + * At this point, tramp[0] == __ctx ! + */ +void ffi_init_trampoline(unsigned char *__tramp, unsigned int __fun, unsigned int __ctx) { + memcpy (__tramp, ffi_metag_trampoline, sizeof(ffi_metag_trampoline)); + *(unsigned int*) &__tramp[40] = __ctx; + *(unsigned int*) &__tramp[44] = __fun; + /* This will flush the instruction cache */ + __builtin_meta2_cachewd(&__tramp[0], 1); + __builtin_meta2_cachewd(&__tramp[47], 1); +} + + + +/* the cif must already be prepared */ + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + void (*closure_func)(ffi_closure*) = NULL; + + if (cif->abi == FFI_SYSV) + closure_func = &ffi_closure_SYSV; + else + return FFI_BAD_ABI; + + ffi_init_trampoline( + (unsigned char*)&closure->tramp[0], + (unsigned int)closure_func, + (unsigned int)codeloc); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + + +/* This function is jumped to by the trampoline */ +unsigned int ffi_closure_SYSV_inner (closure, respp, args, vfp_args) + ffi_closure *closure; + void **respp; + void *args; + void *vfp_args; +{ + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* + * This call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. + */ + ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args); + + (closure->fun) ( cif, *respp, arg_area, closure->user_data); + + return cif->flags; +} + +static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif, + float *vfp_stack) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + /* stack points to original arguments */ + argp = stack; + + /* Store return value */ + if ( cif->flags == FFI_TYPE_STRUCT ) { + argp -= 4; + *rvalue = *(void **) argp; + } + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) { + size_t z; + size_t alignment; + + alignment = (*p_arg)->alignment; + if (alignment < 4) + alignment = 4; + if ((alignment - 1) & (unsigned)argp) + argp = (char *) FFI_ALIGN(argp, alignment); + + z = (*p_arg)->size; + *p_argv = (void*) argp; + p_argv++; + argp -= z; + } + return; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffitarget.h new file mode 100644 index 0000000..7b9dbeb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/ffitarget.h @@ -0,0 +1,53 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2013 Imagination Technologies Ltd. + Target configuration macros for Meta + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_DEFAULT_ABI = FFI_SYSV, + FFI_LAST_ABI = FFI_DEFAULT_ABI + 1, +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 48 +#define FFI_NATIVE_RAW_API 0 + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/sysv.S new file mode 100644 index 0000000..b4b2a3b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/metag/sysv.S @@ -0,0 +1,311 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2013 Imagination Technologies Ltd. + + Meta Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#ifdef HAVE_MACHINE_ASM_H +#include +#else +#ifdef __USER_LABEL_PREFIX__ +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ +#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) +#else +#define CNAME(x) x +#endif +#define ENTRY(x) .globl CNAME(x); .type CNAME(x), %function; CNAME(x): +#endif + +#ifdef __ELF__ +#define LSYM(x) .x +#else +#define LSYM(x) x +#endif + +.macro call_reg x= + .text + .balign 4 + mov D1RtP, \x + swap D1RtP, PC +.endm + +! Save register arguments +.macro SAVE_ARGS + .text + .balign 4 + setl [A0StP++], D0Ar6, D1Ar5 + setl [A0StP++], D0Ar4, D1Ar3 + setl [A0StP++], D0Ar2, D1Ar1 +.endm + +! Save retrun, frame pointer and other regs +.macro SAVE_REGS regs= + .text + .balign 4 + setl [A0StP++], D0FrT, D1RtP + ! Needs to be a pair of regs + .ifnc "\regs","" + setl [A0StP++], \regs + .endif +.endm + +! Declare a global function +.macro METAG_FUNC_START name + .text + .balign 4 + ENTRY(\name) +.endm + +! Return registers from the stack. Reverse SAVE_REGS operation +.macro RET_REGS regs=, cond= + .ifnc "\regs", "" + getl \regs, [--A0StP] + .endif + getl D0FrT, D1RtP, [--A0StP] +.endm + +! Return arguments +.macro RET_ARGS + getl D0Ar2, D1Ar1, [--A0StP] + getl D0Ar4, D1Ar3, [--A0StP] + getl D0Ar6, D1Ar5, [--A0StP] +.endm + + + ! D1Ar1: fn + ! D0Ar2: &ecif + ! D1Ar3: cif->bytes + ! D0Ar4: fig->flags + ! D1Ar5: ecif.rvalue + + ! This assumes we are using GNU as +METAG_FUNC_START ffi_call_SYSV + ! Save argument registers + + SAVE_ARGS + + ! new frame + mov D0FrT, A0FrP + add A0FrP, A0StP, #0 + + ! Preserve the old frame pointer + SAVE_REGS "D1.5, D0.5" + + ! Make room for new args. cifs->bytes is the total space for input + ! and return arguments + + add A0StP, A0StP, D1Ar3 + + ! Preserve cifs->bytes & fn + mov D0.5, D1Ar3 + mov D1.5, D1Ar1 + + ! Place all of the ffi_prep_args in position + mov D1Ar1, A0StP + + ! Call ffi_prep_args(stack, &ecif) +#ifdef __PIC__ + callr D1RtP, CNAME(ffi_prep_args@PLT) +#else + callr D1RtP, CNAME(ffi_prep_args) +#endif + + ! Restore fn pointer + + ! The foreign stack should look like this + ! XXXXX XXXXXX <--- stack pointer + ! FnArgN rvalue + ! FnArgN+2 FnArgN+1 + ! FnArgN+4 FnArgN+3 + ! .... + ! + + ! A0StP now points to the first (or return) argument + 4 + + ! Preserve cif->bytes + getl D0Ar2, D1Ar1, [--A0StP] + getl D0Ar4, D1Ar3, [--A0StP] + getl D0Ar6, D1Ar5, [--A0StP] + + ! Place A0StP to the first argument again + add A0StP, A0StP, #24 ! That's because we loaded 6 regs x 4 byte each + + ! A0FrP points to the initial stack without the reserved space for the + ! cifs->bytes, whilst A0StP points to the stack after the space allocation + + ! fn was the first argument of ffi_call_SYSV. + ! The stack at this point looks like this: + ! + ! A0StP(on entry to _SYSV) -> Arg6 Arg5 | low + ! Arg4 Arg3 | + ! Arg2 Arg1 | + ! A0FrP ----> D0FrtP D1RtP | + ! D1.5 D0.5 | + ! A0StP(bf prep_args) -> FnArgn FnArgn-1 | + ! FnArgn-2FnArgn-3 | + ! ................ | <= cifs->bytes + ! FnArg4 FnArg3 | + ! A0StP (prv_A0StP+cifs->bytes) FnArg2 FnArg1 | high + ! + ! fn was in Arg1 so it's located in in A0FrP+#-0xC + ! + + ! D0Re0 contains the size of arguments stored in registers + sub A0StP, A0StP, D0Re0 + + ! Arg1 is the function pointer for the foreign call. This has been + ! preserved in D1.5 + + ! Time to call (fn). Arguments should be like this: + ! Arg1-Arg6 are loaded to regs + ! The rest of the arguments are stored in stack pointed by A0StP + + call_reg D1.5 + + ! Reset stack. + + mov A0StP, A0FrP + + ! Load Arg1 with the pointer to storage for the return type + ! This was stored in Arg5 + + getd D1Ar1, [A0FrP+#-20] + + ! Load D0Ar2 with the return type code. This was stored in Arg4 (flags) + + getd D0Ar2, [A0FrP+#-16] + + ! We are ready to start processing the return value + ! D0Re0 (and D1Re0) hold the return value + + ! If the return value is NULL, assume no return value + cmp D1Ar1, #0 + beq LSYM(Lepilogue) + + ! return INT + cmp D0Ar2, #FFI_TYPE_INT + ! Sadly, there is no setd{cc} instruction so we need to workaround that + bne .INT64 + setd [D1Ar1], D0Re0 + b LSYM(Lepilogue) + + ! return INT64 +.INT64: + cmp D0Ar2, #FFI_TYPE_SINT64 + setleq [D1Ar1], D0Re0, D1Re0 + + ! return DOUBLE + cmp D0Ar2, #FFI_TYPE_DOUBLE + setl [D1AR1++], D0Re0, D1Re0 + +LSYM(Lepilogue): + ! At this point, the stack pointer points right after the argument + ! saved area. We need to restore 4 regs, therefore we need to move + ! 16 bytes ahead. + add A0StP, A0StP, #16 + RET_REGS "D1.5, D0.5" + RET_ARGS + getd D0Re0, [A0StP] + mov A0FrP, D0FrT + swap D1RtP, PC + +.ffi_call_SYSV_end: + .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) + + +/* + (called by ffi_metag_trampoline) + void ffi_closure_SYSV (ffi_closure*) + + (called by ffi_closure_SYSV) + unsigned int FFI_HIDDEN + ffi_closure_SYSV_inner (closure,respp, args) + ffi_closure *closure; + void **respp; + void *args; +*/ + +METAG_FUNC_START ffi_closure_SYSV + ! We assume that D1Ar1 holds the address of the + ! ffi_closure struct. We will use that to fetch the + ! arguments. The stack pointer points to an empty space + ! and it is ready to store more data. + + ! D1Ar1 is ready + ! Allocate stack space for return value + add A0StP, A0StP, #8 + ! Store it to D0Ar2 + sub D0Ar2, A0StP, #8 + + sub D1Ar3, A0FrP, #4 + + ! D1Ar3 contains the address of the original D1Ar1 argument + ! We need to subtract #4 later on + + ! Preverve D0Ar2 + mov D0.5, D0Ar2 + +#ifdef __PIC__ + callr D1RtP, CNAME(ffi_closure_SYSV_inner@PLT) +#else + callr D1RtP, CNAME(ffi_closure_SYSV_inner) +#endif + + ! Check the return value and store it to D0.5 + cmp D0Re0, #FFI_TYPE_INT + beq .Lretint + cmp D0Re0, #FFI_TYPE_DOUBLE + beq .Lretdouble +.Lclosure_epilogue: + sub A0StP, A0StP, #8 + RET_REGS "D1.5, D0.5" + RET_ARGS + swap D1RtP, PC + +.Lretint: + setd [D0.5], D0Re0 + b .Lclosure_epilogue +.Lretdouble: + setl [D0.5++], D0Re0, D1Re0 + b .Lclosure_epilogue +.ffi_closure_SYSV_end: +.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + + +ENTRY(ffi_metag_trampoline) + SAVE_ARGS + ! New frame + mov A0FrP, A0StP + SAVE_REGS "D1.5, D0.5" + mov D0.5, PC + ! Load D1Ar1 the value of ffi_metag_trampoline + getd D1Ar1, [D0.5 + #8] + ! Jump to ffi_closure_SYSV + getd PC, [D0.5 + #12] diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffi.c new file mode 100644 index 0000000..df6e33c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffi.c @@ -0,0 +1,321 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2012, 2013 Xilinx, Inc + + MicroBlaze Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +extern void ffi_call_SYSV(void (*)(void*, extended_cif*), extended_cif*, + unsigned int, unsigned int, unsigned int*, void (*fn)(void), + unsigned int, unsigned int); + +extern void ffi_closure_SYSV(void); + +#define WORD_SIZE sizeof(unsigned int) +#define ARGS_REGISTER_SIZE (WORD_SIZE * 6) +#define WORD_FFI_ALIGN(x) FFI_ALIGN(x, WORD_SIZE) + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ +void ffi_prep_args(void* stack, extended_cif* ecif) +{ + unsigned int i; + ffi_type** p_arg; + void** p_argv; + void* stack_args_p = stack; + + if (ecif == NULL || ecif->cif == NULL) { + return; /* no description to prepare */ + } + + p_argv = ecif->avalue; + + if ((ecif->cif->rtype != NULL) && + (ecif->cif->rtype->type == FFI_TYPE_STRUCT)) + { + /* if return type is a struct which is referenced on the stack/reg5, + * by a pointer. Stored the return value pointer in r5. + */ + char* addr = stack_args_p; + memcpy(addr, &(ecif->rvalue), WORD_SIZE); + stack_args_p += WORD_SIZE; + } + + if (ecif->avalue == NULL) { + return; /* no arguments to prepare */ + } + + for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; + i++, p_arg++) + { + size_t size = (*p_arg)->size; + int type = (*p_arg)->type; + void* value = p_argv[i]; + char* addr = stack_args_p; + int aligned_size = WORD_FFI_ALIGN(size); + + /* force word alignment on the stack */ + stack_args_p += aligned_size; + + switch (type) + { + case FFI_TYPE_UINT8: + *(unsigned int *)addr = (unsigned int)*(UINT8*)(value); + break; + case FFI_TYPE_SINT8: + *(signed int *)addr = (signed int)*(SINT8*)(value); + break; + case FFI_TYPE_UINT16: + *(unsigned int *)addr = (unsigned int)*(UINT16*)(value); + break; + case FFI_TYPE_SINT16: + *(signed int *)addr = (signed int)*(SINT16*)(value); + break; + case FFI_TYPE_STRUCT: +#if __BIG_ENDIAN__ + /* + * MicroBlaze toolchain appears to emit: + * bsrli r5, r5, 8 (caller) + * ... + * + * ... + * bslli r5, r5, 8 (callee) + * + * For structs like "struct a { uint8_t a[3]; };", when passed + * by value. + * + * Structs like "struct b { uint16_t a; };" are also expected + * to be packed strangely in registers. + * + * This appears to be because the microblaze toolchain expects + * "struct b == uint16_t", which is only any issue for big + * endian. + * + * The following is a work around for big-endian only, for the + * above mentioned case, it will re-align the contents of a + * <= 3-byte struct value. + */ + if (size < WORD_SIZE) + { + memcpy (addr + (WORD_SIZE - size), value, size); + break; + } +#endif + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + default: + memcpy(addr, value, aligned_size); + } + } +} + +ffi_status ffi_prep_cif_machdep(ffi_cif* cif) +{ + /* check ABI */ + switch (cif->abi) + { + case FFI_SYSV: + break; + default: + return FFI_BAD_ABI; + } + return FFI_OK; +} + +void ffi_call(ffi_cif* cif, void (*fn)(void), void* rvalue, void** avalue) +{ + extended_cif ecif; + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { + ecif.rvalue = alloca(cif->rtype->size); + } else { + ecif.rvalue = rvalue; + } + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, + ecif.rvalue, fn, cif->rtype->type, cif->rtype->size); + break; + default: + FFI_ASSERT(0); + break; + } +} + +void ffi_closure_call_SYSV(void* register_args, void* stack_args, + ffi_closure* closure, void* rvalue, + unsigned int* rtype, unsigned int* rsize) +{ + /* prepare arguments for closure call */ + ffi_cif* cif = closure->cif; + ffi_type** arg_types = cif->arg_types; + + /* re-allocate data for the args. This needs to be done in order to keep + * multi-word objects (e.g. structs) in contiguous memory. Callers are not + * required to store the value of args in the lower 6 words in the stack + * (although they are allocated in the stack). + */ + char* stackclone = alloca(cif->bytes); + void** avalue = alloca(cif->nargs * sizeof(void*)); + void* struct_rvalue = NULL; + char* ptr = stackclone; + int i; + + /* copy registers into stack clone */ + int registers_used = cif->bytes; + if (registers_used > ARGS_REGISTER_SIZE) { + registers_used = ARGS_REGISTER_SIZE; + } + memcpy(stackclone, register_args, registers_used); + + /* copy stack allocated args into stack clone */ + if (cif->bytes > ARGS_REGISTER_SIZE) { + int stack_used = cif->bytes - ARGS_REGISTER_SIZE; + memcpy(stackclone + ARGS_REGISTER_SIZE, stack_args, stack_used); + } + + /* preserve struct type return pointer passing */ + if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { + struct_rvalue = *((void**)ptr); + ptr += WORD_SIZE; + } + + /* populate arg pointer list */ + for (i = 0; i < cif->nargs; i++) + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: +#ifdef __BIG_ENDIAN__ + avalue[i] = ptr + 3; +#else + avalue[i] = ptr; +#endif + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: +#ifdef __BIG_ENDIAN__ + avalue[i] = ptr + 2; +#else + avalue[i] = ptr; +#endif + break; + case FFI_TYPE_STRUCT: +#if __BIG_ENDIAN__ + /* + * Work around strange ABI behaviour. + * (see info in ffi_prep_args) + */ + if (arg_types[i]->size < WORD_SIZE) + { + memcpy (ptr, ptr + (WORD_SIZE - arg_types[i]->size), arg_types[i]->size); + } +#endif + avalue[i] = (void*)ptr; + break; + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_DOUBLE: + avalue[i] = ptr; + break; + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + default: + /* default 4-byte argument */ + avalue[i] = ptr; + break; + } + ptr += WORD_FFI_ALIGN(arg_types[i]->size); + } + + /* set the return type info passed back to the wrapper */ + *rsize = cif->rtype->size; + *rtype = cif->rtype->type; + if (struct_rvalue != NULL) { + closure->fun(cif, struct_rvalue, avalue, closure->user_data); + /* copy struct return pointer value into function return value */ + *((void**)rvalue) = struct_rvalue; + } else { + closure->fun(cif, rvalue, avalue, closure->user_data); + } +} + +ffi_status ffi_prep_closure_loc( + ffi_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void* user_data, void* codeloc) +{ + unsigned long* tramp = (unsigned long*)&(closure->tramp[0]); + unsigned long cls = (unsigned long)codeloc; + unsigned long fn = 0; + unsigned long fn_closure_call_sysv = (unsigned long)ffi_closure_call_SYSV; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + switch (cif->abi) + { + case FFI_SYSV: + fn = (unsigned long)ffi_closure_SYSV; + + /* load r11 (temp) with fn */ + /* imm fn(upper) */ + tramp[0] = 0xb0000000 | ((fn >> 16) & 0xffff); + /* addik r11, r0, fn(lower) */ + tramp[1] = 0x31600000 | (fn & 0xffff); + + /* load r12 (temp) with cls */ + /* imm cls(upper) */ + tramp[2] = 0xb0000000 | ((cls >> 16) & 0xffff); + /* addik r12, r0, cls(lower) */ + tramp[3] = 0x31800000 | (cls & 0xffff); + + /* load r3 (temp) with ffi_closure_call_SYSV */ + /* imm fn_closure_call_sysv(upper) */ + tramp[4] = 0xb0000000 | ((fn_closure_call_sysv >> 16) & 0xffff); + /* addik r3, r0, fn_closure_call_sysv(lower) */ + tramp[5] = 0x30600000 | (fn_closure_call_sysv & 0xffff); + /* branch/jump to address stored in r11 (fn) */ + tramp[6] = 0x98085800; /* bra r11 */ + + break; + default: + return FFI_BAD_ABI; + } + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffitarget.h new file mode 100644 index 0000000..c6fa5a4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/ffitarget.h @@ -0,0 +1,53 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2012, 2013 Xilinx, Inc + + Target configuration macros for MicroBlaze. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +/* Definitions for closures */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#define FFI_TRAMPOLINE_SIZE (4*8) + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/sysv.S new file mode 100644 index 0000000..ea43e9d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/microblaze/sysv.S @@ -0,0 +1,302 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2012, 2013 Xilinx, Inc + + MicroBlaze Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + /* + * arg[0] (r5) = ffi_prep_args, + * arg[1] (r6) = &ecif, + * arg[2] (r7) = cif->bytes, + * arg[3] (r8) = cif->flags, + * arg[4] (r9) = ecif.rvalue, + * arg[5] (r10) = fn + * arg[6] (sp[0]) = cif->rtype->type + * arg[7] (sp[4]) = cif->rtype->size + */ + .text + .globl ffi_call_SYSV + .type ffi_call_SYSV, @function +ffi_call_SYSV: + /* push callee saves */ + addik r1, r1, -20 + swi r19, r1, 0 /* Frame Pointer */ + swi r20, r1, 4 /* PIC register */ + swi r21, r1, 8 /* PIC register */ + swi r22, r1, 12 /* save for locals */ + swi r23, r1, 16 /* save for locals */ + + /* save the r5-r10 registers in the stack */ + addik r1, r1, -24 /* increment sp to store 6x 32-bit words */ + swi r5, r1, 0 + swi r6, r1, 4 + swi r7, r1, 8 + swi r8, r1, 12 + swi r9, r1, 16 + swi r10, r1, 20 + + /* save function pointer */ + addik r3, r5, 0 /* copy ffi_prep_args into r3 */ + addik r22, r1, 0 /* save sp for unallocated args into r22 (callee-saved) */ + addik r23, r10, 0 /* save function address into r23 (callee-saved) */ + + /* prepare stack with allocation for n (bytes = r7) args */ + rsub r1, r7, r1 /* subtract bytes from sp */ + + /* prep args for ffi_prep_args call */ + addik r5, r1, 0 /* store stack pointer into arg[0] */ + /* r6 still holds ecif for arg[1] */ + + /* Call ffi_prep_args(stack, &ecif). */ + addik r1, r1, -4 + swi r15, r1, 0 /* store the link register in the frame */ + brald r15, r3 + nop /* branch has delay slot */ + lwi r15, r1, 0 + addik r1, r1, 4 /* restore the link register from the frame */ + /* returns calling stack pointer location */ + + /* prepare args for fn call, prep_args populates them onto the stack */ + lwi r5, r1, 0 /* arg[0] */ + lwi r6, r1, 4 /* arg[1] */ + lwi r7, r1, 8 /* arg[2] */ + lwi r8, r1, 12 /* arg[3] */ + lwi r9, r1, 16 /* arg[4] */ + lwi r10, r1, 20 /* arg[5] */ + + /* call (fn) (...). */ + addik r1, r1, -4 + swi r15, r1, 0 /* store the link register in the frame */ + brald r15, r23 + nop /* branch has delay slot */ + lwi r15, r1, 0 + addik r1, r1, 4 /* restore the link register from the frame */ + + /* Remove the space we pushed for the args. */ + addik r1, r22, 0 /* restore old SP */ + + /* restore this functions parameters */ + lwi r5, r1, 0 /* arg[0] */ + lwi r6, r1, 4 /* arg[1] */ + lwi r7, r1, 8 /* arg[2] */ + lwi r8, r1, 12 /* arg[3] */ + lwi r9, r1, 16 /* arg[4] */ + lwi r10, r1, 20 /* arg[5] */ + addik r1, r1, 24 /* decrement sp to de-allocate 6x 32-bit words */ + + /* If the return value pointer is NULL, assume no return value. */ + beqi r9, ffi_call_SYSV_end + + lwi r22, r1, 48 /* get return type (20 for locals + 28 for arg[6]) */ + lwi r23, r1, 52 /* get return size (20 for locals + 32 for arg[7]) */ + + /* Check if return type is actually a struct, do nothing */ + rsubi r11, r22, FFI_TYPE_STRUCT + beqi r11, ffi_call_SYSV_end + + /* Return 8bit */ + rsubi r11, r23, 1 + beqi r11, ffi_call_SYSV_store8 + + /* Return 16bit */ + rsubi r11, r23, 2 + beqi r11, ffi_call_SYSV_store16 + + /* Return 32bit */ + rsubi r11, r23, 4 + beqi r11, ffi_call_SYSV_store32 + + /* Return 64bit */ + rsubi r11, r23, 8 + beqi r11, ffi_call_SYSV_store64 + + /* Didn't match anything */ + bri ffi_call_SYSV_end + +ffi_call_SYSV_store64: + swi r3, r9, 0 /* store word r3 into return value */ + swi r4, r9, 4 /* store word r4 into return value */ + bri ffi_call_SYSV_end + +ffi_call_SYSV_store32: + swi r3, r9, 0 /* store word r3 into return value */ + bri ffi_call_SYSV_end + +ffi_call_SYSV_store16: +#ifdef __BIG_ENDIAN__ + shi r3, r9, 2 /* store half-word r3 into return value */ +#else + shi r3, r9, 0 /* store half-word r3 into return value */ +#endif + bri ffi_call_SYSV_end + +ffi_call_SYSV_store8: +#ifdef __BIG_ENDIAN__ + sbi r3, r9, 3 /* store byte r3 into return value */ +#else + sbi r3, r9, 0 /* store byte r3 into return value */ +#endif + bri ffi_call_SYSV_end + +ffi_call_SYSV_end: + /* callee restores */ + lwi r19, r1, 0 /* frame pointer */ + lwi r20, r1, 4 /* PIC register */ + lwi r21, r1, 8 /* PIC register */ + lwi r22, r1, 12 + lwi r23, r1, 16 + addik r1, r1, 20 + + /* return from sub-routine (with delay slot) */ + rtsd r15, 8 + nop + + .size ffi_call_SYSV, . - ffi_call_SYSV + +/* ------------------------------------------------------------------------- */ + + /* + * args passed into this function, are passed down to the callee. + * this function is the target of the closure trampoline, as such r12 is + * a pointer to the closure object. + */ + .text + .globl ffi_closure_SYSV + .type ffi_closure_SYSV, @function +ffi_closure_SYSV: + /* push callee saves */ + addik r11, r1, 28 /* save stack args start location (excluding regs/link) */ + addik r1, r1, -12 + swi r19, r1, 0 /* Frame Pointer */ + swi r20, r1, 4 /* PIC register */ + swi r21, r1, 8 /* PIC register */ + + /* store register args on stack */ + addik r1, r1, -24 + swi r5, r1, 0 + swi r6, r1, 4 + swi r7, r1, 8 + swi r8, r1, 12 + swi r9, r1, 16 + swi r10, r1, 20 + + /* setup args */ + addik r5, r1, 0 /* register_args */ + addik r6, r11, 0 /* stack_args */ + addik r7, r12, 0 /* closure object */ + addik r1, r1, -8 /* allocate return value */ + addik r8, r1, 0 /* void* rvalue */ + addik r1, r1, -8 /* allocate for return type/size values */ + addik r9, r1, 0 /* void* rtype */ + addik r10, r1, 4 /* void* rsize */ + + /* call the wrap_call function */ + addik r1, r1, -28 /* allocate args + link reg */ + swi r15, r1, 0 /* store the link register in the frame */ + brald r15, r3 + nop /* branch has delay slot */ + lwi r15, r1, 0 + addik r1, r1, 28 /* restore the link register from the frame */ + +ffi_closure_SYSV_prepare_return: + lwi r9, r1, 0 /* rtype */ + lwi r10, r1, 4 /* rsize */ + addik r1, r1, 8 /* de-allocate return info values */ + + /* Check if return type is actually a struct, store 4 bytes */ + rsubi r11, r9, FFI_TYPE_STRUCT + beqi r11, ffi_closure_SYSV_store32 + + /* Return 8bit */ + rsubi r11, r10, 1 + beqi r11, ffi_closure_SYSV_store8 + + /* Return 16bit */ + rsubi r11, r10, 2 + beqi r11, ffi_closure_SYSV_store16 + + /* Return 32bit */ + rsubi r11, r10, 4 + beqi r11, ffi_closure_SYSV_store32 + + /* Return 64bit */ + rsubi r11, r10, 8 + beqi r11, ffi_closure_SYSV_store64 + + /* Didn't match anything */ + bri ffi_closure_SYSV_end + +ffi_closure_SYSV_store64: + lwi r3, r1, 0 /* store word r3 into return value */ + lwi r4, r1, 4 /* store word r4 into return value */ + /* 64 bits == 2 words, no sign extend occurs */ + bri ffi_closure_SYSV_end + +ffi_closure_SYSV_store32: + lwi r3, r1, 0 /* store word r3 into return value */ + /* 32 bits == 1 word, no sign extend occurs */ + bri ffi_closure_SYSV_end + +ffi_closure_SYSV_store16: +#ifdef __BIG_ENDIAN__ + lhui r3, r1, 2 /* store half-word r3 into return value */ +#else + lhui r3, r1, 0 /* store half-word r3 into return value */ +#endif + rsubi r11, r9, FFI_TYPE_SINT16 + bnei r11, ffi_closure_SYSV_end + sext16 r3, r3 /* fix sign extend of sint8 */ + bri ffi_closure_SYSV_end + +ffi_closure_SYSV_store8: +#ifdef __BIG_ENDIAN__ + lbui r3, r1, 3 /* store byte r3 into return value */ +#else + lbui r3, r1, 0 /* store byte r3 into return value */ +#endif + rsubi r11, r9, FFI_TYPE_SINT8 + bnei r11, ffi_closure_SYSV_end + sext8 r3, r3 /* fix sign extend of sint8 */ + bri ffi_closure_SYSV_end + +ffi_closure_SYSV_end: + addik r1, r1, 8 /* de-allocate return value */ + + /* de-allocate stored args */ + addik r1, r1, 24 + + /* callee restores */ + lwi r19, r1, 0 /* frame pointer */ + lwi r20, r1, 4 /* PIC register */ + lwi r21, r1, 8 /* PIC register */ + addik r1, r1, 12 + + /* return from sub-routine (with delay slot) */ + rtsd r15, 8 + nop + + .size ffi_closure_SYSV, . - ffi_closure_SYSV diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffi.c new file mode 100644 index 0000000..979ca49 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffi.c @@ -0,0 +1,1134 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2011 Anthony Green + Copyright (c) 2008 David Daney + Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc. + + MIPS Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include + +#ifdef __GNUC__ +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) +# define USE__BUILTIN___CLEAR_CACHE 1 +# endif +#endif + +#ifndef USE__BUILTIN___CLEAR_CACHE +# if defined(__FreeBSD__) +# include +# elif defined(__OpenBSD__) +# include +# else +# include +# endif +#endif + +#ifdef FFI_DEBUG +# define FFI_MIPS_STOP_HERE() ffi_stop_here() +#else +# define FFI_MIPS_STOP_HERE() do {} while(0) +#endif + +#ifdef FFI_MIPS_N32 +#define FIX_ARGP \ +FFI_ASSERT(argp <= &stack[bytes]); \ +if (argp == &stack[bytes]) \ +{ \ + argp = stack; \ + FFI_MIPS_STOP_HERE(); \ +} +#else +#define FIX_ARGP +#endif + + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +static void ffi_prep_args(char *stack, + extended_cif *ecif, + int bytes, + int flags) +{ + int i; + void **p_argv; + char *argp; + ffi_type **p_arg; + +#ifdef FFI_MIPS_N32 + /* If more than 8 double words are used, the remainder go + on the stack. We reorder stuff on the stack here to + support this easily. */ + if (bytes > 8 * sizeof(ffi_arg)) + argp = &stack[bytes - (8 * sizeof(ffi_arg))]; + else + argp = stack; +#else + argp = stack; +#endif + + memset(stack, 0, bytes); + +#ifdef FFI_MIPS_N32 + if ( ecif->cif->rstruct_flag != 0 ) +#else + if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) +#endif + { + *(ffi_arg *) argp = (ffi_arg) ecif->rvalue; + argp += sizeof(ffi_arg); + FIX_ARGP; + } + + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; i++, p_arg++) + { + size_t z; + unsigned int a; + + /* Align if necessary. */ + a = (*p_arg)->alignment; + if (a < sizeof(ffi_arg)) + a = sizeof(ffi_arg); + + if ((a - 1) & (unsigned long) argp) + { + argp = (char *) FFI_ALIGN(argp, a); + FIX_ARGP; + } + + z = (*p_arg)->size; + if (z <= sizeof(ffi_arg)) + { + int type = (*p_arg)->type; + z = sizeof(ffi_arg); + + /* The size of a pointer depends on the ABI */ + if (type == FFI_TYPE_POINTER) + type = (ecif->cif->abi == FFI_N64 + || ecif->cif->abi == FFI_N64_SOFT_FLOAT) + ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32; + + if (i < 8 && (ecif->cif->abi == FFI_N32_SOFT_FLOAT + || ecif->cif->abi == FFI_N64_SOFT_FLOAT)) + { + switch (type) + { + case FFI_TYPE_FLOAT: + type = FFI_TYPE_UINT32; + break; + case FFI_TYPE_DOUBLE: + type = FFI_TYPE_UINT64; + break; + default: + break; + } + } + switch (type) + { + case FFI_TYPE_SINT8: + *(ffi_arg *)argp = *(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(ffi_arg *)argp = *(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(ffi_arg *)argp = *(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(ffi_arg *)argp = *(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_SINT32: + *(ffi_arg *)argp = *(SINT32 *)(* p_argv); + break; + + case FFI_TYPE_UINT32: +#ifdef FFI_MIPS_N32 + /* The N32 ABI requires that 32-bit integers + be sign-extended to 64-bits, regardless of + whether they are signed or unsigned. */ + *(ffi_arg *)argp = *(SINT32 *)(* p_argv); +#else + *(ffi_arg *)argp = *(UINT32 *)(* p_argv); +#endif + break; + + /* This can only happen with 64bit slots. */ + case FFI_TYPE_FLOAT: + *(float *) argp = *(float *)(* p_argv); + break; + + /* Handle structures. */ + default: + memcpy(argp, *p_argv, (*p_arg)->size); + break; + } + } + else + { +#ifdef FFI_MIPS_O32 + memcpy(argp, *p_argv, z); +#else + { + unsigned long end = (unsigned long) argp + z; + unsigned long cap = (unsigned long) stack + bytes; + + /* Check if the data will fit within the register space. + Handle it if it doesn't. */ + + if (end <= cap) + memcpy(argp, *p_argv, z); + else + { + unsigned long portion = cap - (unsigned long)argp; + + memcpy(argp, *p_argv, portion); + argp = stack; + z -= portion; + memcpy(argp, (void*)((unsigned long)(*p_argv) + portion), + z); + } + } +#endif + } + p_argv++; + argp += z; + FIX_ARGP; + } +} + +#ifdef FFI_MIPS_N32 + +/* The n32 spec says that if "a chunk consists solely of a double + float field (but not a double, which is part of a union), it + is passed in a floating point register. Any other chunk is + passed in an integer register". This code traverses structure + definitions and generates the appropriate flags. */ + +static unsigned +calc_n32_struct_flags(int soft_float, ffi_type *arg, + unsigned *loc, unsigned *arg_reg) +{ + unsigned flags = 0; + unsigned index = 0; + + ffi_type *e; + + if (soft_float) + return 0; + + while ((e = arg->elements[index])) + { + /* Align this object. */ + *loc = FFI_ALIGN(*loc, e->alignment); + if (e->type == FFI_TYPE_DOUBLE) + { + /* Already aligned to FFI_SIZEOF_ARG. */ + *arg_reg = *loc / FFI_SIZEOF_ARG; + if (*arg_reg > 7) + break; + flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS)); + *loc += e->size; + } + else + *loc += e->size; + index++; + } + /* Next Argument register at alignment of FFI_SIZEOF_ARG. */ + *arg_reg = FFI_ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + + return flags; +} + +static unsigned +calc_n32_return_struct_flags(int soft_float, ffi_type *arg) +{ + unsigned flags = 0; + unsigned small = FFI_TYPE_SMALLSTRUCT; + ffi_type *e; + + /* Returning structures under n32 is a tricky thing. + A struct with only one or two floating point fields + is returned in $f0 (and $f2 if necessary). Any other + struct results at most 128 bits are returned in $2 + (the first 64 bits) and $3 (remainder, if necessary). + Larger structs are handled normally. */ + + if (arg->size > 16) + return 0; + + if (arg->size > 8) + small = FFI_TYPE_SMALLSTRUCT2; + + e = arg->elements[0]; + + if (e->type == FFI_TYPE_DOUBLE) + flags = FFI_TYPE_DOUBLE; + else if (e->type == FFI_TYPE_FLOAT) + flags = FFI_TYPE_FLOAT; + + if (flags && (e = arg->elements[1])) + { + if (e->type == FFI_TYPE_DOUBLE) + flags += FFI_TYPE_DOUBLE << FFI_FLAG_BITS; + else if (e->type == FFI_TYPE_FLOAT) + flags += FFI_TYPE_FLOAT << FFI_FLAG_BITS; + else + return small; + + if (flags && (arg->elements[2])) + { + /* There are three arguments and the first two are + floats! This must be passed the old way. */ + return small; + } + if (soft_float) + flags += FFI_TYPE_STRUCT_SOFT; + } + else + if (!flags) + return small; + + return flags; +} + +#endif + +/* Perform machine dependent cif processing */ +static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) +{ + cif->flags = 0; + cif->mips_nfixedargs = nfixedargs; + +#ifdef FFI_MIPS_O32 + /* Set the flags necessary for O32 processing. FFI_O32_SOFT_FLOAT + * does not have special handling for floating point args. + */ + + if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32) + { + if (cif->nargs > 0 && cif->nargs == nfixedargs) + { + switch ((cif->arg_types)[0]->type) + { + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags += (cif->arg_types)[0]->type; + break; + + default: + break; + } + + if (cif->nargs > 1) + { + /* Only handle the second argument if the first + is a float or double. */ + if (cif->flags) + { + switch ((cif->arg_types)[1]->type) + { + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS; + break; + + default: + break; + } + } + } + } + } + + /* Set the return type flag */ + + if (cif->abi == FFI_O32_SOFT_FLOAT) + { + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: + cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); + break; + + case FFI_TYPE_FLOAT: + default: + cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); + break; + } + } + else + { + /* FFI_O32 */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); + break; + + default: + cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); + break; + } + } +#endif + +#ifdef FFI_MIPS_N32 + /* Set the flags necessary for N32 processing */ + { + int type; + unsigned arg_reg = 0; + unsigned loc = 0; + unsigned count = (cif->nargs < 8) ? cif->nargs : 8; + unsigned index = 0; + + unsigned struct_flags = 0; + int soft_float = (cif->abi == FFI_N32_SOFT_FLOAT + || cif->abi == FFI_N64_SOFT_FLOAT); + + if (cif->rtype->type == FFI_TYPE_STRUCT) + { + struct_flags = calc_n32_return_struct_flags(soft_float, cif->rtype); + + if (struct_flags == 0) + { + /* This means that the structure is being passed as + a hidden argument */ + + arg_reg = 1; + count = (cif->nargs < 7) ? cif->nargs : 7; + + cif->rstruct_flag = !0; + } + else + cif->rstruct_flag = 0; + } + else + cif->rstruct_flag = 0; + + while (count-- > 0 && arg_reg < 8) + { + type = (cif->arg_types)[index]->type; + + // Pass variadic arguments in integer registers even if they're floats + if (soft_float || index >= nfixedargs) + { + switch (type) + { + case FFI_TYPE_FLOAT: + type = FFI_TYPE_UINT32; + break; + case FFI_TYPE_DOUBLE: + type = FFI_TYPE_UINT64; + break; + default: + break; + } + } + switch (type) + { + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags += + ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + break; + case FFI_TYPE_LONGDOUBLE: + /* Align it. */ + arg_reg = FFI_ALIGN(arg_reg, 2); + /* Treat it as two adjacent doubles. */ + if (soft_float || index >= nfixedargs) + { + arg_reg += 2; + } + else + { + cif->flags += + (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + cif->flags += + (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + } + break; + + case FFI_TYPE_STRUCT: + loc = arg_reg * FFI_SIZEOF_ARG; + cif->flags += calc_n32_struct_flags(soft_float || index >= nfixedargs, + (cif->arg_types)[index], + &loc, &arg_reg); + break; + + default: + arg_reg++; + break; + } + + index++; + } + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_STRUCT: + { + if (struct_flags == 0) + { + /* The structure is returned through a hidden + first argument. Do nothing, 'cause FFI_TYPE_VOID + is 0 */ + } + else + { + /* The structure is returned via some tricky + mechanism */ + cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); + cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8)); + } + break; + } + + case FFI_TYPE_VOID: + /* Do nothing, 'cause FFI_TYPE_VOID is 0 */ + break; + + case FFI_TYPE_POINTER: + if (cif->abi == FFI_N32_SOFT_FLOAT || cif->abi == FFI_N32) + cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); + else + cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); + break; + + case FFI_TYPE_FLOAT: + if (soft_float) + { + cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); + break; + } + /* else fall through */ + case FFI_TYPE_DOUBLE: + if (soft_float) + cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); + else + cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); + break; + + case FFI_TYPE_LONGDOUBLE: + /* Long double is returned as if it were a struct containing + two doubles. */ + if (soft_float) + { + cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); + cif->flags += FFI_TYPE_SMALLSTRUCT2 << (4 + (FFI_FLAG_BITS * 8)); + } + else + { + cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); + cif->flags += (FFI_TYPE_DOUBLE + + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS)) + << (4 + (FFI_FLAG_BITS * 8)); + } + break; + default: + cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); + break; + } + } +#endif + + return FFI_OK; +} + +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + return ffi_prep_cif_machdep_int(cif, cif->nargs); +} + +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned nfixedargs, + unsigned ntotalargs MAYBE_UNUSED) +{ + return ffi_prep_cif_machdep_int(cif, nfixedargs); +} + +/* Low level routine for calling O32 functions */ +extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), + extended_cif *, unsigned, + unsigned, unsigned *, void (*)(void), void *closure); + +/* Low level routine for calling N32 functions */ +extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), + extended_cif *, unsigned, + unsigned, void *, void (*)(void), void *closure); + +void ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + ecif.rvalue = alloca(cif->rtype->size); + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { +#ifdef FFI_MIPS_O32 + case FFI_O32: + case FFI_O32_SOFT_FLOAT: + ffi_call_O32(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn, closure); + break; +#endif + +#ifdef FFI_MIPS_N32 + case FFI_N32: + case FFI_N32_SOFT_FLOAT: + case FFI_N64: + case FFI_N64_SOFT_FLOAT: + { + int copy_rvalue = 0; + int copy_offset = 0; + char *rvalue_copy = ecif.rvalue; + if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16) + { + /* For structures smaller than 16 bytes we clobber memory + in 8 byte increments. Make a copy so we don't clobber + the callers memory outside of the struct bounds. */ + rvalue_copy = alloca(16); + copy_rvalue = 1; + } + else if (cif->rtype->type == FFI_TYPE_FLOAT + && (cif->abi == FFI_N64_SOFT_FLOAT + || cif->abi == FFI_N32_SOFT_FLOAT)) + { + rvalue_copy = alloca (8); + copy_rvalue = 1; +#if defined(__MIPSEB__) || defined(_MIPSEB) + copy_offset = 4; +#endif + } + ffi_call_N32(ffi_prep_args, &ecif, cif->bytes, + cif->flags, rvalue_copy, fn, closure); + if (copy_rvalue) + memcpy(ecif.rvalue, rvalue_copy + copy_offset, cif->rtype->size); + } + break; +#endif + + default: + FFI_ASSERT(0); + break; + } +} + +void +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + + +#if FFI_CLOSURES +#if defined(FFI_MIPS_O32) +extern void ffi_closure_O32(void); +extern void ffi_go_closure_O32(void); +#else +extern void ffi_closure_N32(void); +extern void ffi_go_closure_N32(void); +#endif /* FFI_MIPS_O32 */ + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + void * fn; + char *clear_location = (char *) codeloc; + +#if defined(FFI_MIPS_O32) + if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT) + return FFI_BAD_ABI; + fn = ffi_closure_O32; +#else +#if _MIPS_SIM ==_ABIN32 + if (cif->abi != FFI_N32 + && cif->abi != FFI_N32_SOFT_FLOAT) + return FFI_BAD_ABI; +#else + if (cif->abi != FFI_N64 + && cif->abi != FFI_N64_SOFT_FLOAT) + return FFI_BAD_ABI; +#endif + fn = ffi_closure_N32; +#endif /* FFI_MIPS_O32 */ + +#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32) + /* lui $25,high(fn) */ + tramp[0] = 0x3c190000 | ((unsigned)fn >> 16); + /* ori $25,low(fn) */ + tramp[1] = 0x37390000 | ((unsigned)fn & 0xffff); + /* lui $12,high(codeloc) */ + tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16); + /* jr $25 */ +#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) + tramp[3] = 0x03200008; +#else + tramp[3] = 0x03200009; +#endif + /* ori $12,low(codeloc) */ + tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff); +#else + /* N64 has a somewhat larger trampoline. */ + /* lui $25,high(fn) */ + tramp[0] = 0x3c190000 | ((unsigned long)fn >> 48); + /* lui $12,high(codeloc) */ + tramp[1] = 0x3c0c0000 | ((unsigned long)codeloc >> 48); + /* ori $25,mid-high(fn) */ + tramp[2] = 0x37390000 | (((unsigned long)fn >> 32 ) & 0xffff); + /* ori $12,mid-high(codeloc) */ + tramp[3] = 0x358c0000 | (((unsigned long)codeloc >> 32) & 0xffff); + /* dsll $25,$25,16 */ + tramp[4] = 0x0019cc38; + /* dsll $12,$12,16 */ + tramp[5] = 0x000c6438; + /* ori $25,mid-low(fn) */ + tramp[6] = 0x37390000 | (((unsigned long)fn >> 16 ) & 0xffff); + /* ori $12,mid-low(codeloc) */ + tramp[7] = 0x358c0000 | (((unsigned long)codeloc >> 16) & 0xffff); + /* dsll $25,$25,16 */ + tramp[8] = 0x0019cc38; + /* dsll $12,$12,16 */ + tramp[9] = 0x000c6438; + /* ori $25,low(fn) */ + tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff); + /* jr $25 */ +#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) + tramp[11] = 0x03200008; +#else + tramp[11] = 0x03200009; +#endif + /* ori $12,low(codeloc) */ + tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff); + +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + +#if !defined(__FreeBSD__) +#ifdef USE__BUILTIN___CLEAR_CACHE + __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); +#else + cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); +#endif +#endif /* ! __FreeBSD__ */ + return FFI_OK; +} + +/* + * Decodes the arguments to a function, which will be stored on the + * stack. AR is the pointer to the beginning of the integer arguments + * (and, depending upon the arguments, some floating-point arguments + * as well). FPR is a pointer to the area where floating point + * registers have been saved, if any. + * + * RVALUE is the location where the function return value will be + * stored. CLOSURE is the prepared closure to invoke. + * + * This function should only be called from assembly, which is in + * turn called from a trampoline. + * + * Returns the function return type. + * + * Based on the similar routine for sparc. + */ +int +ffi_closure_mips_inner_O32 (ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *rvalue, ffi_arg *ar, + double *fpr) +{ + void **avaluep; + ffi_arg *avalue; + ffi_type **arg_types; + int i, avn, argn, seen_int; + + avalue = alloca (cif->nargs * sizeof (ffi_arg)); + avaluep = alloca (cif->nargs * sizeof (ffi_arg)); + + seen_int = (cif->abi == FFI_O32_SOFT_FLOAT) || (cif->mips_nfixedargs != cif->nargs); + argn = 0; + + if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT) + { + rvalue = (void *)(uintptr_t)ar[0]; + argn = 1; + seen_int = 1; + } + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + while (i < avn) + { + if (arg_types[i]->alignment == 8 && (argn & 0x1)) + argn++; + if (i < 2 && !seen_int && + (arg_types[i]->type == FFI_TYPE_FLOAT || + arg_types[i]->type == FFI_TYPE_DOUBLE || + arg_types[i]->type == FFI_TYPE_LONGDOUBLE)) + { +#if defined(__MIPSEB__) || defined(_MIPSEB) + if (arg_types[i]->type == FFI_TYPE_FLOAT) + avaluep[i] = ((char *) &fpr[i]) + sizeof (float); + else +#endif + avaluep[i] = (char *) &fpr[i]; + } + else + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + avaluep[i] = &avalue[i]; + *(SINT8 *) &avalue[i] = (SINT8) ar[argn]; + break; + + case FFI_TYPE_UINT8: + avaluep[i] = &avalue[i]; + *(UINT8 *) &avalue[i] = (UINT8) ar[argn]; + break; + + case FFI_TYPE_SINT16: + avaluep[i] = &avalue[i]; + *(SINT16 *) &avalue[i] = (SINT16) ar[argn]; + break; + + case FFI_TYPE_UINT16: + avaluep[i] = &avalue[i]; + *(UINT16 *) &avalue[i] = (UINT16) ar[argn]; + break; + + default: + avaluep[i] = (char *) &ar[argn]; + break; + } + seen_int = 1; + } + argn += FFI_ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + i++; + } + + /* Invoke the closure. */ + fun(cif, rvalue, avaluep, user_data); + + if (cif->abi == FFI_O32_SOFT_FLOAT) + { + switch (cif->rtype->type) + { + case FFI_TYPE_FLOAT: + return FFI_TYPE_INT; + case FFI_TYPE_DOUBLE: + return FFI_TYPE_UINT64; + default: + return cif->rtype->type; + } + } + else + { + return cif->rtype->type; + } +} + +#if defined(FFI_MIPS_N32) + +static void +copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type, + int argn, unsigned arg_offset, ffi_arg *ar, + ffi_arg *fpr, int soft_float) +{ + ffi_type **elt_typep = type->elements; + while(*elt_typep) + { + ffi_type *elt_type = *elt_typep; + unsigned o; + char *tp; + char *argp; + char *fpp; + + o = FFI_ALIGN(offset, elt_type->alignment); + arg_offset += o - offset; + offset = o; + argn += arg_offset / sizeof(ffi_arg); + arg_offset = arg_offset % sizeof(ffi_arg); + + argp = (char *)(ar + argn); + fpp = (char *)(argn >= 8 ? ar + argn : fpr + argn); + + tp = target + offset; + + if (elt_type->type == FFI_TYPE_DOUBLE && !soft_float) + *(double *)tp = *(double *)fpp; + else + memcpy(tp, argp + arg_offset, elt_type->size); + + offset += elt_type->size; + arg_offset += elt_type->size; + elt_typep++; + argn += arg_offset / sizeof(ffi_arg); + arg_offset = arg_offset % sizeof(ffi_arg); + } +} + +/* + * Decodes the arguments to a function, which will be stored on the + * stack. AR is the pointer to the beginning of the integer + * arguments. FPR is a pointer to the area where floating point + * registers have been saved. + * + * RVALUE is the location where the function return value will be + * stored. CLOSURE is the prepared closure to invoke. + * + * This function should only be called from assembly, which is in + * turn called from a trampoline. + * + * Returns the function return flags. + * + */ +int +ffi_closure_mips_inner_N32 (ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *rvalue, ffi_arg *ar, + ffi_arg *fpr) +{ + void **avaluep; + ffi_arg *avalue; + ffi_type **arg_types; + int i, avn, argn; + int soft_float; + ffi_arg *argp; + + soft_float = cif->abi == FFI_N64_SOFT_FLOAT + || cif->abi == FFI_N32_SOFT_FLOAT; + avalue = alloca (cif->nargs * sizeof (ffi_arg)); + avaluep = alloca (cif->nargs * sizeof (ffi_arg)); + + argn = 0; + + if (cif->rstruct_flag) + { +#if _MIPS_SIM==_ABIN32 + rvalue = (void *)(UINT32)ar[0]; +#else /* N64 */ + rvalue = (void *)ar[0]; +#endif + argn = 1; + } + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + while (i < avn) + { + if (arg_types[i]->type == FFI_TYPE_FLOAT + || arg_types[i]->type == FFI_TYPE_DOUBLE + || arg_types[i]->type == FFI_TYPE_LONGDOUBLE) + { + argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; + if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((uintptr_t)argp & (arg_types[i]->alignment-1))) + { + argp=(ffi_arg*)FFI_ALIGN(argp,arg_types[i]->alignment); + argn++; + } +#if defined(__MIPSEB__) || defined(_MIPSEB) + if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8) + avaluep[i] = ((char *) argp) + sizeof (float); + else +#endif + avaluep[i] = (char *) argp; + } + else + { + unsigned type = arg_types[i]->type; + + if (arg_types[i]->alignment > sizeof(ffi_arg)) + argn = FFI_ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg)); + + argp = ar + argn; + + /* The size of a pointer depends on the ABI */ + if (type == FFI_TYPE_POINTER) + type = (cif->abi == FFI_N64 || cif->abi == FFI_N64_SOFT_FLOAT) + ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32; + + if (soft_float && type == FFI_TYPE_FLOAT) + type = FFI_TYPE_UINT32; + + switch (type) + { + case FFI_TYPE_SINT8: + avaluep[i] = &avalue[i]; + *(SINT8 *) &avalue[i] = (SINT8) *argp; + break; + + case FFI_TYPE_UINT8: + avaluep[i] = &avalue[i]; + *(UINT8 *) &avalue[i] = (UINT8) *argp; + break; + + case FFI_TYPE_SINT16: + avaluep[i] = &avalue[i]; + *(SINT16 *) &avalue[i] = (SINT16) *argp; + break; + + case FFI_TYPE_UINT16: + avaluep[i] = &avalue[i]; + *(UINT16 *) &avalue[i] = (UINT16) *argp; + break; + + case FFI_TYPE_SINT32: + avaluep[i] = &avalue[i]; + *(SINT32 *) &avalue[i] = (SINT32) *argp; + break; + + case FFI_TYPE_UINT32: + avaluep[i] = &avalue[i]; + *(UINT32 *) &avalue[i] = (UINT32) *argp; + break; + + case FFI_TYPE_STRUCT: + if (argn < 8) + { + /* Allocate space for the struct as at least part of + it was passed in registers. */ + avaluep[i] = alloca(arg_types[i]->size); + copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i], + argn, 0, ar, fpr, i >= cif->mips_nfixedargs || soft_float); + + break; + } + /* Else fall through. */ + default: + avaluep[i] = (char *) argp; + break; + } + } + argn += FFI_ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg); + i++; + } + + /* Invoke the closure. */ + fun (cif, rvalue, avaluep, user_data); + + return cif->flags >> (FFI_FLAG_BITS * 8); +} + +#endif /* FFI_MIPS_N32 */ + +#if defined(FFI_MIPS_O32) +extern void ffi_closure_O32(void); +extern void ffi_go_closure_O32(void); +#else +extern void ffi_closure_N32(void); +extern void ffi_go_closure_N32(void); +#endif /* FFI_MIPS_O32 */ + +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*)) +{ + void * fn; + +#if defined(FFI_MIPS_O32) + if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT) + return FFI_BAD_ABI; + fn = ffi_go_closure_O32; +#else +#if _MIPS_SIM ==_ABIN32 + if (cif->abi != FFI_N32 + && cif->abi != FFI_N32_SOFT_FLOAT) + return FFI_BAD_ABI; +#else + if (cif->abi != FFI_N64 + && cif->abi != FFI_N64_SOFT_FLOAT) + return FFI_BAD_ABI; +#endif + fn = ffi_go_closure_N32; +#endif /* FFI_MIPS_O32 */ + + closure->tramp = (void *)fn; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +#endif /* FFI_CLOSURES */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffitarget.h new file mode 100644 index 0000000..fdd5ca9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/ffitarget.h @@ -0,0 +1,244 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for MIPS. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifdef __linux__ +# include +#elif defined(__rtems__) +/* + * Subprogram calling convention - copied from sgidefs.h + */ +#define _MIPS_SIM_ABI32 1 +#define _MIPS_SIM_NABI32 2 +#define _MIPS_SIM_ABI64 3 +#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) +# include +#endif + +# ifndef _ABIN32 +# define _ABIN32 _MIPS_SIM_NABI32 +# endif +# ifndef _ABI64 +# define _ABI64 _MIPS_SIM_ABI64 +# endif +# ifndef _ABIO32 +# define _ABIO32 _MIPS_SIM_ABI32 +# endif + +#if !defined(_MIPS_SIM) +# error -- something is very wrong -- +#else +# if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64)) +# define FFI_MIPS_N32 +# else +# if (_MIPS_SIM==_ABIO32 && defined(_ABIO32)) +# define FFI_MIPS_O32 +# else +# error -- this is an unsupported platform -- +# endif +# endif +#endif + +#ifdef FFI_MIPS_O32 +/* O32 stack frames have 32bit integer args */ +# define FFI_SIZEOF_ARG 4 +#else +/* N32 and N64 frames have 64bit integer args */ +# define FFI_SIZEOF_ARG 8 +# if _MIPS_SIM == _ABIN32 +# define FFI_SIZEOF_JAVA_RAW 4 +# endif +#endif + +#define FFI_FLAG_BITS 2 + +/* SGI's strange assembler requires that we multiply by 4 rather + than shift left by FFI_FLAG_BITS */ + +#define FFI_ARGS_D FFI_TYPE_DOUBLE +#define FFI_ARGS_F FFI_TYPE_FLOAT +#define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE +#define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT +#define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT +#define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE + +/* Needed for N32 structure returns */ +#define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8 +#define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8 + +#if 0 +/* The SGI assembler can't handle this.. */ +#define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT +/* (and so on) */ +#else +/* ...so we calculate these by hand! */ +#define FFI_TYPE_STRUCT_D 61 +#define FFI_TYPE_STRUCT_F 45 +#define FFI_TYPE_STRUCT_DD 253 +#define FFI_TYPE_STRUCT_FF 173 +#define FFI_TYPE_STRUCT_FD 237 +#define FFI_TYPE_STRUCT_DF 189 +#define FFI_TYPE_STRUCT_SMALL 93 +#define FFI_TYPE_STRUCT_SMALL2 109 + +/* and for n32 soft float, add 16 * 2^4 */ +#define FFI_TYPE_STRUCT_D_SOFT 317 +#define FFI_TYPE_STRUCT_F_SOFT 301 +#define FFI_TYPE_STRUCT_DD_SOFT 509 +#define FFI_TYPE_STRUCT_FF_SOFT 429 +#define FFI_TYPE_STRUCT_FD_SOFT 493 +#define FFI_TYPE_STRUCT_DF_SOFT 445 +#define FFI_TYPE_STRUCT_SOFT 16 +#endif + +#ifdef LIBFFI_ASM +#define v0 $2 +#define v1 $3 +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define a4 $8 +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define t8 $24 +#define t9 $25 +#define ra $31 + +#ifdef FFI_MIPS_O32 +# define REG_L lw +# define REG_S sw +# define SUBU subu +# define ADDU addu +# define SRL srl +# define LI li +#else /* !FFI_MIPS_O32 */ +# define REG_L ld +# define REG_S sd +# define SUBU dsubu +# define ADDU daddu +# define SRL dsrl +# define LI dli +# if (_MIPS_SIM==_ABI64) +# define LA dla +# define EH_FRAME_ALIGN 3 +# define FDE_ADDR_BYTES .8byte +# else +# define LA la +# define EH_FRAME_ALIGN 2 +# define FDE_ADDR_BYTES .4byte +# endif /* _MIPS_SIM==_ABI64 */ +#endif /* !FFI_MIPS_O32 */ +#else /* !LIBFFI_ASM */ +# ifdef __GNUC__ +# ifdef FFI_MIPS_O32 +/* O32 stack frames have 32bit integer args */ +typedef unsigned int ffi_arg __attribute__((__mode__(__SI__))); +typedef signed int ffi_sarg __attribute__((__mode__(__SI__))); +#else +/* N32 and N64 frames have 64bit integer args */ +typedef unsigned int ffi_arg __attribute__((__mode__(__DI__))); +typedef signed int ffi_sarg __attribute__((__mode__(__DI__))); +# endif +# else +# ifdef FFI_MIPS_O32 +/* O32 stack frames have 32bit integer args */ +typedef __uint32_t ffi_arg; +typedef __int32_t ffi_sarg; +# else +/* N32 and N64 frames have 64bit integer args */ +typedef __uint64_t ffi_arg; +typedef __int64_t ffi_sarg; +# endif +# endif /* __GNUC__ */ + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_O32, + FFI_N32, + FFI_N64, + FFI_O32_SOFT_FLOAT, + FFI_N32_SOFT_FLOAT, + FFI_N64_SOFT_FLOAT, + FFI_LAST_ABI, + +#ifdef FFI_MIPS_O32 +#ifdef __mips_soft_float + FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT +#else + FFI_DEFAULT_ABI = FFI_O32 +#endif +#else +# if _MIPS_SIM==_ABI64 +# ifdef __mips_soft_float + FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT +# else + FFI_DEFAULT_ABI = FFI_N64 +# endif +# else +# ifdef __mips_soft_float + FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT +# else + FFI_DEFAULT_ABI = FFI_N32 +# endif +# endif +#endif +} ffi_abi; + +#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag; unsigned mips_nfixedargs +#define FFI_TARGET_SPECIFIC_VARIADIC +#endif /* !LIBFFI_ASM */ + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32) +# define FFI_TRAMPOLINE_SIZE 20 +#else +# define FFI_TRAMPOLINE_SIZE 56 +#endif + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/n32.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/n32.S new file mode 100644 index 0000000..1a940b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/mips/n32.S @@ -0,0 +1,663 @@ +/* ----------------------------------------------------------------------- + n32.S - Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc. + + MIPS Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +/* Only build this code if we are compiling for n32 */ + +#if defined(FFI_MIPS_N32) + +#define callback a0 +#define bytes a2 +#define flags a3 +#define raddr a4 +#define fn a5 +#define closure a6 + +/* Note: to keep stack 16 byte aligned we need even number slots + used 9 slots here +*/ +#define SIZEOF_FRAME ( 10 * FFI_SIZEOF_ARG ) + +#ifdef __GNUC__ + .abicalls +#endif +#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) + .set mips4 +#endif + .text + .align 2 + .globl ffi_call_N32 + .ent ffi_call_N32 +ffi_call_N32: +.LFB0: + .frame $fp, SIZEOF_FRAME, ra + .mask 0xc0000000,-FFI_SIZEOF_ARG + .fmask 0x00000000,0 + + # Prologue + SUBU $sp, SIZEOF_FRAME # Frame size +.LCFI00: + REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer + REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address +.LCFI01: + move $fp, $sp +.LCFI02: + move t9, callback # callback function pointer + REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes + REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags + REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr + REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn + REG_S closure, 6*FFI_SIZEOF_ARG($fp) # closure + + # Allocate at least 4 words in the argstack + move v0, bytes + bge bytes, 4 * FFI_SIZEOF_ARG, bigger + LI v0, 4 * FFI_SIZEOF_ARG + b sixteen + + bigger: + ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned + and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry. + +sixteen: + SUBU $sp, $sp, v0 # move the stack pointer to reflect the + # arg space + + move a0, $sp # 4 * FFI_SIZEOF_ARG + ADDU a3, $fp, 3 * FFI_SIZEOF_ARG + + # Call ffi_prep_args + jal t9 + + # Copy the stack pointer to t9 + move t9, $sp + + # Fix the stack if there are more than 8 64bit slots worth + # of arguments. + + # Load the number of bytes + REG_L t6, 2*FFI_SIZEOF_ARG($fp) + + # Is it bigger than 8 * FFI_SIZEOF_ARG? + daddiu t8, t6, -(8 * FFI_SIZEOF_ARG) + bltz t8, loadregs + + ADDU t9, t9, t8 + +loadregs: + + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + +#ifdef __mips_soft_float + REG_L a0, 0*FFI_SIZEOF_ARG(t9) + REG_L a1, 1*FFI_SIZEOF_ARG(t9) + REG_L a2, 2*FFI_SIZEOF_ARG(t9) + REG_L a3, 3*FFI_SIZEOF_ARG(t9) + REG_L a4, 4*FFI_SIZEOF_ARG(t9) + REG_L a5, 5*FFI_SIZEOF_ARG(t9) + REG_L a6, 6*FFI_SIZEOF_ARG(t9) + REG_L a7, 7*FFI_SIZEOF_ARG(t9) +#else + and t4, t6, ((1< +#include + +/* Only build this code if we are compiling for o32 */ + +#if defined(FFI_MIPS_O32) + +#define callback a0 +#define bytes a2 +#define flags a3 + +#define SIZEOF_FRAME (4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG) +#define A3_OFF (SIZEOF_FRAME + 3 * FFI_SIZEOF_ARG) +#define FP_OFF (SIZEOF_FRAME - 2 * FFI_SIZEOF_ARG) +#define RA_OFF (SIZEOF_FRAME - 1 * FFI_SIZEOF_ARG) + + .abicalls + .text + .align 2 + .globl ffi_call_O32 + .ent ffi_call_O32 +ffi_call_O32: +$LFB0: + # Prologue + SUBU $sp, SIZEOF_FRAME # Frame size +$LCFI00: + REG_S $fp, FP_OFF($sp) # Save frame pointer +$LCFI01: + REG_S ra, RA_OFF($sp) # Save return address +$LCFI02: + move $fp, $sp + +$LCFI03: + move t9, callback # callback function pointer + REG_S flags, A3_OFF($fp) # flags + + # Allocate at least 4 words in the argstack + LI v0, 4 * FFI_SIZEOF_ARG + blt bytes, v0, sixteen + + ADDU v0, bytes, 7 # make sure it is aligned + and v0, -8 # to an 8 byte boundry + +sixteen: + SUBU $sp, v0 # move the stack pointer to reflect the + # arg space + + ADDU a0, $sp, 4 * FFI_SIZEOF_ARG + + jalr t9 + + REG_L t0, A3_OFF($fp) # load the flags word + SRL t2, t0, 4 # shift our arg info + and t0, ((1<<4)-1) # mask out the return type + + ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args + +#ifndef __mips_soft_float + bnez t0, pass_d # make it quick for int +#endif + REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the + REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) + b call_it + +#ifndef __mips_soft_float +pass_d: + bne t0, FFI_ARGS_D, pass_f + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double + REG_L a3, 3*FFI_SIZEOF_ARG($sp) + b call_it + +pass_f: + bne t0, FFI_ARGS_F, pass_d_d + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) + b call_it + +pass_d_d: + bne t0, FFI_ARGS_DD, pass_f_f + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles + b call_it + +pass_f_f: + bne t0, FFI_ARGS_FF, pass_d_f + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats + REG_L a2, 2*FFI_SIZEOF_ARG($sp) + REG_L a3, 3*FFI_SIZEOF_ARG($sp) + b call_it + +pass_d_f: + bne t0, FFI_ARGS_DF, pass_f_d + l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float + REG_L a3, 3*FFI_SIZEOF_ARG($sp) + b call_it + +pass_f_d: + # assume that the only other combination must be float then double + # bne t0, FFI_ARGS_F_D, call_it + l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args + l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float +#endif + +call_it: + # Load the static chain pointer + REG_L t7, SIZEOF_FRAME + 6*FFI_SIZEOF_ARG($fp) + + # Load the function pointer + REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp) + + # If the return value pointer is NULL, assume no return value. + REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) + beqz t1, noretval + + bne t2, FFI_TYPE_INT, retlonglong + jalr t9 + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) + REG_S v0, 0(t0) + b epilogue + +retlonglong: + # Really any 64-bit int, signed or not. + bne t2, FFI_TYPE_UINT64, retfloat + jalr t9 + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) + REG_S v1, 4(t0) + REG_S v0, 0(t0) + b epilogue + +retfloat: + bne t2, FFI_TYPE_FLOAT, retdouble + jalr t9 + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) +#ifndef __mips_soft_float + s.s $f0, 0(t0) +#else + REG_S v0, 0(t0) +#endif + b epilogue + +retdouble: + bne t2, FFI_TYPE_DOUBLE, noretval + jalr t9 + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) +#ifndef __mips_soft_float + s.d $f0, 0(t0) +#else + REG_S v1, 4(t0) + REG_S v0, 0(t0) +#endif + b epilogue + +noretval: + jalr t9 + + # Epilogue +epilogue: + move $sp, $fp + REG_L $fp, FP_OFF($sp) # Restore frame pointer + REG_L ra, RA_OFF($sp) # Restore return address + ADDU $sp, SIZEOF_FRAME # Fix stack pointer + j ra + +$LFE0: + .end ffi_call_O32 + + +/* ffi_closure_O32. Expects address of the passed-in ffi_closure + in t4 ($12). Stores any arguments passed in registers onto the + stack, then calls ffi_closure_mips_inner_O32, which + then decodes them. + + Stack layout: + + 3 - a3 save + 2 - a2 save + 1 - a1 save + 0 - a0 save, original sp + -1 - ra save + -2 - fp save + -3 - $16 (s0) save + -4 - cprestore + -5 - return value high (v1) + -6 - return value low (v0) + -7 - f14 (le high, be low) + -8 - f14 (le low, be high) + -9 - f12 (le high, be low) + -10 - f12 (le low, be high) + -11 - Called function a5 save + -12 - Called function a4 save + -13 - Called function a3 save + -14 - Called function a2 save + -15 - Called function a1 save + -16 - Called function a0 save, our sp and fp point here + */ + +#define SIZEOF_FRAME2 (16 * FFI_SIZEOF_ARG) +#define A3_OFF2 (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG) +#define A2_OFF2 (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG) +#define A1_OFF2 (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG) +#define A0_OFF2 (SIZEOF_FRAME2 + 0 * FFI_SIZEOF_ARG) +#define RA_OFF2 (SIZEOF_FRAME2 - 1 * FFI_SIZEOF_ARG) +#define FP_OFF2 (SIZEOF_FRAME2 - 2 * FFI_SIZEOF_ARG) +#define S0_OFF2 (SIZEOF_FRAME2 - 3 * FFI_SIZEOF_ARG) +#define GP_OFF2 (SIZEOF_FRAME2 - 4 * FFI_SIZEOF_ARG) +#define V1_OFF2 (SIZEOF_FRAME2 - 5 * FFI_SIZEOF_ARG) +#define V0_OFF2 (SIZEOF_FRAME2 - 6 * FFI_SIZEOF_ARG) +#define FA_1_1_OFF2 (SIZEOF_FRAME2 - 7 * FFI_SIZEOF_ARG) +#define FA_1_0_OFF2 (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG) +#define FA_0_1_OFF2 (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG) +#define FA_0_0_OFF2 (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG) +#define CALLED_A5_OFF2 (SIZEOF_FRAME2 - 11 * FFI_SIZEOF_ARG) +#define CALLED_A4_OFF2 (SIZEOF_FRAME2 - 12 * FFI_SIZEOF_ARG) + + .text + + .align 2 + .globl ffi_go_closure_O32 + .ent ffi_go_closure_O32 +ffi_go_closure_O32: +$LFB1: + # Prologue + .frame $fp, SIZEOF_FRAME2, ra + .set noreorder + .cpload t9 + .set reorder + SUBU $sp, SIZEOF_FRAME2 + .cprestore GP_OFF2 +$LCFI10: + + REG_S $16, S0_OFF2($sp) # Save s0 + REG_S $fp, FP_OFF2($sp) # Save frame pointer + REG_S ra, RA_OFF2($sp) # Save return address +$LCFI11: + + move $fp, $sp +$LCFI12: + + REG_S a0, A0_OFF2($fp) + REG_S a1, A1_OFF2($fp) + REG_S a2, A2_OFF2($fp) + REG_S a3, A3_OFF2($fp) + + # Load ABI enum to s0 + REG_L $16, 4($15) # cif + REG_L $16, 0($16) # abi is first member. + + li $13, 1 # FFI_O32 + bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT + +#ifndef __mips_soft_float + # Store all possible float/double registers. + s.d $f12, FA_0_0_OFF2($fp) + s.d $f14, FA_1_0_OFF2($fp) +#endif +1: + # prepare arguments for ffi_closure_mips_inner_O32 + REG_L a0, 4($15) # cif + REG_L a1, 8($15) # fun + move a2, $15 # user_data = go closure + addu a3, $fp, V0_OFF2 # rvalue + + addu t9, $fp, A0_OFF2 # ar + REG_S t9, CALLED_A4_OFF2($fp) + + addu t9, $fp, FA_0_0_OFF2 #fpr + REG_S t9, CALLED_A5_OFF2($fp) + + b $do_closure + +$LFE1: + .end ffi_go_closure_O32 + + .align 2 + .globl ffi_closure_O32 + .ent ffi_closure_O32 +ffi_closure_O32: +$LFB2: + # Prologue + .frame $fp, SIZEOF_FRAME2, ra + .set noreorder + .cpload t9 + .set reorder + SUBU $sp, SIZEOF_FRAME2 + .cprestore GP_OFF2 +$LCFI20: + REG_S $16, S0_OFF2($sp) # Save s0 + REG_S $fp, FP_OFF2($sp) # Save frame pointer + REG_S ra, RA_OFF2($sp) # Save return address +$LCFI21: + move $fp, $sp + +$LCFI22: + # Store all possible argument registers. If there are more than + # four arguments, then they are stored above where we put a3. + REG_S a0, A0_OFF2($fp) + REG_S a1, A1_OFF2($fp) + REG_S a2, A2_OFF2($fp) + REG_S a3, A3_OFF2($fp) + + # Load ABI enum to s0 + REG_L $16, 20($12) # cif pointer follows tramp. + REG_L $16, 0($16) # abi is first member. + + li $13, 1 # FFI_O32 + bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT + +#ifndef __mips_soft_float + # Store all possible float/double registers. + s.d $f12, FA_0_0_OFF2($fp) + s.d $f14, FA_1_0_OFF2($fp) +#endif +1: + # prepare arguments for ffi_closure_mips_inner_O32 + REG_L a0, 20($12) # cif pointer follows tramp. + REG_L a1, 24($12) # fun + REG_L a2, 28($12) # user_data + addu a3, $fp, V0_OFF2 # rvalue + + addu t9, $fp, A0_OFF2 # ar + REG_S t9, CALLED_A4_OFF2($fp) + + addu t9, $fp, FA_0_0_OFF2 #fpr + REG_S t9, CALLED_A5_OFF2($fp) + +$do_closure: + la t9, ffi_closure_mips_inner_O32 + # Call ffi_closure_mips_inner_O32 to do the work. + jalr t9 + + # Load the return value into the appropriate register. + move $8, $2 + li $9, FFI_TYPE_VOID + beq $8, $9, closure_done + + li $13, 1 # FFI_O32 + bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT + +#ifndef __mips_soft_float + li $9, FFI_TYPE_FLOAT + l.s $f0, V0_OFF2($fp) + beq $8, $9, closure_done + + li $9, FFI_TYPE_DOUBLE + l.d $f0, V0_OFF2($fp) + beq $8, $9, closure_done +#endif +1: + REG_L $3, V1_OFF2($fp) + REG_L $2, V0_OFF2($fp) + +closure_done: + # Epilogue + move $sp, $fp + REG_L $16, S0_OFF2($sp) # Restore s0 + REG_L $fp, FP_OFF2($sp) # Restore frame pointer + REG_L ra, RA_OFF2($sp) # Restore return address + ADDU $sp, SIZEOF_FRAME2 + j ra +$LFE2: + .end ffi_closure_O32 + +/* DWARF-2 unwind info. */ + + .section .eh_frame,"a",@progbits +$Lframe0: + .4byte $LECIE0-$LSCIE0 # Length of Common Information Entry +$LSCIE0: + .4byte 0x0 # CIE Identifier Tag + .byte 0x1 # CIE Version + .ascii "zR\0" # CIE Augmentation + .uleb128 0x1 # CIE Code Alignment Factor + .sleb128 4 # CIE Data Alignment Factor + .byte 0x1f # CIE RA Column + .uleb128 0x1 # Augmentation size + .byte 0x00 # FDE Encoding (absptr) + .byte 0xc # DW_CFA_def_cfa + .uleb128 0x1d + .uleb128 0x0 + .align 2 +$LECIE0: + +$LSFDE0: + .4byte $LEFDE0-$LASFDE0 # FDE Length +$LASFDE0: + .4byte $LASFDE0-$Lframe0 # FDE CIE offset + .4byte $LFB0 # FDE initial location + .4byte $LFE0-$LFB0 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI00-$LFB0 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0x18 + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI01-$LCFI00 + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1e # $fp + .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1f # $ra + .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI02-$LCFI01 + .byte 0xc # DW_CFA_def_cfa + .uleb128 0x1e + .uleb128 0x18 + .align 2 +$LEFDE0: + +$LSFDE1: + .4byte $LEFDE1-$LASFDE1 # FDE Length +$LASFDE1: + .4byte $LASFDE1-$Lframe0 # FDE CIE offset + .4byte $LFB1 # FDE initial location + .4byte $LFE1-$LFB1 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI10-$LFB1 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 SIZEOF_FRAME2 + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI11-$LCFI10 + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x10 # $16 + .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp) + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1e # $fp + .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1f # $ra + .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI12-$LCFI11 + .byte 0xc # DW_CFA_def_cfa + .uleb128 0x1e + .uleb128 SIZEOF_FRAME2 + .align 2 +$LEFDE1: + +$LSFDE2: + .4byte $LEFDE2-$LASFDE2 # FDE Length +$LASFDE2: + .4byte $LASFDE2-$Lframe0 # FDE CIE offset + .4byte $LFB2 # FDE initial location + .4byte $LFE2-$LFB2 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI20-$LFB2 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 SIZEOF_FRAME2 + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI21-$LCFI20 + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x10 # $16 + .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp) + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1e # $fp + .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x1f # $ra + .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) + .byte 0x4 # DW_CFA_advance_loc4 + .4byte $LCFI22-$LCFI21 + .byte 0xc # DW_CFA_def_cfa + .uleb128 0x1e + .uleb128 SIZEOF_FRAME2 + .align 2 +$LEFDE2: + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/eabi.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/eabi.S new file mode 100644 index 0000000..10cfb04 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/eabi.S @@ -0,0 +1,101 @@ +/* ----------------------------------------------------------------------- + eabi.S - Copyright (c) 2012, 2013 Anthony Green + + Moxie Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + .globl ffi_prep_args_EABI + + .text + .p2align 4 + .globl ffi_call_EABI + .type ffi_call_EABI, @function + + # $r0 : ffi_prep_args + # $r1 : &ecif + # $r2 : cif->bytes + # $r3 : fig->flags + # $r4 : ecif.rvalue + # $r5 : fn + +ffi_call_EABI: + push $sp, $r6 + push $sp, $r7 + push $sp, $r8 + dec $sp, 24 + + /* Store incoming args on stack. */ + sto.l 0($sp), $r0 /* ffi_prep_args */ + sto.l 4($sp), $r1 /* ecif */ + sto.l 8($sp), $r2 /* bytes */ + sto.l 12($sp), $r3 /* flags */ + sto.l 16($sp), $r4 /* &rvalue */ + sto.l 20($sp), $r5 /* fn */ + + /* Call ffi_prep_args. */ + mov $r6, $r4 /* Save result buffer */ + mov $r7, $r5 /* Save the target fn */ + mov $r8, $r3 /* Save the flags */ + sub $sp, $r2 /* Allocate stack space */ + mov $r0, $sp /* We can stomp over $r0 */ + /* $r1 is already set up */ + jsra ffi_prep_args + + /* Load register arguments. */ + ldo.l $r0, 0($sp) + ldo.l $r1, 4($sp) + ldo.l $r2, 8($sp) + ldo.l $r3, 12($sp) + ldo.l $r4, 16($sp) + ldo.l $r5, 20($sp) + + /* Call the target function. */ + jsr $r7 + + ldi.l $r7, 0xffffffff + cmp $r8, $r7 + beq retstruct + + ldi.l $r7, 4 + cmp $r8, $r7 + bgt ret2reg + + st.l ($r6), $r0 + jmpa retdone + +ret2reg: + st.l ($r6), $r0 + sto.l 4($r6), $r1 + +retstruct: +retdone: + /* Return. */ + ldo.l $r6, -4($fp) + ldo.l $r7, -8($fp) + ldo.l $r8, -12($fp) + ret + .size ffi_call_EABI, .-ffi_call_EABI + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffi.c new file mode 100644 index 0000000..16d2bb3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffi.c @@ -0,0 +1,285 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (C) 2012, 2013, 2018 Anthony Green + + Moxie Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void *ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + register int count = 0; + + p_argv = ecif->avalue; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += 4; + } + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); + i--, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + + if ((*p_arg)->type == FFI_TYPE_STRUCT) + { + z = sizeof(void*); + *(void **) argp = *p_argv; + } + else if (z < sizeof(int)) + { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof(int)) + { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + count += z; + } + + return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8))); +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + if (cif->rtype->type == FFI_TYPE_STRUCT) + cif->flags = -1; + else + cif->flags = cif->rtype->size; + + cif->bytes = FFI_ALIGN (cif->bytes, 8); + + return FFI_OK; +} + +extern void ffi_call_EABI(void *(*)(char *, extended_cif *), + extended_cif *, + unsigned, unsigned, + unsigned *, + void (*fn)(void)); + +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_EABI: + ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + default: + FFI_ASSERT(0); + break; + } +} + +void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, + unsigned arg4, unsigned arg5, unsigned arg6) +{ + /* This function is called by a trampoline. The trampoline stows a + pointer to the ffi_closure object in $r12. We must save this + pointer in a place that will persist while we do our work. */ + register ffi_closure *creg __asm__ ("$r12"); + ffi_closure *closure = creg; + + /* Arguments that don't fit in registers are found on the stack + at a fixed offset above the current frame pointer. */ + register char *frame_pointer __asm__ ("$fp"); + + /* Pointer to a struct return value. */ + void *struct_rvalue = (void *) arg1; + + /* 6 words reserved for register args + 3 words from jsr */ + char *stack_args = frame_pointer + 9*4; + + /* Lay the register arguments down in a continuous chunk of memory. */ + unsigned register_args[6] = + { arg1, arg2, arg3, arg4, arg5, arg6 }; + char *register_args_ptr = (char *) register_args; + + ffi_cif *cif = closure->cif; + ffi_type **arg_types = cif->arg_types; + void **avalue = alloca (cif->nargs * sizeof(void *)); + char *ptr = (char *) register_args; + int i; + + /* preserve struct type return pointer passing */ + if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { + ptr += 4; + register_args_ptr = (char *)®ister_args[1]; + } + + /* Find the address of each argument. */ + for (i = 0; i < cif->nargs; i++) + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = ptr + 3; + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = ptr + 2; + break; + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_POINTER: + avalue[i] = ptr; + break; + case FFI_TYPE_STRUCT: + avalue[i] = *(void**)ptr; + break; + default: + /* This is an 8-byte value. */ + if (ptr == (char *) ®ister_args[5]) + { + /* The value is split across two locations */ + unsigned *ip = alloca(8); + avalue[i] = ip; + ip[0] = *(unsigned *) ptr; + ip[1] = *(unsigned *) stack_args; + } + else + { + avalue[i] = ptr; + } + ptr += 4; + break; + } + ptr += 4; + + /* If we've handled more arguments than fit in registers, + start looking at the those passed on the stack. */ + if (ptr == (char *) ®ister_args[6]) + ptr = stack_args; + else if (ptr == (char *) ®ister_args[7]) + ptr = stack_args + 4; + } + + /* Invoke the closure. */ + if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT)) + { + (closure->fun) (cif, struct_rvalue, avalue, closure->user_data); + } + else + { + /* Allocate space for the return value and call the function. */ + long long rvalue; + (closure->fun) (cif, &rvalue, avalue, closure->user_data); + asm ("mov $r12, %0\n ld.l $r0, ($r12)\n ldo.l $r1, 4($r12)" : : "r" (&rvalue)); + } +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned short *tramp = (unsigned short *) &closure->tramp[0]; + unsigned long fn = (long) ffi_closure_eabi; + unsigned long cls = (long) codeloc; + + if (cif->abi != FFI_EABI) + return FFI_BAD_ABI; + + fn = (unsigned long) ffi_closure_eabi; + + tramp[0] = 0x01e0; /* ldi.l $r12, .... */ + tramp[1] = cls >> 16; + tramp[2] = cls & 0xffff; + tramp[3] = 0x1a00; /* jmpa .... */ + tramp[4] = fn >> 16; + tramp[5] = fn & 0xffff; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffitarget.h new file mode 100644 index 0000000..623e3ec --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/moxie/ffitarget.h @@ -0,0 +1,52 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012, 2013 Anthony Green + Target configuration macros for Moxie + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_EABI, + FFI_DEFAULT_ABI = FFI_EABI, + FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +/* Trampolines are 12-bytes long. See ffi_prep_closure_loc. */ +#define FFI_TRAMPOLINE_SIZE (12) + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffi.c new file mode 100644 index 0000000..721080d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffi.c @@ -0,0 +1,304 @@ +/* libffi support for Altera Nios II. + + Copyright (c) 2013 Mentor Graphics. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +#include +#include + +#include + +/* The Nios II Processor Reference Handbook defines the procedure call + ABI as follows. + + Arguments are passed as if a structure containing the types of + the arguments were constructed. The first 16 bytes are passed in r4 + through r7, the remainder on the stack. The first 16 bytes of a function + taking variable arguments are passed in r4-r7 in the same way. + + Return values of types up to 8 bytes are returned in r2 and r3. For + return values greater than 8 bytes, the caller must allocate memory for + the result and pass the address as if it were argument 0. + + While this isn't specified explicitly in the ABI documentation, GCC + promotes integral arguments smaller than int size to 32 bits. + + Also of note, the ABI specifies that all structure objects are + aligned to 32 bits even if all their fields have a smaller natural + alignment. See FFI_AGGREGATE_ALIGNMENT. */ + + +/* Declare the assembly language hooks. */ + +extern UINT64 ffi_call_sysv (void (*) (char *, extended_cif *), + extended_cif *, + unsigned, + void (*fn) (void)); +extern void ffi_closure_sysv (void); + +/* Perform machine-dependent cif processing. */ + +ffi_status ffi_prep_cif_machdep (ffi_cif *cif) +{ + /* We always want at least 16 bytes in the parameter block since it + simplifies the low-level call function. Also round the parameter + block size up to a multiple of 4 bytes to preserve + 32-bit alignment of the stack pointer. */ + if (cif->bytes < 16) + cif->bytes = 16; + else + cif->bytes = (cif->bytes + 3) & ~3; + + return FFI_OK; +} + + +/* ffi_prep_args is called by the assembly routine to transfer arguments + to the stack using the pointers in the ecif array. + Note that the stack buffer is big enough to fit all the arguments, + but the first 16 bytes will be copied to registers for the actual + call. */ + +void ffi_prep_args (char *stack, extended_cif *ecif) +{ + char *argp = stack; + unsigned int i; + + /* The implicit return value pointer is passed as if it were a hidden + first argument. */ + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT + && ecif->cif->rtype->size > 8) + { + (*(void **) argp) = ecif->rvalue; + argp += 4; + } + + for (i = 0; i < ecif->cif->nargs; i++) + { + void *avalue = ecif->avalue[i]; + ffi_type *atype = ecif->cif->arg_types[i]; + size_t size = atype->size; + size_t alignment = atype->alignment; + + /* Align argp as appropriate for the argument type. */ + if ((alignment - 1) & (unsigned) argp) + argp = (char *) FFI_ALIGN (argp, alignment); + + /* Copy the argument, promoting integral types smaller than a + word to word size. */ + if (size < sizeof (int)) + { + size = sizeof (int); + switch (atype->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) avalue; + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int) *(UINT8 *) avalue; + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) avalue; + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) *(UINT16 *) avalue; + break; + + case FFI_TYPE_STRUCT: + memcpy (argp, avalue, atype->size); + break; + + default: + FFI_ASSERT(0); + } + } + else if (size == sizeof (int)) + *(unsigned int *) argp = (unsigned int) *(UINT32 *) avalue; + else + memcpy (argp, avalue, size); + argp += size; + } +} + + +/* Call FN using the prepared CIF. RVALUE points to space allocated by + the caller for the return value, and AVALUE is an array of argument + pointers. */ + +void ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + + extended_cif ecif; + UINT64 result; + + /* If bigret is true, this is the case where a return value of larger + than 8 bytes is handled by being passed by reference as an implicit + argument. */ + int bigret = (cif->rtype->type == FFI_TYPE_STRUCT + && cif->rtype->size > 8); + + ecif.cif = cif; + ecif.avalue = avalue; + + /* Allocate space for return value if this is the pass-by-reference case + and the caller did not provide a buffer. */ + if (rvalue == NULL && bigret) + ecif.rvalue = alloca (cif->rtype->size); + else + ecif.rvalue = rvalue; + + result = ffi_call_sysv (ffi_prep_args, &ecif, cif->bytes, fn); + + /* Now result contains the 64 bit contents returned from fn in + r2 and r3. Copy the value of the appropriate size to the user-provided + rvalue buffer. */ + if (rvalue && !bigret) + switch (cif->rtype->size) + { + case 1: + *(UINT8 *)rvalue = (UINT8) result; + break; + case 2: + *(UINT16 *)rvalue = (UINT16) result; + break; + case 4: + *(UINT32 *)rvalue = (UINT32) result; + break; + case 8: + *(UINT64 *)rvalue = (UINT64) result; + break; + default: + memcpy (rvalue, (void *)&result, cif->rtype->size); + break; + } +} + +/* This function is invoked from the closure trampoline to invoke + CLOSURE with argument block ARGS. Parse ARGS according to + CLOSURE->cfi and invoke CLOSURE->fun. */ + +static UINT64 +ffi_closure_helper (unsigned char *args, + ffi_closure *closure) +{ + ffi_cif *cif = closure->cif; + unsigned char *argp = args; + void **parsed_args = alloca (cif->nargs * sizeof (void *)); + UINT64 result; + void *retptr; + unsigned int i; + + /* First figure out what to do about the return type. If this is the + big-structure-return case, the first arg is the hidden return buffer + allocated by the caller. */ + if (cif->rtype->type == FFI_TYPE_STRUCT + && cif->rtype->size > 8) + { + retptr = *((void **) argp); + argp += 4; + } + else + retptr = (void *) &result; + + /* Fill in the array of argument pointers. */ + for (i = 0; i < cif->nargs; i++) + { + size_t size = cif->arg_types[i]->size; + size_t alignment = cif->arg_types[i]->alignment; + + /* Align argp as appropriate for the argument type. */ + if ((alignment - 1) & (unsigned) argp) + argp = (char *) FFI_ALIGN (argp, alignment); + + /* Arguments smaller than an int are promoted to int. */ + if (size < sizeof (int)) + size = sizeof (int); + + /* Store the pointer. */ + parsed_args[i] = argp; + argp += size; + } + + /* Call the user-supplied function. */ + (closure->fun) (cif, retptr, parsed_args, closure->user_data); + return result; +} + + +/* Initialize CLOSURE with a trampoline to call FUN with + CIF and USER_DATA. */ +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun) (ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + int i; + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + /* The trampoline looks like: + movhi r8, %hi(ffi_closure_sysv) + ori r8, r8, %lo(ffi_closure_sysv) + movhi r9, %hi(ffi_closure_helper) + ori r0, r9, %lo(ffi_closure_helper) + movhi r10, %hi(closure) + ori r10, r10, %lo(closure) + jmp r8 + and then ffi_closure_sysv retrieves the closure pointer out of r10 + in addition to the arguments passed in the normal way for the call, + and invokes ffi_closure_helper. We encode the pointer to + ffi_closure_helper in the trampoline because making a PIC call + to it in ffi_closure_sysv would be messy (it would have to indirect + through the GOT). */ + +#define HI(x) ((((unsigned int) (x)) >> 16) & 0xffff) +#define LO(x) (((unsigned int) (x)) & 0xffff) + tramp[0] = (0 << 27) | (8 << 22) | (HI (ffi_closure_sysv) << 6) | 0x34; + tramp[1] = (8 << 27) | (8 << 22) | (LO (ffi_closure_sysv) << 6) | 0x14; + tramp[2] = (0 << 27) | (9 << 22) | (HI (ffi_closure_helper) << 6) | 0x34; + tramp[3] = (9 << 27) | (9 << 22) | (LO (ffi_closure_helper) << 6) | 0x14; + tramp[4] = (0 << 27) | (10 << 22) | (HI (closure) << 6) | 0x34; + tramp[5] = (10 << 27) | (10 << 22) | (LO (closure) << 6) | 0x14; + tramp[6] = (8 << 27) | (0x0d << 11) | 0x3a; +#undef HI +#undef LO + + /* Flush the caches. + See Example 9-4 in the Nios II Software Developer's Handbook. */ + for (i = 0; i < 7; i++) + asm volatile ("flushd 0(%0); flushi %0" :: "r"(tramp + i) : "memory"); + asm volatile ("flushp" ::: "memory"); + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffitarget.h new file mode 100644 index 0000000..134d118 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/ffitarget.h @@ -0,0 +1,52 @@ +/* libffi target includes for Altera Nios II. + + Copyright (c) 2013 Mentor Graphics. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +/* Structures have a 4-byte alignment even if all the fields have lesser + alignment requirements. */ +#define FFI_AGGREGATE_ALIGNMENT 4 + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 28 /* 7 instructions */ +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/sysv.S new file mode 100644 index 0000000..75f442b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/nios2/sysv.S @@ -0,0 +1,136 @@ +/* Low-level libffi support for Altera Nios II. + + Copyright (c) 2013 Mentor Graphics. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* This function is declared on the C side as + + extern UINT64 ffi_call_sysv (void (*arghook) (char *, extended_cif *), + extended_cif *ecif, + unsigned nbytes, + void (*fn) (void)); + + On input, the arguments appear as + r4 = arghook + r5 = ecif + r6 = nbytes + r7 = fn +*/ + + .section .text + .align 2 + .global ffi_call_sysv + .type ffi_call_sysv, @function + +ffi_call_sysv: + .cfi_startproc + + /* Create the stack frame, saving r16 so we can use it locally. */ + addi sp, sp, -12 + .cfi_def_cfa_offset 12 + stw ra, 8(sp) + stw fp, 4(sp) + stw r16, 0(sp) + .cfi_offset 31, -4 + .cfi_offset 28, -8 + .cfi_offset 16, -12 + mov fp, sp + .cfi_def_cfa_register 28 + mov r16, r7 + + /* Adjust the stack pointer to create the argument buffer + nbytes long. */ + sub sp, sp, r6 + + /* Call the arghook function. */ + mov r2, r4 /* fn */ + mov r4, sp /* argbuffer */ + callr r2 /* r5 already contains ecif */ + + /* Pop off the first 16 bytes of the argument buffer on the stack, + transferring the contents to the argument registers. */ + ldw r4, 0(sp) + ldw r5, 4(sp) + ldw r6, 8(sp) + ldw r7, 12(sp) + addi sp, sp, 16 + + /* Call the user function, which leaves its result in r2 and r3. */ + callr r16 + + /* Pop off the stack frame. */ + mov sp, fp + ldw ra, 8(sp) + ldw fp, 4(sp) + ldw r16, 0(sp) + addi sp, sp, 12 + ret + .cfi_endproc + .size ffi_call_sysv, .-ffi_call_sysv + + +/* Closure trampolines jump here after putting the C helper address + in r9 and the closure pointer in r10. The user-supplied arguments + to the closure are in the normal places, in r4-r7 and on the + stack. Push the register arguments on the stack too and then call the + C helper function to deal with them. */ + + .section .text + .align 2 + .global ffi_closure_sysv + .type ffi_closure_sysv, @function + +ffi_closure_sysv: + .cfi_startproc + + /* Create the stack frame, pushing the register args on the stack + just below the stack args. This is the same trick illustrated + in Figure 7-3 in the Nios II Processor Reference Handbook, used + for variable arguments and structures passed by value. */ + addi sp, sp, -20 + .cfi_def_cfa_offset 20 + stw ra, 0(sp) + .cfi_offset 31, -20 + stw r4, 4(sp) + .cfi_offset 4, -16 + stw r5, 8(sp) + .cfi_offset 5, -12 + stw r6, 12(sp) + .cfi_offset 6, -8 + stw r7, 16(sp) + .cfi_offset 7, -4 + + /* Call the helper. + r4 = pointer to arguments on stack + r5 = closure pointer (loaded in r10 by the trampoline) + r9 = address of helper function (loaded by trampoline) */ + addi r4, sp, 4 + mov r5, r10 + callr r9 + + /* Pop the stack and return. */ + ldw ra, 0(sp) + addi sp, sp, 20 + .cfi_def_cfa_offset -20 + ret + .cfi_endproc + .size ffi_closure_sysv, .-ffi_closure_sysv + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffi.c new file mode 100644 index 0000000..2bad938 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffi.c @@ -0,0 +1,328 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2014 Sebastian Macke + + OpenRISC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include "ffi_common.h" + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void* ffi_prep_args(char *stack, extended_cif *ecif) +{ + char *stacktemp = stack; + int i, s; + ffi_type **arg; + int count = 0; + int nfixedargs; + + nfixedargs = ecif->cif->nfixedargs; + arg = ecif->cif->arg_types; + void **argv = ecif->avalue; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) + { + *(void **) stack = ecif->rvalue; + stack += 4; + count = 4; + } + for(i=0; icif->nargs; i++) + { + + /* variadic args are saved on stack */ + if ((nfixedargs == 0) && (count < 24)) + { + count = 24; + stack = stacktemp + 24; + } + nfixedargs--; + + s = 4; + switch((*arg)->type) + { + case FFI_TYPE_STRUCT: + *(void **)stack = *argv; + break; + + case FFI_TYPE_SINT8: + *(signed int *) stack = (signed int)*(SINT8 *)(* argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) stack = (unsigned int)*(UINT8 *)(* argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) stack = (signed int)*(SINT16 *)(* argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) stack = (unsigned int)*(UINT16 *)(* argv); + break; + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_POINTER: + *(int *)stack = *(int*)(*argv); + break; + + default: /* 8 byte types */ + if (count == 20) /* never split arguments */ + { + stack += 4; + count += 4; + } + s = (*arg)->size; + memcpy(stack, *argv, s); + break; + } + + stack += s; + count += s; + argv++; + arg++; + } + return stacktemp + ((count>24)?24:0); +} + +extern void ffi_call_SYSV(unsigned, + extended_cif *, + void *(*)(int *, extended_cif *), + unsigned *, + void (*fn)(void), + unsigned); + + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + int i; + int size; + ffi_type **arg; + + /* Calculate size to allocate on stack */ + + for(i = 0, arg = cif->arg_types, size=0; i < cif->nargs; i++, arg++) + { + if ((*arg)->type == FFI_TYPE_STRUCT) + size += 4; + else + if ((*arg)->size <= 4) + size += 4; + else + size += 8; + } + + /* for variadic functions more space is needed on the stack */ + if (cif->nargs != cif->nfixedargs) + size += 24; + + if (cif->rtype->type == FFI_TYPE_STRUCT) + size += 4; + + + extended_cif ecif; + ecif.cif = cif; + ecif.avalue = avalue; + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(size, &ecif, ffi_prep_args, rvalue, fn, cif->flags); + break; + default: + FFI_ASSERT(0); + break; + } +} + + +void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, unsigned long r8) +{ + register int *sp __asm__ ("r17"); + register int *r13 __asm__ ("r13"); + + ffi_closure* closure = (ffi_closure*) r13; + char *stack_args = sp; + + /* Lay the register arguments down in a continuous chunk of memory. */ + unsigned register_args[6] = + { r3, r4, r5, r6, r7, r8 }; + + /* Pointer to a struct return value. */ + void *struct_rvalue = (void *) r3; + + ffi_cif *cif = closure->cif; + ffi_type **arg_types = cif->arg_types; + void **avalue = alloca (cif->nargs * sizeof(void *)); + char *ptr = (char *) register_args; + int count = 0; + int nfixedargs = cif->nfixedargs; + int i; + + /* preserve struct type return pointer passing */ + + if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ptr += 4; + count = 4; + } + + /* Find the address of each argument. */ + for (i = 0; i < cif->nargs; i++) + { + + /* variadic args are saved on stack */ + if ((nfixedargs == 0) && (count < 24)) + { + ptr = stack_args; + count = 24; + } + nfixedargs--; + + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = ptr + 3; + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = ptr + 2; + break; + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_POINTER: + avalue[i] = ptr; + break; + + case FFI_TYPE_STRUCT: + avalue[i] = *(void**)ptr; + break; + + default: + /* 8-byte values */ + + /* arguments are never splitted */ + if (ptr == ®ister_args[5]) + ptr = stack_args; + avalue[i] = ptr; + ptr += 4; + count += 4; + break; + } + ptr += 4; + count += 4; + + /* If we've handled more arguments than fit in registers, + start looking at the those passed on the stack. */ + + if (count == 24) + ptr = stack_args; + } + + if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT)) + { + (closure->fun) (cif, struct_rvalue, avalue, closure->user_data); + } else + { + long long rvalue; + (closure->fun) (cif, &rvalue, avalue, closure->user_data); + if (cif->rtype) + asm ("l.ori r12, %0, 0x0\n l.lwz r11, 0(r12)\n l.lwz r12, 4(r12)" : : "r" (&rvalue)); + } +} + + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + unsigned short *tramp = (unsigned short *) closure->tramp; + unsigned long fn = (unsigned long) ffi_closure_SYSV; + unsigned long cls = (unsigned long) codeloc; + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + /* write pointers to temporary registers */ + tramp[0] = (0x6 << 10) | (13 << 5); /* l.movhi r13, ... */ + tramp[1] = cls >> 16; + tramp[2] = (0x2a << 10) | (13 << 5) | 13; /* l.ori r13, r13, ... */ + tramp[3] = cls & 0xFFFF; + + tramp[4] = (0x6 << 10) | (15 << 5); /* l.movhi r15, ... */ + tramp[5] = fn >> 16; + tramp[6] = (0x2a << 10) | (15 << 5) | 15; /* l.ori r15, r15 ... */ + tramp[7] = fn & 0xFFFF; + + tramp[8] = (0x11 << 10); /* l.jr r15 */ + tramp[9] = 15 << 11; + + tramp[10] = (0x2a << 10) | (17 << 5) | 1; /* l.ori r17, r1, ... */ + tramp[11] = 0x0; + + return FFI_OK; +} + + +ffi_status ffi_prep_cif_machdep (ffi_cif *cif) +{ + cif->flags = 0; + + /* structures are returned as pointers */ + if (cif->rtype->type == FFI_TYPE_STRUCT) + cif->flags = FFI_TYPE_STRUCT; + else + if (cif->rtype->size > 4) + cif->flags = FFI_TYPE_UINT64; + + cif->nfixedargs = cif->nargs; + + return FFI_OK; +} + + +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned int nfixedargs, unsigned int ntotalargs) +{ + ffi_status status; + + status = ffi_prep_cif_machdep (cif); + cif->nfixedargs = nfixedargs; + return status; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffitarget.h new file mode 100644 index 0000000..e55da28 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/ffitarget.h @@ -0,0 +1,58 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2014 Sebastian Macke + + OpenRISC Target configuration macros + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#define FFI_TRAMPOLINE_SIZE (24) + +#define FFI_TARGET_SPECIFIC_VARIADIC 1 +#define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs; + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/sysv.S new file mode 100644 index 0000000..df6570b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/or1k/sysv.S @@ -0,0 +1,107 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2014 Sebastian Macke + + OpenRISC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +.text + .globl ffi_call_SYSV + .type ffi_call_SYSV, @function +/* + r3: size to allocate on stack + r4: extended cif structure + r5: function pointer ffi_prep_args + r6: ret address + r7: function to call + r8: flag for return type +*/ + +ffi_call_SYSV: + /* Store registers used on stack */ + l.sw -4(r1), r9 /* return address */ + l.sw -8(r1), r1 /* stack address */ + l.sw -12(r1), r14 /* callee saved registers */ + l.sw -16(r1), r16 + l.sw -20(r1), r18 + l.sw -24(r1), r20 + + l.ori r14, r1, 0x0 /* save stack pointer */ + l.addi r1, r1, -24 + + l.ori r16, r7, 0x0 /* save function address */ + l.ori r18, r6, 0x0 /* save ret address */ + l.ori r20, r8, 0x0 /* save flag */ + + l.sub r1, r1, r3 /* reserve space on stack */ + + /* Call ffi_prep_args */ + l.ori r3, r1, 0x0 /* first argument stack address, second already ecif */ + l.jalr r5 + l.nop + + /* Load register arguments and call*/ + + l.lwz r3, 0(r1) + l.lwz r4, 4(r1) + l.lwz r5, 8(r1) + l.lwz r6, 12(r1) + l.lwz r7, 16(r1) + l.lwz r8, 20(r1) + l.ori r1, r11, 0x0 /* new stack pointer */ + l.jalr r16 + l.nop + + /* handle return values */ + + l.sfeqi r20, FFI_TYPE_STRUCT + l.bf ret /* structs don't return an rvalue */ + l.nop + + /* copy ret address */ + + l.sfeqi r20, FFI_TYPE_UINT64 + l.bnf four_byte_ret /* 8 byte value is returned */ + l.nop + + l.sw 4(r18), r12 + +four_byte_ret: + l.sw 0(r18), r11 + +ret: + /* return */ + l.ori r1, r14, 0x0 /* reset stack pointer */ + l.lwz r9, -4(r1) + l.lwz r1, -8(r1) + l.lwz r14, -12(r1) + l.lwz r16, -16(r1) + l.lwz r18, -20(r1) + l.lwz r20, -24(r1) + l.jr r9 + l.nop + +.size ffi_call_SYSV, .-ffi_call_SYSV diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffi.c new file mode 100644 index 0000000..95e6694 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffi.c @@ -0,0 +1,674 @@ +/* ----------------------------------------------------------------------- + ffi.c - (c) 2011 Anthony Green + (c) 2008 Red Hat, Inc. + (c) 2006 Free Software Foundation, Inc. + (c) 2003-2004 Randolph Chung + + HPPA Foreign Function Interface + HP-UX PA ABI support + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include + +#define ROUND_UP(v, a) (((size_t)(v) + (a) - 1) & ~((a) - 1)) + +#define MIN_STACK_SIZE 64 +#define FIRST_ARG_SLOT 9 +#define DEBUG_LEVEL 0 + +#define fldw(addr, fpreg) \ + __asm__ volatile ("fldw 0(%0), %%" #fpreg "L" : : "r"(addr) : #fpreg) +#define fstw(fpreg, addr) \ + __asm__ volatile ("fstw %%" #fpreg "L, 0(%0)" : : "r"(addr)) +#define fldd(addr, fpreg) \ + __asm__ volatile ("fldd 0(%0), %%" #fpreg : : "r"(addr) : #fpreg) +#define fstd(fpreg, addr) \ + __asm__ volatile ("fstd %%" #fpreg "L, 0(%0)" : : "r"(addr)) + +#define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0) + +static inline int ffi_struct_type(ffi_type *t) +{ + size_t sz = t->size; + + /* Small structure results are passed in registers, + larger ones are passed by pointer. Note that + small structures of size 2, 4 and 8 differ from + the corresponding integer types in that they have + different alignment requirements. */ + + if (sz <= 1) + return FFI_TYPE_UINT8; + else if (sz == 2) + return FFI_TYPE_SMALL_STRUCT2; + else if (sz == 3) + return FFI_TYPE_SMALL_STRUCT3; + else if (sz == 4) + return FFI_TYPE_SMALL_STRUCT4; + else if (sz == 5) + return FFI_TYPE_SMALL_STRUCT5; + else if (sz == 6) + return FFI_TYPE_SMALL_STRUCT6; + else if (sz == 7) + return FFI_TYPE_SMALL_STRUCT7; + else if (sz <= 8) + return FFI_TYPE_SMALL_STRUCT8; + else + return FFI_TYPE_STRUCT; /* else, we pass it by pointer. */ +} + +/* PA has a downward growing stack, which looks like this: + + Offset + [ Variable args ] + SP = (4*(n+9)) arg word N + ... + SP-52 arg word 4 + [ Fixed args ] + SP-48 arg word 3 + SP-44 arg word 2 + SP-40 arg word 1 + SP-36 arg word 0 + [ Frame marker ] + ... + SP-20 RP + SP-4 previous SP + + The first four argument words on the stack are reserved for use by + the callee. Instead, the general and floating registers replace + the first four argument slots. Non FP arguments are passed solely + in the general registers. FP arguments are passed in both general + and floating registers when using libffi. + + Non-FP 32-bit args are passed in gr26, gr25, gr24 and gr23. + Non-FP 64-bit args are passed in register pairs, starting + on an odd numbered register (i.e. r25+r26 and r23+r24). + FP 32-bit arguments are passed in fr4L, fr5L, fr6L and fr7L. + FP 64-bit arguments are passed in fr5 and fr7. + + The registers are allocated in the same manner as stack slots. + This allows the callee to save its arguments on the stack if + necessary: + + arg word 3 -> gr23 or fr7L + arg word 2 -> gr24 or fr6L or fr7R + arg word 1 -> gr25 or fr5L + arg word 0 -> gr26 or fr4L or fr5R + + Note that fr4R and fr6R are never used for arguments (i.e., + doubles are not passed in fr4 or fr6). + + The rest of the arguments are passed on the stack starting at SP-52, + but 64-bit arguments need to be aligned to an 8-byte boundary + + This means we can have holes either in the register allocation, + or in the stack. */ + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments + + The following code will put everything into the stack frame + (which was allocated by the asm routine), and on return + the asm routine will load the arguments that should be + passed by register into the appropriate registers + + NOTE: We load floating point args in this function... that means we + assume gcc will not mess with fp regs in here. */ + +void ffi_prep_args_pa32(UINT32 *stack, extended_cif *ecif, unsigned bytes) +{ + register unsigned int i; + register ffi_type **p_arg; + register void **p_argv; + unsigned int slot = FIRST_ARG_SLOT; + char *dest_cpy; + size_t len; + + debug(1, "%s: stack = %p, ecif = %p, bytes = %u\n", __FUNCTION__, stack, + ecif, bytes); + + p_arg = ecif->cif->arg_types; + p_argv = ecif->avalue; + + for (i = 0; i < ecif->cif->nargs; i++) + { + int type = (*p_arg)->type; + + switch (type) + { + case FFI_TYPE_SINT8: + *(SINT32 *)(stack - slot) = *(SINT8 *)(*p_argv); + break; + + case FFI_TYPE_UINT8: + *(UINT32 *)(stack - slot) = *(UINT8 *)(*p_argv); + break; + + case FFI_TYPE_SINT16: + *(SINT32 *)(stack - slot) = *(SINT16 *)(*p_argv); + break; + + case FFI_TYPE_UINT16: + *(UINT32 *)(stack - slot) = *(UINT16 *)(*p_argv); + break; + + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + debug(3, "Storing UINT32 %u in slot %u\n", *(UINT32 *)(*p_argv), + slot); + *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + /* Align slot for 64-bit type. */ + slot += (slot & 1) ? 1 : 2; + *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv); + break; + + case FFI_TYPE_FLOAT: + /* First 4 args go in fr4L - fr7L. */ + debug(3, "Storing UINT32(float) in slot %u\n", slot); + *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); + switch (slot - FIRST_ARG_SLOT) + { + /* First 4 args go in fr4L - fr7L. */ + case 0: fldw(stack - slot, fr4); break; + case 1: fldw(stack - slot, fr5); break; + case 2: fldw(stack - slot, fr6); break; + case 3: fldw(stack - slot, fr7); break; + } + break; + + case FFI_TYPE_DOUBLE: + /* Align slot for 64-bit type. */ + slot += (slot & 1) ? 1 : 2; + debug(3, "Storing UINT64(double) at slot %u\n", slot); + *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv); + switch (slot - FIRST_ARG_SLOT) + { + /* First 2 args go in fr5, fr7. */ + case 1: fldd(stack - slot, fr5); break; + case 3: fldd(stack - slot, fr7); break; + } + break; + +#ifdef PA_HPUX + case FFI_TYPE_LONGDOUBLE: + /* Long doubles are passed in the same manner as structures + larger than 8 bytes. */ + *(UINT32 *)(stack - slot) = (UINT32)(*p_argv); + break; +#endif + + case FFI_TYPE_STRUCT: + + /* Structs smaller or equal than 4 bytes are passed in one + register. Structs smaller or equal 8 bytes are passed in two + registers. Larger structures are passed by pointer. */ + + len = (*p_arg)->size; + if (len <= 4) + { + dest_cpy = (char *)(stack - slot) + 4 - len; + memcpy(dest_cpy, (char *)*p_argv, len); + } + else if (len <= 8) + { + slot += (slot & 1) ? 1 : 2; + dest_cpy = (char *)(stack - slot) + 8 - len; + memcpy(dest_cpy, (char *)*p_argv, len); + } + else + *(UINT32 *)(stack - slot) = (UINT32)(*p_argv); + break; + + default: + FFI_ASSERT(0); + } + + slot++; + p_arg++; + p_argv++; + } + + /* Make sure we didn't mess up and scribble on the stack. */ + { + unsigned int n; + + debug(5, "Stack setup:\n"); + for (n = 0; n < (bytes + 3) / 4; n++) + { + if ((n%4) == 0) { debug(5, "\n%08x: ", (unsigned int)(stack - n)); } + debug(5, "%08x ", *(stack - n)); + } + debug(5, "\n"); + } + + FFI_ASSERT(slot * 4 <= bytes); + + return; +} + +static void ffi_size_stack_pa32(ffi_cif *cif) +{ + ffi_type **ptr; + int i; + int z = 0; /* # stack slots */ + + for (ptr = cif->arg_types, i = 0; i < cif->nargs; ptr++, i++) + { + int type = (*ptr)->type; + + switch (type) + { + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + z += 2 + (z & 1); /* must start on even regs, so we may waste one */ + break; + +#ifdef PA_HPUX + case FFI_TYPE_LONGDOUBLE: +#endif + case FFI_TYPE_STRUCT: + z += 1; /* pass by ptr, callee will copy */ + break; + + default: /* <= 32-bit values */ + z++; + } + } + + /* We can fit up to 6 args in the default 64-byte stack frame, + if we need more, we need more stack. */ + if (z <= 6) + cif->bytes = MIN_STACK_SIZE; /* min stack size */ + else + cif->bytes = 64 + ROUND_UP((z - 6) * sizeof(UINT32), MIN_STACK_SIZE); + + debug(3, "Calculated stack size is %u bytes\n", cif->bytes); +} + +/* Perform machine dependent cif processing. */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + cif->flags = (unsigned) cif->rtype->type; + break; + +#ifdef PA_HPUX + case FFI_TYPE_LONGDOUBLE: + /* Long doubles are treated like a structure. */ + cif->flags = FFI_TYPE_STRUCT; + break; +#endif + + case FFI_TYPE_STRUCT: + /* For the return type we have to check the size of the structures. + If the size is smaller or equal 4 bytes, the result is given back + in one register. If the size is smaller or equal 8 bytes than we + return the result in two registers. But if the size is bigger than + 8 bytes, we work with pointers. */ + cif->flags = ffi_struct_type(cif->rtype); + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + cif->flags = FFI_TYPE_UINT64; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + /* Lucky us, because of the unique PA ABI we get to do our + own stack sizing. */ + switch (cif->abi) + { + case FFI_PA32: + ffi_size_stack_pa32(cif); + break; + + default: + FFI_ASSERT(0); + break; + } + + return FFI_OK; +} + +extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned), + extended_cif *, unsigned, unsigned, unsigned *, + void (*fn)(void)); + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return + value address then we need to make one. */ + + if (rvalue == NULL +#ifdef PA_HPUX + && (cif->rtype->type == FFI_TYPE_STRUCT + || cif->rtype->type == FFI_TYPE_LONGDOUBLE)) +#else + && cif->rtype->type == FFI_TYPE_STRUCT) +#endif + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { + case FFI_PA32: + debug(3, "Calling ffi_call_pa32: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn); + ffi_call_pa32(ffi_prep_args_pa32, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT(0); + break; + } +} + +#if FFI_CLOSURES +/* This is more-or-less an inverse of ffi_call -- we have arguments on + the stack, and we need to fill them into a cif structure and invoke + the user function. This really ought to be in asm to make sure + the compiler doesn't do things we don't expect. */ +ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) +{ + ffi_cif *cif; + void **avalue; + void *rvalue; + /* Functions can return up to 64-bits in registers. Return address + must be double word aligned. */ + union { double rd; UINT32 ret[2]; } u; + ffi_type **p_arg; + char *tmp; + int i, avn; + unsigned int slot = FIRST_ARG_SLOT; + register UINT32 r28 asm("r28"); + ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure); + + cif = closure->cif; + + /* If returning via structure, callee will write to our pointer. */ + if (cif->flags == FFI_TYPE_STRUCT) + rvalue = (void *)r28; + else + rvalue = &u; + + avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG); + avn = cif->nargs; + p_arg = cif->arg_types; + + for (i = 0; i < avn; i++) + { + int type = (*p_arg)->type; + + switch (type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + avalue[i] = (char *)(stack - slot) + sizeof(UINT32) - (*p_arg)->size; + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + slot += (slot & 1) ? 1 : 2; + avalue[i] = (void *)(stack - slot); + break; + + case FFI_TYPE_FLOAT: +#ifdef PA_LINUX + /* The closure call is indirect. In Linux, floating point + arguments in indirect calls with a prototype are passed + in the floating point registers instead of the general + registers. So, we need to replace what was previously + stored in the current slot with the value in the + corresponding floating point register. */ + switch (slot - FIRST_ARG_SLOT) + { + case 0: fstw(fr4, (void *)(stack - slot)); break; + case 1: fstw(fr5, (void *)(stack - slot)); break; + case 2: fstw(fr6, (void *)(stack - slot)); break; + case 3: fstw(fr7, (void *)(stack - slot)); break; + } +#endif + avalue[i] = (void *)(stack - slot); + break; + + case FFI_TYPE_DOUBLE: + slot += (slot & 1) ? 1 : 2; +#ifdef PA_LINUX + /* See previous comment for FFI_TYPE_FLOAT. */ + switch (slot - FIRST_ARG_SLOT) + { + case 1: fstd(fr5, (void *)(stack - slot)); break; + case 3: fstd(fr7, (void *)(stack - slot)); break; + } +#endif + avalue[i] = (void *)(stack - slot); + break; + +#ifdef PA_HPUX + case FFI_TYPE_LONGDOUBLE: + /* Long doubles are treated like a big structure. */ + avalue[i] = (void *) *(stack - slot); + break; +#endif + + case FFI_TYPE_STRUCT: + /* Structs smaller or equal than 4 bytes are passed in one + register. Structs smaller or equal 8 bytes are passed in two + registers. Larger structures are passed by pointer. */ + if((*p_arg)->size <= 4) + { + avalue[i] = (void *)(stack - slot) + sizeof(UINT32) - + (*p_arg)->size; + } + else if ((*p_arg)->size <= 8) + { + slot += (slot & 1) ? 1 : 2; + avalue[i] = (void *)(stack - slot) + sizeof(UINT64) - + (*p_arg)->size; + } + else + avalue[i] = (void *) *(stack - slot); + break; + + default: + FFI_ASSERT(0); + } + + slot++; + p_arg++; + } + + /* Invoke the closure. */ + (c->fun) (cif, rvalue, avalue, c->user_data); + + debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0], + u.ret[1]); + + /* Store the result using the lower 2 bytes of the flags. */ + switch (cif->flags) + { + case FFI_TYPE_UINT8: + *(stack - FIRST_ARG_SLOT) = (UINT8)(u.ret[0] >> 24); + break; + case FFI_TYPE_SINT8: + *(stack - FIRST_ARG_SLOT) = (SINT8)(u.ret[0] >> 24); + break; + case FFI_TYPE_UINT16: + *(stack - FIRST_ARG_SLOT) = (UINT16)(u.ret[0] >> 16); + break; + case FFI_TYPE_SINT16: + *(stack - FIRST_ARG_SLOT) = (SINT16)(u.ret[0] >> 16); + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + *(stack - FIRST_ARG_SLOT) = u.ret[0]; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + *(stack - FIRST_ARG_SLOT) = u.ret[0]; + *(stack - FIRST_ARG_SLOT - 1) = u.ret[1]; + break; + + case FFI_TYPE_DOUBLE: + fldd(rvalue, fr4); + break; + + case FFI_TYPE_FLOAT: + fldw(rvalue, fr4); + break; + + case FFI_TYPE_STRUCT: + /* Don't need a return value, done by caller. */ + break; + + case FFI_TYPE_SMALL_STRUCT2: + case FFI_TYPE_SMALL_STRUCT3: + case FFI_TYPE_SMALL_STRUCT4: + tmp = (void*)(stack - FIRST_ARG_SLOT); + tmp += 4 - cif->rtype->size; + memcpy((void*)tmp, &u, cif->rtype->size); + break; + + case FFI_TYPE_SMALL_STRUCT5: + case FFI_TYPE_SMALL_STRUCT6: + case FFI_TYPE_SMALL_STRUCT7: + case FFI_TYPE_SMALL_STRUCT8: + { + unsigned int ret2[2]; + int off; + + /* Right justify ret[0] and ret[1] */ + switch (cif->flags) + { + case FFI_TYPE_SMALL_STRUCT5: off = 3; break; + case FFI_TYPE_SMALL_STRUCT6: off = 2; break; + case FFI_TYPE_SMALL_STRUCT7: off = 1; break; + default: off = 0; break; + } + + memset (ret2, 0, sizeof (ret2)); + memcpy ((char *)ret2 + off, &u, 8 - off); + + *(stack - FIRST_ARG_SLOT) = ret2[0]; + *(stack - FIRST_ARG_SLOT - 1) = ret2[1]; + } + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_VOID: + break; + + default: + debug(0, "assert with cif->flags: %d\n",cif->flags); + FFI_ASSERT(0); + break; + } + return FFI_OK; +} + +/* Fill in a closure to refer to the specified fun and user_data. + cif specifies the argument and result types for fun. + The cif must already be prep'ed. */ + +extern void ffi_closure_pa32(void); + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure); + + /* The layout of a function descriptor. A function pointer with the PLABEL + bit set points to a function descriptor. */ + struct pa32_fd + { + UINT32 code_pointer; + UINT32 gp; + }; + + struct ffi_pa32_trampoline_struct + { + UINT32 code_pointer; /* Pointer to ffi_closure_unix. */ + UINT32 fake_gp; /* Pointer to closure, installed as gp. */ + UINT32 real_gp; /* Real gp value. */ + }; + + struct ffi_pa32_trampoline_struct *tramp; + struct pa32_fd *fd; + + if (cif->abi != FFI_PA32) + return FFI_BAD_ABI; + + /* Get function descriptor address for ffi_closure_pa32. */ + fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3); + + /* Setup trampoline. */ + tramp = (struct ffi_pa32_trampoline_struct *)c->tramp; + tramp->code_pointer = fd->code_pointer; + tramp->fake_gp = (UINT32)codeloc & ~3; + tramp->real_gp = fd->gp; + + c->cif = cif; + c->user_data = user_data; + c->fun = fun; + + return FFI_OK; +} +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffitarget.h new file mode 100644 index 0000000..df1209e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/ffitarget.h @@ -0,0 +1,80 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for hppa. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + +#ifdef PA_LINUX + FFI_PA32, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_PA32 +#endif + +#ifdef PA_HPUX + FFI_PA32, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_PA32 +#endif + +#ifdef PA64_HPUX +#error "PA64_HPUX FFI is not yet implemented" + FFI_PA64, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_PA64 +#endif +} ffi_abi; +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#define FFI_TRAMPOLINE_SIZE 12 + +#define FFI_TYPE_SMALL_STRUCT2 -1 +#define FFI_TYPE_SMALL_STRUCT3 -2 +#define FFI_TYPE_SMALL_STRUCT4 -3 +#define FFI_TYPE_SMALL_STRUCT5 -4 +#define FFI_TYPE_SMALL_STRUCT6 -5 +#define FFI_TYPE_SMALL_STRUCT7 -6 +#define FFI_TYPE_SMALL_STRUCT8 -7 +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/hpux32.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/hpux32.S new file mode 100644 index 0000000..d0e5f69 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/hpux32.S @@ -0,0 +1,370 @@ +/* ----------------------------------------------------------------------- + hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc. + (c) 2008 Red Hat, Inc. + based on src/pa/linux.S + + HP-UX PA Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + .LEVEL 1.1 + .SPACE $PRIVATE$ + .IMPORT $global$,DATA + .IMPORT $$dyncall,MILLICODE + .SUBSPA $DATA$ + .align 4 + + /* void ffi_call_pa32(void (*)(char *, extended_cif *), + extended_cif *ecif, + unsigned bytes, + unsigned flags, + unsigned *rvalue, + void (*fn)(void)); + */ + + .export ffi_call_pa32,ENTRY,PRIV_LEV=3 + .import ffi_prep_args_pa32,CODE + + .SPACE $TEXT$ + .SUBSPA $CODE$ + .align 4 + +L$FB1 +ffi_call_pa32 + .proc + .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 + .entry + stw %rp, -20(%sp) + copy %r3, %r1 +L$CFI11 + copy %sp, %r3 +L$CFI12 + + /* Setup the stack for calling prep_args... + We want the stack to look like this: + + [ Previous stack ] <- %r3 + + [ 64-bytes register save area ] <- %r4 + + [ Stack space for actual call, passed as ] <- %arg0 + [ arg0 to ffi_prep_args_pa32 ] + + [ Stack for calling prep_args ] <- %sp + */ + + stwm %r1, 64(%sp) + stw %r4, 12(%r3) +L$CFI13 + copy %sp, %r4 + + addl %arg2, %r4, %arg0 ; arg stack + stw %arg3, -48(%r3) ; save flags we need it later + + /* Call prep_args: + %arg0(stack) -- set up above + %arg1(ecif) -- same as incoming param + %arg2(bytes) -- same as incoming param */ + bl ffi_prep_args_pa32,%r2 + ldo 64(%arg0), %sp + ldo -64(%sp), %sp + + /* now %sp should point where %arg0 was pointing. */ + + /* Load the arguments that should be passed in registers + The fp args are loaded by the prep_args function. */ + ldw -36(%sp), %arg0 + ldw -40(%sp), %arg1 + ldw -44(%sp), %arg2 + ldw -48(%sp), %arg3 + + /* in case the function is going to return a structure + we need to give it a place to put the result. */ + ldw -52(%r3), %ret0 ; %ret0 <- rvalue + ldw -56(%r3), %r22 ; %r22 <- function to call + bl $$dyncall, %r31 ; Call the user function + copy %r31, %rp + + /* Prepare to store the result; we need to recover flags and rvalue. */ + ldw -48(%r3), %r21 ; r21 <- flags + ldw -52(%r3), %r20 ; r20 <- rvalue + + /* Store the result according to the return type. The most + likely types should come first. */ + +L$checkint + comib,<>,n FFI_TYPE_INT, %r21, L$checkint8 + b L$done + stw %ret0, 0(%r20) + +L$checkint8 + comib,<>,n FFI_TYPE_UINT8, %r21, L$checkint16 + b L$done + stb %ret0, 0(%r20) + +L$checkint16 + comib,<>,n FFI_TYPE_UINT16, %r21, L$checkdbl + b L$done + sth %ret0, 0(%r20) + +L$checkdbl + comib,<>,n FFI_TYPE_DOUBLE, %r21, L$checkfloat + b L$done + fstd %fr4,0(%r20) + +L$checkfloat + comib,<>,n FFI_TYPE_FLOAT, %r21, L$checkll + b L$done + fstw %fr4L,0(%r20) + +L$checkll + comib,<>,n FFI_TYPE_UINT64, %r21, L$checksmst2 + stw %ret0, 0(%r20) + b L$done + stw %ret1, 4(%r20) + +L$checksmst2 + comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, L$checksmst3 + /* 2-byte structs are returned in ret0 as ????xxyy. */ + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret0, 0(%r20) + +L$checksmst3 + comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, L$checksmst4 + /* 3-byte structs are returned in ret0 as ??xxyyzz. */ + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret0, 0(%r20) + +L$checksmst4 + comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, L$checksmst5 + /* 4-byte structs are returned in ret0 as wwxxyyzz. */ + extru %ret0, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret0, 0(%r20) + +L$checksmst5 + comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, L$checksmst6 + /* 5 byte values are returned right justified: + ret0 ret1 + 5: ??????aa bbccddee */ + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret1, 0(%r20) + +L$checksmst6 + comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, L$checksmst7 + /* 6 byte values are returned right justified: + ret0 ret1 + 6: ????aabb ccddeeff */ + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret1, 0(%r20) + +L$checksmst7 + comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, L$checksmst8 + /* 7 byte values are returned right justified: + ret0 ret1 + 7: ??aabbcc ddeeffgg */ + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b L$done + stb %ret1, 0(%r20) + +L$checksmst8 + comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, L$done + /* 8 byte values are returned right justified: + ret0 ret1 + 8: aabbccdd eeffgghh */ + extru %ret0, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stb %ret1, 0(%r20) + +L$done + /* all done, return */ + copy %r4, %sp ; pop arg stack + ldw 12(%r3), %r4 + ldwm -64(%sp), %r3 ; .. and pop stack + ldw -20(%sp), %rp + bv %r0(%rp) + nop + .exit + .procend +L$FE1 + + /* void ffi_closure_pa32(void); + Called with closure argument in %r19 */ + + .SPACE $TEXT$ + .SUBSPA $CODE$ + .export ffi_closure_pa32,ENTRY,PRIV_LEV=3,RTNVAL=GR + .import ffi_closure_inner_pa32,CODE + .align 4 +L$FB2 +ffi_closure_pa32 + .proc + .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 + .entry + + stw %rp, -20(%sp) + copy %r3, %r1 +L$CFI21 + copy %sp, %r3 +L$CFI22 + stwm %r1, 64(%sp) + + /* Put arguments onto the stack and call ffi_closure_inner. */ + stw %arg0, -36(%r3) + stw %arg1, -40(%r3) + stw %arg2, -44(%r3) + stw %arg3, -48(%r3) + + /* Retrieve closure pointer and real gp. */ + copy %r19, %arg0 + ldw 8(%r19), %r19 + bl ffi_closure_inner_pa32, %r2 + copy %r3, %arg1 + ldwm -64(%sp), %r3 + ldw -20(%sp), %rp + ldw -36(%sp), %ret0 + bv %r0(%rp) + ldw -40(%sp), %ret1 + .exit + .procend +L$FE2: + + .SPACE $PRIVATE$ + .SUBSPA $DATA$ + + .align 4 + .EXPORT _GLOBAL__F_ffi_call_pa32,DATA +_GLOBAL__F_ffi_call_pa32 +L$frame1: + .word L$ECIE1-L$SCIE1 ;# Length of Common Information Entry +L$SCIE1: + .word 0x0 ;# CIE Identifier Tag + .byte 0x1 ;# CIE Version + .ascii "\0" ;# CIE Augmentation + .uleb128 0x1 ;# CIE Code Alignment Factor + .sleb128 4 ;# CIE Data Alignment Factor + .byte 0x2 ;# CIE RA Column + .byte 0xc ;# DW_CFA_def_cfa + .uleb128 0x1e + .uleb128 0x0 + .align 4 +L$ECIE1: +L$SFDE1: + .word L$EFDE1-L$ASFDE1 ;# FDE Length +L$ASFDE1: + .word L$ASFDE1-L$frame1 ;# FDE CIE offset + .word L$FB1 ;# FDE initial location + .word L$FE1-L$FB1 ;# FDE address range + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word L$CFI11-L$FB1 + .byte 0x83 ;# DW_CFA_offset, column 0x3 + .uleb128 0x0 + .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] + .uleb128 0x2 + .sleb128 -5 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word L$CFI12-L$CFI11 + .byte 0xd ;# DW_CFA_def_cfa_register = r3 + .uleb128 0x3 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word L$CFI13-L$CFI12 + .byte 0x84 ;# DW_CFA_offset, column 0x4 + .uleb128 0x3 + + .align 4 +L$EFDE1: + +L$SFDE2: + .word L$EFDE2-L$ASFDE2 ;# FDE Length +L$ASFDE2: + .word L$ASFDE2-L$frame1 ;# FDE CIE offset + .word L$FB2 ;# FDE initial location + .word L$FE2-L$FB2 ;# FDE address range + .byte 0x4 ;# DW_CFA_advance_loc4 + .word L$CFI21-L$FB2 + .byte 0x83 ;# DW_CFA_offset, column 0x3 + .uleb128 0x0 + .byte 0x11 ;# DW_CFA_offset_extended_sf + .uleb128 0x2 + .sleb128 -5 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word L$CFI22-L$CFI21 + .byte 0xd ;# DW_CFA_def_cfa_register = r3 + .uleb128 0x3 + + .align 4 +L$EFDE2: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/linux.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/linux.S new file mode 100644 index 0000000..33ef0b1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/pa/linux.S @@ -0,0 +1,380 @@ +/* ----------------------------------------------------------------------- + linux.S - (c) 2003-2004 Randolph Chung + (c) 2008 Red Hat, Inc. + + HPPA Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + .text + .level 1.1 + .align 4 + + /* void ffi_call_pa32(void (*)(char *, extended_cif *), + extended_cif *ecif, + unsigned bytes, + unsigned flags, + unsigned *rvalue, + void (*fn)(void)); + */ + + .export ffi_call_pa32,code + .import ffi_prep_args_pa32,code + + .type ffi_call_pa32, @function +.LFB1: +ffi_call_pa32: + .proc + .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 + .entry + stw %rp, -20(%sp) + copy %r3, %r1 +.LCFI11: + + copy %sp, %r3 +.LCFI12: + + /* Setup the stack for calling prep_args... + We want the stack to look like this: + + [ Previous stack ] <- %r3 + + [ 64-bytes register save area ] <- %r4 + + [ Stack space for actual call, passed as ] <- %arg0 + [ arg0 to ffi_prep_args_pa32 ] + + [ Stack for calling prep_args ] <- %sp + */ + + stwm %r1, 64(%sp) + stw %r4, 12(%r3) +.LCFI13: + copy %sp, %r4 + + addl %arg2, %r4, %arg0 /* arg stack */ + stw %arg3, -48(%r3) /* save flags; we need it later */ + + /* Call prep_args: + %arg0(stack) -- set up above + %arg1(ecif) -- same as incoming param + %arg2(bytes) -- same as incoming param */ + bl ffi_prep_args_pa32,%r2 + ldo 64(%arg0), %sp + ldo -64(%sp), %sp + + /* now %sp should point where %arg0 was pointing. */ + + /* Load the arguments that should be passed in registers + The fp args were loaded by the prep_args function. */ + ldw -36(%sp), %arg0 + ldw -40(%sp), %arg1 + ldw -44(%sp), %arg2 + ldw -48(%sp), %arg3 + + /* in case the function is going to return a structure + we need to give it a place to put the result. */ + ldw -52(%r3), %ret0 /* %ret0 <- rvalue */ + ldw -56(%r3), %r22 /* %r22 <- function to call */ + bl $$dyncall, %r31 /* Call the user function */ + copy %r31, %rp + + /* Prepare to store the result; we need to recover flags and rvalue. */ + ldw -48(%r3), %r21 /* r21 <- flags */ + ldw -52(%r3), %r20 /* r20 <- rvalue */ + + /* Store the result according to the return type. */ + +.Lcheckint: + comib,<>,n FFI_TYPE_INT, %r21, .Lcheckint8 + b .Ldone + stw %ret0, 0(%r20) + +.Lcheckint8: + comib,<>,n FFI_TYPE_UINT8, %r21, .Lcheckint16 + b .Ldone + stb %ret0, 0(%r20) + +.Lcheckint16: + comib,<>,n FFI_TYPE_UINT16, %r21, .Lcheckdbl + b .Ldone + sth %ret0, 0(%r20) + +.Lcheckdbl: + comib,<>,n FFI_TYPE_DOUBLE, %r21, .Lcheckfloat + b .Ldone + fstd %fr4,0(%r20) + +.Lcheckfloat: + comib,<>,n FFI_TYPE_FLOAT, %r21, .Lcheckll + b .Ldone + fstw %fr4L,0(%r20) + +.Lcheckll: + comib,<>,n FFI_TYPE_UINT64, %r21, .Lchecksmst2 + stw %ret0, 0(%r20) + b .Ldone + stw %ret1, 4(%r20) + +.Lchecksmst2: + comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, .Lchecksmst3 + /* 2-byte structs are returned in ret0 as ????xxyy. */ + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret0, 0(%r20) + +.Lchecksmst3: + comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, .Lchecksmst4 + /* 3-byte structs are returned in ret0 as ??xxyyzz. */ + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret0, 0(%r20) + +.Lchecksmst4: + comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, .Lchecksmst5 + /* 4-byte structs are returned in ret0 as wwxxyyzz. */ + extru %ret0, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret0, 0(%r20) + +.Lchecksmst5: + comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, .Lchecksmst6 + /* 5 byte values are returned right justified: + ret0 ret1 + 5: ??????aa bbccddee */ + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret1, 0(%r20) + +.Lchecksmst6: + comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, .Lchecksmst7 + /* 6 byte values are returned right justified: + ret0 ret1 + 6: ????aabb ccddeeff */ + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret1, 0(%r20) + +.Lchecksmst7: + comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, .Lchecksmst8 + /* 7 byte values are returned right justified: + ret0 ret1 + 7: ??aabbcc ddeeffgg */ + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + b .Ldone + stb %ret1, 0(%r20) + +.Lchecksmst8: + comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, .Ldone + /* 8 byte values are returned right justified: + ret0 ret1 + 8: aabbccdd eeffgghh */ + extru %ret0, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret0, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stbs,ma %ret0, 1(%r20) + extru %ret1, 7, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 15, 8, %r22 + stbs,ma %r22, 1(%r20) + extru %ret1, 23, 8, %r22 + stbs,ma %r22, 1(%r20) + stb %ret1, 0(%r20) + +.Ldone: + /* all done, return */ + copy %r4, %sp /* pop arg stack */ + ldw 12(%r3), %r4 + ldwm -64(%sp), %r3 /* .. and pop stack */ + ldw -20(%sp), %rp + bv %r0(%rp) + nop + .exit + .procend +.LFE1: + + /* void ffi_closure_pa32(void); + Called with closure argument in %r19 */ + .export ffi_closure_pa32,code + .import ffi_closure_inner_pa32,code + + .type ffi_closure_pa32, @function +.LFB2: +ffi_closure_pa32: + .proc + .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 + .entry + + stw %rp, -20(%sp) +.LCFI20: + copy %r3, %r1 +.LCFI21: + copy %sp, %r3 +.LCFI22: + stwm %r1, 64(%sp) + + /* Put arguments onto the stack and call ffi_closure_inner. */ + stw %arg0, -36(%r3) + stw %arg1, -40(%r3) + stw %arg2, -44(%r3) + stw %arg3, -48(%r3) + + /* Retrieve closure pointer and real gp. */ + copy %r19, %arg0 + ldw 8(%r19), %r19 + bl ffi_closure_inner_pa32, %r2 + copy %r3, %arg1 + + ldwm -64(%sp), %r3 + ldw -20(%sp), %rp + ldw -36(%sp), %ret0 + bv %r0(%r2) + ldw -40(%sp), %ret1 + + .exit + .procend +.LFE2: + + .section ".eh_frame",EH_FRAME_FLAGS,@progbits +.Lframe1: + .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry +.LSCIE1: + .word 0x0 ;# CIE Identifier Tag + .byte 0x1 ;# CIE Version +#ifdef __PIC__ + .ascii "zR\0" ;# CIE Augmentation: 'z' - data, 'R' - DW_EH_PE_... data +#else + .ascii "\0" ;# CIE Augmentation +#endif + .uleb128 0x1 ;# CIE Code Alignment Factor + .sleb128 4 ;# CIE Data Alignment Factor + .byte 0x2 ;# CIE RA Column +#ifdef __PIC__ + .uleb128 0x1 ;# Augmentation size + .byte 0x1b ;# FDE Encoding (DW_EH_PE_pcrel|DW_EH_PE_sdata4) +#endif + .byte 0xc ;# DW_CFA_def_cfa + .uleb128 0x1e + .uleb128 0x0 + .align 4 +.LECIE1: +.LSFDE1: + .word .LEFDE1-.LASFDE1 ;# FDE Length +.LASFDE1: + .word .LASFDE1-.Lframe1 ;# FDE CIE offset +#ifdef __PIC__ + .word .LFB1-. ;# FDE initial location +#else + .word .LFB1 ;# FDE initial location +#endif + .word .LFE1-.LFB1 ;# FDE address range +#ifdef __PIC__ + .uleb128 0x0 ;# Augmentation size: no data +#endif + .byte 0x4 ;# DW_CFA_advance_loc4 + .word .LCFI11-.LFB1 + .byte 0x83 ;# DW_CFA_offset, column 0x3 + .uleb128 0x0 + .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] + .uleb128 0x2 + .sleb128 -5 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word .LCFI12-.LCFI11 + .byte 0xd ;# DW_CFA_def_cfa_register = r3 + .uleb128 0x3 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word .LCFI13-.LCFI12 + .byte 0x84 ;# DW_CFA_offset, column 0x4 + .uleb128 0x3 + + .align 4 +.LEFDE1: + +.LSFDE2: + .word .LEFDE2-.LASFDE2 ;# FDE Length +.LASFDE2: + .word .LASFDE2-.Lframe1 ;# FDE CIE offset +#ifdef __PIC__ + .word .LFB2-. ;# FDE initial location +#else + .word .LFB2 ;# FDE initial location +#endif + .word .LFE2-.LFB2 ;# FDE address range +#ifdef __PIC__ + .uleb128 0x0 ;# Augmentation size: no data +#endif + .byte 0x4 ;# DW_CFA_advance_loc4 + .word .LCFI21-.LFB2 + .byte 0x83 ;# DW_CFA_offset, column 0x3 + .uleb128 0x0 + .byte 0x11 ;# DW_CFA_offset_extended_sf + .uleb128 0x2 + .sleb128 -5 + + .byte 0x4 ;# DW_CFA_advance_loc4 + .word .LCFI22-.LCFI21 + .byte 0xd ;# DW_CFA_def_cfa_register = r3 + .uleb128 0x3 + + .align 4 +.LEFDE2: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix.S new file mode 100644 index 0000000..7ba5415 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix.S @@ -0,0 +1,566 @@ +/* ----------------------------------------------------------------------- + aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc. + based on darwin.S by John Hornkvist + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + .set r0,0 + .set r1,1 + .set r2,2 + .set r3,3 + .set r4,4 + .set r5,5 + .set r6,6 + .set r7,7 + .set r8,8 + .set r9,9 + .set r10,10 + .set r11,11 + .set r12,12 + .set r13,13 + .set r14,14 + .set r15,15 + .set r16,16 + .set r17,17 + .set r18,18 + .set r19,19 + .set r20,20 + .set r21,21 + .set r22,22 + .set r23,23 + .set r24,24 + .set r25,25 + .set r26,26 + .set r27,27 + .set r28,28 + .set r29,29 + .set r30,30 + .set r31,31 + .set f0,0 + .set f1,1 + .set f2,2 + .set f3,3 + .set f4,4 + .set f5,5 + .set f6,6 + .set f7,7 + .set f8,8 + .set f9,9 + .set f10,10 + .set f11,11 + .set f12,12 + .set f13,13 + .set f14,14 + .set f15,15 + .set f16,16 + .set f17,17 + .set f18,18 + .set f19,19 + .set f20,20 + .set f21,21 + + .extern .ffi_prep_args + +#define LIBFFI_ASM +#include +#include +#define JUMPTARGET(name) name +#define L(x) x + .file "aix.S" + .toc + + /* void ffi_call_AIX(extended_cif *ecif, unsigned long bytes, + * unsigned int flags, unsigned int *rvalue, + * void (*fn)(), + * void (*prep_args)(extended_cif*, unsigned *const)); + * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args + */ + +.csect .text[PR] + .align 2 + .globl ffi_call_AIX + .globl .ffi_call_AIX +.csect ffi_call_AIX[DS] +ffi_call_AIX: +#ifdef __64BIT__ + .llong .ffi_call_AIX, TOC[tc0], 0 + .csect .text[PR] +.ffi_call_AIX: + .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0 + .bf __LINE__ + .line 1 +LFB..0: + /* Save registers we use. */ + mflr r0 + + std r28,-32(r1) + std r29,-24(r1) + std r30,-16(r1) + std r31, -8(r1) + + std r0, 16(r1) +LCFI..0: + mr r28, r1 /* our AP. */ + stdux r1, r1, r4 +LCFI..1: + + /* Save arguments over call... */ + mr r31, r5 /* flags, */ + mr r30, r6 /* rvalue, */ + mr r29, r7 /* function address. */ + std r2, 40(r1) + + /* Call ffi_prep_args. */ + mr r4, r1 + bl .ffi_prep_args + nop + + /* Now do the call. */ + ld r0, 0(r29) + ld r2, 8(r29) + ld r11, 16(r29) + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40, r31 + mtctr r0 + /* Load all those argument registers. */ + /* We have set up a nice stack frame, just load it into registers. */ + ld r3, 40+(1*8)(r1) + ld r4, 40+(2*8)(r1) + ld r5, 40+(3*8)(r1) + ld r6, 40+(4*8)(r1) + nop + ld r7, 40+(5*8)(r1) + ld r8, 40+(6*8)(r1) + ld r9, 40+(7*8)(r1) + ld r10,40+(8*8)(r1) + +L1: + /* Load all the FP registers. */ + bf 6,L2 /* 2f + 0x18 */ + lfd f1,-32-(13*8)(r28) + lfd f2,-32-(12*8)(r28) + lfd f3,-32-(11*8)(r28) + lfd f4,-32-(10*8)(r28) + nop + lfd f5,-32-(9*8)(r28) + lfd f6,-32-(8*8)(r28) + lfd f7,-32-(7*8)(r28) + lfd f8,-32-(6*8)(r28) + nop + lfd f9,-32-(5*8)(r28) + lfd f10,-32-(4*8)(r28) + lfd f11,-32-(3*8)(r28) + lfd f12,-32-(2*8)(r28) + nop + lfd f13,-32-(1*8)(r28) + +L2: + /* Make the call. */ + bctrl + ld r2, 40(r1) + + /* Now, deal with the return value. */ + mtcrf 0x01, r31 + + bt 30, L(done_return_value) + bt 29, L(fp_return_value) + std r3, 0(r30) + + /* Fall through... */ + +L(done_return_value): + /* Restore the registers we used and return. */ + mr r1, r28 + ld r0, 16(r28) + ld r28, -32(r1) + mtlr r0 + ld r29, -24(r1) + ld r30, -16(r1) + ld r31, -8(r1) + blr + +L(fp_return_value): + bf 28, L(float_return_value) + stfd f1, 0(r30) + bf 31, L(done_return_value) + stfd f2, 8(r30) + b L(done_return_value) +L(float_return_value): + stfs f1, 0(r30) + b L(done_return_value) +LFE..0: +#else /* ! __64BIT__ */ + + .long .ffi_call_AIX, TOC[tc0], 0 + .csect .text[PR] +.ffi_call_AIX: + .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0 + .bf __LINE__ + .line 1 +LFB..0: + /* Save registers we use. */ + mflr r0 + + stw r28,-16(r1) + stw r29,-12(r1) + stw r30, -8(r1) + stw r31, -4(r1) + + stw r0, 8(r1) +LCFI..0: + mr r28, r1 /* out AP. */ + stwux r1, r1, r4 +LCFI..1: + + /* Save arguments over call... */ + mr r31, r5 /* flags, */ + mr r30, r6 /* rvalue, */ + mr r29, r7 /* function address, */ + stw r2, 20(r1) + + /* Call ffi_prep_args. */ + mr r4, r1 + bl .ffi_prep_args + nop + + /* Now do the call. */ + lwz r0, 0(r29) + lwz r2, 4(r29) + lwz r11, 8(r29) + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40, r31 + mtctr r0 + /* Load all those argument registers. */ + /* We have set up a nice stack frame, just load it into registers. */ + lwz r3, 20+(1*4)(r1) + lwz r4, 20+(2*4)(r1) + lwz r5, 20+(3*4)(r1) + lwz r6, 20+(4*4)(r1) + nop + lwz r7, 20+(5*4)(r1) + lwz r8, 20+(6*4)(r1) + lwz r9, 20+(7*4)(r1) + lwz r10,20+(8*4)(r1) + +L1: + /* Load all the FP registers. */ + bf 6,L2 /* 2f + 0x18 */ + lfd f1,-16-(13*8)(r28) + lfd f2,-16-(12*8)(r28) + lfd f3,-16-(11*8)(r28) + lfd f4,-16-(10*8)(r28) + nop + lfd f5,-16-(9*8)(r28) + lfd f6,-16-(8*8)(r28) + lfd f7,-16-(7*8)(r28) + lfd f8,-16-(6*8)(r28) + nop + lfd f9,-16-(5*8)(r28) + lfd f10,-16-(4*8)(r28) + lfd f11,-16-(3*8)(r28) + lfd f12,-16-(2*8)(r28) + nop + lfd f13,-16-(1*8)(r28) + +L2: + /* Make the call. */ + bctrl + lwz r2, 20(r1) + + /* Now, deal with the return value. */ + mtcrf 0x01, r31 + + bt 30, L(done_return_value) + bt 29, L(fp_return_value) + stw r3, 0(r30) + bf 28, L(done_return_value) + stw r4, 4(r30) + + /* Fall through... */ + +L(done_return_value): + /* Restore the registers we used and return. */ + mr r1, r28 + lwz r0, 8(r28) + lwz r28,-16(r1) + mtlr r0 + lwz r29,-12(r1) + lwz r30, -8(r1) + lwz r31, -4(r1) + blr + +L(fp_return_value): + bf 28, L(float_return_value) + stfd f1, 0(r30) + b L(done_return_value) +L(float_return_value): + stfs f1, 0(r30) + b L(done_return_value) +LFE..0: +#endif + .ef __LINE__ + .long 0 + .byte 0,0,0,1,128,4,0,0 +/* END(ffi_call_AIX) */ + + /* void ffi_call_go_AIX(extended_cif *ecif, unsigned long bytes, + * unsigned int flags, unsigned int *rvalue, + * void (*fn)(), + * void (*prep_args)(extended_cif*, unsigned *const), + * void *closure); + * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args, r9=closure + */ + +.csect .text[PR] + .align 2 + .globl ffi_call_go_AIX + .globl .ffi_call_go_AIX +.csect ffi_call_go_AIX[DS] +ffi_call_go_AIX: +#ifdef __64BIT__ + .llong .ffi_call_go_AIX, TOC[tc0], 0 + .csect .text[PR] +.ffi_call_go_AIX: + .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1 + .bf __LINE__ + .line 1 +LFB..1: + /* Save registers we use. */ + mflr r0 + + std r28,-32(r1) + std r29,-24(r1) + std r30,-16(r1) + std r31, -8(r1) + + std r9, 8(r1) /* closure, saved in cr field. */ + std r0, 16(r1) +LCFI..2: + mr r28, r1 /* our AP. */ + stdux r1, r1, r4 +LCFI..3: + + /* Save arguments over call... */ + mr r31, r5 /* flags, */ + mr r30, r6 /* rvalue, */ + mr r29, r7 /* function address, */ + std r2, 40(r1) + + /* Call ffi_prep_args. */ + mr r4, r1 + bl .ffi_prep_args + nop + + /* Now do the call. */ + ld r0, 0(r29) + ld r2, 8(r29) + ld r11, 8(r28) /* closure */ + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40, r31 + mtctr r0 + /* Load all those argument registers. */ + /* We have set up a nice stack frame, just load it into registers. */ + ld r3, 40+(1*8)(r1) + ld r4, 40+(2*8)(r1) + ld r5, 40+(3*8)(r1) + ld r6, 40+(4*8)(r1) + nop + ld r7, 40+(5*8)(r1) + ld r8, 40+(6*8)(r1) + ld r9, 40+(7*8)(r1) + ld r10,40+(8*8)(r1) + + b L1 +LFE..1: +#else /* ! __64BIT__ */ + + .long .ffi_call_go_AIX, TOC[tc0], 0 + .csect .text[PR] +.ffi_call_go_AIX: + .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1 + .bf __LINE__ + .line 1 + /* Save registers we use. */ +LFB..1: + mflr r0 + + stw r28,-16(r1) + stw r29,-12(r1) + stw r30, -8(r1) + stw r31, -4(r1) + + stw r9, 4(r1) /* closure, saved in cr field. */ + stw r0, 8(r1) +LCFI..2: + mr r28, r1 /* out AP. */ + stwux r1, r1, r4 +LCFI..3: + + /* Save arguments over call... */ + mr r31, r5 /* flags, */ + mr r30, r6 /* rvalue, */ + mr r29, r7 /* function address, */ + stw r2, 20(r1) + + /* Call ffi_prep_args. */ + mr r4, r1 + bl .ffi_prep_args + nop + + /* Now do the call. */ + lwz r0, 0(r29) + lwz r2, 4(r29) + lwz r11, 4(r28) /* closure */ + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40, r31 + mtctr r0 + /* Load all those argument registers. */ + /* We have set up a nice stack frame, just load it into registers. */ + lwz r3, 20+(1*4)(r1) + lwz r4, 20+(2*4)(r1) + lwz r5, 20+(3*4)(r1) + lwz r6, 20+(4*4)(r1) + nop + lwz r7, 20+(5*4)(r1) + lwz r8, 20+(6*4)(r1) + lwz r9, 20+(7*4)(r1) + lwz r10,20+(8*4)(r1) + + b L1 +LFE..1: +#endif + .ef __LINE__ + .long 0 + .byte 0,0,0,1,128,4,0,0 +/* END(ffi_call_go_AIX) */ + +.csect .text[PR] + .align 2 + .globl ffi_call_DARWIN + .globl .ffi_call_DARWIN +.csect ffi_call_DARWIN[DS] +ffi_call_DARWIN: +#ifdef __64BIT__ + .llong .ffi_call_DARWIN, TOC[tc0], 0 +#else + .long .ffi_call_DARWIN, TOC[tc0], 0 +#endif + .csect .text[PR] +.ffi_call_DARWIN: + blr + .long 0 + .byte 0,0,0,0,0,0,0,0 +/* END(ffi_call_DARWIN) */ + +/* EH frame stuff. */ + +#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */ +#ifdef __64BIT__ +#define PTRSIZE 8 +#define LOG2_PTRSIZE 3 +#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */ +#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */ +#else +#define PTRSIZE 4 +#define LOG2_PTRSIZE 2 +#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */ +#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */ +#endif + .csect _unwind.ro_[RO],4 + .align LOG2_PTRSIZE + .globl _GLOBAL__F_libffi_src_powerpc_aix +_GLOBAL__F_libffi_src_powerpc_aix: +Lframe..1: + .vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */ +LSCIE..1: + .vbyte 4,0 /* CIE Identifier Tag */ + .byte 0x3 /* CIE Version */ + .byte "zR" /* CIE Augmentation */ + .byte 0 + .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ + .byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */ + .byte 0x41 /* CIE RA Column */ + .byte 0x1 /* uleb128 0x1; Augmentation size */ + .byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */ + .byte 0xc /* DW_CFA_def_cfa */ + .byte 0x1 /* uleb128 0x1; Register r1 */ + .byte 0 /* uleb128 0x0; Offset 0 */ + .align LOG2_PTRSIZE +LECIE..1: +LSFDE..1: + .vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */ +LASFDE..1: + .vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */ + .vbyte PTRSIZE,LFB..0-$ /* FDE initial location */ + .vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */ + .byte 0 /* uleb128 0x0; Augmentation size */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..0-LFB..0 + .byte 0x11 /* DW_CFA_def_offset_extended_sf */ + .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ + .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ + .byte 0x9f /* DW_CFA_offset Register r31 */ + .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */ + .byte 0x9e /* DW_CFA_offset Register r30 */ + .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */ + .byte 0x9d /* DW_CFA_offset Register r29 */ + .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */ + .byte 0x9c /* DW_CFA_offset Register r28 */ + .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..1-LCFI..0 + .byte 0xd /* DW_CFA_def_cfa_register */ + .byte 0x1c /* uleb128 28; Register r28 */ + .align LOG2_PTRSIZE +LEFDE..1: +LSFDE..2: + .vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */ +LASFDE..2: + .vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */ + .vbyte PTRSIZE,LFB..1-$ /* FDE initial location */ + .vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */ + .byte 0 /* uleb128 0x0; Augmentation size */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..2-LFB..1 + .byte 0x11 /* DW_CFA_def_offset_extended_sf */ + .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ + .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ + .byte 0x9f /* DW_CFA_offset Register r31 */ + .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */ + .byte 0x9e /* DW_CFA_offset Register r30 */ + .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */ + .byte 0x9d /* DW_CFA_offset Register r29 */ + .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */ + .byte 0x9c /* DW_CFA_offset Register r28 */ + .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..3-LCFI..2 + .byte 0xd /* DW_CFA_def_cfa_register */ + .byte 0x1c /* uleb128 28; Register r28 */ + .align LOG2_PTRSIZE +LEFDE..2: + .vbyte 4,0 /* End of FDEs */ + + .csect .text[PR] + .ref _GLOBAL__F_libffi_src_powerpc_aix /* Prevents garbage collection by AIX linker */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix_closure.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix_closure.S new file mode 100644 index 0000000..132c785 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/aix_closure.S @@ -0,0 +1,694 @@ +/* ----------------------------------------------------------------------- + aix_closure.S - Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc. + based on darwin_closure.S + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + .set r0,0 + .set r1,1 + .set r2,2 + .set r3,3 + .set r4,4 + .set r5,5 + .set r6,6 + .set r7,7 + .set r8,8 + .set r9,9 + .set r10,10 + .set r11,11 + .set r12,12 + .set r13,13 + .set r14,14 + .set r15,15 + .set r16,16 + .set r17,17 + .set r18,18 + .set r19,19 + .set r20,20 + .set r21,21 + .set r22,22 + .set r23,23 + .set r24,24 + .set r25,25 + .set r26,26 + .set r27,27 + .set r28,28 + .set r29,29 + .set r30,30 + .set r31,31 + .set f0,0 + .set f1,1 + .set f2,2 + .set f3,3 + .set f4,4 + .set f5,5 + .set f6,6 + .set f7,7 + .set f8,8 + .set f9,9 + .set f10,10 + .set f11,11 + .set f12,12 + .set f13,13 + .set f14,14 + .set f15,15 + .set f16,16 + .set f17,17 + .set f18,18 + .set f19,19 + .set f20,20 + .set f21,21 + + .extern .ffi_closure_helper_DARWIN + .extern .ffi_go_closure_helper_DARWIN + +#define LIBFFI_ASM +#define JUMPTARGET(name) name +#define L(x) x + .file "aix_closure.S" + .toc +LC..60: + .tc L..60[TC],L..60 + .csect .text[PR] + .align 2 + +.csect .text[PR] + .align 2 + .globl ffi_closure_ASM + .globl .ffi_closure_ASM +.csect ffi_closure_ASM[DS] +ffi_closure_ASM: +#ifdef __64BIT__ + .llong .ffi_closure_ASM, TOC[tc0], 0 + .csect .text[PR] +.ffi_closure_ASM: + .function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0 + .bf __LINE__ + .line 1 +LFB..0: +/* we want to build up an area for the parameters passed */ +/* in registers (both floating point and integer) */ + + /* we store gpr 3 to gpr 10 (aligned to 4) + in the parents outgoing area */ + std r3, 48+(0*8)(r1) + std r4, 48+(1*8)(r1) + std r5, 48+(2*8)(r1) + std r6, 48+(3*8)(r1) + mflr r0 + + std r7, 48+(4*8)(r1) + std r8, 48+(5*8)(r1) + std r9, 48+(6*8)(r1) + std r10, 48+(7*8)(r1) + std r0, 16(r1) /* save the return address */ +LCFI..0: + /* 48 Bytes (Linkage Area) */ + /* 64 Bytes (params) */ + /* 16 Bytes (result) */ + /* 104 Bytes (13*8 from FPR) */ + /* 8 Bytes (alignment) */ + /* 240 Bytes */ + + stdu r1, -240(r1) /* skip over caller save area + keep stack aligned to 16 */ +LCFI..1: + + /* next save fpr 1 to fpr 13 (aligned to 8) */ + stfd f1, 128+(0*8)(r1) + stfd f2, 128+(1*8)(r1) + stfd f3, 128+(2*8)(r1) + stfd f4, 128+(3*8)(r1) + stfd f5, 128+(4*8)(r1) + stfd f6, 128+(5*8)(r1) + stfd f7, 128+(6*8)(r1) + stfd f8, 128+(7*8)(r1) + stfd f9, 128+(8*8)(r1) + stfd f10, 128+(9*8)(r1) + stfd f11, 128+(10*8)(r1) + stfd f12, 128+(11*8)(r1) + stfd f13, 128+(12*8)(r1) + + /* set up registers for the routine that actually does the work */ + /* get the context pointer from the trampoline */ + mr r3, r11 + + /* now load up the pointer to the result storage */ + addi r4, r1, 112 + + /* now load up the pointer to the saved gpr registers */ + addi r5, r1, 288 + + /* now load up the pointer to the saved fpr registers */ + addi r6, r1, 128 + + /* make the call */ + bl .ffi_closure_helper_DARWIN + nop + +.Ldoneclosure: + + /* now r3 contains the return type */ + /* so use it to look up in a table */ + /* so we know how to deal with each type */ + + /* look up the proper starting point in table */ + /* by using return type as offset */ + lhz r3, 10(r3) /* load type from return type */ + ld r4, LC..60(2) /* get address of jump table */ + sldi r3, r3, 4 /* now multiply return type by 16 */ + ld r0, 240+16(r1) /* load return address */ + add r3, r3, r4 /* add contents of table to table address */ + mtctr r3 + bctr /* jump to it */ + +/* Each fragment must be exactly 16 bytes long (4 instructions). + Align to 16 byte boundary for cache and dispatch efficiency. */ + .align 4 + +L..60: +/* case FFI_TYPE_VOID */ + mtlr r0 + addi r1, r1, 240 + blr + nop + +/* case FFI_TYPE_INT */ + lwa r3, 112+4(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_FLOAT */ + lfs f1, 112+0(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_DOUBLE */ + lfd f1, 112+0(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_LONGDOUBLE */ + lfd f1, 112+0(r1) + mtlr r0 + lfd f2, 112+8(r1) + b L..finish + +/* case FFI_TYPE_UINT8 */ + lbz r3, 112+7(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_SINT8 */ + lbz r3, 112+7(r1) + mtlr r0 + extsb r3, r3 + b L..finish + +/* case FFI_TYPE_UINT16 */ + lhz r3, 112+6(r1) + mtlr r0 +L..finish: + addi r1, r1, 240 + blr + +/* case FFI_TYPE_SINT16 */ + lha r3, 112+6(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_UINT32 */ + lwz r3, 112+4(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_SINT32 */ + lwa r3, 112+4(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_UINT64 */ + ld r3, 112+0(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_SINT64 */ + ld r3, 112+0(r1) + mtlr r0 + addi r1, r1, 240 + blr + +/* case FFI_TYPE_STRUCT */ + mtlr r0 + addi r1, r1, 240 + blr + nop + +/* case FFI_TYPE_POINTER */ + ld r3, 112+0(r1) + mtlr r0 + addi r1, r1, 240 + blr +LFE..0: + +#else /* ! __64BIT__ */ + + .long .ffi_closure_ASM, TOC[tc0], 0 + .csect .text[PR] +.ffi_closure_ASM: + .function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0 + .bf __LINE__ + .line 1 +LFB..0: +/* we want to build up an area for the parameters passed */ +/* in registers (both floating point and integer) */ + + /* we store gpr 3 to gpr 10 (aligned to 4) + in the parents outgoing area */ + stw r3, 24+(0*4)(r1) + stw r4, 24+(1*4)(r1) + stw r5, 24+(2*4)(r1) + stw r6, 24+(3*4)(r1) + mflr r0 + + stw r7, 24+(4*4)(r1) + stw r8, 24+(5*4)(r1) + stw r9, 24+(6*4)(r1) + stw r10, 24+(7*4)(r1) + stw r0, 8(r1) +LCFI..0: + /* 24 Bytes (Linkage Area) */ + /* 32 Bytes (params) */ + /* 16 Bytes (result) */ + /* 104 Bytes (13*8 from FPR) */ + /* 176 Bytes */ + + stwu r1, -176(r1) /* skip over caller save area + keep stack aligned to 16 */ +LCFI..1: + + /* next save fpr 1 to fpr 13 (aligned to 8) */ + stfd f1, 72+(0*8)(r1) + stfd f2, 72+(1*8)(r1) + stfd f3, 72+(2*8)(r1) + stfd f4, 72+(3*8)(r1) + stfd f5, 72+(4*8)(r1) + stfd f6, 72+(5*8)(r1) + stfd f7, 72+(6*8)(r1) + stfd f8, 72+(7*8)(r1) + stfd f9, 72+(8*8)(r1) + stfd f10, 72+(9*8)(r1) + stfd f11, 72+(10*8)(r1) + stfd f12, 72+(11*8)(r1) + stfd f13, 72+(12*8)(r1) + + /* set up registers for the routine that actually does the work */ + /* get the context pointer from the trampoline */ + mr r3, r11 + + /* now load up the pointer to the result storage */ + addi r4, r1, 56 + + /* now load up the pointer to the saved gpr registers */ + addi r5, r1, 200 + + /* now load up the pointer to the saved fpr registers */ + addi r6, r1, 72 + + /* make the call */ + bl .ffi_closure_helper_DARWIN + nop + +.Ldoneclosure: + + /* now r3 contains the return type */ + /* so use it to look up in a table */ + /* so we know how to deal with each type */ + + /* look up the proper starting point in table */ + /* by using return type as offset */ + lhz r3, 6(r3) /* load type from return type */ + lwz r4, LC..60(2) /* get address of jump table */ + slwi r3, r3, 4 /* now multiply return type by 16 */ + lwz r0, 176+8(r1) /* load return address */ + add r3, r3, r4 /* add contents of table to table address */ + mtctr r3 + bctr /* jump to it */ + +/* Each fragment must be exactly 16 bytes long (4 instructions). + Align to 16 byte boundary for cache and dispatch efficiency. */ + .align 4 + +L..60: +/* case FFI_TYPE_VOID */ + mtlr r0 + addi r1, r1, 176 + blr + nop + +/* case FFI_TYPE_INT */ + lwz r3, 56+0(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_FLOAT */ + lfs f1, 56+0(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_DOUBLE */ + lfd f1, 56+0(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_LONGDOUBLE */ + lfd f1, 56+0(r1) + mtlr r0 + lfd f2, 56+8(r1) + b L..finish + +/* case FFI_TYPE_UINT8 */ + lbz r3, 56+3(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_SINT8 */ + lbz r3, 56+3(r1) + mtlr r0 + extsb r3, r3 + b L..finish + +/* case FFI_TYPE_UINT16 */ + lhz r3, 56+2(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_SINT16 */ + lha r3, 56+2(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_UINT32 */ + lwz r3, 56+0(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_SINT32 */ + lwz r3, 56+0(r1) + mtlr r0 + addi r1, r1, 176 + blr + +/* case FFI_TYPE_UINT64 */ + lwz r3, 56+0(r1) + mtlr r0 + lwz r4, 56+4(r1) + b L..finish + +/* case FFI_TYPE_SINT64 */ + lwz r3, 56+0(r1) + mtlr r0 + lwz r4, 56+4(r1) + b L..finish + +/* case FFI_TYPE_STRUCT */ + mtlr r0 + addi r1, r1, 176 + blr + nop + +/* case FFI_TYPE_POINTER */ + lwz r3, 56+0(r1) + mtlr r0 +L..finish: + addi r1, r1, 176 + blr +LFE..0: +#endif + .ef __LINE__ +/* END(ffi_closure_ASM) */ + + +.csect .text[PR] + .align 2 + .globl ffi_go_closure_ASM + .globl .ffi_go_closure_ASM +.csect ffi_go_closure_ASM[DS] +ffi_go_closure_ASM: +#ifdef __64BIT__ + .llong .ffi_go_closure_ASM, TOC[tc0], 0 + .csect .text[PR] +.ffi_go_closure_ASM: + .function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1 + .bf __LINE__ + .line 1 +LFB..1: +/* we want to build up an area for the parameters passed */ +/* in registers (both floating point and integer) */ + + /* we store gpr 3 to gpr 10 (aligned to 4) + in the parents outgoing area */ + std r3, 48+(0*8)(r1) + std r4, 48+(1*8)(r1) + std r5, 48+(2*8)(r1) + std r6, 48+(3*8)(r1) + mflr r0 + + std r7, 48+(4*8)(r1) + std r8, 48+(5*8)(r1) + std r9, 48+(6*8)(r1) + std r10, 48+(7*8)(r1) + std r0, 16(r1) /* save the return address */ +LCFI..2: + /* 48 Bytes (Linkage Area) */ + /* 64 Bytes (params) */ + /* 16 Bytes (result) */ + /* 104 Bytes (13*8 from FPR) */ + /* 8 Bytes (alignment) */ + /* 240 Bytes */ + + stdu r1, -240(r1) /* skip over caller save area + keep stack aligned to 16 */ +LCFI..3: + + /* next save fpr 1 to fpr 13 (aligned to 8) */ + stfd f1, 128+(0*8)(r1) + stfd f2, 128+(1*8)(r1) + stfd f3, 128+(2*8)(r1) + stfd f4, 128+(3*8)(r1) + stfd f5, 128+(4*8)(r1) + stfd f6, 128+(5*8)(r1) + stfd f7, 128+(6*8)(r1) + stfd f8, 128+(7*8)(r1) + stfd f9, 128+(8*8)(r1) + stfd f10, 128+(9*8)(r1) + stfd f11, 128+(10*8)(r1) + stfd f12, 128+(11*8)(r1) + stfd f13, 128+(12*8)(r1) + + /* set up registers for the routine that actually does the work */ + mr r3, r11 /* go closure */ + + /* now load up the pointer to the result storage */ + addi r4, r1, 112 + + /* now load up the pointer to the saved gpr registers */ + addi r5, r1, 288 + + /* now load up the pointer to the saved fpr registers */ + addi r6, r1, 128 + + /* make the call */ + bl .ffi_go_closure_helper_DARWIN + nop + + b .Ldoneclosure +LFE..1: + +#else /* ! __64BIT__ */ + + .long .ffi_go_closure_ASM, TOC[tc0], 0 + .csect .text[PR] +.ffi_go_closure_ASM: + .function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1 + .bf __LINE__ + .line 1 +LFB..1: +/* we want to build up an area for the parameters passed */ +/* in registers (both floating point and integer) */ + + /* we store gpr 3 to gpr 10 (aligned to 4) + in the parents outgoing area */ + stw r3, 24+(0*4)(r1) + stw r4, 24+(1*4)(r1) + stw r5, 24+(2*4)(r1) + stw r6, 24+(3*4)(r1) + mflr r0 + + stw r7, 24+(4*4)(r1) + stw r8, 24+(5*4)(r1) + stw r9, 24+(6*4)(r1) + stw r10, 24+(7*4)(r1) + stw r0, 8(r1) +LCFI..2: + /* 24 Bytes (Linkage Area) */ + /* 32 Bytes (params) */ + /* 16 Bytes (result) */ + /* 104 Bytes (13*8 from FPR) */ + /* 176 Bytes */ + + stwu r1, -176(r1) /* skip over caller save area + keep stack aligned to 16 */ +LCFI..3: + + /* next save fpr 1 to fpr 13 (aligned to 8) */ + stfd f1, 72+(0*8)(r1) + stfd f2, 72+(1*8)(r1) + stfd f3, 72+(2*8)(r1) + stfd f4, 72+(3*8)(r1) + stfd f5, 72+(4*8)(r1) + stfd f6, 72+(5*8)(r1) + stfd f7, 72+(6*8)(r1) + stfd f8, 72+(7*8)(r1) + stfd f9, 72+(8*8)(r1) + stfd f10, 72+(9*8)(r1) + stfd f11, 72+(10*8)(r1) + stfd f12, 72+(11*8)(r1) + stfd f13, 72+(12*8)(r1) + + /* set up registers for the routine that actually does the work */ + mr r3, 11 /* go closure */ + + /* now load up the pointer to the result storage */ + addi r4, r1, 56 + + /* now load up the pointer to the saved gpr registers */ + addi r5, r1, 200 + + /* now load up the pointer to the saved fpr registers */ + addi r6, r1, 72 + + /* make the call */ + bl .ffi_go_closure_helper_DARWIN + nop + + b .Ldoneclosure +LFE..1: +#endif + .ef __LINE__ +/* END(ffi_go_closure_ASM) */ + +/* EH frame stuff. */ + +#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */ +#ifdef __64BIT__ +#define PTRSIZE 8 +#define LOG2_PTRSIZE 3 +#define CFA_OFFSET 0xf0,0x01 /* LEB128 240 */ +#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */ +#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */ +#else +#define PTRSIZE 4 +#define LOG2_PTRSIZE 2 +#define CFA_OFFSET 0xb0,0x01 /* LEB128 176 */ +#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */ +#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */ +#endif + + .csect _unwind.ro_[RO],4 + .align LOG2_PTRSIZE + .globl _GLOBAL__F_libffi_src_powerpc_aix_closure +_GLOBAL__F_libffi_src_powerpc_aix_closure: +Lframe..1: + .vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */ +LSCIE..1: + .vbyte 4,0 /* CIE Identifier Tag */ + .byte 0x3 /* CIE Version */ + .byte "zR" /* CIE Augmentation */ + .byte 0 + .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ + .byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */ + .byte LR_REGNO /* CIE RA Column */ + .byte 0x1 /* uleb128 0x1; Augmentation size */ + .byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */ + .byte 0xc /* DW_CFA_def_cfa */ + .byte 0x1 /* uleb128 0x1; Register r1 */ + .byte 0 /* uleb128 0x0; Offset 0 */ + .align LOG2_PTRSIZE +LECIE..1: +LSFDE..1: + .vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */ +LASFDE..1: + .vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */ + .vbyte PTRSIZE,LFB..0-$ /* FDE initial location */ + .vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */ + .byte 0 /* uleb128 0x0; Augmentation size */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..1-LCFI..0 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte CFA_OFFSET /* uleb128 176/240 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..0-LFB..0 + .byte 0x11 /* DW_CFA_offset_extended_sf */ + .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ + .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ + .align LOG2_PTRSIZE +LEFDE..1: +LSFDE..2: + .vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */ +LASFDE..2: + .vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */ + .vbyte PTRSIZE,LFB..1-$ /* FDE initial location */ + .vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */ + .byte 0 /* uleb128 0x0; Augmentation size */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..3-LCFI..2 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte CFA_OFFSET /* uleb128 176/240 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .vbyte 4,LCFI..2-LFB..1 + .byte 0x11 /* DW_CFA_offset_extended_sf */ + .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ + .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ + .align LOG2_PTRSIZE +LEFDE..2: + .vbyte 4,0 /* End of FDEs */ + + .csect .text[PR] + .ref _GLOBAL__F_libffi_src_powerpc_aix_closure /* Prevents garbage collection by AIX linker */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/asm.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/asm.h new file mode 100644 index 0000000..27b22f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/asm.h @@ -0,0 +1,125 @@ +/* ----------------------------------------------------------------------- + asm.h - Copyright (c) 1998 Geoffrey Keating + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define ASM_GLOBAL_DIRECTIVE .globl + + +#define C_SYMBOL_NAME(name) name +/* Macro for a label. */ +#ifdef __STDC__ +#define C_LABEL(name) name##: +#else +#define C_LABEL(name) name/**/: +#endif + +/* This seems to always be the case on PPC. */ +#define ALIGNARG(log2) log2 +/* For ELF we need the `.type' directive to make shared libs work right. */ +#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; +#define ASM_SIZE_DIRECTIVE(name) .size name,.-name + +/* If compiled for profiling, call `_mcount' at the start of each function. */ +#ifdef PROF +/* The mcount code relies on the return address being on the stack + to locate our caller and so it can restore it; so store one just + for its benefit. */ +#ifdef PIC +#define CALL_MCOUNT \ + .pushsection; \ + .section ".data"; \ + .align ALIGNARG(2); \ +0:.long 0; \ + .previous; \ + mflr %r0; \ + stw %r0,4(%r1); \ + bl _GLOBAL_OFFSET_TABLE_@local-4; \ + mflr %r11; \ + lwz %r0,0b@got(%r11); \ + bl JUMPTARGET(_mcount); +#else /* PIC */ +#define CALL_MCOUNT \ + .section ".data"; \ + .align ALIGNARG(2); \ +0:.long 0; \ + .previous; \ + mflr %r0; \ + lis %r11,0b@ha; \ + stw %r0,4(%r1); \ + addi %r0,%r11,0b@l; \ + bl JUMPTARGET(_mcount); +#endif /* PIC */ +#else /* PROF */ +#define CALL_MCOUNT /* Do nothing. */ +#endif /* PROF */ + +#define ENTRY(name) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ + ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ + .align ALIGNARG(2); \ + C_LABEL(name) \ + CALL_MCOUNT + +#define EALIGN_W_0 /* No words to insert. */ +#define EALIGN_W_1 nop +#define EALIGN_W_2 nop;nop +#define EALIGN_W_3 nop;nop;nop +#define EALIGN_W_4 EALIGN_W_3;nop +#define EALIGN_W_5 EALIGN_W_4;nop +#define EALIGN_W_6 EALIGN_W_5;nop +#define EALIGN_W_7 EALIGN_W_6;nop + +/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes + past a 2^align boundary. */ +#ifdef PROF +#define EFFI_ALIGN(name, alignt, words) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ + ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ + .align ALIGNARG(2); \ + C_LABEL(name) \ + CALL_MCOUNT \ + b 0f; \ + .align ALIGNARG(alignt); \ + EALIGN_W_##words; \ + 0: +#else /* PROF */ +#define EFFI_ALIGN(name, alignt, words) \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ + ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ + .align ALIGNARG(alignt); \ + EALIGN_W_##words; \ + C_LABEL(name) +#endif + +#define END(name) \ + ASM_SIZE_DIRECTIVE(name) + +#ifdef PIC +#define JUMPTARGET(name) name##@plt +#else +#define JUMPTARGET(name) name +#endif + +/* Local labels stripped out by the linker. */ +#define L(x) .L##x diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin.S new file mode 100644 index 0000000..066eb82 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin.S @@ -0,0 +1,378 @@ +/* ----------------------------------------------------------------------- + darwin.S - Copyright (c) 2000 John Hornkvist + Copyright (c) 2004, 2010 Free Software Foundation, Inc. + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define machine_choice MODE_CHOICE(ppc7400,ppc64) + +; Define some pseudo-opcodes for size-independent load & store of GPRs ... +#define lgu MODE_CHOICE(lwzu, ldu) +#define lg MODE_CHOICE(lwz,ld) +#define sg MODE_CHOICE(stw,std) +#define sgu MODE_CHOICE(stwu,stdu) +#define sgux MODE_CHOICE(stwux,stdux) + +; ... and the size of GPRs and their storage indicator. +#define GPR_BYTES MODE_CHOICE(4,8) +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04. +#define LINKAGE_SIZE MODE_CHOICE(24,48) +#define PARAM_AREA MODE_CHOICE(32,64) +#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */ + +/* If there is any FP stuff we make space for all of the regs. */ +#define SAVED_FPR_COUNT 13 +#define FPR_SIZE 8 +#define RESULT_BYTES 16 + +/* This should be kept in step with the same value in ffi_darwin.c. */ +#define ASM_NEEDS_REGISTERS 4 +#define SAVE_REGS_SIZE (ASM_NEEDS_REGISTERS * GPR_BYTES) + +#include +#include + +#define JUMPTARGET(name) name +#define L(x) x + + .text + .align 2 + .globl _ffi_prep_args + + .align 2 + .globl _ffi_call_DARWIN + + /* We arrive here with: + r3 = ptr to extended cif. + r4 = -bytes. + r5 = cif flags. + r6 = ptr to return value. + r7 = fn pointer (user func). + r8 = fn pointer (ffi_prep_args). + r9 = ffi_type* for the ret val. */ + +_ffi_call_DARWIN: +Lstartcode: + mr r12,r8 /* We only need r12 until the call, + so it does not have to be saved. */ +LFB1: + /* Save the old stack pointer as AP. */ + mr r8,r1 +LCFI0: + + /* Save the retval type in parents frame. */ + sg r9,(LINKAGE_SIZE+6*GPR_BYTES)(r8) + + /* Allocate the stack space we need. */ + sgux r1,r1,r4 + + /* Save registers we use. */ + mflr r9 + sg r9,SAVED_LR_OFFSET(r8) + + sg r28,-(4 * GPR_BYTES)(r8) + sg r29,-(3 * GPR_BYTES)(r8) + sg r30,-(2 * GPR_BYTES)(r8) + sg r31,-( GPR_BYTES)(r8) + +#if !defined(POWERPC_DARWIN) + /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */ + sg r2,(5 * GPR_BYTES)(r1) +#endif + +LCFI1: + + /* Save arguments over call. */ + mr r31,r5 /* flags, */ + mr r30,r6 /* rvalue, */ + mr r29,r7 /* function address, */ + mr r28,r8 /* our AP. */ +LCFI2: + /* Call ffi_prep_args. r3 = extended cif, r4 = stack ptr copy. */ + mr r4,r1 + li r9,0 + + mtctr r12 /* r12 holds address of _ffi_prep_args. */ + bctrl + +#if !defined(POWERPC_DARWIN) + /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */ + lg r2,(5 * GPR_BYTES)(r1) +#endif + /* Now do the call. + Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40,r31 + /* Get the address to call into CTR. */ + mtctr r29 + /* Load all those argument registers. + We have set up a nice stack frame, just load it into registers. */ + lg r3, (LINKAGE_SIZE )(r1) + lg r4, (LINKAGE_SIZE + GPR_BYTES)(r1) + lg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r1) + lg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r1) + nop + lg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r1) + lg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r1) + lg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r1) + lg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r1) + +L1: + /* ... Load all the FP registers. */ + bf 6,L2 /* No floats to load. */ + lfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28) + lfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28) + lfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28) + lfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28) + nop + lfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28) + lfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28) + lfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28) + lfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28) + nop + lfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28) + lfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28) + lfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28) + lfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28) + nop + lfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28) + +L2: + mr r12,r29 /* Put the target address in r12 as specified. */ + mtctr r12 + nop + nop + + /* Make the call. */ + bctrl + + /* Now, deal with the return value. */ + + /* m64 structure returns can occupy the same set of registers as + would be used to pass such a structure as arg0 - so take care + not to step on any possibly hot regs. */ + + /* Get the flags.. */ + mtcrf 0x03,r31 ; we need c6 & cr7 now. + ; FLAG_RETURNS_NOTHING also covers struct ret-by-ref. + bt 30,L(done_return_value) ; FLAG_RETURNS_NOTHING + bf 27,L(scalar_return_value) ; not FLAG_RETURNS_STRUCT + + /* OK, so we have a struct. */ +#if defined(__ppc64__) + bt 31,L(maybe_return_128) ; FLAG_RETURNS_128BITS, special case + + /* OK, we have to map the return back to a mem struct. + We are about to trample the parents param area, so recover the + return type. r29 is free, since the call is done. */ + lg r29,(LINKAGE_SIZE + 6 * GPR_BYTES)(r28) + + sg r3, (LINKAGE_SIZE )(r28) + sg r4, (LINKAGE_SIZE + GPR_BYTES)(r28) + sg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r28) + sg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r28) + nop + sg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r28) + sg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r28) + sg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r28) + sg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28) + /* OK, so do the block move - we trust that memcpy will not trample + the fprs... */ + mr r3,r30 ; dest + addi r4,r28,LINKAGE_SIZE ; source + /* The size is a size_t, should be long. */ + lg r5,0(r29) + /* Figure out small structs */ + cmpi 0,r5,4 + bgt L3 ; 1, 2 and 4 bytes have special rules. + cmpi 0,r5,3 + beq L3 ; not 3 + addi r4,r4,8 + subf r4,r5,r4 +L3: + bl _memcpy + + /* ... do we need the FP registers? - recover the flags.. */ + mtcrf 0x03,r31 ; we need c6 & cr7 now. + bf 29,L(done_return_value) /* No floats in the struct. */ + stfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28) + stfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28) + stfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28) + stfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28) + nop + stfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28) + stfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28) + stfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28) + stfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28) + nop + stfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28) + stfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28) + stfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28) + stfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28) + nop + stfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28) + + mr r3,r29 ; ffi_type * + mr r4,r30 ; dest + addi r5,r28,-SAVE_REGS_SIZE-(13*FPR_SIZE) ; fprs + xor r6,r6,r6 + sg r6,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28) + addi r6,r28,(LINKAGE_SIZE + 7 * GPR_BYTES) ; point to a zeroed counter. + bl _darwin64_struct_floats_to_mem + + b L(done_return_value) +#else + stw r3,0(r30) ; m32 the only struct return in reg is 4 bytes. +#endif + b L(done_return_value) + +L(fp_return_value): + /* Do we have long double to store? */ + bf 31,L(fd_return_value) ; FLAG_RETURNS_128BITS + stfd f1,0(r30) + stfd f2,FPR_SIZE(r30) + b L(done_return_value) + +L(fd_return_value): + /* Do we have double to store? */ + bf 28,L(float_return_value) + stfd f1,0(r30) + b L(done_return_value) + +L(float_return_value): + /* We only have a float to store. */ + stfs f1,0(r30) + b L(done_return_value) + +L(scalar_return_value): + bt 29,L(fp_return_value) ; FLAG_RETURNS_FP + ; ffi_arg is defined as unsigned long. + sg r3,0(r30) ; Save the reg. + bf 28,L(done_return_value) ; not FLAG_RETURNS_64BITS + +#if defined(__ppc64__) +L(maybe_return_128): + std r3,0(r30) + bf 31,L(done_return_value) ; not FLAG_RETURNS_128BITS + std r4,8(r30) +#else + stw r4,4(r30) +#endif + + /* Fall through. */ + /* We want this at the end to simplify eh epilog computation. */ + +L(done_return_value): + /* Restore the registers we used and return. */ + lg r29,SAVED_LR_OFFSET(r28) + ; epilog + lg r31,-(1 * GPR_BYTES)(r28) + mtlr r29 + lg r30,-(2 * GPR_BYTES)(r28) + lg r29,-(3 * GPR_BYTES)(r28) + lg r28,-(4 * GPR_BYTES)(r28) + lg r1,0(r1) + blr +LFE1: + .align 1 +/* END(_ffi_call_DARWIN) */ + +/* Provide a null definition of _ffi_call_AIX. */ + .text + .globl _ffi_call_AIX + .align 2 +_ffi_call_AIX: + blr +/* END(_ffi_call_AIX) */ + +/* EH stuff. */ + +#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78) + + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +EH_frame1: + .set L$set$0,LECIE1-LSCIE1 + .long L$set$0 ; Length of Common Information Entry +LSCIE1: + .long 0x0 ; CIE Identifier Tag + .byte 0x1 ; CIE Version + .ascii "zR\0" ; CIE Augmentation + .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor + .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size + .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 + .align LOG2_GPR_BYTES +LECIE1: + + .globl _ffi_call_DARWIN.eh +_ffi_call_DARWIN.eh: +LSFDE1: + .set L$set$1,LEFDE1-LASFDE1 + .long L$set$1 ; FDE Length +LASFDE1: + .long LASFDE1-EH_frame1 ; FDE CIE offset + .g_long Lstartcode-. ; FDE initial location + .set L$set$3,LFE1-Lstartcode + .g_long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$4,LCFI0-Lstartcode + .long L$set$4 + .byte 0xd ; DW_CFA_def_cfa_register + .byte 0x08 ; uleb128 0x08 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$5,LCFI1-LCFI0 + .long L$set$5 + .byte 0x11 ; DW_CFA_offset_extended_sf + .byte 0x41 ; uleb128 0x41 + .byte 0x7e ; sleb128 -2 + .byte 0x9f ; DW_CFA_offset, column 0x1f + .byte 0x1 ; uleb128 0x1 + .byte 0x9e ; DW_CFA_offset, column 0x1e + .byte 0x2 ; uleb128 0x2 + .byte 0x9d ; DW_CFA_offset, column 0x1d + .byte 0x3 ; uleb128 0x3 + .byte 0x9c ; DW_CFA_offset, column 0x1c + .byte 0x4 ; uleb128 0x4 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$6,LCFI2-LCFI1 + .long L$set$6 + .byte 0xd ; DW_CFA_def_cfa_register + .byte 0x1c ; uleb128 0x1c + .align LOG2_GPR_BYTES +LEFDE1: + .align 1 + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin_closure.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin_closure.S new file mode 100644 index 0000000..3121e6a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/darwin_closure.S @@ -0,0 +1,571 @@ +/* ----------------------------------------------------------------------- + darwin_closure.S - Copyright (c) 2002, 2003, 2004, 2010, + Free Software Foundation, Inc. + based on ppc_closure.S + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#define L(x) x + +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define machine_choice MODE_CHOICE(ppc7400,ppc64) + +; Define some pseudo-opcodes for size-independent load & store of GPRs ... +#define lgu MODE_CHOICE(lwzu, ldu) +#define lg MODE_CHOICE(lwz,ld) +#define sg MODE_CHOICE(stw,std) +#define sgu MODE_CHOICE(stwu,stdu) + +; ... and the size of GPRs and their storage indicator. +#define GPR_BYTES MODE_CHOICE(4,8) +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04. +#define LINKAGE_SIZE MODE_CHOICE(24,48) +#define PARAM_AREA MODE_CHOICE(32,64) + +#define SAVED_CR_OFFSET MODE_CHOICE(4,8) /* save position for CR */ +#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */ + +/* WARNING: if ffi_type is changed... here be monsters. + Offsets of items within the result type. */ +#define FFI_TYPE_TYPE MODE_CHOICE(6,10) +#define FFI_TYPE_ELEM MODE_CHOICE(8,16) + +#define SAVED_FPR_COUNT 13 +#define FPR_SIZE 8 +/* biggest m64 struct ret is 8GPRS + 13FPRS = 168 bytes - rounded to 16bytes = 176. */ +#define RESULT_BYTES MODE_CHOICE(16,176) + +; The whole stack frame **MUST** be 16byte-aligned. +#define SAVE_SIZE (((LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES)+15) & -16LL) +#define PAD_SIZE (SAVE_SIZE-(LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES)) + +#define PARENT_PARM_BASE (SAVE_SIZE+LINKAGE_SIZE) +#define FP_SAVE_BASE (LINKAGE_SIZE+PARAM_AREA) + +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 +; We no longer need the pic symbol stub for Darwin >= 9. +#define BLCLS_HELP _ffi_closure_helper_DARWIN +#define STRUCT_RETVALUE_P _darwin64_struct_ret_by_value_p +#define PASS_STR_FLOATS _darwin64_pass_struct_floats +#undef WANT_STUB +#else +#define BLCLS_HELP L_ffi_closure_helper_DARWIN$stub +#define STRUCT_RETVALUE_P L_darwin64_struct_ret_by_value_p$stub +#define PASS_STR_FLOATS L_darwin64_pass_struct_floats$stub +#define WANT_STUB +#endif + +/* m32/m64 + + The stack layout looks like this: + + | Additional params... | | Higher address + ~ ~ ~ + | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS + |--------------------------------------------| | + | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | + |--------------------------------------------| | + | Reserved 2*4/8 | | + |--------------------------------------------| | + | Space for callee`s LR 4/8 | | + |--------------------------------------------| | + | Saved CR [low word for m64] 4/8 | | + |--------------------------------------------| | + | Current backchain pointer 4/8 |-/ Parent`s frame. + |--------------------------------------------| <+ <<< on entry to + | Result Bytes 16/176 | | + |--------------------------------------------| | + ~ padding to 16-byte alignment ~ ~ + |--------------------------------------------| | + | NUM_FPR_ARG_REGISTERS slots | | + | here fp13 .. fp1 13*8 | | + |--------------------------------------------| | + | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS + |--------------------------------------------| | + | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | + |--------------------------------------------| | stack | + | Reserved [compiler,binder] 2*4/8 | | grows | + |--------------------------------------------| | down V + | Space for callees LR 4/8 | | + |--------------------------------------------| | lower addresses + | Saved CR [low word for m64] 4/8 | | + |--------------------------------------------| | stack pointer here + | Current backchain pointer 4/8 |-/ during + |--------------------------------------------| <<< call. + +*/ + + .file "darwin_closure.S" + + .machine machine_choice + + .text + .globl _ffi_closure_ASM + .align LOG2_GPR_BYTES +_ffi_closure_ASM: +LFB1: +Lstartcode: + mflr r0 /* extract return address */ + sg r0,SAVED_LR_OFFSET(r1) /* save the return address */ +LCFI0: + sgu r1,-SAVE_SIZE(r1) /* skip over caller save area + keep stack aligned to 16. */ +LCFI1: + /* We want to build up an area for the parameters passed + in registers. (both floating point and integer) */ + + /* Put gpr 3 to gpr 10 in the parents outgoing area... + ... the remainder of any params that overflowed the regs will + follow here. */ + sg r3, (PARENT_PARM_BASE )(r1) + sg r4, (PARENT_PARM_BASE + GPR_BYTES )(r1) + sg r5, (PARENT_PARM_BASE + GPR_BYTES * 2)(r1) + sg r6, (PARENT_PARM_BASE + GPR_BYTES * 3)(r1) + sg r7, (PARENT_PARM_BASE + GPR_BYTES * 4)(r1) + sg r8, (PARENT_PARM_BASE + GPR_BYTES * 5)(r1) + sg r9, (PARENT_PARM_BASE + GPR_BYTES * 6)(r1) + sg r10,(PARENT_PARM_BASE + GPR_BYTES * 7)(r1) + + /* We save fpr 1 to fpr 14 in our own save frame. */ + stfd f1, (FP_SAVE_BASE )(r1) + stfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1) + stfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1) + stfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1) + stfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1) + stfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1) + stfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1) + stfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1) + stfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1) + stfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1) + stfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1) + stfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1) + stfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1) + + /* Set up registers for the routine that actually does the work + get the context pointer from the trampoline. */ + mr r3,r11 + + /* Now load up the pointer to the result storage. */ + addi r4,r1,(SAVE_SIZE-RESULT_BYTES) + + /* Now load up the pointer to the saved gpr registers. */ + addi r5,r1,PARENT_PARM_BASE + + /* Now load up the pointer to the saved fpr registers. */ + addi r6,r1,FP_SAVE_BASE + + /* Make the call. */ + bl BLCLS_HELP + + /* r3 contains the rtype pointer... save it since we will need + it later. */ + sg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type + lg r0,0(r3) ; size => r0 + lhz r3,FFI_TYPE_TYPE(r3) ; type => r3 + + /* The helper will have intercepted structure returns and inserted + the caller`s destination address for structs returned by ref. */ + + /* r3 contains the return type so use it to look up in a table + so we know how to deal with each type. */ + + addi r5,r1,(SAVE_SIZE-RESULT_BYTES) /* Otherwise, our return is here. */ + bl Lget_ret_type0_addr /* Get pointer to Lret_type0 into LR. */ + mflr r4 /* Move to r4. */ + slwi r3,r3,4 /* Now multiply return type by 16. */ + add r3,r3,r4 /* Add contents of table to table address. */ + mtctr r3 + bctr /* Jump to it. */ +LFE1: +/* Each of the ret_typeX code fragments has to be exactly 16 bytes long + (4 instructions). For cache effectiveness we align to a 16 byte boundary + first. */ + + .align 4 + + nop + nop + nop +Lget_ret_type0_addr: + blrl + +/* case FFI_TYPE_VOID */ +Lret_type0: + b Lfinish + nop + nop + nop + +/* case FFI_TYPE_INT */ +Lret_type1: + lg r3,0(r5) + b Lfinish + nop + nop + +/* case FFI_TYPE_FLOAT */ +Lret_type2: + lfs f1,0(r5) + b Lfinish + nop + nop + +/* case FFI_TYPE_DOUBLE */ +Lret_type3: + lfd f1,0(r5) + b Lfinish + nop + nop + +/* case FFI_TYPE_LONGDOUBLE */ +Lret_type4: + lfd f1,0(r5) + lfd f2,8(r5) + b Lfinish + nop + +/* case FFI_TYPE_UINT8 */ +Lret_type5: +#if defined(__ppc64__) + lbz r3,7(r5) +#else + lbz r3,3(r5) +#endif + b Lfinish + nop + nop + +/* case FFI_TYPE_SINT8 */ +Lret_type6: +#if defined(__ppc64__) + lbz r3,7(r5) +#else + lbz r3,3(r5) +#endif + extsb r3,r3 + b Lfinish + nop + +/* case FFI_TYPE_UINT16 */ +Lret_type7: +#if defined(__ppc64__) + lhz r3,6(r5) +#else + lhz r3,2(r5) +#endif + b Lfinish + nop + nop + +/* case FFI_TYPE_SINT16 */ +Lret_type8: +#if defined(__ppc64__) + lha r3,6(r5) +#else + lha r3,2(r5) +#endif + b Lfinish + nop + nop + +/* case FFI_TYPE_UINT32 */ +Lret_type9: +#if defined(__ppc64__) + lwz r3,4(r5) +#else + lwz r3,0(r5) +#endif + b Lfinish + nop + nop + +/* case FFI_TYPE_SINT32 */ +Lret_type10: +#if defined(__ppc64__) + lwz r3,4(r5) +#else + lwz r3,0(r5) +#endif + b Lfinish + nop + nop + +/* case FFI_TYPE_UINT64 */ +Lret_type11: +#if defined(__ppc64__) + lg r3,0(r5) + b Lfinish + nop +#else + lwz r3,0(r5) + lwz r4,4(r5) + b Lfinish +#endif + nop + +/* case FFI_TYPE_SINT64 */ +Lret_type12: +#if defined(__ppc64__) + lg r3,0(r5) + b Lfinish + nop +#else + lwz r3,0(r5) + lwz r4,4(r5) + b Lfinish +#endif + nop + +/* case FFI_TYPE_STRUCT */ +Lret_type13: +#if defined(__ppc64__) + lg r3,0(r5) ; we need at least this... + cmpi 0,r0,4 + bgt Lstructend ; not a special small case + b Lsmallstruct ; see if we need more. +#else + cmpwi 0,r0,4 + bgt Lfinish ; not by value + lg r3,0(r5) + b Lfinish +#endif +/* case FFI_TYPE_POINTER */ +Lret_type14: + lg r3,0(r5) + b Lfinish + nop + nop + +#if defined(__ppc64__) +Lsmallstruct: + beq Lfour ; continuation of Lret13. + cmpi 0,r0,3 + beq Lfinish ; don`t adjust this - can`t be any floats here... + srdi r3,r3,48 + cmpi 0,r0,2 + beq Lfinish ; .. or here .. + srdi r3,r3,8 + b Lfinish ; .. or here. + +Lfour: + lg r6,LINKAGE_SIZE(r1) ; get the result type + lg r6,FFI_TYPE_ELEM(r6) ; elements array pointer + lg r6,0(r6) ; first element + lhz r0,FFI_TYPE_TYPE(r6) ; OK go the type + cmpi 0,r0,2 ; FFI_TYPE_FLOAT + bne Lfourint + lfs f1,0(r5) ; just one float in the struct. + b Lfinish + +Lfourint: + srdi r3,r3,32 ; four bytes. + b Lfinish + +Lstructend: + lg r3,LINKAGE_SIZE(r1) ; get the result type + bl STRUCT_RETVALUE_P + cmpi 0,r3,0 + beq Lfinish ; nope. + /* Recover a pointer to the results. */ + addi r11,r1,(SAVE_SIZE-RESULT_BYTES) + lg r3,0(r11) ; we need at least this... + lg r4,8(r11) + cmpi 0,r0,16 + beq Lfinish ; special case 16 bytes we don't consider floats. + + /* OK, frustratingly, the process of saving the struct to mem might have + messed with the FPRs, so we have to re-load them :(. + We`ll use our FPRs space again - calling: + void darwin64_pass_struct_floats (ffi_type *s, char *src, + unsigned *nfpr, double **fprs) + We`ll temporarily pinch the first two slots of the param area for local + vars used by the routine. */ + xor r6,r6,r6 + addi r5,r1,PARENT_PARM_BASE ; some space + sg r6,0(r5) ; *nfpr zeroed. + addi r6,r5,8 ; **fprs + addi r3,r1,FP_SAVE_BASE ; pointer to FPRs space + sg r3,0(r6) + mr r4,r11 ; the struct is here... + lg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type. + bl PASS_STR_FLOATS ; get struct floats into FPR save space. + /* See if we used any floats */ + lwz r0,(SAVE_SIZE-RESULT_BYTES)(r1) + cmpi 0,r0,0 + beq Lstructints ; nope. + /* OK load `em up... */ + lfd f1, (FP_SAVE_BASE )(r1) + lfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1) + lfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1) + lfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1) + lfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1) + lfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1) + lfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1) + lfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1) + lfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1) + lfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1) + lfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1) + lfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1) + lfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1) + + /* point back at our saved struct. */ +Lstructints: + addi r11,r1,(SAVE_SIZE-RESULT_BYTES) + lg r3,0(r11) ; we end up picking the + lg r4,8(r11) ; first two again. + lg r5,16(r11) + lg r6,24(r11) + lg r7,32(r11) + lg r8,40(r11) + lg r9,48(r11) + lg r10,56(r11) +#endif + +/* case done */ +Lfinish: + addi r1,r1,SAVE_SIZE /* Restore stack pointer. */ + lg r0,SAVED_LR_OFFSET(r1) /* Get return address. */ + mtlr r0 /* Reset link register. */ + blr +Lendcode: + .align 1 + +/* END(ffi_closure_ASM) */ + +/* EH frame stuff. */ +#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78) +/* 176, 400 */ +#define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90) +#define EH_FRAME_OFFSETB MODE_CHOICE(1,3) + + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +EH_frame1: + .set L$set$0,LECIE1-LSCIE1 + .long L$set$0 ; Length of Common Information Entry +LSCIE1: + .long 0x0 ; CIE Identifier Tag + .byte 0x1 ; CIE Version + .ascii "zR\0" ; CIE Augmentation + .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor + .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size + .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 + .align LOG2_GPR_BYTES +LECIE1: + .globl _ffi_closure_ASM.eh +_ffi_closure_ASM.eh: +LSFDE1: + .set L$set$1,LEFDE1-LASFDE1 + .long L$set$1 ; FDE Length + +LASFDE1: + .long LASFDE1-EH_frame1 ; FDE CIE offset + .g_long Lstartcode-. ; FDE initial location + .set L$set$2,LFE1-Lstartcode + .g_long L$set$2 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$3,LCFI1-LCFI0 + .long L$set$3 + .byte 0xe ; DW_CFA_def_cfa_offset + .byte EH_FRAME_OFFSETA,EH_FRAME_OFFSETB ; uleb128 176,1/190,3 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$4,LCFI0-Lstartcode + .long L$set$4 + .byte 0x11 ; DW_CFA_offset_extended_sf + .byte 0x41 ; uleb128 0x41 + .byte 0x7e ; sleb128 -2 + .align LOG2_GPR_BYTES +LEFDE1: + .align 1 + +#ifdef WANT_STUB + .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 + .align 5 +L_ffi_closure_helper_DARWIN$stub: + .indirect_symbol _ffi_closure_helper_DARWIN + mflr r0 + bcl 20,31,"L1$spb" +"L1$spb": + mflr r11 + addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb") + mtlr r0 + lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +L_ffi_closure_helper_DARWIN$lazy_ptr: + .indirect_symbol _ffi_closure_helper_DARWIN + .g_long dyld_stub_binding_helper + +#if defined(__ppc64__) + .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 + .align 5 +L_darwin64_struct_ret_by_value_p$stub: + .indirect_symbol _darwin64_struct_ret_by_value_p + mflr r0 + bcl 20,31,"L2$spb" +"L2$spb": + mflr r11 + addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb") + mtlr r0 + lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +L_darwin64_struct_ret_by_value_p$lazy_ptr: + .indirect_symbol _darwin64_struct_ret_by_value_p + .g_long dyld_stub_binding_helper + + .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 + .align 5 +L_darwin64_pass_struct_floats$stub: + .indirect_symbol _darwin64_pass_struct_floats + mflr r0 + bcl 20,31,"L3$spb" +"L3$spb": + mflr r11 + addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb") + mtlr r0 + lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +L_darwin64_pass_struct_floats$lazy_ptr: + .indirect_symbol _darwin64_pass_struct_floats + .g_long dyld_stub_binding_helper +# endif +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi.c new file mode 100644 index 0000000..a19bcbb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi.c @@ -0,0 +1,175 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (C) 2013 IBM + Copyright (C) 2011 Anthony Green + Copyright (C) 2011 Kyle Moffett + Copyright (C) 2008 Red Hat, Inc + Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (c) 1998 Geoffrey Keating + + PowerPC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include "ffi.h" +#include "ffi_common.h" +#include "ffi_powerpc.h" + +#if HAVE_LONG_DOUBLE_VARIANT +/* Adjust ffi_type_longdouble. */ +void FFI_HIDDEN +ffi_prep_types (ffi_abi abi) +{ +# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +# ifdef POWERPC64 + ffi_prep_types_linux64 (abi); +# else + ffi_prep_types_sysv (abi); +# endif +# endif +} +#endif + +/* Perform machine dependent cif processing */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep (ffi_cif *cif) +{ +#ifdef POWERPC64 + return ffi_prep_cif_linux64 (cif); +#else + return ffi_prep_cif_sysv (cif); +#endif +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var (ffi_cif *cif, + unsigned int nfixedargs MAYBE_UNUSED, + unsigned int ntotalargs MAYBE_UNUSED) +{ +#ifdef POWERPC64 + return ffi_prep_cif_linux64_var (cif, nfixedargs, ntotalargs); +#else + return ffi_prep_cif_sysv (cif); +#endif +} + +static void +ffi_call_int (ffi_cif *cif, + void (*fn) (void), + void *rvalue, + void **avalue, + void *closure) +{ + /* The final SYSV ABI says that structures smaller or equal 8 bytes + are returned in r3/r4. A draft ABI used by linux instead returns + them in memory. + + We bounce-buffer SYSV small struct return values so that sysv.S + can write r3 and r4 to memory without worrying about struct size. + + For ELFv2 ABI, use a bounce buffer for homogeneous structs too, + for similar reasons. This bounce buffer must be aligned to 16 + bytes for use with homogeneous structs of vectors (float128). */ + float128 smst_buffer[8]; + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + ecif.rvalue = rvalue; + if ((cif->flags & FLAG_RETURNS_SMST) != 0) + ecif.rvalue = smst_buffer; + /* Ensure that we have a valid struct return value. + FIXME: Isn't this just papering over a user problem? */ + else if (!rvalue && cif->rtype->type == FFI_TYPE_STRUCT) + ecif.rvalue = alloca (cif->rtype->size); + +#ifdef POWERPC64 + ffi_call_LINUX64 (&ecif, fn, ecif.rvalue, cif->flags, closure, + -(long) cif->bytes); +#else + ffi_call_SYSV (&ecif, fn, ecif.rvalue, cif->flags, closure, -cif->bytes); +#endif + + /* Check for a bounce-buffered return value */ + if (rvalue && ecif.rvalue == smst_buffer) + { + unsigned int rsize = cif->rtype->size; +#ifndef __LITTLE_ENDIAN__ + /* The SYSV ABI returns a structure of up to 4 bytes in size + left-padded in r3. */ +# ifndef POWERPC64 + if (rsize <= 4) + memcpy (rvalue, (char *) smst_buffer + 4 - rsize, rsize); + else +# endif + /* The SYSV ABI returns a structure of up to 8 bytes in size + left-padded in r3/r4, and the ELFv2 ABI similarly returns a + structure of up to 8 bytes in size left-padded in r3. But + note that a structure of a single float is not paddded. */ + if (rsize <= 8 && (cif->flags & FLAG_RETURNS_FP) == 0) + memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize); + else +#endif + memcpy (rvalue, smst_buffer, rsize); + } +} + +void +ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, + void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *codeloc) +{ +#ifdef POWERPC64 + return ffi_prep_closure_loc_linux64 (closure, cif, fun, user_data, codeloc); +#else + return ffi_prep_closure_loc_sysv (closure, cif, fun, user_data, codeloc); +#endif +} + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *)) +{ +#ifdef POWERPC64 + closure->tramp = ffi_go_closure_linux64; +#else + closure->tramp = ffi_go_closure_sysv; +#endif + closure->cif = cif; + closure->fun = fun; + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c new file mode 100644 index 0000000..64bb94d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c @@ -0,0 +1,1452 @@ +/* ----------------------------------------------------------------------- + ffi_darwin.c + + Copyright (C) 1998 Geoffrey Keating + Copyright (C) 2001 John Hornkvist + Copyright (C) 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. + + FFI support for Darwin and AIX. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +extern void ffi_closure_ASM (void); + +#if defined (FFI_GO_CLOSURES) +extern void ffi_go_closure_ASM (void); +#endif + +enum { + /* The assembly depends on these exact flags. + For Darwin64 (when FLAG_RETURNS_STRUCT is set): + FLAG_RETURNS_FP indicates that the structure embeds FP data. + FLAG_RETURNS_128BITS signals a special struct size that is not + expanded for float content. */ + FLAG_RETURNS_128BITS = 1 << (31-31), /* These go in cr7 */ + FLAG_RETURNS_NOTHING = 1 << (31-30), + FLAG_RETURNS_FP = 1 << (31-29), + FLAG_RETURNS_64BITS = 1 << (31-28), + + FLAG_RETURNS_STRUCT = 1 << (31-27), /* This goes in cr6 */ + + FLAG_ARG_NEEDS_COPY = 1 << (31- 7), + FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ + FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), + FLAG_RETVAL_REFERENCE = 1 << (31- 4) +}; + +/* About the DARWIN ABI. */ +enum { + NUM_GPR_ARG_REGISTERS = 8, + NUM_FPR_ARG_REGISTERS = 13, + LINKAGE_AREA_GPRS = 6 +}; + +enum { ASM_NEEDS_REGISTERS = 4 }; /* r28-r31 */ + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments. + + m32/m64 + + The stack layout we want looks like this: + + | Return address from ffi_call_DARWIN | higher addresses + |--------------------------------------------| + | Previous backchain pointer 4/8 | stack pointer here + |--------------------------------------------|<+ <<< on entry to + | ASM_NEEDS_REGISTERS=r28-r31 4*(4/8) | | ffi_call_DARWIN + |--------------------------------------------| | + | When we have any FP activity... the | | + | FPRs occupy NUM_FPR_ARG_REGISTERS slots | | + | here fp13 .. fp1 from high to low addr. | | + ~ ~ ~ + | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS + |--------------------------------------------| | + | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | + |--------------------------------------------| | stack | + | Reserved 2*4/8 | | grows | + |--------------------------------------------| | down V + | Space for callee's LR 4/8 | | + |--------------------------------------------| | lower addresses + | Saved CR [low word for m64] 4/8 | | + |--------------------------------------------| | stack pointer here + | Current backchain pointer 4/8 |-/ during + |--------------------------------------------| <<< ffi_call_DARWIN + + */ + +#if defined(POWERPC_DARWIN64) +static void +darwin64_pass_struct_by_value + (ffi_type *, char *, unsigned, unsigned *, double **, unsigned long **); +#endif + +/* This depends on GPR_SIZE = sizeof (unsigned long) */ + +void +ffi_prep_args (extended_cif *ecif, unsigned long *const stack) +{ + const unsigned bytes = ecif->cif->bytes; + const unsigned flags = ecif->cif->flags; + const unsigned nargs = ecif->cif->nargs; +#if !defined(POWERPC_DARWIN64) + const ffi_abi abi = ecif->cif->abi; +#endif + + /* 'stacktop' points at the previous backchain pointer. */ + unsigned long *const stacktop = stack + (bytes / sizeof(unsigned long)); + + /* 'fpr_base' points at the space for fpr1, and grows upwards as + we use FPR registers. */ + double *fpr_base = (double *) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS; + int gp_count = 0, fparg_count = 0; + + /* 'next_arg' grows up as we put parameters in it. */ + unsigned long *next_arg = stack + LINKAGE_AREA_GPRS; /* 6 reserved positions. */ + + int i; + double double_tmp; + void **p_argv = ecif->avalue; + unsigned long gprvalue; + ffi_type** ptr = ecif->cif->arg_types; +#if !defined(POWERPC_DARWIN64) + char *dest_cpy; +#endif + unsigned size_al = 0; + + /* Check that everything starts aligned properly. */ + FFI_ASSERT(((unsigned) (char *) stack & 0xF) == 0); + FFI_ASSERT(((unsigned) (char *) stacktop & 0xF) == 0); + FFI_ASSERT((bytes & 0xF) == 0); + + /* Deal with return values that are actually pass-by-reference. + Rule: + Return values are referenced by r3, so r4 is the first parameter. */ + + if (flags & FLAG_RETVAL_REFERENCE) + *next_arg++ = (unsigned long) (char *) ecif->rvalue; + + /* Now for the arguments. */ + for (i = nargs; i > 0; i--, ptr++, p_argv++) + { + switch ((*ptr)->type) + { + /* If a floating-point parameter appears before all of the general- + purpose registers are filled, the corresponding GPRs that match + the size of the floating-point parameter are skipped. */ + case FFI_TYPE_FLOAT: + double_tmp = *(float *) *p_argv; + if (fparg_count < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = double_tmp; +#if defined(POWERPC_DARWIN) + *(float *)next_arg = *(float *) *p_argv; +#else + *(double *)next_arg = double_tmp; +#endif + next_arg++; + gp_count++; + fparg_count++; + FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); + break; + + case FFI_TYPE_DOUBLE: + double_tmp = *(double *) *p_argv; + if (fparg_count < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = double_tmp; + *(double *)next_arg = double_tmp; +#ifdef POWERPC64 + next_arg++; + gp_count++; +#else + next_arg += 2; + gp_count += 2; +#endif + fparg_count++; + FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + + case FFI_TYPE_LONGDOUBLE: +# if defined(POWERPC64) && !defined(POWERPC_DARWIN64) + /* ??? This will exceed the regs count when the value starts at fp13 + and it will not put the extra bit on the stack. */ + if (fparg_count < NUM_FPR_ARG_REGISTERS) + *(long double *) fpr_base++ = *(long double *) *p_argv; + else + *(long double *) next_arg = *(long double *) *p_argv; + next_arg += 2; + fparg_count += 2; +# else + double_tmp = ((double *) *p_argv)[0]; + if (fparg_count < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = double_tmp; + *(double *) next_arg = double_tmp; +# if defined(POWERPC_DARWIN64) + next_arg++; + gp_count++; +# else + next_arg += 2; + gp_count += 2; +# endif + fparg_count++; + double_tmp = ((double *) *p_argv)[1]; + if (fparg_count < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = double_tmp; + *(double *) next_arg = double_tmp; +# if defined(POWERPC_DARWIN64) + next_arg++; + gp_count++; +# else + next_arg += 2; + gp_count += 2; +# endif + fparg_count++; +# endif + FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); + break; +#endif + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#ifdef POWERPC64 + gprvalue = *(long long *) *p_argv; + goto putgpr; +#else + *(long long *) next_arg = *(long long *) *p_argv; + next_arg += 2; + gp_count += 2; +#endif + break; + case FFI_TYPE_POINTER: + gprvalue = *(unsigned long *) *p_argv; + goto putgpr; + case FFI_TYPE_UINT8: + gprvalue = *(unsigned char *) *p_argv; + goto putgpr; + case FFI_TYPE_SINT8: + gprvalue = *(signed char *) *p_argv; + goto putgpr; + case FFI_TYPE_UINT16: + gprvalue = *(unsigned short *) *p_argv; + goto putgpr; + case FFI_TYPE_SINT16: + gprvalue = *(signed short *) *p_argv; + goto putgpr; + + case FFI_TYPE_STRUCT: + size_al = (*ptr)->size; +#if defined(POWERPC_DARWIN64) + next_arg = (unsigned long *)FFI_ALIGN((char *)next_arg, (*ptr)->alignment); + darwin64_pass_struct_by_value (*ptr, (char *) *p_argv, + (unsigned) size_al, + (unsigned int *) &fparg_count, + &fpr_base, &next_arg); +#else + dest_cpy = (char *) next_arg; + + /* If the first member of the struct is a double, then include enough + padding in the struct size to align it to double-word. */ + if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE) + size_al = FFI_ALIGN((*ptr)->size, 8); + +# if defined(POWERPC64) + FFI_ASSERT (abi != FFI_DARWIN); + memcpy ((char *) dest_cpy, (char *) *p_argv, size_al); + next_arg += (size_al + 7) / 8; +# else + /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, + SI 4 bytes) are aligned as if they were those modes. + Structures with 3 byte in size are padded upwards. */ + if (size_al < 3 && abi == FFI_DARWIN) + dest_cpy += 4 - size_al; + + memcpy((char *) dest_cpy, (char *) *p_argv, size_al); + next_arg += (size_al + 3) / 4; +# endif +#endif + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + gprvalue = *(signed int *) *p_argv; + goto putgpr; + + case FFI_TYPE_UINT32: + gprvalue = *(unsigned int *) *p_argv; + putgpr: + *next_arg++ = gprvalue; + gp_count++; + break; + default: + break; + } + } + + /* Check that we didn't overrun the stack... */ + /* FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS); + FFI_ASSERT((unsigned *)fpr_base + <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); + FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); */ +} + +#if defined(POWERPC_DARWIN64) + +/* See if we can put some of the struct into fprs. + This should not be called for structures of size 16 bytes, since these are not + broken out this way. */ +static void +darwin64_scan_struct_for_floats (ffi_type *s, unsigned *nfpr) +{ + int i; + + FFI_ASSERT (s->type == FFI_TYPE_STRUCT) + + for (i = 0; s->elements[i] != NULL; i++) + { + ffi_type *p = s->elements[i]; + switch (p->type) + { + case FFI_TYPE_STRUCT: + darwin64_scan_struct_for_floats (p, nfpr); + break; + case FFI_TYPE_LONGDOUBLE: + (*nfpr) += 2; + break; + case FFI_TYPE_DOUBLE: + case FFI_TYPE_FLOAT: + (*nfpr) += 1; + break; + default: + break; + } + } +} + +static int +darwin64_struct_size_exceeds_gprs_p (ffi_type *s, char *src, unsigned *nfpr) +{ + unsigned struct_offset=0, i; + + for (i = 0; s->elements[i] != NULL; i++) + { + char *item_base; + ffi_type *p = s->elements[i]; + /* Find the start of this item (0 for the first one). */ + if (i > 0) + struct_offset = FFI_ALIGN(struct_offset, p->alignment); + + item_base = src + struct_offset; + + switch (p->type) + { + case FFI_TYPE_STRUCT: + if (darwin64_struct_size_exceeds_gprs_p (p, item_base, nfpr)) + return 1; + break; + case FFI_TYPE_LONGDOUBLE: + if (*nfpr >= NUM_FPR_ARG_REGISTERS) + return 1; + (*nfpr) += 1; + item_base += 8; + /* FALL THROUGH */ + case FFI_TYPE_DOUBLE: + if (*nfpr >= NUM_FPR_ARG_REGISTERS) + return 1; + (*nfpr) += 1; + break; + case FFI_TYPE_FLOAT: + if (*nfpr >= NUM_FPR_ARG_REGISTERS) + return 1; + (*nfpr) += 1; + break; + default: + /* If we try and place any item, that is non-float, once we've + exceeded the 8 GPR mark, then we can't fit the struct. */ + if ((unsigned long)item_base >= 8*8) + return 1; + break; + } + /* now count the size of what we just used. */ + struct_offset += p->size; + } + return 0; +} + +/* Can this struct be returned by value? */ +int +darwin64_struct_ret_by_value_p (ffi_type *s) +{ + unsigned nfp = 0; + + FFI_ASSERT (s && s->type == FFI_TYPE_STRUCT); + + /* The largest structure we can return is 8long + 13 doubles. */ + if (s->size > 168) + return 0; + + /* We can't pass more than 13 floats. */ + darwin64_scan_struct_for_floats (s, &nfp); + if (nfp > 13) + return 0; + + /* If there are not too many floats, and the struct is + small enough to accommodate in the GPRs, then it must be OK. */ + if (s->size <= 64) + return 1; + + /* Well, we have to look harder. */ + nfp = 0; + if (darwin64_struct_size_exceeds_gprs_p (s, NULL, &nfp)) + return 0; + + return 1; +} + +void +darwin64_pass_struct_floats (ffi_type *s, char *src, + unsigned *nfpr, double **fprs) +{ + int i; + double *fpr_base = *fprs; + unsigned struct_offset = 0; + + /* We don't assume anything about the alignment of the source. */ + for (i = 0; s->elements[i] != NULL; i++) + { + char *item_base; + ffi_type *p = s->elements[i]; + /* Find the start of this item (0 for the first one). */ + if (i > 0) + struct_offset = FFI_ALIGN(struct_offset, p->alignment); + item_base = src + struct_offset; + + switch (p->type) + { + case FFI_TYPE_STRUCT: + darwin64_pass_struct_floats (p, item_base, nfpr, + &fpr_base); + break; + case FFI_TYPE_LONGDOUBLE: + if (*nfpr < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = *(double *)item_base; + (*nfpr) += 1; + item_base += 8; + /* FALL THROUGH */ + case FFI_TYPE_DOUBLE: + if (*nfpr < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = *(double *)item_base; + (*nfpr) += 1; + break; + case FFI_TYPE_FLOAT: + if (*nfpr < NUM_FPR_ARG_REGISTERS) + *fpr_base++ = (double) *(float *)item_base; + (*nfpr) += 1; + break; + default: + break; + } + /* now count the size of what we just used. */ + struct_offset += p->size; + } + /* Update the scores. */ + *fprs = fpr_base; +} + +/* Darwin64 special rules. + Break out a struct into params and float registers. */ +static void +darwin64_pass_struct_by_value (ffi_type *s, char *src, unsigned size, + unsigned *nfpr, double **fprs, unsigned long **arg) +{ + unsigned long *next_arg = *arg; + char *dest_cpy = (char *)next_arg; + + FFI_ASSERT (s->type == FFI_TYPE_STRUCT) + + if (!size) + return; + + /* First... special cases. */ + if (size < 3 + || (size == 4 + && s->elements[0] + && s->elements[0]->type != FFI_TYPE_FLOAT)) + { + /* Must be at least one GPR, padding is unspecified in value, + let's make it zero. */ + *next_arg = 0UL; + dest_cpy += 8 - size; + memcpy ((char *) dest_cpy, src, size); + next_arg++; + } + else if (size == 16) + { + memcpy ((char *) dest_cpy, src, size); + next_arg += 2; + } + else + { + /* now the general case, we consider embedded floats. */ + memcpy ((char *) dest_cpy, src, size); + darwin64_pass_struct_floats (s, src, nfpr, fprs); + next_arg += (size+7)/8; + } + + *arg = next_arg; +} + +double * +darwin64_struct_floats_to_mem (ffi_type *s, char *dest, double *fprs, unsigned *nf) +{ + int i; + unsigned struct_offset = 0; + + /* We don't assume anything about the alignment of the source. */ + for (i = 0; s->elements[i] != NULL; i++) + { + char *item_base; + ffi_type *p = s->elements[i]; + /* Find the start of this item (0 for the first one). */ + if (i > 0) + struct_offset = FFI_ALIGN(struct_offset, p->alignment); + item_base = dest + struct_offset; + + switch (p->type) + { + case FFI_TYPE_STRUCT: + fprs = darwin64_struct_floats_to_mem (p, item_base, fprs, nf); + break; + case FFI_TYPE_LONGDOUBLE: + if (*nf < NUM_FPR_ARG_REGISTERS) + { + *(double *)item_base = *fprs++ ; + (*nf) += 1; + } + item_base += 8; + /* FALL THROUGH */ + case FFI_TYPE_DOUBLE: + if (*nf < NUM_FPR_ARG_REGISTERS) + { + *(double *)item_base = *fprs++ ; + (*nf) += 1; + } + break; + case FFI_TYPE_FLOAT: + if (*nf < NUM_FPR_ARG_REGISTERS) + { + *(float *)item_base = (float) *fprs++ ; + (*nf) += 1; + } + break; + default: + break; + } + /* now count the size of what we just used. */ + struct_offset += p->size; + } + return fprs; +} + +#endif + +/* Adjust the size of S to be correct for Darwin. + On Darwin m32, the first field of a structure has natural alignment. + On Darwin m64, all fields have natural alignment. */ + +static void +darwin_adjust_aggregate_sizes (ffi_type *s) +{ + int i; + + if (s->type != FFI_TYPE_STRUCT) + return; + + s->size = 0; + for (i = 0; s->elements[i] != NULL; i++) + { + ffi_type *p; + int align; + + p = s->elements[i]; + if (p->type == FFI_TYPE_STRUCT) + darwin_adjust_aggregate_sizes (p); +#if defined(POWERPC_DARWIN64) + /* Natural alignment for all items. */ + align = p->alignment; +#else + /* Natural alignment for the first item... */ + if (i == 0) + align = p->alignment; + else if (p->alignment == 16 || p->alignment < 4) + /* .. subsequent items with vector or align < 4 have natural align. */ + align = p->alignment; + else + /* .. or align is 4. */ + align = 4; +#endif + /* Pad, if necessary, before adding the current item. */ + s->size = FFI_ALIGN(s->size, align) + p->size; + } + + s->size = FFI_ALIGN(s->size, s->alignment); + + /* This should not be necessary on m64, but harmless. */ + if (s->elements[0]->type == FFI_TYPE_UINT64 + || s->elements[0]->type == FFI_TYPE_SINT64 + || s->elements[0]->type == FFI_TYPE_DOUBLE + || s->elements[0]->alignment == 8) + s->alignment = s->alignment > 8 ? s->alignment : 8; + /* Do not add additional tail padding. */ +} + +/* Adjust the size of S to be correct for AIX. + Word-align double unless it is the first member of a structure. */ + +static void +aix_adjust_aggregate_sizes (ffi_type *s) +{ + int i; + + if (s->type != FFI_TYPE_STRUCT) + return; + + s->size = 0; + for (i = 0; s->elements[i] != NULL; i++) + { + ffi_type *p; + int align; + + p = s->elements[i]; + aix_adjust_aggregate_sizes (p); + align = p->alignment; + if (i != 0 && p->type == FFI_TYPE_DOUBLE) + align = 4; + s->size = FFI_ALIGN(s->size, align) + p->size; + } + + s->size = FFI_ALIGN(s->size, s->alignment); + + if (s->elements[0]->type == FFI_TYPE_UINT64 + || s->elements[0]->type == FFI_TYPE_SINT64 + || s->elements[0]->type == FFI_TYPE_DOUBLE + || s->elements[0]->alignment == 8) + s->alignment = s->alignment > 8 ? s->alignment : 8; + /* Do not add additional tail padding. */ +} + +/* Perform machine dependent cif processing. */ +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + /* All this is for the DARWIN ABI. */ + unsigned i; + ffi_type **ptr; + unsigned bytes; + unsigned fparg_count = 0, intarg_count = 0; + unsigned flags = 0; + unsigned size_al = 0; + + /* All the machine-independent calculation of cif->bytes will be wrong. + All the calculation of structure sizes will also be wrong. + Redo the calculation for DARWIN. */ + + if (cif->abi == FFI_DARWIN) + { + darwin_adjust_aggregate_sizes (cif->rtype); + for (i = 0; i < cif->nargs; i++) + darwin_adjust_aggregate_sizes (cif->arg_types[i]); + } + + if (cif->abi == FFI_AIX) + { + aix_adjust_aggregate_sizes (cif->rtype); + for (i = 0; i < cif->nargs; i++) + aix_adjust_aggregate_sizes (cif->arg_types[i]); + } + + /* Space for the frame pointer, callee's LR, CR, etc, and for + the asm's temp regs. */ + + bytes = (LINKAGE_AREA_GPRS + ASM_NEEDS_REGISTERS) * sizeof(unsigned long); + + /* Return value handling. + The rules m32 are as follows: + - 32-bit (or less) integer values are returned in gpr3; + - structures of size <= 4 bytes also returned in gpr3; + - 64-bit integer values [??? and structures between 5 and 8 bytes] are + returned in gpr3 and gpr4; + - Single/double FP values are returned in fpr1; + - Long double FP (if not equivalent to double) values are returned in + fpr1 and fpr2; + m64: + - 64-bit or smaller integral values are returned in GPR3 + - Single/double FP values are returned in fpr1; + - Long double FP values are returned in fpr1 and fpr2; + m64 Structures: + - If the structure could be accommodated in registers were it to be the + first argument to a routine, then it is returned in those registers. + m32/m64 structures otherwise: + - Larger structures values are allocated space and a pointer is passed + as the first argument. */ + switch (cif->rtype->type) + { + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + flags |= FLAG_RETURNS_128BITS; + flags |= FLAG_RETURNS_FP; + break; +#endif + + case FFI_TYPE_DOUBLE: + flags |= FLAG_RETURNS_64BITS; + /* Fall through. */ + case FFI_TYPE_FLOAT: + flags |= FLAG_RETURNS_FP; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#ifdef POWERPC64 + case FFI_TYPE_POINTER: +#endif + flags |= FLAG_RETURNS_64BITS; + break; + + case FFI_TYPE_STRUCT: +#if defined(POWERPC_DARWIN64) + { + /* Can we fit the struct into regs? */ + if (darwin64_struct_ret_by_value_p (cif->rtype)) + { + unsigned nfpr = 0; + flags |= FLAG_RETURNS_STRUCT; + if (cif->rtype->size != 16) + darwin64_scan_struct_for_floats (cif->rtype, &nfpr) ; + else + flags |= FLAG_RETURNS_128BITS; + /* Will be 0 for 16byte struct. */ + if (nfpr) + flags |= FLAG_RETURNS_FP; + } + else /* By ref. */ + { + flags |= FLAG_RETVAL_REFERENCE; + flags |= FLAG_RETURNS_NOTHING; + intarg_count++; + } + } +#elif defined(DARWIN_PPC) + if (cif->rtype->size <= 4) + flags |= FLAG_RETURNS_STRUCT; + else /* else by reference. */ + { + flags |= FLAG_RETVAL_REFERENCE; + flags |= FLAG_RETURNS_NOTHING; + intarg_count++; + } +#else /* assume we pass by ref. */ + flags |= FLAG_RETVAL_REFERENCE; + flags |= FLAG_RETURNS_NOTHING; + intarg_count++; +#endif + break; + case FFI_TYPE_VOID: + flags |= FLAG_RETURNS_NOTHING; + break; + + default: + /* Returns 32-bit integer, or similar. Nothing to do here. */ + break; + } + + /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the + first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest + goes on the stack. + ??? Structures are passed as a pointer to a copy of the structure. + Stuff on the stack needs to keep proper alignment. + For m64 the count is effectively of half-GPRs. */ + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + unsigned align_words; + switch ((*ptr)->type) + { + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + fparg_count++; +#if !defined(POWERPC_DARWIN64) + /* If this FP arg is going on the stack, it must be + 8-byte-aligned. */ + if (fparg_count > NUM_FPR_ARG_REGISTERS + && (intarg_count & 0x01) != 0) + intarg_count++; +#endif + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + fparg_count += 2; + /* If this FP arg is going on the stack, it must be + 16-byte-aligned. */ + if (fparg_count >= NUM_FPR_ARG_REGISTERS) +#if defined (POWERPC64) + intarg_count = FFI_ALIGN(intarg_count, 2); +#else + intarg_count = FFI_ALIGN(intarg_count, 4); +#endif + break; +#endif + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#if defined(POWERPC64) + intarg_count++; +#else + /* 'long long' arguments are passed as two words, but + either both words must fit in registers or both go + on the stack. If they go on the stack, they must + be 8-byte-aligned. */ + if (intarg_count == NUM_GPR_ARG_REGISTERS-1 + || (intarg_count >= NUM_GPR_ARG_REGISTERS + && (intarg_count & 0x01) != 0)) + intarg_count++; + intarg_count += 2; +#endif + break; + + case FFI_TYPE_STRUCT: + size_al = (*ptr)->size; +#if defined(POWERPC_DARWIN64) + align_words = (*ptr)->alignment >> 3; + if (align_words) + intarg_count = FFI_ALIGN(intarg_count, align_words); + /* Base size of the struct. */ + intarg_count += (size_al + 7) / 8; + /* If 16 bytes then don't worry about floats. */ + if (size_al != 16) + /* Scan through for floats to be placed in regs. */ + darwin64_scan_struct_for_floats (*ptr, &fparg_count) ; +#else + align_words = (*ptr)->alignment >> 2; + if (align_words) + intarg_count = FFI_ALIGN(intarg_count, align_words); + /* If the first member of the struct is a double, then align + the struct to double-word. + if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE) + size_al = FFI_ALIGN((*ptr)->size, 8); */ +# ifdef POWERPC64 + intarg_count += (size_al + 7) / 8; +# else + intarg_count += (size_al + 3) / 4; +# endif +#endif + break; + + default: + /* Everything else is passed as a 4-byte word in a GPR, either + the object itself or a pointer to it. */ + intarg_count++; + break; + } + } + + if (fparg_count != 0) + flags |= FLAG_FP_ARGUMENTS; + +#if defined(POWERPC_DARWIN64) + /* Space to image the FPR registers, if needed - which includes when they might be + used in a struct return. */ + if (fparg_count != 0 + || ((flags & FLAG_RETURNS_STRUCT) + && (flags & FLAG_RETURNS_FP))) + bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); +#else + /* Space for the FPR registers, if needed. */ + if (fparg_count != 0) + bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); +#endif + + /* Stack space. */ +#ifdef POWERPC64 + if ((intarg_count + fparg_count) > NUM_GPR_ARG_REGISTERS) + bytes += (intarg_count + fparg_count) * sizeof(long); +#else + if ((intarg_count + 2 * fparg_count) > NUM_GPR_ARG_REGISTERS) + bytes += (intarg_count + 2 * fparg_count) * sizeof(long); +#endif + else + bytes += NUM_GPR_ARG_REGISTERS * sizeof(long); + + /* The stack space allocated needs to be a multiple of 16 bytes. */ + bytes = FFI_ALIGN(bytes, 16) ; + + cif->flags = flags; + cif->bytes = bytes; + + return FFI_OK; +} + +extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *, + void (*fn)(void), void (*fn2)(void)); + +#if defined (FFI_GO_CLOSURES) +extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *, + void (*fn)(void), void (*fn2)(void), void *closure); +#endif + +extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *, + void (*fn)(void), void (*fn2)(void), ffi_type*); + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return + value address then we need to make one. */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca (cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_AIX: + ffi_call_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, + FFI_FN(ffi_prep_args)); + break; + case FFI_DARWIN: + ffi_call_DARWIN(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, + FFI_FN(ffi_prep_args), cif->rtype); + break; + default: + FFI_ASSERT(0); + break; + } +} + +#if defined (FFI_GO_CLOSURES) +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, + void *closure) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return + value address then we need to make one. */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca (cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_AIX: + ffi_call_go_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, + FFI_FN(ffi_prep_args), closure); + break; + default: + FFI_ASSERT(0); + break; + } +} +#endif + +static void flush_icache(char *); +static void flush_range(char *, int); + +/* The layout of a function descriptor. A C function pointer really + points to one of these. */ + +typedef struct aix_fd_struct { + void *code_pointer; + void *toc; +} aix_fd; + +/* here I'd like to add the stack frame layout we use in darwin_closure.S + and aix_closure.S + + m32/m64 + + The stack layout looks like this: + + | Additional params... | | Higher address + ~ ~ ~ + | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS + |--------------------------------------------| | + | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | + |--------------------------------------------| | + | Reserved 2*4/8 | | + |--------------------------------------------| | + | Space for callee's LR 4/8 | | + |--------------------------------------------| | + | Saved CR [low word for m64] 4/8 | | + |--------------------------------------------| | + | Current backchain pointer 4/8 |-/ Parent's frame. + |--------------------------------------------| <+ <<< on entry to ffi_closure_ASM + | Result Bytes 16 | | + |--------------------------------------------| | + ~ padding to 16-byte alignment ~ ~ + |--------------------------------------------| | + | NUM_FPR_ARG_REGISTERS slots | | + | here fp13 .. fp1 13*8 | | + |--------------------------------------------| | + | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS + |--------------------------------------------| | + | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | + |--------------------------------------------| | stack | + | Reserved [compiler,binder] 2*4/8 | | grows | + |--------------------------------------------| | down V + | Space for callee's LR 4/8 | | + |--------------------------------------------| | lower addresses + | Saved CR [low word for m64] 4/8 | | + |--------------------------------------------| | stack pointer here + | Current backchain pointer 4/8 |-/ during + |--------------------------------------------| <<< ffi_closure_ASM. + +*/ + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp; + struct ffi_aix_trampoline_struct *tramp_aix; + aix_fd *fd; + + switch (cif->abi) + { + case FFI_DARWIN: + + FFI_ASSERT (cif->abi == FFI_DARWIN); + + tramp = (unsigned int *) &closure->tramp[0]; +#if defined(POWERPC_DARWIN64) + tramp[0] = 0x7c0802a6; /* mflr r0 */ + tramp[1] = 0x429f0015; /* bcl- 20,4*cr7+so, +0x18 (L1) */ + /* We put the addresses here. */ + tramp[6] = 0x7d6802a6; /*L1: mflr r11 */ + tramp[7] = 0xe98b0000; /* ld r12,0(r11) function address */ + tramp[8] = 0x7c0803a6; /* mtlr r0 */ + tramp[9] = 0x7d8903a6; /* mtctr r12 */ + tramp[10] = 0xe96b0008; /* lwz r11,8(r11) static chain */ + tramp[11] = 0x4e800420; /* bctr */ + + *((unsigned long *)&tramp[2]) = (unsigned long) ffi_closure_ASM; /* function */ + *((unsigned long *)&tramp[4]) = (unsigned long) codeloc; /* context */ +#else + tramp[0] = 0x7c0802a6; /* mflr r0 */ + tramp[1] = 0x429f000d; /* bcl- 20,4*cr7+so,0x10 */ + tramp[4] = 0x7d6802a6; /* mflr r11 */ + tramp[5] = 0x818b0000; /* lwz r12,0(r11) function address */ + tramp[6] = 0x7c0803a6; /* mtlr r0 */ + tramp[7] = 0x7d8903a6; /* mtctr r12 */ + tramp[8] = 0x816b0004; /* lwz r11,4(r11) static chain */ + tramp[9] = 0x4e800420; /* bctr */ + tramp[2] = (unsigned long) ffi_closure_ASM; /* function */ + tramp[3] = (unsigned long) codeloc; /* context */ +#endif + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Flush the icache. Only necessary on Darwin. */ + flush_range(codeloc, FFI_TRAMPOLINE_SIZE); + + break; + + case FFI_AIX: + + tramp_aix = (struct ffi_aix_trampoline_struct *) (closure->tramp); + fd = (aix_fd *)(void *)ffi_closure_ASM; + + FFI_ASSERT (cif->abi == FFI_AIX); + + tramp_aix->code_pointer = fd->code_pointer; + tramp_aix->toc = fd->toc; + tramp_aix->static_chain = codeloc; + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + break; + + default: + return FFI_BAD_ABI; + break; + } + return FFI_OK; +} + +#if defined (FFI_GO_CLOSURES) +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ + switch (cif->abi) + { + case FFI_AIX: + + FFI_ASSERT (cif->abi == FFI_AIX); + + closure->tramp = (void *)ffi_go_closure_ASM; + closure->cif = cif; + closure->fun = fun; + return FFI_OK; + + // For now, ffi_prep_go_closure is only implemented for AIX, not for Darwin + default: + return FFI_BAD_ABI; + break; + } + return FFI_OK; +} +#endif + +static void +flush_icache(char *addr) +{ +#ifndef _AIX + __asm__ volatile ( + "dcbf 0,%0\n" + "\tsync\n" + "\ticbi 0,%0\n" + "\tsync\n" + "\tisync" + : : "r"(addr) : "memory"); +#endif +} + +static void +flush_range(char * addr1, int size) +{ +#define MIN_LINE_SIZE 32 + int i; + for (i = 0; i < size; i += MIN_LINE_SIZE) + flush_icache(addr1+i); + flush_icache(addr1+size-1); +} + +typedef union +{ + float f; + double d; +} ffi_dblfl; + +ffi_type * +ffi_closure_helper_DARWIN (ffi_closure *, void *, + unsigned long *, ffi_dblfl *); + +#if defined (FFI_GO_CLOSURES) +ffi_type * +ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *, + unsigned long *, ffi_dblfl *); +#endif + +/* Basically the trampoline invokes ffi_closure_ASM, and on + entry, r11 holds the address of the closure. + After storing the registers that could possibly contain + parameters to be passed into the stack frame and setting + up space for a return value, ffi_closure_ASM invokes the + following helper function to do most of the work. */ + +static ffi_type * +ffi_closure_helper_common (ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, void *rvalue, + unsigned long *pgr, ffi_dblfl *pfr) +{ + /* rvalue is the pointer to space for return value in closure assembly + pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM + pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */ + + typedef double ldbits[2]; + + union ldu + { + ldbits lb; + long double ld; + }; + + void ** avalue; + ffi_type ** arg_types; + long i, avn; + ffi_dblfl * end_pfr = pfr + NUM_FPR_ARG_REGISTERS; + unsigned size_al; +#if defined(POWERPC_DARWIN64) + unsigned fpsused = 0; +#endif + + avalue = alloca (cif->nargs * sizeof(void *)); + + if (cif->rtype->type == FFI_TYPE_STRUCT) + { +#if defined(POWERPC_DARWIN64) + if (!darwin64_struct_ret_by_value_p (cif->rtype)) + { + /* Won't fit into the regs - return by ref. */ + rvalue = (void *) *pgr; + pgr++; + } +#elif defined(DARWIN_PPC) + if (cif->rtype->size > 4) + { + rvalue = (void *) *pgr; + pgr++; + } +#else /* assume we return by ref. */ + rvalue = (void *) *pgr; + pgr++; +#endif + } + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: +#if defined(POWERPC64) + avalue[i] = (char *) pgr + 7; +#else + avalue[i] = (char *) pgr + 3; +#endif + pgr++; + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: +#if defined(POWERPC64) + avalue[i] = (char *) pgr + 6; +#else + avalue[i] = (char *) pgr + 2; +#endif + pgr++; + break; + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: +#if defined(POWERPC64) + avalue[i] = (char *) pgr + 4; +#else + case FFI_TYPE_POINTER: + avalue[i] = pgr; +#endif + pgr++; + break; + + case FFI_TYPE_STRUCT: + size_al = arg_types[i]->size; +#if defined(POWERPC_DARWIN64) + pgr = (unsigned long *)FFI_ALIGN((char *)pgr, arg_types[i]->alignment); + if (size_al < 3 || size_al == 4) + { + avalue[i] = ((char *)pgr)+8-size_al; + if (arg_types[i]->elements[0]->type == FFI_TYPE_FLOAT + && fpsused < NUM_FPR_ARG_REGISTERS) + { + *(float *)pgr = (float) *(double *)pfr; + pfr++; + fpsused++; + } + } + else + { + if (size_al != 16) + pfr = (ffi_dblfl *) + darwin64_struct_floats_to_mem (arg_types[i], (char *)pgr, + (double *)pfr, &fpsused); + avalue[i] = pgr; + } + pgr += (size_al + 7) / 8; +#else + /* If the first member of the struct is a double, then align + the struct to double-word. */ + if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE) + size_al = FFI_ALIGN(arg_types[i]->size, 8); +# if defined(POWERPC64) + FFI_ASSERT (cif->abi != FFI_DARWIN); + avalue[i] = pgr; + pgr += (size_al + 7) / 8; +# else + /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, + SI 4 bytes) are aligned as if they were those modes. */ + if (size_al < 3 && cif->abi == FFI_DARWIN) + avalue[i] = (char*) pgr + 4 - size_al; + else + avalue[i] = pgr; + pgr += (size_al + 3) / 4; +# endif +#endif + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: +#if defined(POWERPC64) + case FFI_TYPE_POINTER: + avalue[i] = pgr; + pgr++; + break; +#else + /* Long long ints are passed in two gpr's. */ + avalue[i] = pgr; + pgr += 2; + break; +#endif + + case FFI_TYPE_FLOAT: + /* A float value consumes a GPR. + There are 13 64bit floating point registers. */ + if (pfr < end_pfr) + { + double temp = pfr->d; + pfr->f = (float) temp; + avalue[i] = pfr; + pfr++; + } + else + { + avalue[i] = pgr; + } + pgr++; + break; + + case FFI_TYPE_DOUBLE: + /* A double value consumes two GPRs. + There are 13 64bit floating point registers. */ + if (pfr < end_pfr) + { + avalue[i] = pfr; + pfr++; + } + else + { + avalue[i] = pgr; + } +#ifdef POWERPC64 + pgr++; +#else + pgr += 2; +#endif + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + + case FFI_TYPE_LONGDOUBLE: +#ifdef POWERPC64 + if (pfr + 1 < end_pfr) + { + avalue[i] = pfr; + pfr += 2; + } + else + { + if (pfr < end_pfr) + { + *pgr = *(unsigned long *) pfr; + pfr++; + } + avalue[i] = pgr; + } + pgr += 2; +#else /* POWERPC64 */ + /* A long double value consumes four GPRs and two FPRs. + There are 13 64bit floating point registers. */ + if (pfr + 1 < end_pfr) + { + avalue[i] = pfr; + pfr += 2; + } + /* Here we have the situation where one part of the long double + is stored in fpr13 and the other part is already on the stack. + We use a union to pass the long double to avalue[i]. */ + else if (pfr + 1 == end_pfr) + { + union ldu temp_ld; + memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits)); + memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits)); + avalue[i] = &temp_ld.ld; + pfr++; + } + else + { + avalue[i] = pgr; + } + pgr += 4; +#endif /* POWERPC64 */ + break; +#endif + default: + FFI_ASSERT(0); + } + i++; + } + + (fun) (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_ASM to perform return type promotions. */ + return cif->rtype; +} + +ffi_type * +ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue, + unsigned long *pgr, ffi_dblfl *pfr) +{ + return ffi_closure_helper_common (closure->cif, closure->fun, + closure->user_data, rvalue, pgr, pfr); +} + +#if defined (FFI_GO_CLOSURES) +ffi_type * +ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue, + unsigned long *pgr, ffi_dblfl *pfr) +{ + return ffi_closure_helper_common (closure->cif, closure->fun, + closure, rvalue, pgr, pfr); +} +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c new file mode 100644 index 0000000..4d50878 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c @@ -0,0 +1,1153 @@ +/* ----------------------------------------------------------------------- + ffi_linux64.c - Copyright (C) 2013 IBM + Copyright (C) 2011 Anthony Green + Copyright (C) 2011 Kyle Moffett + Copyright (C) 2008 Red Hat, Inc + Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (c) 1998 Geoffrey Keating + + PowerPC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include "ffi.h" + +#ifdef POWERPC64 +#include "ffi_common.h" +#include "ffi_powerpc.h" + + +/* About the LINUX64 ABI. */ +enum { + NUM_GPR_ARG_REGISTERS64 = 8, + NUM_FPR_ARG_REGISTERS64 = 13, + NUM_VEC_ARG_REGISTERS64 = 12, +}; +enum { ASM_NEEDS_REGISTERS64 = 4 }; + + +#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +/* Adjust size of ffi_type_longdouble. */ +void FFI_HIDDEN +ffi_prep_types_linux64 (ffi_abi abi) +{ + if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX) + { + ffi_type_longdouble.size = 8; + ffi_type_longdouble.alignment = 8; + } + else + { + ffi_type_longdouble.size = 16; + ffi_type_longdouble.alignment = 16; + } +} +#endif + + +static unsigned int +discover_homogeneous_aggregate (ffi_abi abi, + const ffi_type *t, + unsigned int *elnum) +{ + switch (t->type) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + /* 64-bit long doubles are equivalent to doubles. */ + if ((abi & FFI_LINUX_LONG_DOUBLE_128) == 0) + { + *elnum = 1; + return FFI_TYPE_DOUBLE; + } + /* IBM extended precision values use unaligned pairs + of FPRs, but according to the ABI must be considered + distinct from doubles. They are also limited to a + maximum of four members in a homogeneous aggregate. */ + else if ((abi & FFI_LINUX_LONG_DOUBLE_IEEE128) == 0) + { + *elnum = 2; + return FFI_TYPE_LONGDOUBLE; + } + /* Fall through. */ +#endif + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + *elnum = 1; + return (int) t->type; + + case FFI_TYPE_STRUCT:; + { + unsigned int base_elt = 0, total_elnum = 0; + ffi_type **el = t->elements; + while (*el) + { + unsigned int el_elt, el_elnum = 0; + el_elt = discover_homogeneous_aggregate (abi, *el, &el_elnum); + if (el_elt == 0 + || (base_elt && base_elt != el_elt)) + return 0; + base_elt = el_elt; + total_elnum += el_elnum; +#if _CALL_ELF == 2 + if (total_elnum > 8) + return 0; +#else + if (total_elnum > 1) + return 0; +#endif + el++; + } + *elnum = total_elnum; + return base_elt; + } + + default: + return 0; + } +} + + +/* Perform machine dependent cif processing */ +static ffi_status +ffi_prep_cif_linux64_core (ffi_cif *cif) +{ + ffi_type **ptr; + unsigned bytes; + unsigned i, fparg_count = 0, intarg_count = 0, vecarg_count = 0; + unsigned flags = cif->flags; + unsigned elt, elnum, rtype; + +#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE + /* If compiled without long double support... */ + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0 || + (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + return FFI_BAD_ABI; +#elif !defined(__VEC__) + /* If compiled without vector register support (used by assembly)... */ + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + return FFI_BAD_ABI; +#else + /* If the IEEE128 flag is set, but long double is only 64 bits wide... */ + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) == 0 && + (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + return FFI_BAD_ABI; +#endif + + /* The machine-independent calculation of cif->bytes doesn't work + for us. Redo the calculation. */ +#if _CALL_ELF == 2 + /* Space for backchain, CR, LR, TOC and the asm's temp regs. */ + bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long); + + /* Space for the general registers. */ + bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long); +#else + /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp + regs. */ + bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long); + + /* Space for the mandatory parm save area and general registers. */ + bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long); +#endif + + /* Return value handling. */ + rtype = cif->rtype->type; +#if _CALL_ELF == 2 +homogeneous: +#endif + switch (rtype) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + flags |= FLAG_RETURNS_VEC; + break; + } + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) + flags |= FLAG_RETURNS_128BITS; + /* Fall through. */ +#endif + case FFI_TYPE_DOUBLE: + flags |= FLAG_RETURNS_64BITS; + /* Fall through. */ + case FFI_TYPE_FLOAT: + flags |= FLAG_RETURNS_FP; + break; + + case FFI_TYPE_UINT128: + flags |= FLAG_RETURNS_128BITS; + /* Fall through. */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + flags |= FLAG_RETURNS_64BITS; + break; + + case FFI_TYPE_STRUCT: +#if _CALL_ELF == 2 + elt = discover_homogeneous_aggregate (cif->abi, cif->rtype, &elnum); + if (elt) + { + flags |= FLAG_RETURNS_SMST; + rtype = elt; + goto homogeneous; + } + if (cif->rtype->size <= 16) + { + flags |= FLAG_RETURNS_SMST; + break; + } +#endif + intarg_count++; + flags |= FLAG_RETVAL_REFERENCE; + /* Fall through. */ + case FFI_TYPE_VOID: + flags |= FLAG_RETURNS_NOTHING; + break; + + default: + /* Returns 32-bit integer, or similar. Nothing to do here. */ + break; + } + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + unsigned int align; + + switch ((*ptr)->type) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + vecarg_count++; + /* Align to 16 bytes, plus the 16-byte argument. */ + intarg_count = (intarg_count + 3) & ~0x1; + if (vecarg_count > NUM_VEC_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + break; + } + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) + { + fparg_count++; + intarg_count++; + } + /* Fall through. */ +#endif + case FFI_TYPE_DOUBLE: + case FFI_TYPE_FLOAT: + fparg_count++; + intarg_count++; + if (fparg_count > NUM_FPR_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + break; + + case FFI_TYPE_STRUCT: + if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) + { + align = (*ptr)->alignment; + if (align > 16) + align = 16; + align = align / 8; + if (align > 1) + intarg_count = FFI_ALIGN (intarg_count, align); + } + intarg_count += ((*ptr)->size + 7) / 8; + elt = discover_homogeneous_aggregate (cif->abi, *ptr, &elnum); +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + if (elt == FFI_TYPE_LONGDOUBLE && + (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + vecarg_count += elnum; + if (vecarg_count > NUM_VEC_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + break; + } + else +#endif + if (elt) + { + fparg_count += elnum; + if (fparg_count > NUM_FPR_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + } + else + { + if (intarg_count > NUM_GPR_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + } + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + /* Everything else is passed as a 8-byte word in a GPR, either + the object itself or a pointer to it. */ + intarg_count++; + if (intarg_count > NUM_GPR_ARG_REGISTERS64) + flags |= FLAG_ARG_NEEDS_PSAVE; + break; + default: + FFI_ASSERT (0); + } + } + + if (fparg_count != 0) + flags |= FLAG_FP_ARGUMENTS; + if (intarg_count > 4) + flags |= FLAG_4_GPR_ARGUMENTS; + if (vecarg_count != 0) + flags |= FLAG_VEC_ARGUMENTS; + + /* Space for the FPR registers, if needed. */ + if (fparg_count != 0) + bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double); + /* Space for the vector registers, if needed, aligned to 16 bytes. */ + if (vecarg_count != 0) { + bytes = (bytes + 15) & ~0xF; + bytes += NUM_VEC_ARG_REGISTERS64 * sizeof (float128); + } + + /* Stack space. */ +#if _CALL_ELF == 2 + if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0) + bytes += intarg_count * sizeof (long); +#else + if (intarg_count > NUM_GPR_ARG_REGISTERS64) + bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); +#endif + + /* The stack space allocated needs to be a multiple of 16 bytes. */ + bytes = (bytes + 15) & ~0xF; + + cif->flags = flags; + cif->bytes = bytes; + + return FFI_OK; +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_linux64 (ffi_cif *cif) +{ + if ((cif->abi & FFI_LINUX) != 0) + cif->nfixedargs = cif->nargs; +#if _CALL_ELF != 2 + else if (cif->abi == FFI_COMPAT_LINUX64) + { + /* This call is from old code. Don't touch cif->nfixedargs + since old code will be using a smaller cif. */ + cif->flags |= FLAG_COMPAT; + /* Translate to new abi value. */ + cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; + } +#endif + else + return FFI_BAD_ABI; + return ffi_prep_cif_linux64_core (cif); +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_linux64_var (ffi_cif *cif, + unsigned int nfixedargs, + unsigned int ntotalargs MAYBE_UNUSED) +{ + if ((cif->abi & FFI_LINUX) != 0) + cif->nfixedargs = nfixedargs; +#if _CALL_ELF != 2 + else if (cif->abi == FFI_COMPAT_LINUX64) + { + /* This call is from old code. Don't touch cif->nfixedargs + since old code will be using a smaller cif. */ + cif->flags |= FLAG_COMPAT; + /* Translate to new abi value. */ + cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; + } +#endif + else + return FFI_BAD_ABI; +#if _CALL_ELF == 2 + cif->flags |= FLAG_ARG_NEEDS_PSAVE; +#endif + return ffi_prep_cif_linux64_core (cif); +} + + +/* ffi_prep_args64 is called by the assembly routine once stack space + has been allocated for the function's arguments. + + The stack layout we want looks like this: + + | Ret addr from ffi_call_LINUX64 8bytes | higher addresses + |--------------------------------------------| + | CR save area 8bytes | + |--------------------------------------------| + | Previous backchain pointer 8 | stack pointer here + |--------------------------------------------|<+ <<< on entry to + | Saved r28-r31 4*8 | | ffi_call_LINUX64 + |--------------------------------------------| | + | GPR registers r3-r10 8*8 | | + |--------------------------------------------| | + | FPR registers f1-f13 (optional) 13*8 | | + |--------------------------------------------| | + | VEC registers v2-v13 (optional) 12*16 | | + |--------------------------------------------| | + | Parameter save area | | + |--------------------------------------------| | + | TOC save area 8 | | + |--------------------------------------------| | stack | + | Linker doubleword 8 | | grows | + |--------------------------------------------| | down V + | Compiler doubleword 8 | | + |--------------------------------------------| | lower addresses + | Space for callee's LR 8 | | + |--------------------------------------------| | + | CR save area 8 | | + |--------------------------------------------| | stack pointer here + | Current backchain pointer 8 |-/ during + |--------------------------------------------| <<< ffi_call_LINUX64 + +*/ + +void FFI_HIDDEN +ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) +{ + const unsigned long bytes = ecif->cif->bytes; + const unsigned long flags = ecif->cif->flags; + + typedef union + { + char *c; + unsigned long *ul; + float *f; + double *d; + float128 *f128; + size_t p; + } valp; + + /* 'stacktop' points at the previous backchain pointer. */ + valp stacktop; + + /* 'next_arg' points at the space for gpr3, and grows upwards as + we use GPR registers, then continues at rest. */ + valp gpr_base; + valp gpr_end; + valp rest; + valp next_arg; + + /* 'fpr_base' points at the space for f1, and grows upwards as + we use FPR registers. */ + valp fpr_base; + unsigned int fparg_count; + + /* 'vec_base' points at the space for v2, and grows upwards as + we use vector registers. */ + valp vec_base; + unsigned int vecarg_count; + + unsigned int i, words, nargs, nfixedargs; + ffi_type **ptr; + double double_tmp; + union + { + void **v; + char **c; + signed char **sc; + unsigned char **uc; + signed short **ss; + unsigned short **us; + signed int **si; + unsigned int **ui; + unsigned long **ul; + float **f; + double **d; + float128 **f128; + } p_argv; + unsigned long gprvalue; + unsigned long align; + + stacktop.c = (char *) stack + bytes; + gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64; + gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64; +#if _CALL_ELF == 2 + rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64; +#else + rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64; +#endif + fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64; + fparg_count = 0; + /* Place the vector args below the FPRs, if used, else the GPRs. */ + if (ecif->cif->flags & FLAG_FP_ARGUMENTS) + vec_base.p = fpr_base.p & ~0xF; + else + vec_base.p = gpr_base.p; + vec_base.f128 -= NUM_VEC_ARG_REGISTERS64; + vecarg_count = 0; + next_arg.ul = gpr_base.ul; + + /* Check that everything starts aligned properly. */ + FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); + FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); + FFI_ASSERT (((unsigned long) gpr_base.c & 0xF) == 0); + FFI_ASSERT (((unsigned long) gpr_end.c & 0xF) == 0); + FFI_ASSERT (((unsigned long) vec_base.c & 0xF) == 0); + FFI_ASSERT ((bytes & 0xF) == 0); + + /* Deal with return values that are actually pass-by-reference. */ + if (flags & FLAG_RETVAL_REFERENCE) + *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue; + + /* Now for the arguments. */ + p_argv.v = ecif->avalue; + nargs = ecif->cif->nargs; +#if _CALL_ELF != 2 + nfixedargs = (unsigned) -1; + if ((flags & FLAG_COMPAT) == 0) +#endif + nfixedargs = ecif->cif->nfixedargs; + for (ptr = ecif->cif->arg_types, i = 0; + i < nargs; + i++, ptr++, p_argv.v++) + { + unsigned int elt, elnum; + + switch ((*ptr)->type) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + next_arg.p = FFI_ALIGN (next_arg.p, 16); + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) + memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); + else + memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; + FFI_ASSERT (__LDBL_MANT_DIG__ == 113); + FFI_ASSERT (flags & FLAG_VEC_ARGUMENTS); + break; + } + if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) + { + double_tmp = (*p_argv.d)[0]; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) + { + *fpr_base.d++ = double_tmp; +# if _CALL_ELF != 2 + if ((flags & FLAG_COMPAT) != 0) + *next_arg.d = double_tmp; +# endif + } + else + *next_arg.d = double_tmp; + if (++next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + fparg_count++; + double_tmp = (*p_argv.d)[1]; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) + { + *fpr_base.d++ = double_tmp; +# if _CALL_ELF != 2 + if ((flags & FLAG_COMPAT) != 0) + *next_arg.d = double_tmp; +# endif + } + else + *next_arg.d = double_tmp; + if (++next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + fparg_count++; + FFI_ASSERT (__LDBL_MANT_DIG__ == 106); + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; + } + /* Fall through. */ +#endif + case FFI_TYPE_DOUBLE: +#if _CALL_ELF != 2 + do_double: +#endif + double_tmp = **p_argv.d; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) + { + *fpr_base.d++ = double_tmp; +#if _CALL_ELF != 2 + if ((flags & FLAG_COMPAT) != 0) + *next_arg.d = double_tmp; +#endif + } + else + *next_arg.d = double_tmp; + if (++next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + fparg_count++; + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; + + case FFI_TYPE_FLOAT: +#if _CALL_ELF != 2 + do_float: +#endif + double_tmp = **p_argv.f; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) + { + *fpr_base.d++ = double_tmp; +#if _CALL_ELF != 2 + if ((flags & FLAG_COMPAT) != 0) + { +# ifndef __LITTLE_ENDIAN__ + next_arg.f[1] = (float) double_tmp; +# else + next_arg.f[0] = (float) double_tmp; +# endif + } +#endif + } + else + { +# ifndef __LITTLE_ENDIAN__ + next_arg.f[1] = (float) double_tmp; +# else + next_arg.f[0] = (float) double_tmp; +# endif + } + if (++next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + fparg_count++; + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; + + case FFI_TYPE_STRUCT: + if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) + { + align = (*ptr)->alignment; + if (align > 16) + align = 16; + if (align > 1) + { + next_arg.p = FFI_ALIGN (next_arg.p, align); + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + } + } + elt = discover_homogeneous_aggregate (ecif->cif->abi, *ptr, &elnum); + if (elt) + { +#if _CALL_ELF == 2 + union { + void *v; + float *f; + double *d; + float128 *f128; + } arg; + + arg.v = *p_argv.v; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + if (elt == FFI_TYPE_LONGDOUBLE && + (ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + do + { + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 + && i < nfixedargs) + memcpy (vec_base.f128++, arg.f128, sizeof (float128)); + else + memcpy (next_arg.f128, arg.f128++, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; + } + while (--elnum != 0); + } + else +#endif + if (elt == FFI_TYPE_FLOAT) + { + do + { + double_tmp = *arg.f++; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 + && i < nfixedargs) + *fpr_base.d++ = double_tmp; + else + *next_arg.f = (float) double_tmp; + if (++next_arg.f == gpr_end.f) + next_arg.f = rest.f; + fparg_count++; + } + while (--elnum != 0); + if ((next_arg.p & 7) != 0) + if (++next_arg.f == gpr_end.f) + next_arg.f = rest.f; + } + else + do + { + double_tmp = *arg.d++; + if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) + *fpr_base.d++ = double_tmp; + else + *next_arg.d = double_tmp; + if (++next_arg.d == gpr_end.d) + next_arg.d = rest.d; + fparg_count++; + } + while (--elnum != 0); +#else + if (elt == FFI_TYPE_FLOAT) + goto do_float; + else + goto do_double; +#endif + } + else + { + words = ((*ptr)->size + 7) / 8; + if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul) + { + size_t first = gpr_end.c - next_arg.c; + memcpy (next_arg.c, *p_argv.c, first); + memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first); + next_arg.c = rest.c + words * 8 - first; + } + else + { + char *where = next_arg.c; + +#ifndef __LITTLE_ENDIAN__ + /* Structures with size less than eight bytes are passed + left-padded. */ + if ((*ptr)->size < 8) + where += 8 - (*ptr)->size; +#endif + memcpy (where, *p_argv.c, (*ptr)->size); + next_arg.ul += words; + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + } + } + break; + + case FFI_TYPE_UINT8: + gprvalue = **p_argv.uc; + goto putgpr; + case FFI_TYPE_SINT8: + gprvalue = **p_argv.sc; + goto putgpr; + case FFI_TYPE_UINT16: + gprvalue = **p_argv.us; + goto putgpr; + case FFI_TYPE_SINT16: + gprvalue = **p_argv.ss; + goto putgpr; + case FFI_TYPE_UINT32: + gprvalue = **p_argv.ui; + goto putgpr; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + gprvalue = **p_argv.si; + goto putgpr; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + gprvalue = **p_argv.ul; + putgpr: + *next_arg.ul++ = gprvalue; + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + break; + } + } + + FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS + || (next_arg.ul >= gpr_base.ul + && next_arg.ul <= gpr_base.ul + 4)); +} + + +#if _CALL_ELF == 2 +#define MIN_CACHE_LINE_SIZE 8 + +static void +flush_icache (char *wraddr, char *xaddr, int size) +{ + int i; + for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) + __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" + : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); + __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" + : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) + : "memory"); +} +#endif + + +ffi_status FFI_HIDDEN +ffi_prep_closure_loc_linux64 (ffi_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *codeloc) +{ +#if _CALL_ELF == 2 + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + + if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + tramp[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ + tramp[1] = 0xe98c0010; /* ld 12,1f-0b(12) */ + tramp[2] = 0x7d8903a6; /* mtctr 12 */ + tramp[3] = 0x4e800420; /* bctr */ + /* 1: .quad function_addr */ + /* 2: .quad context */ + *(void **) &tramp[4] = (void *) ffi_closure_LINUX64; + *(void **) &tramp[6] = codeloc; + flush_icache ((char *) tramp, (char *) codeloc, 4 * 4); +#else + void **tramp = (void **) &closure->tramp[0]; + + if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + /* Copy function address and TOC from ffi_closure_LINUX64 OPD. */ + memcpy (&tramp[0], (void **) ffi_closure_LINUX64, sizeof (void *)); + tramp[1] = codeloc; + memcpy (&tramp[2], (void **) ffi_closure_LINUX64 + 1, sizeof (void *)); +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + + +int FFI_HIDDEN +ffi_closure_helper_LINUX64 (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *rvalue, + unsigned long *pst, + ffi_dblfl *pfr, + float128 *pvec) +{ + /* rvalue is the pointer to space for return value in closure assembly */ + /* pst is the pointer to parameter save area + (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */ + /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */ + /* pvec is the pointer to where v2-v13 are stored in ffi_closure_LINUX64 */ + + void **avalue; + ffi_type **arg_types; + unsigned long i, avn, nfixedargs; + ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; + float128 *end_pvec = pvec + NUM_VEC_ARG_REGISTERS64; + unsigned long align; + + avalue = alloca (cif->nargs * sizeof (void *)); + + /* Copy the caller's structure return value address so that the + closure returns the data directly to the caller. */ + if (cif->rtype->type == FFI_TYPE_STRUCT + && (cif->flags & FLAG_RETURNS_SMST) == 0) + { + rvalue = (void *) *pst; + pst++; + } + + i = 0; + avn = cif->nargs; +#if _CALL_ELF != 2 + nfixedargs = (unsigned) -1; + if ((cif->flags & FLAG_COMPAT) == 0) +#endif + nfixedargs = cif->nfixedargs; + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) + { + unsigned int elt, elnum; + + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: +#ifndef __LITTLE_ENDIAN__ + avalue[i] = (char *) pst + 7; + pst++; + break; +#endif + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: +#ifndef __LITTLE_ENDIAN__ + avalue[i] = (char *) pst + 6; + pst++; + break; +#endif + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: +#ifndef __LITTLE_ENDIAN__ + avalue[i] = (char *) pst + 4; + pst++; + break; +#endif + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + avalue[i] = pst; + pst++; + break; + + case FFI_TYPE_STRUCT: + if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) + { + align = arg_types[i]->alignment; + if (align > 16) + align = 16; + if (align > 1) + pst = (unsigned long *) FFI_ALIGN ((size_t) pst, align); + } + elt = discover_homogeneous_aggregate (cif->abi, arg_types[i], &elnum); + if (elt) + { +#if _CALL_ELF == 2 + union { + void *v; + unsigned long *ul; + float *f; + double *d; + float128 *f128; + size_t p; + } to, from; + + /* Repackage the aggregate from its parts. The + aggregate size is not greater than the space taken by + the registers so store back to the register/parameter + save arrays. */ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + if (elt == FFI_TYPE_LONGDOUBLE && + (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + if (pvec + elnum <= end_pvec) + to.v = pvec; + else + to.v = pst; + } + else +#endif + if (pfr + elnum <= end_pfr) + to.v = pfr; + else + to.v = pst; + + avalue[i] = to.v; + from.ul = pst; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + if (elt == FFI_TYPE_LONGDOUBLE && + (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + do + { + if (pvec < end_pvec && i < nfixedargs) + memcpy (to.f128, pvec++, sizeof (float128)); + else + memcpy (to.f128, from.f128, sizeof (float128)); + to.f128++; + from.f128++; + } + while (--elnum != 0); + } + else +#endif + if (elt == FFI_TYPE_FLOAT) + { + do + { + if (pfr < end_pfr && i < nfixedargs) + { + *to.f = (float) pfr->d; + pfr++; + } + else + *to.f = *from.f; + to.f++; + from.f++; + } + while (--elnum != 0); + } + else + { + do + { + if (pfr < end_pfr && i < nfixedargs) + { + *to.d = pfr->d; + pfr++; + } + else + *to.d = *from.d; + to.d++; + from.d++; + } + while (--elnum != 0); + } +#else + if (elt == FFI_TYPE_FLOAT) + goto do_float; + else + goto do_double; +#endif + } + else + { +#ifndef __LITTLE_ENDIAN__ + /* Structures with size less than eight bytes are passed + left-padded. */ + if (arg_types[i]->size < 8) + avalue[i] = (char *) pst + 8 - arg_types[i]->size; + else +#endif + avalue[i] = pst; + } + pst += (arg_types[i]->size + 7) / 8; + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) + { + if (((unsigned long) pst & 0xF) != 0) + ++pst; + if (pvec < end_pvec && i < nfixedargs) + avalue[i] = pvec++; + else + avalue[i] = pst; + pst += 2; + break; + } + else if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) + { + if (pfr + 1 < end_pfr && i + 1 < nfixedargs) + { + avalue[i] = pfr; + pfr += 2; + } + else + { + if (pfr < end_pfr && i < nfixedargs) + { + /* Passed partly in f13 and partly on the stack. + Move it all to the stack. */ + *pst = *(unsigned long *) pfr; + pfr++; + } + avalue[i] = pst; + } + pst += 2; + break; + } + /* Fall through. */ +#endif + case FFI_TYPE_DOUBLE: +#if _CALL_ELF != 2 + do_double: +#endif + /* On the outgoing stack all values are aligned to 8 */ + /* there are 13 64bit floating point registers */ + + if (pfr < end_pfr && i < nfixedargs) + { + avalue[i] = pfr; + pfr++; + } + else + avalue[i] = pst; + pst++; + break; + + case FFI_TYPE_FLOAT: +#if _CALL_ELF != 2 + do_float: +#endif + if (pfr < end_pfr && i < nfixedargs) + { + /* Float values are stored as doubles in the + ffi_closure_LINUX64 code. Fix them here. */ + pfr->f = (float) pfr->d; + avalue[i] = pfr; + pfr++; + } + else + { +#ifndef __LITTLE_ENDIAN__ + avalue[i] = (char *) pst + 4; +#else + avalue[i] = pst; +#endif + } + pst++; + break; + + default: + FFI_ASSERT (0); + } + + i++; + } + + (*fun) (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_LINUX64 how to perform return type promotions. */ + if ((cif->flags & FLAG_RETURNS_SMST) != 0) + { + if ((cif->flags & (FLAG_RETURNS_FP | FLAG_RETURNS_VEC)) == 0) + return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1; + else if ((cif->flags & FLAG_RETURNS_VEC) != 0) + return FFI_V2_TYPE_VECTOR_HOMOG; + else if ((cif->flags & FLAG_RETURNS_64BITS) != 0) + return FFI_V2_TYPE_DOUBLE_HOMOG; + else + return FFI_V2_TYPE_FLOAT_HOMOG; + } + if ((cif->flags & FLAG_RETURNS_VEC) != 0) + return FFI_V2_TYPE_VECTOR; + return cif->rtype->type; +} +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h new file mode 100644 index 0000000..960a5c4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h @@ -0,0 +1,105 @@ +/* ----------------------------------------------------------------------- + ffi_powerpc.h - Copyright (C) 2013 IBM + Copyright (C) 2011 Anthony Green + Copyright (C) 2011 Kyle Moffett + Copyright (C) 2008 Red Hat, Inc + Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (c) 1998 Geoffrey Keating + + PowerPC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +enum { + /* The assembly depends on these exact flags. */ + /* These go in cr7 */ + FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */ + FLAG_RETURNS_NOTHING = 1 << (31-30), + FLAG_RETURNS_FP = 1 << (31-29), + FLAG_RETURNS_VEC = 1 << (31-28), + + /* These go in cr6 */ + FLAG_RETURNS_64BITS = 1 << (31-27), + FLAG_RETURNS_128BITS = 1 << (31-26), + + FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */ + + /* These go in cr1 */ + FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */ + FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */ + FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ + FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), + FLAG_RETVAL_REFERENCE = 1 << (31- 4), + FLAG_VEC_ARGUMENTS = 1 << (31- 3), +}; + +typedef union +{ + float f; + double d; +} ffi_dblfl; + +#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128) +typedef _Float128 float128; +#elif defined(__FLOAT128__) +typedef __float128 float128; +#else +typedef char float128[16] __attribute__((aligned(16))); +#endif + +void FFI_HIDDEN ffi_closure_SYSV (void); +void FFI_HIDDEN ffi_go_closure_sysv (void); +void FFI_HIDDEN ffi_call_SYSV(extended_cif *, void (*)(void), void *, + unsigned, void *, int); + +void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi); +ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *); +ffi_status FFI_HIDDEN ffi_prep_closure_loc_sysv (ffi_closure *, + ffi_cif *, + void (*) (ffi_cif *, void *, + void **, void *), + void *, void *); +int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_cif *, + void (*) (ffi_cif *, void *, + void **, void *), + void *, void *, unsigned long *, + ffi_dblfl *, unsigned long *); + +void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, void (*) (void), void *, + unsigned long, void *, long); +void FFI_HIDDEN ffi_closure_LINUX64 (void); +void FFI_HIDDEN ffi_go_closure_linux64 (void); + +void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi); +ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *); +ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int, + unsigned int); +void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const); +ffi_status FFI_HIDDEN ffi_prep_closure_loc_linux64 (ffi_closure *, ffi_cif *, + void (*) (ffi_cif *, void *, + void **, void *), + void *, void *); +int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_cif *, + void (*) (ffi_cif *, void *, + void **, void *), + void *, void *, + unsigned long *, ffi_dblfl *, + float128 *); diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c new file mode 100644 index 0000000..4078e75 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c @@ -0,0 +1,923 @@ +/* ----------------------------------------------------------------------- + ffi_sysv.c - Copyright (C) 2013 IBM + Copyright (C) 2011 Anthony Green + Copyright (C) 2011 Kyle Moffett + Copyright (C) 2008 Red Hat, Inc + Copyright (C) 2007, 2008 Free Software Foundation, Inc + Copyright (c) 1998 Geoffrey Keating + + PowerPC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include "ffi.h" + +#ifndef POWERPC64 +#include "ffi_common.h" +#include "ffi_powerpc.h" + + +/* About the SYSV ABI. */ +#define ASM_NEEDS_REGISTERS 6 +#define NUM_GPR_ARG_REGISTERS 8 +#define NUM_FPR_ARG_REGISTERS 8 + + +#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +/* Adjust size of ffi_type_longdouble. */ +void FFI_HIDDEN +ffi_prep_types_sysv (ffi_abi abi) +{ + if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV) + { + ffi_type_longdouble.size = 8; + ffi_type_longdouble.alignment = 8; + } + else + { + ffi_type_longdouble.size = 16; + ffi_type_longdouble.alignment = 16; + } +} +#endif + +/* Transform long double, double and float to other types as per abi. */ +static int +translate_float (int abi, int type) +{ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + if (type == FFI_TYPE_LONGDOUBLE + && (abi & FFI_SYSV_LONG_DOUBLE_128) == 0) + type = FFI_TYPE_DOUBLE; +#endif + if ((abi & FFI_SYSV_SOFT_FLOAT) != 0) + { + if (type == FFI_TYPE_FLOAT) + type = FFI_TYPE_UINT32; + else if (type == FFI_TYPE_DOUBLE) + type = FFI_TYPE_UINT64; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + else if (type == FFI_TYPE_LONGDOUBLE) + type = FFI_TYPE_UINT128; + } + else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0) + { + if (type == FFI_TYPE_LONGDOUBLE) + type = FFI_TYPE_STRUCT; +#endif + } + return type; +} + +/* Perform machine dependent cif processing */ +static ffi_status +ffi_prep_cif_sysv_core (ffi_cif *cif) +{ + ffi_type **ptr; + unsigned bytes; + unsigned i, fpr_count = 0, gpr_count = 0, stack_count = 0; + unsigned flags = cif->flags; + unsigned struct_copy_size = 0; + unsigned type = cif->rtype->type; + unsigned size = cif->rtype->size; + + /* The machine-independent calculation of cif->bytes doesn't work + for us. Redo the calculation. */ + + /* Space for the frame pointer, callee's LR, and the asm's temp regs. */ + bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int); + + /* Space for the GPR registers. */ + bytes += NUM_GPR_ARG_REGISTERS * sizeof (int); + + /* Return value handling. The rules for SYSV are as follows: + - 32-bit (or less) integer values are returned in gpr3; + - Structures of size <= 4 bytes also returned in gpr3; + - 64-bit integer values and structures between 5 and 8 bytes are returned + in gpr3 and gpr4; + - Larger structures are allocated space and a pointer is passed as + the first argument. + - Single/double FP values are returned in fpr1; + - long doubles (if not equivalent to double) are returned in + fpr1,fpr2 for Linux and as for large structs for SysV. */ + + type = translate_float (cif->abi, type); + + switch (type) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + flags |= FLAG_RETURNS_128BITS; + /* Fall through. */ +#endif + case FFI_TYPE_DOUBLE: + flags |= FLAG_RETURNS_64BITS; + /* Fall through. */ + case FFI_TYPE_FLOAT: + flags |= FLAG_RETURNS_FP; +#ifdef __NO_FPRS__ + return FFI_BAD_ABI; +#endif + break; + + case FFI_TYPE_UINT128: + flags |= FLAG_RETURNS_128BITS; + /* Fall through. */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + flags |= FLAG_RETURNS_64BITS; + break; + + case FFI_TYPE_STRUCT: + /* The final SYSV ABI says that structures smaller or equal 8 bytes + are returned in r3/r4. A draft ABI used by linux instead + returns them in memory. */ + if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) + { + flags |= FLAG_RETURNS_SMST; + break; + } + gpr_count++; + flags |= FLAG_RETVAL_REFERENCE; + /* Fall through. */ + case FFI_TYPE_VOID: + flags |= FLAG_RETURNS_NOTHING; + break; + + default: + /* Returns 32-bit integer, or similar. Nothing to do here. */ + break; + } + + /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the + first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest + goes on the stack. Structures and long doubles (if not equivalent + to double) are passed as a pointer to a copy of the structure. + Stuff on the stack needs to keep proper alignment. */ + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + unsigned short typenum = (*ptr)->type; + + typenum = translate_float (cif->abi, typenum); + + switch (typenum) + { +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if (fpr_count >= NUM_FPR_ARG_REGISTERS - 1) + { + fpr_count = NUM_FPR_ARG_REGISTERS; + /* 8-byte align long doubles. */ + stack_count += stack_count & 1; + stack_count += 4; + } + else + fpr_count += 2; +#ifdef __NO_FPRS__ + return FFI_BAD_ABI; +#endif + break; +#endif + + case FFI_TYPE_DOUBLE: + if (fpr_count >= NUM_FPR_ARG_REGISTERS) + { + /* 8-byte align doubles. */ + stack_count += stack_count & 1; + stack_count += 2; + } + else + fpr_count += 1; +#ifdef __NO_FPRS__ + return FFI_BAD_ABI; +#endif + break; + + case FFI_TYPE_FLOAT: + if (fpr_count >= NUM_FPR_ARG_REGISTERS) + /* Yes, we don't follow the ABI, but neither does gcc. */ + stack_count += 1; + else + fpr_count += 1; +#ifdef __NO_FPRS__ + return FFI_BAD_ABI; +#endif + break; + + case FFI_TYPE_UINT128: + /* A long double in FFI_LINUX_SOFT_FLOAT can use only a set + of four consecutive gprs. If we do not have enough, we + have to adjust the gpr_count value. */ + if (gpr_count >= NUM_GPR_ARG_REGISTERS - 3) + gpr_count = NUM_GPR_ARG_REGISTERS; + if (gpr_count >= NUM_GPR_ARG_REGISTERS) + stack_count += 4; + else + gpr_count += 4; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + /* 'long long' arguments are passed as two words, but + either both words must fit in registers or both go + on the stack. If they go on the stack, they must + be 8-byte-aligned. + + Also, only certain register pairs can be used for + passing long long int -- specifically (r3,r4), (r5,r6), + (r7,r8), (r9,r10). */ + gpr_count += gpr_count & 1; + if (gpr_count >= NUM_GPR_ARG_REGISTERS) + { + stack_count += stack_count & 1; + stack_count += 2; + } + else + gpr_count += 2; + break; + + case FFI_TYPE_STRUCT: + /* We must allocate space for a copy of these to enforce + pass-by-value. Pad the space up to a multiple of 16 + bytes (the maximum alignment required for anything under + the SYSV ABI). */ + struct_copy_size += ((*ptr)->size + 15) & ~0xF; + /* Fall through (allocate space for the pointer). */ + + case FFI_TYPE_POINTER: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + /* Everything else is passed as a 4-byte word in a GPR, either + the object itself or a pointer to it. */ + if (gpr_count >= NUM_GPR_ARG_REGISTERS) + stack_count += 1; + else + gpr_count += 1; + break; + + default: + FFI_ASSERT (0); + } + } + + if (fpr_count != 0) + flags |= FLAG_FP_ARGUMENTS; + if (gpr_count > 4) + flags |= FLAG_4_GPR_ARGUMENTS; + if (struct_copy_size != 0) + flags |= FLAG_ARG_NEEDS_COPY; + + /* Space for the FPR registers, if needed. */ + if (fpr_count != 0) + bytes += NUM_FPR_ARG_REGISTERS * sizeof (double); + + /* Stack space. */ + bytes += stack_count * sizeof (int); + + /* The stack space allocated needs to be a multiple of 16 bytes. */ + bytes = (bytes + 15) & ~0xF; + + /* Add in the space for the copied structures. */ + bytes += struct_copy_size; + + cif->flags = flags; + cif->bytes = bytes; + + return FFI_OK; +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_sysv (ffi_cif *cif) +{ + if ((cif->abi & FFI_SYSV) == 0) + { + /* This call is from old code. Translate to new ABI values. */ + cif->flags |= FLAG_COMPAT; + switch (cif->abi) + { + default: + return FFI_BAD_ABI; + + case FFI_COMPAT_SYSV: + cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128; + break; + + case FFI_COMPAT_GCC_SYSV: + cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128; + break; + + case FFI_COMPAT_LINUX: + cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE + | FFI_SYSV_LONG_DOUBLE_128); + break; + + case FFI_COMPAT_LINUX_SOFT_FLOAT: + cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE + | FFI_SYSV_LONG_DOUBLE_128); + break; + } + } + return ffi_prep_cif_sysv_core (cif); +} + +/* ffi_prep_args_SYSV is called by the assembly routine once stack space + has been allocated for the function's arguments. + + The stack layout we want looks like this: + + | Return address from ffi_call_SYSV 4bytes | higher addresses + |--------------------------------------------| + | Previous backchain pointer 4 | stack pointer here + |--------------------------------------------|<+ <<< on entry to + | Saved r28-r31 4*4 | | ffi_call_SYSV + |--------------------------------------------| | + | GPR registers r3-r10 8*4 | | ffi_call_SYSV + |--------------------------------------------| | + | FPR registers f1-f8 (optional) 8*8 | | + |--------------------------------------------| | stack | + | Space for copied structures | | grows | + |--------------------------------------------| | down V + | Parameters that didn't fit in registers | | + |--------------------------------------------| | lower addresses + | Space for callee's LR 4 | | + |--------------------------------------------| | stack pointer here + | Current backchain pointer 4 |-/ during + |--------------------------------------------| <<< ffi_call_SYSV + +*/ + +void FFI_HIDDEN +ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack) +{ + const unsigned bytes = ecif->cif->bytes; + const unsigned flags = ecif->cif->flags; + + typedef union + { + char *c; + unsigned *u; + long long *ll; + float *f; + double *d; + } valp; + + /* 'stacktop' points at the previous backchain pointer. */ + valp stacktop; + + /* 'gpr_base' points at the space for gpr3, and grows upwards as + we use GPR registers. */ + valp gpr_base; + valp gpr_end; + +#ifndef __NO_FPRS__ + /* 'fpr_base' points at the space for fpr1, and grows upwards as + we use FPR registers. */ + valp fpr_base; + valp fpr_end; +#endif + + /* 'copy_space' grows down as we put structures in it. It should + stay 16-byte aligned. */ + valp copy_space; + + /* 'next_arg' grows up as we put parameters in it. */ + valp next_arg; + + int i; + ffi_type **ptr; +#ifndef __NO_FPRS__ + double double_tmp; +#endif + union + { + void **v; + char **c; + signed char **sc; + unsigned char **uc; + signed short **ss; + unsigned short **us; + unsigned int **ui; + long long **ll; + float **f; + double **d; + } p_argv; + size_t struct_copy_size; + unsigned gprvalue; + + stacktop.c = (char *) stack + bytes; + gpr_end.u = stacktop.u - ASM_NEEDS_REGISTERS; + gpr_base.u = gpr_end.u - NUM_GPR_ARG_REGISTERS; +#ifndef __NO_FPRS__ + fpr_end.d = gpr_base.d; + fpr_base.d = fpr_end.d - NUM_FPR_ARG_REGISTERS; + copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c); +#else + copy_space.c = gpr_base.c; +#endif + next_arg.u = stack + 2; + + /* Check that everything starts aligned properly. */ + FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); + FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0); + FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); + FFI_ASSERT ((bytes & 0xF) == 0); + FFI_ASSERT (copy_space.c >= next_arg.c); + + /* Deal with return values that are actually pass-by-reference. */ + if (flags & FLAG_RETVAL_REFERENCE) + *gpr_base.u++ = (unsigned) (char *) ecif->rvalue; + + /* Now for the arguments. */ + p_argv.v = ecif->avalue; + for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; + i > 0; + i--, ptr++, p_argv.v++) + { + unsigned int typenum = (*ptr)->type; + + typenum = translate_float (ecif->cif->abi, typenum); + + /* Now test the translated value */ + switch (typenum) + { +#ifndef __NO_FPRS__ +# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + double_tmp = (*p_argv.d)[0]; + + if (fpr_base.d >= fpr_end.d - 1) + { + fpr_base.d = fpr_end.d; + if (((next_arg.u - stack) & 1) != 0) + next_arg.u += 1; + *next_arg.d = double_tmp; + next_arg.u += 2; + double_tmp = (*p_argv.d)[1]; + *next_arg.d = double_tmp; + next_arg.u += 2; + } + else + { + *fpr_base.d++ = double_tmp; + double_tmp = (*p_argv.d)[1]; + *fpr_base.d++ = double_tmp; + } + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; +# endif + case FFI_TYPE_DOUBLE: + double_tmp = **p_argv.d; + + if (fpr_base.d >= fpr_end.d) + { + if (((next_arg.u - stack) & 1) != 0) + next_arg.u += 1; + *next_arg.d = double_tmp; + next_arg.u += 2; + } + else + *fpr_base.d++ = double_tmp; + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; + + case FFI_TYPE_FLOAT: + double_tmp = **p_argv.f; + if (fpr_base.d >= fpr_end.d) + { + *next_arg.f = (float) double_tmp; + next_arg.u += 1; + } + else + *fpr_base.d++ = double_tmp; + FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); + break; +#endif /* have FPRs */ + + case FFI_TYPE_UINT128: + /* The soft float ABI for long doubles works like this, a long double + is passed in four consecutive GPRs if available. A maximum of 2 + long doubles can be passed in gprs. If we do not have 4 GPRs + left, the long double is passed on the stack, 4-byte aligned. */ + if (gpr_base.u >= gpr_end.u - 3) + { + unsigned int ii; + gpr_base.u = gpr_end.u; + for (ii = 0; ii < 4; ii++) + { + unsigned int int_tmp = (*p_argv.ui)[ii]; + *next_arg.u++ = int_tmp; + } + } + else + { + unsigned int ii; + for (ii = 0; ii < 4; ii++) + { + unsigned int int_tmp = (*p_argv.ui)[ii]; + *gpr_base.u++ = int_tmp; + } + } + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + if (gpr_base.u >= gpr_end.u - 1) + { + gpr_base.u = gpr_end.u; + if (((next_arg.u - stack) & 1) != 0) + next_arg.u++; + *next_arg.ll = **p_argv.ll; + next_arg.u += 2; + } + else + { + /* The abi states only certain register pairs can be + used for passing long long int specifically (r3,r4), + (r5,r6), (r7,r8), (r9,r10). If next arg is long long + but not correct starting register of pair then skip + until the proper starting register. */ + if (((gpr_end.u - gpr_base.u) & 1) != 0) + gpr_base.u++; + *gpr_base.ll++ = **p_argv.ll; + } + break; + + case FFI_TYPE_STRUCT: + struct_copy_size = ((*ptr)->size + 15) & ~0xF; + copy_space.c -= struct_copy_size; + memcpy (copy_space.c, *p_argv.c, (*ptr)->size); + + gprvalue = (unsigned long) copy_space.c; + + FFI_ASSERT (copy_space.c > next_arg.c); + FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY); + goto putgpr; + + case FFI_TYPE_UINT8: + gprvalue = **p_argv.uc; + goto putgpr; + case FFI_TYPE_SINT8: + gprvalue = **p_argv.sc; + goto putgpr; + case FFI_TYPE_UINT16: + gprvalue = **p_argv.us; + goto putgpr; + case FFI_TYPE_SINT16: + gprvalue = **p_argv.ss; + goto putgpr; + + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + + gprvalue = **p_argv.ui; + + putgpr: + if (gpr_base.u >= gpr_end.u) + *next_arg.u++ = gprvalue; + else + *gpr_base.u++ = gprvalue; + break; + } + } + + /* Check that we didn't overrun the stack... */ + FFI_ASSERT (copy_space.c >= next_arg.c); + FFI_ASSERT (gpr_base.u <= gpr_end.u); +#ifndef __NO_FPRS__ + FFI_ASSERT (fpr_base.u <= fpr_end.u); +#endif + FFI_ASSERT (((flags & FLAG_4_GPR_ARGUMENTS) != 0) + == (gpr_end.u - gpr_base.u < 4)); +} + +#define MIN_CACHE_LINE_SIZE 8 + +static void +flush_icache (char *wraddr, char *xaddr, int size) +{ + int i; + for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) + __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" + : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); + __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" + : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) + : "memory"); +} + +ffi_status FFI_HIDDEN +ffi_prep_closure_loc_sysv (ffi_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *codeloc) +{ + unsigned int *tramp; + + if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + tramp = (unsigned int *) &closure->tramp[0]; + tramp[0] = 0x7c0802a6; /* mflr r0 */ + tramp[1] = 0x429f0005; /* bcl 20,31,.+4 */ + tramp[2] = 0x7d6802a6; /* mflr r11 */ + tramp[3] = 0x7c0803a6; /* mtlr r0 */ + tramp[4] = 0x800b0018; /* lwz r0,24(r11) */ + tramp[5] = 0x816b001c; /* lwz r11,28(r11) */ + tramp[6] = 0x7c0903a6; /* mtctr r0 */ + tramp[7] = 0x4e800420; /* bctr */ + *(void **) &tramp[8] = (void *) ffi_closure_SYSV; /* function */ + *(void **) &tramp[9] = codeloc; /* context */ + + /* Flush the icache. */ + flush_icache ((char *)tramp, (char *)codeloc, 8 * 4); + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +/* Basically the trampoline invokes ffi_closure_SYSV, and on + entry, r11 holds the address of the closure. + After storing the registers that could possibly contain + parameters to be passed into the stack frame and setting + up space for a return value, ffi_closure_SYSV invokes the + following helper function to do most of the work. */ + +int +ffi_closure_helper_SYSV (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *rvalue, + unsigned long *pgr, + ffi_dblfl *pfr, + unsigned long *pst) +{ + /* rvalue is the pointer to space for return value in closure assembly */ + /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */ + /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */ + /* pst is the pointer to outgoing parameter stack in original caller */ + + void ** avalue; + ffi_type ** arg_types; + long i, avn; +#ifndef __NO_FPRS__ + long nf = 0; /* number of floating registers already used */ +#endif + long ng = 0; /* number of general registers already used */ + + unsigned size = cif->rtype->size; + unsigned short rtypenum = cif->rtype->type; + + avalue = alloca (cif->nargs * sizeof (void *)); + + /* First translate for softfloat/nonlinux */ + rtypenum = translate_float (cif->abi, rtypenum); + + /* Copy the caller's structure return value address so that the closure + returns the data directly to the caller. + For FFI_SYSV the result is passed in r3/r4 if the struct size is less + or equal 8 bytes. */ + if (rtypenum == FFI_TYPE_STRUCT + && !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)) + { + rvalue = (void *) *pgr; + ng++; + pgr++; + } + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) { + unsigned short typenum = arg_types[i]->type; + + /* We may need to handle some values depending on ABI. */ + typenum = translate_float (cif->abi, typenum); + + switch (typenum) + { +#ifndef __NO_FPRS__ + case FFI_TYPE_FLOAT: + /* Unfortunately float values are stored as doubles + in the ffi_closure_SYSV code (since we don't check + the type in that routine). */ + if (nf < NUM_FPR_ARG_REGISTERS) + { + /* FIXME? here we are really changing the values + stored in the original calling routines outgoing + parameter stack. This is probably a really + naughty thing to do but... */ + double temp = pfr->d; + pfr->f = (float) temp; + avalue[i] = pfr; + nf++; + pfr++; + } + else + { + avalue[i] = pst; + pst += 1; + } + break; + + case FFI_TYPE_DOUBLE: + if (nf < NUM_FPR_ARG_REGISTERS) + { + avalue[i] = pfr; + nf++; + pfr++; + } + else + { + if (((long) pst) & 4) + pst++; + avalue[i] = pst; + pst += 2; + } + break; + +# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + if (nf < NUM_FPR_ARG_REGISTERS - 1) + { + avalue[i] = pfr; + pfr += 2; + nf += 2; + } + else + { + if (((long) pst) & 4) + pst++; + avalue[i] = pst; + pst += 4; + nf = 8; + } + break; +# endif +#endif + + case FFI_TYPE_UINT128: + /* Test if for the whole long double, 4 gprs are available. + otherwise the stuff ends up on the stack. */ + if (ng < NUM_GPR_ARG_REGISTERS - 3) + { + avalue[i] = pgr; + pgr += 4; + ng += 4; + } + else + { + avalue[i] = pst; + pst += 4; + ng = 8+4; + } + break; + + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: +#ifndef __LITTLE_ENDIAN__ + if (ng < NUM_GPR_ARG_REGISTERS) + { + avalue[i] = (char *) pgr + 3; + ng++; + pgr++; + } + else + { + avalue[i] = (char *) pst + 3; + pst++; + } + break; +#endif + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: +#ifndef __LITTLE_ENDIAN__ + if (ng < NUM_GPR_ARG_REGISTERS) + { + avalue[i] = (char *) pgr + 2; + ng++; + pgr++; + } + else + { + avalue[i] = (char *) pst + 2; + pst++; + } + break; +#endif + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + if (ng < NUM_GPR_ARG_REGISTERS) + { + avalue[i] = pgr; + ng++; + pgr++; + } + else + { + avalue[i] = pst; + pst++; + } + break; + + case FFI_TYPE_STRUCT: + /* Structs are passed by reference. The address will appear in a + gpr if it is one of the first 8 arguments. */ + if (ng < NUM_GPR_ARG_REGISTERS) + { + avalue[i] = (void *) *pgr; + ng++; + pgr++; + } + else + { + avalue[i] = (void *) *pst; + pst++; + } + break; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + /* Passing long long ints are complex, they must + be passed in suitable register pairs such as + (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) + and if the entire pair aren't available then the outgoing + parameter stack is used for both but an alignment of 8 + must will be kept. So we must either look in pgr + or pst to find the correct address for this type + of parameter. */ + if (ng < NUM_GPR_ARG_REGISTERS - 1) + { + if (ng & 1) + { + /* skip r4, r6, r8 as starting points */ + ng++; + pgr++; + } + avalue[i] = pgr; + ng += 2; + pgr += 2; + } + else + { + if (((long) pst) & 4) + pst++; + avalue[i] = pst; + pst += 2; + ng = NUM_GPR_ARG_REGISTERS; + } + break; + + default: + FFI_ASSERT (0); + } + + i++; + } + + (*fun) (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_SYSV how to perform return type promotions. + Because the FFI_SYSV ABI returns the structures <= 8 bytes in + r3/r4 we have to tell ffi_closure_SYSV how to treat them. We + combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of + the struct less one. We never have a struct with size zero. + See the comment in ffitarget.h about ordering. */ + if (rtypenum == FFI_TYPE_STRUCT + && (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) + return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size; + return rtypenum; +} +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffitarget.h new file mode 100644 index 0000000..7fb9a93 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ffitarget.h @@ -0,0 +1,204 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc + Copyright (c) 1996-2003 Red Hat, Inc. + + Target configuration macros for PowerPC. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#if defined (POWERPC) && defined (__powerpc64__) /* linux64 */ +#ifndef POWERPC64 +#define POWERPC64 +#endif +#elif defined (POWERPC_DARWIN) && defined (__ppc64__) /* Darwin64 */ +#ifndef POWERPC64 +#define POWERPC64 +#endif +#ifndef POWERPC_DARWIN64 +#define POWERPC_DARWIN64 +#endif +#elif defined (POWERPC_AIX) && defined (__64BIT__) /* AIX64 */ +#ifndef POWERPC64 +#define POWERPC64 +#endif +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + +#if defined (POWERPC_AIX) + FFI_AIX, + FFI_DARWIN, + FFI_DEFAULT_ABI = FFI_AIX, + FFI_LAST_ABI + +#elif defined (POWERPC_DARWIN) + FFI_AIX, + FFI_DARWIN, + FFI_DEFAULT_ABI = FFI_DARWIN, + FFI_LAST_ABI + +#else + /* The FFI_COMPAT values are used by old code. Since libffi may be + a shared library we have to support old values for backwards + compatibility. */ + FFI_COMPAT_SYSV, + FFI_COMPAT_GCC_SYSV, + FFI_COMPAT_LINUX64, + FFI_COMPAT_LINUX, + FFI_COMPAT_LINUX_SOFT_FLOAT, + +# if defined (POWERPC64) + /* This bit, always set in new code, must not be set in any of the + old FFI_COMPAT values that might be used for 64-bit linux. We + only need worry about FFI_COMPAT_LINUX64, but to be safe avoid + all old values. */ + FFI_LINUX = 8, + /* This and following bits can reuse FFI_COMPAT values. */ + FFI_LINUX_STRUCT_ALIGN = 1, + FFI_LINUX_LONG_DOUBLE_128 = 2, + FFI_LINUX_LONG_DOUBLE_IEEE128 = 4, + FFI_DEFAULT_ABI = (FFI_LINUX +# ifdef __STRUCT_PARM_ALIGN__ + | FFI_LINUX_STRUCT_ALIGN +# endif +# ifdef __LONG_DOUBLE_128__ + | FFI_LINUX_LONG_DOUBLE_128 +# ifdef __LONG_DOUBLE_IEEE128__ + | FFI_LINUX_LONG_DOUBLE_IEEE128 +# endif +# endif + ), + FFI_LAST_ABI = 16 + +# else + /* This bit, always set in new code, must not be set in any of the + old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd. */ + FFI_SYSV = 8, + /* This and following bits can reuse FFI_COMPAT values. */ + FFI_SYSV_SOFT_FLOAT = 1, + FFI_SYSV_STRUCT_RET = 2, + FFI_SYSV_IBM_LONG_DOUBLE = 4, + FFI_SYSV_LONG_DOUBLE_128 = 16, + + FFI_DEFAULT_ABI = (FFI_SYSV +# ifdef __NO_FPRS__ + | FFI_SYSV_SOFT_FLOAT +# endif +# if (defined (__SVR4_STRUCT_RETURN) \ + || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN)) + | FFI_SYSV_STRUCT_RET +# endif +# if __LDBL_MANT_DIG__ == 106 + | FFI_SYSV_IBM_LONG_DOUBLE +# endif +# ifdef __LONG_DOUBLE_128__ + | FFI_SYSV_LONG_DOUBLE_128 +# endif + ), + FFI_LAST_ABI = 32 +# endif +#endif + +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#if defined (POWERPC) || defined (POWERPC_FREEBSD) +# define FFI_GO_CLOSURES 1 +# define FFI_TARGET_SPECIFIC_VARIADIC 1 +# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs +#endif +#if defined (POWERPC_AIX) +# define FFI_GO_CLOSURES 1 +#endif + +/* ppc_closure.S and linux64_closure.S expect this. */ +#define FFI_PPC_TYPE_LAST FFI_TYPE_POINTER + +/* We define additional types below. If generic types are added that + must be supported by powerpc libffi then it is likely that + FFI_PPC_TYPE_LAST needs increasing *and* the jump tables in + ppc_closure.S and linux64_closure.S be extended. */ + +#if !(FFI_TYPE_LAST == FFI_PPC_TYPE_LAST \ + || (FFI_TYPE_LAST == FFI_TYPE_COMPLEX \ + && !defined FFI_TARGET_HAS_COMPLEX_TYPE)) +# error "You likely have a broken powerpc libffi" +#endif + +/* Needed for soft-float long-double-128 support. */ +#define FFI_TYPE_UINT128 (FFI_PPC_TYPE_LAST + 1) + +/* Needed for FFI_SYSV small structure returns. */ +#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 2) + +/* Used by ELFv2 for homogenous structure returns. */ +#define FFI_V2_TYPE_VECTOR (FFI_PPC_TYPE_LAST + 1) +#define FFI_V2_TYPE_VECTOR_HOMOG (FFI_PPC_TYPE_LAST + 2) +#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_PPC_TYPE_LAST + 3) +#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_PPC_TYPE_LAST + 4) +#define FFI_V2_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 5) + +#if _CALL_ELF == 2 +# define FFI_TRAMPOLINE_SIZE 32 +#else +# if defined(POWERPC64) || defined(POWERPC_AIX) +# if defined(POWERPC_DARWIN64) +# define FFI_TRAMPOLINE_SIZE 48 +# else +# define FFI_TRAMPOLINE_SIZE 24 +# endif +# else /* POWERPC || POWERPC_AIX */ +# define FFI_TRAMPOLINE_SIZE 40 +# endif +#endif + +#ifndef LIBFFI_ASM +#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX) +struct ffi_aix_trampoline_struct { + void * code_pointer; /* Pointer to ffi_closure_ASM */ + void * toc; /* TOC */ + void * static_chain; /* Pointer to closure */ +}; +#endif +#endif + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64.S new file mode 100644 index 0000000..e92d64a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64.S @@ -0,0 +1,291 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC64 Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +#ifdef POWERPC64 + .hidden ffi_call_LINUX64 + .globl ffi_call_LINUX64 + .text + .cfi_startproc +# if _CALL_ELF == 2 +ffi_call_LINUX64: +# ifndef __PCREL__ + addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha + addi %r2, %r2, .TOC.-ffi_call_LINUX64@l +# endif + .localentry ffi_call_LINUX64, . - ffi_call_LINUX64 +# else + .section ".opd","aw" + .align 3 +ffi_call_LINUX64: +# ifdef _CALL_LINUX + .quad .L.ffi_call_LINUX64,.TOC.@tocbase,0 + .type ffi_call_LINUX64,@function + .text +.L.ffi_call_LINUX64: +# else + .hidden .ffi_call_LINUX64 + .globl .ffi_call_LINUX64 + .quad .ffi_call_LINUX64,.TOC.@tocbase,0 + .size ffi_call_LINUX64,24 + .type .ffi_call_LINUX64,@function + .text +.ffi_call_LINUX64: +# endif +# endif + mflr %r0 + std %r28, -32(%r1) + std %r29, -24(%r1) + std %r30, -16(%r1) + std %r31, -8(%r1) + std %r7, 8(%r1) /* closure, saved in cr field. */ + std %r0, 16(%r1) + + mr %r28, %r1 /* our AP. */ + .cfi_def_cfa_register 28 + .cfi_offset 65, 16 + .cfi_offset 31, -8 + .cfi_offset 30, -16 + .cfi_offset 29, -24 + .cfi_offset 28, -32 + + stdux %r1, %r1, %r8 + mr %r31, %r6 /* flags, */ + mr %r30, %r5 /* rvalue, */ + mr %r29, %r4 /* function address. */ +/* Save toc pointer, not for the ffi_prep_args64 call, but for the later + bctrl function call. */ +# if _CALL_ELF == 2 + std %r2, 24(%r1) +# else + std %r2, 40(%r1) +# endif + + /* Call ffi_prep_args64. */ + mr %r4, %r1 +# if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_prep_args64@notoc +# else + bl ffi_prep_args64 + nop +# endif +# else + bl .ffi_prep_args64 + nop +# endif + +# if _CALL_ELF == 2 + mr %r12, %r29 +# else + ld %r12, 0(%r29) + ld %r2, 8(%r29) +# endif + /* Now do the call. */ + /* Set up cr1 with bits 3-7 of the flags. */ + mtcrf 0xc0, %r31 + + /* Get the address to call into CTR. */ + mtctr %r12 + /* Load all those argument registers. */ + addi %r29, %r28, -32-(8*8) + ld %r3, (0*8)(%r29) + ld %r4, (1*8)(%r29) + ld %r5, (2*8)(%r29) + ld %r6, (3*8)(%r29) + bf- 5, 1f + ld %r7, (4*8)(%r29) + ld %r8, (5*8)(%r29) + ld %r9, (6*8)(%r29) + ld %r10, (7*8)(%r29) +1: + + /* Load all the FP registers. */ + bf- 6, 2f + addi %r29, %r29, -(14*8) + lfd %f1, ( 1*8)(%r29) + lfd %f2, ( 2*8)(%r29) + lfd %f3, ( 3*8)(%r29) + lfd %f4, ( 4*8)(%r29) + lfd %f5, ( 5*8)(%r29) + lfd %f6, ( 6*8)(%r29) + lfd %f7, ( 7*8)(%r29) + lfd %f8, ( 8*8)(%r29) + lfd %f9, ( 9*8)(%r29) + lfd %f10, (10*8)(%r29) + lfd %f11, (11*8)(%r29) + lfd %f12, (12*8)(%r29) + lfd %f13, (13*8)(%r29) +2: + + /* Load all the vector registers. */ + bf- 3, 3f + addi %r29, %r29, -16 + lvx %v13, 0, %r29 + addi %r29, %r29, -16 + lvx %v12, 0, %r29 + addi %r29, %r29, -16 + lvx %v11, 0, %r29 + addi %r29, %r29, -16 + lvx %v10, 0, %r29 + addi %r29, %r29, -16 + lvx %v9, 0, %r29 + addi %r29, %r29, -16 + lvx %v8, 0, %r29 + addi %r29, %r29, -16 + lvx %v7, 0, %r29 + addi %r29, %r29, -16 + lvx %v6, 0, %r29 + addi %r29, %r29, -16 + lvx %v5, 0, %r29 + addi %r29, %r29, -16 + lvx %v4, 0, %r29 + addi %r29, %r29, -16 + lvx %v3, 0, %r29 + addi %r29, %r29, -16 + lvx %v2, 0, %r29 +3: + + /* Make the call. */ + ld %r11, 8(%r28) + bctrl + + /* This must follow the call immediately, the unwinder + uses this to find out if r2 has been saved or not. */ +# if _CALL_ELF == 2 + ld %r2, 24(%r1) +# else + ld %r2, 40(%r1) +# endif + + /* Now, deal with the return value. */ + mtcrf 0x01, %r31 + bt 31, .Lstruct_return_value + bt 30, .Ldone_return_value + bt 29, .Lfp_return_value + bt 28, .Lvec_return_value + std %r3, 0(%r30) + /* Fall through... */ + +.Ldone_return_value: + /* Restore the registers we used and return. */ + mr %r1, %r28 + .cfi_def_cfa_register 1 + ld %r0, 16(%r28) + ld %r28, -32(%r28) + mtlr %r0 + ld %r29, -24(%r1) + ld %r30, -16(%r1) + ld %r31, -8(%r1) + blr + +.Lvec_return_value: + stvx %v2, 0, %r30 + b .Ldone_return_value + +.Lfp_return_value: + .cfi_def_cfa_register 28 + mtcrf 0x02, %r31 /* cr6 */ + bf 27, .Lfloat_return_value + stfd %f1, 0(%r30) + bf 26, .Ldone_return_value + stfd %f2, 8(%r30) + b .Ldone_return_value +.Lfloat_return_value: + stfs %f1, 0(%r30) + b .Ldone_return_value + +.Lstruct_return_value: + bf 29, .Lvec_homog_or_small_struct + mtcrf 0x02, %r31 /* cr6 */ + bf 27, .Lfloat_homog_return_value + stfd %f1, 0(%r30) + stfd %f2, 8(%r30) + stfd %f3, 16(%r30) + stfd %f4, 24(%r30) + stfd %f5, 32(%r30) + stfd %f6, 40(%r30) + stfd %f7, 48(%r30) + stfd %f8, 56(%r30) + b .Ldone_return_value + +.Lfloat_homog_return_value: + stfs %f1, 0(%r30) + stfs %f2, 4(%r30) + stfs %f3, 8(%r30) + stfs %f4, 12(%r30) + stfs %f5, 16(%r30) + stfs %f6, 20(%r30) + stfs %f7, 24(%r30) + stfs %f8, 28(%r30) + b .Ldone_return_value + +.Lvec_homog_or_small_struct: + bf 28, .Lsmall_struct + stvx %v2, 0, %r30 + addi %r30, %r30, 16 + stvx %v3, 0, %r30 + addi %r30, %r30, 16 + stvx %v4, 0, %r30 + addi %r30, %r30, 16 + stvx %v5, 0, %r30 + addi %r30, %r30, 16 + stvx %v6, 0, %r30 + addi %r30, %r30, 16 + stvx %v7, 0, %r30 + addi %r30, %r30, 16 + stvx %v8, 0, %r30 + addi %r30, %r30, 16 + stvx %v9, 0, %r30 + b .Ldone_return_value + +.Lsmall_struct: + std %r3, 0(%r30) + std %r4, 8(%r30) + b .Ldone_return_value + + .cfi_endproc +# if _CALL_ELF == 2 + .size ffi_call_LINUX64,.-ffi_call_LINUX64 +# else +# ifdef _CALL_LINUX + .size ffi_call_LINUX64,.-.L.ffi_call_LINUX64 +# else + .long 0 + .byte 0,12,0,1,128,4,0,0 + .size .ffi_call_LINUX64,.-.ffi_call_LINUX64 +# endif +# endif + +#endif + +#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2 + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64_closure.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64_closure.S new file mode 100644 index 0000000..3469a2c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/linux64_closure.S @@ -0,0 +1,564 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC64 Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ +#define LIBFFI_ASM +#include +#include + + .file "linux64_closure.S" + +#ifdef POWERPC64 + FFI_HIDDEN (ffi_closure_LINUX64) + .globl ffi_closure_LINUX64 + .text + .cfi_startproc +# if _CALL_ELF == 2 +ffi_closure_LINUX64: +# ifndef __PCREL__ + addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha + addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l +# endif + .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64 +# else + .section ".opd","aw" + .align 3 +ffi_closure_LINUX64: +# ifdef _CALL_LINUX + .quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0 + .type ffi_closure_LINUX64,@function + .text +.L.ffi_closure_LINUX64: +# else + FFI_HIDDEN (.ffi_closure_LINUX64) + .globl .ffi_closure_LINUX64 + .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 + .size ffi_closure_LINUX64,24 + .type .ffi_closure_LINUX64,@function + .text +.ffi_closure_LINUX64: +# endif +# endif + +# if _CALL_ELF == 2 +# ifdef __VEC__ +# 32 byte special reg save area + 64 byte parm save area +# + 128 byte retval area + 13*8 fpr save area + 12*16 vec save area + round to 16 +# define STACKFRAME 528 +# else +# 32 byte special reg save area + 64 byte parm save area +# + 64 byte retval area + 13*8 fpr save area + round to 16 +# define STACKFRAME 272 +# endif +# define PARMSAVE 32 +# define RETVAL PARMSAVE+64 +# else +# 48 bytes special reg save area + 64 bytes parm save area +# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 +# define STACKFRAME 240 +# define PARMSAVE 48 +# define RETVAL PARMSAVE+64 +# endif + +# if _CALL_ELF == 2 + ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif + mflr %r0 + lwz %r12, 28(%r12) # cif->flags + mtcrf 0x40, %r12 + addi %r12, %r1, PARMSAVE + bt 7, 0f + # Our caller has not allocated a parameter save area. + # We need to allocate one here and use it to pass gprs to + # ffi_closure_helper_LINUX64. + addi %r12, %r1, -STACKFRAME+PARMSAVE +0: + # Save general regs into parm save area + std %r3, 0(%r12) + std %r4, 8(%r12) + std %r5, 16(%r12) + std %r6, 24(%r12) + std %r7, 32(%r12) + std %r8, 40(%r12) + std %r9, 48(%r12) + std %r10, 56(%r12) + + # load up the pointer to the parm save area + mr %r7, %r12 +# else + # copy r2 to r11 and load TOC into r2 + mr %r11, %r2 + ld %r2, 16(%r2) + + mflr %r0 + # Save general regs into parm save area + # This is the parameter save area set up by our caller. + std %r3, PARMSAVE+0(%r1) + std %r4, PARMSAVE+8(%r1) + std %r5, PARMSAVE+16(%r1) + std %r6, PARMSAVE+24(%r1) + std %r7, PARMSAVE+32(%r1) + std %r8, PARMSAVE+40(%r1) + std %r9, PARMSAVE+48(%r1) + std %r10, PARMSAVE+56(%r1) + + # load up the pointer to the parm save area + addi %r7, %r1, PARMSAVE +# endif + std %r0, 16(%r1) + + # closure->cif + ld %r3, FFI_TRAMPOLINE_SIZE(%r11) + # closure->fun + ld %r4, FFI_TRAMPOLINE_SIZE+8(%r11) + # closure->user_data + ld %r5, FFI_TRAMPOLINE_SIZE+16(%r11) + +.Ldoclosure: + # next save fpr 1 to fpr 13 + stfd %f1, -104+(0*8)(%r1) + stfd %f2, -104+(1*8)(%r1) + stfd %f3, -104+(2*8)(%r1) + stfd %f4, -104+(3*8)(%r1) + stfd %f5, -104+(4*8)(%r1) + stfd %f6, -104+(5*8)(%r1) + stfd %f7, -104+(6*8)(%r1) + stfd %f8, -104+(7*8)(%r1) + stfd %f9, -104+(8*8)(%r1) + stfd %f10, -104+(9*8)(%r1) + stfd %f11, -104+(10*8)(%r1) + stfd %f12, -104+(11*8)(%r1) + stfd %f13, -104+(12*8)(%r1) + + # load up the pointer to the saved fpr registers + addi %r8, %r1, -104 + +# ifdef __VEC__ + # load up the pointer to the saved vector registers + # 8 bytes padding for 16-byte alignment at -112(%r1) + addi %r9, %r8, -24 + stvx %v13, 0, %r9 + addi %r9, %r9, -16 + stvx %v12, 0, %r9 + addi %r9, %r9, -16 + stvx %v11, 0, %r9 + addi %r9, %r9, -16 + stvx %v10, 0, %r9 + addi %r9, %r9, -16 + stvx %v9, 0, %r9 + addi %r9, %r9, -16 + stvx %v8, 0, %r9 + addi %r9, %r9, -16 + stvx %v7, 0, %r9 + addi %r9, %r9, -16 + stvx %v6, 0, %r9 + addi %r9, %r9, -16 + stvx %v5, 0, %r9 + addi %r9, %r9, -16 + stvx %v4, 0, %r9 + addi %r9, %r9, -16 + stvx %v3, 0, %r9 + addi %r9, %r9, -16 + stvx %v2, 0, %r9 +# endif + + # load up the pointer to the result storage + addi %r6, %r1, -STACKFRAME+RETVAL + + stdu %r1, -STACKFRAME(%r1) + .cfi_def_cfa_offset STACKFRAME + .cfi_offset 65, 16 + + # make the call +# if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_closure_helper_LINUX64@notoc +.Lret: +# else + bl ffi_closure_helper_LINUX64 +.Lret: + nop +# endif +# else + bl .ffi_closure_helper_LINUX64 +.Lret: + nop +# endif + + # now r3 contains the return type + # so use it to look up in a table + # so we know how to deal with each type + + # look up the proper starting point in table + # by using return type as offset + ld %r0, STACKFRAME+16(%r1) + cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + bge .Lsmall + mflr %r4 # move address of .Lret to r4 + sldi %r3, %r3, 4 # now multiply return type by 16 + addi %r4, %r4, .Lret_type0 - .Lret + add %r3, %r3, %r4 # add contents of table to table address + mtctr %r3 + bctr # jump to it + +# Each of the ret_typeX code fragments has to be exactly 16 bytes long +# (4 instructions). For cache effectiveness we align to a 16 byte boundary +# first. + .align 4 + +.Lret_type0: +# case FFI_TYPE_VOID + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME + nop +# case FFI_TYPE_INT +# ifdef __LITTLE_ENDIAN__ + lwa %r3, RETVAL+0(%r1) +# else + lwa %r3, RETVAL+4(%r1) +# endif + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_FLOAT + lfs %f1, RETVAL+0(%r1) + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_DOUBLE + lfd %f1, RETVAL+0(%r1) + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_LONGDOUBLE + lfd %f1, RETVAL+0(%r1) + mtlr %r0 + lfd %f2, RETVAL+8(%r1) + b .Lfinish +# case FFI_TYPE_UINT8 +# ifdef __LITTLE_ENDIAN__ + lbz %r3, RETVAL+0(%r1) +# else + lbz %r3, RETVAL+7(%r1) +# endif + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_SINT8 +# ifdef __LITTLE_ENDIAN__ + lbz %r3, RETVAL+0(%r1) +# else + lbz %r3, RETVAL+7(%r1) +# endif + extsb %r3,%r3 + mtlr %r0 + b .Lfinish +# case FFI_TYPE_UINT16 +# ifdef __LITTLE_ENDIAN__ + lhz %r3, RETVAL+0(%r1) +# else + lhz %r3, RETVAL+6(%r1) +# endif + mtlr %r0 +.Lfinish: + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_SINT16 +# ifdef __LITTLE_ENDIAN__ + lha %r3, RETVAL+0(%r1) +# else + lha %r3, RETVAL+6(%r1) +# endif + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_UINT32 +# ifdef __LITTLE_ENDIAN__ + lwz %r3, RETVAL+0(%r1) +# else + lwz %r3, RETVAL+4(%r1) +# endif + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_SINT32 +# ifdef __LITTLE_ENDIAN__ + lwa %r3, RETVAL+0(%r1) +# else + lwa %r3, RETVAL+4(%r1) +# endif + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_UINT64 + ld %r3, RETVAL+0(%r1) + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_SINT64 + ld %r3, RETVAL+0(%r1) + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_TYPE_STRUCT + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME + nop +# case FFI_TYPE_POINTER + ld %r3, RETVAL+0(%r1) + mtlr %r0 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +# case FFI_V2_TYPE_VECTOR + addi %r3, %r1, RETVAL + lvx %v2, 0, %r3 + mtlr %r0 + b .Lfinish +# case FFI_V2_TYPE_VECTOR_HOMOG + addi %r3, %r1, RETVAL + lvx %v2, 0, %r3 + addi %r3, %r3, 16 + b .Lmorevector +# case FFI_V2_TYPE_FLOAT_HOMOG + lfs %f1, RETVAL+0(%r1) + lfs %f2, RETVAL+4(%r1) + lfs %f3, RETVAL+8(%r1) + b .Lmorefloat +# case FFI_V2_TYPE_DOUBLE_HOMOG + lfd %f1, RETVAL+0(%r1) + lfd %f2, RETVAL+8(%r1) + lfd %f3, RETVAL+16(%r1) + lfd %f4, RETVAL+24(%r1) + mtlr %r0 + lfd %f5, RETVAL+32(%r1) + lfd %f6, RETVAL+40(%r1) + lfd %f7, RETVAL+48(%r1) + lfd %f8, RETVAL+56(%r1) + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +.Lmorevector: + lvx %v3, 0, %r3 + addi %r3, %r3, 16 + lvx %v4, 0, %r3 + addi %r3, %r3, 16 + lvx %v5, 0, %r3 + mtlr %r0 + addi %r3, %r3, 16 + lvx %v6, 0, %r3 + addi %r3, %r3, 16 + lvx %v7, 0, %r3 + addi %r3, %r3, 16 + lvx %v8, 0, %r3 + addi %r3, %r3, 16 + lvx %v9, 0, %r3 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +.Lmorefloat: + lfs %f4, RETVAL+12(%r1) + mtlr %r0 + lfs %f5, RETVAL+16(%r1) + lfs %f6, RETVAL+20(%r1) + lfs %f7, RETVAL+24(%r1) + lfs %f8, RETVAL+28(%r1) + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +.Lsmall: +# ifdef __LITTLE_ENDIAN__ + ld %r3,RETVAL+0(%r1) + mtlr %r0 + ld %r4,RETVAL+8(%r1) + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr +# else + # A struct smaller than a dword is returned in the low bits of r3 + # ie. right justified. Larger structs are passed left justified + # in r3 and r4. The return value area on the stack will have + # the structs as they are usually stored in memory. + cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes? + neg %r5, %r3 + ld %r3,RETVAL+0(%r1) + blt .Lsmalldown + mtlr %r0 + ld %r4,RETVAL+8(%r1) + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset STACKFRAME +.Lsmalldown: + addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7 + mtlr %r0 + sldi %r5, %r5, 3 + addi %r1, %r1, STACKFRAME + .cfi_def_cfa_offset 0 + srd %r3, %r3, %r5 + blr +# endif + + .cfi_endproc +# if _CALL_ELF == 2 + .size ffi_closure_LINUX64,.-ffi_closure_LINUX64 +# else +# ifdef _CALL_LINUX + .size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64 +# else + .long 0 + .byte 0,12,0,1,128,0,0,0 + .size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64 +# endif +# endif + + + FFI_HIDDEN (ffi_go_closure_linux64) + .globl ffi_go_closure_linux64 + .text + .cfi_startproc +# if _CALL_ELF == 2 +ffi_go_closure_linux64: +# ifndef __PCREL__ + addis %r2, %r12, .TOC.-ffi_go_closure_linux64@ha + addi %r2, %r2, .TOC.-ffi_go_closure_linux64@l +# endif + .localentry ffi_go_closure_linux64, . - ffi_go_closure_linux64 +# else + .section ".opd","aw" + .align 3 +ffi_go_closure_linux64: +# ifdef _CALL_LINUX + .quad .L.ffi_go_closure_linux64,.TOC.@tocbase,0 + .type ffi_go_closure_linux64,@function + .text +.L.ffi_go_closure_linux64: +# else + FFI_HIDDEN (.ffi_go_closure_linux64) + .globl .ffi_go_closure_linux64 + .quad .ffi_go_closure_linux64,.TOC.@tocbase,0 + .size ffi_go_closure_linux64,24 + .type .ffi_go_closure_linux64,@function + .text +.ffi_go_closure_linux64: +# endif +# endif + +# if _CALL_ELF == 2 + ld %r12, 8(%r11) # closure->cif + mflr %r0 + lwz %r12, 28(%r12) # cif->flags + mtcrf 0x40, %r12 + addi %r12, %r1, PARMSAVE + bt 7, 0f + # Our caller has not allocated a parameter save area. + # We need to allocate one here and use it to pass gprs to + # ffi_closure_helper_LINUX64. + addi %r12, %r1, -STACKFRAME+PARMSAVE +0: + # Save general regs into parm save area + std %r3, 0(%r12) + std %r4, 8(%r12) + std %r5, 16(%r12) + std %r6, 24(%r12) + std %r7, 32(%r12) + std %r8, 40(%r12) + std %r9, 48(%r12) + std %r10, 56(%r12) + + # load up the pointer to the parm save area + mr %r7, %r12 +# else + mflr %r0 + # Save general regs into parm save area + # This is the parameter save area set up by our caller. + std %r3, PARMSAVE+0(%r1) + std %r4, PARMSAVE+8(%r1) + std %r5, PARMSAVE+16(%r1) + std %r6, PARMSAVE+24(%r1) + std %r7, PARMSAVE+32(%r1) + std %r8, PARMSAVE+40(%r1) + std %r9, PARMSAVE+48(%r1) + std %r10, PARMSAVE+56(%r1) + + # load up the pointer to the parm save area + addi %r7, %r1, PARMSAVE +# endif + std %r0, 16(%r1) + + # closure->cif + ld %r3, 8(%r11) + # closure->fun + ld %r4, 16(%r11) + # user_data + mr %r5, %r11 + b .Ldoclosure + + .cfi_endproc +# if _CALL_ELF == 2 + .size ffi_go_closure_linux64,.-ffi_go_closure_linux64 +# else +# ifdef _CALL_LINUX + .size ffi_go_closure_linux64,.-.L.ffi_go_closure_linux64 +# else + .long 0 + .byte 0,12,0,1,128,0,0,0 + .size .ffi_go_closure_linux64,.-.ffi_go_closure_linux64 +# endif +# endif +#endif + +#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2 + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ppc_closure.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ppc_closure.S new file mode 100644 index 0000000..b6d209d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/ppc_closure.S @@ -0,0 +1,397 @@ +/* ----------------------------------------------------------------------- + sysv.h - Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2008 Red Hat, Inc. + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ +#define LIBFFI_ASM +#include +#include +#include + + .file "ppc_closure.S" + +#ifndef POWERPC64 + +FFI_HIDDEN(ffi_closure_SYSV) +ENTRY(ffi_closure_SYSV) + .cfi_startproc + stwu %r1,-144(%r1) + .cfi_def_cfa_offset 144 + mflr %r0 + stw %r0,148(%r1) + .cfi_offset 65, 4 + +# we want to build up an areas for the parameters passed +# in registers (both floating point and integer) + + # so first save gpr 3 to gpr 10 (aligned to 4) + stw %r3, 16(%r1) + stw %r4, 20(%r1) + stw %r5, 24(%r1) + + # set up registers for the routine that does the work + + # closure->cif + lwz %r3,FFI_TRAMPOLINE_SIZE(%r11) + # closure->fun + lwz %r4,FFI_TRAMPOLINE_SIZE+4(%r11) + # closure->user_data + lwz %r5,FFI_TRAMPOLINE_SIZE+8(%r11) + +.Ldoclosure: + stw %r6, 28(%r1) + stw %r7, 32(%r1) + stw %r8, 36(%r1) + stw %r9, 40(%r1) + stw %r10,44(%r1) + +#ifndef __NO_FPRS__ + # next save fpr 1 to fpr 8 (aligned to 8) + stfd %f1, 48(%r1) + stfd %f2, 56(%r1) + stfd %f3, 64(%r1) + stfd %f4, 72(%r1) + stfd %f5, 80(%r1) + stfd %f6, 88(%r1) + stfd %f7, 96(%r1) + stfd %f8, 104(%r1) +#endif + + # pointer to the result storage + addi %r6,%r1,112 + + # pointer to the saved gpr registers + addi %r7,%r1,16 + + # pointer to the saved fpr registers + addi %r8,%r1,48 + + # pointer to the outgoing parameter save area in the previous frame + # i.e. the previous frame pointer + 8 + addi %r9,%r1,152 + + # make the call + bl ffi_closure_helper_SYSV@local +.Lret: + # now r3 contains the return type + # so use it to look up in a table + # so we know how to deal with each type + + # look up the proper starting point in table + # by using return type as offset + + mflr %r4 # move address of .Lret to r4 + slwi %r3,%r3,4 # now multiply return type by 16 + addi %r4, %r4, .Lret_type0 - .Lret + lwz %r0,148(%r1) + add %r3,%r3,%r4 # add contents of table to table address + mtctr %r3 + bctr # jump to it + +# Each of the ret_typeX code fragments has to be exactly 16 bytes long +# (4 instructions). For cache effectiveness we align to a 16 byte boundary +# first. + .align 4 +# case FFI_TYPE_VOID +.Lret_type0: + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + nop + +# case FFI_TYPE_INT + lwz %r3,112+0(%r1) + mtlr %r0 +.Lfinish: + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_FLOAT +#ifndef __NO_FPRS__ + lfs %f1,112+0(%r1) +#else + nop +#endif + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_DOUBLE +#ifndef __NO_FPRS__ + lfd %f1,112+0(%r1) +#else + nop +#endif + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_LONGDOUBLE +#ifndef __NO_FPRS__ + lfd %f1,112+0(%r1) + lfd %f2,112+8(%r1) + mtlr %r0 + b .Lfinish +#else + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + nop +#endif + +# case FFI_TYPE_UINT8 +#ifdef __LITTLE_ENDIAN__ + lbz %r3,112+0(%r1) +#else + lbz %r3,112+3(%r1) +#endif + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_SINT8 +#ifdef __LITTLE_ENDIAN__ + lbz %r3,112+0(%r1) +#else + lbz %r3,112+3(%r1) +#endif + extsb %r3,%r3 + mtlr %r0 + b .Lfinish + +# case FFI_TYPE_UINT16 +#ifdef __LITTLE_ENDIAN__ + lhz %r3,112+0(%r1) +#else + lhz %r3,112+2(%r1) +#endif + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_SINT16 +#ifdef __LITTLE_ENDIAN__ + lha %r3,112+0(%r1) +#else + lha %r3,112+2(%r1) +#endif + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_UINT32 + lwz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_SINT32 + lwz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_UINT64 + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) + mtlr %r0 + b .Lfinish + +# case FFI_TYPE_SINT64 + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) + mtlr %r0 + b .Lfinish + +# case FFI_TYPE_STRUCT + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + nop + +# case FFI_TYPE_POINTER + lwz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_TYPE_UINT128 + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) + lwz %r5,112+8(%r1) + b .Luint128 + +# The return types below are only used when the ABI type is FFI_SYSV. +# case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct. + lbz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 2. Two byte struct. + lhz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct. + lwz %r3,112+0(%r1) +#ifdef __LITTLE_ENDIAN__ + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 +#else + srwi %r3,%r3,8 + mtlr %r0 + b .Lfinish +#endif + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct. + lwz %r3,112+0(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) +#ifdef __LITTLE_ENDIAN__ + mtlr %r0 + b .Lfinish +#else + li %r5,24 + b .Lstruct567 +#endif + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) +#ifdef __LITTLE_ENDIAN__ + mtlr %r0 + b .Lfinish +#else + li %r5,16 + b .Lstruct567 +#endif + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) +#ifdef __LITTLE_ENDIAN__ + mtlr %r0 + b .Lfinish +#else + li %r5,8 + b .Lstruct567 +#endif + +# case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) + mtlr %r0 + b .Lfinish + +#ifndef __LITTLE_ENDIAN__ +.Lstruct567: + subfic %r6,%r5,32 + srw %r4,%r4,%r5 + slw %r6,%r3,%r6 + srw %r3,%r3,%r5 + or %r4,%r6,%r4 + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_def_cfa_offset 144 +#endif + +.Luint128: + lwz %r6,112+12(%r1) + mtlr %r0 + addi %r1,%r1,144 + .cfi_def_cfa_offset 0 + blr + .cfi_endproc +END(ffi_closure_SYSV) + + +FFI_HIDDEN(ffi_go_closure_sysv) +ENTRY(ffi_go_closure_sysv) + .cfi_startproc + stwu %r1,-144(%r1) + .cfi_def_cfa_offset 144 + mflr %r0 + stw %r0,148(%r1) + .cfi_offset 65, 4 + + stw %r3, 16(%r1) + stw %r4, 20(%r1) + stw %r5, 24(%r1) + + # closure->cif + lwz %r3,4(%r11) + # closure->fun + lwz %r4,8(%r11) + # user_data + mr %r5,%r11 + b .Ldoclosure + .cfi_endproc +END(ffi_go_closure_sysv) + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/sysv.S new file mode 100644 index 0000000..df97734 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/powerpc/sysv.S @@ -0,0 +1,173 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 1998 Geoffrey Keating + Copyright (C) 2007 Free Software Foundation, Inc + + PowerPC Assembly glue. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include + +#ifndef POWERPC64 +FFI_HIDDEN(ffi_call_SYSV) +ENTRY(ffi_call_SYSV) + .cfi_startproc + /* Save the old stack pointer as AP. */ + mr %r10,%r1 + .cfi_def_cfa_register 10 + + /* Allocate the stack space we need. */ + stwux %r1,%r1,%r8 + /* Save registers we use. */ + mflr %r9 + stw %r28,-16(%r10) + stw %r29,-12(%r10) + stw %r30, -8(%r10) + stw %r31, -4(%r10) + stw %r9, 4(%r10) + .cfi_offset 65, 4 + .cfi_offset 31, -4 + .cfi_offset 30, -8 + .cfi_offset 29, -12 + .cfi_offset 28, -16 + + /* Save arguments over call... */ + stw %r7, -20(%r10) /* closure, */ + mr %r31,%r6 /* flags, */ + mr %r30,%r5 /* rvalue, */ + mr %r29,%r4 /* function address, */ + mr %r28,%r10 /* our AP. */ + .cfi_def_cfa_register 28 + + /* Call ffi_prep_args_SYSV. */ + mr %r4,%r1 + bl ffi_prep_args_SYSV@local + + /* Now do the call. */ + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40,%r31 + /* Get the address to call into CTR. */ + mtctr %r29 + /* Load all those argument registers. */ + lwz %r3,-24-(8*4)(%r28) + lwz %r4,-24-(7*4)(%r28) + lwz %r5,-24-(6*4)(%r28) + lwz %r6,-24-(5*4)(%r28) + bf- 5,1f + nop + lwz %r7,-24-(4*4)(%r28) + lwz %r8,-24-(3*4)(%r28) + lwz %r9,-24-(2*4)(%r28) + lwz %r10,-24-(1*4)(%r28) + nop +1: + +#ifndef __NO_FPRS__ + /* Load all the FP registers. */ + bf- 6,2f + lfd %f1,-24-(8*4)-(8*8)(%r28) + lfd %f2,-24-(8*4)-(7*8)(%r28) + lfd %f3,-24-(8*4)-(6*8)(%r28) + lfd %f4,-24-(8*4)-(5*8)(%r28) + nop + lfd %f5,-24-(8*4)-(4*8)(%r28) + lfd %f6,-24-(8*4)-(3*8)(%r28) + lfd %f7,-24-(8*4)-(2*8)(%r28) + lfd %f8,-24-(8*4)-(1*8)(%r28) +#endif +2: + + /* Make the call. */ + lwz %r11, -20(%r28) + bctrl + + /* Now, deal with the return value. */ + mtcrf 0x03,%r31 /* cr6-cr7 */ + bt- 31,L(small_struct_return_value) + bt- 30,L(done_return_value) +#ifndef __NO_FPRS__ + bt- 29,L(fp_return_value) +#endif + stw %r3,0(%r30) + bf+ 27,L(done_return_value) + stw %r4,4(%r30) + bf 26,L(done_return_value) + stw %r5,8(%r30) + stw %r6,12(%r30) + /* Fall through... */ + +L(done_return_value): + /* Restore the registers we used and return. */ + lwz %r9, 4(%r28) + lwz %r31, -4(%r28) + mtlr %r9 + lwz %r30, -8(%r28) + lwz %r29,-12(%r28) + lwz %r28,-16(%r28) + .cfi_remember_state + /* At this point we don't have a cfa register. Say all our + saved regs have been restored. */ + .cfi_same_value 65 + .cfi_same_value 31 + .cfi_same_value 30 + .cfi_same_value 29 + .cfi_same_value 28 + /* Hopefully this works.. */ + .cfi_def_cfa_register 1 + .cfi_offset 1, 0 + lwz %r1,0(%r1) + .cfi_same_value 1 + blr + +#ifndef __NO_FPRS__ +L(fp_return_value): + .cfi_restore_state + bf 27,L(float_return_value) + stfd %f1,0(%r30) + bf 26,L(done_return_value) + stfd %f2,8(%r30) + b L(done_return_value) +L(float_return_value): + stfs %f1,0(%r30) + b L(done_return_value) +#endif + +L(small_struct_return_value): + /* + * The C code always allocates a properly-aligned 8-byte bounce + * buffer to make this assembly code very simple. Just write out + * r3 and r4 to the buffer to allow the C code to handle the rest. + */ + stw %r3, 0(%r30) + stw %r4, 4(%r30) + b L(done_return_value) + .cfi_endproc + +END(ffi_call_SYSV) + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/prep_cif.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/prep_cif.c new file mode 100644 index 0000000..1db3804 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/prep_cif.c @@ -0,0 +1,263 @@ +/* ----------------------------------------------------------------------- + prep_cif.c - Copyright (c) 2011, 2012 Anthony Green + Copyright (c) 1996, 1998, 2007 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include + +/* Round up to FFI_SIZEOF_ARG. */ + +#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG) + +/* Perform machine independent initialization of aggregate type + specifications. */ + +static ffi_status initialize_aggregate(ffi_type *arg, size_t *offsets) +{ + ffi_type **ptr; + + if (UNLIKELY(arg == NULL || arg->elements == NULL)) + return FFI_BAD_TYPEDEF; + + arg->size = 0; + arg->alignment = 0; + + ptr = &(arg->elements[0]); + + if (UNLIKELY(ptr == 0)) + return FFI_BAD_TYPEDEF; + + while ((*ptr) != NULL) + { + if (UNLIKELY(((*ptr)->size == 0) + && (initialize_aggregate((*ptr), NULL) != FFI_OK))) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type */ + FFI_ASSERT_VALID_TYPE(*ptr); + + arg->size = FFI_ALIGN(arg->size, (*ptr)->alignment); + if (offsets) + *offsets++ = arg->size; + arg->size += (*ptr)->size; + + arg->alignment = (arg->alignment > (*ptr)->alignment) ? + arg->alignment : (*ptr)->alignment; + + ptr++; + } + + /* Structure size includes tail padding. This is important for + structures that fit in one register on ABIs like the PowerPC64 + Linux ABI that right justify small structs in a register. + It's also needed for nested structure layout, for example + struct A { long a; char b; }; struct B { struct A x; char y; }; + should find y at an offset of 2*sizeof(long) and result in a + total size of 3*sizeof(long). */ + arg->size = FFI_ALIGN (arg->size, arg->alignment); + + /* On some targets, the ABI defines that structures have an additional + alignment beyond the "natural" one based on their elements. */ +#ifdef FFI_AGGREGATE_ALIGNMENT + if (FFI_AGGREGATE_ALIGNMENT > arg->alignment) + arg->alignment = FFI_AGGREGATE_ALIGNMENT; +#endif + + if (arg->size == 0) + return FFI_BAD_TYPEDEF; + else + return FFI_OK; +} + +#ifndef __CRIS__ +/* The CRIS ABI specifies structure elements to have byte + alignment only, so it completely overrides this functions, + which assumes "natural" alignment and padding. */ + +/* Perform machine independent ffi_cif preparation, then call + machine dependent routine. */ + +/* For non variadic functions isvariadic should be 0 and + nfixedargs==ntotalargs. + + For variadic calls, isvariadic should be 1 and nfixedargs + and ntotalargs set as appropriate. nfixedargs must always be >=1 */ + + +ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi, + unsigned int isvariadic, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, ffi_type **atypes) +{ + unsigned bytes = 0; + unsigned int i; + ffi_type **ptr; + + FFI_ASSERT(cif != NULL); + FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); + FFI_ASSERT(nfixedargs <= ntotalargs); + + if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) + return FFI_BAD_ABI; + + cif->abi = abi; + cif->arg_types = atypes; + cif->nargs = ntotalargs; + cif->rtype = rtype; + + cif->flags = 0; +#if (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32) + cif->is_variadic = isvariadic; +#endif +#if HAVE_LONG_DOUBLE_VARIANT + ffi_prep_types (abi); +#endif + + /* Initialize the return type if necessary */ + if ((cif->rtype->size == 0) + && (initialize_aggregate(cif->rtype, NULL) != FFI_OK)) + return FFI_BAD_TYPEDEF; + +#ifndef FFI_TARGET_HAS_COMPLEX_TYPE + if (rtype->type == FFI_TYPE_COMPLEX) + abort(); +#endif + /* Perform a sanity check on the return type */ + FFI_ASSERT_VALID_TYPE(cif->rtype); + + /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */ +#if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT +#ifdef TILE + && (cif->rtype->size > 10 * FFI_SIZEOF_ARG) +#endif +#ifdef XTENSA + && (cif->rtype->size > 16) +#endif +#ifdef NIOS2 + && (cif->rtype->size > 8) +#endif + ) + bytes = STACK_ARG_SIZE(sizeof(void*)); +#endif + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + + /* Initialize any uninitialized aggregate type definitions */ + if (((*ptr)->size == 0) + && (initialize_aggregate((*ptr), NULL) != FFI_OK)) + return FFI_BAD_TYPEDEF; + +#ifndef FFI_TARGET_HAS_COMPLEX_TYPE + if ((*ptr)->type == FFI_TYPE_COMPLEX) + abort(); +#endif + /* Perform a sanity check on the argument type, do this + check after the initialization. */ + FFI_ASSERT_VALID_TYPE(*ptr); + +#if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION + { + /* Add any padding if necessary */ + if (((*ptr)->alignment - 1) & bytes) + bytes = (unsigned)FFI_ALIGN(bytes, (*ptr)->alignment); + +#ifdef TILE + if (bytes < 10 * FFI_SIZEOF_ARG && + bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG) + { + /* An argument is never split between the 10 parameter + registers and the stack. */ + bytes = 10 * FFI_SIZEOF_ARG; + } +#endif +#ifdef XTENSA + if (bytes <= 6*4 && bytes + STACK_ARG_SIZE((*ptr)->size) > 6*4) + bytes = 6*4; +#endif + + bytes += (unsigned int)STACK_ARG_SIZE((*ptr)->size); + } +#endif + } + + cif->bytes = bytes; + + /* Perform machine dependent cif processing */ +#ifdef FFI_TARGET_SPECIFIC_VARIADIC + if (isvariadic) + return ffi_prep_cif_machdep_var(cif, nfixedargs, ntotalargs); +#endif + + return ffi_prep_cif_machdep(cif); +} +#endif /* not __CRIS__ */ + +ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, + ffi_type *rtype, ffi_type **atypes) +{ + return ffi_prep_cif_core(cif, abi, 0, nargs, nargs, rtype, atypes); +} + +ffi_status ffi_prep_cif_var(ffi_cif *cif, + ffi_abi abi, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes) +{ + return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes); +} + +#if FFI_CLOSURES + +ffi_status +ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data) +{ + return ffi_prep_closure_loc (closure, cif, fun, user_data, closure); +} + +#endif + +ffi_status +ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets) +{ + if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) + return FFI_BAD_ABI; + if (struct_type->type != FFI_TYPE_STRUCT) + return FFI_BAD_TYPEDEF; + +#if HAVE_LONG_DOUBLE_VARIANT + ffi_prep_types (abi); +#endif + + return initialize_aggregate(struct_type, offsets); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/raw_api.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/raw_api.c new file mode 100644 index 0000000..be15611 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/raw_api.c @@ -0,0 +1,267 @@ +/* ----------------------------------------------------------------------- + raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc. + + Author: Kresten Krab Thorup + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* This file defines generic functions for use with the raw api. */ + +#include +#include + +#if !FFI_NO_RAW_API + +size_t +ffi_raw_size (ffi_cif *cif) +{ + size_t result = 0; + int i; + + ffi_type **at = cif->arg_types; + + for (i = cif->nargs-1; i >= 0; i--, at++) + { +#if !FFI_NO_STRUCTS + if ((*at)->type == FFI_TYPE_STRUCT) + result += FFI_ALIGN (sizeof (void*), FFI_SIZEOF_ARG); + else +#endif + result += FFI_ALIGN ((*at)->size, FFI_SIZEOF_ARG); + } + + return result; +} + + +void +ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + +#if WORDS_BIGENDIAN + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1); + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2); + break; + +#if FFI_SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4); + break; +#endif + +#if !FFI_NO_STRUCTS + case FFI_TYPE_STRUCT: + *args = (raw++)->ptr; + break; +#endif + + case FFI_TYPE_COMPLEX: + *args = (raw++)->ptr; + break; + + case FFI_TYPE_POINTER: + *args = (void*) &(raw++)->ptr; + break; + + default: + *args = raw; + raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + } + } + +#else /* WORDS_BIGENDIAN */ + +#if !PDP + + /* then assume little endian */ + for (i = 0; i < cif->nargs; i++, tp++, args++) + { +#if !FFI_NO_STRUCTS + if ((*tp)->type == FFI_TYPE_STRUCT) + { + *args = (raw++)->ptr; + } + else +#endif + if ((*tp)->type == FFI_TYPE_COMPLEX) + { + *args = (raw++)->ptr; + } + else + { + *args = (void*) raw; + raw += FFI_ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); + } + } + +#else +#error "pdp endian not supported" +#endif /* ! PDP */ + +#endif /* WORDS_BIGENDIAN */ +} + +void +ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: + (raw++)->uint = *(UINT8*) (*args); + break; + + case FFI_TYPE_SINT8: + (raw++)->sint = *(SINT8*) (*args); + break; + + case FFI_TYPE_UINT16: + (raw++)->uint = *(UINT16*) (*args); + break; + + case FFI_TYPE_SINT16: + (raw++)->sint = *(SINT16*) (*args); + break; + +#if FFI_SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: + (raw++)->uint = *(UINT32*) (*args); + break; + + case FFI_TYPE_SINT32: + (raw++)->sint = *(SINT32*) (*args); + break; +#endif + +#if !FFI_NO_STRUCTS + case FFI_TYPE_STRUCT: + (raw++)->ptr = *args; + break; +#endif + + case FFI_TYPE_COMPLEX: + (raw++)->ptr = *args; + break; + + case FFI_TYPE_POINTER: + (raw++)->ptr = **(void***) args; + break; + + default: + memcpy ((void*) raw->data, (void*)*args, (*tp)->size); + raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + } + } +} + +#if !FFI_NATIVE_RAW_API + + +/* This is a generic definition of ffi_raw_call, to be used if the + * native system does not provide a machine-specific implementation. + * Having this, allows code to be written for the raw API, without + * the need for system-specific code to handle input in that format; + * these following couple of functions will handle the translation forth + * and back automatically. */ + +void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw) +{ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + ffi_raw_to_ptrarray (cif, raw, avalue); + ffi_call (cif, fn, rvalue, avalue); +} + +#if FFI_CLOSURES /* base system provides closures */ + +static void +ffi_translate_args (ffi_cif *cif, void *rvalue, + void **avalue, void *user_data) +{ + ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif)); + ffi_raw_closure *cl = (ffi_raw_closure*)user_data; + + ffi_ptrarray_to_raw (cif, avalue, raw); + (*cl->fun) (cif, rvalue, raw, cl->user_data); +} + +ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc) +{ + ffi_status status; + + status = ffi_prep_closure_loc ((ffi_closure*) cl, + cif, + &ffi_translate_args, + codeloc, + codeloc); + if (status == FFI_OK) + { + cl->fun = fun; + cl->user_data = user_data; + } + + return status; +} + +#endif /* FFI_CLOSURES */ +#endif /* !FFI_NATIVE_RAW_API */ + +#if FFI_CLOSURES + +/* Again, here is the generic version of ffi_prep_raw_closure, which + * will install an intermediate "hub" for translation of arguments from + * the pointer-array format, to the raw format */ + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data) +{ + return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl); +} + +#endif /* FFI_CLOSURES */ + +#endif /* !FFI_NO_RAW_API */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffi.c new file mode 100644 index 0000000..c910858 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffi.c @@ -0,0 +1,481 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2015 Michael Knyszek + 2015 Andrew Waterman + 2018 Stef O'Rear + Based on MIPS N32/64 port + + RISC-V Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include + +#if __riscv_float_abi_double +#define ABI_FLEN 64 +#define ABI_FLOAT double +#elif __riscv_float_abi_single +#define ABI_FLEN 32 +#define ABI_FLOAT float +#endif + +#define NARGREG 8 +#define STKALIGN 16 +#define MAXCOPYARG (2 * sizeof(double)) + +typedef struct call_context +{ +#if ABI_FLEN + ABI_FLOAT fa[8]; +#endif + size_t a[8]; + /* used by the assembly code to in-place construct its own stack frame */ + char frame[16]; +} call_context; + +typedef struct call_builder +{ + call_context *aregs; + int used_integer; + int used_float; + size_t *used_stack; +} call_builder; + +/* integer (not pointer) less than ABI XLEN */ +/* FFI_TYPE_INT does not appear to be used */ +#if __SIZEOF_POINTER__ == 8 +#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT64) +#else +#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT32) +#endif + +#if ABI_FLEN +typedef struct { + char as_elements, type1, offset2, type2; +} float_struct_info; + +#if ABI_FLEN >= 64 +#define IS_FLOAT(type) ((type) >= FFI_TYPE_FLOAT && (type) <= FFI_TYPE_DOUBLE) +#else +#define IS_FLOAT(type) ((type) == FFI_TYPE_FLOAT) +#endif + +static ffi_type **flatten_struct(ffi_type *in, ffi_type **out, ffi_type **out_end) { + int i; + if (out == out_end) return out; + if (in->type != FFI_TYPE_STRUCT) { + *(out++) = in; + } else { + for (i = 0; in->elements[i]; i++) + out = flatten_struct(in->elements[i], out, out_end); + } + return out; +} + +/* Structs with at most two fields after flattening, one of which is of + floating point type, are passed in multiple registers if sufficient + registers are available. */ +static float_struct_info struct_passed_as_elements(call_builder *cb, ffi_type *top) { + float_struct_info ret = {0, 0, 0, 0}; + ffi_type *fields[3]; + int num_floats, num_ints; + int num_fields = flatten_struct(top, fields, fields + 3) - fields; + + if (num_fields == 1) { + if (IS_FLOAT(fields[0]->type)) { + ret.as_elements = 1; + ret.type1 = fields[0]->type; + } + } else if (num_fields == 2) { + num_floats = IS_FLOAT(fields[0]->type) + IS_FLOAT(fields[1]->type); + num_ints = IS_INT(fields[0]->type) + IS_INT(fields[1]->type); + if (num_floats == 0 || num_floats + num_ints != 2) + return ret; + if (cb->used_float + num_floats > NARGREG || cb->used_integer + (2 - num_floats) > NARGREG) + return ret; + if (!IS_FLOAT(fields[0]->type) && !IS_FLOAT(fields[1]->type)) + return ret; + + ret.type1 = fields[0]->type; + ret.type2 = fields[1]->type; + ret.offset2 = FFI_ALIGN(fields[0]->size, fields[1]->alignment); + ret.as_elements = 1; + } + + return ret; +} +#endif + +/* allocates a single register, float register, or XLEN-sized stack slot to a datum */ +static void marshal_atom(call_builder *cb, int type, void *data) { + size_t value = 0; + switch (type) { + case FFI_TYPE_UINT8: value = *(uint8_t *)data; break; + case FFI_TYPE_SINT8: value = *(int8_t *)data; break; + case FFI_TYPE_UINT16: value = *(uint16_t *)data; break; + case FFI_TYPE_SINT16: value = *(int16_t *)data; break; + /* 32-bit quantities are always sign-extended in the ABI */ + case FFI_TYPE_UINT32: value = *(int32_t *)data; break; + case FFI_TYPE_SINT32: value = *(int32_t *)data; break; +#if __SIZEOF_POINTER__ == 8 + case FFI_TYPE_UINT64: value = *(uint64_t *)data; break; + case FFI_TYPE_SINT64: value = *(int64_t *)data; break; +#endif + case FFI_TYPE_POINTER: value = *(size_t *)data; break; + + /* float values may be recoded in an implementation-defined way + by hardware conforming to 2.1 or earlier, so use asm to + reinterpret floats as doubles */ +#if ABI_FLEN >= 32 + case FFI_TYPE_FLOAT: + asm("" : "=f"(cb->aregs->fa[cb->used_float++]) : "0"(*(float *)data)); + return; +#endif +#if ABI_FLEN >= 64 + case FFI_TYPE_DOUBLE: + asm("" : "=f"(cb->aregs->fa[cb->used_float++]) : "0"(*(double *)data)); + return; +#endif + default: FFI_ASSERT(0); break; + } + + if (cb->used_integer == NARGREG) { + *cb->used_stack++ = value; + } else { + cb->aregs->a[cb->used_integer++] = value; + } +} + +static void unmarshal_atom(call_builder *cb, int type, void *data) { + size_t value; + switch (type) { +#if ABI_FLEN >= 32 + case FFI_TYPE_FLOAT: + asm("" : "=f"(*(float *)data) : "0"(cb->aregs->fa[cb->used_float++])); + return; +#endif +#if ABI_FLEN >= 64 + case FFI_TYPE_DOUBLE: + asm("" : "=f"(*(double *)data) : "0"(cb->aregs->fa[cb->used_float++])); + return; +#endif + } + + if (cb->used_integer == NARGREG) { + value = *cb->used_stack++; + } else { + value = cb->aregs->a[cb->used_integer++]; + } + + switch (type) { + case FFI_TYPE_UINT8: *(uint8_t *)data = value; break; + case FFI_TYPE_SINT8: *(uint8_t *)data = value; break; + case FFI_TYPE_UINT16: *(uint16_t *)data = value; break; + case FFI_TYPE_SINT16: *(uint16_t *)data = value; break; + case FFI_TYPE_UINT32: *(uint32_t *)data = value; break; + case FFI_TYPE_SINT32: *(uint32_t *)data = value; break; +#if __SIZEOF_POINTER__ == 8 + case FFI_TYPE_UINT64: *(uint64_t *)data = value; break; + case FFI_TYPE_SINT64: *(uint64_t *)data = value; break; +#endif + case FFI_TYPE_POINTER: *(size_t *)data = value; break; + default: FFI_ASSERT(0); break; + } +} + +/* adds an argument to a call, or a not by reference return value */ +static void marshal(call_builder *cb, ffi_type *type, int var, void *data) { + size_t realign[2]; + +#if ABI_FLEN + if (!var && type->type == FFI_TYPE_STRUCT) { + float_struct_info fsi = struct_passed_as_elements(cb, type); + if (fsi.as_elements) { + marshal_atom(cb, fsi.type1, data); + if (fsi.offset2) + marshal_atom(cb, fsi.type2, ((char*)data) + fsi.offset2); + return; + } + } + + if (!var && cb->used_float < NARGREG && IS_FLOAT(type->type)) { + marshal_atom(cb, type->type, data); + return; + } +#endif + + if (type->size > 2 * __SIZEOF_POINTER__) { + /* pass by reference */ + marshal_atom(cb, FFI_TYPE_POINTER, &data); + } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { + marshal_atom(cb, type->type, data); + } else { + /* overlong integers, soft-float floats, and structs without special + float handling are treated identically from this point on */ + + /* variadics are aligned even in registers */ + if (type->alignment > __SIZEOF_POINTER__) { + if (var) + cb->used_integer = FFI_ALIGN(cb->used_integer, 2); + cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__); + } + + memcpy(realign, data, type->size); + if (type->size > 0) + marshal_atom(cb, FFI_TYPE_POINTER, realign); + if (type->size > __SIZEOF_POINTER__) + marshal_atom(cb, FFI_TYPE_POINTER, realign + 1); + } +} + +/* for arguments passed by reference returns the pointer, otherwise the arg is copied (up to MAXCOPYARG bytes) */ +static void *unmarshal(call_builder *cb, ffi_type *type, int var, void *data) { + size_t realign[2]; + void *pointer; + +#if ABI_FLEN + if (!var && type->type == FFI_TYPE_STRUCT) { + float_struct_info fsi = struct_passed_as_elements(cb, type); + if (fsi.as_elements) { + unmarshal_atom(cb, fsi.type1, data); + if (fsi.offset2) + unmarshal_atom(cb, fsi.type2, ((char*)data) + fsi.offset2); + return data; + } + } + + if (!var && cb->used_float < NARGREG && IS_FLOAT(type->type)) { + unmarshal_atom(cb, type->type, data); + return data; + } +#endif + + if (type->size > 2 * __SIZEOF_POINTER__) { + /* pass by reference */ + unmarshal_atom(cb, FFI_TYPE_POINTER, (char*)&pointer); + return pointer; + } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { + unmarshal_atom(cb, type->type, data); + return data; + } else { + /* overlong integers, soft-float floats, and structs without special + float handling are treated identically from this point on */ + + /* variadics are aligned even in registers */ + if (type->alignment > __SIZEOF_POINTER__) { + if (var) + cb->used_integer = FFI_ALIGN(cb->used_integer, 2); + cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__); + } + + if (type->size > 0) + unmarshal_atom(cb, FFI_TYPE_POINTER, realign); + if (type->size > __SIZEOF_POINTER__) + unmarshal_atom(cb, FFI_TYPE_POINTER, realign + 1); + memcpy(data, realign, type->size); + return data; + } +} + +static int passed_by_ref(call_builder *cb, ffi_type *type, int var) { +#if ABI_FLEN + if (!var && type->type == FFI_TYPE_STRUCT) { + float_struct_info fsi = struct_passed_as_elements(cb, type); + if (fsi.as_elements) return 0; + } +#endif + + return type->size > 2 * __SIZEOF_POINTER__; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { + cif->riscv_nfixedargs = cif->nargs; + return FFI_OK; +} + +/* Perform machine dependent cif processing when we have a variadic function */ + +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs) { + cif->riscv_nfixedargs = nfixedargs; + return FFI_OK; +} + +/* Low level routine for calling functions */ +extern void ffi_call_asm (void *stack, struct call_context *regs, + void (*fn) (void), void *closure) FFI_HIDDEN; + +static void +ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, + void *closure) +{ + /* this is a conservative estimate, assuming a complex return value and + that all remaining arguments are long long / __int128 */ + size_t arg_bytes = cif->nargs <= 3 ? 0 : + FFI_ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN); + size_t rval_bytes = 0; + if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__) + rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN); + size_t alloc_size = arg_bytes + rval_bytes + sizeof(call_context); + + /* the assembly code will deallocate all stack data at lower addresses + than the argument region, so we need to allocate the frame and the + return value after the arguments in a single allocation */ + size_t alloc_base; + /* Argument region must be 16-byte aligned */ + if (_Alignof(max_align_t) >= STKALIGN) { + /* since sizeof long double is normally 16, the compiler will + guarantee alloca alignment to at least that much */ + alloc_base = (size_t)alloca(alloc_size); + } else { + alloc_base = FFI_ALIGN(alloca(alloc_size + STKALIGN - 1), STKALIGN); + } + + if (rval_bytes) + rvalue = (void*)(alloc_base + arg_bytes); + + call_builder cb; + cb.used_float = cb.used_integer = 0; + cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes); + cb.used_stack = (void*)alloc_base; + + int return_by_ref = passed_by_ref(&cb, cif->rtype, 0); + if (return_by_ref) + marshal(&cb, &ffi_type_pointer, 0, &rvalue); + + int i; + for (i = 0; i < cif->nargs; i++) + marshal(&cb, cif->arg_types[i], i >= cif->riscv_nfixedargs, avalue[i]); + + ffi_call_asm ((void *) alloc_base, cb.aregs, fn, closure); + + cb.used_float = cb.used_integer = 0; + if (!return_by_ref && rvalue) + unmarshal(&cb, cif->rtype, 0, rvalue); +} + +void +ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + ffi_call_int(cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int(cif, fn, rvalue, avalue, closure); +} + +extern void ffi_closure_asm(void) FFI_HIDDEN; + +ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data, void *codeloc) +{ + uint32_t *tramp = (uint32_t *) &closure->tramp[0]; + uint64_t fn = (uint64_t) (uintptr_t) ffi_closure_asm; + + if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + /* we will call ffi_closure_inner with codeloc, not closure, but as long + as the memory is readable it should work */ + + tramp[0] = 0x00000317; /* auipc t1, 0 (i.e. t0 <- codeloc) */ +#if __SIZEOF_POINTER__ == 8 + tramp[1] = 0x01033383; /* ld t2, 16(t1) */ +#else + tramp[1] = 0x01032383; /* lw t2, 16(t1) */ +#endif + tramp[2] = 0x00038067; /* jr t2 */ + tramp[3] = 0x00000013; /* nop */ + tramp[4] = fn; + tramp[5] = fn >> 32; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + __builtin___clear_cache(codeloc, codeloc + FFI_TRAMPOLINE_SIZE); + + return FFI_OK; +} + +extern void ffi_go_closure_asm (void) FFI_HIDDEN; + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *)) +{ + if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + closure->tramp = (void *) ffi_go_closure_asm; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +/* Called by the assembly code with aregs pointing to saved argument registers + and stack pointing to the stacked arguments. Return values passed in + registers will be reloaded from aregs. */ +void FFI_HIDDEN +ffi_closure_inner (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + size_t *stack, call_context *aregs) +{ + void **avalue = alloca(cif->nargs * sizeof(void*)); + /* storage for arguments which will be copied by unmarshal(). We could + theoretically avoid the copies in many cases and use at most 128 bytes + of memory, but allocating disjoint storage for each argument is + simpler. */ + char *astorage = alloca(cif->nargs * MAXCOPYARG); + void *rvalue; + call_builder cb; + int return_by_ref; + int i; + + cb.aregs = aregs; + cb.used_integer = cb.used_float = 0; + cb.used_stack = stack; + + return_by_ref = passed_by_ref(&cb, cif->rtype, 0); + if (return_by_ref) + unmarshal(&cb, &ffi_type_pointer, 0, &rvalue); + else + rvalue = alloca(cif->rtype->size); + + for (i = 0; i < cif->nargs; i++) + avalue[i] = unmarshal(&cb, cif->arg_types[i], + i >= cif->riscv_nfixedargs, astorage + i*MAXCOPYARG); + + fun (cif, rvalue, avalue, user_data); + + if (!return_by_ref && cif->rtype->type != FFI_TYPE_VOID) { + cb.used_integer = cb.used_float = 0; + marshal(&cb, cif->rtype, 0, rvalue); + } +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffitarget.h new file mode 100644 index 0000000..75e6462 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/ffitarget.h @@ -0,0 +1,69 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - 2014 Michael Knyszek + + Target configuration macros for RISC-V. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef __riscv +#error "libffi was configured for a RISC-V target but this does not appear to be a RISC-V compiler." +#endif + +#ifndef LIBFFI_ASM + +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +/* FFI_UNUSED_NN and riscv_unused are to maintain ABI compatibility with a + distributed Berkeley patch from 2014, and can be removed at SONAME bump */ +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_UNUSED_1, + FFI_UNUSED_2, + FFI_UNUSED_3, + FFI_LAST_ABI, + + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; + +#endif /* LIBFFI_ASM */ + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 +#define FFI_EXTRA_CIF_FIELDS unsigned riscv_nfixedargs; unsigned riscv_unused; +#define FFI_TARGET_SPECIFIC_VARIADIC + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/sysv.S new file mode 100644 index 0000000..522d0b0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/riscv/sysv.S @@ -0,0 +1,293 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2015 Michael Knyszek + 2015 Andrew Waterman + 2018 Stef O'Rear + + RISC-V Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +/* Define aliases so that we can handle all ABIs uniformly */ + +#if __SIZEOF_POINTER__ == 8 +#define PTRS 8 +#define LARG ld +#define SARG sd +#else +#define PTRS 4 +#define LARG lw +#define SARG sw +#endif + +#if __riscv_float_abi_double +#define FLTS 8 +#define FLARG fld +#define FSARG fsd +#elif __riscv_float_abi_single +#define FLTS 4 +#define FLARG flw +#define FSARG fsw +#else +#define FLTS 0 +#endif + +#define fp s0 + + .text + .globl ffi_call_asm + .type ffi_call_asm, @function + .hidden ffi_call_asm +/* + struct call_context { + floatreg fa[8]; + intreg a[8]; + intreg pad[rv32 ? 2 : 0]; + intreg save_fp, save_ra; + } + void ffi_call_asm (size_t *stackargs, struct call_context *regargs, + void (*fn) (void), void *closure); +*/ + +#define FRAME_LEN (8 * FLTS + 8 * PTRS + 16) + +ffi_call_asm: + .cfi_startproc + + /* + We are NOT going to set up an ordinary stack frame. In order to pass + the stacked args to the called function, we adjust our stack pointer to + a0, which is in the _caller's_ alloca area. We establish our own stack + frame at the end of the call_context. + + Anything below the arguments will be freed at this point, although we + preserve the call_context so that it can be read back in the caller. + */ + + .cfi_def_cfa 11, FRAME_LEN # interim CFA based on a1 + SARG fp, FRAME_LEN - 2*PTRS(a1) + .cfi_offset 8, -2*PTRS + SARG ra, FRAME_LEN - 1*PTRS(a1) + .cfi_offset 1, -1*PTRS + + addi fp, a1, FRAME_LEN + mv sp, a0 + .cfi_def_cfa 8, 0 # our frame is fully set up + + # Load arguments + mv t1, a2 + mv t2, a3 + +#if FLTS + FLARG fa0, -FRAME_LEN+0*FLTS(fp) + FLARG fa1, -FRAME_LEN+1*FLTS(fp) + FLARG fa2, -FRAME_LEN+2*FLTS(fp) + FLARG fa3, -FRAME_LEN+3*FLTS(fp) + FLARG fa4, -FRAME_LEN+4*FLTS(fp) + FLARG fa5, -FRAME_LEN+5*FLTS(fp) + FLARG fa6, -FRAME_LEN+6*FLTS(fp) + FLARG fa7, -FRAME_LEN+7*FLTS(fp) +#endif + + LARG a0, -FRAME_LEN+8*FLTS+0*PTRS(fp) + LARG a1, -FRAME_LEN+8*FLTS+1*PTRS(fp) + LARG a2, -FRAME_LEN+8*FLTS+2*PTRS(fp) + LARG a3, -FRAME_LEN+8*FLTS+3*PTRS(fp) + LARG a4, -FRAME_LEN+8*FLTS+4*PTRS(fp) + LARG a5, -FRAME_LEN+8*FLTS+5*PTRS(fp) + LARG a6, -FRAME_LEN+8*FLTS+6*PTRS(fp) + LARG a7, -FRAME_LEN+8*FLTS+7*PTRS(fp) + + /* Call */ + jalr t1 + + /* Save return values - only a0/a1 (fa0/fa1) are used */ +#if FLTS + FSARG fa0, -FRAME_LEN+0*FLTS(fp) + FSARG fa1, -FRAME_LEN+1*FLTS(fp) +#endif + + SARG a0, -FRAME_LEN+8*FLTS+0*PTRS(fp) + SARG a1, -FRAME_LEN+8*FLTS+1*PTRS(fp) + + /* Restore and return */ + addi sp, fp, -FRAME_LEN + .cfi_def_cfa 2, FRAME_LEN + LARG ra, -1*PTRS(fp) + .cfi_restore 1 + LARG fp, -2*PTRS(fp) + .cfi_restore 8 + ret + .cfi_endproc + .size ffi_call_asm, .-ffi_call_asm + + +/* + ffi_closure_asm. Expects address of the passed-in ffi_closure in t1. + void ffi_closure_inner (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + size_t *stackargs, struct call_context *regargs) +*/ + + .globl ffi_closure_asm + .hidden ffi_closure_asm + .type ffi_closure_asm, @function +ffi_closure_asm: + .cfi_startproc + + addi sp, sp, -FRAME_LEN + .cfi_def_cfa_offset FRAME_LEN + + /* make a frame */ + SARG fp, FRAME_LEN - 2*PTRS(sp) + .cfi_offset 8, -2*PTRS + SARG ra, FRAME_LEN - 1*PTRS(sp) + .cfi_offset 1, -1*PTRS + addi fp, sp, FRAME_LEN + + /* save arguments */ +#if FLTS + FSARG fa0, 0*FLTS(sp) + FSARG fa1, 1*FLTS(sp) + FSARG fa2, 2*FLTS(sp) + FSARG fa3, 3*FLTS(sp) + FSARG fa4, 4*FLTS(sp) + FSARG fa5, 5*FLTS(sp) + FSARG fa6, 6*FLTS(sp) + FSARG fa7, 7*FLTS(sp) +#endif + + SARG a0, 8*FLTS+0*PTRS(sp) + SARG a1, 8*FLTS+1*PTRS(sp) + SARG a2, 8*FLTS+2*PTRS(sp) + SARG a3, 8*FLTS+3*PTRS(sp) + SARG a4, 8*FLTS+4*PTRS(sp) + SARG a5, 8*FLTS+5*PTRS(sp) + SARG a6, 8*FLTS+6*PTRS(sp) + SARG a7, 8*FLTS+7*PTRS(sp) + + /* enter C */ + LARG a0, FFI_TRAMPOLINE_SIZE+0*PTRS(t1) + LARG a1, FFI_TRAMPOLINE_SIZE+1*PTRS(t1) + LARG a2, FFI_TRAMPOLINE_SIZE+2*PTRS(t1) + addi a3, sp, FRAME_LEN + mv a4, sp + + call ffi_closure_inner + + /* return values */ +#if FLTS + FLARG fa0, 0*FLTS(sp) + FLARG fa1, 1*FLTS(sp) +#endif + + LARG a0, 8*FLTS+0*PTRS(sp) + LARG a1, 8*FLTS+1*PTRS(sp) + + /* restore and return */ + LARG ra, FRAME_LEN-1*PTRS(sp) + .cfi_restore 1 + LARG fp, FRAME_LEN-2*PTRS(sp) + .cfi_restore 8 + addi sp, sp, FRAME_LEN + .cfi_def_cfa_offset 0 + ret + .cfi_endproc + .size ffi_closure_asm, .-ffi_closure_asm + +/* + ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in t2. + void ffi_closure_inner (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + size_t *stackargs, struct call_context *regargs) +*/ + + .globl ffi_go_closure_asm + .hidden ffi_go_closure_asm + .type ffi_go_closure_asm, @function +ffi_go_closure_asm: + .cfi_startproc + + addi sp, sp, -FRAME_LEN + .cfi_def_cfa_offset FRAME_LEN + + /* make a frame */ + SARG fp, FRAME_LEN - 2*PTRS(sp) + .cfi_offset 8, -2*PTRS + SARG ra, FRAME_LEN - 1*PTRS(sp) + .cfi_offset 1, -1*PTRS + addi fp, sp, FRAME_LEN + + /* save arguments */ +#if FLTS + FSARG fa0, 0*FLTS(sp) + FSARG fa1, 1*FLTS(sp) + FSARG fa2, 2*FLTS(sp) + FSARG fa3, 3*FLTS(sp) + FSARG fa4, 4*FLTS(sp) + FSARG fa5, 5*FLTS(sp) + FSARG fa6, 6*FLTS(sp) + FSARG fa7, 7*FLTS(sp) +#endif + + SARG a0, 8*FLTS+0*PTRS(sp) + SARG a1, 8*FLTS+1*PTRS(sp) + SARG a2, 8*FLTS+2*PTRS(sp) + SARG a3, 8*FLTS+3*PTRS(sp) + SARG a4, 8*FLTS+4*PTRS(sp) + SARG a5, 8*FLTS+5*PTRS(sp) + SARG a6, 8*FLTS+6*PTRS(sp) + SARG a7, 8*FLTS+7*PTRS(sp) + + /* enter C */ + LARG a0, 1*PTRS(t2) + LARG a1, 2*PTRS(t2) + mv a2, t2 + addi a3, sp, FRAME_LEN + mv a4, sp + + call ffi_closure_inner + + /* return values */ +#if FLTS + FLARG fa0, 0*FLTS(sp) + FLARG fa1, 1*FLTS(sp) +#endif + + LARG a0, 8*FLTS+0*PTRS(sp) + LARG a1, 8*FLTS+1*PTRS(sp) + + /* restore and return */ + LARG ra, FRAME_LEN-1*PTRS(sp) + .cfi_restore 1 + LARG fp, FRAME_LEN-2*PTRS(sp) + .cfi_restore 8 + addi sp, sp, FRAME_LEN + .cfi_def_cfa_offset 0 + ret + .cfi_endproc + .size ffi_go_closure_asm, .-ffi_go_closure_asm diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffi.c new file mode 100644 index 0000000..4035b6e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffi.c @@ -0,0 +1,756 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2000, 2007 Software AG + Copyright (c) 2008 Red Hat, Inc + + S390 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ +/*====================================================================*/ +/* Includes */ +/* -------- */ +/*====================================================================*/ + +#include +#include +#include +#include "internal.h" + +/*====================== End of Includes =============================*/ + +/*====================================================================*/ +/* Defines */ +/* ------- */ +/*====================================================================*/ + +/* Maximum number of GPRs available for argument passing. */ +#define MAX_GPRARGS 5 + +/* Maximum number of FPRs available for argument passing. */ +#ifdef __s390x__ +#define MAX_FPRARGS 4 +#else +#define MAX_FPRARGS 2 +#endif + +/* Round to multiple of 16. */ +#define ROUND_SIZE(size) (((size) + 15) & ~15) + +/*===================== End of Defines ===============================*/ + +/*====================================================================*/ +/* Externals */ +/* --------- */ +/*====================================================================*/ + +struct call_frame +{ + void *back_chain; + void *eos; + unsigned long gpr_args[5]; + unsigned long gpr_save[9]; + unsigned long long fpr_args[4]; +}; + +extern void FFI_HIDDEN ffi_call_SYSV(struct call_frame *, unsigned, void *, + void (*fn)(void), void *); + +extern void ffi_closure_SYSV(void); +extern void ffi_go_closure_SYSV(void); + +/*====================== End of Externals ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_check_struct_type. */ +/* */ +/* Function - Determine if a structure can be passed within a */ +/* general purpose or floating point register. */ +/* */ +/*====================================================================*/ + +static int +ffi_check_struct_type (ffi_type *arg) +{ + size_t size = arg->size; + + /* If the struct has just one element, look at that element + to find out whether to consider the struct as floating point. */ + while (arg->type == FFI_TYPE_STRUCT + && arg->elements[0] && !arg->elements[1]) + arg = arg->elements[0]; + + /* Structs of size 1, 2, 4, and 8 are passed in registers, + just like the corresponding int/float types. */ + switch (size) + { + case 1: + return FFI_TYPE_UINT8; + + case 2: + return FFI_TYPE_UINT16; + + case 4: + if (arg->type == FFI_TYPE_FLOAT) + return FFI_TYPE_FLOAT; + else + return FFI_TYPE_UINT32; + + case 8: + if (arg->type == FFI_TYPE_DOUBLE) + return FFI_TYPE_DOUBLE; + else + return FFI_TYPE_UINT64; + + default: + break; + } + + /* Other structs are passed via a pointer to the data. */ + return FFI_TYPE_POINTER; +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_prep_cif_machdep. */ +/* */ +/* Function - Perform machine dependent CIF processing. */ +/* */ +/*====================================================================*/ + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep(ffi_cif *cif) +{ + size_t struct_size = 0; + int n_gpr = 0; + int n_fpr = 0; + int n_ov = 0; + + ffi_type **ptr; + int i; + + /* Determine return value handling. */ + + switch (cif->rtype->type) + { + /* Void is easy. */ + case FFI_TYPE_VOID: + cif->flags = FFI390_RET_VOID; + break; + + /* Structures and complex are returned via a hidden pointer. */ + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: + cif->flags = FFI390_RET_STRUCT; + n_gpr++; /* We need one GPR to pass the pointer. */ + break; + + /* Floating point values are returned in fpr 0. */ + case FFI_TYPE_FLOAT: + cif->flags = FFI390_RET_FLOAT; + break; + + case FFI_TYPE_DOUBLE: + cif->flags = FFI390_RET_DOUBLE; + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + cif->flags = FFI390_RET_STRUCT; + n_gpr++; + break; +#endif + /* Integer values are returned in gpr 2 (and gpr 3 + for 64-bit values on 31-bit machines). */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + cif->flags = FFI390_RET_INT64; + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + /* These are to be extended to word size. */ +#ifdef __s390x__ + cif->flags = FFI390_RET_INT64; +#else + cif->flags = FFI390_RET_INT32; +#endif + break; + + default: + FFI_ASSERT (0); + break; + } + + /* Now for the arguments. */ + + for (ptr = cif->arg_types, i = cif->nargs; + i > 0; + i--, ptr++) + { + int type = (*ptr)->type; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + /* 16-byte long double is passed like a struct. */ + if (type == FFI_TYPE_LONGDOUBLE) + type = FFI_TYPE_STRUCT; +#endif + + /* Check how a structure type is passed. */ + if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) + { + if (type == FFI_TYPE_COMPLEX) + type = FFI_TYPE_POINTER; + else + type = ffi_check_struct_type (*ptr); + + /* If we pass the struct via pointer, we must reserve space + to copy its data for proper call-by-value semantics. */ + if (type == FFI_TYPE_POINTER) + struct_size += ROUND_SIZE ((*ptr)->size); + } + + /* Now handle all primitive int/float data types. */ + switch (type) + { + /* The first MAX_FPRARGS floating point arguments + go in FPRs, the rest overflow to the stack. */ + + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + n_fpr++; + else + n_ov += sizeof (double) / sizeof (long); + break; + + case FFI_TYPE_FLOAT: + if (n_fpr < MAX_FPRARGS) + n_fpr++; + else + n_ov++; + break; + + /* On 31-bit machines, 64-bit integers are passed in GPR pairs, + if one is still available, or else on the stack. If only one + register is free, skip the register (it won't be used for any + subsequent argument either). */ + +#ifndef __s390x__ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + n_gpr += 2; + else + n_ov += 2; + break; +#endif + + /* Everything else is passed in GPRs (until MAX_GPRARGS + have been used) or overflows to the stack. */ + + default: + if (n_gpr < MAX_GPRARGS) + n_gpr++; + else + n_ov++; + break; + } + } + + /* Total stack space as required for overflow arguments + and temporary structure copies. */ + + cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; + + return FFI_OK; +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_call. */ +/* */ +/* Function - Call the FFI routine. */ +/* */ +/*====================================================================*/ + +static void +ffi_call_int(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue, + void *closure) +{ + int ret_type = cif->flags; + size_t rsize = 0, bytes = cif->bytes; + unsigned char *stack, *p_struct; + struct call_frame *frame; + unsigned long *p_ov, *p_gpr; + unsigned long long *p_fpr; + int n_fpr, n_gpr, n_ov, i, n; + ffi_type **arg_types; + + FFI_ASSERT (cif->abi == FFI_SYSV); + + /* If we don't have a return value, we need to fake one. */ + if (rvalue == NULL) + { + if (ret_type & FFI390_RET_IN_MEM) + rsize = cif->rtype->size; + else + ret_type = FFI390_RET_VOID; + } + + /* The stack space will be filled with those areas: + + dummy structure return (highest addresses) + FPR argument register save area + GPR argument register save area + stack frame for ffi_call_SYSV + temporary struct copies + overflow argument area (lowest addresses) + + We set up the following pointers: + + p_fpr: bottom of the FPR area (growing upwards) + p_gpr: bottom of the GPR area (growing upwards) + p_ov: bottom of the overflow area (growing upwards) + p_struct: top of the struct copy area (growing downwards) + + All areas are kept aligned to twice the word size. + + Note that we're going to create the stack frame for both + ffi_call_SYSV _and_ the target function right here. This + works because we don't make any function calls with more + than 5 arguments (indeed only memcpy and ffi_call_SYSV), + and thus we don't have any stacked outgoing parameters. */ + + stack = alloca (bytes + sizeof(struct call_frame) + rsize); + frame = (struct call_frame *)(stack + bytes); + if (rsize) + rvalue = frame + 1; + + /* Link the new frame back to the one from this function. */ + frame->back_chain = __builtin_frame_address (0); + + /* Fill in all of the argument stuff. */ + p_ov = (unsigned long *)stack; + p_struct = (unsigned char *)frame; + p_gpr = frame->gpr_args; + p_fpr = frame->fpr_args; + n_fpr = n_gpr = n_ov = 0; + + /* If we returning a structure then we set the first parameter register + to the address of where we are returning this structure. */ + if (cif->flags & FFI390_RET_IN_MEM) + p_gpr[n_gpr++] = (uintptr_t) rvalue; + + /* Now for the arguments. */ + arg_types = cif->arg_types; + for (i = 0, n = cif->nargs; i < n; ++i) + { + ffi_type *ty = arg_types[i]; + void *arg = avalue[i]; + int type = ty->type; + ffi_arg val; + + restart: + switch (type) + { + case FFI_TYPE_SINT8: + val = *(SINT8 *)arg; + goto do_int; + case FFI_TYPE_UINT8: + val = *(UINT8 *)arg; + goto do_int; + case FFI_TYPE_SINT16: + val = *(SINT16 *)arg; + goto do_int; + case FFI_TYPE_UINT16: + val = *(UINT16 *)arg; + goto do_int; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + val = *(SINT32 *)arg; + goto do_int; + case FFI_TYPE_UINT32: + val = *(UINT32 *)arg; + goto do_int; + case FFI_TYPE_POINTER: + val = *(uintptr_t *)arg; + do_int: + *(n_gpr < MAX_GPRARGS ? p_gpr + n_gpr++ : p_ov + n_ov++) = val; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#ifdef __s390x__ + val = *(UINT64 *)arg; + goto do_int; +#else + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = ((UINT32 *) arg)[0], + p_gpr[n_gpr++] = ((UINT32 *) arg)[1]; + else + p_ov[n_ov++] = ((UINT32 *) arg)[0], + p_ov[n_ov++] = ((UINT32 *) arg)[1]; +#endif + break; + + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + p_fpr[n_fpr++] = *(UINT64 *) arg; + else + { +#ifdef __s390x__ + p_ov[n_ov++] = *(UINT64 *) arg; +#else + p_ov[n_ov++] = ((UINT32 *) arg)[0], + p_ov[n_ov++] = ((UINT32 *) arg)[1]; +#endif + } + break; + + case FFI_TYPE_FLOAT: + val = *(UINT32 *)arg; + if (n_fpr < MAX_FPRARGS) + p_fpr[n_fpr++] = (UINT64)val << 32; + else + p_ov[n_ov++] = val; + break; + + case FFI_TYPE_STRUCT: + /* Check how a structure type is passed. */ + type = ffi_check_struct_type (ty); + /* Some structures are passed via a type they contain. */ + if (type != FFI_TYPE_POINTER) + goto restart; + /* ... otherwise, passed by reference. fallthru. */ + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + /* 16-byte long double is passed via reference. */ +#endif + case FFI_TYPE_COMPLEX: + /* Complex types are passed via reference. */ + p_struct -= ROUND_SIZE (ty->size); + memcpy (p_struct, arg, ty->size); + val = (uintptr_t)p_struct; + goto do_int; + + default: + FFI_ASSERT (0); + break; + } + } + + ffi_call_SYSV (frame, ret_type & FFI360_RET_MASK, rvalue, fn, closure); +} + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int(cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int(cif, fn, rvalue, avalue, closure); +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_closure_helper_SYSV. */ +/* */ +/* Function - Call a FFI closure target function. */ +/* */ +/*====================================================================*/ + +void FFI_HIDDEN +ffi_closure_helper_SYSV (ffi_cif *cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + unsigned long *p_gpr, + unsigned long long *p_fpr, + unsigned long *p_ov) +{ + unsigned long long ret_buffer; + + void *rvalue = &ret_buffer; + void **avalue; + void **p_arg; + + int n_gpr = 0; + int n_fpr = 0; + int n_ov = 0; + + ffi_type **ptr; + int i; + + /* Allocate buffer for argument list pointers. */ + p_arg = avalue = alloca (cif->nargs * sizeof (void *)); + + /* If we returning a structure, pass the structure address + directly to the target function. Otherwise, have the target + function store the return value to the GPR save area. */ + if (cif->flags & FFI390_RET_IN_MEM) + rvalue = (void *) p_gpr[n_gpr++]; + + /* Now for the arguments. */ + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, p_arg++, ptr++) + { + int deref_struct_pointer = 0; + int type = (*ptr)->type; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + /* 16-byte long double is passed like a struct. */ + if (type == FFI_TYPE_LONGDOUBLE) + type = FFI_TYPE_STRUCT; +#endif + + /* Check how a structure type is passed. */ + if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) + { + if (type == FFI_TYPE_COMPLEX) + type = FFI_TYPE_POINTER; + else + type = ffi_check_struct_type (*ptr); + + /* If we pass the struct via pointer, remember to + retrieve the pointer later. */ + if (type == FFI_TYPE_POINTER) + deref_struct_pointer = 1; + } + + /* Pointers are passed like UINTs of the same size. */ + if (type == FFI_TYPE_POINTER) + { +#ifdef __s390x__ + type = FFI_TYPE_UINT64; +#else + type = FFI_TYPE_UINT32; +#endif + } + + /* Now handle all primitive int/float data types. */ + switch (type) + { + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + *p_arg = &p_fpr[n_fpr++]; + else + *p_arg = &p_ov[n_ov], + n_ov += sizeof (double) / sizeof (long); + break; + + case FFI_TYPE_FLOAT: + if (n_fpr < MAX_FPRARGS) + *p_arg = &p_fpr[n_fpr++]; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#ifdef __s390x__ + if (n_gpr < MAX_GPRARGS) + *p_arg = &p_gpr[n_gpr++]; + else + *p_arg = &p_ov[n_ov++]; +#else + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + *p_arg = &p_gpr[n_gpr], n_gpr += 2; + else + *p_arg = &p_ov[n_ov], n_ov += 2; +#endif + break; + + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; + break; + + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; + break; + + default: + FFI_ASSERT (0); + break; + } + + /* If this is a struct passed via pointer, we need to + actually retrieve that pointer. */ + if (deref_struct_pointer) + *p_arg = *(void **)*p_arg; + } + + + /* Call the target function. */ + (fun) (cif, rvalue, avalue, user_data); + + /* Convert the return value. */ + switch (cif->rtype->type) + { + /* Void is easy, and so is struct. */ + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: +#endif + break; + + /* Floating point values are returned in fpr 0. */ + case FFI_TYPE_FLOAT: + p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; + break; + + case FFI_TYPE_DOUBLE: + p_fpr[0] = *(unsigned long long *) rvalue; + break; + + /* Integer values are returned in gpr 2 (and gpr 3 + for 64-bit values on 31-bit machines). */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#ifdef __s390x__ + p_gpr[0] = *(unsigned long *) rvalue; +#else + p_gpr[0] = ((unsigned long *) rvalue)[0], + p_gpr[1] = ((unsigned long *) rvalue)[1]; +#endif + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_UINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT8: + p_gpr[0] = *(unsigned long *) rvalue; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT8: + p_gpr[0] = *(signed long *) rvalue; + break; + + default: + FFI_ASSERT (0); + break; + } +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_prep_closure_loc. */ +/* */ +/* Function - Prepare a FFI closure. */ +/* */ +/*====================================================================*/ + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, + void *codeloc) +{ + static unsigned short const template[] = { + 0x0d10, /* basr %r1,0 */ +#ifndef __s390x__ + 0x9801, 0x1006, /* lm %r0,%r1,6(%r1) */ +#else + 0xeb01, 0x100e, 0x0004, /* lmg %r0,%r1,14(%r1) */ +#endif + 0x07f1 /* br %r1 */ + }; + + unsigned long *tramp = (unsigned long *)&closure->tramp; + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + memcpy (tramp, template, sizeof(template)); + tramp[2] = (unsigned long)codeloc; + tramp[3] = (unsigned long)&ffi_closure_SYSV; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +/*======================== End of Routine ============================*/ + +/* Build a Go language closure. */ + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun)(ffi_cif*,void*,void**,void*)) +{ + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + closure->tramp = ffi_go_closure_SYSV; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffitarget.h new file mode 100644 index 0000000..d8a4ee4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/ffitarget.h @@ -0,0 +1,70 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for S390. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#if defined (__s390x__) +#ifndef S390X +#define S390X +#endif +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +#define FFI_TARGET_HAS_COMPLEX_TYPE + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#ifdef S390X +#define FFI_TRAMPOLINE_SIZE 32 +#else +#define FFI_TRAMPOLINE_SIZE 16 +#endif +#define FFI_NATIVE_RAW_API 0 + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/internal.h new file mode 100644 index 0000000..b875578 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/internal.h @@ -0,0 +1,11 @@ +/* If these values change, sysv.S must be adapted! */ +#define FFI390_RET_DOUBLE 0 +#define FFI390_RET_FLOAT 1 +#define FFI390_RET_INT64 2 +#define FFI390_RET_INT32 3 +#define FFI390_RET_VOID 4 + +#define FFI360_RET_MASK 7 +#define FFI390_RET_IN_MEM 8 + +#define FFI390_RET_STRUCT (FFI390_RET_VOID | FFI390_RET_IN_MEM) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/sysv.S new file mode 100644 index 0000000..c4b5006 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/s390/sysv.S @@ -0,0 +1,325 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2000 Software AG + Copyright (c) 2008 Red Hat, Inc. + + S390 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + + .text + +#ifndef __s390x__ + + # r2: frame + # r3: ret_type + # r4: ret_addr + # r5: fun + # r6: closure + + # This assumes we are using gas. + .balign 8 + .globl ffi_call_SYSV + FFI_HIDDEN(ffi_call_SYSV) + .type ffi_call_SYSV,%function +ffi_call_SYSV: + .cfi_startproc + st %r6,44(%r2) # Save registers + stm %r12,%r14,48(%r2) + lr %r13,%r2 # Install frame pointer + .cfi_rel_offset r6, 44 + .cfi_rel_offset r12, 48 + .cfi_rel_offset r13, 52 + .cfi_rel_offset r14, 56 + .cfi_def_cfa_register r13 + st %r2,0(%r15) # Set up back chain + sla %r3,3 # ret_type *= 8 + lr %r12,%r4 # Save ret_addr + lr %r1,%r5 # Save fun + lr %r0,%r6 # Install static chain + + # Set return address, so that there is only one indirect jump. +#ifdef HAVE_AS_S390_ZARCH + larl %r14,.Ltable + ar %r14,%r3 +#else + basr %r14,0 +0: la %r14,.Ltable-0b(%r14,%r3) +#endif + + lm %r2,%r6,8(%r13) # Load arguments + ld %f0,64(%r13) + ld %f2,72(%r13) + br %r1 # ... and call function + + .balign 8 +.Ltable: +# FFI390_RET_DOUBLE + std %f0,0(%r12) + j .Ldone + + .balign 8 +# FFI390_RET_FLOAT + ste %f0,0(%r12) + j .Ldone + + .balign 8 +# FFI390_RET_INT64 + st %r3,4(%r12) + nop + # fallthru + + .balign 8 +# FFI390_RET_INT32 + st %r2,0(%r12) + nop + # fallthru + + .balign 8 +# FFI390_RET_VOID +.Ldone: + l %r14,56(%r13) + l %r12,48(%r13) + l %r6,44(%r13) + l %r13,52(%r13) + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_restore 6 + .cfi_def_cfa r15, 96 + br %r14 + .cfi_endproc + .size ffi_call_SYSV,.-ffi_call_SYSV + + + .balign 8 + .globl ffi_go_closure_SYSV + FFI_HIDDEN(ffi_go_closure_SYSV) + .type ffi_go_closure_SYSV,%function +ffi_go_closure_SYSV: + .cfi_startproc + stm %r2,%r6,8(%r15) # Save arguments + lr %r4,%r0 # Load closure -> user_data + l %r2,4(%r4) # ->cif + l %r3,8(%r4) # ->fun + j .Ldoclosure + .cfi_endproc + + .balign 8 + .globl ffi_closure_SYSV + FFI_HIDDEN(ffi_closure_SYSV) + .type ffi_closure_SYSV,%function +ffi_closure_SYSV: + .cfi_startproc + stm %r2,%r6,8(%r15) # Save arguments + lr %r4,%r0 # Closure + l %r2,16(%r4) # ->cif + l %r3,20(%r4) # ->fun + l %r4,24(%r4) # ->user_data +.Ldoclosure: + stm %r12,%r15,48(%r15) # Save registers + lr %r12,%r15 + .cfi_def_cfa_register r12 + .cfi_rel_offset r6, 24 + .cfi_rel_offset r12, 48 + .cfi_rel_offset r13, 52 + .cfi_rel_offset r14, 56 + .cfi_rel_offset r15, 60 +#ifndef HAVE_AS_S390_ZARCH + basr %r13,0 # Set up base register +.Lcbase: + l %r1,.Lchelper-.Lcbase(%r13) # Get helper function +#endif + ahi %r15,-96-8 # Set up stack frame + st %r12,0(%r15) # Set up back chain + + std %f0,64(%r12) # Save fp arguments + std %f2,72(%r12) + + la %r5,96(%r12) # Overflow + st %r5,96(%r15) + la %r6,64(%r12) # FPRs + la %r5,8(%r12) # GPRs +#ifdef HAVE_AS_S390_ZARCH + brasl %r14,ffi_closure_helper_SYSV +#else + bas %r14,0(%r1,%r13) # Call helper +#endif + + lr %r15,%r12 + .cfi_def_cfa_register r15 + lm %r12,%r14,48(%r12) # Restore saved registers + l %r6,24(%r15) + ld %f0,64(%r15) # Load return registers + lm %r2,%r3,8(%r15) + br %r14 + .cfi_endproc + +#ifndef HAVE_AS_S390_ZARCH + .align 4 +.Lchelper: + .long ffi_closure_helper_SYSV-.Lcbase +#endif + + .size ffi_closure_SYSV,.-ffi_closure_SYSV + +#else + + # r2: frame + # r3: ret_type + # r4: ret_addr + # r5: fun + # r6: closure + + # This assumes we are using gas. + .balign 8 + .globl ffi_call_SYSV + FFI_HIDDEN(ffi_call_SYSV) + .type ffi_call_SYSV,%function +ffi_call_SYSV: + .cfi_startproc + stg %r6,88(%r2) # Save registers + stmg %r12,%r14,96(%r2) + lgr %r13,%r2 # Install frame pointer + .cfi_rel_offset r6, 88 + .cfi_rel_offset r12, 96 + .cfi_rel_offset r13, 104 + .cfi_rel_offset r14, 112 + .cfi_def_cfa_register r13 + stg %r2,0(%r15) # Set up back chain + larl %r14,.Ltable # Set up return address + slag %r3,%r3,3 # ret_type *= 8 + lgr %r12,%r4 # Save ret_addr + lgr %r1,%r5 # Save fun + lgr %r0,%r6 # Install static chain + agr %r14,%r3 + lmg %r2,%r6,16(%r13) # Load arguments + ld %f0,128(%r13) + ld %f2,136(%r13) + ld %f4,144(%r13) + ld %f6,152(%r13) + br %r1 # ... and call function + + .balign 8 +.Ltable: +# FFI390_RET_DOUBLE + std %f0,0(%r12) + j .Ldone + + .balign 8 +# FFI390_RET_DOUBLE + ste %f0,0(%r12) + j .Ldone + + .balign 8 +# FFI390_RET_INT64 + stg %r2,0(%r12) + + .balign 8 +# FFI390_RET_INT32 + # Never used, as we always store type ffi_arg. + # But the stg above is 6 bytes and we cannot + # jump around this case, so fall through. + nop + nop + + .balign 8 +# FFI390_RET_VOID +.Ldone: + lg %r14,112(%r13) + lg %r12,96(%r13) + lg %r6,88(%r13) + lg %r13,104(%r13) + .cfi_restore r14 + .cfi_restore r13 + .cfi_restore r12 + .cfi_restore r6 + .cfi_def_cfa r15, 160 + br %r14 + .cfi_endproc + .size ffi_call_SYSV,.-ffi_call_SYSV + + + .balign 8 + .globl ffi_go_closure_SYSV + FFI_HIDDEN(ffi_go_closure_SYSV) + .type ffi_go_closure_SYSV,%function +ffi_go_closure_SYSV: + .cfi_startproc + stmg %r2,%r6,16(%r15) # Save arguments + lgr %r4,%r0 # Load closure -> user_data + lg %r2,8(%r4) # ->cif + lg %r3,16(%r4) # ->fun + j .Ldoclosure + .cfi_endproc + .size ffi_go_closure_SYSV,.-ffi_go_closure_SYSV + + + .balign 8 + .globl ffi_closure_SYSV + FFI_HIDDEN(ffi_closure_SYSV) + .type ffi_closure_SYSV,%function +ffi_closure_SYSV: + .cfi_startproc + stmg %r2,%r6,16(%r15) # Save arguments + lgr %r4,%r0 # Load closure + lg %r2,32(%r4) # ->cif + lg %r3,40(%r4) # ->fun + lg %r4,48(%r4) # ->user_data +.Ldoclosure: + stmg %r13,%r15,104(%r15) # Save registers + lgr %r13,%r15 + .cfi_def_cfa_register r13 + .cfi_rel_offset r6, 48 + .cfi_rel_offset r13, 104 + .cfi_rel_offset r14, 112 + .cfi_rel_offset r15, 120 + aghi %r15,-160-16 # Set up stack frame + stg %r13,0(%r15) # Set up back chain + + std %f0,128(%r13) # Save fp arguments + std %f2,136(%r13) + std %f4,144(%r13) + std %f6,152(%r13) + la %r5,160(%r13) # Overflow + stg %r5,160(%r15) + la %r6,128(%r13) # FPRs + la %r5,16(%r13) # GPRs + brasl %r14,ffi_closure_helper_SYSV # Call helper + + lgr %r15,%r13 + .cfi_def_cfa_register r15 + lmg %r13,%r14,104(%r13) # Restore saved registers + lg %r6,48(%r15) + ld %f0,128(%r15) # Load return registers + lg %r2,16(%r15) + br %r14 + .cfi_endproc + .size ffi_closure_SYSV,.-ffi_closure_SYSV +#endif /* !s390x */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffi.c new file mode 100644 index 0000000..9ec86bf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffi.c @@ -0,0 +1,717 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2002-2008, 2012 Kaz Kojima + Copyright (c) 2008 Red Hat, Inc. + + SuperH Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +#define NGREGARG 4 +#if defined(__SH4__) +#define NFREGARG 8 +#endif + +#if defined(__HITACHI__) +#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 +#else +#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 +#endif + +/* If the structure has essentially an unique element, return its type. */ +static int +simple_type (ffi_type *arg) +{ + if (arg->type != FFI_TYPE_STRUCT) + return arg->type; + else if (arg->elements[1]) + return FFI_TYPE_STRUCT; + + return simple_type (arg->elements[0]); +} + +static int +return_type (ffi_type *arg) +{ + unsigned short type; + + if (arg->type != FFI_TYPE_STRUCT) + return arg->type; + + type = simple_type (arg->elements[0]); + if (! arg->elements[1]) + { + switch (type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + return FFI_TYPE_INT; + + default: + return type; + } + } + + /* gcc uses r0/r1 pair for some kind of structures. */ + if (arg->size <= 2 * sizeof (int)) + { + int i = 0; + ffi_type *e; + + while ((e = arg->elements[i++])) + { + type = simple_type (e); + switch (type) + { + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_INT: + case FFI_TYPE_FLOAT: + return FFI_TYPE_UINT64; + + default: + break; + } + } + } + + return FFI_TYPE_STRUCT; +} + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register int tmp; + register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + int greg, ireg; +#if defined(__SH4__) + int freg = 0; +#endif + + tmp = 0; + argp = stack; + + if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += 4; + ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; + } + else + ireg = 0; + + /* Set arguments for registers. */ + greg = ireg; + avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ >= NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + argp += z; + } + else if (z == sizeof(int)) + { +#if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ >= NFREGARG) + continue; + } + else +#endif + { + if (greg++ >= NGREGARG) + continue; + } + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + argp += z; + } +#if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 >= NFREGARG) + continue; + freg = (freg + 1) & ~1; + freg += 2; + memcpy (argp, *p_argv, z); + argp += z; + } +#endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); +#if defined(__SH4__) + if (greg + n - 1 >= NGREGARG) + continue; +#else + if (greg >= NGREGARG) + continue; +#endif + greg += n; + memcpy (argp, *p_argv, z); + argp += n * sizeof (int); + } + } + + /* Set arguments on stack. */ + greg = ireg; +#if defined(__SH4__) + freg = 0; +#endif + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ < NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + argp += z; + } + else if (z == sizeof(int)) + { +#if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ < NFREGARG) + continue; + } + else +#endif + { + if (greg++ < NGREGARG) + continue; + } + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + argp += z; + } +#if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 < NFREGARG) + { + freg = (freg + 1) & ~1; + freg += 2; + continue; + } + memcpy (argp, *p_argv, z); + argp += z; + } +#endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 < NGREGARG) + { + greg += n; + continue; + } +#if (! defined(__SH4__)) + else if (greg < NGREGARG) + { + greg = NGREGARG; + continue; + } +#endif + memcpy (argp, *p_argv, z); + argp += n * sizeof (int); + } + } + + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + int i, j; + int size, type; + int n, m; + int greg; +#if defined(__SH4__) + int freg = 0; +#endif + + cif->flags = 0; + + greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && + STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; + +#if defined(__SH4__) + for (i = j = 0; i < cif->nargs && j < 12; i++) + { + type = (cif->arg_types)[i]->type; + switch (type) + { + case FFI_TYPE_FLOAT: + if (freg >= NFREGARG) + continue; + freg++; + cif->flags += ((cif->arg_types)[i]->type) << (2 * j); + j++; + break; + + case FFI_TYPE_DOUBLE: + if ((freg + 1) >= NFREGARG) + continue; + freg = (freg + 1) & ~1; + freg += 2; + cif->flags += ((cif->arg_types)[i]->type) << (2 * j); + j++; + break; + + default: + size = (cif->arg_types)[i]->size; + n = (size + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 >= NGREGARG) + continue; + greg += n; + for (m = 0; m < n; m++) + cif->flags += FFI_TYPE_INT << (2 * j++); + break; + } + } +#else + for (i = j = 0; i < cif->nargs && j < 4; i++) + { + size = (cif->arg_types)[i]->size; + n = (size + sizeof (int) - 1) / sizeof (int); + if (greg >= NGREGARG) + continue; + else if (greg + n - 1 >= NGREGARG) + n = NGREGARG - greg; + greg += n; + for (m = 0; m < n; m++) + cif->flags += FFI_TYPE_INT << (2 * j++); + } +#endif + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_STRUCT: + cif->flags += (unsigned) (return_type (cif->rtype)) << 24; + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags += (unsigned) cif->rtype->type << 24; + break; + + default: + cif->flags += FFI_TYPE_INT << 24; + break; + } + + return FFI_OK; +} + +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + UINT64 trvalue; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if (cif->rtype->type == FFI_TYPE_STRUCT + && return_type (cif->rtype) != FFI_TYPE_STRUCT) + ecif.rvalue = &trvalue; + else if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, + fn); + break; + default: + FFI_ASSERT(0); + break; + } + + if (rvalue + && cif->rtype->type == FFI_TYPE_STRUCT + && return_type (cif->rtype) != FFI_TYPE_STRUCT) + memcpy (rvalue, &trvalue, cif->rtype->size); +} + +extern void ffi_closure_SYSV (void); +#if defined(__SH4__) +extern void __ic_invalidate (void *line); +#endif + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp; + unsigned int insn; + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + tramp = (unsigned int *) &closure->tramp[0]; + /* Set T bit if the function returns a struct pointed with R2. */ + insn = (return_type (cif->rtype) == FFI_TYPE_STRUCT + ? 0x0018 /* sett */ + : 0x0008 /* clrt */); + +#ifdef __LITTLE_ENDIAN__ + tramp[0] = 0xd301d102; + tramp[1] = 0x0000412b | (insn << 16); +#else + tramp[0] = 0xd102d301; + tramp[1] = 0x412b0000 | insn; +#endif + *(void **) &tramp[2] = (void *)codeloc; /* ctx */ + *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + +#if defined(__SH4__) + /* Flush the icache. */ + __ic_invalidate(codeloc); +#endif + + return FFI_OK; +} + +/* Basically the trampoline invokes ffi_closure_SYSV, and on + * entry, r3 holds the address of the closure. + * After storing the registers that could possibly contain + * parameters to be passed into the stack frame and setting + * up space for a return value, ffi_closure_SYSV invokes the + * following helper function to do most of the work. + */ + +#ifdef __LITTLE_ENDIAN__ +#define OFS_INT8 0 +#define OFS_INT16 0 +#else +#define OFS_INT8 3 +#define OFS_INT16 2 +#endif + +int +ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, + unsigned long *pgr, unsigned long *pfr, + unsigned long *pst) +{ + void **avalue; + ffi_type **p_arg; + int i, avn; + int ireg, greg = 0; +#if defined(__SH4__) + int freg = 0; +#endif + ffi_cif *cif; + + cif = closure->cif; + avalue = alloca(cif->nargs * sizeof(void *)); + + /* Copy the caller's structure return value address so that the closure + returns the data directly to the caller. */ + if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG) + { + rvalue = (void *) *pgr++; + ireg = 1; + } + else + ireg = 0; + + cif = closure->cif; + greg = ireg; + avn = cif->nargs; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ >= NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = (((char *)pgr) + OFS_INT8); + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = (((char *)pgr) + OFS_INT16); + break; + + case FFI_TYPE_STRUCT: + avalue[i] = pgr; + break; + + default: + FFI_ASSERT(0); + } + pgr++; + } + else if (z == sizeof(int)) + { +#if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ >= NFREGARG) + continue; + avalue[i] = pfr; + pfr++; + } + else +#endif + { + if (greg++ >= NGREGARG) + continue; + avalue[i] = pgr; + pgr++; + } + } +#if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 >= NFREGARG) + continue; + if (freg & 1) + pfr++; + freg = (freg + 1) & ~1; + freg += 2; + avalue[i] = pfr; + pfr += 2; + } +#endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); +#if defined(__SH4__) + if (greg + n - 1 >= NGREGARG) + continue; +#else + if (greg >= NGREGARG) + continue; +#endif + greg += n; + avalue[i] = pgr; + pgr += n; + } + } + + greg = ireg; +#if defined(__SH4__) + freg = 0; +#endif + + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ < NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = (((char *)pst) + OFS_INT8); + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = (((char *)pst) + OFS_INT16); + break; + + case FFI_TYPE_STRUCT: + avalue[i] = pst; + break; + + default: + FFI_ASSERT(0); + } + pst++; + } + else if (z == sizeof(int)) + { +#if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ < NFREGARG) + continue; + } + else +#endif + { + if (greg++ < NGREGARG) + continue; + } + avalue[i] = pst; + pst++; + } +#if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 < NFREGARG) + { + freg = (freg + 1) & ~1; + freg += 2; + continue; + } + avalue[i] = pst; + pst += 2; + } +#endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 < NGREGARG) + { + greg += n; + continue; + } +#if (! defined(__SH4__)) + else if (greg < NGREGARG) + { + greg += n; + pst += greg - NGREGARG; + continue; + } +#endif + avalue[i] = pst; + pst += n; + } + } + + (closure->fun) (cif, rvalue, avalue, closure->user_data); + + /* Tell ffi_closure_SYSV how to perform return type promotions. */ + return return_type (cif->rtype); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffitarget.h new file mode 100644 index 0000000..a36bf42 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/ffitarget.h @@ -0,0 +1,54 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for SuperH. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 16 +#define FFI_NATIVE_RAW_API 0 + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/sysv.S new file mode 100644 index 0000000..5be7516 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh/sysv.S @@ -0,0 +1,850 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima + + SuperH Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#ifdef HAVE_MACHINE_ASM_H +#include +#else +/* XXX these lose for some platforms, I'm sure. */ +#define CNAME(x) x +#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): +#endif + +#if defined(__HITACHI__) +#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 +#else +#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 +#endif + +.text + + # r4: ffi_prep_args + # r5: &ecif + # r6: bytes + # r7: flags + # sp+0: rvalue + # sp+4: fn + + # This assumes we are using gas. +ENTRY(ffi_call_SYSV) + # Save registers +.LFB1: + mov.l r8,@-r15 +.LCFI0: + mov.l r9,@-r15 +.LCFI1: + mov.l r10,@-r15 +.LCFI2: + mov.l r12,@-r15 +.LCFI3: + mov.l r14,@-r15 +.LCFI4: + sts.l pr,@-r15 +.LCFI5: + mov r15,r14 +.LCFI6: +#if defined(__SH4__) + mov r6,r8 + mov r7,r9 + + sub r6,r15 + add #-16,r15 + mov #~7,r0 + and r0,r15 + + mov r4,r0 + jsr @r0 + mov r15,r4 + + mov r9,r1 + shlr8 r9 + shlr8 r9 + shlr8 r9 + + mov #FFI_TYPE_STRUCT,r2 + cmp/eq r2,r9 + bf 1f +#if STRUCT_VALUE_ADDRESS_WITH_ARG + mov.l @r15+,r4 + bra 2f + mov #5,r2 +#else + mov.l @r15+,r10 +#endif +1: + mov #4,r2 +2: + mov #4,r3 + +L_pass: + cmp/pl r8 + bf L_call_it + + mov r1,r0 + and #3,r0 + +L_pass_d: + cmp/eq #FFI_TYPE_DOUBLE,r0 + bf L_pass_f + + mov r3,r0 + and #1,r0 + tst r0,r0 + bt 1f + add #1,r3 +1: + mov #12,r0 + cmp/hs r0,r3 + bt/s 3f + shlr2 r1 + bsr L_pop_d + nop +3: + add #2,r3 + bra L_pass + add #-8,r8 + +L_pop_d: + mov r3,r0 + add r0,r0 + add r3,r0 + add #-12,r0 + braf r0 + nop +#ifdef __LITTLE_ENDIAN__ + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr4 + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr6 + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr8 + fmov.s @r15+,fr11 + rts + fmov.s @r15+,fr10 +#else + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr5 + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr7 + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr9 + fmov.s @r15+,fr10 + rts + fmov.s @r15+,fr11 +#endif + +L_pass_f: + cmp/eq #FFI_TYPE_FLOAT,r0 + bf L_pass_i + + mov #12,r0 + cmp/hs r0,r3 + bt/s 2f + shlr2 r1 + bsr L_pop_f + nop +2: + add #1,r3 + bra L_pass + add #-4,r8 + +L_pop_f: + mov r3,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop +#ifdef __LITTLE_ENDIAN__ + rts + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr11 + rts + fmov.s @r15+,fr10 +#else + rts + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr10 + rts + fmov.s @r15+,fr11 +#endif + +L_pass_i: + cmp/eq #FFI_TYPE_INT,r0 + bf L_call_it + + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r1 + bsr L_pop_i + nop +2: + add #1,r2 + bra L_pass + add #-4,r8 + +L_pop_i: + mov r2,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop + rts + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + +L_call_it: + # call function +#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) + mov r10, r2 +#endif + mov.l @(28,r14),r1 + jsr @r1 + nop + +L_ret_d: + mov #FFI_TYPE_DOUBLE,r2 + cmp/eq r2,r9 + bf L_ret_ll + + mov.l @(24,r14),r1 +#ifdef __LITTLE_ENDIAN__ + fmov.s fr1,@r1 + add #4,r1 + bra L_epilogue + fmov.s fr0,@r1 +#else + fmov.s fr0,@r1 + add #4,r1 + bra L_epilogue + fmov.s fr1,@r1 +#endif + +L_ret_ll: + mov #FFI_TYPE_SINT64,r2 + cmp/eq r2,r9 + bt/s 1f + mov #FFI_TYPE_UINT64,r2 + cmp/eq r2,r9 + bf L_ret_f + +1: + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + +L_ret_f: + mov #FFI_TYPE_FLOAT,r2 + cmp/eq r2,r9 + bf L_ret_i + + mov.l @(24,r14),r1 + bra L_epilogue + fmov.s fr0,@r1 + +L_ret_i: + mov #FFI_TYPE_INT,r2 + cmp/eq r2,r9 + bf L_epilogue + + mov.l @(24,r14),r1 + bra L_epilogue + mov.l r0,@r1 + +L_epilogue: + # Remove the space we pushed for the args + mov r14,r15 + + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r12 + mov.l @r15+,r10 + mov.l @r15+,r9 + rts + mov.l @r15+,r8 +#else + mov r6,r8 + mov r7,r9 + + sub r6,r15 + add #-16,r15 + mov #~7,r0 + and r0,r15 + + mov r4,r0 + jsr @r0 + mov r15,r4 + + mov r9,r3 + shlr8 r9 + shlr8 r9 + shlr8 r9 + + mov #FFI_TYPE_STRUCT,r2 + cmp/eq r2,r9 + bf 1f +#if STRUCT_VALUE_ADDRESS_WITH_ARG + mov.l @r15+,r4 + bra 2f + mov #5,r2 +#else + mov.l @r15+,r10 +#endif +1: + mov #4,r2 +2: + +L_pass: + cmp/pl r8 + bf L_call_it + + mov r3,r0 + and #3,r0 + +L_pass_d: + cmp/eq #FFI_TYPE_DOUBLE,r0 + bf L_pass_i + + mov r15,r0 + and #7,r0 + tst r0,r0 + bt 1f + add #4,r15 +1: + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r3 + bsr L_pop_d + nop +2: + add #2,r2 + bra L_pass + add #-8,r8 + +L_pop_d: + mov r2,r0 + add r0,r0 + add r2,r0 + add #-12,r0 + add r0,r0 + braf r0 + nop + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + rts + mov.l @r15+,r7 + +L_pass_i: + cmp/eq #FFI_TYPE_INT,r0 + bf L_call_it + + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r3 + bsr L_pop_i + nop +2: + add #1,r2 + bra L_pass + add #-4,r8 + +L_pop_i: + mov r2,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop + rts + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + +L_call_it: + # call function +#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) + mov r10, r2 +#endif + mov.l @(28,r14),r1 + jsr @r1 + nop + +L_ret_d: + mov #FFI_TYPE_DOUBLE,r2 + cmp/eq r2,r9 + bf L_ret_ll + + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + +L_ret_ll: + mov #FFI_TYPE_SINT64,r2 + cmp/eq r2,r9 + bt/s 1f + mov #FFI_TYPE_UINT64,r2 + cmp/eq r2,r9 + bf L_ret_i + +1: + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + +L_ret_i: + mov #FFI_TYPE_FLOAT,r2 + cmp/eq r2,r9 + bt 1f + mov #FFI_TYPE_INT,r2 + cmp/eq r2,r9 + bf L_epilogue +1: + mov.l @(24,r14),r1 + bra L_epilogue + mov.l r0,@r1 + +L_epilogue: + # Remove the space we pushed for the args + mov r14,r15 + + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r12 + mov.l @r15+,r10 + mov.l @r15+,r9 + rts + mov.l @r15+,r8 +#endif +.LFE1: +.ffi_call_SYSV_end: + .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) + +.globl ffi_closure_helper_SYSV + +ENTRY(ffi_closure_SYSV) +.LFB2: + mov.l r7,@-r15 +.LCFI7: + mov.l r6,@-r15 +.LCFI8: + mov.l r5,@-r15 +.LCFI9: + mov.l r4,@-r15 +.LCFIA: + mov.l r14,@-r15 +.LCFIB: + sts.l pr,@-r15 + + /* Stack layout: + xx bytes (on stack parameters) + 16 bytes (register parameters) + 4 bytes (saved frame pointer) + 4 bytes (saved return address) + 32 bytes (floating register parameters, SH-4 only) + 8 bytes (result) + 4 bytes (pad) + 4 bytes (5th arg) + <- new stack pointer + */ +.LCFIC: +#if defined(__SH4__) + add #-48,r15 +#else + add #-16,r15 +#endif +.LCFID: + mov r15,r14 +.LCFIE: + +#if defined(__SH4__) + mov r14,r1 + add #48,r1 +#ifdef __LITTLE_ENDIAN__ + fmov.s fr10,@-r1 + fmov.s fr11,@-r1 + fmov.s fr8,@-r1 + fmov.s fr9,@-r1 + fmov.s fr6,@-r1 + fmov.s fr7,@-r1 + fmov.s fr4,@-r1 + fmov.s fr5,@-r1 +#else + fmov.s fr11,@-r1 + fmov.s fr10,@-r1 + fmov.s fr9,@-r1 + fmov.s fr8,@-r1 + fmov.s fr7,@-r1 + fmov.s fr6,@-r1 + fmov.s fr5,@-r1 + fmov.s fr4,@-r1 +#endif + mov r1,r7 + mov r14,r6 + add #56,r6 +#else + mov r14,r6 + add #24,r6 +#endif + + bt/s 10f + mov r2, r5 + mov r14,r1 + add #8,r1 + mov r1,r5 +10: + + mov r14,r1 +#if defined(__SH4__) + add #72,r1 +#else + add #40,r1 +#endif + mov.l r1,@r14 + +#ifdef PIC + mov.l L_got,r1 + mova L_got,r0 + add r0,r1 + mov.l L_helper,r0 + add r1,r0 +#else + mov.l L_helper,r0 +#endif + jsr @r0 + mov r3,r4 + + shll r0 + mov r0,r1 + mova L_table,r0 + add r1,r0 + mov.w @r0,r0 + mov r14,r2 + braf r0 + add #8,r2 +0: + .align 2 +#ifdef PIC +L_got: + .long _GLOBAL_OFFSET_TABLE_ +L_helper: + .long ffi_closure_helper_SYSV@GOTOFF +#else +L_helper: + .long ffi_closure_helper_SYSV +#endif +L_table: + .short L_case_v - 0b /* FFI_TYPE_VOID */ + .short L_case_i - 0b /* FFI_TYPE_INT */ +#if defined(__SH4__) + .short L_case_f - 0b /* FFI_TYPE_FLOAT */ + .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ + .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ +#else + .short L_case_i - 0b /* FFI_TYPE_FLOAT */ + .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ + .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ +#endif + .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ + .short L_case_q - 0b /* FFI_TYPE_SINT8 */ + .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ + .short L_case_h - 0b /* FFI_TYPE_SINT16 */ + .short L_case_i - 0b /* FFI_TYPE_UINT32 */ + .short L_case_i - 0b /* FFI_TYPE_SINT32 */ + .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ + .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ + .short L_case_v - 0b /* FFI_TYPE_STRUCT */ + .short L_case_i - 0b /* FFI_TYPE_POINTER */ + +#if defined(__SH4__) +L_case_d: +#ifdef __LITTLE_ENDIAN__ + fmov.s @r2+,fr1 + bra L_case_v + fmov.s @r2,fr0 +#else + fmov.s @r2+,fr0 + bra L_case_v + fmov.s @r2,fr1 +#endif + +L_case_f: + bra L_case_v + fmov.s @r2,fr0 +#endif + +L_case_ll: + mov.l @r2+,r0 + bra L_case_v + mov.l @r2,r1 + +L_case_i: + bra L_case_v + mov.l @r2,r0 + +L_case_q: +#ifdef __LITTLE_ENDIAN__ +#else + add #3,r2 +#endif + bra L_case_v + mov.b @r2,r0 + +L_case_uq: +#ifdef __LITTLE_ENDIAN__ +#else + add #3,r2 +#endif + mov.b @r2,r0 + bra L_case_v + extu.b r0,r0 + +L_case_h: +#ifdef __LITTLE_ENDIAN__ +#else + add #2,r2 +#endif + bra L_case_v + mov.w @r2,r0 + +L_case_uh: +#ifdef __LITTLE_ENDIAN__ +#else + add #2,r2 +#endif + mov.w @r2,r0 + extu.w r0,r0 + /* fall through */ + +L_case_v: +#if defined(__SH4__) + add #48,r15 +#else + add #16,r15 +#endif + lds.l @r15+,pr + mov.l @r15+,r14 + rts + add #16,r15 +.LFE2: +.ffi_closure_SYSV_end: + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif + + .section ".eh_frame","aw",@progbits +__FRAME_BEGIN__: + .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ +.LSCIE1: + .4byte 0x0 /* CIE Identifier Tag */ + .byte 0x1 /* CIE Version */ +#ifdef PIC + .ascii "zR\0" /* CIE Augmentation */ +#else + .byte 0x0 /* CIE Augmentation */ +#endif + .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ + .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ + .byte 0x11 /* CIE RA Column */ +#ifdef PIC + .uleb128 0x1 /* Augmentation size */ + .byte 0x10 /* FDE Encoding (pcrel) */ +#endif + .byte 0xc /* DW_CFA_def_cfa */ + .byte 0xf /* uleb128 0xf */ + .byte 0x0 /* uleb128 0x0 */ + .align 2 +.LECIE1: +.LSFDE1: + .4byte .LEFDE1-.LASFDE1 /* FDE Length */ +.LASFDE1: + .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ +#ifdef PIC + .4byte .LFB1-. /* FDE initial location */ +#else + .4byte .LFB1 /* FDE initial location */ +#endif + .4byte .LFE1-.LFB1 /* FDE address range */ +#ifdef PIC + .uleb128 0x0 /* Augmentation size */ +#endif + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI0-.LFB1 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x4 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI1-.LCFI0 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x8 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI2-.LCFI1 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0xc /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI3-.LCFI2 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x10 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI4-.LCFI3 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x14 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI5-.LCFI4 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x18 /* uleb128 0x4 */ + .byte 0x91 /* DW_CFA_offset, column 0x11 */ + .byte 0x6 /* uleb128 0x6 */ + .byte 0x8e /* DW_CFA_offset, column 0xe */ + .byte 0x5 /* uleb128 0x5 */ + .byte 0x8c /* DW_CFA_offset, column 0xc */ + .byte 0x4 /* uleb128 0x4 */ + .byte 0x8a /* DW_CFA_offset, column 0xa */ + .byte 0x3 /* uleb128 0x3 */ + .byte 0x89 /* DW_CFA_offset, column 0x9 */ + .byte 0x2 /* uleb128 0x2 */ + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .byte 0x1 /* uleb128 0x1 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI6-.LCFI5 + .byte 0xd /* DW_CFA_def_cfa_register */ + .byte 0xe /* uleb128 0xe */ + .align 2 +.LEFDE1: + +.LSFDE3: + .4byte .LEFDE3-.LASFDE3 /* FDE Length */ +.LASFDE3: + .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ +#ifdef PIC + .4byte .LFB2-. /* FDE initial location */ +#else + .4byte .LFB2 /* FDE initial location */ +#endif + .4byte .LFE2-.LFB2 /* FDE address range */ +#ifdef PIC + .uleb128 0x0 /* Augmentation size */ +#endif + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI7-.LFB2 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x4 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI8-.LCFI7 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x8 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFI9-.LCFI8 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0xc /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIA-.LCFI9 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x10 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIB-.LCFIA + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x14 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIC-.LCFIB + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x18 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFID-.LCFIC + .byte 0xe /* DW_CFA_def_cfa_offset */ +#if defined(__SH4__) + .byte 24+48 /* uleb128 24+48 */ +#else + .byte 24+16 /* uleb128 24+16 */ +#endif + .byte 0x91 /* DW_CFA_offset, column 0x11 */ + .byte 0x6 /* uleb128 0x6 */ + .byte 0x8e /* DW_CFA_offset, column 0xe */ + .byte 0x5 /* uleb128 0x5 */ + .byte 0x84 /* DW_CFA_offset, column 0x4 */ + .byte 0x4 /* uleb128 0x4 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 */ + .byte 0x3 /* uleb128 0x3 */ + .byte 0x86 /* DW_CFA_offset, column 0x6 */ + .byte 0x2 /* uleb128 0x2 */ + .byte 0x87 /* DW_CFA_offset, column 0x7 */ + .byte 0x1 /* uleb128 0x1 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIE-.LCFID + .byte 0xd /* DW_CFA_def_cfa_register */ + .byte 0xe /* uleb128 0xe */ + .align 2 +.LEFDE3: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffi.c new file mode 100644 index 0000000..123b87a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffi.c @@ -0,0 +1,469 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima + Copyright (c) 2008 Anthony Green + + SuperH SHmedia Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +#define NGREGARG 8 +#define NFREGARG 12 + +static int +return_type (ffi_type *arg) +{ + + if (arg->type != FFI_TYPE_STRUCT) + return arg->type; + + /* gcc uses r2 if the result can be packed in on register. */ + if (arg->size <= sizeof (UINT8)) + return FFI_TYPE_UINT8; + else if (arg->size <= sizeof (UINT16)) + return FFI_TYPE_UINT16; + else if (arg->size <= sizeof (UINT32)) + return FFI_TYPE_UINT32; + else if (arg->size <= sizeof (UINT64)) + return FFI_TYPE_UINT64; + + return FFI_TYPE_STRUCT; +} + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += sizeof (UINT64); + } + + avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) + { + size_t z; + int align; + + z = (*p_arg)->size; + align = (*p_arg)->alignment; + if (z < sizeof (UINT32)) + { + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(SINT64 *) argp = (SINT64) *(SINT8 *)(*p_argv); + break; + + case FFI_TYPE_UINT8: + *(UINT64 *) argp = (UINT64) *(UINT8 *)(*p_argv); + break; + + case FFI_TYPE_SINT16: + *(SINT64 *) argp = (SINT64) *(SINT16 *)(*p_argv); + break; + + case FFI_TYPE_UINT16: + *(UINT64 *) argp = (UINT64) *(UINT16 *)(*p_argv); + break; + + case FFI_TYPE_STRUCT: + memcpy (argp, *p_argv, z); + break; + + default: + FFI_ASSERT(0); + } + argp += sizeof (UINT64); + } + else if (z == sizeof (UINT32) && align == sizeof (UINT32)) + { + switch ((*p_arg)->type) + { + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + *(SINT64 *) argp = (SINT64) *(SINT32 *) (*p_argv); + break; + + case FFI_TYPE_FLOAT: + case FFI_TYPE_POINTER: + case FFI_TYPE_UINT32: + case FFI_TYPE_STRUCT: + *(UINT64 *) argp = (UINT64) *(UINT32 *) (*p_argv); + break; + + default: + FFI_ASSERT(0); + break; + } + argp += sizeof (UINT64); + } + else if (z == sizeof (UINT64) + && align == sizeof (UINT64) + && ((int) *p_argv & (sizeof (UINT64) - 1)) == 0) + { + *(UINT64 *) argp = *(UINT64 *) (*p_argv); + argp += sizeof (UINT64); + } + else + { + int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); + + memcpy (argp, *p_argv, z); + argp += n * sizeof (UINT64); + } + } + + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + int i, j; + int size, type; + int n, m; + int greg; + int freg; + int fpair = -1; + + greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0); + freg = 0; + cif->flags2 = 0; + + for (i = j = 0; i < cif->nargs; i++) + { + type = (cif->arg_types)[i]->type; + switch (type) + { + case FFI_TYPE_FLOAT: + greg++; + cif->bytes += sizeof (UINT64) - sizeof (float); + if (freg >= NFREGARG - 1) + continue; + if (fpair < 0) + { + fpair = freg; + freg += 2; + } + else + fpair = -1; + cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); + break; + + case FFI_TYPE_DOUBLE: + if (greg++ >= NGREGARG && (freg + 1) >= NFREGARG) + continue; + if ((freg + 1) < NFREGARG) + { + freg += 2; + cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); + } + else + cif->flags2 += FFI_TYPE_INT << (2 * j++); + break; + + default: + size = (cif->arg_types)[i]->size; + if (size < sizeof (UINT64)) + cif->bytes += sizeof (UINT64) - size; + n = (size + sizeof (UINT64) - 1) / sizeof (UINT64); + if (greg >= NGREGARG) + continue; + else if (greg + n - 1 >= NGREGARG) + greg = NGREGARG; + else + greg += n; + for (m = 0; m < n; m++) + cif->flags2 += FFI_TYPE_INT << (2 * j++); + break; + } + } + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_STRUCT: + cif->flags = return_type (cif->rtype); + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = cif->rtype->type; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +/*@-declundef@*/ +/*@-exportheader@*/ +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, long long, + /*@out@*/ unsigned *, + void (*fn)(void)); +/*@=declundef@*/ +/*@=exportheader@*/ + +void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(void), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) +{ + extended_cif ecif; + UINT64 trvalue; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if (cif->rtype->type == FFI_TYPE_STRUCT + && return_type (cif->rtype) != FFI_TYPE_STRUCT) + ecif.rvalue = &trvalue; + else if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->flags2, + ecif.rvalue, fn); + break; + default: + FFI_ASSERT(0); + break; + } + + if (rvalue + && cif->rtype->type == FFI_TYPE_STRUCT + && return_type (cif->rtype) != FFI_TYPE_STRUCT) + memcpy (rvalue, &trvalue, cif->rtype->size); +} + +extern void ffi_closure_SYSV (void); +extern void __ic_invalidate (void *line); + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp; + + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + tramp = (unsigned int *) &closure->tramp[0]; + /* Since ffi_closure is an aligned object, the ffi trampoline is + called as an SHcompact code. Sigh. + SHcompact part: + mova @(1,pc),r0; add #1,r0; jmp @r0; nop; + SHmedia part: + movi fnaddr >> 16,r1; shori fnaddr,r1; ptabs/l r1,tr0 + movi cxt >> 16,r1; shori cxt,r1; blink tr0,r63 */ +#ifdef __LITTLE_ENDIAN__ + tramp[0] = 0x7001c701; + tramp[1] = 0x0009402b; +#else + tramp[0] = 0xc7017001; + tramp[1] = 0x402b0009; +#endif + tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10; + tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10; + tramp[4] = 0x6bf10600; + tramp[5] = 0xcc000010 | (((UINT32) codeloc) >> 16) << 10; + tramp[6] = 0xc8000010 | (((UINT32) codeloc) & 0xffff) << 10; + tramp[7] = 0x4401fff0; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Flush the icache. */ + asm volatile ("ocbwb %0,0; synco; icbi %1,0; synci" : : "r" (tramp), + "r"(codeloc)); + + return FFI_OK; +} + +/* Basically the trampoline invokes ffi_closure_SYSV, and on + * entry, r3 holds the address of the closure. + * After storing the registers that could possibly contain + * parameters to be passed into the stack frame and setting + * up space for a return value, ffi_closure_SYSV invokes the + * following helper function to do most of the work. + */ + +int +ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue, + UINT64 *pgr, UINT64 *pfr, UINT64 *pst) +{ + void **avalue; + ffi_type **p_arg; + int i, avn; + int greg, freg; + ffi_cif *cif; + int fpair = -1; + + cif = closure->cif; + avalue = alloca (cif->nargs * sizeof (void *)); + + /* Copy the caller's structure return value address so that the closure + returns the data directly to the caller. */ + if (return_type (cif->rtype) == FFI_TYPE_STRUCT) + { + rvalue = (UINT64 *) *pgr; + greg = 1; + } + else + greg = 0; + + freg = 0; + cif = closure->cif; + avn = cif->nargs; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + size_t z; + void *p; + + z = (*p_arg)->size; + if (z < sizeof (UINT32)) + { + p = pgr + greg++; + + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_STRUCT: +#ifdef __LITTLE_ENDIAN__ + avalue[i] = p; +#else + avalue[i] = ((char *) p) + sizeof (UINT32) - z; +#endif + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof (UINT32)) + { + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg < NFREGARG - 1) + { + if (fpair >= 0) + { + avalue[i] = (UINT32 *) pfr + fpair; + fpair = -1; + } + else + { +#ifdef __LITTLE_ENDIAN__ + fpair = freg; + avalue[i] = (UINT32 *) pfr + (1 ^ freg); +#else + fpair = 1 ^ freg; + avalue[i] = (UINT32 *) pfr + freg; +#endif + freg += 2; + } + } + else +#ifdef __LITTLE_ENDIAN__ + avalue[i] = pgr + greg; +#else + avalue[i] = (UINT32 *) (pgr + greg) + 1; +#endif + } + else +#ifdef __LITTLE_ENDIAN__ + avalue[i] = pgr + greg; +#else + avalue[i] = (UINT32 *) (pgr + greg) + 1; +#endif + greg++; + } + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 >= NFREGARG) + avalue[i] = pgr + greg; + else + { + avalue[i] = pfr + (freg >> 1); + freg += 2; + } + greg++; + } + else + { + int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); + + avalue[i] = pgr + greg; + greg += n; + } + } + + (closure->fun) (cif, rvalue, avalue, closure->user_data); + + /* Tell ffi_closure_SYSV how to perform return type promotions. */ + return return_type (cif->rtype); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffitarget.h new file mode 100644 index 0000000..08a6fe9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/ffitarget.h @@ -0,0 +1,58 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for SuperH - SHmedia. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; + +#define FFI_EXTRA_CIF_FIELDS long long flags2 +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 32 +#define FFI_NATIVE_RAW_API 0 + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/sysv.S new file mode 100644 index 0000000..c4587d5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sh64/sysv.S @@ -0,0 +1,539 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima + + SuperH SHmedia Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#ifdef HAVE_MACHINE_ASM_H +#include +#else +/* XXX these lose for some platforms, I'm sure. */ +#define CNAME(x) x +#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): +#endif + +#ifdef __LITTLE_ENDIAN__ +#define OFS_FLT 0 +#else +#define OFS_FLT 4 +#endif + + .section .text..SHmedia32,"ax" + + # r2: ffi_prep_args + # r3: &ecif + # r4: bytes + # r5: flags + # r6: flags2 + # r7: rvalue + # r8: fn + + # This assumes we are using gas. + .align 5 +ENTRY(ffi_call_SYSV) + # Save registers +.LFB1: + addi.l r15, -48, r15 +.LCFI0: + st.q r15, 40, r32 + st.q r15, 32, r31 + st.q r15, 24, r30 + st.q r15, 16, r29 + st.q r15, 8, r28 + st.l r15, 4, r18 + st.l r15, 0, r14 +.LCFI1: + add.l r15, r63, r14 +.LCFI2: +# add r4, r63, r28 + add r5, r63, r29 + add r6, r63, r30 + add r7, r63, r31 + add r8, r63, r32 + + addi r4, (64 + 7), r4 + andi r4, ~7, r4 + sub.l r15, r4, r15 + + ptabs/l r2, tr0 + add r15, r63, r2 + blink tr0, r18 + + addi r15, 64, r22 + movi 0, r0 + movi 0, r1 + movi -1, r23 + + pt/l 1f, tr1 + bnei/l r29, FFI_TYPE_STRUCT, tr1 + ld.l r15, 0, r19 + addi r15, 8, r15 + addi r0, 1, r0 +1: + +.L_pass: + andi r30, 3, r20 + shlri r30, 2, r30 + + pt/l .L_call_it, tr0 + pt/l .L_pass_i, tr1 + pt/l .L_pass_f, tr2 + + beqi/l r20, FFI_TYPE_VOID, tr0 + beqi/l r20, FFI_TYPE_INT, tr1 + beqi/l r20, FFI_TYPE_FLOAT, tr2 + +.L_pass_d: + addi r0, 1, r0 + pt/l 3f, tr0 + movi 12, r20 + bge/l r1, r20, tr0 + + pt/l .L_pop_d, tr1 + pt/l 2f, tr0 + blink tr1, r63 +2: + addi.l r15, 8, r15 +3: + pt/l .L_pass, tr0 + addi r1, 2, r1 + blink tr0, r63 + +.L_pop_d: + pt/l .L_pop_d_tbl, tr1 + gettr tr1, r20 + shlli r1, 2, r21 + add r20, r21, r20 + ptabs/l r20, tr1 + blink tr1, r63 + +.L_pop_d_tbl: + fld.d r15, 0, dr0 + blink tr0, r63 + fld.d r15, 0, dr2 + blink tr0, r63 + fld.d r15, 0, dr4 + blink tr0, r63 + fld.d r15, 0, dr6 + blink tr0, r63 + fld.d r15, 0, dr8 + blink tr0, r63 + fld.d r15, 0, dr10 + blink tr0, r63 + +.L_pass_f: + addi r0, 1, r0 + pt/l 3f, tr0 + movi 12, r20 + bge/l r1, r20, tr0 + + pt/l .L_pop_f, tr1 + pt/l 2f, tr0 + blink tr1, r63 +2: + addi.l r15, 8, r15 +3: + pt/l .L_pass, tr0 + blink tr0, r63 + +.L_pop_f: + pt/l .L_pop_f_tbl, tr1 + pt/l 5f, tr2 + gettr tr1, r20 + bge/l r23, r63, tr2 + add r1, r63, r23 + shlli r1, 3, r21 + addi r1, 2, r1 + add r20, r21, r20 + ptabs/l r20, tr1 + blink tr1, r63 +5: + addi r23, 1, r21 + movi -1, r23 + shlli r21, 3, r21 + add r20, r21, r20 + ptabs/l r20, tr1 + blink tr1, r63 + +.L_pop_f_tbl: + fld.s r15, OFS_FLT, fr0 + blink tr0, r63 + fld.s r15, OFS_FLT, fr1 + blink tr0, r63 + fld.s r15, OFS_FLT, fr2 + blink tr0, r63 + fld.s r15, OFS_FLT, fr3 + blink tr0, r63 + fld.s r15, OFS_FLT, fr4 + blink tr0, r63 + fld.s r15, OFS_FLT, fr5 + blink tr0, r63 + fld.s r15, OFS_FLT, fr6 + blink tr0, r63 + fld.s r15, OFS_FLT, fr7 + blink tr0, r63 + fld.s r15, OFS_FLT, fr8 + blink tr0, r63 + fld.s r15, OFS_FLT, fr9 + blink tr0, r63 + fld.s r15, OFS_FLT, fr10 + blink tr0, r63 + fld.s r15, OFS_FLT, fr11 + blink tr0, r63 + +.L_pass_i: + pt/l 3f, tr0 + movi 8, r20 + bge/l r0, r20, tr0 + + pt/l .L_pop_i, tr1 + pt/l 2f, tr0 + blink tr1, r63 +2: + addi.l r15, 8, r15 +3: + pt/l .L_pass, tr0 + addi r0, 1, r0 + blink tr0, r63 + +.L_pop_i: + pt/l .L_pop_i_tbl, tr1 + gettr tr1, r20 + shlli r0, 3, r21 + add r20, r21, r20 + ptabs/l r20, tr1 + blink tr1, r63 + +.L_pop_i_tbl: + ld.q r15, 0, r2 + blink tr0, r63 + ld.q r15, 0, r3 + blink tr0, r63 + ld.q r15, 0, r4 + blink tr0, r63 + ld.q r15, 0, r5 + blink tr0, r63 + ld.q r15, 0, r6 + blink tr0, r63 + ld.q r15, 0, r7 + blink tr0, r63 + ld.q r15, 0, r8 + blink tr0, r63 + ld.q r15, 0, r9 + blink tr0, r63 + +.L_call_it: + # call function + pt/l 1f, tr1 + bnei/l r29, FFI_TYPE_STRUCT, tr1 + add r19, r63, r2 +1: + add r22, r63, r15 + ptabs/l r32, tr0 + blink tr0, r18 + + pt/l .L_ret_i, tr0 + pt/l .L_ret_ll, tr1 + pt/l .L_ret_d, tr2 + pt/l .L_ret_f, tr3 + pt/l .L_epilogue, tr4 + + beqi/l r29, FFI_TYPE_INT, tr0 + beqi/l r29, FFI_TYPE_UINT32, tr0 + beqi/l r29, FFI_TYPE_SINT64, tr1 + beqi/l r29, FFI_TYPE_UINT64, tr1 + beqi/l r29, FFI_TYPE_DOUBLE, tr2 + beqi/l r29, FFI_TYPE_FLOAT, tr3 + + pt/l .L_ret_q, tr0 + pt/l .L_ret_h, tr1 + + beqi/l r29, FFI_TYPE_UINT8, tr0 + beqi/l r29, FFI_TYPE_UINT16, tr1 + blink tr4, r63 + +.L_ret_d: + fst.d r31, 0, dr0 + blink tr4, r63 + +.L_ret_ll: + st.q r31, 0, r2 + blink tr4, r63 + +.L_ret_f: + fst.s r31, OFS_FLT, fr0 + blink tr4, r63 + +.L_ret_q: + st.b r31, 0, r2 + blink tr4, r63 + +.L_ret_h: + st.w r31, 0, r2 + blink tr4, r63 + +.L_ret_i: + st.l r31, 0, r2 + # Fall + +.L_epilogue: + # Remove the space we pushed for the args + add r14, r63, r15 + + ld.l r15, 0, r14 + ld.l r15, 4, r18 + ld.q r15, 8, r28 + ld.q r15, 16, r29 + ld.q r15, 24, r30 + ld.q r15, 32, r31 + ld.q r15, 40, r32 + addi.l r15, 48, r15 + ptabs r18, tr0 + blink tr0, r63 + +.LFE1: +.ffi_call_SYSV_end: + .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) + + .align 5 +ENTRY(ffi_closure_SYSV) +.LFB2: + addi.l r15, -136, r15 +.LCFI3: + st.l r15, 12, r18 + st.l r15, 8, r14 + st.l r15, 4, r12 +.LCFI4: + add r15, r63, r14 +.LCFI5: + /* Stack layout: + ... + 64 bytes (register parameters) + 48 bytes (floating register parameters) + 8 bytes (result) + 4 bytes (r18) + 4 bytes (r14) + 4 bytes (r12) + 4 bytes (for align) + <- new stack pointer + */ + fst.d r14, 24, dr0 + fst.d r14, 32, dr2 + fst.d r14, 40, dr4 + fst.d r14, 48, dr6 + fst.d r14, 56, dr8 + fst.d r14, 64, dr10 + st.q r14, 72, r2 + st.q r14, 80, r3 + st.q r14, 88, r4 + st.q r14, 96, r5 + st.q r14, 104, r6 + st.q r14, 112, r7 + st.q r14, 120, r8 + st.q r14, 128, r9 + + add r1, r63, r2 + addi r14, 16, r3 + addi r14, 72, r4 + addi r14, 24, r5 + addi r14, 136, r6 +#ifdef PIC + movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12 + shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12 +.LPCS0: ptrel/u r12, tr0 + movi ((ffi_closure_helper_SYSV@GOTPLT) & 65535), r1 + gettr tr0, r12 + ldx.l r1, r12, r1 + ptabs r1, tr0 +#else + pt/l ffi_closure_helper_SYSV, tr0 +#endif + blink tr0, r18 + + shlli r2, 1, r1 + movi (((datalabel .L_table) >> 16) & 65535), r2 + shori ((datalabel .L_table) & 65535), r2 + ldx.w r2, r1, r1 + add r1, r2, r1 + pt/l .L_case_v, tr1 + ptabs r1, tr0 + blink tr0, r63 + + .align 2 +.L_table: + .word .L_case_v - datalabel .L_table /* FFI_TYPE_VOID */ + .word .L_case_i - datalabel .L_table /* FFI_TYPE_INT */ + .word .L_case_f - datalabel .L_table /* FFI_TYPE_FLOAT */ + .word .L_case_d - datalabel .L_table /* FFI_TYPE_DOUBLE */ + .word .L_case_d - datalabel .L_table /* FFI_TYPE_LONGDOUBLE */ + .word .L_case_uq - datalabel .L_table /* FFI_TYPE_UINT8 */ + .word .L_case_q - datalabel .L_table /* FFI_TYPE_SINT8 */ + .word .L_case_uh - datalabel .L_table /* FFI_TYPE_UINT16 */ + .word .L_case_h - datalabel .L_table /* FFI_TYPE_SINT16 */ + .word .L_case_i - datalabel .L_table /* FFI_TYPE_UINT32 */ + .word .L_case_i - datalabel .L_table /* FFI_TYPE_SINT32 */ + .word .L_case_ll - datalabel .L_table /* FFI_TYPE_UINT64 */ + .word .L_case_ll - datalabel .L_table /* FFI_TYPE_SINT64 */ + .word .L_case_v - datalabel .L_table /* FFI_TYPE_STRUCT */ + .word .L_case_i - datalabel .L_table /* FFI_TYPE_POINTER */ + + .align 2 +.L_case_d: + fld.d r14, 16, dr0 + blink tr1, r63 +.L_case_f: + fld.s r14, 16, fr0 + blink tr1, r63 +.L_case_ll: + ld.q r14, 16, r2 + blink tr1, r63 +.L_case_i: + ld.l r14, 16, r2 + blink tr1, r63 +.L_case_q: + ld.b r14, 16, r2 + blink tr1, r63 +.L_case_uq: + ld.ub r14, 16, r2 + blink tr1, r63 +.L_case_h: + ld.w r14, 16, r2 + blink tr1, r63 +.L_case_uh: + ld.uw r14, 16, r2 + blink tr1, r63 +.L_case_v: + add.l r14, r63, r15 + ld.l r15, 4, r12 + ld.l r15, 8, r14 + ld.l r15, 12, r18 + addi.l r15, 136, r15 + ptabs r18, tr0 + blink tr0, r63 + +.LFE2: +.ffi_closure_SYSV_end: + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif + + .section ".eh_frame","aw",@progbits +__FRAME_BEGIN__: + .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ +.LSCIE1: + .4byte 0x0 /* CIE Identifier Tag */ + .byte 0x1 /* CIE Version */ +#ifdef PIC + .ascii "zR\0" /* CIE Augmentation */ +#else + .byte 0x0 /* CIE Augmentation */ +#endif + .uleb128 0x1 /* CIE Code Alignment Factor */ + .sleb128 -4 /* CIE Data Alignment Factor */ + .byte 0x12 /* CIE RA Column */ +#ifdef PIC + .uleb128 0x1 /* Augmentation size */ + .byte 0x10 /* FDE Encoding (pcrel) */ +#endif + .byte 0xc /* DW_CFA_def_cfa */ + .uleb128 0xf + .uleb128 0x0 + .align 2 +.LECIE1: +.LSFDE1: + .4byte datalabel .LEFDE1-datalabel .LASFDE1 /* FDE Length */ +.LASFDE1: + .4byte datalabel .LASFDE1-datalabel __FRAME_BEGIN__ +#ifdef PIC + .4byte .LFB1-. /* FDE initial location */ +#else + .4byte .LFB1 /* FDE initial location */ +#endif + .4byte datalabel .LFE1-datalabel .LFB1 /* FDE address range */ +#ifdef PIC + .uleb128 0x0 /* Augmentation size */ +#endif + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI0-datalabel .LFB1 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 0x30 + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI1-datalabel .LCFI0 + .byte 0x8e /* DW_CFA_offset, column 0xe */ + .uleb128 0xc + .byte 0x92 /* DW_CFA_offset, column 0x12 */ + .uleb128 0xb + .byte 0x9c /* DW_CFA_offset, column 0x1c */ + .uleb128 0xa + .byte 0x9d /* DW_CFA_offset, column 0x1d */ + .uleb128 0x8 + .byte 0x9e /* DW_CFA_offset, column 0x1e */ + .uleb128 0x6 + .byte 0x9f /* DW_CFA_offset, column 0x1f */ + .uleb128 0x4 + .byte 0xa0 /* DW_CFA_offset, column 0x20 */ + .uleb128 0x2 + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI2-datalabel .LCFI1 + .byte 0xd /* DW_CFA_def_cfa_register */ + .uleb128 0xe + .align 2 +.LEFDE1: + +.LSFDE3: + .4byte datalabel .LEFDE3-datalabel .LASFDE3 /* FDE Length */ +.LASFDE3: + .4byte datalabel .LASFDE3-datalabel __FRAME_BEGIN__ +#ifdef PIC + .4byte .LFB2-. /* FDE initial location */ +#else + .4byte .LFB2 /* FDE initial location */ +#endif + .4byte datalabel .LFE2-datalabel .LFB2 /* FDE address range */ +#ifdef PIC + .uleb128 0x0 /* Augmentation size */ +#endif + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI3-datalabel .LFB2 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 0x88 + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI4-datalabel .LCFI3 + .byte 0x8c /* DW_CFA_offset, column 0xc */ + .uleb128 0x21 + .byte 0x8e /* DW_CFA_offset, column 0xe */ + .uleb128 0x20 + .byte 0x92 /* DW_CFA_offset, column 0x12 */ + .uleb128 0x1f + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte datalabel .LCFI5-datalabel .LCFI4 + .byte 0xd /* DW_CFA_def_cfa_register */ + .uleb128 0xe + .align 2 +.LEFDE3: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi.c new file mode 100644 index 0000000..9e406d0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi.c @@ -0,0 +1,468 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2011, 2013 Anthony Green + Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. + + SPARC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include +#include "internal.h" + +#ifndef SPARC64 + +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 128-bit type. */ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + +/* Perform machine dependent cif processing */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep(ffi_cif *cif) +{ + ffi_type *rtype = cif->rtype; + int rtt = rtype->type; + size_t bytes; + int i, n, flags; + + /* Set the return type flag */ + switch (rtt) + { + case FFI_TYPE_VOID: + flags = SPARC_RET_VOID; + break; + case FFI_TYPE_FLOAT: + flags = SPARC_RET_F_1; + break; + case FFI_TYPE_DOUBLE: + flags = SPARC_RET_F_2; + break; + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_STRUCT: + flags = (rtype->size & 0xfff) << SPARC_SIZEMASK_SHIFT; + flags |= SPARC_RET_STRUCT; + break; + case FFI_TYPE_SINT8: + flags = SPARC_RET_SINT8; + break; + case FFI_TYPE_UINT8: + flags = SPARC_RET_UINT8; + break; + case FFI_TYPE_SINT16: + flags = SPARC_RET_SINT16; + break; + case FFI_TYPE_UINT16: + flags = SPARC_RET_UINT16; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + flags = SPARC_RET_UINT32; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + flags = SPARC_RET_INT64; + break; + case FFI_TYPE_COMPLEX: + rtt = rtype->elements[0]->type; + switch (rtt) + { + case FFI_TYPE_FLOAT: + flags = SPARC_RET_F_2; + break; + case FFI_TYPE_DOUBLE: + flags = SPARC_RET_F_4; + break; + case FFI_TYPE_LONGDOUBLE: + flags = SPARC_RET_F_8; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + flags = SPARC_RET_INT128; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + flags = SPARC_RET_INT64; + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + flags = SP_V8_RET_CPLX16; + break; + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + flags = SP_V8_RET_CPLX8; + break; + default: + abort(); + } + break; + default: + abort(); + } + cif->flags = flags; + + bytes = 0; + for (i = 0, n = cif->nargs; i < n; ++i) + { + ffi_type *ty = cif->arg_types[i]; + size_t z = ty->size; + int tt = ty->type; + + switch (tt) + { + case FFI_TYPE_STRUCT: + case FFI_TYPE_LONGDOUBLE: + by_reference: + /* Passed by reference. */ + z = 4; + break; + + case FFI_TYPE_COMPLEX: + tt = ty->elements[0]->type; + if (tt == FFI_TYPE_FLOAT || z > 8) + goto by_reference; + /* FALLTHRU */ + + default: + z = FFI_ALIGN(z, 4); + } + bytes += z; + } + + /* Sparc call frames require that space is allocated for 6 args, + even if they aren't used. Make that space if necessary. */ + if (bytes < 6 * 4) + bytes = 6 * 4; + + /* The ABI always requires space for the struct return pointer. */ + bytes += 4; + + /* The stack must be 2 word aligned, so round bytes up appropriately. */ + bytes = FFI_ALIGN(bytes, 2 * 4); + + /* Include the call frame to prep_args. */ + bytes += 4*16 + 4*8; + cif->bytes = bytes; + + return FFI_OK; +} + +extern void ffi_call_v8(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, size_t bytes, void *closure) FFI_HIDDEN; + +int FFI_HIDDEN +ffi_prep_args_v8(ffi_cif *cif, unsigned long *argp, void *rvalue, void **avalue) +{ + ffi_type **p_arg; + int flags = cif->flags; + int i, nargs; + + if (rvalue == NULL) + { + if ((flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) + { + /* Since we pass the pointer to the callee, we need a value. + We allowed for this space in ffi_call, before ffi_call_v8 + alloca'd the space. */ + rvalue = (char *)argp + cif->bytes; + } + else + { + /* Otherwise, we can ignore the return value. */ + flags = SPARC_RET_VOID; + } + } + + /* This could only really be done when we are returning a structure. + However, the space is reserved so we can do it unconditionally. */ + *argp++ = (unsigned long)rvalue; + +#ifdef USING_PURIFY + /* Purify will probably complain in our assembly routine, + unless we zero out this memory. */ + memset(argp, 0, 6*4); +#endif + + p_arg = cif->arg_types; + for (i = 0, nargs = cif->nargs; i < nargs; i++) + { + ffi_type *ty = p_arg[i]; + void *a = avalue[i]; + int tt = ty->type; + size_t z; + + switch (tt) + { + case FFI_TYPE_STRUCT: + case FFI_TYPE_LONGDOUBLE: + by_reference: + *argp++ = (unsigned long)a; + break; + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + memcpy(argp, a, 8); + argp += 2; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_FLOAT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + *argp++ = *(unsigned *)a; + break; + + case FFI_TYPE_UINT8: + *argp++ = *(UINT8 *)a; + break; + case FFI_TYPE_SINT8: + *argp++ = *(SINT8 *)a; + break; + case FFI_TYPE_UINT16: + *argp++ = *(UINT16 *)a; + break; + case FFI_TYPE_SINT16: + *argp++ = *(SINT16 *)a; + break; + + case FFI_TYPE_COMPLEX: + tt = ty->elements[0]->type; + z = ty->size; + if (tt == FFI_TYPE_FLOAT || z > 8) + goto by_reference; + if (z < 4) + { + memcpy((char *)argp + 4 - z, a, z); + argp++; + } + else + { + memcpy(argp, a, z); + argp += z / 4; + } + break; + + default: + abort(); + } + } + + return flags; +} + +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + size_t bytes = cif->bytes; + + FFI_ASSERT (cif->abi == FFI_V8); + + /* If we've not got a return value, we need to create one if we've + got to pass the return value to the callee. Otherwise ignore it. */ + if (rvalue == NULL + && (cif->flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) + bytes += FFI_ALIGN (cif->rtype->size, 8); + + ffi_call_v8(cif, fn, rvalue, avalue, -bytes, closure); +} + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + +#ifdef __GNUC__ +static inline void +ffi_flush_icache (void *p) +{ + /* SPARC v8 requires 5 instructions for flush to be visible */ + asm volatile ("iflush %0; iflush %0+8; nop; nop; nop; nop; nop" + : : "r" (p) : "memory"); +} +#else +extern void ffi_flush_icache (void *) FFI_HIDDEN; +#endif + +extern void ffi_closure_v8(void) FFI_HIDDEN; +extern void ffi_go_closure_v8(void) FFI_HIDDEN; + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + unsigned long ctx = (unsigned long) closure; + unsigned long fn = (unsigned long) ffi_closure_v8; + + if (cif->abi != FFI_V8) + return FFI_BAD_ABI; + + tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ + tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ + tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ + tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + ffi_flush_icache (closure); + + return FFI_OK; +} + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ + if (cif->abi != FFI_V8) + return FFI_BAD_ABI; + + closure->tramp = ffi_go_closure_v8; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +int FFI_HIDDEN +ffi_closure_sparc_inner_v8(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, void *rvalue, + unsigned long *argp) +{ + ffi_type **arg_types; + void **avalue; + int i, nargs, flags; + + arg_types = cif->arg_types; + nargs = cif->nargs; + flags = cif->flags; + avalue = alloca(nargs * sizeof(void *)); + + /* Copy the caller's structure return address so that the closure + returns the data directly to the caller. Also install it so we + can return the address in %o0. */ + if ((flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) + { + void *new_rvalue = (void *)*argp; + *(void **)rvalue = new_rvalue; + rvalue = new_rvalue; + } + + /* Always skip the structure return address. */ + argp++; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0; i < nargs; i++) + { + ffi_type *ty = arg_types[i]; + int tt = ty->type; + void *a = argp; + size_t z; + + switch (tt) + { + case FFI_TYPE_STRUCT: + case FFI_TYPE_LONGDOUBLE: + by_reference: + /* Straight copy of invisible reference. */ + a = (void *)*argp; + break; + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + if ((unsigned long)a & 7) + { + /* Align on a 8-byte boundary. */ + UINT64 *tmp = alloca(8); + *tmp = ((UINT64)argp[0] << 32) | argp[1]; + a = tmp; + } + argp++; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_FLOAT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + break; + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + a += 2; + break; + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + a += 3; + break; + + case FFI_TYPE_COMPLEX: + tt = ty->elements[0]->type; + z = ty->size; + if (tt == FFI_TYPE_FLOAT || z > 8) + goto by_reference; + if (z < 4) + a += 4 - z; + else if (z > 4) + argp++; + break; + + default: + abort(); + } + argp++; + avalue[i] = a; + } + + /* Invoke the closure. */ + fun (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_sparc how to perform return type promotions. */ + return flags; +} +#endif /* !SPARC64 */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi64.c new file mode 100644 index 0000000..9e04061 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffi64.c @@ -0,0 +1,608 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2011, 2013 Anthony Green + Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. + + SPARC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include +#include "internal.h" + +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 128-bit type. */ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + +#ifdef SPARC64 + +/* Flatten the contents of a structure to the parts that are passed in + floating point registers. The return is a bit mask wherein bit N + set means bytes [4*n, 4*n+3] are passed in %fN. + + We encode both the (running) size (maximum 32) and mask (maxumum 255) + into one integer. The size is placed in the low byte, so that align + and addition work correctly. The mask is placed in the second byte. */ + +static int +ffi_struct_float_mask (ffi_type *outer_type, int size_mask) +{ + ffi_type **elts; + ffi_type *t; + + if (outer_type->type == FFI_TYPE_COMPLEX) + { + int m = 0, tt = outer_type->elements[0]->type; + size_t z = outer_type->size; + + if (tt == FFI_TYPE_FLOAT + || tt == FFI_TYPE_DOUBLE + || tt == FFI_TYPE_LONGDOUBLE) + m = (1 << (z / 4)) - 1; + return (m << 8) | z; + } + FFI_ASSERT (outer_type->type == FFI_TYPE_STRUCT); + + for (elts = outer_type->elements; (t = *elts) != NULL; elts++) + { + size_t z = t->size; + int o, m, tt; + + size_mask = FFI_ALIGN(size_mask, t->alignment); + switch (t->type) + { + case FFI_TYPE_STRUCT: + size_mask = ffi_struct_float_mask (t, size_mask); + continue; + case FFI_TYPE_COMPLEX: + tt = t->elements[0]->type; + if (tt != FFI_TYPE_FLOAT + && tt != FFI_TYPE_DOUBLE + && tt != FFI_TYPE_LONGDOUBLE) + break; + /* FALLTHRU */ + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + m = (1 << (z / 4)) - 1; /* compute mask for type */ + o = (size_mask >> 2) & 0x3f; /* extract word offset */ + size_mask |= m << (o + 8); /* insert mask into place */ + break; + } + size_mask += z; + } + + size_mask = FFI_ALIGN(size_mask, outer_type->alignment); + FFI_ASSERT ((size_mask & 0xff) == outer_type->size); + + return size_mask; +} + +/* Merge floating point data into integer data. If the structure is + entirely floating point, simply return a pointer to the fp data. */ + +static void * +ffi_struct_float_merge (int size_mask, void *vi, void *vf) +{ + int size = size_mask & 0xff; + int mask = size_mask >> 8; + int n = size >> 2; + + if (mask == 0) + return vi; + else if (mask == (1 << n) - 1) + return vf; + else + { + unsigned int *wi = vi, *wf = vf; + int i; + + for (i = 0; i < n; ++i) + if ((mask >> i) & 1) + wi[i] = wf[i]; + + return vi; + } +} + +/* Similar, but place the data into VD in the end. */ + +void FFI_HIDDEN +ffi_struct_float_copy (int size_mask, void *vd, void *vi, void *vf) +{ + int size = size_mask & 0xff; + int mask = size_mask >> 8; + int n = size >> 2; + + if (mask == 0) + ; + else if (mask == (1 << n) - 1) + vi = vf; + else + { + unsigned int *wd = vd, *wi = vi, *wf = vf; + int i; + + for (i = 0; i < n; ++i) + wd[i] = ((mask >> i) & 1 ? wf : wi)[i]; + return; + } + memcpy (vd, vi, size); +} + +/* Perform machine dependent cif processing */ + +static ffi_status +ffi_prep_cif_machdep_core(ffi_cif *cif) +{ + ffi_type *rtype = cif->rtype; + int rtt = rtype->type; + size_t bytes = 0; + int i, n, flags; + + /* Set the return type flag */ + switch (rtt) + { + case FFI_TYPE_VOID: + flags = SPARC_RET_VOID; + break; + case FFI_TYPE_FLOAT: + flags = SPARC_RET_F_1; + break; + case FFI_TYPE_DOUBLE: + flags = SPARC_RET_F_2; + break; + case FFI_TYPE_LONGDOUBLE: + flags = SPARC_RET_F_4; + break; + + case FFI_TYPE_COMPLEX: + case FFI_TYPE_STRUCT: + if (rtype->size > 32) + { + flags = SPARC_RET_VOID | SPARC_FLAG_RET_IN_MEM; + bytes = 8; + } + else + { + int size_mask = ffi_struct_float_mask (rtype, 0); + int word_size = (size_mask >> 2) & 0x3f; + int all_mask = (1 << word_size) - 1; + int fp_mask = size_mask >> 8; + + flags = (size_mask << SPARC_SIZEMASK_SHIFT) | SPARC_RET_STRUCT; + + /* For special cases of all-int or all-fp, we can return + the value directly without popping through a struct copy. */ + if (fp_mask == 0) + { + if (rtype->alignment >= 8) + { + if (rtype->size == 8) + flags = SPARC_RET_INT64; + else if (rtype->size == 16) + flags = SPARC_RET_INT128; + } + } + else if (fp_mask == all_mask) + switch (word_size) + { + case 1: flags = SPARC_RET_F_1; break; + case 2: flags = SPARC_RET_F_2; break; + case 3: flags = SP_V9_RET_F_3; break; + case 4: flags = SPARC_RET_F_4; break; + /* 5 word structures skipped; handled via RET_STRUCT. */ + case 6: flags = SPARC_RET_F_6; break; + /* 7 word structures skipped; handled via RET_STRUCT. */ + case 8: flags = SPARC_RET_F_8; break; + } + } + break; + + case FFI_TYPE_SINT8: + flags = SPARC_RET_SINT8; + break; + case FFI_TYPE_UINT8: + flags = SPARC_RET_UINT8; + break; + case FFI_TYPE_SINT16: + flags = SPARC_RET_SINT16; + break; + case FFI_TYPE_UINT16: + flags = SPARC_RET_UINT16; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + flags = SP_V9_RET_SINT32; + break; + case FFI_TYPE_UINT32: + flags = SPARC_RET_UINT32; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + flags = SPARC_RET_INT64; + break; + + default: + abort(); + } + + bytes = 0; + for (i = 0, n = cif->nargs; i < n; ++i) + { + ffi_type *ty = cif->arg_types[i]; + size_t z = ty->size; + size_t a = ty->alignment; + + switch (ty->type) + { + case FFI_TYPE_COMPLEX: + case FFI_TYPE_STRUCT: + /* Large structs passed by reference. */ + if (z > 16) + { + a = z = 8; + break; + } + /* Small structs may be passed in integer or fp regs or both. */ + if (bytes >= 16*8) + break; + if ((ffi_struct_float_mask (ty, 0) & 0xff00) == 0) + break; + /* FALLTHRU */ + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + flags |= SPARC_FLAG_FP_ARGS; + break; + } + bytes = FFI_ALIGN(bytes, a); + bytes += FFI_ALIGN(z, 8); + } + + /* Sparc call frames require that space is allocated for 6 args, + even if they aren't used. Make that space if necessary. */ + if (bytes < 6 * 8) + bytes = 6 * 8; + + /* The stack must be 2 word aligned, so round bytes up appropriately. */ + bytes = FFI_ALIGN(bytes, 16); + + /* Include the call frame to prep_args. */ + bytes += 8*16 + 8*8; + + cif->bytes = bytes; + cif->flags = flags; + return FFI_OK; +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep(ffi_cif *cif) +{ + cif->nfixedargs = cif->nargs; + return ffi_prep_cif_machdep_core(cif); +} + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned nfixedargs, unsigned ntotalargs) +{ + cif->nfixedargs = nfixedargs; + return ffi_prep_cif_machdep_core(cif); +} + +extern void ffi_call_v9(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, size_t bytes, void *closure) FFI_HIDDEN; + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +int FFI_HIDDEN +ffi_prep_args_v9(ffi_cif *cif, unsigned long *argp, void *rvalue, void **avalue) +{ + ffi_type **p_arg; + int flags = cif->flags; + int i, nargs; + + if (rvalue == NULL) + { + if (flags & SPARC_FLAG_RET_IN_MEM) + { + /* Since we pass the pointer to the callee, we need a value. + We allowed for this space in ffi_call, before ffi_call_v8 + alloca'd the space. */ + rvalue = (char *)argp + cif->bytes; + } + else + { + /* Otherwise, we can ignore the return value. */ + flags = SPARC_RET_VOID; + } + } + +#ifdef USING_PURIFY + /* Purify will probably complain in our assembly routine, + unless we zero out this memory. */ + memset(argp, 0, 6*8); +#endif + + if (flags & SPARC_FLAG_RET_IN_MEM) + *argp++ = (unsigned long)rvalue; + + p_arg = cif->arg_types; + for (i = 0, nargs = cif->nargs; i < nargs; i++) + { + ffi_type *ty = p_arg[i]; + void *a = avalue[i]; + size_t z; + + switch (ty->type) + { + case FFI_TYPE_SINT8: + *argp++ = *(SINT8 *)a; + break; + case FFI_TYPE_UINT8: + *argp++ = *(UINT8 *)a; + break; + case FFI_TYPE_SINT16: + *argp++ = *(SINT16 *)a; + break; + case FFI_TYPE_UINT16: + *argp++ = *(UINT16 *)a; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + *argp++ = *(SINT32 *)a; + break; + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + *argp++ = *(UINT32 *)a; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + case FFI_TYPE_DOUBLE: + *argp++ = *(UINT64 *)a; + break; + + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_COMPLEX: + case FFI_TYPE_STRUCT: + z = ty->size; + if (z > 16) + { + /* For structures larger than 16 bytes we pass reference. */ + *argp++ = (unsigned long)a; + break; + } + if (((unsigned long)argp & 15) && ty->alignment > 8) + argp++; + memcpy(argp, a, z); + argp += FFI_ALIGN(z, 8) / 8; + break; + + default: + abort(); + } + } + + return flags; +} + +static void +ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + size_t bytes = cif->bytes; + + FFI_ASSERT (cif->abi == FFI_V9); + + if (rvalue == NULL && (cif->flags & SPARC_FLAG_RET_IN_MEM)) + bytes += FFI_ALIGN (cif->rtype->size, 16); + + ffi_call_v9(cif, fn, rvalue, avalue, -bytes, closure); +} + +void +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int(cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int(cif, fn, rvalue, avalue, closure); +} + +#ifdef __GNUC__ +static inline void +ffi_flush_icache (void *p) +{ + asm volatile ("flush %0; flush %0+8" : : "r" (p) : "memory"); +} +#else +extern void ffi_flush_icache (void *) FFI_HIDDEN; +#endif + +extern void ffi_closure_v9(void) FFI_HIDDEN; +extern void ffi_go_closure_v9(void) FFI_HIDDEN; + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + unsigned long fn; + + if (cif->abi != FFI_V9) + return FFI_BAD_ABI; + + /* Trampoline address is equal to the closure address. We take advantage + of that to reduce the trampoline size by 8 bytes. */ + fn = (unsigned long) ffi_closure_v9; + tramp[0] = 0x83414000; /* rd %pc, %g1 */ + tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ + tramp[2] = 0x81c14000; /* jmp %g5 */ + tramp[3] = 0x01000000; /* nop */ + *((unsigned long *) &tramp[4]) = fn; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + ffi_flush_icache (closure); + + return FFI_OK; +} + +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ + if (cif->abi != FFI_V9) + return FFI_BAD_ABI; + + closure->tramp = ffi_go_closure_v9; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +int FFI_HIDDEN +ffi_closure_sparc_inner_v9(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, void *rvalue, + unsigned long *gpr, unsigned long *fpr) +{ + ffi_type **arg_types; + void **avalue; + int i, argn, argx, nargs, flags, nfixedargs; + + arg_types = cif->arg_types; + nargs = cif->nargs; + flags = cif->flags; + nfixedargs = cif->nfixedargs; + + avalue = alloca(nargs * sizeof(void *)); + + /* Copy the caller's structure return address so that the closure + returns the data directly to the caller. */ + if (flags & SPARC_FLAG_RET_IN_MEM) + { + rvalue = (void *) gpr[0]; + /* Skip the structure return address. */ + argn = 1; + } + else + argn = 0; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0; i < nargs; i++, argn = argx) + { + int named = i < nfixedargs; + ffi_type *ty = arg_types[i]; + void *a = &gpr[argn]; + size_t z; + + argx = argn + 1; + switch (ty->type) + { + case FFI_TYPE_COMPLEX: + case FFI_TYPE_STRUCT: + z = ty->size; + if (z > 16) + a = *(void **)a; + else + { + argx = argn + FFI_ALIGN (z, 8) / 8; + if (named && argn < 16) + { + int size_mask = ffi_struct_float_mask (ty, 0); + int argn_mask = (0xffff00 >> argn) & 0xff00; + + /* Eliminate fp registers off the end. */ + size_mask = (size_mask & 0xff) | (size_mask & argn_mask); + a = ffi_struct_float_merge (size_mask, gpr+argn, fpr+argn); + } + } + break; + + case FFI_TYPE_LONGDOUBLE: + argn = FFI_ALIGN (argn, 2); + a = (named && argn < 16 ? fpr : gpr) + argn; + argx = argn + 2; + break; + case FFI_TYPE_DOUBLE: + if (named && argn < 16) + a = fpr + argn; + break; + case FFI_TYPE_FLOAT: + if (named && argn < 16) + a = fpr + argn; + a += 4; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + break; + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + a += 4; + break; + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + a += 6; + break; + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + a += 7; + break; + + default: + abort(); + } + avalue[i] = a; + } + + /* Invoke the closure. */ + fun (cif, rvalue, avalue, user_data); + + /* Tell ffi_closure_sparc how to perform return type promotions. */ + return flags; +} +#endif /* SPARC64 */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffitarget.h new file mode 100644 index 0000000..2f4cd9a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/ffitarget.h @@ -0,0 +1,81 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. + Target configuration macros for SPARC. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#if defined(__arch64__) || defined(__sparcv9) +#ifndef SPARC64 +#define SPARC64 +#endif +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, +#ifdef SPARC64 + FFI_V9, + FFI_DEFAULT_ABI = FFI_V9, +#else + FFI_V8, + FFI_DEFAULT_ABI = FFI_V8, +#endif + FFI_LAST_ABI +} ffi_abi; +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION 1 +#define FFI_TARGET_HAS_COMPLEX_TYPE 1 + +#ifdef SPARC64 +# define FFI_TARGET_SPECIFIC_VARIADIC 1 +# define FFI_EXTRA_CIF_FIELDS unsigned int nfixedargs +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 + +#ifdef SPARC64 +#define FFI_TRAMPOLINE_SIZE 24 +#else +#define FFI_TRAMPOLINE_SIZE 16 +#endif + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/internal.h new file mode 100644 index 0000000..0a66472 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/internal.h @@ -0,0 +1,26 @@ +#define SPARC_RET_VOID 0 +#define SPARC_RET_STRUCT 1 +#define SPARC_RET_UINT8 2 +#define SPARC_RET_SINT8 3 +#define SPARC_RET_UINT16 4 +#define SPARC_RET_SINT16 5 +#define SPARC_RET_UINT32 6 +#define SP_V9_RET_SINT32 7 /* v9 only */ +#define SP_V8_RET_CPLX16 7 /* v8 only */ +#define SPARC_RET_INT64 8 +#define SPARC_RET_INT128 9 + +/* Note that F_7 is missing, and is handled by SPARC_RET_STRUCT. */ +#define SPARC_RET_F_8 10 +#define SPARC_RET_F_6 11 +#define SPARC_RET_F_4 12 +#define SPARC_RET_F_2 13 +#define SP_V9_RET_F_3 14 /* v9 only */ +#define SP_V8_RET_CPLX8 14 /* v8 only */ +#define SPARC_RET_F_1 15 + +#define SPARC_FLAG_RET_MASK 15 +#define SPARC_FLAG_RET_IN_MEM 32 +#define SPARC_FLAG_FP_ARGS 64 + +#define SPARC_SIZEMASK_SHIFT 8 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v8.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v8.S new file mode 100644 index 0000000..a2e4908 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v8.S @@ -0,0 +1,443 @@ +/* ----------------------------------------------------------------------- + v8.S - Copyright (c) 2013 The Written Word, Inc. + Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc. + + SPARC Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include "internal.h" + +#ifndef SPARC64 + +#define C2(X, Y) X ## Y +#define C1(X, Y) C2(X, Y) + +#ifdef __USER_LABEL_PREFIX__ +# define C(Y) C1(__USER_LABEL_PREFIX__, Y) +#else +# define C(Y) Y +#endif +#define L(Y) C1(.L, Y) + + .text + +#ifndef __GNUC__ + .align 8 + .globl C(ffi_flush_icache) + .type C(ffi_flush_icache),#function + FFI_HIDDEN(C(ffi_flush_icache)) + +C(ffi_flush_icache): +1: iflush %o0 + iflush %o+8 + nop + nop + nop + nop + nop + retl + nop + .size C(ffi_flush_icache), . - C(ffi_flush_icache) +#endif + +#if defined(__sun__) && defined(__svr4__) +# define E(INDEX) .align 16 +#else +# define E(INDEX) .align 16; .org 2b + INDEX * 16 +#endif + + .align 8 + .globl C(ffi_call_v8) + .type C(ffi_call_v8),#function + FFI_HIDDEN(C(ffi_call_v8)) + +C(ffi_call_v8): +.LUW0: + ! Allocate a stack frame sized by ffi_call. + save %sp, %o4, %sp +.LUW1: + mov %i0, %o0 ! copy cif + add %sp, 64+32, %o1 ! load args area + mov %i2, %o2 ! copy rvalue + call C(ffi_prep_args_v8) + mov %i3, %o3 ! copy avalue + + add %sp, 32, %sp ! deallocate prep frame + and %o0, SPARC_FLAG_RET_MASK, %l0 ! save return type + srl %o0, SPARC_SIZEMASK_SHIFT, %l1 ! save return size + ld [%sp+64+4], %o0 ! load all argument registers + ld [%sp+64+8], %o1 + ld [%sp+64+12], %o2 + ld [%sp+64+16], %o3 + cmp %l0, SPARC_RET_STRUCT ! struct return needs an unimp 4 + ld [%sp+64+20], %o4 + be 8f + ld [%sp+64+24], %o5 + + ! Call foreign function + call %i1 + mov %i5, %g2 ! load static chain + +0: call 1f ! load pc in %o7 + sll %l0, 4, %l0 +1: add %o7, %l0, %o7 ! o7 = 0b + ret_type*16 + jmp %o7+(2f-0b) + nop + + ! Note that each entry is 4 insns, enforced by the E macro. + .align 16 +2: +E(SPARC_RET_VOID) + ret + restore +E(SPARC_RET_STRUCT) + unimp +E(SPARC_RET_UINT8) + and %o0, 0xff, %o0 + st %o0, [%i2] + ret + restore +E(SPARC_RET_SINT8) + sll %o0, 24, %o0 + b 7f + sra %o0, 24, %o0 +E(SPARC_RET_UINT16) + sll %o0, 16, %o0 + b 7f + srl %o0, 16, %o0 +E(SPARC_RET_SINT16) + sll %o0, 16, %o0 + b 7f + sra %o0, 16, %o0 +E(SPARC_RET_UINT32) +7: st %o0, [%i2] + ret + restore +E(SP_V8_RET_CPLX16) + sth %o0, [%i2+2] + b 9f + srl %o0, 16, %o0 +E(SPARC_RET_INT64) + st %o0, [%i2] + st %o1, [%i2+4] + ret + restore +E(SPARC_RET_INT128) + std %o0, [%i2] + std %o2, [%i2+8] + ret + restore +E(SPARC_RET_F_8) + st %f7, [%i2+7*4] + nop + st %f6, [%i2+6*4] + nop +E(SPARC_RET_F_6) + st %f5, [%i2+5*4] + nop + st %f4, [%i2+4*4] + nop +E(SPARC_RET_F_4) + st %f3, [%i2+3*4] + nop + st %f2, [%i2+2*4] + nop +E(SPARC_RET_F_2) + st %f1, [%i2+4] + st %f0, [%i2] + ret + restore +E(SP_V8_RET_CPLX8) + stb %o0, [%i2+1] + b 0f + srl %o0, 8, %o0 +E(SPARC_RET_F_1) + st %f0, [%i2] + ret + restore + + .align 8 +9: sth %o0, [%i2] + ret + restore + .align 8 +0: stb %o0, [%i2] + ret + restore + + ! Struct returning functions expect and skip the unimp here. + ! To make it worse, conforming callees examine the unimp and + ! make sure the low 12 bits of the unimp match the size of + ! the struct being returned. + .align 8 +8: call 1f ! load pc in %o7 + sll %l1, 2, %l0 ! size * 4 +1: sll %l1, 4, %l1 ! size * 16 + add %l0, %l1, %l0 ! size * 20 + add %o7, %l0, %o7 ! o7 = 8b + size*20 + jmp %o7+(2f-8b) + mov %i5, %g2 ! load static chain +2: + +/* The Sun assembler doesn't understand .rept 0x1000. */ +#define rept1 \ + call %i1; \ + nop; \ + unimp (. - 2b) / 20; \ + ret; \ + restore + +#define rept16 \ + rept1; rept1; rept1; rept1; \ + rept1; rept1; rept1; rept1; \ + rept1; rept1; rept1; rept1; \ + rept1; rept1; rept1; rept1 + +#define rept256 \ + rept16; rept16; rept16; rept16; \ + rept16; rept16; rept16; rept16; \ + rept16; rept16; rept16; rept16; \ + rept16; rept16; rept16; rept16 + + rept256; rept256; rept256; rept256 + rept256; rept256; rept256; rept256 + rept256; rept256; rept256; rept256 + rept256; rept256; rept256; rept256 + +.LUW2: + .size C(ffi_call_v8),. - C(ffi_call_v8) + + +/* 16*4 register window + 1*4 struct return + 6*4 args backing store + + 8*4 return storage + 1*4 alignment. */ +#define STACKFRAME (16*4 + 4 + 6*4 + 8*4 + 4) + +/* ffi_closure_v8(...) + + Receives the closure argument in %g2. */ + +#ifdef HAVE_AS_REGISTER_PSEUDO_OP + .register %g2, #scratch +#endif + + .align 8 + .globl C(ffi_go_closure_v8) + .type C(ffi_go_closure_v8),#function + FFI_HIDDEN(C(ffi_go_closure_v8)) + +C(ffi_go_closure_v8): +.LUW3: + save %sp, -STACKFRAME, %sp +.LUW4: + ld [%g2+4], %o0 ! load cif + ld [%g2+8], %o1 ! load fun + b 0f + mov %g2, %o2 ! load user_data +.LUW5: + .size C(ffi_go_closure_v8), . - C(ffi_go_closure_v8) + + .align 8 + .globl C(ffi_closure_v8) + .type C(ffi_closure_v8),#function + FFI_HIDDEN(C(ffi_closure_v8)) + +C(ffi_closure_v8): +.LUW6: + save %sp, -STACKFRAME, %sp +.LUW7: + ld [%g2+FFI_TRAMPOLINE_SIZE], %o0 ! load cif + ld [%g2+FFI_TRAMPOLINE_SIZE+4], %o1 ! load fun + ld [%g2+FFI_TRAMPOLINE_SIZE+8], %o2 ! load user_data +0: + ! Store all of the potential argument registers in va_list format. + st %i0, [%fp+68+0] + st %i1, [%fp+68+4] + st %i2, [%fp+68+8] + st %i3, [%fp+68+12] + st %i4, [%fp+68+16] + st %i5, [%fp+68+20] + + ! Call ffi_closure_sparc_inner to do the bulk of the work. + add %fp, -8*4, %o3 + call ffi_closure_sparc_inner_v8 + add %fp, 64, %o4 + +0: call 1f + and %o0, SPARC_FLAG_RET_MASK, %o0 +1: sll %o0, 4, %o0 ! o0 = o0 * 16 + add %o7, %o0, %o7 ! o7 = 0b + o0*16 + jmp %o7+(2f-0b) + add %fp, -8*4, %i2 + + ! Note that each entry is 4 insns, enforced by the E macro. + .align 16 +2: +E(SPARC_RET_VOID) + ret + restore +E(SPARC_RET_STRUCT) + ld [%i2], %i0 + jmp %i7+12 + restore +E(SPARC_RET_UINT8) + ldub [%i2+3], %i0 + ret + restore +E(SPARC_RET_SINT8) + ldsb [%i2+3], %i0 + ret + restore +E(SPARC_RET_UINT16) + lduh [%i2+2], %i0 + ret + restore +E(SPARC_RET_SINT16) + ldsh [%i2+2], %i0 + ret + restore +E(SPARC_RET_UINT32) + ld [%i2], %i0 + ret + restore +E(SP_V8_RET_CPLX16) + ld [%i2], %i0 + ret + restore +E(SPARC_RET_INT64) + ldd [%i2], %i0 + ret + restore +E(SPARC_RET_INT128) + ldd [%i2], %i0 + ldd [%i2+8], %i2 + ret + restore +E(SPARC_RET_F_8) + ld [%i2+7*4], %f7 + nop + ld [%i2+6*4], %f6 + nop +E(SPARC_RET_F_6) + ld [%i2+5*4], %f5 + nop + ld [%i2+4*4], %f4 + nop +E(SPARC_RET_F_4) + ld [%i2+3*4], %f3 + nop + ld [%i2+2*4], %f2 + nop +E(SPARC_RET_F_2) + ldd [%i2], %f0 + ret + restore +E(SP_V8_RET_CPLX8) + lduh [%i2], %i0 + ret + restore +E(SPARC_RET_F_1) + ld [%i2], %f0 + ret + restore + +.LUW8: + .size C(ffi_closure_v8), . - C(ffi_closure_v8) + +#ifdef HAVE_RO_EH_FRAME + .section ".eh_frame",#alloc +#else + .section ".eh_frame",#alloc,#write +#endif + +#ifdef HAVE_AS_SPARC_UA_PCREL +# define FDE_ADDR(X) %r_disp32(X) +#else +# define FDE_ADDR(X) X +#endif + + .align 4 +.LCIE: + .long .LECIE - .LSCIE ! CIE Length +.LSCIE: + .long 0 ! CIE Identifier Tag + .byte 1 ! CIE Version + .ascii "zR\0" ! CIE Augmentation + .byte 4 ! CIE Code Alignment Factor + .byte 0x7c ! CIE Data Alignment Factor + .byte 15 ! CIE RA Column + .byte 1 ! Augmentation size +#ifdef HAVE_AS_SPARC_UA_PCREL + .byte 0x1b ! FDE Encoding (pcrel sdata4) +#else + .byte 0x50 ! FDE Encoding (aligned absolute) +#endif + .byte 0xc, 14, 0 ! DW_CFA_def_cfa, %o6, offset 0 + .align 4 +.LECIE: + + .long .LEFDE1 - .LSFDE1 ! FDE Length +.LSFDE1: + .long .LSFDE1 - .LCIE ! FDE CIE offset + .long FDE_ADDR(.LUW0) ! Initial location + .long .LUW2 - .LUW0 ! Address range + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 4 +.LEFDE1: + + .long .LEFDE2 - .LSFDE2 ! FDE Length +.LSFDE2: + .long .LSFDE2 - .LCIE ! FDE CIE offset + .long FDE_ADDR(.LUW3) ! Initial location + .long .LUW5 - .LUW3 ! Address range + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 4 +.LEFDE2: + + .long .LEFDE3 - .LSFDE3 ! FDE Length +.LSFDE3: + .long .LSFDE3 - .LCIE ! FDE CIE offset + .long FDE_ADDR(.LUW6) ! Initial location + .long .LUW8 - .LUW6 ! Address range + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 4 +.LEFDE3: + +#endif /* !SPARC64 */ +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v9.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v9.S new file mode 100644 index 0000000..55f8f43 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/sparc/v9.S @@ -0,0 +1,440 @@ +/* ----------------------------------------------------------------------- + v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. + + SPARC 64-bit Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include +#include "internal.h" + +#ifdef SPARC64 + +#define C2(X, Y) X ## Y +#define C1(X, Y) C2(X, Y) + +#ifdef __USER_LABEL_PREFIX__ +# define C(Y) C1(__USER_LABEL_PREFIX__, Y) +#else +# define C(Y) Y +#endif +#define L(Y) C1(.L, Y) + +#if defined(__sun__) && defined(__svr4__) +# define E(INDEX) .align 16 +#else +# define E(INDEX) .align 16; .org 2b + INDEX * 16 +#endif + +#define STACK_BIAS 2047 + + .text + .align 8 + .globl C(ffi_call_v9) + .type C(ffi_call_v9),#function + FFI_HIDDEN(C(ffi_call_v9)) + +C(ffi_call_v9): +.LUW0: + save %sp, %o4, %sp +.LUW1: + mov %i0, %o0 ! copy cif + add %sp, STACK_BIAS+128+48, %o1 ! load args area + mov %i2, %o2 ! copy rvalue + call C(ffi_prep_args_v9) + mov %i3, %o3 ! copy avalue + + andcc %o0, SPARC_FLAG_FP_ARGS, %g0 ! need fp regs? + add %sp, 48, %sp ! deallocate prep frame + be,pt %xcc, 1f + mov %o0, %l0 ! save flags + + ldd [%sp+STACK_BIAS+128], %f0 ! load all fp arg regs + ldd [%sp+STACK_BIAS+128+8], %f2 + ldd [%sp+STACK_BIAS+128+16], %f4 + ldd [%sp+STACK_BIAS+128+24], %f6 + ldd [%sp+STACK_BIAS+128+32], %f8 + ldd [%sp+STACK_BIAS+128+40], %f10 + ldd [%sp+STACK_BIAS+128+48], %f12 + ldd [%sp+STACK_BIAS+128+56], %f14 + ldd [%sp+STACK_BIAS+128+64], %f16 + ldd [%sp+STACK_BIAS+128+72], %f18 + ldd [%sp+STACK_BIAS+128+80], %f20 + ldd [%sp+STACK_BIAS+128+88], %f22 + ldd [%sp+STACK_BIAS+128+96], %f24 + ldd [%sp+STACK_BIAS+128+104], %f26 + ldd [%sp+STACK_BIAS+128+112], %f28 + ldd [%sp+STACK_BIAS+128+120], %f30 + +1: ldx [%sp+STACK_BIAS+128], %o0 ! load all int arg regs + ldx [%sp+STACK_BIAS+128+8], %o1 + ldx [%sp+STACK_BIAS+128+16], %o2 + ldx [%sp+STACK_BIAS+128+24], %o3 + ldx [%sp+STACK_BIAS+128+32], %o4 + ldx [%sp+STACK_BIAS+128+40], %o5 + call %i1 + mov %i5, %g5 ! load static chain + +0: call 1f ! load pc in %o7 + and %l0, SPARC_FLAG_RET_MASK, %l1 +1: sll %l1, 4, %l1 + add %o7, %l1, %o7 ! o7 = 0b + ret_type*16 + jmp %o7+(2f-0b) + nop + + .align 16 +2: +E(SPARC_RET_VOID) + return %i7+8 + nop +E(SPARC_RET_STRUCT) + add %sp, STACK_BIAS-64+128+48, %l2 + sub %sp, 64, %sp + b 8f + stx %o0, [%l2] +E(SPARC_RET_UINT8) + and %o0, 0xff, %i0 + return %i7+8 + stx %o0, [%o2] +E(SPARC_RET_SINT8) + sll %o0, 24, %o0 + sra %o0, 24, %i0 + return %i7+8 + stx %o0, [%o2] +E(SPARC_RET_UINT16) + sll %o0, 16, %o0 + srl %o0, 16, %i0 + return %i7+8 + stx %o0, [%o2] +E(SPARC_RET_SINT16) + sll %o0, 16, %o0 + sra %o0, 16, %i0 + return %i7+8 + stx %o0, [%o2] +E(SPARC_RET_UINT32) + srl %o0, 0, %i0 + return %i7+8 + stx %o0, [%o2] +E(SP_V9_RET_SINT32) + sra %o0, 0, %i0 + return %i7+8 + stx %o0, [%o2] +E(SPARC_RET_INT64) + stx %o0, [%i2] + return %i7+8 + nop +E(SPARC_RET_INT128) + stx %o0, [%i2] + stx %o1, [%i2+8] + return %i7+8 + nop +E(SPARC_RET_F_8) + st %f7, [%i2+7*4] + nop + st %f6, [%i2+6*4] + nop +E(SPARC_RET_F_6) + st %f5, [%i2+5*4] + nop + st %f4, [%i2+4*4] + nop +E(SPARC_RET_F_4) + std %f2, [%i2+2*4] + return %i7+8 + std %f0, [%o2] +E(SPARC_RET_F_2) + return %i7+8 + std %f0, [%o2] +E(SP_V9_RET_F_3) + st %f2, [%i2+2*4] + nop + st %f1, [%i2+1*4] + nop +E(SPARC_RET_F_1) + return %i7+8 + st %f0, [%o2] + + ! Finish the SPARC_RET_STRUCT sequence. + .align 8 +8: stx %o1, [%l2+8] + stx %o2, [%l2+16] + stx %o3, [%l2+24] + std %f0, [%l2+32] + std %f2, [%l2+40] + std %f4, [%l2+48] + std %f6, [%l2+56] + + ! Copy the structure into place. + srl %l0, SPARC_SIZEMASK_SHIFT, %o0 ! load size_mask + mov %i2, %o1 ! load dst + mov %l2, %o2 ! load src_gp + call C(ffi_struct_float_copy) + add %l2, 32, %o3 ! load src_fp + + return %i7+8 + nop + +.LUW2: + .size C(ffi_call_v9), . - C(ffi_call_v9) + + +#undef STACKFRAME +#define STACKFRAME 336 /* 16*8 register window + + 6*8 args backing store + + 20*8 locals */ +#define FP %fp+STACK_BIAS + +/* ffi_closure_v9(...) + + Receives the closure argument in %g1. */ + + .align 8 + .globl C(ffi_go_closure_v9) + .type C(ffi_go_closure_v9),#function + FFI_HIDDEN(C(ffi_go_closure_v9)) + +C(ffi_go_closure_v9): +.LUW3: + save %sp, -STACKFRAME, %sp +.LUW4: + ldx [%g5+8], %o0 + ldx [%g5+16], %o1 + b 0f + mov %g5, %o2 + +.LUW5: + .size C(ffi_go_closure_v9), . - C(ffi_go_closure_v9) + + .align 8 + .globl C(ffi_closure_v9) + .type C(ffi_closure_v9),#function + FFI_HIDDEN(C(ffi_closure_v9)) + +C(ffi_closure_v9): +.LUW6: + save %sp, -STACKFRAME, %sp +.LUW7: + ldx [%g1+FFI_TRAMPOLINE_SIZE], %o0 + ldx [%g1+FFI_TRAMPOLINE_SIZE+8], %o1 + ldx [%g1+FFI_TRAMPOLINE_SIZE+16], %o2 +0: + ! Store all of the potential argument registers in va_list format. + stx %i0, [FP+128+0] + stx %i1, [FP+128+8] + stx %i2, [FP+128+16] + stx %i3, [FP+128+24] + stx %i4, [FP+128+32] + stx %i5, [FP+128+40] + + ! Store possible floating point argument registers too. + std %f0, [FP-128] + std %f2, [FP-120] + std %f4, [FP-112] + std %f6, [FP-104] + std %f8, [FP-96] + std %f10, [FP-88] + std %f12, [FP-80] + std %f14, [FP-72] + std %f16, [FP-64] + std %f18, [FP-56] + std %f20, [FP-48] + std %f22, [FP-40] + std %f24, [FP-32] + std %f26, [FP-24] + std %f28, [FP-16] + std %f30, [FP-8] + + ! Call ffi_closure_sparc_inner to do the bulk of the work. + add %fp, STACK_BIAS-160, %o3 + add %fp, STACK_BIAS+128, %o4 + call C(ffi_closure_sparc_inner_v9) + add %fp, STACK_BIAS-128, %o5 + +0: call 1f ! load pc in %o7 + and %o0, SPARC_FLAG_RET_MASK, %o0 +1: sll %o0, 4, %o0 ! o2 = i2 * 16 + add %o7, %o0, %o7 ! o7 = 0b + i2*16 + jmp %o7+(2f-0b) + nop + + ! Note that we cannot load the data in the delay slot of + ! the return insn because the data is in the stack frame + ! that is deallocated by the return. + .align 16 +2: +E(SPARC_RET_VOID) + return %i7+8 + nop +E(SPARC_RET_STRUCT) + ldx [FP-160], %i0 + ldd [FP-160], %f0 + b 8f + ldx [FP-152], %i1 +E(SPARC_RET_UINT8) + ldub [FP-160+7], %i0 + return %i7+8 + nop +E(SPARC_RET_SINT8) + ldsb [FP-160+7], %i0 + return %i7+8 + nop +E(SPARC_RET_UINT16) + lduh [FP-160+6], %i0 + return %i7+8 + nop +E(SPARC_RET_SINT16) + ldsh [FP-160+6], %i0 + return %i7+8 + nop +E(SPARC_RET_UINT32) + lduw [FP-160+4], %i0 + return %i7+8 + nop +E(SP_V9_RET_SINT32) + ldsw [FP-160+4], %i0 + return %i7+8 + nop +E(SPARC_RET_INT64) + ldx [FP-160], %i0 + return %i7+8 + nop +E(SPARC_RET_INT128) + ldx [FP-160], %i0 + ldx [FP-160+8], %i1 + return %i7+8 + nop +E(SPARC_RET_F_8) + ld [FP-160+7*4], %f7 + nop + ld [FP-160+6*4], %f6 + nop +E(SPARC_RET_F_6) + ld [FP-160+5*4], %f5 + nop + ld [FP-160+4*4], %f4 + nop +E(SPARC_RET_F_4) + ldd [FP-160], %f0 + ldd [FP-160+8], %f2 + return %i7+8 + nop +E(SPARC_RET_F_2) + ldd [FP-160], %f0 + return %i7+8 + nop +E(SP_V9_RET_F_3) + ld [FP-160+2*4], %f2 + nop + ld [FP-160+1*4], %f1 + nop +E(SPARC_RET_F_1) + ld [FP-160], %f0 + return %i7+8 + nop + + ! Finish the SPARC_RET_STRUCT sequence. + .align 8 +8: ldd [FP-152], %f2 + ldx [FP-144], %i2 + ldd [FP-144], %f4 + ldx [FP-136], %i3 + ldd [FP-136], %f6 + return %i7+8 + nop + +.LUW8: + .size C(ffi_closure_v9), . - C(ffi_closure_v9) + +#ifdef HAVE_RO_EH_FRAME + .section ".eh_frame",#alloc +#else + .section ".eh_frame",#alloc,#write +#endif + +#ifdef HAVE_AS_SPARC_UA_PCREL +# define FDE_RANGE(B, E) .long %r_disp32(B), E - B +#else +# define FDE_RANGE(B, E) .align 8; .xword B, E - B +#endif + + .align 8 +.LCIE: + .long .LECIE - .LSCIE ! CIE Length +.LSCIE: + .long 0 ! CIE Identifier Tag + .byte 1 ! CIE Version + .ascii "zR\0" ! CIE Augmentation + .byte 4 ! CIE Code Alignment Factor + .byte 0x78 ! CIE Data Alignment Factor + .byte 15 ! CIE RA Column + .byte 1 ! Augmentation size +#ifdef HAVE_AS_SPARC_UA_PCREL + .byte 0x1b ! FDE Encoding (pcrel sdata4) +#else + .byte 0x50 ! FDE Encoding (aligned absolute) +#endif + .byte 0xc, 14, 0xff, 0xf ! DW_CFA_def_cfa, %o6, offset 0x7ff + .align 8 +.LECIE: + + .long .LEFDE1 - .LSFDE1 ! FDE Length +.LSFDE1: + .long .LSFDE1 - .LCIE ! FDE CIE offset + FDE_RANGE(.LUW0, .LUW2) + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 8 +.LEFDE1: + + .long .LEFDE2 - .LSFDE2 ! FDE Length +.LSFDE2: + .long .LSFDE2 - .LCIE ! FDE CIE offset + FDE_RANGE(.LUW3, .LUW5) + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 8 +.LEFDE2: + + .long .LEFDE3 - .LSFDE3 ! FDE Length +.LSFDE3: + .long .LSFDE3 - .LCIE ! FDE CIE offset + FDE_RANGE(.LUW6, .LUW8) + .byte 0 ! Augmentation size + .byte 0x40+1 ! DW_CFA_advance_loc 4 + .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 + .align 8 +.LEFDE3: + +#endif /* SPARC64 */ +#ifdef __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffi.c new file mode 100644 index 0000000..3a94469 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffi.c @@ -0,0 +1,355 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2012 Tilera Corp. + + TILE Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* The first 10 registers are used to pass arguments and return values. */ +#define NUM_ARG_REGS 10 + +/* Performs a raw function call with the given NUM_ARG_REGS register arguments + and the specified additional stack arguments (if any). */ +extern void ffi_call_tile(ffi_sarg reg_args[NUM_ARG_REGS], + const ffi_sarg *stack_args, + size_t stack_args_bytes, + void (*fnaddr)(void)) + FFI_HIDDEN; + +/* This handles the raw call from the closure stub, cleaning up the + parameters and delegating to ffi_closure_tile_inner. */ +extern void ffi_closure_tile(void) FFI_HIDDEN; + + +ffi_status +ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* We always allocate room for all registers. Even if we don't + use them as parameters, they get returned in the same array + as struct return values so we need to make room. */ + if (cif->bytes < NUM_ARG_REGS * FFI_SIZEOF_ARG) + cif->bytes = NUM_ARG_REGS * FFI_SIZEOF_ARG; + + if (cif->rtype->size > NUM_ARG_REGS * FFI_SIZEOF_ARG) + cif->flags = FFI_TYPE_STRUCT; + else + cif->flags = FFI_TYPE_INT; + + /* Nothing to do. */ + return FFI_OK; +} + + +static long +assign_to_ffi_arg(ffi_sarg *out, void *in, const ffi_type *type, + int write_to_reg) +{ + switch (type->type) + { + case FFI_TYPE_SINT8: + *out = *(SINT8 *)in; + return 1; + + case FFI_TYPE_UINT8: + *out = *(UINT8 *)in; + return 1; + + case FFI_TYPE_SINT16: + *out = *(SINT16 *)in; + return 1; + + case FFI_TYPE_UINT16: + *out = *(UINT16 *)in; + return 1; + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: +#ifndef __LP64__ + case FFI_TYPE_POINTER: +#endif + /* Note that even unsigned 32-bit quantities are sign extended + on tilegx when stored in a register. */ + *out = *(SINT32 *)in; + return 1; + + case FFI_TYPE_FLOAT: +#ifdef __tilegx__ + if (write_to_reg) + { + /* Properly sign extend the value. */ + union { float f; SINT32 s32; } val; + val.f = *(float *)in; + *out = val.s32; + } + else +#endif + { + *(float *)out = *(float *)in; + } + return 1; + + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_DOUBLE: +#ifdef __LP64__ + case FFI_TYPE_POINTER: +#endif + *(UINT64 *)out = *(UINT64 *)in; + return sizeof(UINT64) / FFI_SIZEOF_ARG; + + case FFI_TYPE_STRUCT: + memcpy(out, in, type->size); + return (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; + + case FFI_TYPE_VOID: + /* Must be a return type. Nothing to do. */ + return 0; + + default: + FFI_ASSERT(0); + return -1; + } +} + + +void +ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_sarg * const arg_mem = alloca(cif->bytes); + ffi_sarg * const reg_args = arg_mem; + ffi_sarg * const stack_args = ®_args[NUM_ARG_REGS]; + ffi_sarg *argp = arg_mem; + ffi_type ** const arg_types = cif->arg_types; + const long num_args = cif->nargs; + long i; + + if (cif->flags == FFI_TYPE_STRUCT) + { + /* Pass a hidden pointer to the return value. We make sure there + is scratch space for the callee to store the return value even if + our caller doesn't care about it. */ + *argp++ = (intptr_t)(rvalue ? rvalue : alloca(cif->rtype->size)); + + /* No more work needed to return anything. */ + rvalue = NULL; + } + + for (i = 0; i < num_args; i++) + { + ffi_type *type = arg_types[i]; + void * const arg_in = avalue[i]; + ptrdiff_t arg_word = argp - arg_mem; + +#ifndef __tilegx__ + /* Doubleword-aligned values are always in an even-number register + pair, or doubleword-aligned stack slot if out of registers. */ + long align = arg_word & (type->alignment > FFI_SIZEOF_ARG); + argp += align; + arg_word += align; +#endif + + if (type->type == FFI_TYPE_STRUCT) + { + const size_t arg_size_in_words = + (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; + + if (arg_word < NUM_ARG_REGS && + arg_word + arg_size_in_words > NUM_ARG_REGS) + { + /* Args are not allowed to span registers and the stack. */ + argp = stack_args; + } + + memcpy(argp, arg_in, type->size); + argp += arg_size_in_words; + } + else + { + argp += assign_to_ffi_arg(argp, arg_in, arg_types[i], 1); + } + } + + /* Actually do the call. */ + ffi_call_tile(reg_args, stack_args, + cif->bytes - (NUM_ARG_REGS * FFI_SIZEOF_ARG), fn); + + if (rvalue != NULL) + assign_to_ffi_arg(rvalue, reg_args, cif->rtype, 0); +} + + +/* Template code for closure. */ +extern const UINT64 ffi_template_tramp_tile[] FFI_HIDDEN; + + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ +#ifdef __tilegx__ + /* TILE-Gx */ + SINT64 c; + SINT64 h; + int s; + UINT64 *out; + + if (cif->abi != FFI_UNIX) + return FFI_BAD_ABI; + + out = (UINT64 *)closure->tramp; + + c = (intptr_t)closure; + h = (intptr_t)ffi_closure_tile; + s = 0; + + /* Find the smallest shift count that doesn't lose information + (i.e. no need to explicitly insert high bits of the address that + are just the sign extension of the low bits). */ + while ((c >> s) != (SINT16)(c >> s) || (h >> s) != (SINT16)(h >> s)) + s += 16; + +#define OPS(a, b, shift) \ + (create_Imm16_X0((a) >> (shift)) | create_Imm16_X1((b) >> (shift))) + + /* Emit the moveli. */ + *out++ = ffi_template_tramp_tile[0] | OPS(c, h, s); + for (s -= 16; s >= 0; s -= 16) + *out++ = ffi_template_tramp_tile[1] | OPS(c, h, s); + +#undef OPS + + *out++ = ffi_template_tramp_tile[2]; + +#else + /* TILEPro */ + UINT64 *out; + intptr_t delta; + + if (cif->abi != FFI_UNIX) + return FFI_BAD_ABI; + + out = (UINT64 *)closure->tramp; + delta = (intptr_t)ffi_closure_tile - (intptr_t)codeloc; + + *out++ = ffi_template_tramp_tile[0] | create_JOffLong_X1(delta >> 3); +#endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + invalidate_icache(closure->tramp, (char *)out - closure->tramp, + getpagesize()); + + return FFI_OK; +} + + +/* This is called by the assembly wrapper for closures. This does + all of the work. On entry reg_args[0] holds the values the registers + had when the closure was invoked. On return reg_args[1] holds the register + values to be returned to the caller (many of which may be garbage). */ +void FFI_HIDDEN +ffi_closure_tile_inner(ffi_closure *closure, + ffi_sarg reg_args[2][NUM_ARG_REGS], + ffi_sarg *stack_args) +{ + ffi_cif * const cif = closure->cif; + void ** const avalue = alloca(cif->nargs * sizeof(void *)); + void *rvalue; + ffi_type ** const arg_types = cif->arg_types; + ffi_sarg * const reg_args_in = reg_args[0]; + ffi_sarg * const reg_args_out = reg_args[1]; + ffi_sarg * argp; + long i, arg_word, nargs = cif->nargs; + /* Use a union to guarantee proper alignment for double. */ + union { ffi_sarg arg[NUM_ARG_REGS]; double d; UINT64 u64; } closure_ret; + + /* Start out reading register arguments. */ + argp = reg_args_in; + + /* Copy the caller's structure return address to that the closure + returns the data directly to the caller. */ + if (cif->flags == FFI_TYPE_STRUCT) + { + /* Return by reference via hidden pointer. */ + rvalue = (void *)(intptr_t)*argp++; + arg_word = 1; + } + else + { + /* Return the value in registers. */ + rvalue = &closure_ret; + arg_word = 0; + } + + /* Grab the addresses of the arguments. */ + for (i = 0; i < nargs; i++) + { + ffi_type * const type = arg_types[i]; + const size_t arg_size_in_words = + (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; + +#ifndef __tilegx__ + /* Doubleword-aligned values are always in an even-number register + pair, or doubleword-aligned stack slot if out of registers. */ + long align = arg_word & (type->alignment > FFI_SIZEOF_ARG); + argp += align; + arg_word += align; +#endif + + if (arg_word == NUM_ARG_REGS || + (arg_word < NUM_ARG_REGS && + arg_word + arg_size_in_words > NUM_ARG_REGS)) + { + /* Switch to reading arguments from the stack. */ + argp = stack_args; + arg_word = NUM_ARG_REGS; + } + + avalue[i] = argp; + argp += arg_size_in_words; + arg_word += arg_size_in_words; + } + + /* Invoke the closure. */ + closure->fun(cif, rvalue, avalue, closure->user_data); + + if (cif->flags != FFI_TYPE_STRUCT) + { + /* Canonicalize for register representation. */ + assign_to_ffi_arg(reg_args_out, &closure_ret, cif->rtype, 1); + } +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffitarget.h new file mode 100644 index 0000000..679fb5d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/ffitarget.h @@ -0,0 +1,65 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Tilera Corp. + Target configuration macros for TILE. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM + +#include + +typedef uint_reg_t ffi_arg; +typedef int_reg_t ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_UNIX, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_UNIX +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ +#define FFI_CLOSURES 1 + +#ifdef __tilegx__ +/* We always pass 8-byte values, even in -m32 mode. */ +# define FFI_SIZEOF_ARG 8 +# ifdef __LP64__ +# define FFI_TRAMPOLINE_SIZE (8 * 5) /* 5 bundles */ +# else +# define FFI_TRAMPOLINE_SIZE (8 * 3) /* 3 bundles */ +# endif +#else +# define FFI_SIZEOF_ARG 4 +# define FFI_TRAMPOLINE_SIZE 8 /* 1 bundle */ +#endif +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/tile.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/tile.S new file mode 100644 index 0000000..d1f82cb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/tile/tile.S @@ -0,0 +1,360 @@ +/* ----------------------------------------------------------------------- + tile.S - Copyright (c) 2011 Tilera Corp. + + Tilera TILEPro and TILE-Gx Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +/* Number of bytes in a register. */ +#define REG_SIZE FFI_SIZEOF_ARG + +/* Number of bytes in stack linkage area for backtracing. + + A note about the ABI: on entry to a procedure, sp points to a stack + slot where it must spill the return address if it's not a leaf. + REG_SIZE bytes beyond that is a slot owned by the caller which + contains the sp value that the caller had when it was originally + entered (i.e. the caller's frame pointer). */ +#define LINKAGE_SIZE (2 * REG_SIZE) + +/* The first 10 registers are used to pass arguments and return values. */ +#define NUM_ARG_REGS 10 + +#ifdef __tilegx__ +#define SW st +#define LW ld +#define BGZT bgtzt +#else +#define SW sw +#define LW lw +#define BGZT bgzt +#endif + + +/* void ffi_call_tile (int_reg_t reg_args[NUM_ARG_REGS], + const int_reg_t *stack_args, + unsigned long stack_args_bytes, + void (*fnaddr)(void)); + + On entry, REG_ARGS contain the outgoing register values, + and STACK_ARGS contains STACK_ARG_BYTES of additional values + to be passed on the stack. If STACK_ARG_BYTES is zero, then + STACK_ARGS is ignored. + + When the invoked function returns, the values of r0-r9 are + blindly stored back into REG_ARGS for the caller to examine. */ + + .section .text.ffi_call_tile, "ax", @progbits + .align 8 + .globl ffi_call_tile + FFI_HIDDEN(ffi_call_tile) +ffi_call_tile: + +/* Incoming arguments. */ +#define REG_ARGS r0 +#define INCOMING_STACK_ARGS r1 +#define STACK_ARG_BYTES r2 +#define ORIG_FNADDR r3 + +/* Temporary values. */ +#define FRAME_SIZE r10 +#define TMP r11 +#define TMP2 r12 +#define OUTGOING_STACK_ARGS r13 +#define REG_ADDR_PTR r14 +#define RETURN_REG_ADDR r15 +#define FNADDR r16 + + .cfi_startproc + { + /* Save return address. */ + SW sp, lr + .cfi_offset lr, 0 + /* Prepare to spill incoming r52. */ + addi TMP, sp, -REG_SIZE + /* Increase frame size to have room to spill r52 and REG_ARGS. + The +7 is to round up mod 8. */ + addi FRAME_SIZE, STACK_ARG_BYTES, \ + REG_SIZE + REG_SIZE + LINKAGE_SIZE + 7 + } + { + /* Round stack frame size to a multiple of 8 to satisfy ABI. */ + andi FRAME_SIZE, FRAME_SIZE, -8 + /* Compute where to spill REG_ARGS value. */ + addi TMP2, sp, -(REG_SIZE * 2) + } + { + /* Spill incoming r52. */ + SW TMP, r52 + .cfi_offset r52, -REG_SIZE + /* Set up our frame pointer. */ + move r52, sp + .cfi_def_cfa_register r52 + /* Push stack frame. */ + sub sp, sp, FRAME_SIZE + } + { + /* Prepare to set up stack linkage. */ + addi TMP, sp, REG_SIZE + /* Prepare to memcpy stack args. */ + addi OUTGOING_STACK_ARGS, sp, LINKAGE_SIZE + /* Save REG_ARGS which we will need after we call the subroutine. */ + SW TMP2, REG_ARGS + } + { + /* Set up linkage info to hold incoming stack pointer. */ + SW TMP, r52 + } + { + /* Skip stack args memcpy if we don't have any stack args (common). */ + blezt STACK_ARG_BYTES, .Ldone_stack_args_memcpy + } + +.Lmemcpy_stack_args: + { + /* Load incoming argument from stack_args. */ + LW TMP, INCOMING_STACK_ARGS + addi INCOMING_STACK_ARGS, INCOMING_STACK_ARGS, REG_SIZE + } + { + /* Store stack argument into outgoing stack argument area. */ + SW OUTGOING_STACK_ARGS, TMP + addi OUTGOING_STACK_ARGS, OUTGOING_STACK_ARGS, REG_SIZE + addi STACK_ARG_BYTES, STACK_ARG_BYTES, -REG_SIZE + } + { + BGZT STACK_ARG_BYTES, .Lmemcpy_stack_args + } +.Ldone_stack_args_memcpy: + + { + /* Copy aside ORIG_FNADDR so we can overwrite its register. */ + move FNADDR, ORIG_FNADDR + /* Prepare to load argument registers. */ + addi REG_ADDR_PTR, r0, REG_SIZE + /* Load outgoing r0. */ + LW r0, r0 + } + + /* Load up argument registers from the REG_ARGS array. */ +#define LOAD_REG(REG, PTR) \ + { \ + LW REG, PTR ; \ + addi PTR, PTR, REG_SIZE \ + } + + LOAD_REG(r1, REG_ADDR_PTR) + LOAD_REG(r2, REG_ADDR_PTR) + LOAD_REG(r3, REG_ADDR_PTR) + LOAD_REG(r4, REG_ADDR_PTR) + LOAD_REG(r5, REG_ADDR_PTR) + LOAD_REG(r6, REG_ADDR_PTR) + LOAD_REG(r7, REG_ADDR_PTR) + LOAD_REG(r8, REG_ADDR_PTR) + LOAD_REG(r9, REG_ADDR_PTR) + + { + /* Call the subroutine. */ + jalr FNADDR + } + + { + /* Restore original lr. */ + LW lr, r52 + /* Prepare to recover ARGS, which we spilled earlier. */ + addi TMP, r52, -(2 * REG_SIZE) + } + { + /* Restore ARGS, so we can fill it in with the return regs r0-r9. */ + LW RETURN_REG_ADDR, TMP + /* Prepare to restore original r52. */ + addi TMP, r52, -REG_SIZE + } + + { + /* Pop stack frame. */ + move sp, r52 + /* Restore original r52. */ + LW r52, TMP + } + +#define STORE_REG(REG, PTR) \ + { \ + SW PTR, REG ; \ + addi PTR, PTR, REG_SIZE \ + } + + /* Return all register values by reference. */ + STORE_REG(r0, RETURN_REG_ADDR) + STORE_REG(r1, RETURN_REG_ADDR) + STORE_REG(r2, RETURN_REG_ADDR) + STORE_REG(r3, RETURN_REG_ADDR) + STORE_REG(r4, RETURN_REG_ADDR) + STORE_REG(r5, RETURN_REG_ADDR) + STORE_REG(r6, RETURN_REG_ADDR) + STORE_REG(r7, RETURN_REG_ADDR) + STORE_REG(r8, RETURN_REG_ADDR) + STORE_REG(r9, RETURN_REG_ADDR) + + { + jrp lr + } + + .cfi_endproc + .size ffi_call_tile, .-ffi_call_tile + +/* ffi_closure_tile(...) + + On entry, lr points to the closure plus 8 bytes, and r10 + contains the actual return address. + + This function simply dumps all register parameters into a stack array + and passes the closure, the registers array, and the stack arguments + to C code that does all of the actual closure processing. */ + + .section .text.ffi_closure_tile, "ax", @progbits + .align 8 + .globl ffi_closure_tile + FFI_HIDDEN(ffi_closure_tile) + + .cfi_startproc +/* Room to spill all NUM_ARG_REGS incoming registers, plus frame linkage. */ +#define CLOSURE_FRAME_SIZE (((NUM_ARG_REGS * REG_SIZE * 2 + LINKAGE_SIZE) + 7) & -8) +ffi_closure_tile: + { +#ifdef __tilegx__ + st sp, lr + .cfi_offset lr, 0 +#else + /* Save return address (in r10 due to closure stub wrapper). */ + SW sp, r10 + .cfi_return_column r10 + .cfi_offset r10, 0 +#endif + /* Compute address for stack frame linkage. */ + addli r10, sp, -(CLOSURE_FRAME_SIZE - REG_SIZE) + } + { + /* Save incoming stack pointer in linkage area. */ + SW r10, sp + .cfi_offset sp, -(CLOSURE_FRAME_SIZE - REG_SIZE) + /* Push a new stack frame. */ + addli sp, sp, -CLOSURE_FRAME_SIZE + .cfi_adjust_cfa_offset CLOSURE_FRAME_SIZE + } + + { + /* Create pointer to where to start spilling registers. */ + addi r10, sp, LINKAGE_SIZE + } + + /* Spill all the incoming registers. */ + STORE_REG(r0, r10) + STORE_REG(r1, r10) + STORE_REG(r2, r10) + STORE_REG(r3, r10) + STORE_REG(r4, r10) + STORE_REG(r5, r10) + STORE_REG(r6, r10) + STORE_REG(r7, r10) + STORE_REG(r8, r10) + { + /* Save r9. */ + SW r10, r9 +#ifdef __tilegx__ + /* Pointer to closure is passed in r11. */ + move r0, r11 +#else + /* Compute pointer to the closure object. Because the closure + starts with a "jal ffi_closure_tile", we can just take the + value of lr (a phony return address pointing into the closure) + and subtract 8. */ + addi r0, lr, -8 +#endif + /* Compute a pointer to the register arguments we just spilled. */ + addi r1, sp, LINKAGE_SIZE + } + { + /* Compute a pointer to the extra stack arguments (if any). */ + addli r2, sp, CLOSURE_FRAME_SIZE + LINKAGE_SIZE + /* Call C code to deal with all of the grotty details. */ + jal ffi_closure_tile_inner + } + { + addli r10, sp, CLOSURE_FRAME_SIZE + } + { + /* Restore the return address. */ + LW lr, r10 + /* Compute pointer to registers array. */ + addli r10, sp, LINKAGE_SIZE + (NUM_ARG_REGS * REG_SIZE) + } + /* Return all the register values, which C code may have set. */ + LOAD_REG(r0, r10) + LOAD_REG(r1, r10) + LOAD_REG(r2, r10) + LOAD_REG(r3, r10) + LOAD_REG(r4, r10) + LOAD_REG(r5, r10) + LOAD_REG(r6, r10) + LOAD_REG(r7, r10) + LOAD_REG(r8, r10) + LOAD_REG(r9, r10) + { + /* Pop the frame. */ + addli sp, sp, CLOSURE_FRAME_SIZE + jrp lr + } + + .cfi_endproc + .size ffi_closure_tile, . - ffi_closure_tile + + +/* What follows are code template instructions that get copied to the + closure trampoline by ffi_prep_closure_loc. The zeroed operands + get replaced by their proper values at runtime. */ + + .section .text.ffi_template_tramp_tile, "ax", @progbits + .align 8 + .globl ffi_template_tramp_tile + FFI_HIDDEN(ffi_template_tramp_tile) +ffi_template_tramp_tile: +#ifdef __tilegx__ + { + moveli r11, 0 /* backpatched to address of containing closure. */ + moveli r10, 0 /* backpatched to ffi_closure_tile. */ + } + /* Note: the following bundle gets generated multiple times + depending on the pointer value (esp. useful for -m32 mode). */ + { shl16insli r11, r11, 0 ; shl16insli r10, r10, 0 } + { info 2+8 /* for backtracer: -> pc in lr, frame size 0 */ ; jr r10 } +#else + /* 'jal .' yields a PC-relative offset of zero so we can OR in the + right offset at runtime. */ + { move r10, lr ; jal . /* ffi_closure_tile */ } +#endif + + .size ffi_template_tramp_tile, . - ffi_template_tramp_tile diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/types.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/types.c new file mode 100644 index 0000000..9ec27f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/types.c @@ -0,0 +1,108 @@ +/* ----------------------------------------------------------------------- + types.c - Copyright (c) 1996, 1998 Red Hat, Inc. + + Predefined ffi_types needed by libffi. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* Hide the basic type definitions from the header file, so that we + can redefine them here as "const". */ +#define LIBFFI_HIDE_BASIC_TYPES + +#include +#include + +/* Type definitions */ + +#define FFI_TYPEDEF(name, type, id, maybe_const)\ +struct struct_align_##name { \ + char c; \ + type x; \ +}; \ +FFI_EXTERN \ +maybe_const ffi_type ffi_type_##name = { \ + sizeof(type), \ + offsetof(struct struct_align_##name, x), \ + id, NULL \ +} + +#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ +static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ +}; \ +struct struct_align_complex_##name { \ + char c; \ + _Complex type x; \ +}; \ +FFI_EXTERN \ +maybe_const ffi_type ffi_type_complex_##name = { \ + sizeof(_Complex type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ +} + +/* Size and alignment are fake here. They must not be 0. */ +FFI_EXTERN const ffi_type ffi_type_void = { + 1, 1, FFI_TYPE_VOID, NULL +}; + +FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8, const); +FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8, const); +FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16, const); +FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16, const); +FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32, const); +FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32, const); +FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64, const); +FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64, const); + +FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER, const); + +FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT, const); +FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const); + +#if !defined HAVE_LONG_DOUBLE_VARIANT || defined __alpha__ +#define FFI_LDBL_CONST const +#else +#define FFI_LDBL_CONST +#endif + +#ifdef __alpha__ +/* Even if we're not configured to default to 128-bit long double, + maintain binary compatibility, as -mlong-double-128 can be used + at any time. */ +/* Validate the hard-coded number below. */ +# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; +#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); +#endif + +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE +FFI_COMPLEX_TYPEDEF(float, float, const); +FFI_COMPLEX_TYPEDEF(double, double, const); +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); +#endif +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/elfbsd.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/elfbsd.S new file mode 100644 index 0000000..01ca313 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/elfbsd.S @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * vax Foreign Function Interface + */ + +#define LIBFFI_ASM +#include +#include + + .text + +/* + * void * %r0 + * ffi_call_elfbsd(extended_cif *ecif, 4(%ap) + * unsigned bytes, 8(%ap) + * unsigned flags, 12(%ap) + * void *rvalue, 16(%ap) + * void (*fn)()); 20(%ap) + */ + .globl ffi_call_elfbsd + .type ffi_call_elfbsd,@function + .align 2 +ffi_call_elfbsd: + .word 0x00c # save R2 and R3 + + # Allocate stack space for the args + subl2 8(%ap), %sp + + # Call ffi_prep_args + pushl %sp + pushl 4(%ap) + calls $2, ffi_prep_args + + # Get function pointer + movl 20(%ap), %r1 + + # Build a CALLS frame + ashl $-2, 8(%ap), %r0 + pushl %r0 # argument stack usage + movl %sp, %r0 # future %ap + # saved registers + bbc $11, 0(%r1), 1f + pushl %r11 +1: bbc $10, 0(%r1), 1f + pushl %r10 +1: bbc $9, 0(%r1), 1f + pushl %r9 +1: bbc $8, 0(%r1), 1f + pushl %r8 +1: bbc $7, 0(%r1), 1f + pushl %r7 +1: bbc $6, 0(%r1), 1f + pushl %r6 +1: bbc $5, 0(%r1), 1f + pushl %r5 +1: bbc $4, 0(%r1), 1f + pushl %r4 +1: bbc $3, 0(%r1), 1f + pushl %r3 +1: bbc $2, 0(%r1), 1f + pushl %r2 +1: + pushal 9f + pushl %fp + pushl %ap + movl 16(%ap), %r3 # struct return address, if needed + movl %r0, %ap + movzwl 4(%fp), %r0 # previous PSW, without the saved registers mask + bisl2 $0x20000000, %r0 # calls frame + movzwl 0(%r1), %r2 + bicw2 $0xf003, %r2 # only keep R11-R2 + ashl $16, %r2, %r2 + bisl2 %r2, %r0 # saved register mask of the called function + pushl %r0 + pushl $0 + movl %sp, %fp + + # Invoke the function + pushal 2(%r1) # skip procedure entry mask + movl %r3, %r1 + bicpsw $0x000f + rsb + +9: + # Copy return value if necessary + tstl 16(%ap) + jeql 9f + movl 16(%ap), %r2 + + bbc $0, 12(%ap), 1f # CIF_FLAGS_CHAR + movb %r0, 0(%r2) + brb 9f +1: + bbc $1, 12(%ap), 1f # CIF_FLAGS_SHORT + movw %r0, 0(%r2) + brb 9f +1: + bbc $2, 12(%ap), 1f # CIF_FLAGS_INT + movl %r0, 0(%r2) + brb 9f +1: + bbc $3, 12(%ap), 1f # CIF_FLAGS_DINT + movq %r0, 0(%r2) + brb 9f +1: + movl %r1, %r0 # might have been a struct + #brb 9f + +9: + ret + +/* + * ffi_closure_elfbsd(void); + * invoked with %r0: ffi_closure *closure + */ + .globl ffi_closure_elfbsd + .type ffi_closure_elfbsd, @function + .align 2 +ffi_closure_elfbsd: + .word 0 + + # Allocate room on stack for return value + subl2 $8, %sp + + # Invoke the closure function + pushal 4(%ap) # calling stack + pushal 4(%sp) # return value + pushl %r0 # closure + calls $3, ffi_closure_elfbsd_inner + + # Copy return value if necessary + bitb $1, %r0 # CIF_FLAGS_CHAR + beql 1f + movb 0(%sp), %r0 + brb 9f +1: + bitb $2, %r0 # CIF_FLAGS_SHORT + beql 1f + movw 0(%sp), %r0 + brb 9f +1: + bitb $4, %r0 # CIF_FLAGS_INT + beql 1f + movl 0(%sp), %r0 + brb 9f +1: + bitb $8, %r0 # CIF_FLAGS_DINT + beql 1f + movq 0(%sp), %r0 + #brb 9f +1: + +9: + ret + +/* + * ffi_closure_struct_elfbsd(void); + * invoked with %r0: ffi_closure *closure + * %r1: struct return address + */ + .globl ffi_closure_struct_elfbsd + .type ffi_closure_struct_elfbsd, @function + .align 2 +ffi_closure_struct_elfbsd: + .word 0 + + # Invoke the closure function + pushal 4(%ap) # calling stack + pushl %r1 # return value + pushl %r0 # closure + calls $3, ffi_closure_elfbsd_inner + + ret diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffi.c new file mode 100644 index 0000000..e52caec --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffi.c @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * vax Foreign Function Interface + * + * This file attempts to provide all the FFI entry points which can reliably + * be implemented in C. + */ + +#include +#include + +#include +#include + +#define CIF_FLAGS_CHAR 1 /* for struct only */ +#define CIF_FLAGS_SHORT 2 /* for struct only */ +#define CIF_FLAGS_INT 4 +#define CIF_FLAGS_DINT 8 + +/* + * Foreign Function Interface API + */ + +void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *, + void (*) ()); +void *ffi_prep_args (extended_cif *ecif, void *stack); + +void * +ffi_prep_args (extended_cif *ecif, void *stack) +{ + unsigned int i; + void **p_argv; + char *argp; + ffi_type **p_arg; + void *struct_value_ptr; + + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT + && !ecif->cif->flags) + struct_value_ptr = ecif->rvalue; + else + struct_value_ptr = NULL; + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + i != 0; + i--, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof (int)) + { + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; + break; + + case FFI_TYPE_STRUCT: + memcpy (argp, *p_argv, z); + break; + + default: + FFI_ASSERT (0); + } + z = sizeof (int); + } + else + { + memcpy (argp, *p_argv, z); + + /* Align if necessary. */ + if ((sizeof(int) - 1) & z) + z = FFI_ALIGN(z, sizeof(int)); + } + + p_argv++; + argp += z; + } + + return struct_value_ptr; +} + +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + cif->flags = 0; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT && + cif->rtype->elements[1]) + { + cif->flags = 0; + break; + } + + if (cif->rtype->size == sizeof (char)) + cif->flags = CIF_FLAGS_CHAR; + else if (cif->rtype->size == sizeof (short)) + cif->flags = CIF_FLAGS_SHORT; + else if (cif->rtype->size == sizeof (int)) + cif->flags = CIF_FLAGS_INT; + else if (cif->rtype->size == 2 * sizeof (int)) + cif->flags = CIF_FLAGS_DINT; + else + cif->flags = 0; + break; + + default: + if (cif->rtype->size <= sizeof (int)) + cif->flags = CIF_FLAGS_INT; + else + cif->flags = CIF_FLAGS_DINT; + break; + } + + return FFI_OK; +} + +void +ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return value + address then we need to make one. */ + + if (rvalue == NULL + && cif->rtype->type == FFI_TYPE_STRUCT + && cif->flags == 0) + ecif.rvalue = alloca (cif->rtype->size); + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_ELFBSD: + ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT (0); + break; + } +} + +/* + * Closure API + */ + +void ffi_closure_elfbsd (void); +void ffi_closure_struct_elfbsd (void); +unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *); + +static void +ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp) +{ + unsigned int i; + void **p_argv; + ffi_type **p_arg; + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + *p_argv = stackp; + + /* Align if necessary */ + if ((sizeof (int) - 1) & z) + z = FFI_ALIGN(z, sizeof (int)); + + p_argv++; + stackp += z; + } +} + +unsigned int +ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack) +{ + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void **) alloca (cif->nargs * sizeof (void *)); + + ffi_prep_closure_elfbsd (cif, arg_area, stack); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + return cif->flags; +} + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, + void (*fun)(ffi_cif *, void *, void **, void *), + void *user_data, void *codeloc) +{ + char *tramp = (char *) codeloc; + void *fn; + + FFI_ASSERT (cif->abi == FFI_ELFBSD); + + /* entry mask */ + *(unsigned short *)(tramp + 0) = 0x0000; + /* movl #closure, r0 */ + tramp[2] = 0xd0; + tramp[3] = 0x8f; + *(unsigned int *)(tramp + 4) = (unsigned int) closure; + tramp[8] = 0x50; + + if (cif->rtype->type == FFI_TYPE_STRUCT + && !cif->flags) + fn = &ffi_closure_struct_elfbsd; + else + fn = &ffi_closure_elfbsd; + + /* jmpl #fn */ + tramp[9] = 0x17; + tramp[10] = 0xef; + *(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 - + (unsigned int)tramp - 9 - 6; + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffitarget.h new file mode 100644 index 0000000..2fc9488 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/vax/ffitarget.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2013 Miodrag Vallat. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * vax Foreign Function Interface + */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_ELFBSD, + FFI_DEFAULT_ABI = FFI_ELFBSD, + FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 15 +#define FFI_NATIVE_RAW_API 0 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/asmnames.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/asmnames.h new file mode 100644 index 0000000..7551021 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/asmnames.h @@ -0,0 +1,30 @@ +#ifndef ASMNAMES_H +#define ASMNAMES_H + +#define C2(X, Y) X ## Y +#define C1(X, Y) C2(X, Y) +#ifdef __USER_LABEL_PREFIX__ +# define C(X) C1(__USER_LABEL_PREFIX__, X) +#else +# define C(X) X +#endif + +#ifdef __APPLE__ +# define L(X) C1(L, X) +#else +# define L(X) C1(.L, X) +#endif + +#if defined(__ELF__) && defined(__PIC__) +# define PLT(X) X@PLT +#else +# define PLT(X) X +#endif + +#ifdef __ELF__ +# define ENDF(X) .type X,@function; .size X, . - X +#else +# define ENDF(X) +#endif + +#endif /* ASMNAMES_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi.c new file mode 100644 index 0000000..5f7fd81 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi.c @@ -0,0 +1,770 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2017 Anthony Green + Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc. + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2002 Bo Thorsen + Copyright (c) 2002 Roger Sayle + Copyright (C) 2008, 2010 Free Software Foundation, Inc. + + x86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if defined(__i386__) || defined(_M_IX86) +#include +#include +#include +#include +#include "internal.h" + +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 80-bit type. */ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + +#if defined(__GNUC__) && !defined(__declspec) +# define __declspec(x) __attribute__((x)) +#endif + +#if defined(_MSC_VER) && defined(_M_IX86) +/* Stack is not 16-byte aligned on Windows. */ +#define STACK_ALIGN(bytes) (bytes) +#else +#define STACK_ALIGN(bytes) FFI_ALIGN (bytes, 16) +#endif + +/* Perform machine dependent cif processing. */ +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep(ffi_cif *cif) +{ + size_t bytes = 0; + int i, n, flags, cabi = cif->abi; + + switch (cabi) + { + case FFI_SYSV: + case FFI_STDCALL: + case FFI_THISCALL: + case FFI_FASTCALL: + case FFI_MS_CDECL: + case FFI_PASCAL: + case FFI_REGISTER: + break; + default: + return FFI_BAD_ABI; + } + + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + flags = X86_RET_VOID; + break; + case FFI_TYPE_FLOAT: + flags = X86_RET_FLOAT; + break; + case FFI_TYPE_DOUBLE: + flags = X86_RET_DOUBLE; + break; + case FFI_TYPE_LONGDOUBLE: + flags = X86_RET_LDOUBLE; + break; + case FFI_TYPE_UINT8: + flags = X86_RET_UINT8; + break; + case FFI_TYPE_UINT16: + flags = X86_RET_UINT16; + break; + case FFI_TYPE_SINT8: + flags = X86_RET_SINT8; + break; + case FFI_TYPE_SINT16: + flags = X86_RET_SINT16; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + flags = X86_RET_INT32; + break; + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + flags = X86_RET_INT64; + break; + case FFI_TYPE_STRUCT: +#ifndef X86 + /* ??? This should be a different ABI rather than an ifdef. */ + if (cif->rtype->size == 1) + flags = X86_RET_STRUCT_1B; + else if (cif->rtype->size == 2) + flags = X86_RET_STRUCT_2B; + else if (cif->rtype->size == 4) + flags = X86_RET_INT32; + else if (cif->rtype->size == 8) + flags = X86_RET_INT64; + else +#endif + { + do_struct: + switch (cabi) + { + case FFI_THISCALL: + case FFI_FASTCALL: + case FFI_STDCALL: + case FFI_MS_CDECL: + flags = X86_RET_STRUCTARG; + break; + default: + flags = X86_RET_STRUCTPOP; + break; + } + /* Allocate space for return value pointer. */ + bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG); + } + break; + case FFI_TYPE_COMPLEX: + switch (cif->rtype->elements[0]->type) + { + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + goto do_struct; + case FFI_TYPE_FLOAT: + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + flags = X86_RET_INT64; + break; + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + flags = X86_RET_INT32; + break; + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + flags = X86_RET_STRUCT_2B; + break; + default: + return FFI_BAD_TYPEDEF; + } + break; + default: + return FFI_BAD_TYPEDEF; + } + cif->flags = flags; + + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *t = cif->arg_types[i]; + + bytes = FFI_ALIGN (bytes, t->alignment); + bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG); + } + cif->bytes = bytes; + + return FFI_OK; +} + +static ffi_arg +extend_basic_type(void *arg, int type) +{ + switch (type) + { + case FFI_TYPE_SINT8: + return *(SINT8 *)arg; + case FFI_TYPE_UINT8: + return *(UINT8 *)arg; + case FFI_TYPE_SINT16: + return *(SINT16 *)arg; + case FFI_TYPE_UINT16: + return *(UINT16 *)arg; + + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_POINTER: + case FFI_TYPE_FLOAT: + return *(UINT32 *)arg; + + default: + abort(); + } +} + +struct call_frame +{ + void *ebp; /* 0 */ + void *retaddr; /* 4 */ + void (*fn)(void); /* 8 */ + int flags; /* 12 */ + void *rvalue; /* 16 */ + unsigned regs[3]; /* 20-28 */ +}; + +struct abi_params +{ + int dir; /* parameter growth direction */ + int static_chain; /* the static chain register used by gcc */ + int nregs; /* number of register parameters */ + int regs[3]; +}; + +static const struct abi_params abi_params[FFI_LAST_ABI] = { + [FFI_SYSV] = { 1, R_ECX, 0 }, + [FFI_THISCALL] = { 1, R_EAX, 1, { R_ECX } }, + [FFI_FASTCALL] = { 1, R_EAX, 2, { R_ECX, R_EDX } }, + [FFI_STDCALL] = { 1, R_ECX, 0 }, + [FFI_PASCAL] = { -1, R_ECX, 0 }, + /* ??? No defined static chain; gcc does not support REGISTER. */ + [FFI_REGISTER] = { -1, R_ECX, 3, { R_EAX, R_EDX, R_ECX } }, + [FFI_MS_CDECL] = { 1, R_ECX, 0 } +}; + +#ifdef HAVE_FASTCALL + #ifdef _MSC_VER + #define FFI_DECLARE_FASTCALL __fastcall + #else + #define FFI_DECLARE_FASTCALL __declspec(fastcall) + #endif +#else + #define FFI_DECLARE_FASTCALL +#endif + +extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; + +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + size_t rsize, bytes; + struct call_frame *frame; + char *stack, *argp; + ffi_type **arg_types; + int flags, cabi, i, n, dir, narg_reg; + const struct abi_params *pabi; + + flags = cif->flags; + cabi = cif->abi; + pabi = &abi_params[cabi]; + dir = pabi->dir; + + rsize = 0; + if (rvalue == NULL) + { + switch (flags) + { + case X86_RET_FLOAT: + case X86_RET_DOUBLE: + case X86_RET_LDOUBLE: + case X86_RET_STRUCTPOP: + case X86_RET_STRUCTARG: + /* The float cases need to pop the 387 stack. + The struct cases need to pass a valid pointer to the callee. */ + rsize = cif->rtype->size; + break; + default: + /* We can pretend that the callee returns nothing. */ + flags = X86_RET_VOID; + break; + } + } + + bytes = STACK_ALIGN (cif->bytes); + stack = alloca(bytes + sizeof(*frame) + rsize); + argp = (dir < 0 ? stack + bytes : stack); + frame = (struct call_frame *)(stack + bytes); + if (rsize) + rvalue = frame + 1; + + frame->fn = fn; + frame->flags = flags; + frame->rvalue = rvalue; + frame->regs[pabi->static_chain] = (unsigned)closure; + + narg_reg = 0; + switch (flags) + { + case X86_RET_STRUCTARG: + /* The pointer is passed as the first argument. */ + if (pabi->nregs > 0) + { + frame->regs[pabi->regs[0]] = (unsigned)rvalue; + narg_reg = 1; + break; + } + /* fallthru */ + case X86_RET_STRUCTPOP: + *(void **)argp = rvalue; + argp += sizeof(void *); + break; + } + + arg_types = cif->arg_types; + for (i = 0, n = cif->nargs; i < n; i++) + { + ffi_type *ty = arg_types[i]; + void *valp = avalue[i]; + size_t z = ty->size; + int t = ty->type; + + if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT) + { + ffi_arg val = extend_basic_type (valp, t); + + if (t != FFI_TYPE_FLOAT && narg_reg < pabi->nregs) + frame->regs[pabi->regs[narg_reg++]] = val; + else if (dir < 0) + { + argp -= 4; + *(ffi_arg *)argp = val; + } + else + { + *(ffi_arg *)argp = val; + argp += 4; + } + } + else + { + size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG); + size_t align = FFI_SIZEOF_ARG; + + /* Issue 434: For thiscall and fastcall, if the paramter passed + as 64-bit integer or struct, all following integer parameters + will be passed on stack. */ + if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) + && (t == FFI_TYPE_SINT64 + || t == FFI_TYPE_UINT64 + || t == FFI_TYPE_STRUCT)) + narg_reg = 2; + + /* Alignment rules for arguments are quite complex. Vectors and + structures with 16 byte alignment get it. Note that long double + on Darwin does have 16 byte alignment, and does not get this + alignment if passed directly; a structure with a long double + inside, however, would get 16 byte alignment. Since libffi does + not support vectors, we need non concern ourselves with other + cases. */ + if (t == FFI_TYPE_STRUCT && ty->alignment >= 16) + align = 16; + + if (dir < 0) + { + /* ??? These reverse argument ABIs are probably too old + to have cared about alignment. Someone should check. */ + argp -= za; + memcpy (argp, valp, z); + } + else + { + argp = (char *)FFI_ALIGN (argp, align); + memcpy (argp, valp, z); + argp += za; + } + } + } + FFI_ASSERT (dir > 0 || argp == stack); + + ffi_call_i386 (frame, stack); +} + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +#ifdef FFI_GO_CLOSURES +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} +#endif + +/** private members **/ + +void FFI_HIDDEN ffi_closure_i386(void); +void FFI_HIDDEN ffi_closure_STDCALL(void); +void FFI_HIDDEN ffi_closure_REGISTER(void); + +struct closure_frame +{ + unsigned rettemp[4]; /* 0 */ + unsigned regs[3]; /* 16-24 */ + ffi_cif *cif; /* 28 */ + void (*fun)(ffi_cif*,void*,void**,void*); /* 32 */ + void *user_data; /* 36 */ +}; + +int FFI_HIDDEN FFI_DECLARE_FASTCALL +ffi_closure_inner (struct closure_frame *frame, char *stack) +{ + ffi_cif *cif = frame->cif; + int cabi, i, n, flags, dir, narg_reg; + const struct abi_params *pabi; + ffi_type **arg_types; + char *argp; + void *rvalue; + void **avalue; + + cabi = cif->abi; + flags = cif->flags; + narg_reg = 0; + rvalue = frame->rettemp; + pabi = &abi_params[cabi]; + dir = pabi->dir; + argp = (dir < 0 ? stack + STACK_ALIGN (cif->bytes) : stack); + + switch (flags) + { + case X86_RET_STRUCTARG: + if (pabi->nregs > 0) + { + rvalue = (void *)frame->regs[pabi->regs[0]]; + narg_reg = 1; + frame->rettemp[0] = (unsigned)rvalue; + break; + } + /* fallthru */ + case X86_RET_STRUCTPOP: + rvalue = *(void **)argp; + argp += sizeof(void *); + frame->rettemp[0] = (unsigned)rvalue; + break; + } + + n = cif->nargs; + avalue = alloca(sizeof(void *) * n); + + arg_types = cif->arg_types; + for (i = 0; i < n; ++i) + { + ffi_type *ty = arg_types[i]; + size_t z = ty->size; + int t = ty->type; + void *valp; + + if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT) + { + if (t != FFI_TYPE_FLOAT && narg_reg < pabi->nregs) + valp = &frame->regs[pabi->regs[narg_reg++]]; + else if (dir < 0) + { + argp -= 4; + valp = argp; + } + else + { + valp = argp; + argp += 4; + } + } + else + { + size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG); + size_t align = FFI_SIZEOF_ARG; + + /* See the comment in ffi_call_int. */ + if (t == FFI_TYPE_STRUCT && ty->alignment >= 16) + align = 16; + + /* Issue 434: For thiscall and fastcall, if the paramter passed + as 64-bit integer or struct, all following integer parameters + will be passed on stack. */ + if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) + && (t == FFI_TYPE_SINT64 + || t == FFI_TYPE_UINT64 + || t == FFI_TYPE_STRUCT)) + narg_reg = 2; + + if (dir < 0) + { + /* ??? These reverse argument ABIs are probably too old + to have cared about alignment. Someone should check. */ + argp -= za; + valp = argp; + } + else + { + argp = (char *)FFI_ALIGN (argp, align); + valp = argp; + argp += za; + } + } + + avalue[i] = valp; + } + + frame->fun (cif, rvalue, avalue, frame->user_data); + + if (cabi == FFI_STDCALL) + return flags + (cif->bytes << X86_RET_POP_SHIFT); + else + return flags; +} + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + char *tramp = closure->tramp; + void (*dest)(void); + int op = 0xb8; /* movl imm, %eax */ + + switch (cif->abi) + { + case FFI_SYSV: + case FFI_THISCALL: + case FFI_FASTCALL: + case FFI_MS_CDECL: + dest = ffi_closure_i386; + break; + case FFI_STDCALL: + case FFI_PASCAL: + dest = ffi_closure_STDCALL; + break; + case FFI_REGISTER: + dest = ffi_closure_REGISTER; + op = 0x68; /* pushl imm */ + break; + default: + return FFI_BAD_ABI; + } + + /* endbr32. */ + *(UINT32 *) tramp = 0xfb1e0ff3; + + /* movl or pushl immediate. */ + tramp[4] = op; + *(void **)(tramp + 5) = codeloc; + + /* jmp dest */ + tramp[9] = 0xe9; + *(unsigned *)(tramp + 10) = (unsigned)dest - ((unsigned)codeloc + 14); + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +#ifdef FFI_GO_CLOSURES + +void FFI_HIDDEN ffi_go_closure_EAX(void); +void FFI_HIDDEN ffi_go_closure_ECX(void); +void FFI_HIDDEN ffi_go_closure_STDCALL(void); + +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*)) +{ + void (*dest)(void); + + switch (cif->abi) + { + case FFI_SYSV: + case FFI_MS_CDECL: + dest = ffi_go_closure_ECX; + break; + case FFI_THISCALL: + case FFI_FASTCALL: + dest = ffi_go_closure_EAX; + break; + case FFI_STDCALL: + case FFI_PASCAL: + dest = ffi_go_closure_STDCALL; + break; + case FFI_REGISTER: + default: + return FFI_BAD_ABI; + } + + closure->tramp = dest; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +#endif /* FFI_GO_CLOSURES */ + +/* ------- Native raw API support -------------------------------- */ + +#if !FFI_NO_RAW_API + +void FFI_HIDDEN ffi_closure_raw_SYSV(void); +void FFI_HIDDEN ffi_closure_raw_THISCALL(void); + +ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure *closure, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc) +{ + char *tramp = closure->tramp; + void (*dest)(void); + int i; + + /* We currently don't support certain kinds of arguments for raw + closures. This should be implemented by a separate assembly + language routine, since it would require argument processing, + something we don't do now for performance. */ + for (i = cif->nargs-1; i >= 0; i--) + switch (cif->arg_types[i]->type) + { + case FFI_TYPE_STRUCT: + case FFI_TYPE_LONGDOUBLE: + return FFI_BAD_TYPEDEF; + } + + switch (cif->abi) + { + case FFI_THISCALL: + dest = ffi_closure_raw_THISCALL; + break; + case FFI_SYSV: + dest = ffi_closure_raw_SYSV; + break; + default: + return FFI_BAD_ABI; + } + + /* movl imm, %eax. */ + tramp[0] = 0xb8; + *(void **)(tramp + 1) = codeloc; + + /* jmp dest */ + tramp[5] = 0xe9; + *(unsigned *)(tramp + 6) = (unsigned)dest - ((unsigned)codeloc + 10); + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +void +ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue) +{ + size_t rsize, bytes; + struct call_frame *frame; + char *stack, *argp; + ffi_type **arg_types; + int flags, cabi, i, n, narg_reg; + const struct abi_params *pabi; + + flags = cif->flags; + cabi = cif->abi; + pabi = &abi_params[cabi]; + + rsize = 0; + if (rvalue == NULL) + { + switch (flags) + { + case X86_RET_FLOAT: + case X86_RET_DOUBLE: + case X86_RET_LDOUBLE: + case X86_RET_STRUCTPOP: + case X86_RET_STRUCTARG: + /* The float cases need to pop the 387 stack. + The struct cases need to pass a valid pointer to the callee. */ + rsize = cif->rtype->size; + break; + default: + /* We can pretend that the callee returns nothing. */ + flags = X86_RET_VOID; + break; + } + } + + bytes = STACK_ALIGN (cif->bytes); + argp = stack = + (void *)((uintptr_t)alloca(bytes + sizeof(*frame) + rsize + 15) & ~16); + frame = (struct call_frame *)(stack + bytes); + if (rsize) + rvalue = frame + 1; + + frame->fn = fn; + frame->flags = flags; + frame->rvalue = rvalue; + + narg_reg = 0; + switch (flags) + { + case X86_RET_STRUCTARG: + /* The pointer is passed as the first argument. */ + if (pabi->nregs > 0) + { + frame->regs[pabi->regs[0]] = (unsigned)rvalue; + narg_reg = 1; + break; + } + /* fallthru */ + case X86_RET_STRUCTPOP: + *(void **)argp = rvalue; + argp += sizeof(void *); + bytes -= sizeof(void *); + break; + } + + arg_types = cif->arg_types; + for (i = 0, n = cif->nargs; narg_reg < pabi->nregs && i < n; i++) + { + ffi_type *ty = arg_types[i]; + size_t z = ty->size; + int t = ty->type; + + if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT && t != FFI_TYPE_FLOAT) + { + ffi_arg val = extend_basic_type (avalue, t); + frame->regs[pabi->regs[narg_reg++]] = val; + z = FFI_SIZEOF_ARG; + } + else + { + memcpy (argp, avalue, z); + z = FFI_ALIGN (z, FFI_SIZEOF_ARG); + argp += z; + } + avalue += z; + bytes -= z; + } + if (i < n) + memcpy (argp, avalue, bytes); + + ffi_call_i386 (frame, stack); +} +#endif /* !FFI_NO_RAW_API */ +#endif /* __i386__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi64.c new file mode 100644 index 0000000..39f9598 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffi64.c @@ -0,0 +1,895 @@ +/* ----------------------------------------------------------------------- + ffi64.c - Copyright (c) 2011, 2018 Anthony Green + Copyright (c) 2013 The Written Word, Inc. + Copyright (c) 2008, 2010 Red Hat, Inc. + Copyright (c) 2002, 2007 Bo Thorsen + + x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include +#include +#include "internal64.h" + +#ifdef __x86_64__ + +#define MAX_GPR_REGS 6 +#define MAX_SSE_REGS 8 + +#if defined(__INTEL_COMPILER) +#include "xmmintrin.h" +#define UINT128 __m128 +#else +#if defined(__SUNPRO_C) +#include +#define UINT128 __m128i +#else +#define UINT128 __int128_t +#endif +#endif + +union big_int_union +{ + UINT32 i32; + UINT64 i64; + UINT128 i128; +}; + +struct register_args +{ + /* Registers for argument passing. */ + UINT64 gpr[MAX_GPR_REGS]; + union big_int_union sse[MAX_SSE_REGS]; + UINT64 rax; /* ssecount */ + UINT64 r10; /* static chain */ +}; + +extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, + void *raddr, void (*fnaddr)(void)) FFI_HIDDEN; + +/* All reference to register classes here is identical to the code in + gcc/config/i386/i386.c. Do *not* change one without the other. */ + +/* Register class used for passing given 64bit part of the argument. + These represent classes as documented by the PS ABI, with the + exception of SSESF, SSEDF classes, that are basically SSE class, + just gcc will use SF or DFmode move instead of DImode to avoid + reformatting penalties. + + Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves + whenever possible (upper half does contain padding). */ +enum x86_64_reg_class + { + X86_64_NO_CLASS, + X86_64_INTEGER_CLASS, + X86_64_INTEGERSI_CLASS, + X86_64_SSE_CLASS, + X86_64_SSESF_CLASS, + X86_64_SSEDF_CLASS, + X86_64_SSEUP_CLASS, + X86_64_X87_CLASS, + X86_64_X87UP_CLASS, + X86_64_COMPLEX_X87_CLASS, + X86_64_MEMORY_CLASS + }; + +#define MAX_CLASSES 4 + +#define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS) + +/* x86-64 register passing implementation. See x86-64 ABI for details. Goal + of this code is to classify each 8bytes of incoming argument by the register + class and assign registers accordingly. */ + +/* Return the union class of CLASS1 and CLASS2. + See the x86-64 PS ABI for details. */ + +static enum x86_64_reg_class +merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) +{ + /* Rule #1: If both classes are equal, this is the resulting class. */ + if (class1 == class2) + return class1; + + /* Rule #2: If one of the classes is NO_CLASS, the resulting class is + the other class. */ + if (class1 == X86_64_NO_CLASS) + return class2; + if (class2 == X86_64_NO_CLASS) + return class1; + + /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ + if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ + if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) + || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) + return X86_64_INTEGERSI_CLASS; + if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS + || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) + return X86_64_INTEGER_CLASS; + + /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class, + MEMORY is used. */ + if (class1 == X86_64_X87_CLASS + || class1 == X86_64_X87UP_CLASS + || class1 == X86_64_COMPLEX_X87_CLASS + || class2 == X86_64_X87_CLASS + || class2 == X86_64_X87UP_CLASS + || class2 == X86_64_COMPLEX_X87_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #6: Otherwise class SSE is used. */ + return X86_64_SSE_CLASS; +} + +/* Classify the argument of type TYPE and mode MODE. + CLASSES will be filled by the register class used to pass each word + of the operand. The number of words is returned. In case the parameter + should be passed in memory, 0 is returned. As a special case for zero + sized containers, classes[0] will be NO_CLASS and 1 is returned. + + See the x86-64 PS ABI for details. +*/ +static size_t +classify_argument (ffi_type *type, enum x86_64_reg_class classes[], + size_t byte_offset) +{ + switch (type->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + do_integer: + { + size_t size = byte_offset + type->size; + + if (size <= 4) + { + classes[0] = X86_64_INTEGERSI_CLASS; + return 1; + } + else if (size <= 8) + { + classes[0] = X86_64_INTEGER_CLASS; + return 1; + } + else if (size <= 12) + { + classes[0] = X86_64_INTEGER_CLASS; + classes[1] = X86_64_INTEGERSI_CLASS; + return 2; + } + else if (size <= 16) + { + classes[0] = classes[1] = X86_64_INTEGER_CLASS; + return 2; + } + else + FFI_ASSERT (0); + } + case FFI_TYPE_FLOAT: + if (!(byte_offset % 8)) + classes[0] = X86_64_SSESF_CLASS; + else + classes[0] = X86_64_SSE_CLASS; + return 1; + case FFI_TYPE_DOUBLE: + classes[0] = X86_64_SSEDF_CLASS; + return 1; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + classes[0] = X86_64_X87_CLASS; + classes[1] = X86_64_X87UP_CLASS; + return 2; +#endif + case FFI_TYPE_STRUCT: + { + const size_t UNITS_PER_WORD = 8; + size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + ffi_type **ptr; + unsigned int i; + enum x86_64_reg_class subclasses[MAX_CLASSES]; + + /* If the struct is larger than 32 bytes, pass it on the stack. */ + if (type->size > 32) + return 0; + + for (i = 0; i < words; i++) + classes[i] = X86_64_NO_CLASS; + + /* Zero sized arrays or structures are NO_CLASS. We return 0 to + signalize memory class, so handle it as special case. */ + if (!words) + { + case FFI_TYPE_VOID: + classes[0] = X86_64_NO_CLASS; + return 1; + } + + /* Merge the fields of structure. */ + for (ptr = type->elements; *ptr != NULL; ptr++) + { + size_t num; + + byte_offset = FFI_ALIGN (byte_offset, (*ptr)->alignment); + + num = classify_argument (*ptr, subclasses, byte_offset % 8); + if (num == 0) + return 0; + for (i = 0; i < num; i++) + { + size_t pos = byte_offset / 8; + classes[i + pos] = + merge_classes (subclasses[i], classes[i + pos]); + } + + byte_offset += (*ptr)->size; + } + + if (words > 2) + { + /* When size > 16 bytes, if the first one isn't + X86_64_SSE_CLASS or any other ones aren't + X86_64_SSEUP_CLASS, everything should be passed in + memory. */ + if (classes[0] != X86_64_SSE_CLASS) + return 0; + + for (i = 1; i < words; i++) + if (classes[i] != X86_64_SSEUP_CLASS) + return 0; + } + + /* Final merger cleanup. */ + for (i = 0; i < words; i++) + { + /* If one class is MEMORY, everything should be passed in + memory. */ + if (classes[i] == X86_64_MEMORY_CLASS) + return 0; + + /* The X86_64_SSEUP_CLASS should be always preceded by + X86_64_SSE_CLASS or X86_64_SSEUP_CLASS. */ + if (i > 1 && classes[i] == X86_64_SSEUP_CLASS + && classes[i - 1] != X86_64_SSE_CLASS + && classes[i - 1] != X86_64_SSEUP_CLASS) + { + /* The first one should never be X86_64_SSEUP_CLASS. */ + FFI_ASSERT (i != 0); + classes[i] = X86_64_SSE_CLASS; + } + + /* If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS, + everything should be passed in memory. */ + if (i > 1 && classes[i] == X86_64_X87UP_CLASS + && (classes[i - 1] != X86_64_X87_CLASS)) + { + /* The first one should never be X86_64_X87UP_CLASS. */ + FFI_ASSERT (i != 0); + return 0; + } + } + return words; + } + case FFI_TYPE_COMPLEX: + { + ffi_type *inner = type->elements[0]; + switch (inner->type) + { + case FFI_TYPE_INT: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + goto do_integer; + + case FFI_TYPE_FLOAT: + classes[0] = X86_64_SSE_CLASS; + if (byte_offset % 8) + { + classes[1] = X86_64_SSESF_CLASS; + return 2; + } + return 1; + case FFI_TYPE_DOUBLE: + classes[0] = classes[1] = X86_64_SSEDF_CLASS; + return 2; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + classes[0] = X86_64_COMPLEX_X87_CLASS; + return 1; +#endif + } + } + } + abort(); +} + +/* Examine the argument and return set number of register required in each + class. Return zero iff parameter should be passed in memory, otherwise + the number of registers. */ + +static size_t +examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES], + _Bool in_return, int *pngpr, int *pnsse) +{ + size_t n; + unsigned int i; + int ngpr, nsse; + + n = classify_argument (type, classes, 0); + if (n == 0) + return 0; + + ngpr = nsse = 0; + for (i = 0; i < n; ++i) + switch (classes[i]) + { + case X86_64_INTEGER_CLASS: + case X86_64_INTEGERSI_CLASS: + ngpr++; + break; + case X86_64_SSE_CLASS: + case X86_64_SSESF_CLASS: + case X86_64_SSEDF_CLASS: + nsse++; + break; + case X86_64_NO_CLASS: + case X86_64_SSEUP_CLASS: + break; + case X86_64_X87_CLASS: + case X86_64_X87UP_CLASS: + case X86_64_COMPLEX_X87_CLASS: + return in_return != 0; + default: + abort (); + } + + *pngpr = ngpr; + *pnsse = nsse; + + return n; +} + +/* Perform machine dependent cif processing. */ + +#ifndef __ILP32__ +extern ffi_status +ffi_prep_cif_machdep_efi64(ffi_cif *cif); +#endif + +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep (ffi_cif *cif) +{ + int gprcount, ssecount, i, avn, ngpr, nsse; + unsigned flags; + enum x86_64_reg_class classes[MAX_CLASSES]; + size_t bytes, n, rtype_size; + ffi_type *rtype; + +#ifndef __ILP32__ + if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) + return ffi_prep_cif_machdep_efi64(cif); +#endif + if (cif->abi != FFI_UNIX64) + return FFI_BAD_ABI; + + gprcount = ssecount = 0; + + rtype = cif->rtype; + rtype_size = rtype->size; + switch (rtype->type) + { + case FFI_TYPE_VOID: + flags = UNIX64_RET_VOID; + break; + case FFI_TYPE_UINT8: + flags = UNIX64_RET_UINT8; + break; + case FFI_TYPE_SINT8: + flags = UNIX64_RET_SINT8; + break; + case FFI_TYPE_UINT16: + flags = UNIX64_RET_UINT16; + break; + case FFI_TYPE_SINT16: + flags = UNIX64_RET_SINT16; + break; + case FFI_TYPE_UINT32: + flags = UNIX64_RET_UINT32; + break; + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + flags = UNIX64_RET_SINT32; + break; + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + flags = UNIX64_RET_INT64; + break; + case FFI_TYPE_POINTER: + flags = (sizeof(void *) == 4 ? UNIX64_RET_UINT32 : UNIX64_RET_INT64); + break; + case FFI_TYPE_FLOAT: + flags = UNIX64_RET_XMM32; + break; + case FFI_TYPE_DOUBLE: + flags = UNIX64_RET_XMM64; + break; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + flags = UNIX64_RET_X87; + break; +#endif + case FFI_TYPE_STRUCT: + n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); + if (n == 0) + { + /* The return value is passed in memory. A pointer to that + memory is the first argument. Allocate a register for it. */ + gprcount++; + /* We don't have to do anything in asm for the return. */ + flags = UNIX64_RET_VOID | UNIX64_FLAG_RET_IN_MEM; + } + else + { + _Bool sse0 = SSE_CLASS_P (classes[0]); + + if (rtype_size == 4 && sse0) + flags = UNIX64_RET_XMM32; + else if (rtype_size == 8) + flags = sse0 ? UNIX64_RET_XMM64 : UNIX64_RET_INT64; + else + { + _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]); + if (sse0 && sse1) + flags = UNIX64_RET_ST_XMM0_XMM1; + else if (sse0) + flags = UNIX64_RET_ST_XMM0_RAX; + else if (sse1) + flags = UNIX64_RET_ST_RAX_XMM0; + else + flags = UNIX64_RET_ST_RAX_RDX; + flags |= rtype_size << UNIX64_SIZE_SHIFT; + } + } + break; + case FFI_TYPE_COMPLEX: + switch (rtype->elements[0]->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + flags = UNIX64_RET_ST_RAX_RDX | ((unsigned) rtype_size << UNIX64_SIZE_SHIFT); + break; + case FFI_TYPE_FLOAT: + flags = UNIX64_RET_XMM64; + break; + case FFI_TYPE_DOUBLE: + flags = UNIX64_RET_ST_XMM0_XMM1 | (16 << UNIX64_SIZE_SHIFT); + break; +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + flags = UNIX64_RET_X87_2; + break; +#endif + default: + return FFI_BAD_TYPEDEF; + } + break; + default: + return FFI_BAD_TYPEDEF; + } + + /* Go over all arguments and determine the way they should be passed. + If it's in a register and there is space for it, let that be so. If + not, add it's size to the stack byte count. */ + for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++) + { + if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = cif->arg_types[i]->alignment; + + if (align < 8) + align = 8; + + bytes = FFI_ALIGN (bytes, align); + bytes += cif->arg_types[i]->size; + } + else + { + gprcount += ngpr; + ssecount += nsse; + } + } + if (ssecount) + flags |= UNIX64_FLAG_XMM_ARGS; + + cif->flags = flags; + cif->bytes = (unsigned) FFI_ALIGN (bytes, 8); + + return FFI_OK; +} + +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + enum x86_64_reg_class classes[MAX_CLASSES]; + char *stack, *argp; + ffi_type **arg_types; + int gprcount, ssecount, ngpr, nsse, i, avn, flags; + struct register_args *reg_args; + + /* Can't call 32-bit mode from 64-bit mode. */ + FFI_ASSERT (cif->abi == FFI_UNIX64); + + /* If the return value is a struct and we don't have a return value + address then we need to make one. Otherwise we can ignore it. */ + flags = cif->flags; + if (rvalue == NULL) + { + if (flags & UNIX64_FLAG_RET_IN_MEM) + rvalue = alloca (cif->rtype->size); + else + flags = UNIX64_RET_VOID; + } + + /* Allocate the space for the arguments, plus 4 words of temp space. */ + stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8); + reg_args = (struct register_args *) stack; + argp = stack + sizeof (struct register_args); + + reg_args->r10 = (uintptr_t) closure; + + gprcount = ssecount = 0; + + /* If the return value is passed in memory, add the pointer as the + first integer argument. */ + if (flags & UNIX64_FLAG_RET_IN_MEM) + reg_args->gpr[gprcount++] = (unsigned long) rvalue; + + avn = cif->nargs; + arg_types = cif->arg_types; + + for (i = 0; i < avn; ++i) + { + size_t n, size = arg_types[i]->size; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = arg_types[i]->alignment; + + /* Stack arguments are *always* at least 8 byte aligned. */ + if (align < 8) + align = 8; + + /* Pass this argument in memory. */ + argp = (void *) FFI_ALIGN (argp, align); + memcpy (argp, avalue[i], size); + argp += size; + } + else + { + /* The argument is passed entirely in registers. */ + char *a = (char *) avalue[i]; + unsigned int j; + + for (j = 0; j < n; j++, a += 8, size -= 8) + { + switch (classes[j]) + { + case X86_64_NO_CLASS: + case X86_64_SSEUP_CLASS: + break; + case X86_64_INTEGER_CLASS: + case X86_64_INTEGERSI_CLASS: + /* Sign-extend integer arguments passed in general + purpose registers, to cope with the fact that + LLVM incorrectly assumes that this will be done + (the x86-64 PS ABI does not specify this). */ + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a); + break; + case FFI_TYPE_SINT16: + reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a); + break; + case FFI_TYPE_SINT32: + reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a); + break; + default: + reg_args->gpr[gprcount] = 0; + memcpy (®_args->gpr[gprcount], a, size); + } + gprcount++; + break; + case X86_64_SSE_CLASS: + case X86_64_SSEDF_CLASS: + memcpy (®_args->sse[ssecount++].i64, a, sizeof(UINT64)); + break; + case X86_64_SSESF_CLASS: + memcpy (®_args->sse[ssecount++].i32, a, sizeof(UINT32)); + break; + default: + abort(); + } + } + } + } + reg_args->rax = ssecount; + + ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args), + flags, rvalue, fn); +} + +#ifndef __ILP32__ +extern void +ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue); +#endif + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ +#ifndef __ILP32__ + if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) + { + ffi_call_efi64(cif, fn, rvalue, avalue); + return; + } +#endif + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +#ifdef FFI_GO_CLOSURES + +#ifndef __ILP32__ +extern void +ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure); +#endif + +void +ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ +#ifndef __ILP32__ + if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) + { + ffi_call_go_efi64(cif, fn, rvalue, avalue, closure); + return; + } +#endif + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + +#endif /* FFI_GO_CLOSURES */ + +extern void ffi_closure_unix64(void) FFI_HIDDEN; +extern void ffi_closure_unix64_sse(void) FFI_HIDDEN; + +#ifndef __ILP32__ +extern ffi_status +ffi_prep_closure_loc_efi64(ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc); +#endif + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + static const unsigned char trampoline[24] = { + /* endbr64 */ + 0xf3, 0x0f, 0x1e, 0xfa, + /* leaq -0xb(%rip),%r10 # 0x0 */ + 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, + /* jmpq *0x7(%rip) # 0x18 */ + 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, + /* nopl 0(%rax) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 + }; + void (*dest)(void); + char *tramp = closure->tramp; + +#ifndef __ILP32__ + if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) + return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc); +#endif + if (cif->abi != FFI_UNIX64) + return FFI_BAD_ABI; + + if (cif->flags & UNIX64_FLAG_XMM_ARGS) + dest = ffi_closure_unix64_sse; + else + dest = ffi_closure_unix64; + + memcpy (tramp, trampoline, sizeof(trampoline)); + *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)dest; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +int FFI_HIDDEN +ffi_closure_unix64_inner(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *rvalue, + struct register_args *reg_args, + char *argp) +{ + void **avalue; + ffi_type **arg_types; + long i, avn; + int gprcount, ssecount, ngpr, nsse; + int flags; + + avn = cif->nargs; + flags = cif->flags; + avalue = alloca(avn * sizeof(void *)); + gprcount = ssecount = 0; + + if (flags & UNIX64_FLAG_RET_IN_MEM) + { + /* On return, %rax will contain the address that was passed + by the caller in %rdi. */ + void *r = (void *)(uintptr_t)reg_args->gpr[gprcount++]; + *(void **)rvalue = r; + rvalue = r; + flags = (sizeof(void *) == 4 ? UNIX64_RET_UINT32 : UNIX64_RET_INT64); + } + + arg_types = cif->arg_types; + for (i = 0; i < avn; ++i) + { + enum x86_64_reg_class classes[MAX_CLASSES]; + size_t n; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = arg_types[i]->alignment; + + /* Stack arguments are *always* at least 8 byte aligned. */ + if (align < 8) + align = 8; + + /* Pass this argument in memory. */ + argp = (void *) FFI_ALIGN (argp, align); + avalue[i] = argp; + argp += arg_types[i]->size; + } + /* If the argument is in a single register, or two consecutive + integer registers, then we can use that address directly. */ + else if (n == 1 + || (n == 2 && !(SSE_CLASS_P (classes[0]) + || SSE_CLASS_P (classes[1])))) + { + /* The argument is in a single register. */ + if (SSE_CLASS_P (classes[0])) + { + avalue[i] = ®_args->sse[ssecount]; + ssecount += n; + } + else + { + avalue[i] = ®_args->gpr[gprcount]; + gprcount += n; + } + } + /* Otherwise, allocate space to make them consecutive. */ + else + { + char *a = alloca (16); + unsigned int j; + + avalue[i] = a; + for (j = 0; j < n; j++, a += 8) + { + if (SSE_CLASS_P (classes[j])) + memcpy (a, ®_args->sse[ssecount++], 8); + else + memcpy (a, ®_args->gpr[gprcount++], 8); + } + } + } + + /* Invoke the closure. */ + fun (cif, rvalue, avalue, user_data); + + /* Tell assembly how to perform return type promotions. */ + return flags; +} + +#ifdef FFI_GO_CLOSURES + +extern void ffi_go_closure_unix64(void) FFI_HIDDEN; +extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN; + +#ifndef __ILP32__ +extern ffi_status +ffi_prep_go_closure_efi64(ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)); +#endif + +ffi_status +ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ +#ifndef __ILP32__ + if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) + return ffi_prep_go_closure_efi64(closure, cif, fun); +#endif + if (cif->abi != FFI_UNIX64) + return FFI_BAD_ABI; + + closure->tramp = (cif->flags & UNIX64_FLAG_XMM_ARGS + ? ffi_go_closure_unix64_sse + : ffi_go_closure_unix64); + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} + +#endif /* FFI_GO_CLOSURES */ + +#endif /* __x86_64__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffitarget.h new file mode 100644 index 0000000..a34f3e5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffitarget.h @@ -0,0 +1,160 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green + Copyright (c) 1996-2003, 2010 Red Hat, Inc. + Copyright (C) 2008 Free Software Foundation, Inc. + + Target configuration macros for x86 and x86-64. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +/* For code common to all platforms on x86 and x86_64. */ +#define X86_ANY + +#if defined (X86_64) && defined (__i386__) +#undef X86_64 +#define X86 +#endif + +#ifdef X86_WIN64 +#define FFI_SIZEOF_ARG 8 +#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */ +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +#ifndef _MSC_VER +#define FFI_TARGET_HAS_COMPLEX_TYPE +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +#ifdef X86_WIN64 +#ifdef _MSC_VER +typedef unsigned __int64 ffi_arg; +typedef __int64 ffi_sarg; +#else +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#endif +#else +#if defined __x86_64__ && defined __ILP32__ +#define FFI_SIZEOF_ARG 8 +#define FFI_SIZEOF_JAVA_RAW 4 +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#else +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; +#endif +#endif + +typedef enum ffi_abi { +#if defined(X86_WIN64) + FFI_FIRST_ABI = 0, + FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */ + FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */ + FFI_LAST_ABI, +#ifdef __GNUC__ + FFI_DEFAULT_ABI = FFI_GNUW64 +#else + FFI_DEFAULT_ABI = FFI_WIN64 +#endif + +#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) + FFI_FIRST_ABI = 1, + FFI_UNIX64, + FFI_WIN64, + FFI_EFI64 = FFI_WIN64, + FFI_GNUW64, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_UNIX64 + +#elif defined(X86_WIN32) + FFI_FIRST_ABI = 0, + FFI_SYSV = 1, + FFI_STDCALL = 2, + FFI_THISCALL = 3, + FFI_FASTCALL = 4, + FFI_MS_CDECL = 5, + FFI_PASCAL = 6, + FFI_REGISTER = 7, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_MS_CDECL +#else + FFI_FIRST_ABI = 0, + FFI_SYSV = 1, + FFI_THISCALL = 3, + FFI_FASTCALL = 4, + FFI_STDCALL = 5, + FFI_PASCAL = 6, + FFI_REGISTER = 7, + FFI_MS_CDECL = 8, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +#endif +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 + +#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) +#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) +#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) +#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) + +#if defined (X86_64) || defined(X86_WIN64) \ + || (defined (__x86_64__) && defined (X86_DARWIN)) +/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP + + 8 bytes of pointer. */ +# define FFI_TRAMPOLINE_SIZE 32 +# define FFI_NATIVE_RAW_API 0 +#else +/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused + bytes. */ +# define FFI_TRAMPOLINE_SIZE 16 +# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ +#endif + +#if !defined(GENERATE_LIBFFI_MAP) && defined(__ASSEMBLER__) \ + && defined(__CET__) +# include +# define _CET_NOTRACK notrack +#else +# define _CET_ENDBR +# define _CET_NOTRACK +#endif + +#endif + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffiw64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffiw64.c new file mode 100644 index 0000000..a43a9eb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/ffiw64.c @@ -0,0 +1,318 @@ +/* ----------------------------------------------------------------------- + ffiw64.c - Copyright (c) 2018 Anthony Green + Copyright (c) 2014 Red Hat, Inc. + + x86 win64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if defined(__x86_64__) || defined(_M_AMD64) +#include +#include +#include +#include + +#ifdef X86_WIN64 +#define EFI64(name) name +#else +#define EFI64(name) FFI_HIDDEN name##_efi64 +#endif + +struct win64_call_frame +{ + UINT64 rbp; /* 0 */ + UINT64 retaddr; /* 8 */ + UINT64 fn; /* 16 */ + UINT64 flags; /* 24 */ + UINT64 rvalue; /* 32 */ +}; + +extern void ffi_call_win64 (void *stack, struct win64_call_frame *, + void *closure) FFI_HIDDEN; + +ffi_status FFI_HIDDEN +EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) +{ + int flags, n; + + switch (cif->abi) + { + case FFI_WIN64: + case FFI_GNUW64: + break; + default: + return FFI_BAD_ABI; + } + + flags = cif->rtype->type; + switch (flags) + { + default: + break; + case FFI_TYPE_LONGDOUBLE: + /* GCC returns long double values by reference, like a struct */ + if (cif->abi == FFI_GNUW64) + flags = FFI_TYPE_STRUCT; + break; + case FFI_TYPE_COMPLEX: + flags = FFI_TYPE_STRUCT; + /* FALLTHRU */ + case FFI_TYPE_STRUCT: + switch (cif->rtype->size) + { + case 8: + flags = FFI_TYPE_UINT64; + break; + case 4: + flags = FFI_TYPE_SMALL_STRUCT_4B; + break; + case 2: + flags = FFI_TYPE_SMALL_STRUCT_2B; + break; + case 1: + flags = FFI_TYPE_SMALL_STRUCT_1B; + break; + } + break; + } + cif->flags = flags; + + /* Each argument either fits in a register, an 8 byte slot, or is + passed by reference with the pointer in the 8 byte slot. */ + n = cif->nargs; + n += (flags == FFI_TYPE_STRUCT); + if (n < 4) + n = 4; + cif->bytes = n * 8; + + return FFI_OK; +} + +static void +ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + int i, j, n, flags; + UINT64 *stack; + size_t rsize; + struct win64_call_frame *frame; + + FFI_ASSERT(cif->abi == FFI_GNUW64 || cif->abi == FFI_WIN64); + + flags = cif->flags; + rsize = 0; + + /* If we have no return value for a structure, we need to create one. + Otherwise we can ignore the return type entirely. */ + if (rvalue == NULL) + { + if (flags == FFI_TYPE_STRUCT) + rsize = cif->rtype->size; + else + flags = FFI_TYPE_VOID; + } + + stack = alloca(cif->bytes + sizeof(struct win64_call_frame) + rsize); + frame = (struct win64_call_frame *)((char *)stack + cif->bytes); + if (rsize) + rvalue = frame + 1; + + frame->fn = (uintptr_t)fn; + frame->flags = flags; + frame->rvalue = (uintptr_t)rvalue; + + j = 0; + if (flags == FFI_TYPE_STRUCT) + { + stack[0] = (uintptr_t)rvalue; + j = 1; + } + + for (i = 0, n = cif->nargs; i < n; ++i, ++j) + { + switch (cif->arg_types[i]->size) + { + case 8: + stack[j] = *(UINT64 *)avalue[i]; + break; + case 4: + stack[j] = *(UINT32 *)avalue[i]; + break; + case 2: + stack[j] = *(UINT16 *)avalue[i]; + break; + case 1: + stack[j] = *(UINT8 *)avalue[i]; + break; + default: + stack[j] = (uintptr_t)avalue[i]; + break; + } + } + + ffi_call_win64 (stack, frame, closure); +} + +void +EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +void +EFI64(ffi_call_go)(ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + + +extern void ffi_closure_win64(void) FFI_HIDDEN; + +#ifdef FFI_GO_CLOSURES +extern void ffi_go_closure_win64(void) FFI_HIDDEN; +#endif + +ffi_status +EFI64(ffi_prep_closure_loc)(ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + static const unsigned char trampoline[FFI_TRAMPOLINE_SIZE - 8] = { + /* endbr64 */ + 0xf3, 0x0f, 0x1e, 0xfa, + /* leaq -0xb(%rip),%r10 # 0x0 */ + 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, + /* jmpq *0x7(%rip) # 0x18 */ + 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, + /* nopl 0(%rax) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 + }; + char *tramp = closure->tramp; + + switch (cif->abi) + { + case FFI_WIN64: + case FFI_GNUW64: + break; + default: + return FFI_BAD_ABI; + } + + memcpy (tramp, trampoline, sizeof(trampoline)); + *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)ffi_closure_win64; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +#ifdef FFI_GO_CLOSURES +ffi_status +EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +{ + switch (cif->abi) + { + case FFI_WIN64: + case FFI_GNUW64: + break; + default: + return FFI_BAD_ABI; + } + + closure->tramp = ffi_go_closure_win64; + closure->cif = cif; + closure->fun = fun; + + return FFI_OK; +} +#endif + +struct win64_closure_frame +{ + UINT64 rvalue[2]; + UINT64 fargs[4]; + UINT64 retaddr; + UINT64 args[]; +}; + +/* Force the inner function to use the MS ABI. When compiling on win64 + this is a nop. When compiling on unix, this simplifies the assembly, + and places the burden of saving the extra call-saved registers on + the compiler. */ +int FFI_HIDDEN __attribute__((ms_abi)) +ffi_closure_win64_inner(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + struct win64_closure_frame *frame) +{ + void **avalue; + void *rvalue; + int i, n, nreg, flags; + + avalue = alloca(cif->nargs * sizeof(void *)); + rvalue = frame->rvalue; + nreg = 0; + + /* When returning a structure, the address is in the first argument. + We must also be prepared to return the same address in eax, so + install that address in the frame and pretend we return a pointer. */ + flags = cif->flags; + if (flags == FFI_TYPE_STRUCT) + { + rvalue = (void *)(uintptr_t)frame->args[0]; + frame->rvalue[0] = frame->args[0]; + nreg = 1; + } + + for (i = 0, n = cif->nargs; i < n; ++i, ++nreg) + { + size_t size = cif->arg_types[i]->size; + size_t type = cif->arg_types[i]->type; + void *a; + + if (type == FFI_TYPE_DOUBLE || type == FFI_TYPE_FLOAT) + { + if (nreg < 4) + a = &frame->fargs[nreg]; + else + a = &frame->args[nreg]; + } + else if (size == 1 || size == 2 || size == 4 || size == 8) + a = &frame->args[nreg]; + else + a = (void *)(uintptr_t)frame->args[nreg]; + + avalue[i] = a; + } + + /* Invoke the closure. */ + fun (cif, rvalue, avalue, user_data); + return flags; +} + +#endif /* __x86_64__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal.h new file mode 100644 index 0000000..09771ba --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal.h @@ -0,0 +1,29 @@ +#define X86_RET_FLOAT 0 +#define X86_RET_DOUBLE 1 +#define X86_RET_LDOUBLE 2 +#define X86_RET_SINT8 3 +#define X86_RET_SINT16 4 +#define X86_RET_UINT8 5 +#define X86_RET_UINT16 6 +#define X86_RET_INT64 7 +#define X86_RET_INT32 8 +#define X86_RET_VOID 9 +#define X86_RET_STRUCTPOP 10 +#define X86_RET_STRUCTARG 11 +#define X86_RET_STRUCT_1B 12 +#define X86_RET_STRUCT_2B 13 +#define X86_RET_UNUSED14 14 +#define X86_RET_UNUSED15 15 + +#define X86_RET_TYPE_MASK 15 +#define X86_RET_POP_SHIFT 4 + +#define R_EAX 0 +#define R_EDX 1 +#define R_ECX 2 + +#ifdef __PCC__ +# define HAVE_FASTCALL 0 +#else +# define HAVE_FASTCALL 1 +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal64.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal64.h new file mode 100644 index 0000000..512e955 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/internal64.h @@ -0,0 +1,22 @@ +#define UNIX64_RET_VOID 0 +#define UNIX64_RET_UINT8 1 +#define UNIX64_RET_UINT16 2 +#define UNIX64_RET_UINT32 3 +#define UNIX64_RET_SINT8 4 +#define UNIX64_RET_SINT16 5 +#define UNIX64_RET_SINT32 6 +#define UNIX64_RET_INT64 7 +#define UNIX64_RET_XMM32 8 +#define UNIX64_RET_XMM64 9 +#define UNIX64_RET_X87 10 +#define UNIX64_RET_X87_2 11 +#define UNIX64_RET_ST_XMM0_RAX 12 +#define UNIX64_RET_ST_RAX_XMM0 13 +#define UNIX64_RET_ST_XMM0_XMM1 14 +#define UNIX64_RET_ST_RAX_RDX 15 + +#define UNIX64_RET_LAST 15 + +#define UNIX64_FLAG_RET_IN_MEM (1 << 10) +#define UNIX64_FLAG_XMM_ARGS (1 << 11) +#define UNIX64_SIZE_SHIFT 12 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv.S new file mode 100644 index 0000000..d8ab4b0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv.S @@ -0,0 +1,1138 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2017 Anthony Green + - Copyright (c) 2013 The Written Word, Inc. + - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. + + X86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifdef __i386__ +#ifndef _MSC_VER + +#define LIBFFI_ASM +#include +#include +#include "internal.h" + +#define C2(X, Y) X ## Y +#define C1(X, Y) C2(X, Y) +#ifdef __USER_LABEL_PREFIX__ +# define C(X) C1(__USER_LABEL_PREFIX__, X) +#else +# define C(X) X +#endif + +#ifdef X86_DARWIN +# define L(X) C1(L, X) +#else +# define L(X) C1(.L, X) +#endif + +#ifdef __ELF__ +# define ENDF(X) .type X,@function; .size X, . - X +#else +# define ENDF(X) +#endif + +/* Handle win32 fastcall name mangling. */ +#ifdef X86_WIN32 +# define ffi_call_i386 "@ffi_call_i386@8" +# define ffi_closure_inner "@ffi_closure_inner@8" +#else +# define ffi_call_i386 C(ffi_call_i386) +# define ffi_closure_inner C(ffi_closure_inner) +#endif + +/* This macro allows the safe creation of jump tables without an + actual table. The entry points into the table are all 8 bytes. + The use of ORG asserts that we're at the correct location. */ +/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ +#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +# define E(BASE, X) .balign 8 +#else +# define E(BASE, X) .balign 8; .org BASE + X * 8 +#endif + + .text + .balign 16 + .globl ffi_call_i386 + FFI_HIDDEN(ffi_call_i386) + +/* This is declared as + + void ffi_call_i386(struct call_frame *frame, char *argp) + __attribute__((fastcall)); + + Thus the arguments are present in + + ecx: frame + edx: argp +*/ + +ffi_call_i386: +L(UW0): + # cfi_startproc + _CET_ENDBR +#if !HAVE_FASTCALL + movl 4(%esp), %ecx + movl 8(%esp), %edx +#endif + movl (%esp), %eax /* move the return address */ + movl %ebp, (%ecx) /* store %ebp into local frame */ + movl %eax, 4(%ecx) /* store retaddr into local frame */ + + /* New stack frame based off ebp. This is a itty bit of unwind + trickery in that the CFA *has* changed. There is no easy way + to describe it correctly on entry to the function. Fortunately, + it doesn't matter too much since at all points we can correctly + unwind back to ffi_call. Note that the location to which we + moved the return address is (the new) CFA-4, so from the + perspective of the unwind info, it hasn't moved. */ + movl %ecx, %ebp +L(UW1): + # cfi_def_cfa(%ebp, 8) + # cfi_rel_offset(%ebp, 0) + + movl %edx, %esp /* set outgoing argument stack */ + movl 20+R_EAX*4(%ebp), %eax /* set register arguments */ + movl 20+R_EDX*4(%ebp), %edx + movl 20+R_ECX*4(%ebp), %ecx + + call *8(%ebp) + + movl 12(%ebp), %ecx /* load return type code */ + movl %ebx, 8(%ebp) /* preserve %ebx */ +L(UW2): + # cfi_rel_offset(%ebx, 8) + + andl $X86_RET_TYPE_MASK, %ecx +#ifdef __PIC__ + call C(__x86.get_pc_thunk.bx) +L(pc1): + leal L(store_table)-L(pc1)(%ebx, %ecx, 8), %ebx +#else + leal L(store_table)(,%ecx, 8), %ebx +#endif + movl 16(%ebp), %ecx /* load result address */ + _CET_NOTRACK jmp *%ebx + + .balign 8 +L(store_table): +E(L(store_table), X86_RET_FLOAT) + fstps (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_DOUBLE) + fstpl (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_LDOUBLE) + fstpt (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_SINT8) + movsbl %al, %eax + mov %eax, (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_SINT16) + movswl %ax, %eax + mov %eax, (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_UINT8) + movzbl %al, %eax + mov %eax, (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_UINT16) + movzwl %ax, %eax + mov %eax, (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_INT64) + movl %edx, 4(%ecx) + /* fallthru */ +E(L(store_table), X86_RET_INT32) + movl %eax, (%ecx) + /* fallthru */ +E(L(store_table), X86_RET_VOID) +L(e1): + movl 8(%ebp), %ebx + movl %ebp, %esp + popl %ebp +L(UW3): + # cfi_remember_state + # cfi_def_cfa(%esp, 4) + # cfi_restore(%ebx) + # cfi_restore(%ebp) + ret +L(UW4): + # cfi_restore_state + +E(L(store_table), X86_RET_STRUCTPOP) + jmp L(e1) +E(L(store_table), X86_RET_STRUCTARG) + jmp L(e1) +E(L(store_table), X86_RET_STRUCT_1B) + movb %al, (%ecx) + jmp L(e1) +E(L(store_table), X86_RET_STRUCT_2B) + movw %ax, (%ecx) + jmp L(e1) + + /* Fill out the table so that bad values are predictable. */ +E(L(store_table), X86_RET_UNUSED14) + ud2 +E(L(store_table), X86_RET_UNUSED15) + ud2 + +L(UW5): + # cfi_endproc +ENDF(ffi_call_i386) + +/* The inner helper is declared as + + void ffi_closure_inner(struct closure_frame *frame, char *argp) + __attribute_((fastcall)) + + Thus the arguments are placed in + + ecx: frame + edx: argp +*/ + +/* Macros to help setting up the closure_data structure. */ + +#if HAVE_FASTCALL +# define closure_FS (40 + 4) +# define closure_CF 0 +#else +# define closure_FS (8 + 40 + 12) +# define closure_CF 8 +#endif + +#define FFI_CLOSURE_SAVE_REGS \ + movl %eax, closure_CF+16+R_EAX*4(%esp); \ + movl %edx, closure_CF+16+R_EDX*4(%esp); \ + movl %ecx, closure_CF+16+R_ECX*4(%esp) + +#define FFI_CLOSURE_COPY_TRAMP_DATA \ + movl FFI_TRAMPOLINE_SIZE(%eax), %edx; /* copy cif */ \ + movl FFI_TRAMPOLINE_SIZE+4(%eax), %ecx; /* copy fun */ \ + movl FFI_TRAMPOLINE_SIZE+8(%eax), %eax; /* copy user_data */ \ + movl %edx, closure_CF+28(%esp); \ + movl %ecx, closure_CF+32(%esp); \ + movl %eax, closure_CF+36(%esp) + +#if HAVE_FASTCALL +# define FFI_CLOSURE_PREP_CALL \ + movl %esp, %ecx; /* load closure_data */ \ + leal closure_FS+4(%esp), %edx; /* load incoming stack */ +#else +# define FFI_CLOSURE_PREP_CALL \ + leal closure_CF(%esp), %ecx; /* load closure_data */ \ + leal closure_FS+4(%esp), %edx; /* load incoming stack */ \ + movl %ecx, (%esp); \ + movl %edx, 4(%esp) +#endif + +#define FFI_CLOSURE_CALL_INNER(UWN) \ + call ffi_closure_inner + +#define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \ + andl $X86_RET_TYPE_MASK, %eax; \ + leal L(C1(load_table,N))(, %eax, 8), %edx; \ + movl closure_CF(%esp), %eax; /* optimiztic load */ \ + _CET_NOTRACK jmp *%edx + +#ifdef __PIC__ +# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +# undef FFI_CLOSURE_MASK_AND_JUMP +# define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \ + andl $X86_RET_TYPE_MASK, %eax; \ + call C(__x86.get_pc_thunk.dx); \ +L(C1(pc,N)): \ + leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \ + movl closure_CF(%esp), %eax; /* optimiztic load */ \ + _CET_NOTRACK jmp *%edx +# else +# define FFI_CLOSURE_CALL_INNER_SAVE_EBX +# undef FFI_CLOSURE_CALL_INNER +# define FFI_CLOSURE_CALL_INNER(UWN) \ + movl %ebx, 40(%esp); /* save ebx */ \ +L(C1(UW,UWN)): \ + /* cfi_rel_offset(%ebx, 40); */ \ + call C(__x86.get_pc_thunk.bx); /* load got register */ \ + addl $C(_GLOBAL_OFFSET_TABLE_), %ebx; \ + call ffi_closure_inner@PLT +# undef FFI_CLOSURE_MASK_AND_JUMP +# define FFI_CLOSURE_MASK_AND_JUMP(N, UWN) \ + andl $X86_RET_TYPE_MASK, %eax; \ + leal L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx; \ + movl 40(%esp), %ebx; /* restore ebx */ \ +L(C1(UW,UWN)): \ + /* cfi_restore(%ebx); */ \ + movl closure_CF(%esp), %eax; /* optimiztic load */ \ + _CET_NOTRACK jmp *%edx +# endif /* DARWIN || HIDDEN */ +#endif /* __PIC__ */ + + .balign 16 + .globl C(ffi_go_closure_EAX) + FFI_HIDDEN(C(ffi_go_closure_EAX)) +C(ffi_go_closure_EAX): +L(UW6): + # cfi_startproc + _CET_ENDBR + subl $closure_FS, %esp +L(UW7): + # cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + movl 4(%eax), %edx /* copy cif */ + movl 8(%eax), %ecx /* copy fun */ + movl %edx, closure_CF+28(%esp) + movl %ecx, closure_CF+32(%esp) + movl %eax, closure_CF+36(%esp) /* closure is user_data */ + jmp L(do_closure_i386) +L(UW8): + # cfi_endproc +ENDF(C(ffi_go_closure_EAX)) + + .balign 16 + .globl C(ffi_go_closure_ECX) + FFI_HIDDEN(C(ffi_go_closure_ECX)) +C(ffi_go_closure_ECX): +L(UW9): + # cfi_startproc + _CET_ENDBR + subl $closure_FS, %esp +L(UW10): + # cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + movl 4(%ecx), %edx /* copy cif */ + movl 8(%ecx), %eax /* copy fun */ + movl %edx, closure_CF+28(%esp) + movl %eax, closure_CF+32(%esp) + movl %ecx, closure_CF+36(%esp) /* closure is user_data */ + jmp L(do_closure_i386) +L(UW11): + # cfi_endproc +ENDF(C(ffi_go_closure_ECX)) + +/* The closure entry points are reached from the ffi_closure trampoline. + On entry, %eax contains the address of the ffi_closure. */ + + .balign 16 + .globl C(ffi_closure_i386) + FFI_HIDDEN(C(ffi_closure_i386)) + +C(ffi_closure_i386): +L(UW12): + # cfi_startproc + _CET_ENDBR + subl $closure_FS, %esp +L(UW13): + # cfi_def_cfa_offset(closure_FS + 4) + + FFI_CLOSURE_SAVE_REGS + FFI_CLOSURE_COPY_TRAMP_DATA + + /* Entry point from preceeding Go closures. */ +L(do_closure_i386): + + FFI_CLOSURE_PREP_CALL + FFI_CLOSURE_CALL_INNER(14) + FFI_CLOSURE_MASK_AND_JUMP(2, 15) + + .balign 8 +L(load_table2): +E(L(load_table2), X86_RET_FLOAT) + flds closure_CF(%esp) + jmp L(e2) +E(L(load_table2), X86_RET_DOUBLE) + fldl closure_CF(%esp) + jmp L(e2) +E(L(load_table2), X86_RET_LDOUBLE) + fldt closure_CF(%esp) + jmp L(e2) +E(L(load_table2), X86_RET_SINT8) + movsbl %al, %eax + jmp L(e2) +E(L(load_table2), X86_RET_SINT16) + movswl %ax, %eax + jmp L(e2) +E(L(load_table2), X86_RET_UINT8) + movzbl %al, %eax + jmp L(e2) +E(L(load_table2), X86_RET_UINT16) + movzwl %ax, %eax + jmp L(e2) +E(L(load_table2), X86_RET_INT64) + movl closure_CF+4(%esp), %edx + jmp L(e2) +E(L(load_table2), X86_RET_INT32) + nop + /* fallthru */ +E(L(load_table2), X86_RET_VOID) +L(e2): + addl $closure_FS, %esp +L(UW16): + # cfi_adjust_cfa_offset(-closure_FS) + ret +L(UW17): + # cfi_adjust_cfa_offset(closure_FS) +E(L(load_table2), X86_RET_STRUCTPOP) + addl $closure_FS, %esp +L(UW18): + # cfi_adjust_cfa_offset(-closure_FS) + ret $4 +L(UW19): + # cfi_adjust_cfa_offset(closure_FS) +E(L(load_table2), X86_RET_STRUCTARG) + jmp L(e2) +E(L(load_table2), X86_RET_STRUCT_1B) + movzbl %al, %eax + jmp L(e2) +E(L(load_table2), X86_RET_STRUCT_2B) + movzwl %ax, %eax + jmp L(e2) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table2), X86_RET_UNUSED14) + ud2 +E(L(load_table2), X86_RET_UNUSED15) + ud2 + +L(UW20): + # cfi_endproc +ENDF(C(ffi_closure_i386)) + + .balign 16 + .globl C(ffi_go_closure_STDCALL) + FFI_HIDDEN(C(ffi_go_closure_STDCALL)) +C(ffi_go_closure_STDCALL): +L(UW21): + # cfi_startproc + _CET_ENDBR + subl $closure_FS, %esp +L(UW22): + # cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + movl 4(%ecx), %edx /* copy cif */ + movl 8(%ecx), %eax /* copy fun */ + movl %edx, closure_CF+28(%esp) + movl %eax, closure_CF+32(%esp) + movl %ecx, closure_CF+36(%esp) /* closure is user_data */ + jmp L(do_closure_STDCALL) +L(UW23): + # cfi_endproc +ENDF(C(ffi_go_closure_STDCALL)) + +/* For REGISTER, we have no available parameter registers, and so we + enter here having pushed the closure onto the stack. */ + + .balign 16 + .globl C(ffi_closure_REGISTER) + FFI_HIDDEN(C(ffi_closure_REGISTER)) +C(ffi_closure_REGISTER): +L(UW24): + # cfi_startproc + # cfi_def_cfa(%esp, 8) + # cfi_offset(%eip, -8) + _CET_ENDBR + subl $closure_FS-4, %esp +L(UW25): + # cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + movl closure_FS-4(%esp), %ecx /* load retaddr */ + movl closure_FS(%esp), %eax /* load closure */ + movl %ecx, closure_FS(%esp) /* move retaddr */ + jmp L(do_closure_REGISTER) +L(UW26): + # cfi_endproc +ENDF(C(ffi_closure_REGISTER)) + +/* For STDCALL (and others), we need to pop N bytes of arguments off + the stack following the closure. The amount needing to be popped + is returned to us from ffi_closure_inner. */ + + .balign 16 + .globl C(ffi_closure_STDCALL) + FFI_HIDDEN(C(ffi_closure_STDCALL)) +C(ffi_closure_STDCALL): +L(UW27): + # cfi_startproc + _CET_ENDBR + subl $closure_FS, %esp +L(UW28): + # cfi_def_cfa_offset(closure_FS + 4) + + FFI_CLOSURE_SAVE_REGS + + /* Entry point from ffi_closure_REGISTER. */ +L(do_closure_REGISTER): + + FFI_CLOSURE_COPY_TRAMP_DATA + + /* Entry point from preceeding Go closure. */ +L(do_closure_STDCALL): + + FFI_CLOSURE_PREP_CALL + FFI_CLOSURE_CALL_INNER(29) + + movl %eax, %ecx + shrl $X86_RET_POP_SHIFT, %ecx /* isolate pop count */ + leal closure_FS(%esp, %ecx), %ecx /* compute popped esp */ + movl closure_FS(%esp), %edx /* move return address */ + movl %edx, (%ecx) + + /* From this point on, the value of %esp upon return is %ecx+4, + and we've copied the return address to %ecx to make return easy. + There's no point in representing this in the unwind info, as + there is always a window between the mov and the ret which + will be wrong from one point of view or another. */ + + FFI_CLOSURE_MASK_AND_JUMP(3, 30) + + .balign 8 +L(load_table3): +E(L(load_table3), X86_RET_FLOAT) + flds closure_CF(%esp) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_DOUBLE) + fldl closure_CF(%esp) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_LDOUBLE) + fldt closure_CF(%esp) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_SINT8) + movsbl %al, %eax + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_SINT16) + movswl %ax, %eax + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_UINT8) + movzbl %al, %eax + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_UINT16) + movzwl %ax, %eax + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_INT64) + movl closure_CF+4(%esp), %edx + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_INT32) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_VOID) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_STRUCTPOP) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_STRUCTARG) + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_STRUCT_1B) + movzbl %al, %eax + movl %ecx, %esp + ret +E(L(load_table3), X86_RET_STRUCT_2B) + movzwl %ax, %eax + movl %ecx, %esp + ret + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table3), X86_RET_UNUSED14) + ud2 +E(L(load_table3), X86_RET_UNUSED15) + ud2 + +L(UW31): + # cfi_endproc +ENDF(C(ffi_closure_STDCALL)) + +#if !FFI_NO_RAW_API + +#define raw_closure_S_FS (16+16+12) + + .balign 16 + .globl C(ffi_closure_raw_SYSV) + FFI_HIDDEN(C(ffi_closure_raw_SYSV)) +C(ffi_closure_raw_SYSV): +L(UW32): + # cfi_startproc + _CET_ENDBR + subl $raw_closure_S_FS, %esp +L(UW33): + # cfi_def_cfa_offset(raw_closure_S_FS + 4) + movl %ebx, raw_closure_S_FS-4(%esp) +L(UW34): + # cfi_rel_offset(%ebx, raw_closure_S_FS-4) + + movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */ + movl %edx, 12(%esp) + leal raw_closure_S_FS+4(%esp), %edx /* load raw_args */ + movl %edx, 8(%esp) + leal 16(%esp), %edx /* load &res */ + movl %edx, 4(%esp) + movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */ + movl %ebx, (%esp) + call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */ + + movl 20(%ebx), %eax /* load cif->flags */ + andl $X86_RET_TYPE_MASK, %eax +#ifdef __PIC__ + call C(__x86.get_pc_thunk.bx) +L(pc4): + leal L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx +#else + leal L(load_table4)(,%eax, 8), %ecx +#endif + movl raw_closure_S_FS-4(%esp), %ebx +L(UW35): + # cfi_restore(%ebx) + movl 16(%esp), %eax /* Optimistic load */ + jmp *%ecx + + .balign 8 +L(load_table4): +E(L(load_table4), X86_RET_FLOAT) + flds 16(%esp) + jmp L(e4) +E(L(load_table4), X86_RET_DOUBLE) + fldl 16(%esp) + jmp L(e4) +E(L(load_table4), X86_RET_LDOUBLE) + fldt 16(%esp) + jmp L(e4) +E(L(load_table4), X86_RET_SINT8) + movsbl %al, %eax + jmp L(e4) +E(L(load_table4), X86_RET_SINT16) + movswl %ax, %eax + jmp L(e4) +E(L(load_table4), X86_RET_UINT8) + movzbl %al, %eax + jmp L(e4) +E(L(load_table4), X86_RET_UINT16) + movzwl %ax, %eax + jmp L(e4) +E(L(load_table4), X86_RET_INT64) + movl 16+4(%esp), %edx + jmp L(e4) +E(L(load_table4), X86_RET_INT32) + nop + /* fallthru */ +E(L(load_table4), X86_RET_VOID) +L(e4): + addl $raw_closure_S_FS, %esp +L(UW36): + # cfi_adjust_cfa_offset(-raw_closure_S_FS) + ret +L(UW37): + # cfi_adjust_cfa_offset(raw_closure_S_FS) +E(L(load_table4), X86_RET_STRUCTPOP) + addl $raw_closure_S_FS, %esp +L(UW38): + # cfi_adjust_cfa_offset(-raw_closure_S_FS) + ret $4 +L(UW39): + # cfi_adjust_cfa_offset(raw_closure_S_FS) +E(L(load_table4), X86_RET_STRUCTARG) + jmp L(e4) +E(L(load_table4), X86_RET_STRUCT_1B) + movzbl %al, %eax + jmp L(e4) +E(L(load_table4), X86_RET_STRUCT_2B) + movzwl %ax, %eax + jmp L(e4) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table4), X86_RET_UNUSED14) + ud2 +E(L(load_table4), X86_RET_UNUSED15) + ud2 + +L(UW40): + # cfi_endproc +ENDF(C(ffi_closure_raw_SYSV)) + +#define raw_closure_T_FS (16+16+8) + + .balign 16 + .globl C(ffi_closure_raw_THISCALL) + FFI_HIDDEN(C(ffi_closure_raw_THISCALL)) +C(ffi_closure_raw_THISCALL): +L(UW41): + # cfi_startproc + _CET_ENDBR + /* Rearrange the stack such that %ecx is the first argument. + This means moving the return address. */ + popl %edx +L(UW42): + # cfi_def_cfa_offset(0) + # cfi_register(%eip, %edx) + pushl %ecx +L(UW43): + # cfi_adjust_cfa_offset(4) + pushl %edx +L(UW44): + # cfi_adjust_cfa_offset(4) + # cfi_rel_offset(%eip, 0) + subl $raw_closure_T_FS, %esp +L(UW45): + # cfi_adjust_cfa_offset(raw_closure_T_FS) + movl %ebx, raw_closure_T_FS-4(%esp) +L(UW46): + # cfi_rel_offset(%ebx, raw_closure_T_FS-4) + + movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */ + movl %edx, 12(%esp) + leal raw_closure_T_FS+4(%esp), %edx /* load raw_args */ + movl %edx, 8(%esp) + leal 16(%esp), %edx /* load &res */ + movl %edx, 4(%esp) + movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */ + movl %ebx, (%esp) + call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */ + + movl 20(%ebx), %eax /* load cif->flags */ + andl $X86_RET_TYPE_MASK, %eax +#ifdef __PIC__ + call C(__x86.get_pc_thunk.bx) +L(pc5): + leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx +#else + leal L(load_table5)(,%eax, 8), %ecx +#endif + movl raw_closure_T_FS-4(%esp), %ebx +L(UW47): + # cfi_restore(%ebx) + movl 16(%esp), %eax /* Optimistic load */ + jmp *%ecx + + .balign 8 +L(load_table5): +E(L(load_table5), X86_RET_FLOAT) + flds 16(%esp) + jmp L(e5) +E(L(load_table5), X86_RET_DOUBLE) + fldl 16(%esp) + jmp L(e5) +E(L(load_table5), X86_RET_LDOUBLE) + fldt 16(%esp) + jmp L(e5) +E(L(load_table5), X86_RET_SINT8) + movsbl %al, %eax + jmp L(e5) +E(L(load_table5), X86_RET_SINT16) + movswl %ax, %eax + jmp L(e5) +E(L(load_table5), X86_RET_UINT8) + movzbl %al, %eax + jmp L(e5) +E(L(load_table5), X86_RET_UINT16) + movzwl %ax, %eax + jmp L(e5) +E(L(load_table5), X86_RET_INT64) + movl 16+4(%esp), %edx + jmp L(e5) +E(L(load_table5), X86_RET_INT32) + nop + /* fallthru */ +E(L(load_table5), X86_RET_VOID) +L(e5): + addl $raw_closure_T_FS, %esp +L(UW48): + # cfi_adjust_cfa_offset(-raw_closure_T_FS) + /* Remove the extra %ecx argument we pushed. */ + ret $4 +L(UW49): + # cfi_adjust_cfa_offset(raw_closure_T_FS) +E(L(load_table5), X86_RET_STRUCTPOP) + addl $raw_closure_T_FS, %esp +L(UW50): + # cfi_adjust_cfa_offset(-raw_closure_T_FS) + ret $8 +L(UW51): + # cfi_adjust_cfa_offset(raw_closure_T_FS) +E(L(load_table5), X86_RET_STRUCTARG) + jmp L(e5) +E(L(load_table5), X86_RET_STRUCT_1B) + movzbl %al, %eax + jmp L(e5) +E(L(load_table5), X86_RET_STRUCT_2B) + movzwl %ax, %eax + jmp L(e5) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table5), X86_RET_UNUSED14) + ud2 +E(L(load_table5), X86_RET_UNUSED15) + ud2 + +L(UW52): + # cfi_endproc +ENDF(C(ffi_closure_raw_THISCALL)) + +#endif /* !FFI_NO_RAW_API */ + +#ifdef X86_DARWIN +# define COMDAT(X) \ + .section __TEXT,__text,coalesced,pure_instructions; \ + .weak_definition X; \ + FFI_HIDDEN(X) +#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__)) +# define COMDAT(X) \ + .section .text.X,"axG",@progbits,X,comdat; \ + .globl X; \ + FFI_HIDDEN(X) +#else +# define COMDAT(X) +#endif + +#if defined(__PIC__) + COMDAT(C(__x86.get_pc_thunk.bx)) +C(__x86.get_pc_thunk.bx): + movl (%esp), %ebx + ret +ENDF(C(__x86.get_pc_thunk.bx)) +# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE + COMDAT(C(__x86.get_pc_thunk.dx)) +C(__x86.get_pc_thunk.dx): + movl (%esp), %edx + ret +ENDF(C(__x86.get_pc_thunk.dx)) +#endif /* DARWIN || HIDDEN */ +#endif /* __PIC__ */ + +/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ + +#ifdef __APPLE__ +.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +EHFrame0: +#elif defined(X86_WIN32) +.section .eh_frame,"r" +#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) +.section .eh_frame,EH_FRAME_FLAGS,@unwind +#else +.section .eh_frame,EH_FRAME_FLAGS,@progbits +#endif + +#ifdef HAVE_AS_X86_PCREL +# define PCREL(X) X - . +#else +# define PCREL(X) X@rel +#endif + +/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ +#define ADV(N, P) .byte 2, L(N)-L(P) + + .balign 4 +L(CIE): + .set L(set0),L(ECIE)-L(SCIE) + .long L(set0) /* CIE Length */ +L(SCIE): + .long 0 /* CIE Identifier Tag */ + .byte 1 /* CIE Version */ + .ascii "zR\0" /* CIE Augmentation */ + .byte 1 /* CIE Code Alignment Factor */ + .byte 0x7c /* CIE Data Alignment Factor */ + .byte 0x8 /* CIE RA Column */ + .byte 1 /* Augmentation size */ + .byte 0x1b /* FDE Encoding (pcrel sdata4) */ + .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */ + .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */ + .balign 4 +L(ECIE): + + .set L(set1),L(EFDE1)-L(SFDE1) + .long L(set1) /* FDE Length */ +L(SFDE1): + .long L(SFDE1)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW0)) /* Initial location */ + .long L(UW5)-L(UW0) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW1, UW0) + .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */ + .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */ + ADV(UW2, UW1) + .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */ + ADV(UW3, UW2) + .byte 0xa /* DW_CFA_remember_state */ + .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */ + .byte 0xc0+3 /* DW_CFA_restore, %ebx */ + .byte 0xc0+5 /* DW_CFA_restore, %ebp */ + ADV(UW4, UW3) + .byte 0xb /* DW_CFA_restore_state */ + .balign 4 +L(EFDE1): + + .set L(set2),L(EFDE2)-L(SFDE2) + .long L(set2) /* FDE Length */ +L(SFDE2): + .long L(SFDE2)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW6)) /* Initial location */ + .long L(UW8)-L(UW6) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW7, UW6) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE2): + + .set L(set3),L(EFDE3)-L(SFDE3) + .long L(set3) /* FDE Length */ +L(SFDE3): + .long L(SFDE3)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW9)) /* Initial location */ + .long L(UW11)-L(UW9) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW10, UW9) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE3): + + .set L(set4),L(EFDE4)-L(SFDE4) + .long L(set4) /* FDE Length */ +L(SFDE4): + .long L(SFDE4)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW12)) /* Initial location */ + .long L(UW20)-L(UW12) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW13, UW12) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ +#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX + ADV(UW14, UW13) + .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ + ADV(UW15, UW14) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW16, UW15) +#else + ADV(UW16, UW13) +#endif + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW17, UW16) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW18, UW17) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW19, UW18) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE4): + + .set L(set5),L(EFDE5)-L(SFDE5) + .long L(set5) /* FDE Length */ +L(SFDE5): + .long L(SFDE5)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW21)) /* Initial location */ + .long L(UW23)-L(UW21) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW22, UW21) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE5): + + .set L(set6),L(EFDE6)-L(SFDE6) + .long L(set6) /* FDE Length */ +L(SFDE6): + .long L(SFDE6)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW24)) /* Initial location */ + .long L(UW26)-L(UW24) /* Address range */ + .byte 0 /* Augmentation size */ + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */ + ADV(UW25, UW24) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE6): + + .set L(set7),L(EFDE7)-L(SFDE7) + .long L(set7) /* FDE Length */ +L(SFDE7): + .long L(SFDE7)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW27)) /* Initial location */ + .long L(UW31)-L(UW27) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW28, UW27) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ +#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX + ADV(UW29, UW28) + .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ + ADV(UW30, UW29) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ +#endif + .balign 4 +L(EFDE7): + +#if !FFI_NO_RAW_API + .set L(set8),L(EFDE8)-L(SFDE8) + .long L(set8) /* FDE Length */ +L(SFDE8): + .long L(SFDE8)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW32)) /* Initial location */ + .long L(UW40)-L(UW32) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW33, UW32) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW34, UW33) + .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */ + ADV(UW35, UW34) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW36, UW35) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW37, UW36) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW38, UW37) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW39, UW38) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE8): + + .set L(set9),L(EFDE9)-L(SFDE9) + .long L(set9) /* FDE Length */ +L(SFDE9): + .long L(SFDE9)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW41)) /* Initial location */ + .long L(UW52)-L(UW41) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW42, UW41) + .byte 0xe, 0 /* DW_CFA_def_cfa_offset */ + .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */ + ADV(UW43, UW42) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW44, UW43) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */ + ADV(UW45, UW44) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + ADV(UW46, UW45) + .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */ + ADV(UW47, UW46) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW48, UW47) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + ADV(UW49, UW48) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + ADV(UW50, UW49) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + ADV(UW51, UW50) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE9): +#endif /* !FFI_NO_RAW_API */ + +#ifdef _WIN32 + .def @feat.00; + .scl 3; + .type 0; + .endef + .globl @feat.00 +@feat.00 = 1 +#endif + +#ifdef __APPLE__ + .subsections_via_symbols + .section __LD,__compact_unwind,regular,debug + + /* compact unwind for ffi_call_i386 */ + .long C(ffi_call_i386) + .set L1,L(UW5)-L(UW0) + .long L1 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_go_closure_EAX */ + .long C(ffi_go_closure_EAX) + .set L2,L(UW8)-L(UW6) + .long L2 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_go_closure_ECX */ + .long C(ffi_go_closure_ECX) + .set L3,L(UW11)-L(UW9) + .long L3 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_closure_i386 */ + .long C(ffi_closure_i386) + .set L4,L(UW20)-L(UW12) + .long L4 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_go_closure_STDCALL */ + .long C(ffi_go_closure_STDCALL) + .set L5,L(UW23)-L(UW21) + .long L5 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_closure_REGISTER */ + .long C(ffi_closure_REGISTER) + .set L6,L(UW26)-L(UW24) + .long L6 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_closure_STDCALL */ + .long C(ffi_closure_STDCALL) + .set L7,L(UW31)-L(UW27) + .long L7 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_closure_raw_SYSV */ + .long C(ffi_closure_raw_SYSV) + .set L8,L(UW40)-L(UW32) + .long L8 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 + + /* compact unwind for ffi_closure_raw_THISCALL */ + .long C(ffi_closure_raw_THISCALL) + .set L9,L(UW52)-L(UW41) + .long L9 + .long 0x04000000 /* use dwarf unwind info */ + .long 0 + .long 0 +#endif /* __APPLE__ */ + +#endif /* ifndef _MSC_VER */ +#endif /* ifdef __i386__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv_intel.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv_intel.S new file mode 100644 index 0000000..3cafd71 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/sysv_intel.S @@ -0,0 +1,995 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2017 Anthony Green + - Copyright (c) 2013 The Written Word, Inc. + - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. + + X86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef __x86_64__ +#ifdef _MSC_VER + +#define LIBFFI_ASM +#include +#include +#include +#include "internal.h" + +#define C2(X, Y) X ## Y +#define C1(X, Y) C2(X, Y) +#define L(X) C1(L, X) +# define ENDF(X) X ENDP + +/* This macro allows the safe creation of jump tables without an + actual table. The entry points into the table are all 8 bytes. + The use of ORG asserts that we're at the correct location. */ +/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ +#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +# define E(BASE, X) ALIGN 8 +#else +# define E(BASE, X) ALIGN 8; ORG BASE + X * 8 +#endif + + .686P + .MODEL FLAT + +EXTRN @ffi_closure_inner@8:PROC +_TEXT SEGMENT + +/* This is declared as + + void ffi_call_i386(struct call_frame *frame, char *argp) + __attribute__((fastcall)); + + Thus the arguments are present in + + ecx: frame + edx: argp +*/ + +ALIGN 16 +PUBLIC @ffi_call_i386@8 +@ffi_call_i386@8 PROC +L(UW0): + cfi_startproc + #if !HAVE_FASTCALL + mov ecx, [esp+4] + mov edx, [esp+8] + #endif + mov eax, [esp] /* move the return address */ + mov [ecx], ebp /* store ebp into local frame */ + mov [ecx+4], eax /* store retaddr into local frame */ + + /* New stack frame based off ebp. This is a itty bit of unwind + trickery in that the CFA *has* changed. There is no easy way + to describe it correctly on entry to the function. Fortunately, + it doesn't matter too much since at all points we can correctly + unwind back to ffi_call. Note that the location to which we + moved the return address is (the new) CFA-4, so from the + perspective of the unwind info, it hasn't moved. */ + mov ebp, ecx +L(UW1): + // cfi_def_cfa(%ebp, 8) + // cfi_rel_offset(%ebp, 0) + + mov esp, edx /* set outgoing argument stack */ + mov eax, [20+R_EAX*4+ebp] /* set register arguments */ + mov edx, [20+R_EDX*4+ebp] + mov ecx, [20+R_ECX*4+ebp] + + call dword ptr [ebp+8] + + mov ecx, [12+ebp] /* load return type code */ + mov [ebp+8], ebx /* preserve %ebx */ +L(UW2): + // cfi_rel_offset(%ebx, 8) + + and ecx, X86_RET_TYPE_MASK + lea ebx, [L(store_table) + ecx * 8] + mov ecx, [ebp+16] /* load result address */ + jmp ebx + + ALIGN 8 +L(store_table): +E(L(store_table), X86_RET_FLOAT) + fstp DWORD PTR [ecx] + jmp L(e1) +E(L(store_table), X86_RET_DOUBLE) + fstp QWORD PTR [ecx] + jmp L(e1) +E(L(store_table), X86_RET_LDOUBLE) + fstp QWORD PTR [ecx] + jmp L(e1) +E(L(store_table), X86_RET_SINT8) + movsx eax, al + mov [ecx], eax + jmp L(e1) +E(L(store_table), X86_RET_SINT16) + movsx eax, ax + mov [ecx], eax + jmp L(e1) +E(L(store_table), X86_RET_UINT8) + movzx eax, al + mov [ecx], eax + jmp L(e1) +E(L(store_table), X86_RET_UINT16) + movzx eax, ax + mov [ecx], eax + jmp L(e1) +E(L(store_table), X86_RET_INT64) + mov [ecx+4], edx + /* fallthru */ +E(L(store_table), X86_RET_int 32) + mov [ecx], eax + /* fallthru */ +E(L(store_table), X86_RET_VOID) +L(e1): + mov ebx, [ebp+8] + mov esp, ebp + pop ebp +L(UW3): + // cfi_remember_state + // cfi_def_cfa(%esp, 4) + // cfi_restore(%ebx) + // cfi_restore(%ebp) + ret +L(UW4): + // cfi_restore_state + +E(L(store_table), X86_RET_STRUCTPOP) + jmp L(e1) +E(L(store_table), X86_RET_STRUCTARG) + jmp L(e1) +E(L(store_table), X86_RET_STRUCT_1B) + mov [ecx], al + jmp L(e1) +E(L(store_table), X86_RET_STRUCT_2B) + mov [ecx], ax + jmp L(e1) + + /* Fill out the table so that bad values are predictable. */ +E(L(store_table), X86_RET_UNUSED14) + int 3 +E(L(store_table), X86_RET_UNUSED15) + int 3 + +L(UW5): + // cfi_endproc +ENDF(@ffi_call_i386@8) + +/* The inner helper is declared as + + void ffi_closure_inner(struct closure_frame *frame, char *argp) + __attribute_((fastcall)) + + Thus the arguments are placed in + + ecx: frame + edx: argp +*/ + +/* Macros to help setting up the closure_data structure. */ + +#if HAVE_FASTCALL +# define closure_FS (40 + 4) +# define closure_CF 0 +#else +# define closure_FS (8 + 40 + 12) +# define closure_CF 8 +#endif + +FFI_CLOSURE_SAVE_REGS MACRO + mov [esp + closure_CF+16+R_EAX*4], eax + mov [esp + closure_CF+16+R_EDX*4], edx + mov [esp + closure_CF+16+R_ECX*4], ecx +ENDM + +FFI_CLOSURE_COPY_TRAMP_DATA MACRO + mov edx, [eax+FFI_TRAMPOLINE_SIZE] /* copy cif */ + mov ecx, [eax+FFI_TRAMPOLINE_SIZE+4] /* copy fun */ + mov eax, [eax+FFI_TRAMPOLINE_SIZE+8]; /* copy user_data */ + mov [esp+closure_CF+28], edx + mov [esp+closure_CF+32], ecx + mov [esp+closure_CF+36], eax +ENDM + +#if HAVE_FASTCALL +FFI_CLOSURE_PREP_CALL MACRO + mov ecx, esp /* load closure_data */ + lea edx, [esp+closure_FS+4] /* load incoming stack */ +ENDM +#else +FFI_CLOSURE_PREP_CALL MACRO + lea ecx, [esp+closure_CF] /* load closure_data */ + lea edx, [esp+closure_FS+4] /* load incoming stack */ + mov [esp], ecx + mov [esp+4], edx +ENDM +#endif + +FFI_CLOSURE_CALL_INNER MACRO UWN + call @ffi_closure_inner@8 +ENDM + +FFI_CLOSURE_MASK_AND_JUMP MACRO LABEL + and eax, X86_RET_TYPE_MASK + lea edx, [LABEL+eax*8] + mov eax, [esp+closure_CF] /* optimiztic load */ + jmp edx +ENDM + +ALIGN 16 +PUBLIC ffi_go_closure_EAX +ffi_go_closure_EAX PROC C +L(UW6): + // cfi_startproc + sub esp, closure_FS +L(UW7): + // cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + mov edx, [eax+4] /* copy cif */ + mov ecx, [eax +8] /* copy fun */ + mov [esp+closure_CF+28], edx + mov [esp+closure_CF+32], ecx + mov [esp+closure_CF+36], eax /* closure is user_data */ + jmp L(do_closure_i386) +L(UW8): + // cfi_endproc +ENDF(ffi_go_closure_EAX) + +ALIGN 16 +PUBLIC ffi_go_closure_ECX +ffi_go_closure_ECX PROC C +L(UW9): + // cfi_startproc + sub esp, closure_FS +L(UW10): + // cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + mov edx, [ecx+4] /* copy cif */ + mov eax, [ecx+8] /* copy fun */ + mov [esp+closure_CF+28], edx + mov [esp+closure_CF+32], eax + mov [esp+closure_CF+36], ecx /* closure is user_data */ + jmp L(do_closure_i386) +L(UW11): + // cfi_endproc +ENDF(ffi_go_closure_ECX) + +/* The closure entry points are reached from the ffi_closure trampoline. + On entry, %eax contains the address of the ffi_closure. */ + +ALIGN 16 +PUBLIC ffi_closure_i386 +ffi_closure_i386 PROC C +L(UW12): + // cfi_startproc + sub esp, closure_FS +L(UW13): + // cfi_def_cfa_offset(closure_FS + 4) + + FFI_CLOSURE_SAVE_REGS + FFI_CLOSURE_COPY_TRAMP_DATA + + /* Entry point from preceeding Go closures. */ +L(do_closure_i386):: + + FFI_CLOSURE_PREP_CALL + FFI_CLOSURE_CALL_INNER(14) + FFI_CLOSURE_MASK_AND_JUMP L(C1(load_table,2)) + + ALIGN 8 +L(load_table2): +E(L(load_table2), X86_RET_FLOAT) + fld dword ptr [esp+closure_CF] + jmp L(e2) +E(L(load_table2), X86_RET_DOUBLE) + fld qword ptr [esp+closure_CF] + jmp L(e2) +E(L(load_table2), X86_RET_LDOUBLE) + fld qword ptr [esp+closure_CF] + jmp L(e2) +E(L(load_table2), X86_RET_SINT8) + movsx eax, al + jmp L(e2) +E(L(load_table2), X86_RET_SINT16) + movsx eax, ax + jmp L(e2) +E(L(load_table2), X86_RET_UINT8) + movzx eax, al + jmp L(e2) +E(L(load_table2), X86_RET_UINT16) + movzx eax, ax + jmp L(e2) +E(L(load_table2), X86_RET_INT64) + mov edx, [esp+closure_CF+4] + jmp L(e2) +E(L(load_table2), X86_RET_INT32) + nop + /* fallthru */ +E(L(load_table2), X86_RET_VOID) +L(e2): + add esp, closure_FS +L(UW16): + // cfi_adjust_cfa_offset(-closure_FS) + ret +L(UW17): + // cfi_adjust_cfa_offset(closure_FS) +E(L(load_table2), X86_RET_STRUCTPOP) + add esp, closure_FS +L(UW18): + // cfi_adjust_cfa_offset(-closure_FS) + ret 4 +L(UW19): + // cfi_adjust_cfa_offset(closure_FS) +E(L(load_table2), X86_RET_STRUCTARG) + jmp L(e2) +E(L(load_table2), X86_RET_STRUCT_1B) + movzx eax, al + jmp L(e2) +E(L(load_table2), X86_RET_STRUCT_2B) + movzx eax, ax + jmp L(e2) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table2), X86_RET_UNUSED14) + int 3 +E(L(load_table2), X86_RET_UNUSED15) + int 3 + +L(UW20): + // cfi_endproc +ENDF(ffi_closure_i386) + +ALIGN 16 +PUBLIC ffi_go_closure_STDCALL +ffi_go_closure_STDCALL PROC C +L(UW21): + // cfi_startproc + sub esp, closure_FS +L(UW22): + // cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + mov edx, [ecx+4] /* copy cif */ + mov eax, [ecx+8] /* copy fun */ + mov [esp+closure_CF+28], edx + mov [esp+closure_CF+32], eax + mov [esp+closure_CF+36], ecx /* closure is user_data */ + jmp L(do_closure_STDCALL) +L(UW23): + // cfi_endproc +ENDF(ffi_go_closure_STDCALL) + +/* For REGISTER, we have no available parameter registers, and so we + enter here having pushed the closure onto the stack. */ + +ALIGN 16 +PUBLIC ffi_closure_REGISTER +ffi_closure_REGISTER PROC C +L(UW24): + // cfi_startproc + // cfi_def_cfa(%esp, 8) + // cfi_offset(%eip, -8) + sub esp, closure_FS-4 +L(UW25): + // cfi_def_cfa_offset(closure_FS + 4) + FFI_CLOSURE_SAVE_REGS + mov ecx, [esp+closure_FS-4] /* load retaddr */ + mov eax, [esp+closure_FS] /* load closure */ + mov [esp+closure_FS], ecx /* move retaddr */ + jmp L(do_closure_REGISTER) +L(UW26): + // cfi_endproc +ENDF(ffi_closure_REGISTER) + +/* For STDCALL (and others), we need to pop N bytes of arguments off + the stack following the closure. The amount needing to be popped + is returned to us from ffi_closure_inner. */ + +ALIGN 16 +PUBLIC ffi_closure_STDCALL +ffi_closure_STDCALL PROC C +L(UW27): + // cfi_startproc + sub esp, closure_FS +L(UW28): + // cfi_def_cfa_offset(closure_FS + 4) + + FFI_CLOSURE_SAVE_REGS + + /* Entry point from ffi_closure_REGISTER. */ +L(do_closure_REGISTER):: + + FFI_CLOSURE_COPY_TRAMP_DATA + + /* Entry point from preceeding Go closure. */ +L(do_closure_STDCALL):: + + FFI_CLOSURE_PREP_CALL + FFI_CLOSURE_CALL_INNER(29) + + mov ecx, eax + shr ecx, X86_RET_POP_SHIFT /* isolate pop count */ + lea ecx, [esp+closure_FS+ecx] /* compute popped esp */ + mov edx, [esp+closure_FS] /* move return address */ + mov [ecx], edx + + /* From this point on, the value of %esp upon return is %ecx+4, + and we've copied the return address to %ecx to make return easy. + There's no point in representing this in the unwind info, as + there is always a window between the mov and the ret which + will be wrong from one point of view or another. */ + + FFI_CLOSURE_MASK_AND_JUMP L(C1(load_table,3)) + + ALIGN 8 +L(load_table3): +E(L(load_table3), X86_RET_FLOAT) + fld DWORD PTR [esp+closure_CF] + mov esp, ecx + ret +E(L(load_table3), X86_RET_DOUBLE) + fld QWORD PTR [esp+closure_CF] + mov esp, ecx + ret +E(L(load_table3), X86_RET_LDOUBLE) + fld QWORD PTR [esp+closure_CF] + mov esp, ecx + ret +E(L(load_table3), X86_RET_SINT8) + movsx eax, al + mov esp, ecx + ret +E(L(load_table3), X86_RET_SINT16) + movsx eax, ax + mov esp, ecx + ret +E(L(load_table3), X86_RET_UINT8) + movzx eax, al + mov esp, ecx + ret +E(L(load_table3), X86_RET_UINT16) + movzx eax, ax + mov esp, ecx + ret +E(L(load_table3), X86_RET_INT64) + mov edx, [esp+closure_CF+4] + mov esp, ecx + ret +E(L(load_table3), X86_RET_int 32) + mov esp, ecx + ret +E(L(load_table3), X86_RET_VOID) + mov esp, ecx + ret +E(L(load_table3), X86_RET_STRUCTPOP) + mov esp, ecx + ret +E(L(load_table3), X86_RET_STRUCTARG) + mov esp, ecx + ret +E(L(load_table3), X86_RET_STRUCT_1B) + movzx eax, al + mov esp, ecx + ret +E(L(load_table3), X86_RET_STRUCT_2B) + movzx eax, ax + mov esp, ecx + ret + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table3), X86_RET_UNUSED14) + int 3 +E(L(load_table3), X86_RET_UNUSED15) + int 3 + +L(UW31): + // cfi_endproc +ENDF(ffi_closure_STDCALL) + +#if !FFI_NO_RAW_API + +#define raw_closure_S_FS (16+16+12) + +ALIGN 16 +PUBLIC ffi_closure_raw_SYSV +ffi_closure_raw_SYSV PROC C +L(UW32): + // cfi_startproc + sub esp, raw_closure_S_FS +L(UW33): + // cfi_def_cfa_offset(raw_closure_S_FS + 4) + mov [esp+raw_closure_S_FS-4], ebx +L(UW34): + // cfi_rel_offset(%ebx, raw_closure_S_FS-4) + + mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ + mov [esp+12], edx + lea edx, [esp+raw_closure_S_FS+4] /* load raw_args */ + mov [esp+8], edx + lea edx, [esp+16] /* load &res */ + mov [esp+4], edx + mov ebx, [eax+FFI_TRAMPOLINE_SIZE] /* load cl->cif */ + mov [esp], ebx + call DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4] /* call cl->fun */ + + mov eax, [ebx+20] /* load cif->flags */ + and eax, X86_RET_TYPE_MASK +// #ifdef __PIC__ +// call __x86.get_pc_thunk.bx +// L(pc4): +// lea ecx, L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx +// #else + lea ecx, [L(load_table4)+eax+8] +// #endif + mov ebx, [esp+raw_closure_S_FS-4] +L(UW35): + // cfi_restore(%ebx) + mov eax, [esp+16] /* Optimistic load */ + jmp dword ptr [ecx] + + ALIGN 8 +L(load_table4): +E(L(load_table4), X86_RET_FLOAT) + fld DWORD PTR [esp +16] + jmp L(e4) +E(L(load_table4), X86_RET_DOUBLE) + fld QWORD PTR [esp +16] + jmp L(e4) +E(L(load_table4), X86_RET_LDOUBLE) + fld QWORD PTR [esp +16] + jmp L(e4) +E(L(load_table4), X86_RET_SINT8) + movsx eax, al + jmp L(e4) +E(L(load_table4), X86_RET_SINT16) + movsx eax, ax + jmp L(e4) +E(L(load_table4), X86_RET_UINT8) + movzx eax, al + jmp L(e4) +E(L(load_table4), X86_RET_UINT16) + movzx eax, ax + jmp L(e4) +E(L(load_table4), X86_RET_INT64) + mov edx, [esp+16+4] + jmp L(e4) +E(L(load_table4), X86_RET_int 32) + nop + /* fallthru */ +E(L(load_table4), X86_RET_VOID) +L(e4): + add esp, raw_closure_S_FS +L(UW36): + // cfi_adjust_cfa_offset(-raw_closure_S_FS) + ret +L(UW37): + // cfi_adjust_cfa_offset(raw_closure_S_FS) +E(L(load_table4), X86_RET_STRUCTPOP) + add esp, raw_closure_S_FS +L(UW38): + // cfi_adjust_cfa_offset(-raw_closure_S_FS) + ret 4 +L(UW39): + // cfi_adjust_cfa_offset(raw_closure_S_FS) +E(L(load_table4), X86_RET_STRUCTARG) + jmp L(e4) +E(L(load_table4), X86_RET_STRUCT_1B) + movzx eax, al + jmp L(e4) +E(L(load_table4), X86_RET_STRUCT_2B) + movzx eax, ax + jmp L(e4) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table4), X86_RET_UNUSED14) + int 3 +E(L(load_table4), X86_RET_UNUSED15) + int 3 + +L(UW40): + // cfi_endproc +ENDF(ffi_closure_raw_SYSV) + +#define raw_closure_T_FS (16+16+8) + +ALIGN 16 +PUBLIC ffi_closure_raw_THISCALL +ffi_closure_raw_THISCALL PROC C +L(UW41): + // cfi_startproc + /* Rearrange the stack such that %ecx is the first argument. + This means moving the return address. */ + pop edx +L(UW42): + // cfi_def_cfa_offset(0) + // cfi_register(%eip, %edx) + push ecx +L(UW43): + // cfi_adjust_cfa_offset(4) + push edx +L(UW44): + // cfi_adjust_cfa_offset(4) + // cfi_rel_offset(%eip, 0) + sub esp, raw_closure_T_FS +L(UW45): + // cfi_adjust_cfa_offset(raw_closure_T_FS) + mov [esp+raw_closure_T_FS-4], ebx +L(UW46): + // cfi_rel_offset(%ebx, raw_closure_T_FS-4) + + mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ + mov [esp+12], edx + lea edx, [esp+raw_closure_T_FS+4] /* load raw_args */ + mov [esp+8], edx + lea edx, [esp+16] /* load &res */ + mov [esp+4], edx + mov ebx, [eax+FFI_TRAMPOLINE_SIZE] /* load cl->cif */ + mov [esp], ebx + call DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4] /* call cl->fun */ + + mov eax, [ebx+20] /* load cif->flags */ + and eax, X86_RET_TYPE_MASK +// #ifdef __PIC__ +// call __x86.get_pc_thunk.bx +// L(pc5): +// leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx +// #else + lea ecx, [L(load_table5)+eax*8] +//#endif + mov ebx, [esp+raw_closure_T_FS-4] +L(UW47): + // cfi_restore(%ebx) + mov eax, [esp+16] /* Optimistic load */ + jmp DWORD PTR [ecx] + + AlIGN 4 +L(load_table5): +E(L(load_table5), X86_RET_FLOAT) + fld DWORD PTR [esp +16] + jmp L(e5) +E(L(load_table5), X86_RET_DOUBLE) + fld QWORD PTR [esp +16] + jmp L(e5) +E(L(load_table5), X86_RET_LDOUBLE) + fld QWORD PTR [esp+16] + jmp L(e5) +E(L(load_table5), X86_RET_SINT8) + movsx eax, al + jmp L(e5) +E(L(load_table5), X86_RET_SINT16) + movsx eax, ax + jmp L(e5) +E(L(load_table5), X86_RET_UINT8) + movzx eax, al + jmp L(e5) +E(L(load_table5), X86_RET_UINT16) + movzx eax, ax + jmp L(e5) +E(L(load_table5), X86_RET_INT64) + mov edx, [esp+16+4] + jmp L(e5) +E(L(load_table5), X86_RET_int 32) + nop + /* fallthru */ +E(L(load_table5), X86_RET_VOID) +L(e5): + add esp, raw_closure_T_FS +L(UW48): + // cfi_adjust_cfa_offset(-raw_closure_T_FS) + /* Remove the extra %ecx argument we pushed. */ + ret 4 +L(UW49): + // cfi_adjust_cfa_offset(raw_closure_T_FS) +E(L(load_table5), X86_RET_STRUCTPOP) + add esp, raw_closure_T_FS +L(UW50): + // cfi_adjust_cfa_offset(-raw_closure_T_FS) + ret 8 +L(UW51): + // cfi_adjust_cfa_offset(raw_closure_T_FS) +E(L(load_table5), X86_RET_STRUCTARG) + jmp L(e5) +E(L(load_table5), X86_RET_STRUCT_1B) + movzx eax, al + jmp L(e5) +E(L(load_table5), X86_RET_STRUCT_2B) + movzx eax, ax + jmp L(e5) + + /* Fill out the table so that bad values are predictable. */ +E(L(load_table5), X86_RET_UNUSED14) + int 3 +E(L(load_table5), X86_RET_UNUSED15) + int 3 + +L(UW52): + // cfi_endproc +ENDF(ffi_closure_raw_THISCALL) + +#endif /* !FFI_NO_RAW_API */ + +#ifdef X86_DARWIN +# define COMDAT(X) \ + .section __TEXT,__text,coalesced,pure_instructions; \ + .weak_definition X; \ + FFI_HIDDEN(X) +#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__)) +# define COMDAT(X) \ + .section .text.X,"axG",@progbits,X,comdat; \ + PUBLIC X; \ + FFI_HIDDEN(X) +#else +# define COMDAT(X) +#endif + +// #if defined(__PIC__) +// COMDAT(C(__x86.get_pc_thunk.bx)) +// C(__x86.get_pc_thunk.bx): +// movl (%esp), %ebx +// ret +// ENDF(C(__x86.get_pc_thunk.bx)) +// # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +// COMDAT(C(__x86.get_pc_thunk.dx)) +// C(__x86.get_pc_thunk.dx): +// movl (%esp), %edx +// ret +// ENDF(C(__x86.get_pc_thunk.dx)) +// #endif /* DARWIN || HIDDEN */ +// #endif /* __PIC__ */ + +#if 0 +/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ + +#ifdef __APPLE__ +.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +EHFrame0: +#elif defined(X86_WIN32) +.section .eh_frame,"r" +#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) +.section .eh_frame,EH_FRAME_FLAGS,@unwind +#else +.section .eh_frame,EH_FRAME_FLAGS,@progbits +#endif + +#ifdef HAVE_AS_X86_PCREL +# define PCREL(X) X - . +#else +# define PCREL(X) X@rel +#endif + +/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ +#define ADV(N, P) .byte 2, L(N)-L(P) + + .balign 4 +L(CIE): + .set L(set0),L(ECIE)-L(SCIE) + .long L(set0) /* CIE Length */ +L(SCIE): + .long 0 /* CIE Identifier Tag */ + .byte 1 /* CIE Version */ + .ascii "zR\0" /* CIE Augmentation */ + .byte 1 /* CIE Code Alignment Factor */ + .byte 0x7c /* CIE Data Alignment Factor */ + .byte 0x8 /* CIE RA Column */ + .byte 1 /* Augmentation size */ + .byte 0x1b /* FDE Encoding (pcrel sdata4) */ + .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */ + .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */ + .balign 4 +L(ECIE): + + .set L(set1),L(EFDE1)-L(SFDE1) + .long L(set1) /* FDE Length */ +L(SFDE1): + .long L(SFDE1)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW0)) /* Initial location */ + .long L(UW5)-L(UW0) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW1, UW0) + .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */ + .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */ + ADV(UW2, UW1) + .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */ + ADV(UW3, UW2) + .byte 0xa /* DW_CFA_remember_state */ + .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */ + .byte 0xc0+3 /* DW_CFA_restore, %ebx */ + .byte 0xc0+5 /* DW_CFA_restore, %ebp */ + ADV(UW4, UW3) + .byte 0xb /* DW_CFA_restore_state */ + .balign 4 +L(EFDE1): + + .set L(set2),L(EFDE2)-L(SFDE2) + .long L(set2) /* FDE Length */ +L(SFDE2): + .long L(SFDE2)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW6)) /* Initial location */ + .long L(UW8)-L(UW6) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW7, UW6) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE2): + + .set L(set3),L(EFDE3)-L(SFDE3) + .long L(set3) /* FDE Length */ +L(SFDE3): + .long L(SFDE3)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW9)) /* Initial location */ + .long L(UW11)-L(UW9) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW10, UW9) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE3): + + .set L(set4),L(EFDE4)-L(SFDE4) + .long L(set4) /* FDE Length */ +L(SFDE4): + .long L(SFDE4)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW12)) /* Initial location */ + .long L(UW20)-L(UW12) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW13, UW12) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ +#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX + ADV(UW14, UW13) + .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ + ADV(UW15, UW14) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW16, UW15) +#else + ADV(UW16, UW13) +#endif + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW17, UW16) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW18, UW17) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW19, UW18) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE4): + + .set L(set5),L(EFDE5)-L(SFDE5) + .long L(set5) /* FDE Length */ +L(SFDE5): + .long L(SFDE5)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW21)) /* Initial location */ + .long L(UW23)-L(UW21) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW22, UW21) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE5): + + .set L(set6),L(EFDE6)-L(SFDE6) + .long L(set6) /* FDE Length */ +L(SFDE6): + .long L(SFDE6)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW24)) /* Initial location */ + .long L(UW26)-L(UW24) /* Address range */ + .byte 0 /* Augmentation size */ + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */ + ADV(UW25, UW24) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE6): + + .set L(set7),L(EFDE7)-L(SFDE7) + .long L(set7) /* FDE Length */ +L(SFDE7): + .long L(SFDE7)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW27)) /* Initial location */ + .long L(UW31)-L(UW27) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW28, UW27) + .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ +#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX + ADV(UW29, UW28) + .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ + ADV(UW30, UW29) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ +#endif + .balign 4 +L(EFDE7): + +#if !FFI_NO_RAW_API + .set L(set8),L(EFDE8)-L(SFDE8) + .long L(set8) /* FDE Length */ +L(SFDE8): + .long L(SFDE8)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW32)) /* Initial location */ + .long L(UW40)-L(UW32) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW33, UW32) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW34, UW33) + .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */ + ADV(UW35, UW34) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW36, UW35) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW37, UW36) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + ADV(UW38, UW37) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW39, UW38) + .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE8): + + .set L(set9),L(EFDE9)-L(SFDE9) + .long L(set9) /* FDE Length */ +L(SFDE9): + .long L(SFDE9)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW41)) /* Initial location */ + .long L(UW52)-L(UW41) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW42, UW41) + .byte 0xe, 0 /* DW_CFA_def_cfa_offset */ + .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */ + ADV(UW43, UW42) + .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ + ADV(UW44, UW43) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */ + ADV(UW45, UW44) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + ADV(UW46, UW45) + .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */ + ADV(UW47, UW46) + .byte 0xc0+3 /* DW_CFA_restore %ebx */ + ADV(UW48, UW47) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + ADV(UW49, UW48) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + ADV(UW50, UW49) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ + ADV(UW51, UW50) + .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ + .balign 4 +L(EFDE9): +#endif /* !FFI_NO_RAW_API */ + +#ifdef _WIN32 + .def @feat.00; + .scl 3; + .type 0; + .endef + PUBLIC @feat.00 +@feat.00 = 1 +#endif + +#endif /* ifndef _MSC_VER */ +#endif /* ifndef __x86_64__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif +#endif + +END \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/unix64.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/unix64.S new file mode 100644 index 0000000..89d7db1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/unix64.S @@ -0,0 +1,621 @@ +/* ----------------------------------------------------------------------- + unix64.S - Copyright (c) 2013 The Written Word, Inc. + - Copyright (c) 2008 Red Hat, Inc + - Copyright (c) 2002 Bo Thorsen + + x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifdef __x86_64__ +#define LIBFFI_ASM +#include +#include +#include "internal64.h" +#include "asmnames.h" + + .text + +/* This macro allows the safe creation of jump tables without an + actual table. The entry points into the table are all 8 bytes. + The use of ORG asserts that we're at the correct location. */ +/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ +#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +# define E(BASE, X) .balign 8 +#else +# ifdef __CET__ +# define E(BASE, X) .balign 8; .org BASE + X * 16 +# else +# define E(BASE, X) .balign 8; .org BASE + X * 8 +# endif +#endif + +/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, + void *raddr, void (*fnaddr)(void)); + + Bit o trickiness here -- ARGS+BYTES is the base of the stack frame + for this function. This has been allocated by ffi_call. We also + deallocate some of the stack that has been alloca'd. */ + + .balign 8 + .globl C(ffi_call_unix64) + FFI_HIDDEN(C(ffi_call_unix64)) + +C(ffi_call_unix64): +L(UW0): + _CET_ENDBR + movq (%rsp), %r10 /* Load return address. */ + leaq (%rdi, %rsi), %rax /* Find local stack base. */ + movq %rdx, (%rax) /* Save flags. */ + movq %rcx, 8(%rax) /* Save raddr. */ + movq %rbp, 16(%rax) /* Save old frame pointer. */ + movq %r10, 24(%rax) /* Relocate return address. */ + movq %rax, %rbp /* Finalize local stack frame. */ + + /* New stack frame based off rbp. This is a itty bit of unwind + trickery in that the CFA *has* changed. There is no easy way + to describe it correctly on entry to the function. Fortunately, + it doesn't matter too much since at all points we can correctly + unwind back to ffi_call. Note that the location to which we + moved the return address is (the new) CFA-8, so from the + perspective of the unwind info, it hasn't moved. */ +L(UW1): + /* cfi_def_cfa(%rbp, 32) */ + /* cfi_rel_offset(%rbp, 16) */ + + movq %rdi, %r10 /* Save a copy of the register area. */ + movq %r8, %r11 /* Save a copy of the target fn. */ + + /* Load up all argument registers. */ + movq (%r10), %rdi + movq 0x08(%r10), %rsi + movq 0x10(%r10), %rdx + movq 0x18(%r10), %rcx + movq 0x20(%r10), %r8 + movq 0x28(%r10), %r9 + movl 0xb0(%r10), %eax /* Set number of SSE registers. */ + testl %eax, %eax + jnz L(load_sse) +L(ret_from_load_sse): + + /* Deallocate the reg arg area, except for r10, then load via pop. */ + leaq 0xb8(%r10), %rsp + popq %r10 + + /* Call the user function. */ + call *%r11 + + /* Deallocate stack arg area; local stack frame in redzone. */ + leaq 24(%rbp), %rsp + + movq 0(%rbp), %rcx /* Reload flags. */ + movq 8(%rbp), %rdi /* Reload raddr. */ + movq 16(%rbp), %rbp /* Reload old frame pointer. */ +L(UW2): + /* cfi_remember_state */ + /* cfi_def_cfa(%rsp, 8) */ + /* cfi_restore(%rbp) */ + + /* The first byte of the flags contains the FFI_TYPE. */ + cmpb $UNIX64_RET_LAST, %cl + movzbl %cl, %r10d + leaq L(store_table)(%rip), %r11 + ja L(sa) +#ifdef __CET__ + /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + + 4 bytes NOP padding double slot size to 16 bytes. */ + addl %r10d, %r10d +#endif + leaq (%r11, %r10, 8), %r10 + + /* Prep for the structure cases: scratch area in redzone. */ + leaq -20(%rsp), %rsi + jmp *%r10 + + .balign 8 +L(store_table): +E(L(store_table), UNIX64_RET_VOID) + _CET_ENDBR + ret +E(L(store_table), UNIX64_RET_UINT8) + _CET_ENDBR + movzbl %al, %eax + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_UINT16) + _CET_ENDBR + movzwl %ax, %eax + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_UINT32) + _CET_ENDBR + movl %eax, %eax + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_SINT8) + _CET_ENDBR + movsbq %al, %rax + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_SINT16) + _CET_ENDBR + movswq %ax, %rax + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_SINT32) + _CET_ENDBR + cltq + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_INT64) + _CET_ENDBR + movq %rax, (%rdi) + ret +E(L(store_table), UNIX64_RET_XMM32) + _CET_ENDBR + movd %xmm0, (%rdi) + ret +E(L(store_table), UNIX64_RET_XMM64) + _CET_ENDBR + movq %xmm0, (%rdi) + ret +E(L(store_table), UNIX64_RET_X87) + _CET_ENDBR + fstpt (%rdi) + ret +E(L(store_table), UNIX64_RET_X87_2) + _CET_ENDBR + fstpt (%rdi) + fstpt 16(%rdi) + ret +E(L(store_table), UNIX64_RET_ST_XMM0_RAX) + _CET_ENDBR + movq %rax, 8(%rsi) + jmp L(s3) +E(L(store_table), UNIX64_RET_ST_RAX_XMM0) + _CET_ENDBR + movq %xmm0, 8(%rsi) + jmp L(s2) +E(L(store_table), UNIX64_RET_ST_XMM0_XMM1) + _CET_ENDBR + movq %xmm1, 8(%rsi) + jmp L(s3) +E(L(store_table), UNIX64_RET_ST_RAX_RDX) + _CET_ENDBR + movq %rdx, 8(%rsi) +L(s2): + movq %rax, (%rsi) + shrl $UNIX64_SIZE_SHIFT, %ecx + rep movsb + ret + .balign 8 +L(s3): + movq %xmm0, (%rsi) + shrl $UNIX64_SIZE_SHIFT, %ecx + rep movsb + ret + +L(sa): call PLT(C(abort)) + + /* Many times we can avoid loading any SSE registers at all. + It's not worth an indirect jump to load the exact set of + SSE registers needed; zero or all is a good compromise. */ + .balign 2 +L(UW3): + /* cfi_restore_state */ +L(load_sse): + movdqa 0x30(%r10), %xmm0 + movdqa 0x40(%r10), %xmm1 + movdqa 0x50(%r10), %xmm2 + movdqa 0x60(%r10), %xmm3 + movdqa 0x70(%r10), %xmm4 + movdqa 0x80(%r10), %xmm5 + movdqa 0x90(%r10), %xmm6 + movdqa 0xa0(%r10), %xmm7 + jmp L(ret_from_load_sse) + +L(UW4): +ENDF(C(ffi_call_unix64)) + +/* 6 general registers, 8 vector registers, + 32 bytes of rvalue, 8 bytes of alignment. */ +#define ffi_closure_OFS_G 0 +#define ffi_closure_OFS_V (6*8) +#define ffi_closure_OFS_RVALUE (ffi_closure_OFS_V + 8*16) +#define ffi_closure_FS (ffi_closure_OFS_RVALUE + 32 + 8) + +/* The location of rvalue within the red zone after deallocating the frame. */ +#define ffi_closure_RED_RVALUE (ffi_closure_OFS_RVALUE - ffi_closure_FS) + + .balign 2 + .globl C(ffi_closure_unix64_sse) + FFI_HIDDEN(C(ffi_closure_unix64_sse)) + +C(ffi_closure_unix64_sse): +L(UW5): + _CET_ENDBR + subq $ffi_closure_FS, %rsp +L(UW6): + /* cfi_adjust_cfa_offset(ffi_closure_FS) */ + + movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp) + movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp) + movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp) + movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp) + movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp) + movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp) + movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp) + movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp) + jmp L(sse_entry1) + +L(UW7): +ENDF(C(ffi_closure_unix64_sse)) + + .balign 2 + .globl C(ffi_closure_unix64) + FFI_HIDDEN(C(ffi_closure_unix64)) + +C(ffi_closure_unix64): +L(UW8): + _CET_ENDBR + subq $ffi_closure_FS, %rsp +L(UW9): + /* cfi_adjust_cfa_offset(ffi_closure_FS) */ +L(sse_entry1): + movq %rdi, ffi_closure_OFS_G+0x00(%rsp) + movq %rsi, ffi_closure_OFS_G+0x08(%rsp) + movq %rdx, ffi_closure_OFS_G+0x10(%rsp) + movq %rcx, ffi_closure_OFS_G+0x18(%rsp) + movq %r8, ffi_closure_OFS_G+0x20(%rsp) + movq %r9, ffi_closure_OFS_G+0x28(%rsp) + +#ifdef __ILP32__ + movl FFI_TRAMPOLINE_SIZE(%r10), %edi /* Load cif */ + movl FFI_TRAMPOLINE_SIZE+4(%r10), %esi /* Load fun */ + movl FFI_TRAMPOLINE_SIZE+8(%r10), %edx /* Load user_data */ +#else + movq FFI_TRAMPOLINE_SIZE(%r10), %rdi /* Load cif */ + movq FFI_TRAMPOLINE_SIZE+8(%r10), %rsi /* Load fun */ + movq FFI_TRAMPOLINE_SIZE+16(%r10), %rdx /* Load user_data */ +#endif +L(do_closure): + leaq ffi_closure_OFS_RVALUE(%rsp), %rcx /* Load rvalue */ + movq %rsp, %r8 /* Load reg_args */ + leaq ffi_closure_FS+8(%rsp), %r9 /* Load argp */ + call PLT(C(ffi_closure_unix64_inner)) + + /* Deallocate stack frame early; return value is now in redzone. */ + addq $ffi_closure_FS, %rsp +L(UW10): + /* cfi_adjust_cfa_offset(-ffi_closure_FS) */ + + /* The first byte of the return value contains the FFI_TYPE. */ + cmpb $UNIX64_RET_LAST, %al + movzbl %al, %r10d + leaq L(load_table)(%rip), %r11 + ja L(la) +#ifdef __CET__ + /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + + 4 bytes NOP padding double slot size to 16 bytes. */ + addl %r10d, %r10d +#endif + leaq (%r11, %r10, 8), %r10 + leaq ffi_closure_RED_RVALUE(%rsp), %rsi + jmp *%r10 + + .balign 8 +L(load_table): +E(L(load_table), UNIX64_RET_VOID) + _CET_ENDBR + ret +E(L(load_table), UNIX64_RET_UINT8) + _CET_ENDBR + movzbl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_UINT16) + _CET_ENDBR + movzwl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_UINT32) + _CET_ENDBR + movl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_SINT8) + _CET_ENDBR + movsbl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_SINT16) + _CET_ENDBR + movswl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_SINT32) + _CET_ENDBR + movl (%rsi), %eax + ret +E(L(load_table), UNIX64_RET_INT64) + _CET_ENDBR + movq (%rsi), %rax + ret +E(L(load_table), UNIX64_RET_XMM32) + _CET_ENDBR + movd (%rsi), %xmm0 + ret +E(L(load_table), UNIX64_RET_XMM64) + _CET_ENDBR + movq (%rsi), %xmm0 + ret +E(L(load_table), UNIX64_RET_X87) + _CET_ENDBR + fldt (%rsi) + ret +E(L(load_table), UNIX64_RET_X87_2) + _CET_ENDBR + fldt 16(%rsi) + fldt (%rsi) + ret +E(L(load_table), UNIX64_RET_ST_XMM0_RAX) + _CET_ENDBR + movq 8(%rsi), %rax + jmp L(l3) +E(L(load_table), UNIX64_RET_ST_RAX_XMM0) + _CET_ENDBR + movq 8(%rsi), %xmm0 + jmp L(l2) +E(L(load_table), UNIX64_RET_ST_XMM0_XMM1) + _CET_ENDBR + movq 8(%rsi), %xmm1 + jmp L(l3) +E(L(load_table), UNIX64_RET_ST_RAX_RDX) + _CET_ENDBR + movq 8(%rsi), %rdx +L(l2): + movq (%rsi), %rax + ret + .balign 8 +L(l3): + movq (%rsi), %xmm0 + ret + +L(la): call PLT(C(abort)) + +L(UW11): +ENDF(C(ffi_closure_unix64)) + + .balign 2 + .globl C(ffi_go_closure_unix64_sse) + FFI_HIDDEN(C(ffi_go_closure_unix64_sse)) + +C(ffi_go_closure_unix64_sse): +L(UW12): + _CET_ENDBR + subq $ffi_closure_FS, %rsp +L(UW13): + /* cfi_adjust_cfa_offset(ffi_closure_FS) */ + + movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp) + movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp) + movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp) + movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp) + movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp) + movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp) + movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp) + movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp) + jmp L(sse_entry2) + +L(UW14): +ENDF(C(ffi_go_closure_unix64_sse)) + + .balign 2 + .globl C(ffi_go_closure_unix64) + FFI_HIDDEN(C(ffi_go_closure_unix64)) + +C(ffi_go_closure_unix64): +L(UW15): + _CET_ENDBR + subq $ffi_closure_FS, %rsp +L(UW16): + /* cfi_adjust_cfa_offset(ffi_closure_FS) */ +L(sse_entry2): + movq %rdi, ffi_closure_OFS_G+0x00(%rsp) + movq %rsi, ffi_closure_OFS_G+0x08(%rsp) + movq %rdx, ffi_closure_OFS_G+0x10(%rsp) + movq %rcx, ffi_closure_OFS_G+0x18(%rsp) + movq %r8, ffi_closure_OFS_G+0x20(%rsp) + movq %r9, ffi_closure_OFS_G+0x28(%rsp) + +#ifdef __ILP32__ + movl 4(%r10), %edi /* Load cif */ + movl 8(%r10), %esi /* Load fun */ + movl %r10d, %edx /* Load closure (user_data) */ +#else + movq 8(%r10), %rdi /* Load cif */ + movq 16(%r10), %rsi /* Load fun */ + movq %r10, %rdx /* Load closure (user_data) */ +#endif + jmp L(do_closure) + +L(UW17): +ENDF(C(ffi_go_closure_unix64)) + +/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ + +#ifdef __APPLE__ +.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support +EHFrame0: +#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) +.section .eh_frame,"a",@unwind +#else +.section .eh_frame,"a",@progbits +#endif + +#ifdef HAVE_AS_X86_PCREL +# define PCREL(X) X - . +#else +# define PCREL(X) X@rel +#endif + +/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ +#ifdef __CET__ +/* Use DW_CFA_advance_loc2 when IBT is enabled. */ +# define ADV(N, P) .byte 3; .2byte L(N)-L(P) +#else +# define ADV(N, P) .byte 2, L(N)-L(P) +#endif + + .balign 8 +L(CIE): + .set L(set0),L(ECIE)-L(SCIE) + .long L(set0) /* CIE Length */ +L(SCIE): + .long 0 /* CIE Identifier Tag */ + .byte 1 /* CIE Version */ + .ascii "zR\0" /* CIE Augmentation */ + .byte 1 /* CIE Code Alignment Factor */ + .byte 0x78 /* CIE Data Alignment Factor */ + .byte 0x10 /* CIE RA Column */ + .byte 1 /* Augmentation size */ + .byte 0x1b /* FDE Encoding (pcrel sdata4) */ + .byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp offset 8 */ + .byte 0x80+16, 1 /* DW_CFA_offset, %rip offset 1*-8 */ + .balign 8 +L(ECIE): + + .set L(set1),L(EFDE1)-L(SFDE1) + .long L(set1) /* FDE Length */ +L(SFDE1): + .long L(SFDE1)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW0)) /* Initial location */ + .long L(UW4)-L(UW0) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW1, UW0) + .byte 0xc, 6, 32 /* DW_CFA_def_cfa, %rbp 32 */ + .byte 0x80+6, 2 /* DW_CFA_offset, %rbp 2*-8 */ + ADV(UW2, UW1) + .byte 0xa /* DW_CFA_remember_state */ + .byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp 8 */ + .byte 0xc0+6 /* DW_CFA_restore, %rbp */ + ADV(UW3, UW2) + .byte 0xb /* DW_CFA_restore_state */ + .balign 8 +L(EFDE1): + + .set L(set2),L(EFDE2)-L(SFDE2) + .long L(set2) /* FDE Length */ +L(SFDE2): + .long L(SFDE2)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW5)) /* Initial location */ + .long L(UW7)-L(UW5) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW6, UW5) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ + .balign 8 +L(EFDE2): + + .set L(set3),L(EFDE3)-L(SFDE3) + .long L(set3) /* FDE Length */ +L(SFDE3): + .long L(SFDE3)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW8)) /* Initial location */ + .long L(UW11)-L(UW8) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW9, UW8) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ + ADV(UW10, UW9) + .byte 0xe, 8 /* DW_CFA_def_cfa_offset 8 */ +L(EFDE3): + + .set L(set4),L(EFDE4)-L(SFDE4) + .long L(set4) /* FDE Length */ +L(SFDE4): + .long L(SFDE4)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW12)) /* Initial location */ + .long L(UW14)-L(UW12) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW13, UW12) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ + .balign 8 +L(EFDE4): + + .set L(set5),L(EFDE5)-L(SFDE5) + .long L(set5) /* FDE Length */ +L(SFDE5): + .long L(SFDE5)-L(CIE) /* FDE CIE offset */ + .long PCREL(L(UW15)) /* Initial location */ + .long L(UW17)-L(UW15) /* Address range */ + .byte 0 /* Augmentation size */ + ADV(UW16, UW15) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ + .balign 8 +L(EFDE5): +#ifdef __APPLE__ + .subsections_via_symbols + .section __LD,__compact_unwind,regular,debug + + /* compact unwind for ffi_call_unix64 */ + .quad C(ffi_call_unix64) + .set L1,L(UW4)-L(UW0) + .long L1 + .long 0x04000000 /* use dwarf unwind info */ + .quad 0 + .quad 0 + + /* compact unwind for ffi_closure_unix64_sse */ + .quad C(ffi_closure_unix64_sse) + .set L2,L(UW7)-L(UW5) + .long L2 + .long 0x04000000 /* use dwarf unwind info */ + .quad 0 + .quad 0 + + /* compact unwind for ffi_closure_unix64 */ + .quad C(ffi_closure_unix64) + .set L3,L(UW11)-L(UW8) + .long L3 + .long 0x04000000 /* use dwarf unwind info */ + .quad 0 + .quad 0 + + /* compact unwind for ffi_go_closure_unix64_sse */ + .quad C(ffi_go_closure_unix64_sse) + .set L4,L(UW14)-L(UW12) + .long L4 + .long 0x04000000 /* use dwarf unwind info */ + .quad 0 + .quad 0 + + /* compact unwind for ffi_go_closure_unix64 */ + .quad C(ffi_go_closure_unix64) + .set L5,L(UW17)-L(UW15) + .long L5 + .long 0x04000000 /* use dwarf unwind info */ + .quad 0 + .quad 0 +#endif + +#endif /* __x86_64__ */ +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64.S new file mode 100644 index 0000000..8315e8b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64.S @@ -0,0 +1,241 @@ +#ifdef __x86_64__ +#define LIBFFI_ASM +#include +#include +#include +#include "asmnames.h" + +#if defined(HAVE_AS_CFI_PSEUDO_OP) + .cfi_sections .debug_frame +#endif + +#ifdef X86_WIN64 +#define SEH(...) __VA_ARGS__ +#define arg0 %rcx +#define arg1 %rdx +#define arg2 %r8 +#define arg3 %r9 +#else +#define SEH(...) +#define arg0 %rdi +#define arg1 %rsi +#define arg2 %rdx +#define arg3 %rcx +#endif + +/* This macro allows the safe creation of jump tables without an + actual table. The entry points into the table are all 8 bytes. + The use of ORG asserts that we're at the correct location. */ +/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ +#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +# define E(BASE, X) .balign 8 +#else +# define E(BASE, X) .balign 8; .org BASE + (X) * 8 +#endif + + .text + +/* ffi_call_win64 (void *stack, struct win64_call_frame *frame, void *r10) + + Bit o trickiness here -- FRAME is the base of the stack frame + for this function. This has been allocated by ffi_call. We also + deallocate some of the stack that has been alloca'd. */ + + .align 8 + .globl C(ffi_call_win64) + FFI_HIDDEN(C(ffi_call_win64)) + + SEH(.seh_proc ffi_call_win64) +C(ffi_call_win64): + cfi_startproc + _CET_ENDBR + /* Set up the local stack frame and install it in rbp/rsp. */ + movq (%rsp), %rax + movq %rbp, (arg1) + movq %rax, 8(arg1) + movq arg1, %rbp + cfi_def_cfa(%rbp, 16) + cfi_rel_offset(%rbp, 0) + SEH(.seh_pushreg %rbp) + SEH(.seh_setframe %rbp, 0) + SEH(.seh_endprologue) + movq arg0, %rsp + + movq arg2, %r10 + + /* Load all slots into both general and xmm registers. */ + movq (%rsp), %rcx + movsd (%rsp), %xmm0 + movq 8(%rsp), %rdx + movsd 8(%rsp), %xmm1 + movq 16(%rsp), %r8 + movsd 16(%rsp), %xmm2 + movq 24(%rsp), %r9 + movsd 24(%rsp), %xmm3 + + call *16(%rbp) + + movl 24(%rbp), %ecx + movq 32(%rbp), %r8 + leaq 0f(%rip), %r10 + cmpl $FFI_TYPE_SMALL_STRUCT_4B, %ecx + leaq (%r10, %rcx, 8), %r10 + ja 99f + _CET_NOTRACK jmp *%r10 + +/* Below, we're space constrained most of the time. Thus we eschew the + modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ +.macro epilogue + leaveq + cfi_remember_state + cfi_def_cfa(%rsp, 8) + cfi_restore(%rbp) + ret + cfi_restore_state +.endm + + .align 8 +0: +E(0b, FFI_TYPE_VOID) + epilogue +E(0b, FFI_TYPE_INT) + movslq %eax, %rax + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_FLOAT) + movss %xmm0, (%r8) + epilogue +E(0b, FFI_TYPE_DOUBLE) + movsd %xmm0, (%r8) + epilogue +// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. +E(0b, FFI_TYPE_DOUBLE + 1) + call PLT(C(abort)) +E(0b, FFI_TYPE_UINT8) + movzbl %al, %eax + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT8) + movsbq %al, %rax + jmp 98f +E(0b, FFI_TYPE_UINT16) + movzwl %ax, %eax + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT16) + movswq %ax, %rax + jmp 98f +E(0b, FFI_TYPE_UINT32) + movl %eax, %eax + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT32) + movslq %eax, %rax + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_UINT64) +98: movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT64) + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_STRUCT) + epilogue +E(0b, FFI_TYPE_POINTER) + movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_COMPLEX) + call PLT(C(abort)) +E(0b, FFI_TYPE_SMALL_STRUCT_1B) + movb %al, (%r8) + epilogue +E(0b, FFI_TYPE_SMALL_STRUCT_2B) + movw %ax, (%r8) + epilogue +E(0b, FFI_TYPE_SMALL_STRUCT_4B) + movl %eax, (%r8) + epilogue + + .align 8 +99: call PLT(C(abort)) + + epilogue + + cfi_endproc + SEH(.seh_endproc) + + +/* 32 bytes of outgoing register stack space, 8 bytes of alignment, + 16 bytes of result, 32 bytes of xmm registers. */ +#define ffi_clo_FS (32+8+16+32) +#define ffi_clo_OFF_R (32+8) +#define ffi_clo_OFF_X (32+8+16) + + .align 8 + .globl C(ffi_go_closure_win64) + FFI_HIDDEN(C(ffi_go_closure_win64)) + + SEH(.seh_proc ffi_go_closure_win64) +C(ffi_go_closure_win64): + cfi_startproc + _CET_ENDBR + /* Save all integer arguments into the incoming reg stack space. */ + movq %rcx, 8(%rsp) + movq %rdx, 16(%rsp) + movq %r8, 24(%rsp) + movq %r9, 32(%rsp) + + movq 8(%r10), %rcx /* load cif */ + movq 16(%r10), %rdx /* load fun */ + movq %r10, %r8 /* closure is user_data */ + jmp 0f + cfi_endproc + SEH(.seh_endproc) + + .align 8 + .globl C(ffi_closure_win64) + FFI_HIDDEN(C(ffi_closure_win64)) + + SEH(.seh_proc ffi_closure_win64) +C(ffi_closure_win64): + cfi_startproc + _CET_ENDBR + /* Save all integer arguments into the incoming reg stack space. */ + movq %rcx, 8(%rsp) + movq %rdx, 16(%rsp) + movq %r8, 24(%rsp) + movq %r9, 32(%rsp) + + movq FFI_TRAMPOLINE_SIZE(%r10), %rcx /* load cif */ + movq FFI_TRAMPOLINE_SIZE+8(%r10), %rdx /* load fun */ + movq FFI_TRAMPOLINE_SIZE+16(%r10), %r8 /* load user_data */ +0: + subq $ffi_clo_FS, %rsp + cfi_adjust_cfa_offset(ffi_clo_FS) + SEH(.seh_stackalloc ffi_clo_FS) + SEH(.seh_endprologue) + + /* Save all sse arguments into the stack frame. */ + movsd %xmm0, ffi_clo_OFF_X(%rsp) + movsd %xmm1, ffi_clo_OFF_X+8(%rsp) + movsd %xmm2, ffi_clo_OFF_X+16(%rsp) + movsd %xmm3, ffi_clo_OFF_X+24(%rsp) + + leaq ffi_clo_OFF_R(%rsp), %r9 + call PLT(C(ffi_closure_win64_inner)) + + /* Load the result into both possible result registers. */ + movq ffi_clo_OFF_R(%rsp), %rax + movsd ffi_clo_OFF_R(%rsp), %xmm0 + + addq $ffi_clo_FS, %rsp + cfi_adjust_cfa_offset(-ffi_clo_FS) + ret + + cfi_endproc + SEH(.seh_endproc) +#endif /* __x86_64__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64_intel.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64_intel.S new file mode 100644 index 0000000..970a4f9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/x86/win64_intel.S @@ -0,0 +1,238 @@ +#define LIBFFI_ASM +#include +#include +#include +#include "asmnames.h" + +#if defined(HAVE_AS_CFI_PSEUDO_OP) + .cfi_sections .debug_frame +#endif + +#ifdef X86_WIN64 +#define SEH(...) __VA_ARGS__ +#define arg0 rcx +#define arg1 rdx +#define arg2 r8 +#define arg3 r9 +#else +#define SEH(...) +#define arg0 rdi +#define arg1 rsi +#define arg2 rdx +#define arg3 rcx +#endif + +/* This macro allows the safe creation of jump tables without an + actual table. The entry points into the table are all 8 bytes. + The use of ORG asserts that we're at the correct location. */ +/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ +#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +# define E(BASE, X) ALIGN 8 +#else +# define E(BASE, X) ALIGN 8; ORG BASE + (X) * 8 +#endif + + .CODE + extern PLT(C(abort)):near + extern C(ffi_closure_win64_inner):near + +/* ffi_call_win64 (void *stack, struct win64_call_frame *frame, void *r10) + + Bit o trickiness here -- FRAME is the base of the stack frame + for this function. This has been allocated by ffi_call. We also + deallocate some of the stack that has been alloca'd. */ + + ALIGN 8 + PUBLIC C(ffi_call_win64) + + ; SEH(.safesh ffi_call_win64) +C(ffi_call_win64) proc SEH(frame) + cfi_startproc + /* Set up the local stack frame and install it in rbp/rsp. */ + mov RAX, [RSP] ; movq (%rsp), %rax + mov [arg1], RBP ; movq %rbp, (arg1) + mov [arg1 + 8], RAX; movq %rax, 8(arg1) + mov RBP, arg1; movq arg1, %rbp + cfi_def_cfa(rbp, 16) + cfi_rel_offset(rbp, 0) + SEH(.pushreg rbp) + SEH(.setframe rbp, 0) + SEH(.endprolog) + mov RSP, arg0 ; movq arg0, %rsp + + mov R10, arg2 ; movq arg2, %r10 + + /* Load all slots into both general and xmm registers. */ + mov RCX, [RSP] ; movq (%rsp), %rcx + movsd XMM0, qword ptr [RSP] ; movsd (%rsp), %xmm0 + mov RDX, [RSP + 8] ;movq 8(%rsp), %rdx + movsd XMM1, qword ptr [RSP + 8]; movsd 8(%rsp), %xmm1 + mov R8, [RSP + 16] ; movq 16(%rsp), %r8 + movsd XMM2, qword ptr [RSP + 16] ; movsd 16(%rsp), %xmm2 + mov R9, [RSP + 24] ; movq 24(%rsp), %r9 + movsd XMM3, qword ptr [RSP + 24] ;movsd 24(%rsp), %xmm3 + + CALL qword ptr [RBP + 16] ; call *16(%rbp) + + mov ECX, [RBP + 24] ; movl 24(%rbp), %ecx + mov R8, [RBP + 32] ; movq 32(%rbp), %r8 + LEA R10, ffi_call_win64_tab ; leaq 0f(%rip), %r10 + CMP ECX, FFI_TYPE_SMALL_STRUCT_4B ; cmpl $FFI_TYPE_SMALL_STRUCT_4B, %ecx + LEA R10, [R10 + RCX*8] ; leaq (%r10, %rcx, 8), %r10 + JA L99 ; ja 99f + JMP R10 ; jmp *%r10 + +/* Below, we're space constrained most of the time. Thus we eschew the + modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ +epilogue macro + LEAVE + cfi_remember_state + cfi_def_cfa(rsp, 8) + cfi_restore(rbp) + RET + cfi_restore_state +endm + + ALIGN 8 +ffi_call_win64_tab LABEL NEAR +E(0b, FFI_TYPE_VOID) + epilogue +E(0b, FFI_TYPE_INT) + movsxd rax, eax ; movslq %eax, %rax + mov qword ptr [r8], rax; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_FLOAT) + movss dword ptr [r8], xmm0 ; movss %xmm0, (%r8) + epilogue +E(0b, FFI_TYPE_DOUBLE) + movsd qword ptr[r8], xmm0; movsd %xmm0, (%r8) + epilogue +// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. +E(0b, FFI_TYPE_DOUBLE + 1) + call PLT(C(abort)) +E(0b, FFI_TYPE_UINT8) + movzx eax, al ;movzbl %al, %eax + mov qword ptr[r8], rax; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT8) + movsx rax, al ; movsbq %al, %rax + jmp L98 +E(0b, FFI_TYPE_UINT16) + movzx eax, ax ; movzwl %ax, %eax + mov qword ptr[r8], rax; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT16) + movsx rax, ax; movswq %ax, %rax + jmp L98 +E(0b, FFI_TYPE_UINT32) + mov eax, eax; movl %eax, %eax + mov qword ptr[r8], rax ; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT32) + movsxd rax, eax; movslq %eax, %rax + mov qword ptr [r8], rax; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_UINT64) +L98 LABEL near + mov qword ptr [r8], rax ; movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_SINT64) + mov qword ptr [r8], rax;movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_STRUCT) + epilogue +E(0b, FFI_TYPE_POINTER) + mov qword ptr [r8], rax ;movq %rax, (%r8) + epilogue +E(0b, FFI_TYPE_COMPLEX) + call PLT(C(abort)) +E(0b, FFI_TYPE_SMALL_STRUCT_1B) + mov byte ptr [r8], al ; movb %al, (%r8) + epilogue +E(0b, FFI_TYPE_SMALL_STRUCT_2B) + mov word ptr [r8], ax ; movw %ax, (%r8) + epilogue +E(0b, FFI_TYPE_SMALL_STRUCT_4B) + mov dword ptr [r8], eax ; movl %eax, (%r8) + epilogue + + align 8 +L99 LABEL near + call PLT(C(abort)) + + epilogue + + cfi_endproc + C(ffi_call_win64) endp + + +/* 32 bytes of outgoing register stack space, 8 bytes of alignment, + 16 bytes of result, 32 bytes of xmm registers. */ +#define ffi_clo_FS (32+8+16+32) +#define ffi_clo_OFF_R (32+8) +#define ffi_clo_OFF_X (32+8+16) + + align 8 + PUBLIC C(ffi_go_closure_win64) + +C(ffi_go_closure_win64) proc + cfi_startproc + /* Save all integer arguments into the incoming reg stack space. */ + mov qword ptr [rsp + 8], rcx; movq %rcx, 8(%rsp) + mov qword ptr [rsp + 16], rdx; movq %rdx, 16(%rsp) + mov qword ptr [rsp + 24], r8; movq %r8, 24(%rsp) + mov qword ptr [rsp + 32], r9 ;movq %r9, 32(%rsp) + + mov rcx, qword ptr [r10 + 8]; movq 8(%r10), %rcx /* load cif */ + mov rdx, qword ptr [r10 + 16]; movq 16(%r10), %rdx /* load fun */ + mov r8, r10 ; movq %r10, %r8 /* closure is user_data */ + jmp ffi_closure_win64_2 + cfi_endproc + C(ffi_go_closure_win64) endp + + align 8 + +PUBLIC C(ffi_closure_win64) +C(ffi_closure_win64) PROC FRAME + cfi_startproc + /* Save all integer arguments into the incoming reg stack space. */ + mov qword ptr [rsp + 8], rcx; movq %rcx, 8(%rsp) + mov qword ptr [rsp + 16], rdx; movq %rdx, 16(%rsp) + mov qword ptr [rsp + 24], r8; movq %r8, 24(%rsp) + mov qword ptr [rsp + 32], r9; movq %r9, 32(%rsp) + + mov rcx, qword ptr [FFI_TRAMPOLINE_SIZE + r10] ;movq FFI_TRAMPOLINE_SIZE(%r10), %rcx /* load cif */ + mov rdx, qword ptr [FFI_TRAMPOLINE_SIZE + 8 + r10] ; movq FFI_TRAMPOLINE_SIZE+8(%r10), %rdx /* load fun */ + mov r8, qword ptr [FFI_TRAMPOLINE_SIZE+16+r10] ;movq FFI_TRAMPOLINE_SIZE+16(%r10), %r8 /* load user_data */ +ffi_closure_win64_2 LABEL near + sub rsp, ffi_clo_FS ;subq $ffi_clo_FS, %rsp + cfi_adjust_cfa_offset(ffi_clo_FS) + SEH(.allocstack ffi_clo_FS) + SEH(.endprolog) + + /* Save all sse arguments into the stack frame. */ + movsd qword ptr [ffi_clo_OFF_X + rsp], xmm0 ; movsd %xmm0, ffi_clo_OFF_X(%rsp) + movsd qword ptr [ffi_clo_OFF_X+8+rsp], xmm1 ; movsd %xmm1, ffi_clo_OFF_X+8(%rsp) + movsd qword ptr [ffi_clo_OFF_X+16+rsp], xmm2 ; movsd %xmm2, ffi_clo_OFF_X+16(%rsp) + movsd qword ptr [ffi_clo_OFF_X+24+rsp], xmm3 ; movsd %xmm3, ffi_clo_OFF_X+24(%rsp) + + lea r9, [ffi_clo_OFF_R + rsp] ; leaq ffi_clo_OFF_R(%rsp), %r9 + call C(ffi_closure_win64_inner) + + /* Load the result into both possible result registers. */ + + mov rax, qword ptr [ffi_clo_OFF_R + rsp] ;movq ffi_clo_OFF_R(%rsp), %rax + movsd xmm0, qword ptr [rsp + ffi_clo_OFF_R] ;movsd ffi_clo_OFF_R(%rsp), %xmm0 + + add rsp, ffi_clo_FS ;addq $ffi_clo_FS, %rsp + cfi_adjust_cfa_offset(-ffi_clo_FS) + ret + + cfi_endproc + C(ffi_closure_win64) endp + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits +#endif +_text ends +end \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffi.c new file mode 100644 index 0000000..9a0575f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffi.c @@ -0,0 +1,298 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2013 Tensilica, Inc. + + XTENSA Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +/* + |----------------------------------------| + | | + on entry to ffi_call ----> |----------------------------------------| + | caller stack frame for registers a0-a3 | + |----------------------------------------| + | | + | additional arguments | + entry of the function ---> |----------------------------------------| + | copy of function arguments a2-a7 | + | - - - - - - - - - - - - - | + | | + + The area below the entry line becomes the new stack frame for the function. + +*/ + + +#define FFI_TYPE_STRUCT_REGS FFI_TYPE_LAST + + +extern void ffi_call_SYSV(void *rvalue, unsigned rsize, unsigned flags, + void(*fn)(void), unsigned nbytes, extended_cif*); +extern void ffi_closure_SYSV(void) FFI_HIDDEN; + +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + switch(cif->rtype->type) { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + cif->flags = cif->rtype->type; + break; + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + cif->flags = FFI_TYPE_UINT32; + break; + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + cif->flags = FFI_TYPE_UINT64; // cif->rtype->type; + break; + case FFI_TYPE_STRUCT: + cif->flags = FFI_TYPE_STRUCT; //_REGS; + /* Up to 16 bytes are returned in registers */ + if (cif->rtype->size > 4 * 4) { + /* returned structure is referenced by a register; use 8 bytes + (including 4 bytes for potential additional alignment) */ + cif->flags = FFI_TYPE_STRUCT; + cif->bytes += 8; + } + break; + + default: + cif->flags = FFI_TYPE_UINT32; + break; + } + + /* Round the stack up to a full 4 register frame, just in case + (we use this size in movsp). This way, it's also a multiple of + 8 bytes for 64-bit arguments. */ + cif->bytes = FFI_ALIGN(cif->bytes, 16); + + return FFI_OK; +} + +void ffi_prep_args(extended_cif *ecif, unsigned char* stack) +{ + unsigned int i; + unsigned long *addr; + ffi_type **ptr; + + union { + void **v; + char **c; + signed char **sc; + unsigned char **uc; + signed short **ss; + unsigned short **us; + unsigned int **i; + long long **ll; + float **f; + double **d; + } p_argv; + + /* Verify that everything is aligned up properly */ + FFI_ASSERT (((unsigned long) stack & 0x7) == 0); + + p_argv.v = ecif->avalue; + addr = (unsigned long*)stack; + + /* structures with a size greater than 16 bytes are passed in memory */ + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 16) + { + *addr++ = (unsigned long)ecif->rvalue; + } + + for (i = ecif->cif->nargs, ptr = ecif->cif->arg_types; + i > 0; + i--, ptr++, p_argv.v++) + { + switch ((*ptr)->type) + { + case FFI_TYPE_SINT8: + *addr++ = **p_argv.sc; + break; + case FFI_TYPE_UINT8: + *addr++ = **p_argv.uc; + break; + case FFI_TYPE_SINT16: + *addr++ = **p_argv.ss; + break; + case FFI_TYPE_UINT16: + *addr++ = **p_argv.us; + break; + case FFI_TYPE_FLOAT: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + *addr++ = **p_argv.i; + break; + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + if (((unsigned long)addr & 4) != 0) + addr++; + *(unsigned long long*)addr = **p_argv.ll; + addr += sizeof(unsigned long long) / sizeof (addr); + break; + + case FFI_TYPE_STRUCT: + { + unsigned long offs; + unsigned long size; + + if (((unsigned long)addr & 4) != 0 && (*ptr)->alignment > 4) + addr++; + + offs = (unsigned long) addr - (unsigned long) stack; + size = (*ptr)->size; + + /* Entire structure must fit the argument registers or referenced */ + if (offs < FFI_REGISTER_NARGS * 4 + && offs + size > FFI_REGISTER_NARGS * 4) + addr = (unsigned long*) (stack + FFI_REGISTER_NARGS * 4); + + memcpy((char*) addr, *p_argv.c, size); + addr += (size + 3) / 4; + break; + } + + default: + FFI_ASSERT(0); + } + } +} + + +void ffi_call(ffi_cif* cif, void(*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + unsigned long rsize = cif->rtype->size; + int flags = cif->flags; + void *alloc = NULL; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* Note that for structures that are returned in registers (size <= 16 bytes) + we allocate a temporary buffer and use memcpy to copy it to the final + destination. The reason is that the target address might be misaligned or + the length not a multiple of 4 bytes. Handling all those cases would be + very complex. */ + + if (flags == FFI_TYPE_STRUCT && (rsize <= 16 || rvalue == NULL)) + { + alloc = alloca(FFI_ALIGN(rsize, 4)); + ecif.rvalue = alloc; + } + else + { + ecif.rvalue = rvalue; + } + + if (cif->abi != FFI_SYSV) + FFI_ASSERT(0); + + ffi_call_SYSV (ecif.rvalue, rsize, cif->flags, fn, cif->bytes, &ecif); + + if (alloc != NULL && rvalue != NULL) + memcpy(rvalue, alloc, rsize); +} + +extern void ffi_trampoline(); +extern void ffi_cacheflush(void* start, void* end); + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + /* copye trampoline to stack and patch 'ffi_closure_SYSV' pointer */ + memcpy(closure->tramp, ffi_trampoline, FFI_TRAMPOLINE_SIZE); + *(unsigned int*)(&closure->tramp[8]) = (unsigned int)ffi_closure_SYSV; + + // Do we have this function? + // __builtin___clear_cache(closer->tramp, closer->tramp + FFI_TRAMPOLINE_SIZE) + ffi_cacheflush(closure->tramp, closure->tramp + FFI_TRAMPOLINE_SIZE); + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + return FFI_OK; +} + + +long FFI_HIDDEN +ffi_closure_SYSV_inner(ffi_closure *closure, void **values, void *rvalue) +{ + ffi_cif *cif; + ffi_type **arg_types; + void **avalue; + int i, areg; + + cif = closure->cif; + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + + areg = 0; + + int rtype = cif->rtype->type; + if (rtype == FFI_TYPE_STRUCT && cif->rtype->size > 4 * 4) + { + rvalue = *values; + areg++; + } + + cif = closure->cif; + arg_types = cif->arg_types; + avalue = alloca(cif->nargs * sizeof(void *)); + + for (i = 0; i < cif->nargs; i++) + { + if (arg_types[i]->alignment == 8 && (areg & 1) != 0) + areg++; + + // skip the entry 16,a1 framework, add 16 bytes (4 registers) + if (areg == FFI_REGISTER_NARGS) + areg += 4; + + if (arg_types[i]->type == FFI_TYPE_STRUCT) + { + int numregs = ((arg_types[i]->size + 3) & ~3) / 4; + if (areg < FFI_REGISTER_NARGS && areg + numregs > FFI_REGISTER_NARGS) + areg = FFI_REGISTER_NARGS + 4; + } + + avalue[i] = &values[areg]; + areg += (arg_types[i]->size + 3) / 4; + } + + (closure->fun)(cif, rvalue, avalue, closure->user_data); + + return rtype; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffitarget.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffitarget.h new file mode 100644 index 0000000..0ba728b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/ffitarget.h @@ -0,0 +1,53 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2013 Tensilica, Inc. + Target configuration macros for XTENSA. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; +#endif + +#define FFI_REGISTER_NARGS 6 + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#define FFI_TRAMPOLINE_SIZE 24 + +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/sysv.S b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/sysv.S new file mode 100644 index 0000000..e942179 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/src/xtensa/sysv.S @@ -0,0 +1,258 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2013 Tensilica, Inc. + + XTENSA Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +#define ENTRY(name) .text; .globl name; .type name,@function; .align 4; name: +#define END(name) .size name , . - name + +/* Assert that the table below is in sync with ffi.h. */ + +#if FFI_TYPE_UINT8 != 5 \ + || FFI_TYPE_SINT8 != 6 \ + || FFI_TYPE_UINT16 != 7 \ + || FFI_TYPE_SINT16 != 8 \ + || FFI_TYPE_UINT32 != 9 \ + || FFI_TYPE_SINT32 != 10 \ + || FFI_TYPE_UINT64 != 11 +#error "xtensa/sysv.S out of sync with ffi.h" +#endif + + +/* ffi_call_SYSV (rvalue, rbytes, flags, (*fnaddr)(), bytes, ecif) + void *rvalue; a2 + unsigned long rbytes; a3 + unsigned flags; a4 + void (*fnaddr)(); a5 + unsigned long bytes; a6 + extended_cif* ecif) a7 +*/ + +ENTRY(ffi_call_SYSV) + + entry a1, 32 # 32 byte frame for using call8 below + + mov a10, a7 # a10(->arg0): ecif + sub a11, a1, a6 # a11(->arg1): stack pointer + mov a7, a1 # fp + movsp a1, a11 # set new sp = old_sp - bytes + + movi a8, ffi_prep_args + callx8 a8 # ffi_prep_args(ecif, stack) + + # prepare to move stack pointer back up to 6 arguments + # note that 'bytes' is already aligned + + movi a10, 6*4 + sub a11, a6, a10 + movgez a6, a10, a11 + add a6, a1, a6 + + + # we can pass up to 6 arguments in registers + # for simplicity, just load 6 arguments + # (the stack size is at least 32 bytes, so no risk to cross boundaries) + + l32i a10, a1, 0 + l32i a11, a1, 4 + l32i a12, a1, 8 + l32i a13, a1, 12 + l32i a14, a1, 16 + l32i a15, a1, 20 + + # move stack pointer + + movsp a1, a6 + + callx8 a5 # (*fn)(args...) + + # Handle return value(s) + + beqz a2, .Lexit + + movi a5, FFI_TYPE_STRUCT + bne a4, a5, .Lstore + movi a5, 16 + blt a5, a3, .Lexit + + s32i a10, a2, 0 + blti a3, 5, .Lexit + addi a3, a3, -1 + s32i a11, a2, 4 + blti a3, 8, .Lexit + s32i a12, a2, 8 + blti a3, 12, .Lexit + s32i a13, a2, 12 + +.Lexit: retw + +.Lstore: + addi a4, a4, -FFI_TYPE_UINT8 + bgei a4, 7, .Lexit # should never happen + movi a6, store_calls + add a4, a4, a4 + addx4 a6, a4, a6 # store_table + idx * 8 + jx a6 + + .align 8 +store_calls: + # UINT8 + s8i a10, a2, 0 + retw + + # SINT8 + .align 8 + s8i a10, a2, 0 + retw + + # UINT16 + .align 8 + s16i a10, a2, 0 + retw + + # SINT16 + .align 8 + s16i a10, a2, 0 + retw + + # UINT32 + .align 8 + s32i a10, a2, 0 + retw + + # SINT32 + .align 8 + s32i a10, a2, 0 + retw + + # UINT64 + .align 8 + s32i a10, a2, 0 + s32i a11, a2, 4 + retw + +END(ffi_call_SYSV) + + +/* + * void ffi_cacheflush (unsigned long start, unsigned long end) + */ + +#define EXTRA_ARGS_SIZE 24 + +ENTRY(ffi_cacheflush) + + entry a1, 16 + +1: +#if XCHAL_DCACHE_SIZE + dhwbi a2, 0 +#endif +#if XCHAL_ICACHE_SIZE + ihi a2, 0 +#endif + addi a2, a2, 4 + blt a2, a3, 1b + + retw + +END(ffi_cacheflush) + +/* ffi_trampoline is copied to the stack */ + +ENTRY(ffi_trampoline) + + entry a1, 16 + (FFI_REGISTER_NARGS * 4) + (4 * 4) # [ 0] + j 2f # [ 3] + .align 4 # [ 6] +1: .long 0 # [ 8] +2: l32r a15, 1b # [12] + _mov a14, a0 # [15] + callx0 a15 # [18] + # [21] +END(ffi_trampoline) + +/* + * ffi_closure() + * + * a0: closure + 21 + * a14: return address (a0) + */ + +ENTRY(ffi_closure_SYSV) + + /* intentionally omitting entry here */ + + # restore return address (a0) and move pointer to closure to a10 + addi a10, a0, -21 + mov a0, a14 + + # allow up to 4 arguments as return values + addi a11, a1, 4 * 4 + + # save up to 6 arguments to stack (allocated by entry below) + s32i a2, a11, 0 + s32i a3, a11, 4 + s32i a4, a11, 8 + s32i a5, a11, 12 + s32i a6, a11, 16 + s32i a7, a11, 20 + + movi a8, ffi_closure_SYSV_inner + mov a12, a1 + callx8 a8 # .._inner(*closure, **avalue, *rvalue) + + # load up to four return arguments + l32i a2, a1, 0 + l32i a3, a1, 4 + l32i a4, a1, 8 + l32i a5, a1, 12 + + # (sign-)extend return value + movi a11, FFI_TYPE_UINT8 + bne a10, a11, 1f + extui a2, a2, 0, 8 + retw + +1: movi a11, FFI_TYPE_SINT8 + bne a10, a11, 1f + sext a2, a2, 7 + retw + +1: movi a11, FFI_TYPE_UINT16 + bne a10, a11, 1f + extui a2, a2, 0, 16 + retw + +1: movi a11, FFI_TYPE_SINT16 + bne a10, a11, 1f + sext a2, a2, 15 + +1: retw + +END(ffi_closure_SYSV) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/stamp-h.in b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/stamp-h.in new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/Makefile.am b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/Makefile.am new file mode 100644 index 0000000..bcfea57 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/Makefile.am @@ -0,0 +1,122 @@ +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = foreign dejagnu + +EXTRA_DEJAGNU_SITE_CONFIG=../local.exp + +CLEANFILES = *.exe core* *.log *.sum + +EXTRA_DIST = lib/target-libpath.exp lib/libffi.exp lib/wrapper.exp \ +libffi.call/strlen4.c libffi.call/struct10.c libffi.call/many_mixed.c \ +libffi.call/float.c libffi.call/struct5.c libffi.call/return_fl3.c \ +libffi.call/return_fl1.c libffi.call/call.exp libffi.call/pyobjc-tc.c \ +libffi.call/float_va.c libffi.call/struct8.c libffi.call/pr1172638.c \ +libffi.call/return_sc.c libffi.call/va_struct1.c \ +libffi.call/align_stdcall.c libffi.call/struct9.c libffi.call/va_1.c \ +libffi.call/va_struct2.c libffi.call/return_fl2.c \ +libffi.call/align_mixed.c libffi.call/ffitest.h libffi.call/struct4.c \ +libffi.call/return_ldl.c libffi.call/float3.c libffi.call/return_sl.c \ +libffi.call/return_dbl1.c libffi.call/err_bad_typedef.c \ +libffi.call/return_ll1.c libffi.call/return_dbl2.c \ +libffi.call/negint.c libffi.closures/nested_struct3.c \ +libffi.call/struct2.c libffi.call/struct3.c libffi.call/return_fl.c \ +libffi.call/offsets.c libffi.call/struct7.c libffi.call/va_struct3.c \ +libffi.call/float1.c libffi.call/uninitialized.c libffi.call/many2.c \ +libffi.call/struct6.c libffi.call/strlen2.c libffi.call/float2.c \ +libffi.call/return_ul.c libffi.call/struct1.c libffi.call/strlen3.c \ +libffi.call/return_dbl.c libffi.call/float4.c libffi.call/many.c \ +libffi.call/strlen.c libffi.call/return_uc.c libffi.call/many_double.c \ +libffi.call/return_ll.c libffi.call/promotion.c \ +libffi.complex/complex_defs_longdouble.inc \ +libffi.complex/cls_align_complex_float.c \ +libffi.complex/cls_complex_va_float.c \ +libffi.complex/cls_complex_struct_float.c \ +libffi.complex/return_complex2_longdouble.c \ +libffi.complex/cls_complex_float.c \ +libffi.complex/return_complex_longdouble.c \ +libffi.complex/return_complex2_float.c libffi.complex/cls_complex.inc \ +libffi.complex/cls_complex_va_longdouble.c \ +libffi.complex/return_complex_double.c \ +libffi.complex/return_complex.inc libffi.complex/many_complex.inc \ +libffi.complex/complex_float.c libffi.complex/cls_align_complex.inc \ +libffi.complex/return_complex2_double.c \ +libffi.complex/many_complex_float.c libffi.complex/ffitest.h \ +libffi.complex/return_complex1_double.c \ +libffi.complex/cls_complex_struct_longdouble.c \ +libffi.complex/complex_defs_double.inc \ +libffi.complex/cls_complex_va_double.c \ +libffi.complex/many_complex_double.c \ +libffi.complex/return_complex2.inc \ +libffi.complex/return_complex1_float.c \ +libffi.complex/complex_longdouble.c \ +libffi.complex/complex_defs_float.inc \ +libffi.complex/cls_complex_double.c \ +libffi.complex/cls_align_complex_double.c \ +libffi.complex/cls_align_complex_longdouble.c \ +libffi.complex/complex_double.c libffi.complex/cls_complex_va.inc \ +libffi.complex/many_complex_longdouble.c libffi.complex/complex.inc \ +libffi.complex/return_complex1_longdouble.c \ +libffi.complex/complex_int.c libffi.complex/cls_complex_longdouble.c \ +libffi.complex/cls_complex_struct_double.c \ +libffi.complex/return_complex1.inc libffi.complex/complex.exp \ +libffi.complex/cls_complex_struct.inc \ +libffi.complex/return_complex_float.c libffi.go/closure1.c \ +libffi.go/aa-direct.c libffi.go/ffitest.h libffi.go/go.exp \ +libffi.go/static-chain.h libffi.bhaible/bhaible.exp \ +libffi.bhaible/test-call.c libffi.bhaible/alignof.h \ +libffi.bhaible/testcases.c libffi.bhaible/test-callback.c \ +libffi.bhaible/Makefile libffi.bhaible/README config/default.exp \ +libffi.closures/cls_multi_sshort.c \ +libffi.closures/cls_align_longdouble_split2.c \ +libffi.closures/cls_1_1byte.c libffi.closures/cls_uint_va.c \ +libffi.closures/cls_3_1byte.c libffi.closures/cls_many_mixed_args.c \ +libffi.closures/cls_20byte1.c libffi.closures/cls_pointer_stack.c \ +libffi.closures/cls_align_float.c libffi.closures/cls_5_1_byte.c \ +libffi.closures/cls_9byte1.c libffi.closures/cls_align_uint32.c \ +libffi.closures/stret_medium.c libffi.closures/cls_3byte1.c \ +libffi.closures/cls_align_uint64.c libffi.closures/cls_longdouble_va.c \ +libffi.closures/cls_align_pointer.c libffi.closures/cls_19byte.c \ +libffi.closures/cls_ushort.c libffi.closures/cls_align_sint32.c \ +libffi.closures/cls_ulonglong.c libffi.closures/cls_struct_va1.c \ +libffi.closures/cls_9byte2.c libffi.closures/closure_fn5.c \ +libffi.closures/cls_5byte.c libffi.closures/cls_3float.c \ +libffi.closures/closure.exp libffi.closures/cls_schar.c \ +libffi.closures/closure_fn4.c libffi.closures/cls_uchar_va.c \ +libffi.closures/closure_fn0.c libffi.closures/huge_struct.c \ +libffi.closures/cls_ushort_va.c \ +libffi.closures/cls_64byte.c libffi.closures/cls_longdouble.c \ +libffi.closures/cls_ulong_va.c libffi.closures/cls_6_1_byte.c \ +libffi.closures/cls_align_uint16.c libffi.closures/closure_fn2.c \ +libffi.closures/unwindtest_ffi_call.cc \ +libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_8byte.c \ +libffi.closures/ffitest.h libffi.closures/nested_struct8.c \ +libffi.closures/cls_pointer.c libffi.closures/nested_struct2.c \ +libffi.closures/nested_struct.c libffi.closures/cls_multi_schar.c \ +libffi.closures/cls_align_longdouble_split.c \ +libffi.closures/cls_uchar.c libffi.closures/nested_struct9.c \ +libffi.closures/cls_float.c libffi.closures/stret_medium2.c \ +libffi.closures/closure_loc_fn0.c libffi.closures/cls_6byte.c \ +libffi.closures/closure_simple.c libffi.closures/cls_align_double.c \ +libffi.closures/cls_multi_uchar.c libffi.closures/cls_4_1byte.c \ +libffi.closures/closure_fn3.c libffi.closures/cls_align_sint64.c \ +libffi.closures/nested_struct1.c libffi.closures/unwindtest.cc \ +libffi.closures/nested_struct5.c libffi.closures/cls_multi_ushort.c \ +libffi.closures/nested_struct11.c \ +libffi.closures/cls_multi_sshortchar.c \ +libffi.closures/cls_align_longdouble.c \ +libffi.closures/cls_dbls_struct.c \ +libffi.closures/cls_many_mixed_float_double.c \ +libffi.closures/stret_large.c libffi.closures/stret_large2.c \ +libffi.closures/cls_align_sint16.c libffi.closures/cls_2byte.c \ +libffi.closures/nested_struct4.c libffi.closures/problem1.c \ +libffi.closures/testclosure.c libffi.closures/nested_struct6.c \ +libffi.closures/cls_4byte.c libffi.closures/cls_24byte.c \ +libffi.closures/nested_struct10.c libffi.closures/cls_uint.c \ +libffi.closures/cls_12byte.c libffi.closures/cls_sint.c \ +libffi.closures/cls_7_1_byte.c libffi.closures/cls_sshort.c \ +libffi.closures/cls_16byte.c libffi.closures/nested_struct7.c \ +libffi.closures/cls_double_va.c libffi.closures/cls_3byte2.c \ +libffi.closures/cls_double.c libffi.closures/cls_7byte.c \ +libffi.closures/closure_fn6.c libffi.closures/closure_fn1.c \ +libffi.closures/cls_20byte.c libffi.closures/cls_18byte.c \ +libffi.closures/err_bad_abi.c diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/config/default.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/config/default.exp new file mode 100644 index 0000000..90967cc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/config/default.exp @@ -0,0 +1 @@ +load_lib "standard.exp" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/libffi.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/libffi.exp new file mode 100644 index 0000000..d3c17db --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/libffi.exp @@ -0,0 +1,660 @@ +# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +proc load_gcc_lib { filename } { + global srcdir + load_file $srcdir/lib/$filename +} + +load_lib dg.exp +load_lib libgloss.exp +load_gcc_lib target-libpath.exp +load_gcc_lib wrapper.exp + +proc check_effective_target_gccbug { } { + global has_gccbug + return $has_gccbug +} + +# Return 1 if the target matches the effective target 'arg', 0 otherwise. +# This can be used with any check_* proc that takes no argument and +# returns only 1 or 0. It could be used with check_* procs that take +# arguments with keywords that pass particular arguments. + +proc is-effective-target { arg } { + global et_index + set selected 0 + if { ![info exists et_index] } { + # Initialize the effective target index that is used in some + # check_effective_target_* procs. + set et_index 0 + } + if { [info procs check_effective_target_${arg}] != [list] } { + set selected [check_effective_target_${arg}] + } else { + error "unknown effective target keyword `$arg'" + } + verbose "is-effective-target: $arg $selected" 2 + return $selected +} + +proc is-effective-target-keyword { arg } { + if { [info procs check_effective_target_${arg}] != [list] } { + return 1 + } else { + return 0 + } +} + +# Intercept the call to the DejaGnu version of dg-process-target to +# support use of an effective-target keyword in place of a list of +# target triplets to xfail or skip a test. +# +# The argument to dg-process-target is the keyword "target" or "xfail" +# followed by a selector: +# target-triplet-1 ... +# effective-target-keyword +# selector-expression +# +# For a target list the result is "S" if the target is selected, "N" otherwise. +# For an xfail list the result is "F" if the target is affected, "P" otherwise. + +# In contexts that allow either "target" or "xfail" the argument can be +# target selector1 xfail selector2 +# which returns "N" if selector1 is not selected, otherwise the result of +# "xfail selector2". +# +# A selector expression appears within curly braces and uses a single logical +# operator: !, &&, or ||. An operand is another selector expression, an +# effective-target keyword, or a list of target triplets within quotes or +# curly braces. + +if { [info procs saved-dg-process-target] == [list] } { + rename dg-process-target saved-dg-process-target + + # Evaluate an operand within a selector expression. + proc selector_opd { op } { + set selector "target" + lappend selector $op + set answer [ expr { [dg-process-target $selector] == "S" } ] + verbose "selector_opd: `$op' $answer" 2 + return $answer + } + + # Evaluate a target triplet list within a selector expression. + # Unlike other operands, this needs to be expanded from a list to + # the same string as "target". + proc selector_list { op } { + set selector "target [join $op]" + set answer [ expr { [dg-process-target $selector] == "S" } ] + verbose "selector_list: `$op' $answer" 2 + return $answer + } + + # Evaluate a selector expression. + proc selector_expression { exp } { + if { [llength $exp] == 2 } { + if [string match "!" [lindex $exp 0]] { + set op1 [lindex $exp 1] + set answer [expr { ! [selector_opd $op1] }] + } else { + # Assume it's a list of target triplets. + set answer [selector_list $exp] + } + } elseif { [llength $exp] == 3 } { + set op1 [lindex $exp 0] + set opr [lindex $exp 1] + set op2 [lindex $exp 2] + if [string match "&&" $opr] { + set answer [expr { [selector_opd $op1] && [selector_opd $op2] }] + } elseif [string match "||" $opr] { + set answer [expr { [selector_opd $op1] || [selector_opd $op2] }] + } else { + # Assume it's a list of target triplets. + set answer [selector_list $exp] + } + } else { + # Assume it's a list of target triplets. + set answer [selector_list $exp] + } + + verbose "selector_expression: `$exp' $answer" 2 + return $answer + } + + # Evaluate "target selector" or "xfail selector". + + proc dg-process-target-1 { args } { + verbose "dg-process-target-1: `$args'" 2 + + # Extract the 'what' keyword from the argument list. + set selector [string trim [lindex $args 0]] + if [regexp "^xfail " $selector] { + set what "xfail" + } elseif [regexp "^target " $selector] { + set what "target" + } else { + error "syntax error in target selector \"$selector\"" + } + + # Extract the rest of the list, which might be a keyword. + regsub "^${what}" $selector "" rest + set rest [string trim $rest] + + if [is-effective-target-keyword $rest] { + # The selector is an effective target keyword. + if [is-effective-target $rest] { + return [expr { $what == "xfail" ? "F" : "S" }] + } else { + return [expr { $what == "xfail" ? "P" : "N" }] + } + } + + if [string match "{*}" $rest] { + if [selector_expression [lindex $rest 0]] { + return [expr { $what == "xfail" ? "F" : "S" }] + } else { + return [expr { $what == "xfail" ? "P" : "N" }] + } + } + + # The selector is not an effective-target keyword, so process + # the list of target triplets. + return [saved-dg-process-target $selector] + } + + # Intercept calls to the DejaGnu function. In addition to + # processing "target selector" or "xfail selector", handle + # "target selector1 xfail selector2". + + proc dg-process-target { args } { + verbose "replacement dg-process-target: `$args'" 2 + + set selector [string trim [lindex $args 0]] + + # If the argument list contains both 'target' and 'xfail', + # process 'target' and, if that succeeds, process 'xfail'. + if [regexp "^target .* xfail .*" $selector] { + set xfail_index [string first "xfail" $selector] + set xfail_selector [string range $selector $xfail_index end] + set target_selector [string range $selector 0 [expr $xfail_index-1]] + set target_selector [string trim $target_selector] + if { [dg-process-target-1 $target_selector] == "N" } { + return "N" + } + return [dg-process-target-1 $xfail_selector] + + } + return [dg-process-target-1 $selector] + } +} + +# Define libffi callbacks for dg.exp. + +proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } { + + # To get all \n in dg-output test strings to match printf output + # in a system that outputs it as \015\012 (i.e. not just \012), we + # need to change all \n into \r?\n. As there is no dejagnu flag + # or hook to do that, we simply change the text being tested. + # Unfortunately, we have to know that the variable is called + # dg-output-text and lives in the caller of libffi-dg-test, which + # is two calls up. Overriding proc dg-output would be longer and + # would necessarily have the same assumption. + upvar 2 dg-output-text output_match + + if { [llength $output_match] > 1 } { + regsub -all "\n" [lindex $output_match 1] "\r?\n" x + set output_match [lreplace $output_match 1 1 $x] + } + + # Set up the compiler flags, based on what we're going to do. + + set options [list] + switch $do_what { + "compile" { + set compile_type "assembly" + set output_file "[file rootname [file tail $prog]].s" + } + "link" { + set compile_type "executable" + set output_file "[file rootname [file tail $prog]].exe" + # The following line is needed for targets like the i960 where + # the default output file is b.out. Sigh. + } + "run" { + set compile_type "executable" + # FIXME: "./" is to cope with "." not being in $PATH. + # Should this be handled elsewhere? + # YES. + set output_file "./[file rootname [file tail $prog]].exe" + # This is the only place where we care if an executable was + # created or not. If it was, dg.exp will try to run it. + remote_file build delete $output_file; + } + default { + perror "$do_what: not a valid dg-do keyword" + return "" + } + } + + if { $extra_tool_flags != "" } { + lappend options "additional_flags=$extra_tool_flags" + } + + set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options]; + + + return [list $comp_output $output_file] +} + + +proc libffi-dg-test { prog do_what extra_tool_flags } { + return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags] +} + +proc libffi-dg-prune { target_triplet text } { + # We get this with some qemu emulated systems (eg. ppc64le-linux-gnu) + regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text + return $text +} + +proc libffi-init { args } { + global gluefile wrap_flags; + global srcdir + global blddirffi + global objdir + global TOOL_OPTIONS + global tool + global libffi_include + global libffi_link_flags + global tool_root_dir + global ld_library_path + global compiler_vendor + + if ![info exists blddirffi] { + set blddirffi [pwd]/.. + } + + verbose "libffi $blddirffi" + + # Which compiler are we building with? + set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"] + regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor + + if { [string match $compiler_vendor "gnu"] } { + set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] + if {$gccdir != ""} { + set gccdir [file dirname $gccdir] + } + verbose "gccdir $gccdir" + + set ld_library_path "." + append ld_library_path ":${gccdir}" + + set compiler "${gccdir}/xgcc" + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { + append ld_library_path ":${gccdir}/${mldir}" + } + } + } + } + + # add the library path for libffi. + append ld_library_path ":${blddirffi}/.libs" + + verbose "ld_library_path: $ld_library_path" + + # Point to the Libffi headers in libffi. + set libffi_include "${blddirffi}/include" + verbose "libffi_include $libffi_include" + + set libffi_dir "${blddirffi}/.libs" + verbose "libffi_dir $libffi_dir" + if { $libffi_dir != "" } { + set libffi_dir [file dirname ${libffi_dir}] + set libffi_link_flags "-L${libffi_dir}/.libs" + } + + set_ld_library_path_env_vars + libffi_maybe_build_wrapper "${objdir}/testglue.o" +} + +proc libffi_exit { } { + global gluefile; + + if [info exists gluefile] { + file_on_build delete $gluefile; + unset gluefile; + } +} + +proc libffi_target_compile { source dest type options } { + global gluefile wrap_flags; + global srcdir + global blddirffi + global TOOL_OPTIONS + global libffi_link_flags + global libffi_include + global target_triplet + global compiler_vendor + + if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { + lappend options "libs=${gluefile}" + lappend options "ldflags=$wrap_flags" + } + + # TOOL_OPTIONS must come first, so that it doesn't override testcase + # specific options. + if [info exists TOOL_OPTIONS] { + lappend options "additional_flags=$TOOL_OPTIONS" + } + + # search for ffi_mips.h in srcdir, too + lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.." + lappend options "additional_flags=${libffi_link_flags}" + + # Darwin needs a stack execution allowed flag. + + if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"] + || [istarget "*-*-darwin2*"] } { + lappend options "additional_flags=-Wl,-allow_stack_execute" + } + + # If you're building the compiler with --prefix set to a place + # where it's not yet installed, then the linker won't be able to + # find the libgcc used by libffi.dylib. We could pass the + # -dylib_file option, but that's complicated, and it's much easier + # to just make the linker find libgcc using -L options. + if { [string match "*-*-darwin*" $target_triplet] } { + lappend options "libs= -shared-libgcc" + } + + if { [string match "*-*-openbsd*" $target_triplet] } { + lappend options "libs= -lpthread" + } + + lappend options "libs= -lffi" + + if { [string match "aarch64*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } + + # this may be required for g++, but just confused clang. + if { [string match "*.cc" $source] } { + lappend options "c++" + } + + if { [string match "arc*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } + + verbose "options: $options" + return [target_compile $source $dest $type $options] +} + +# TEST should be a preprocessor condition. Returns true if it holds. +proc libffi_feature_test { test } { + set src "ffitest[pid].c" + + set f [open $src "w"] + puts $f "#include " + puts $f $test + puts $f "/* OK */" + puts $f "#else" + puts $f "# error Failed $test" + puts $f "#endif" + close $f + + set lines [libffi_target_compile $src /dev/null assembly ""] + file delete $src + + return [string match "" $lines] +} + +# Utility routines. + +# +# search_for -- looks for a string match in a file +# +proc search_for { file pattern } { + set fd [open $file r] + while { [gets $fd cur_line]>=0 } { + if [string match "*$pattern*" $cur_line] then { + close $fd + return 1 + } + } + close $fd + return 0 +} + +# Modified dg-runtest that can cycle through a list of optimization options +# as c-torture does. +proc libffi-dg-runtest { testcases default-extra-flags } { + global runtests + + foreach test $testcases { + # If we're only testing specific files and this isn't one of + # them, skip it. + if ![runtest_file_p $runtests $test] { + continue + } + + # Look for a loop within the source code - if we don't find one, + # don't pass -funroll[-all]-loops. + global torture_with_loops torture_without_loops + if [expr [search_for $test "for*("]+[search_for $test "while*("]] { + set option_list $torture_with_loops + } else { + set option_list $torture_without_loops + } + + set nshort [file tail [file dirname $test]]/[file tail $test] + + foreach flags $option_list { + verbose "Testing $nshort, $flags" 1 + dg-test $test $flags ${default-extra-flags} + } + } +} + +proc run-many-tests { testcases extra_flags } { + global compiler_vendor + global has_gccbug + global env + switch $compiler_vendor { + "clang" { + set common "-W -Wall" + if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { + set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] + } else { + set optimizations { "-O0" "-O2" } + } + } + "gnu" { + set common "-W -Wall -Wno-psabi" + if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { + set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] + } else { + set optimizations { "-O0" "-O2" } + } + } + default { + # Assume we are using the vendor compiler. + set common "" + if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { + set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] + } else { + set optimizations { "" } + } + } + } + + info exists env(LD_LIBRARY_PATH) + + set targetabis { "" } + if [string match $compiler_vendor "gnu"] { + if [libffi_feature_test "#ifdef __i386__"] { + set targetabis { + "" + "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__" + "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__" + "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__" + } + } elseif { [istarget "x86_64-*-*"] \ + && [libffi_feature_test "#if !defined __ILP32__ \ + && !defined __i386__"] } { + set targetabis { + "" + "-DABI_NUM=FFI_GNUW64 -DABI_ATTR=__MSABI__" + } + } + } + + set common [ concat $common $extra_flags ] + foreach test $testcases { + set testname [file tail $test] + if [search_for $test "ABI_NUM"] { + set abis $targetabis + } else { + set abis { "" } + } + foreach opt $optimizations { + foreach abi $abis { + set options [concat $common $opt $abi] + set has_gccbug false; + if { [string match $compiler_vendor "gnu"] \ + && [string match "*MSABI*" $abi] \ + && ( ( [string match "*DGTEST=57 *" $common] \ + && [string match "*call.c*" $testname] ) \ + || ( [string match "*DGTEST=54 *" $common] \ + && [string match "*callback*" $testname] ) \ + || [string match "*DGTEST=55 *" $common] \ + || [string match "*DGTEST=56 *" $common] ) } then { + if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] { + set has_gccbug true; + } + } + verbose "Testing $testname, $options" 1 + verbose "has_gccbug = $has_gccbug" 1 + dg-test $test $options "" + } + } + } +} + +# Like check_conditional_xfail, but callable from a dg test. + +proc dg-xfail-if { args } { + set args [lreplace $args 0 0] + set selector "target [join [lindex $args 1]]" + if { [dg-process-target $selector] == "S" } { + global compiler_conditional_xfail_data + set compiler_conditional_xfail_data $args + } +} + +proc check-flags { args } { + + # The args are within another list; pull them out. + set args [lindex $args 0] + + # The next two arguments are optional. If they were not specified, + # use the defaults. + if { [llength $args] == 2 } { + lappend $args [list "*"] + } + if { [llength $args] == 3 } { + lappend $args [list ""] + } + + # If the option strings are the defaults, or the same as the + # defaults, there is no need to call check_conditional_xfail to + # compare them to the actual options. + if { [string compare [lindex $args 2] "*"] == 0 + && [string compare [lindex $args 3] "" ] == 0 } { + set result 1 + } else { + # The target list might be an effective-target keyword, so replace + # the original list with "*-*-*", since we already know it matches. + set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] + } + + return $result +} + +proc dg-skip-if { args } { + # Verify the number of arguments. The last two are optional. + set args [lreplace $args 0 0] + if { [llength $args] < 2 || [llength $args] > 4 } { + error "dg-skip-if 2: need 2, 3, or 4 arguments" + } + + # Don't bother if we're already skipping the test. + upvar dg-do-what dg-do-what + if { [lindex ${dg-do-what} 1] == "N" } { + return + } + + set selector [list target [lindex $args 1]] + if { [dg-process-target $selector] == "S" } { + if [check-flags $args] { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } + } +} + +# We need to make sure that additional_files and additional_sources +# are both cleared out after every test. It is not enough to clear +# them out *before* the next test run because gcc-target-compile gets +# run directly from some .exp files (outside of any test). (Those +# uses should eventually be eliminated.) + +# Because the DG framework doesn't provide a hook that is run at the +# end of a test, we must replace dg-test with a wrapper. + +if { [info procs saved-dg-test] == [list] } { + rename dg-test saved-dg-test + + proc dg-test { args } { + global additional_files + global additional_sources + global errorInfo + + if { [ catch { eval saved-dg-test $args } errmsg ] } { + set saved_info $errorInfo + set additional_files "" + set additional_sources "" + error $errmsg $saved_info + } + set additional_files "" + set additional_sources "" + } +} + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp new file mode 100644 index 0000000..6b7beba --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp @@ -0,0 +1,283 @@ +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# This file was contributed by John David Anglin (dave.anglin@nrc-cnrc.gc.ca) + +set orig_environment_saved 0 +set orig_ld_library_path_saved 0 +set orig_ld_run_path_saved 0 +set orig_shlib_path_saved 0 +set orig_ld_libraryn32_path_saved 0 +set orig_ld_library64_path_saved 0 +set orig_ld_library_path_32_saved 0 +set orig_ld_library_path_64_saved 0 +set orig_dyld_library_path_saved 0 +set orig_path_saved 0 + +####################################### +# proc set_ld_library_path_env_vars { } +####################################### + +proc set_ld_library_path_env_vars { } { + global ld_library_path + global orig_environment_saved + global orig_ld_library_path_saved + global orig_ld_run_path_saved + global orig_shlib_path_saved + global orig_ld_libraryn32_path_saved + global orig_ld_library64_path_saved + global orig_ld_library_path_32_saved + global orig_ld_library_path_64_saved + global orig_dyld_library_path_saved + global orig_path_saved + global orig_ld_library_path + global orig_ld_run_path + global orig_shlib_path + global orig_ld_libraryn32_path + global orig_ld_library64_path + global orig_ld_library_path_32 + global orig_ld_library_path_64 + global orig_dyld_library_path + global orig_path + global GCC_EXEC_PREFIX + + # Set the relocated compiler prefix, but only if the user hasn't specified one. + if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } { + setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX" + } + + # Setting the ld library path causes trouble when testing cross-compilers. + if { [is_remote target] } { + return + } + + if { $orig_environment_saved == 0 } { + global env + + set orig_environment_saved 1 + + # Save the original environment. + if [info exists env(LD_LIBRARY_PATH)] { + set orig_ld_library_path "$env(LD_LIBRARY_PATH)" + set orig_ld_library_path_saved 1 + } + if [info exists env(LD_RUN_PATH)] { + set orig_ld_run_path "$env(LD_RUN_PATH)" + set orig_ld_run_path_saved 1 + } + if [info exists env(SHLIB_PATH)] { + set orig_shlib_path "$env(SHLIB_PATH)" + set orig_shlib_path_saved 1 + } + if [info exists env(LD_LIBRARYN32_PATH)] { + set orig_ld_libraryn32_path "$env(LD_LIBRARYN32_PATH)" + set orig_ld_libraryn32_path_saved 1 + } + if [info exists env(LD_LIBRARY64_PATH)] { + set orig_ld_library64_path "$env(LD_LIBRARY64_PATH)" + set orig_ld_library64_path_saved 1 + } + if [info exists env(LD_LIBRARY_PATH_32)] { + set orig_ld_library_path_32 "$env(LD_LIBRARY_PATH_32)" + set orig_ld_library_path_32_saved 1 + } + if [info exists env(LD_LIBRARY_PATH_64)] { + set orig_ld_library_path_64 "$env(LD_LIBRARY_PATH_64)" + set orig_ld_library_path_64_saved 1 + } + if [info exists env(DYLD_LIBRARY_PATH)] { + set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)" + set orig_dyld_library_path_saved 1 + } + if [info exists env(PATH)] { + set orig_path "$env(PATH)" + set orig_path_saved 1 + } + } + + # We need to set ld library path in the environment. Currently, + # unix.exp doesn't set the environment correctly for all systems. + # It only sets SHLIB_PATH and LD_LIBRARY_PATH when it executes a + # program. We also need the environment set for compilations, etc. + # + # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but + # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH + # (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH), + # Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64), + # and HP-UX (SHLIB_PATH). In some cases, the variables are independent + # of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the + # variable is not defined. + # + # Doing this is somewhat of a hack as ld_library_path gets repeated in + # SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables. + if { $orig_ld_library_path_saved } { + setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path" + } else { + setenv LD_LIBRARY_PATH "$ld_library_path" + } + if { $orig_ld_run_path_saved } { + setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path" + } else { + setenv LD_RUN_PATH "$ld_library_path" + } + # The default shared library dynamic path search for 64-bit + # HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH. + # LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we + # set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent. + if { $orig_shlib_path_saved } { + setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path" + } else { + setenv SHLIB_PATH "$ld_library_path" + } + if { $orig_ld_libraryn32_path_saved } { + setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path" + } elseif { $orig_ld_library_path_saved } { + setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path" + } else { + setenv LD_LIBRARYN32_PATH "$ld_library_path" + } + if { $orig_ld_library64_path_saved } { + setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path" + } elseif { $orig_ld_library_path_saved } { + setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path" + } else { + setenv LD_LIBRARY64_PATH "$ld_library_path" + } + if { $orig_ld_library_path_32_saved } { + setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32" + } elseif { $orig_ld_library_path_saved } { + setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path" + } else { + setenv LD_LIBRARY_PATH_32 "$ld_library_path" + } + if { $orig_ld_library_path_64_saved } { + setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64" + } elseif { $orig_ld_library_path_saved } { + setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path" + } else { + setenv LD_LIBRARY_PATH_64 "$ld_library_path" + } + if { $orig_dyld_library_path_saved } { + setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path" + } else { + setenv DYLD_LIBRARY_PATH "$ld_library_path" + } + if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { + if { $orig_path_saved } { + setenv PATH "$ld_library_path:$orig_path" + } else { + setenv PATH "$ld_library_path" + } + } + + verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path" +} + +####################################### +# proc restore_ld_library_path_env_vars { } +####################################### + +proc restore_ld_library_path_env_vars { } { + global orig_environment_saved + global orig_ld_library_path_saved + global orig_ld_run_path_saved + global orig_shlib_path_saved + global orig_ld_libraryn32_path_saved + global orig_ld_library64_path_saved + global orig_ld_library_path_32_saved + global orig_ld_library_path_64_saved + global orig_dyld_library_path_saved + global orig_path_saved + global orig_ld_library_path + global orig_ld_run_path + global orig_shlib_path + global orig_ld_libraryn32_path + global orig_ld_library64_path + global orig_ld_library_path_32 + global orig_ld_library_path_64 + global orig_dyld_library_path + global orig_path + + if { $orig_environment_saved == 0 } { + return + } + + if { $orig_ld_library_path_saved } { + setenv LD_LIBRARY_PATH "$orig_ld_library_path" + } elseif [info exists env(LD_LIBRARY_PATH)] { + unsetenv LD_LIBRARY_PATH + } + if { $orig_ld_run_path_saved } { + setenv LD_RUN_PATH "$orig_ld_run_path" + } elseif [info exists env(LD_RUN_PATH)] { + unsetenv LD_RUN_PATH + } + if { $orig_shlib_path_saved } { + setenv SHLIB_PATH "$orig_shlib_path" + } elseif [info exists env(SHLIB_PATH)] { + unsetenv SHLIB_PATH + } + if { $orig_ld_libraryn32_path_saved } { + setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path" + } elseif [info exists env(LD_LIBRARYN32_PATH)] { + unsetenv LD_LIBRARYN32_PATH + } + if { $orig_ld_library64_path_saved } { + setenv LD_LIBRARY64_PATH "$orig_ld_library64_path" + } elseif [info exists env(LD_LIBRARY64_PATH)] { + unsetenv LD_LIBRARY64_PATH + } + if { $orig_ld_library_path_32_saved } { + setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32" + } elseif [info exists env(LD_LIBRARY_PATH_32)] { + unsetenv LD_LIBRARY_PATH_32 + } + if { $orig_ld_library_path_64_saved } { + setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64" + } elseif [info exists env(LD_LIBRARY_PATH_64)] { + unsetenv LD_LIBRARY_PATH_64 + } + if { $orig_dyld_library_path_saved } { + setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path" + } elseif [info exists env(DYLD_LIBRARY_PATH)] { + unsetenv DYLD_LIBRARY_PATH + } + if { $orig_path_saved } { + setenv PATH "$orig_path" + } elseif [info exists env(PATH)] { + unsetenv PATH + } +} + +####################################### +# proc get_shlib_extension { } +####################################### + +proc get_shlib_extension { } { + global shlib_ext + + if { [ istarget *-*-darwin* ] } { + set shlib_ext "dylib" + } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } { + set shlib_ext "dll" + } elseif { [ istarget hppa*-*-hpux* ] } { + set shlib_ext "sl" + } else { + set shlib_ext "so" + } + return $shlib_ext +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/wrapper.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/wrapper.exp new file mode 100644 index 0000000..4e5ae43 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/lib/wrapper.exp @@ -0,0 +1,45 @@ +# Copyright (C) 2004, 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# This file contains GCC-specifics for status wrappers for test programs. + +# ${tool}_maybe_build_wrapper -- Build wrapper object if the target +# needs it. FILENAME is the path to the wrapper file. If there are +# additional arguments, they are command-line options to provide to +# the compiler when compiling FILENAME. + +proc ${tool}_maybe_build_wrapper { filename args } { + global gluefile wrap_flags + + if { [target_info needs_status_wrapper] != "" \ + && [target_info needs_status_wrapper] != "0" \ + && ![info exists gluefile] } { + set saved_wrap_compile_flags [target_info wrap_compile_flags] + set flags [join $args " "] + # The wrapper code may contain code that gcc objects on. This + # became true for dejagnu-1.4.4. The set of warnings and code + # that gcc objects on may change, so just make sure -w is always + # passed to turn off all warnings. + set_currtarget_info wrap_compile_flags \ + "$saved_wrap_compile_flags -w $flags" + set result [build_wrapper $filename] + set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags" + if { $result != "" } { + set gluefile [lindex $result 0] + set wrap_flags [lindex $result 1] + } + } +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile new file mode 100644 index 0000000..3322de9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile @@ -0,0 +1,28 @@ +CC = gcc +CFLAGS = -O2 -Wall +prefix = +includedir = $(prefix)/include +libdir = $(prefix)/lib +CPPFLAGS = -I$(includedir) +LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir) + +all: check-call check-callback + +test-call: test-call.c testcases.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi + +test-callback: test-callback.c testcases.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi + +check-call: test-call + ./test-call > test-call.out + LC_ALL=C uniq -u < test-call.out > failed-call + test '!' -s failed-call + +check-callback: test-callback + ./test-callback > test-callback.out + LC_ALL=C uniq -u < test-callback.out > failed-callback + test '!' -s failed-callback + +clean: + rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/README b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/README new file mode 100644 index 0000000..be8540b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/README @@ -0,0 +1,78 @@ +This package contains a test suite for libffi. + +This test suite can be compiled with a C compiler. No need for 'expect' +or some other package that is often not installed. + +The test suite consists of 81 C functions, each with a different signature. +* test-call verifies that calling each function directly produces the same + results as calling the function indirectly through 'ffi_call'. +* test-callback verifies that calling each function directly produces the same + results as calling a function that is a callback (object build by + 'ffi_prep_closure_loc') and simulates the original function. + +Each direct or indirect invocation should produce one line of output to +stdout. A correct output consists of paired lines, such as + +void f(void): +void f(void): +int f(void):->99 +int f(void):->99 +int f(int):(1)->2 +int f(int):(1)->2 +int f(2*int):(1,2)->3 +int f(2*int):(1,2)->3 +... + +The Makefile then creates two files: +* failed-call, which consists of the non-paired lines of output of + 'test-call', +* failed-callback, which consists of the non-paired lines of output of + 'test-callback'. + +The test suite passes if both failed-call and failed-callback come out +as empty. + + +How to use the test suite +------------------------- + +1. Modify the Makefile's variables + prefix = the directory in which libffi was installed + CC = the C compiler, often with options such as "-m32" or "-m64" + that enforce a certain ABI, + CFLAGS = optimization options (need to change them only for non-GCC + compilers) +2. Run "make". If it fails already in "test-call", run also + "make check-callback". +3. If this failed, inspect the output files. + + +How to interpret the results +---------------------------- + +The failed-call and failed-callback files consist of paired lines: +The first line is the result of the direct invocation. +The second line is the result of invocation through libffi. + +For example, this output + +uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->255 +uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->0 + +indicates that the arguments were passed correctly, but the return +value came out wrong. + +And this output + +float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,6,7,8,561,1105,1729,2465,2821,6601)->15319.1 +float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,-140443648,10,268042216,-72537980,-140443648,-140443648,-140443648,-140443648,-140443648)->-6.47158e+08 + +indicates that integer arguments that come after 17 floating-point arguments +were not passed correctly. + + +Credits +------- + +The test suite is based on the one of GNU libffcall-2.0. +Authors: Bill Triggs, Bruno Haible diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h new file mode 100644 index 0000000..00604a5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h @@ -0,0 +1,50 @@ +/* Determine alignment of types. + Copyright (C) 2003-2004, 2006, 2009-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +#ifndef _ALIGNOF_H +#define _ALIGNOF_H + +#include + +/* alignof_slot (TYPE) + Determine the alignment of a structure slot (field) of a given type, + at compile time. Note that the result depends on the ABI. + This is the same as alignof (TYPE) and _Alignof (TYPE), defined in + if __alignof_is_defined is 1. + Note: The result cannot be used as a value for an 'enum' constant, + due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ +#if defined __cplusplus + template struct alignof_helper { char __slot1; type __slot2; }; +# define alignof_slot(type) offsetof (alignof_helper, __slot2) +#else +# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) +#endif + +/* alignof_type (TYPE) + Determine the good alignment of an object of the given type at compile time. + Note that this is not necessarily the same as alignof_slot(type). + For example, with GNU C on x86 platforms: alignof_type(double) = 8, but + - when -malign-double is not specified: alignof_slot(double) = 4, + - when -malign-double is specified: alignof_slot(double) = 8. + Note: The result cannot be used as a value for an 'enum' constant, + due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ +#if defined __GNUC__ || defined __IBM__ALIGNOF__ +# define alignof_type __alignof__ +#else +# define alignof_type alignof_slot +#endif + +#endif /* _ALIGNOF_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp new file mode 100644 index 0000000..44aebc5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp @@ -0,0 +1,63 @@ +# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2018 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +dg-init +libffi-init + +global srcdir subdir +global compiler_vendor + +# The conversion of this testsuite into a dejagnu compatible testsuite +# was done in a pretty lazy fashion, and requires the use of compiler +# flags to disable warnings for now. +if { [string match $compiler_vendor "gnu"] } { + set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized"; +} +if { [string match $compiler_vendor "microsoft"] } { + # -wd4996 suggest use of vsprintf_s instead of vsprintf + # -wd4116 unnamed type definition + # -wd4101 unreferenced local variable + # -wd4244 warning about implicit double to float conversion + set warning_options "-wd4996 -wd4116 -wd4101 -wd4244"; +} +if { ![string match $compiler_vendor "microsoft"] && ![string match $compiler_vendor "gnu"] } { + set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized"; +} + + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-call.c]] + +for {set i 1} {$i < 82} {incr i} { + run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options] +} + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-callback.c]] + +for {set i 1} {$i < 81} {incr i} { + if { [libffi_feature_test "#if FFI_CLOSURES"] } { + run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options] + } else { + foreach test $tlist { + unsupported [format "%s -DDGTEST=%d %s" $test $i $warning_options] + } + } +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c new file mode 100644 index 0000000..cf9219e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c @@ -0,0 +1,1745 @@ +/** + Copyright 1993 Bill Triggs + Copyright 1995-2017 Bruno Haible + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +**/ + +/* { dg-do run { xfail gccbug } } */ + +#include +#include +#include +#include +#include "alignof.h" +#include + +/* libffi testsuite local changes -------------------------------- */ +#ifdef DGTEST +/* Redefine exit(1) as a test failure */ +#define exit(V) (void)((V) ? (abort(), 1) : exit(0)) +int count = 0; +char rbuf1[2048]; +char rbuf2[2048]; +int _fprintf(FILE *stream, const char *format, ...) +{ + va_list args; + va_start(args, format); + + switch (count++) + { + case 0: + case 1: + vsprintf(&rbuf1[strlen(rbuf1)], format, args); + break; + case 2: + printf("%s", rbuf1); + vsprintf(rbuf2, format, args); + break; + case 3: + vsprintf(&rbuf2[strlen(rbuf2)], format, args); + printf("%s", rbuf2); + if (strcmp (rbuf1, rbuf2)) abort(); + break; + } + + va_end(args); + + return 0; +} +#define fprintf _fprintf +#endif +/* --------------------------------------------------------------- */ + +#include "testcases.c" + +#ifndef ABI_NUM +#define ABI_NUM FFI_DEFAULT_ABI +#endif + +/* Definitions that ought to be part of libffi. */ +static ffi_type ffi_type_char; +#define ffi_type_slonglong ffi_type_sint64 +#define ffi_type_ulonglong ffi_type_uint64 + +/* libffi does not support arrays inside structs. */ +#define SKIP_EXTRA_STRUCTS + +#define FFI_PREP_CIF(cif,argtypes,rettype) \ + if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort() +#define FFI_PREP_CIF_NOARGS(cif,rettype) \ + if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort() +#define FFI_CALL(cif,fn,args,retaddr) \ + ffi_call(&(cif),(void(*)(void))(fn),retaddr,args) + +long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h, + long i, long j, long k, long l, long m, long n, long o, long p) +{ return 0; } +float clear_traces_f (float a, float b, float c, float d, float e, float f, float g, + float h, float i, float j, float k, float l, float m, float n, + float o, float p) +{ return 0.0; } +double clear_traces_d (double a, double b, double c, double d, double e, double f, double g, + double h, double i, double j, double k, double l, double m, double n, + double o, double p) +{ return 0.0; } +J clear_traces_J (void) +{ J j; j.l1 = j.l2 = 0; return j; } +void clear_traces (void) +{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); + clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); + clear_traces_J(); +} + +void + void_tests (void) +{ +#if (!defined(DGTEST)) || DGTEST == 1 + v_v(); + clear_traces(); + { + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_void); + { + FFI_CALL(cif,v_v,NULL,NULL); + } + } +#endif + return; +} +void + int_tests (void) +{ + int ir; + ffi_arg retvalue; +#if (!defined(DGTEST)) || DGTEST == 2 + ir = i_v(); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_sint); + { + FFI_CALL(cif,i_v,NULL,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 3 + ir = i_i(i1); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + { + /*const*/ void* args[] = { &i1 }; + FFI_CALL(cif,i_i,args,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 4 + ir = i_i2(i1,i2); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + { + /*const*/ void* args[] = { &i1, &i2 }; + FFI_CALL(cif,i_i2,args,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 5 + ir = i_i4(i1,i2,i3,i4); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + { + /*const*/ void* args[] = { &i1, &i2, &i3, &i4 }; + FFI_CALL(cif,i_i4,args,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 6 + ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + { + /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8 }; + FFI_CALL(cif,i_i8,args,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 7 + ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + { + /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9, &i10, &i11, &i12, &i13, &i14, &i15, &i16 }; + FFI_CALL(cif,i_i16,args,&retvalue); + ir = retvalue; + } + } + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + + return; +} +void + float_tests (void) +{ + float fr; + +#if (!defined(DGTEST)) || DGTEST == 8 + fr = f_f(f1); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1 }; + FFI_CALL(cif,f_f,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 9 + fr = f_f2(f1,f2); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2 }; + FFI_CALL(cif,f_f2,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 10 + fr = f_f4(f1,f2,f3,f4); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4 }; + FFI_CALL(cif,f_f4,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 11 + fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8 }; + FFI_CALL(cif,f_f8,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 12 + fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16 }; + FFI_CALL(cif,f_f16,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 13 + fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &f18, &f19, &f20, &f21, &f22, &f23, &f24 }; + FFI_CALL(cif,f_f24,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif +} +void + double_tests (void) +{ + double dr; + +#if (!defined(DGTEST)) || DGTEST == 14 + + dr = d_d(d1); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1 }; + FFI_CALL(cif,d_d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 15 + dr = d_d2(d1,d2); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2 }; + FFI_CALL(cif,d_d2,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 16 + dr = d_d4(d1,d2,d3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4 }; + FFI_CALL(cif,d_d4,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 17 + dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8 }; + FFI_CALL(cif,d_d8,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 18 + dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16 }; + FFI_CALL(cif,d_d16,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + return; +} +void + pointer_tests (void) +{ + void* vpr; + +#if (!defined(DGTEST)) || DGTEST == 19 + vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4); + fprintf(out,"->0x%p\n",vpr); + fflush(out); + vpr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_pointer); + { + void* puc1 = &uc1; + void* pd2 = &d2; + void* pstr3 = str3; + void* pI4 = &I4; + /*const*/ void* args[] = { &puc1, &pd2, &pstr3, &pI4 }; + FFI_CALL(cif,vp_vpdpcpsp,args,&vpr); + } + } + fprintf(out,"->0x%p\n",vpr); + fflush(out); +#endif + return; +} +void + mixed_number_tests (void) +{ + uchar ucr; + ushort usr; + float fr; + double dr; + long long llr; + + /* Unsigned types. + */ +#if (!defined(DGTEST)) || DGTEST == 20 + ucr = uc_ucsil(uc1, us2, ui3, ul4); + fprintf(out,"->%u\n",ucr); + fflush(out); + ucr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_uchar); + { + ffi_arg r; + /*const*/ void* args[] = { &uc1, &us2, &ui3, &ul4 }; + FFI_CALL(cif,uc_ucsil,args,&r); + ucr = (uchar) r; + } + } + fprintf(out,"->%u\n",ucr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 21 + /* Mixed int & float types. + */ + dr = d_iidd(i1,i2,d3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &i1, &i2, &d3, &d4 }; + FFI_CALL(cif,d_iidd,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 22 + dr = d_iiidi(i1,i2,i3,d4,i5); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &i1, &i2, &i3, &d4, &i5 }; + FFI_CALL(cif,d_iiidi,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 23 + dr = d_idid(i1,d2,i3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &i1, &d2, &i3, &d4 }; + FFI_CALL(cif,d_idid,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 24 + dr = d_fdi(f1,d2,i3); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &f1, &d2, &i3 }; + FFI_CALL(cif,d_fdi,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 25 + usr = us_cdcd(c1,d2,c3,d4); + fprintf(out,"->%u\n",usr); + fflush(out); + usr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_ushort); + { + ffi_arg rint; + /*const*/ void* args[] = { &c1, &d2, &c3, &d4 }; + FFI_CALL(cif,us_cdcd,args,&rint); + usr = (ushort) rint; + } + } + fprintf(out,"->%u\n",usr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 26 + /* Long long types. + */ + llr = ll_iiilli(i1,i2,i3,ll1,i13); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &i1, &i2, &i3, &ll1, &i13 }; + FFI_CALL(cif,ll_iiilli,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 27 + llr = ll_flli(f13,ll1,i13); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &f13, &ll1, &i13 }; + FFI_CALL(cif,ll_flli,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 28 + fr = f_fi(f1,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &i9 }; + FFI_CALL(cif,f_fi,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 29 + fr = f_f2i(f1,f2,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &i9 }; + FFI_CALL(cif,f_f2i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 30 + fr = f_f3i(f1,f2,f3,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &i9 }; + FFI_CALL(cif,f_f3i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 31 + fr = f_f4i(f1,f2,f3,f4,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &i9 }; + FFI_CALL(cif,f_f4i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 32 + fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &i9 }; + FFI_CALL(cif,f_f7i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 33 + fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &i9 }; + FFI_CALL(cif,f_f8i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 34 + fr = f_f12i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &i9 }; + FFI_CALL(cif,f_f12i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 35 + fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &i9 }; + FFI_CALL(cif,f_f13i,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 36 + dr = d_di(d1,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &i9 }; + FFI_CALL(cif,d_di,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 37 + dr = d_d2i(d1,d2,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &i9 }; + FFI_CALL(cif,d_d2i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 38 + dr = d_d3i(d1,d2,d3,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &i9 }; + FFI_CALL(cif,d_d3i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 39 + dr = d_d4i(d1,d2,d3,d4,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &i9 }; + FFI_CALL(cif,d_d4i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 40 + dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &i9 }; + FFI_CALL(cif,d_d7i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 41 + dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &i9 }; + FFI_CALL(cif,d_d8i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 42 + dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &i9 }; + FFI_CALL(cif,d_d12i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 43 + dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &i9 }; + FFI_CALL(cif,d_d13i,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + return; +} +void + small_structure_return_tests (void) +{ +#if (!defined(DGTEST)) || DGTEST == 44 + { + Size1 r = S1_v(); + fprintf(out,"->{%c}\n",r.x1); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL }; + ffi_type ffi_type_Size1; + ffi_type_Size1.type = FFI_TYPE_STRUCT; + ffi_type_Size1.size = sizeof(Size1); + ffi_type_Size1.alignment = alignof_slot(Size1); + ffi_type_Size1.elements = ffi_type_Size1_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1); + { + FFI_CALL(cif,S1_v,NULL,&r); + } + } + fprintf(out,"->{%c}\n",r.x1); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 45 + { + Size2 r = S2_v(); + fprintf(out,"->{%c%c}\n",r.x1,r.x2); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size2; + ffi_type_Size2.type = FFI_TYPE_STRUCT; + ffi_type_Size2.size = sizeof(Size2); + ffi_type_Size2.alignment = alignof_slot(Size2); + ffi_type_Size2.elements = ffi_type_Size2_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2); + { + FFI_CALL(cif,S2_v,NULL,&r); + } + } + fprintf(out,"->{%c%c}\n",r.x1,r.x2); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 46 + { + Size3 r = S3_v(); + fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size3; + ffi_type_Size3.type = FFI_TYPE_STRUCT; + ffi_type_Size3.size = sizeof(Size3); + ffi_type_Size3.alignment = alignof_slot(Size3); + ffi_type_Size3.elements = ffi_type_Size3_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3); + { + FFI_CALL(cif,S3_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 47 + { + Size4 r = S4_v(); + fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size4; + ffi_type_Size4.type = FFI_TYPE_STRUCT; + ffi_type_Size4.size = sizeof(Size4); + ffi_type_Size4.alignment = alignof_slot(Size4); + ffi_type_Size4.elements = ffi_type_Size4_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4); + { + FFI_CALL(cif,S4_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 48 + { + Size7 r = S7_v(); + fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size7; + ffi_type_Size7.type = FFI_TYPE_STRUCT; + ffi_type_Size7.size = sizeof(Size7); + ffi_type_Size7.alignment = alignof_slot(Size7); + ffi_type_Size7.elements = ffi_type_Size7_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7); + { + FFI_CALL(cif,S7_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 49 + { + Size8 r = S8_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size8; + ffi_type_Size8.type = FFI_TYPE_STRUCT; + ffi_type_Size8.size = sizeof(Size8); + ffi_type_Size8.alignment = alignof_slot(Size8); + ffi_type_Size8.elements = ffi_type_Size8_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8); + { + FFI_CALL(cif,S8_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 50 + { + Size12 r = S12_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size12; + ffi_type_Size12.type = FFI_TYPE_STRUCT; + ffi_type_Size12.size = sizeof(Size12); + ffi_type_Size12.alignment = alignof_slot(Size12); + ffi_type_Size12.elements = ffi_type_Size12_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12); + { + FFI_CALL(cif,S12_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 51 + { + Size15 r = S15_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size15; + ffi_type_Size15.type = FFI_TYPE_STRUCT; + ffi_type_Size15.size = sizeof(Size15); + ffi_type_Size15.alignment = alignof_slot(Size15); + ffi_type_Size15.elements = ffi_type_Size15_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15); + { + FFI_CALL(cif,S15_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15); + fflush(out); + } +#endif +#if (!defined(DGTEST)) || DGTEST == 52 + { + Size16 r = S16_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + { + ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size16; + ffi_type_Size16.type = FFI_TYPE_STRUCT; + ffi_type_Size16.size = sizeof(Size16); + ffi_type_Size16.alignment = alignof_slot(Size16); + ffi_type_Size16.elements = ffi_type_Size16_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16); + { + FFI_CALL(cif,S16_v,NULL,&r); + } + } + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16); + fflush(out); + } +#endif +} +void + structure_tests (void) +{ + Int Ir; + Char Cr; + Float Fr; + Double Dr; + J Jr; +#ifndef SKIP_EXTRA_STRUCTS + T Tr; + X Xr; +#endif + +#if (!defined(DGTEST)) || DGTEST == 53 + Ir = I_III(I1,I2,I3); + fprintf(out,"->{%d}\n",Ir.x); + fflush(out); + Ir.x = 0; clear_traces(); + { + ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL }; + ffi_type ffi_type_Int; + ffi_type_Int.type = FFI_TYPE_STRUCT; + ffi_type_Int.size = sizeof(Int); + ffi_type_Int.alignment = alignof_slot(Int); + ffi_type_Int.elements = ffi_type_Int_elements; + ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Int); + { + /*const*/ void* args[] = { &I1, &I2, &I3 }; + FFI_CALL(cif,I_III,args,&Ir); + } + } + fprintf(out,"->{%d}\n",Ir.x); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 54 + Cr = C_CdC(C1,d2,C3); + fprintf(out,"->{'%c'}\n",Cr.x); + fflush(out); + Cr.x = '\0'; clear_traces(); + { + ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL }; + ffi_type ffi_type_Char; + ffi_type_Char.type = FFI_TYPE_STRUCT; + ffi_type_Char.size = sizeof(Char); + ffi_type_Char.alignment = alignof_slot(Char); + ffi_type_Char.elements = ffi_type_Char_elements; + ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Char); + { + /*const*/ void* args[] = { &C1, &d2, &C3 }; + FFI_CALL(cif,C_CdC,args,&Cr); + } + } + fprintf(out,"->{'%c'}\n",Cr.x); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 55 + Fr = F_Ffd(F1,f2,d3); + fprintf(out,"->{%g}\n",Fr.x); + fflush(out); + Fr.x = 0.0; clear_traces(); + { + ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL }; + ffi_type ffi_type_Float; + ffi_type_Float.type = FFI_TYPE_STRUCT; + ffi_type_Float.size = sizeof(Float); + ffi_type_Float.alignment = alignof_slot(Float); + ffi_type_Float.elements = ffi_type_Float_elements; + ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Float); + { + /*const*/ void* args[] = { &F1, &f2, &d3 }; + FFI_CALL(cif,F_Ffd,args,&Fr); + } + } + fprintf(out,"->{%g}\n",Fr.x); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 56 + Dr = D_fDd(f1,D2,d3); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); + Dr.x = 0.0; clear_traces(); + { + ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; + ffi_type ffi_type_Double; + ffi_type_Double.type = FFI_TYPE_STRUCT; + ffi_type_Double.size = sizeof(Double); + ffi_type_Double.alignment = alignof_slot(Double); + ffi_type_Double.elements = ffi_type_Double_elements; + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Double); + { + /*const*/ void* args[] = { &f1, &D2, &d3 }; + FFI_CALL(cif,D_fDd,args,&Dr); + } + } + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 57 + Dr = D_Dfd(D1,f2,d3); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); + Dr.x = 0.0; clear_traces(); + { + ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; + ffi_type ffi_type_Double; + ffi_type_Double.type = FFI_TYPE_STRUCT; + ffi_type_Double.size = sizeof(Double); + ffi_type_Double.alignment = alignof_slot(Double); + ffi_type_Double.elements = ffi_type_Double_elements; + ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Double); + { + /*const*/ void* args[] = { &D1, &f2, &d3 }; + FFI_CALL(cif,D_Dfd,args,&Dr); + } + } + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 58 + Jr = J_JiJ(J1,i2,J2); + fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); + fflush(out); + Jr.l1 = Jr.l2 = 0; clear_traces(); + { + ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_J; + ffi_type_J.type = FFI_TYPE_STRUCT; + ffi_type_J.size = sizeof(J); + ffi_type_J.alignment = alignof_slot(J); + ffi_type_J.elements = ffi_type_J_elements; + ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_J); + { + /*const*/ void* args[] = { &J1, &i2, &J2 }; + FFI_CALL(cif,J_JiJ,args,&Jr); + } + } + fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); + fflush(out); +#endif +#ifndef SKIP_EXTRA_STRUCTS +#if (!defined(DGTEST)) || DGTEST == 59 + Tr = T_TcT(T1,' ',T2); + fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); + fflush(out); + Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces(); + { + ffi_type* ffi_type_T_elements[] = { ??, NULL }; + ffi_type ffi_type_T; + ffi_type_T.type = FFI_TYPE_STRUCT; + ffi_type_T.size = sizeof(T); + ffi_type_T.alignment = alignof_slot(T); + ffi_type_T.elements = ffi_type_T_elements; + ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_T); + { + char space = ' '; + /*const*/ void* args[] = { &T1, &space, &T2 }; + FFI_CALL(cif,T_TcT,args,&Tr); + } + } + fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 60 + Xr = X_BcdB(B1,c2,d3,B2); + fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); + fflush(out); + Xr.c[0]=Xr.c1='\0'; clear_traces(); + { + ffi_type* ffi_type_X_elements[] = { ??, NULL }; + ffi_type ffi_type_X; + ffi_type_X.type = FFI_TYPE_STRUCT; + ffi_type_X.size = sizeof(X); + ffi_type_X.alignment = alignof_slot(X); + ffi_type_X.elements = ffi_type_X_elements; + ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_X); + { + /*const*/ void* args[] = { &B1, &c2, &d3, &B2 }; + FFI_CALL(cif,X_BcdB,args,&Xr); + } + } + fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); + fflush(out); +#endif +#endif + + return; +} + +void + gpargs_boundary_tests (void) +{ + ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_K; + ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_L; + long lr; + long long llr; + float fr; + double dr; + + ffi_type_K.type = FFI_TYPE_STRUCT; + ffi_type_K.size = sizeof(K); + ffi_type_K.alignment = alignof_slot(K); + ffi_type_K.elements = ffi_type_K_elements; + + ffi_type_L.type = FFI_TYPE_STRUCT; + ffi_type_L.size = sizeof(L); + ffi_type_L.alignment = alignof_slot(L); + ffi_type_L.elements = ffi_type_L_elements; + +#if (!defined(DGTEST)) || DGTEST == 61 + lr = l_l0K(K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &K1, &l9 }; + FFI_CALL(cif,l_l0K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 62 + lr = l_l1K(l1,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &K1, &l9 }; + FFI_CALL(cif,l_l1K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 63 + lr = l_l2K(l1,l2,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &l2, &K1, &l9 }; + FFI_CALL(cif,l_l2K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 64 + lr = l_l3K(l1,l2,l3,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &K1, &l9 }; + FFI_CALL(cif,l_l3K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 65 + lr = l_l4K(l1,l2,l3,l4,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &K1, &l9 }; + FFI_CALL(cif,l_l4K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 66 + lr = l_l5K(l1,l2,l3,l4,l5,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &K1, &l9 }; + FFI_CALL(cif,l_l5K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 67 + lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &K1, &l9 }; + FFI_CALL(cif,l_l6K,args,&lr); + } + } + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 68 + fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + { + /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &l6, &l7, &l8, &L1 }; + FFI_CALL(cif,f_f17l3L,args,&fr); + } + } + fprintf(out,"->%g\n",fr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 69 + dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16, &d17, &l6, &l7, &l8, &L1 }; + FFI_CALL(cif,d_d17l3L,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 70 + llr = ll_l2ll(l1,l2,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &ll1, &l9 }; + FFI_CALL(cif,ll_l2ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 71 + llr = ll_l3ll(l1,l2,l3,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &ll1, &l9 }; + FFI_CALL(cif,ll_l3ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 72 + llr = ll_l4ll(l1,l2,l3,l4,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &ll1, &l9 }; + FFI_CALL(cif,ll_l4ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 73 + llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &ll1, &l9 }; + FFI_CALL(cif,ll_l5ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 74 + llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &ll1, &l9 }; + FFI_CALL(cif,ll_l6ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 75 + llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &ll1, &l9 }; + FFI_CALL(cif,ll_l7ll,args,&llr); + } + } + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 76 + dr = d_l2d(l1,l2,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &d2, &l9 }; + FFI_CALL(cif,d_l2d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 77 + dr = d_l3d(l1,l2,l3,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &d2, &l9 }; + FFI_CALL(cif,d_l3d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 78 + dr = d_l4d(l1,l2,l3,l4,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &d2, &l9 }; + FFI_CALL(cif,d_l4d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 79 + dr = d_l5d(l1,l2,l3,l4,l5,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &d2, &l9 }; + FFI_CALL(cif,d_l5d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 80 + dr = d_l6d(l1,l2,l3,l4,l5,l6,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &d2, &l9 }; + FFI_CALL(cif,d_l6d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif +#if (!defined(DGTEST)) || DGTEST == 81 + dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,d2,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + { + /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &d2, &l9 }; + FFI_CALL(cif,d_l7d,args,&dr); + } + } + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + return; +} + +int + main (void) +{ + ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar; + out = stdout; + + void_tests(); + int_tests(); + float_tests(); + double_tests(); + pointer_tests(); + mixed_number_tests(); + small_structure_return_tests(); + structure_tests(); + gpargs_boundary_tests(); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c new file mode 100644 index 0000000..0b16799 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c @@ -0,0 +1,2885 @@ +/* + * Copyright 1993 Bill Triggs + * Copyright 1995-2017 Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* { dg-do run { xfail gccbug } } */ + +#include +#include +#include +#include +#include "alignof.h" +#include + +/* libffi testsuite local changes -------------------------------- */ +#ifdef DGTEST +/* Redefine exit(1) as a test failure */ +#define exit(V) (void)((V) ? (abort(), 1) : exit(0)) +int count = 0; +char rbuf1[2048]; +char rbuf2[2048]; +int _fprintf(FILE *stream, const char *format, ...) +{ + va_list args; + va_start(args, format); + + switch (count++) + { + case 0: + case 1: + vsprintf(&rbuf1[strlen(rbuf1)], format, args); + break; + case 2: + printf("%s", rbuf1); + vsprintf(rbuf2, format, args); + break; + case 3: + vsprintf(&rbuf2[strlen(rbuf2)], format, args); + printf("%s", rbuf2); + if (strcmp (rbuf1, rbuf2)) abort(); + break; + } + + va_end(args); + + return 0; +} +#define fprintf _fprintf +#endif +/* --------------------------------------------------------------- */ + +#include "testcases.c" + +#ifndef ABI_NUM +#define ABI_NUM FFI_DEFAULT_ABI +#endif + +/* Definitions that ought to be part of libffi. */ +static ffi_type ffi_type_char; +#define ffi_type_slonglong ffi_type_sint64 +#define ffi_type_ulonglong ffi_type_uint64 + +/* libffi does not support arrays inside structs. */ +#define SKIP_EXTRA_STRUCTS + +#define FFI_PREP_CIF(cif,argtypes,rettype) \ + if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort() +#define FFI_PREP_CIF_NOARGS(cif,rettype) \ + if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort() + +#if defined(__sparc__) && defined(__sun) && defined(__SUNPRO_C) /* SUNWspro cc */ +/* SunPRO cc miscompiles the simulator function for X_BcdB: d.i[1] is + * temporarily stored in %l2 and put onto the stack from %l2, but in between + * the copy of X has used %l2 as a counter without saving and restoring its + * value. + */ +#define SKIP_X +#endif +#if defined(__mipsn32__) && !defined(__GNUC__) +/* The X test crashes for an unknown reason. */ +#define SKIP_X +#endif + + +/* These functions simulate the behaviour of the functions defined in testcases.c. */ + +/* void tests */ +void v_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&v_v) { fprintf(out,"wrong data for v_v\n"); exit(1); } + fprintf(out,"void f(void):\n"); + fflush(out); +} + +/* int tests */ +void i_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_v) { fprintf(out,"wrong data for i_v\n"); exit(1); } + {int r=99; + fprintf(out,"int f(void):"); + fflush(out); + *(ffi_arg*)retp = r; +}} +void i_i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_i) { fprintf(out,"wrong data for i_i\n"); exit(1); } + int a = *(int*)(*args++); + int r=a+1; + fprintf(out,"int f(int):(%d)",a); + fflush(out); + *(ffi_arg*)retp = r; +} +void i_i2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_i2) { fprintf(out,"wrong data for i_i2\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int r=a+b; + fprintf(out,"int f(2*int):(%d,%d)",a,b); + fflush(out); + *(ffi_arg*)retp = r; +}} +void i_i4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_i4) { fprintf(out,"wrong data for i_i4\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int c = *(int*)(*args++); + int d = *(int*)(*args++); + int r=a+b+c+d; + fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d); + fflush(out); + *(ffi_arg*)retp = r; +}} +void i_i8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_i8) { fprintf(out,"wrong data for i_i8\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int c = *(int*)(*args++); + int d = *(int*)(*args++); + int e = *(int*)(*args++); + int f = *(int*)(*args++); + int g = *(int*)(*args++); + int h = *(int*)(*args++); + int r=a+b+c+d+e+f+g+h; + fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h); + fflush(out); + *(ffi_arg*)retp = r; +}} +void i_i16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&i_i16) { fprintf(out,"wrong data for i_i16\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int c = *(int*)(*args++); + int d = *(int*)(*args++); + int e = *(int*)(*args++); + int f = *(int*)(*args++); + int g = *(int*)(*args++); + int h = *(int*)(*args++); + int i = *(int*)(*args++); + int j = *(int*)(*args++); + int k = *(int*)(*args++); + int l = *(int*)(*args++); + int m = *(int*)(*args++); + int n = *(int*)(*args++); + int o = *(int*)(*args++); + int p = *(int*)(*args++); + int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", + a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + *(ffi_arg*)retp = r; +}} + +/* float tests */ +void f_f_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f) { fprintf(out,"wrong data for f_f\n"); exit(1); } + {float a = *(float*)(*args++); + float r=a+1.0; + fprintf(out,"float f(float):(%g)",a); + fflush(out); + *(float*)retp = r; +}} +void f_f2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f2) { fprintf(out,"wrong data for f_f2\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float r=a+b; + fprintf(out,"float f(2*float):(%g,%g)",a,b); + fflush(out); + *(float*)retp = r; +}} +void f_f4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f4) { fprintf(out,"wrong data for f_f4\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float r=a+b+c+d; + fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d); + fflush(out); + *(float*)retp = r; +}} +void f_f8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f8) { fprintf(out,"wrong data for f_f8\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float r=a+b+c+d+e+f+g+h; + fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); + fflush(out); + *(float*)retp = r; +}} +void f_f16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f16) { fprintf(out,"wrong data for f_f16\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float i = *(float*)(*args++); + float j = *(float*)(*args++); + float k = *(float*)(*args++); + float l = *(float*)(*args++); + float m = *(float*)(*args++); + float n = *(float*)(*args++); + float o = *(float*)(*args++); + float p = *(float*)(*args++); + float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + *(float*)retp = r; +}} +void f_f24_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f24) { fprintf(out,"wrong data for f_f24\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float i = *(float*)(*args++); + float j = *(float*)(*args++); + float k = *(float*)(*args++); + float l = *(float*)(*args++); + float m = *(float*)(*args++); + float n = *(float*)(*args++); + float o = *(float*)(*args++); + float p = *(float*)(*args++); + float q = *(float*)(*args++); + float s = *(float*)(*args++); + float t = *(float*)(*args++); + float u = *(float*)(*args++); + float v = *(float*)(*args++); + float w = *(float*)(*args++); + float x = *(float*)(*args++); + float y = *(float*)(*args++); + float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y; + fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y); + fflush(out); + *(float*)retp = r; +}} + +/* double tests */ +void d_d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d) { fprintf(out,"wrong data for d_d\n"); exit(1); } + {double a = *(double*)(*args++); + double r=a+1.0; + fprintf(out,"double f(double):(%g)",a); + fflush(out); + *(double*)retp = r; +}} +void d_d2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d2) { fprintf(out,"wrong data for d_d2\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double r=a+b; + fprintf(out,"double f(2*double):(%g,%g)",a,b); + fflush(out); + *(double*)retp = r; +}} +void d_d4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d4) { fprintf(out,"wrong data for d_d4\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double r=a+b+c+d; + fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d); + fflush(out); + *(double*)retp = r; +}} +void d_d8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d8) { fprintf(out,"wrong data for d_d8\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + double r=a+b+c+d+e+f+g+h; + fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); + fflush(out); + *(double*)retp = r; +}} +void d_d16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d16) { fprintf(out,"wrong data for d_d16\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + double i = *(double*)(*args++); + double j = *(double*)(*args++); + double k = *(double*)(*args++); + double l = *(double*)(*args++); + double m = *(double*)(*args++); + double n = *(double*)(*args++); + double o = *(double*)(*args++); + double p = *(double*)(*args++); + double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + *(double*)retp = r; +}} + +/* pointer tests */ +void vp_vpdpcpsp_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&vp_vpdpcpsp) { fprintf(out,"wrong data for vp_vpdpcpsp\n"); exit(1); } + {void* a = *(void* *)(*args++); + double* b = *(double* *)(*args++); + char* c = *(char* *)(*args++); + Int* d = *(Int* *)(*args++); + void* ret = (char*)b + 1; + fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d); + fflush(out); + *(void* *)retp = ret; +}} + +/* mixed number tests */ +void uc_ucsil_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&uc_ucsil) { fprintf(out,"wrong data for uc_ucsil\n"); exit(1); } + {uchar a = *(unsigned char *)(*args++); + ushort b = *(unsigned short *)(*args++); + uint c = *(unsigned int *)(*args++); + ulong d = *(unsigned long *)(*args++); + uchar r = (uchar)-1; + fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d); + fflush(out); + *(ffi_arg *)retp = r; +}} +void d_iidd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_iidd) { fprintf(out,"wrong data for d_iidd\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double r=a+b+c+d; + fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d); + fflush(out); + *(double*)retp = r; +}} +void d_iiidi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_iiidi) { fprintf(out,"wrong data for d_iiidi\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int c = *(int*)(*args++); + double d = *(double*)(*args++); + int e = *(int*)(*args++); + double r=a+b+c+d+e; + fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e); + fflush(out); + *(double*)retp = r; +}} +void d_idid_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_idid) { fprintf(out,"wrong data for d_idid\n"); exit(1); } + {int a = *(int*)(*args++); + double b = *(double*)(*args++); + int c = *(int*)(*args++); + double d = *(double*)(*args++); + double r=a+b+c+d; + fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d); + fflush(out); + *(double*)retp = r; +}} +void d_fdi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_fdi) { fprintf(out,"wrong data for d_fdi\n"); exit(1); } + {float a = *(float*)(*args++); + double b = *(double*)(*args++); + int c = *(int*)(*args++); + double r=a+b+c; + fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c); + fflush(out); + *(double*)retp = r; +}} +void us_cdcd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&us_cdcd) { fprintf(out,"wrong data for us_cdcd\n"); exit(1); } + {char a = *(char*)(*args++); + double b = *(double*)(*args++); + char c = *(char*)(*args++); + double d = *(double*)(*args++); + ushort r = (ushort)(a + b + c + d); + fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d); + fflush(out); + *(ffi_arg *)retp = r; +}} +void ll_iiilli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_iiilli) { fprintf(out,"wrong data for ll_iiilli\n"); exit(1); } + {int a = *(int*)(*args++); + int b = *(int*)(*args++); + int c = *(int*)(*args++); + long long d = *(long long *)(*args++); + int e = *(int*)(*args++); + long long r = (long long)(int)a + (long long)(int)b + (long long)(int)c + d + (long long)e; + fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e); + fflush(out); + *(long long *)retp = r; +}} +void ll_flli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_flli) { fprintf(out,"wrong data for ll_flli\n"); exit(1); } + {float a = *(float*)(*args++); + long long b = *(long long *)(*args++); + int c = *(int*)(*args++); + long long r = (long long)(int)a + b + (long long)c; + fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c); + fflush(out); + *(long long *)retp = r; +}} +void f_fi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_fi) { fprintf(out,"wrong data for f_fi\n"); exit(1); } + {float a = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+z; + fprintf(out,"float f(float,int):(%g,%d)",a,z); + fflush(out); + *(float*)retp = r; +}} +void f_f2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f2i) { fprintf(out,"wrong data for f_f2i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+z; + fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z); + fflush(out); + *(float*)retp = r; +}} +void f_f3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f3i) { fprintf(out,"wrong data for f_f3i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+z; + fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z); + fflush(out); + *(float*)retp = r; +}} +void f_f4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f4i) { fprintf(out,"wrong data for f_f4i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+d+z; + fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); + fflush(out); + *(float*)retp = r; +}} +void f_f7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f7i) { fprintf(out,"wrong data for f_f7i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+d+e+f+g+z; + fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); + fflush(out); + *(float*)retp = r; +}} +void f_f8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f8i) { fprintf(out,"wrong data for f_f8i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+d+e+f+g+h+z; + fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); + fflush(out); + *(float*)retp = r; +}} +void f_f12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f12i) { fprintf(out,"wrong data for f_f12i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float i = *(float*)(*args++); + float j = *(float*)(*args++); + float k = *(float*)(*args++); + float l = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+d+e+f+g+h+i+j+k+l+z; + fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); + fflush(out); + *(float*)retp = r; +}} +void f_f13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f13i) { fprintf(out,"wrong data for f_f13i\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float i = *(float*)(*args++); + float j = *(float*)(*args++); + float k = *(float*)(*args++); + float l = *(float*)(*args++); + float m = *(float*)(*args++); + int z = *(int*)(*args++); + float r=a+b+c+d+e+f+g+h+i+j+k+l+m+z; + fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); + fflush(out); + *(float*)retp = r; +}} +void d_di_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_di) { fprintf(out,"wrong data for d_di\n"); exit(1); } + {double a = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+z; + fprintf(out,"double f(double,int):(%g,%d)",a,z); + fflush(out); + *(double*)retp = r; +}} +void d_d2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d2i) { fprintf(out,"wrong data for d_d2i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+z; + fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z); + fflush(out); + *(double*)retp = r; +}} +void d_d3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d3i) { fprintf(out,"wrong data for d_d3i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+z; + fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z); + fflush(out); + *(double*)retp = r; +}} +void d_d4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d4i) { fprintf(out,"wrong data for d_d4i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+d+z; + fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); + fflush(out); + *(double*)retp = r; +}} +void d_d7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d7i) { fprintf(out,"wrong data for d_d7i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+d+e+f+g+z; + fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); + fflush(out); + *(double*)retp = r; +}} +void d_d8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d8i) { fprintf(out,"wrong data for d_d8i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+d+e+f+g+h+z; + fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); + fflush(out); + *(double*)retp = r; +}} +void d_d12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d12i) { fprintf(out,"wrong data for d_d12i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + double i = *(double*)(*args++); + double j = *(double*)(*args++); + double k = *(double*)(*args++); + double l = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+d+e+f+g+h+i+j+k+l+z; + fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); + fflush(out); + *(double*)retp = r; +}} +void d_d13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d13i) { fprintf(out,"wrong data for d_d13i\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + double i = *(double*)(*args++); + double j = *(double*)(*args++); + double k = *(double*)(*args++); + double l = *(double*)(*args++); + double m = *(double*)(*args++); + int z = *(int*)(*args++); + double r=a+b+c+d+e+f+g+h+i+j+k+l+m+z; + fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); + fflush(out); + *(double*)retp = r; +}} + +/* small structure return tests */ +void S1_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S1_v) { fprintf(out,"wrong data for S1_v\n"); exit(1); } + {Size1 r = Size1_1; + fprintf(out,"Size1 f(void):"); + fflush(out); + *(Size1*)retp = r; +}} +void S2_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S2_v) { fprintf(out,"wrong data for S2_v\n"); exit(1); } + {Size2 r = Size2_1; + fprintf(out,"Size2 f(void):"); + fflush(out); + *(Size2*)retp = r; +}} +void S3_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S3_v) { fprintf(out,"wrong data for S3_v\n"); exit(1); } + {Size3 r = Size3_1; + fprintf(out,"Size3 f(void):"); + fflush(out); + *(Size3*)retp = r; +}} +void S4_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S4_v) { fprintf(out,"wrong data for S4_v\n"); exit(1); } + {Size4 r = Size4_1; + fprintf(out,"Size4 f(void):"); + fflush(out); + *(Size4*)retp = r; +}} +void S7_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S7_v) { fprintf(out,"wrong data for S7_v\n"); exit(1); } + {Size7 r = Size7_1; + fprintf(out,"Size7 f(void):"); + fflush(out); + *(Size7*)retp = r; +}} +void S8_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S8_v) { fprintf(out,"wrong data for S8_v\n"); exit(1); } + {Size8 r = Size8_1; + fprintf(out,"Size8 f(void):"); + fflush(out); + *(Size8*)retp = r; +}} +void S12_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S12_v) { fprintf(out,"wrong data for S12_v\n"); exit(1); } + {Size12 r = Size12_1; + fprintf(out,"Size12 f(void):"); + fflush(out); + *(Size12*)retp = r; +}} +void S15_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S15_v) { fprintf(out,"wrong data for S15_v\n"); exit(1); } + {Size15 r = Size15_1; + fprintf(out,"Size15 f(void):"); + fflush(out); + *(Size15*)retp = r; +}} +void S16_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&S16_v) { fprintf(out,"wrong data for S16_v\n"); exit(1); } + {Size16 r = Size16_1; + fprintf(out,"Size16 f(void):"); + fflush(out); + *(Size16*)retp = r; +}} + +/* structure tests */ +void I_III_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&I_III) { fprintf(out,"wrong data for I_III\n"); exit(1); } + {Int a = *(Int*)(*args++); + Int b = *(Int*)(*args++); + Int c = *(Int*)(*args++); + Int r; + r.x = a.x + b.x + c.x; + fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x); + fflush(out); + *(Int*)retp = r; +}} +void C_CdC_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&C_CdC) { fprintf(out,"wrong data for C_CdC\n"); exit(1); } + {Char a = *(Char*)(*args++); + double b = *(double*)(*args++); + Char c = *(Char*)(*args++); + Char r; + r.x = (a.x + c.x)/2; + fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x); + fflush(out); + *(Char*)retp = r; +}} +void F_Ffd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&F_Ffd) { fprintf(out,"wrong data for F_Ffd\n"); exit(1); } + {Float a = *(Float*)(*args++); + float b = *(float*)(*args++); + double c = *(double*)(*args++); + Float r; + r.x = a.x + b + c; + fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c); + fflush(out); + *(Float*)retp = r; +}} +void D_fDd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&D_fDd) { fprintf(out,"wrong data for D_fDd\n"); exit(1); } + {float a = *(float*)(*args++); + Double b = *(Double*)(*args++); + double c = *(double*)(*args++); + Double r; + r.x = a + b.x + c; + fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c); + fflush(out); + *(Double*)retp = r; +}} +void D_Dfd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&D_Dfd) { fprintf(out,"wrong data for D_Dfd\n"); exit(1); } + {Double a = *(Double*)(*args++); + float b = *(float*)(*args++); + double c = *(double*)(*args++); + Double r; + r.x = a.x + b + c; + fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c); + fflush(out); + *(Double*)retp = r; +}} +void J_JiJ_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&J_JiJ) { fprintf(out,"wrong data for J_JiJ\n"); exit(1); } + {J a = *(J*)(*args++); + int b= *(int*)(*args++); + J c = *(J*)(*args++); + J r; + r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2; + fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2); + fflush(out); + *(J*)retp = r; +}} +#ifndef SKIP_EXTRA_STRUCTS +void T_TcT_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&T_TcT) { fprintf(out,"wrong data for T_TcT\n"); exit(1); } + {T a = *(T*)(*args++); + char b = *(char*)(*args++); + T c = *(T*)(*args++); + T r; + r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2]; + fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]); + fflush(out); + *(T*)retp = r; +}} +void X_BcdB_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&X_BcdB) { fprintf(out,"wrong data for X_BcdB\n"); exit(1); } + {B a = *(B*)(*args++); + char b = *(char*)(*args++); + double c = *(double*)(*args++); + B d = *(B*)(*args++); + static X xr={"return val",'R'}; + X r; + r = xr; + r.c1 = b; + fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})", + a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]); + fflush(out); + *(X*)retp = r; +}} +#endif + +/* gpargs boundary tests */ +void l_l0K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l0K) { fprintf(out,"wrong data for l_l0K\n"); exit(1); } + {K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l1K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l1K) { fprintf(out,"wrong data for l_l1K\n"); exit(1); } + {long a1 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l2K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l2K) { fprintf(out,"wrong data for l_l2K\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l3K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l3K) { fprintf(out,"wrong data for l_l3K\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l4K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l4K) { fprintf(out,"wrong data for l_l4K\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l5K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l5K) { fprintf(out,"wrong data for l_l5K\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void l_l6K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&l_l6K) { fprintf(out,"wrong data for l_l6K\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long a6 = *(long*)(*args++); + K b = *(K*)(*args++); + long c = *(long*)(*args++); + long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + *(ffi_arg*)retp = r; +}} +void f_f17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&f_f17l3L) { fprintf(out,"wrong data for f_f17l3L\n"); exit(1); } + {float a = *(float*)(*args++); + float b = *(float*)(*args++); + float c = *(float*)(*args++); + float d = *(float*)(*args++); + float e = *(float*)(*args++); + float f = *(float*)(*args++); + float g = *(float*)(*args++); + float h = *(float*)(*args++); + float i = *(float*)(*args++); + float j = *(float*)(*args++); + float k = *(float*)(*args++); + float l = *(float*)(*args++); + float m = *(float*)(*args++); + float n = *(float*)(*args++); + float o = *(float*)(*args++); + float p = *(float*)(*args++); + float q = *(float*)(*args++); + long s = *(long*)(*args++); + long t = *(long*)(*args++); + long u = *(long*)(*args++); + L z = *(L*)(*args++); + float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; + fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); + fflush(out); + *(float*)retp = r; +}} +void d_d17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_d17l3L) { fprintf(out,"wrong data for d_d17l3L\n"); exit(1); } + {double a = *(double*)(*args++); + double b = *(double*)(*args++); + double c = *(double*)(*args++); + double d = *(double*)(*args++); + double e = *(double*)(*args++); + double f = *(double*)(*args++); + double g = *(double*)(*args++); + double h = *(double*)(*args++); + double i = *(double*)(*args++); + double j = *(double*)(*args++); + double k = *(double*)(*args++); + double l = *(double*)(*args++); + double m = *(double*)(*args++); + double n = *(double*)(*args++); + double o = *(double*)(*args++); + double p = *(double*)(*args++); + double q = *(double*)(*args++); + long s = *(long*)(*args++); + long t = *(long*)(*args++); + long u = *(long*)(*args++); + L z = *(L*)(*args++); + double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; + fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); + fflush(out); + *(double*)retp = r; +}} +void ll_l2ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l2ll) { fprintf(out,"wrong data for ll_l2ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2) + b + c; + fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void ll_l3ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l3ll) { fprintf(out,"wrong data for ll_l3ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2 + a3) + b + c; + fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void ll_l4ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l4ll) { fprintf(out,"wrong data for ll_l4ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2 + a3 + a4) + b + c; + fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void ll_l5ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l5ll) { fprintf(out,"wrong data for ll_l5ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c; + fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void ll_l6ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l6ll) { fprintf(out,"wrong data for ll_l6ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long a6 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; + fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void ll_l7ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&ll_l7ll) { fprintf(out,"wrong data for ll_l7ll\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long a6 = *(long*)(*args++); + long a7 = *(long*)(*args++); + long long b = *(long long *)(*args++); + long c = *(long*)(*args++); + long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; + fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + *(long long *)retp = r; +}} +void d_l2d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l2d) { fprintf(out,"wrong data for d_l2d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2) + b + c; + fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c); + fflush(out); + *(double*)retp = r; +}} +void d_l3d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l3d) { fprintf(out,"wrong data for d_l3d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2 + a3) + b + c; + fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c); + fflush(out); + *(double*)retp = r; +}} +void d_l4d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l4d) { fprintf(out,"wrong data for d_l4d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2 + a3 + a4) + b + c; + fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c); + fflush(out); + *(double*)retp = r; +}} +void d_l5d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l5d) { fprintf(out,"wrong data for d_l5d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c; + fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c); + fflush(out); + *(double*)retp = r; +}} +void d_l6d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l6d) { fprintf(out,"wrong data for d_l6d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long a6 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; + fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c); + fflush(out); + *(double*)retp = r; +}} +void d_l7d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data) +{ + if (data != (void*)&d_l7d) { fprintf(out,"wrong data for d_l7d\n"); exit(1); } + {long a1 = *(long*)(*args++); + long a2 = *(long*)(*args++); + long a3 = *(long*)(*args++); + long a4 = *(long*)(*args++); + long a5 = *(long*)(*args++); + long a6 = *(long*)(*args++); + long a7 = *(long*)(*args++); + double b = *(double*)(*args++); + long c = *(long*)(*args++); + double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; + fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c); + fflush(out); + *(double*)retp = r; +}} + + +/* + * The way we run these tests - first call the function directly, then + * through vacall() - there is the danger that arguments or results seem + * to be passed correctly, but what we are seeing are in fact the vestiges + * (traces) or the previous call. This may seriously fake the test. + * Avoid this by clearing the registers between the first and the second call. + */ +long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h, + long i, long j, long k, long l, long m, long n, long o, long p) +{ return 0; } +float clear_traces_f (float a, float b, float c, float d, float e, float f, float g, + float h, float i, float j, float k, float l, float m, float n, + float o, float p) +{ return 0.0; } +double clear_traces_d (double a, double b, double c, double d, double e, double f, double g, + double h, double i, double j, double k, double l, double m, double n, + double o, double p) +{ return 0.0; } +J clear_traces_J (void) +{ J j; j.l1 = j.l2 = 0; return j; } +void clear_traces (void) +{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); + clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); + clear_traces_J(); +} + +int main (void) +{ + void* callback_code; + void* callback_writable; +#define ALLOC_CALLBACK() \ + callback_writable = ffi_closure_alloc(sizeof(ffi_closure),&callback_code); \ + if (!callback_writable) abort() +#define PREP_CALLBACK(cif,simulator,data) \ + if (ffi_prep_closure_loc(callback_writable,&(cif),simulator,data,callback_code) != FFI_OK) abort() +#define FREE_CALLBACK() \ + ffi_closure_free(callback_writable) + + ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar; + out = stdout; + +#if (!defined(DGTEST)) || DGTEST == 1 + /* void tests */ + v_v(); + clear_traces(); + ALLOC_CALLBACK(); + { + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_void); + PREP_CALLBACK(cif,v_v_simulator,(void*)&v_v); + ((void (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); +#endif + + /* int tests */ + { int ir; + +#if (!defined(DGTEST)) || DGTEST == 2 + ir = i_v(); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_sint); + PREP_CALLBACK(cif,i_v_simulator,(void*)&i_v); + ir = ((int (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 3 + ir = i_i(i1); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + PREP_CALLBACK(cif,i_i_simulator,(void*)&i_i); + ir = ((int (ABI_ATTR *) (int)) callback_code) (i1); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 4 + ir = i_i2(i1,i2); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + PREP_CALLBACK(cif,i_i2_simulator,(void*)&i_i2); + ir = ((int (ABI_ATTR *) (int,int)) callback_code) (i1,i2); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 5 + ir = i_i4(i1,i2,i3,i4); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + PREP_CALLBACK(cif,i_i4_simulator,(void*)&i_i4); + ir = ((int (ABI_ATTR *) (int,int,int,int)) callback_code) (i1,i2,i3,i4); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 6 + ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + PREP_CALLBACK(cif,i_i8_simulator,(void*)&i_i8); + ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 7 + ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16); + fprintf(out,"->%d\n",ir); + fflush(out); + ir = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_sint); + PREP_CALLBACK(cif,i_i16_simulator,(void*)&i_i16); + ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16); + } + FREE_CALLBACK(); + fprintf(out,"->%d\n",ir); + fflush(out); +#endif + } + + /* float tests */ + { float fr; + +#if (!defined(DGTEST)) || DGTEST == 8 + fr = f_f(f1); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f_simulator,(void*)&f_f); + fr = ((float (ABI_ATTR *) (float)) callback_code) (f1); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 9 + fr = f_f2(f1,f2); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f2_simulator,(void*)&f_f2); + fr = ((float (ABI_ATTR *) (float,float)) callback_code) (f1,f2); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 10 + fr = f_f4(f1,f2,f3,f4); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f4_simulator,(void*)&f_f4); + fr = ((float (ABI_ATTR *) (float,float,float,float)) callback_code) (f1,f2,f3,f4); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 11 + fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f8_simulator,(void*)&f_f8); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 12 + fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f16_simulator,(void*)&f_f16); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 13 + fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f24_simulator,(void*)&f_f24); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + + } + + /* double tests */ + { double dr; + +#if (!defined(DGTEST)) || DGTEST == 14 + dr = d_d(d1); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d_simulator,(void*)&d_d); + dr = ((double (ABI_ATTR *) (double)) callback_code) (d1); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 15 + dr = d_d2(d1,d2); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d2_simulator,(void*)&d_d2); + dr = ((double (ABI_ATTR *) (double,double)) callback_code) (d1,d2); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 16 + dr = d_d4(d1,d2,d3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d4_simulator,(void*)&d_d4); + dr = ((double (ABI_ATTR *) (double,double,double,double)) callback_code) (d1,d2,d3,d4); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 17 + dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d8_simulator,(void*)&d_d8); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 18 + dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d16_simulator,(void*)&d_d16); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + } + + /* pointer tests */ + { void* vpr; + +#if (!defined(DGTEST)) || DGTEST == 19 + vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4); + fprintf(out,"->0x%p\n",vpr); + fflush(out); + vpr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_pointer); + PREP_CALLBACK(cif,vp_vpdpcpsp_simulator,(void*)&vp_vpdpcpsp); + vpr = ((void* (ABI_ATTR *) (void*,double*,char*,Int*)) callback_code) (&uc1,&d2,str3,&I4); + } + FREE_CALLBACK(); + fprintf(out,"->0x%p\n",vpr); + fflush(out); +#endif + } + + /* mixed number tests */ + { uchar ucr; + ushort usr; + float fr; + double dr; + long long llr; + +#if (!defined(DGTEST)) || DGTEST == 20 + ucr = uc_ucsil(uc1,us2,ui3,ul4); + fprintf(out,"->%u\n",ucr); + fflush(out); + ucr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_uchar); + PREP_CALLBACK(cif,uc_ucsil_simulator,(void*)&uc_ucsil); + ucr = ((uchar (ABI_ATTR *) (uchar,ushort,uint,ulong)) callback_code) (uc1,us2,ui3,ul4); + } + FREE_CALLBACK(); + fprintf(out,"->%u\n",ucr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 21 + dr = d_iidd(i1,i2,d3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_iidd_simulator,(void*)&d_iidd); + dr = ((double (ABI_ATTR *) (int,int,double,double)) callback_code) (i1,i2,d3,d4); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 22 + dr = d_iiidi(i1,i2,i3,d4,i5); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_iiidi_simulator,(void*)&d_iiidi); + dr = ((double (ABI_ATTR *) (int,int,int,double,int)) callback_code) (i1,i2,i3,d4,i5); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 23 + dr = d_idid(i1,d2,i3,d4); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_idid_simulator,(void*)&d_idid); + dr = ((double (ABI_ATTR *) (int,double,int,double)) callback_code) (i1,d2,i3,d4); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 24 + dr = d_fdi(f1,d2,i3); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_fdi_simulator,(void*)&d_fdi); + dr = ((double (ABI_ATTR *) (float,double,int)) callback_code) (f1,d2,i3); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 25 + usr = us_cdcd(c1,d2,c3,d4); + fprintf(out,"->%u\n",usr); + fflush(out); + usr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_ushort); + PREP_CALLBACK(cif,us_cdcd_simulator,(void*)&us_cdcd); + usr = ((ushort (ABI_ATTR *) (char,double,char,double)) callback_code) (c1,d2,c3,d4); + } + FREE_CALLBACK(); + fprintf(out,"->%u\n",usr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 26 + llr = ll_iiilli(i1,i2,i3,ll1,i13); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_iiilli_simulator,(void*)&ll_iiilli); + llr = ((long long (ABI_ATTR *) (int,int,int,long long,int)) callback_code) (i1,i2,i3,ll1,i13); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 27 + llr = ll_flli(f13,ll1,i13); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_flli_simulator,(void*)&ll_flli); + llr = ((long long (ABI_ATTR *) (float,long long,int)) callback_code) (f13,ll1,i13); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 28 + fr = f_fi(f1,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_fi_simulator,(void*)&f_fi); + fr = ((float (ABI_ATTR *) (float,int)) callback_code) (f1,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 29 + fr = f_f2i(f1,f2,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f2i_simulator,(void*)&f_f2i); + fr = ((float (ABI_ATTR *) (float,float,int)) callback_code) (f1,f2,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 30 + fr = f_f3i(f1,f2,f3,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f3i_simulator,(void*)&f_f3i); + fr = ((float (ABI_ATTR *) (float,float,float,int)) callback_code) (f1,f2,f3,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 31 + fr = f_f4i(f1,f2,f3,f4,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f4i_simulator,(void*)&f_f4i); + fr = ((float (ABI_ATTR *) (float,float,float,float,int)) callback_code) (f1,f2,f3,f4,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 32 + fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f7i_simulator,(void*)&f_f7i); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 33 + fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f8i_simulator,(void*)&f_f8i); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 34 + fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f13i_simulator,(void*)&f_f13i); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 35 + dr = d_di(d1,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_di_simulator,(void*)&d_di); + dr = ((double (ABI_ATTR *) (double,int)) callback_code) (d1,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 36 + dr = d_d2i(d1,d2,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d2i_simulator,(void*)&d_d2i); + dr = ((double (ABI_ATTR *) (double,double,int)) callback_code) (d1,d2,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 37 + dr = d_d3i(d1,d2,d3,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d3i_simulator,(void*)&d_d3i); + dr = ((double (ABI_ATTR *) (double,double,double,int)) callback_code) (d1,d2,d3,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 38 + dr = d_d4i(d1,d2,d3,d4,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d4i_simulator,(void*)&d_d4i); + dr = ((double (ABI_ATTR *) (double,double,double,double,int)) callback_code) (d1,d2,d3,d4,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 39 + dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d7i_simulator,(void*)&d_d7i); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 40 + dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d8i_simulator,(void*)&d_d8i); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 41 + dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d12i_simulator,(void*)&d_d12i); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 42 + dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d13i_simulator,(void*)&d_d13i); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + } + + /* small structure return tests */ +#if (!defined(DGTEST)) || DGTEST == 43 + { + Size1 r = S1_v(); + fprintf(out,"->{%c}\n",r.x1); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL }; + ffi_type ffi_type_Size1; + ffi_type_Size1.type = FFI_TYPE_STRUCT; + ffi_type_Size1.size = sizeof(Size1); + ffi_type_Size1.alignment = alignof_slot(Size1); + ffi_type_Size1.elements = ffi_type_Size1_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1); + PREP_CALLBACK(cif,S1_v_simulator,(void*)&S1_v); + r = ((Size1 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c}\n",r.x1); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 44 + { + Size2 r = S2_v(); + fprintf(out,"->{%c%c}\n",r.x1,r.x2); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size2; + ffi_type_Size2.type = FFI_TYPE_STRUCT; + ffi_type_Size2.size = sizeof(Size2); + ffi_type_Size2.alignment = alignof_slot(Size2); + ffi_type_Size2.elements = ffi_type_Size2_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2); + PREP_CALLBACK(cif,S2_v_simulator,(void*)&S2_v); + r = ((Size2 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c}\n",r.x1,r.x2); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 45 + { + Size3 r = S3_v(); + fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size3; + ffi_type_Size3.type = FFI_TYPE_STRUCT; + ffi_type_Size3.size = sizeof(Size3); + ffi_type_Size3.alignment = alignof_slot(Size3); + ffi_type_Size3.elements = ffi_type_Size3_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3); + PREP_CALLBACK(cif,S3_v_simulator,(void*)&S3_v); + r = ((Size3 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 46 + { + Size4 r = S4_v(); + fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size4; + ffi_type_Size4.type = FFI_TYPE_STRUCT; + ffi_type_Size4.size = sizeof(Size4); + ffi_type_Size4.alignment = alignof_slot(Size4); + ffi_type_Size4.elements = ffi_type_Size4_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4); + PREP_CALLBACK(cif,S4_v_simulator,(void*)&S4_v); + r = ((Size4 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 47 + { + Size7 r = S7_v(); + fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size7; + ffi_type_Size7.type = FFI_TYPE_STRUCT; + ffi_type_Size7.size = sizeof(Size7); + ffi_type_Size7.alignment = alignof_slot(Size7); + ffi_type_Size7.elements = ffi_type_Size7_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7); + PREP_CALLBACK(cif,S7_v_simulator,(void*)&S7_v); + r = ((Size7 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 48 + { + Size8 r = S8_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size8; + ffi_type_Size8.type = FFI_TYPE_STRUCT; + ffi_type_Size8.size = sizeof(Size8); + ffi_type_Size8.alignment = alignof_slot(Size8); + ffi_type_Size8.elements = ffi_type_Size8_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8); + PREP_CALLBACK(cif,S8_v_simulator,(void*)&S8_v); + r = ((Size8 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 49 + { + Size12 r = S12_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size12; + ffi_type_Size12.type = FFI_TYPE_STRUCT; + ffi_type_Size12.size = sizeof(Size12); + ffi_type_Size12.alignment = alignof_slot(Size12); + ffi_type_Size12.elements = ffi_type_Size12_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12); + PREP_CALLBACK(cif,S12_v_simulator,(void*)&S12_v); + r = ((Size12 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 50 + { + Size15 r = S15_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size15; + ffi_type_Size15.type = FFI_TYPE_STRUCT; + ffi_type_Size15.size = sizeof(Size15); + ffi_type_Size15.alignment = alignof_slot(Size15); + ffi_type_Size15.elements = ffi_type_Size15_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15); + PREP_CALLBACK(cif,S15_v_simulator,(void*)&S15_v); + r = ((Size15 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15); + fflush(out); + } +#endif + +#if (!defined(DGTEST)) || DGTEST == 51 + { + Size16 r = S16_v(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16); + fflush(out); + memset(&r,0,sizeof(r)); clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL }; + ffi_type ffi_type_Size16; + ffi_type_Size16.type = FFI_TYPE_STRUCT; + ffi_type_Size16.size = sizeof(Size16); + ffi_type_Size16.alignment = alignof_slot(Size16); + ffi_type_Size16.elements = ffi_type_Size16_elements; + ffi_cif cif; + FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16); + PREP_CALLBACK(cif,S16_v_simulator,(void*)&S16_v); + r = ((Size16 (ABI_ATTR *) (void)) callback_code) (); + } + FREE_CALLBACK(); + fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16); + fflush(out); + } +#endif + + + /* structure tests */ + { Int Ir; + Char Cr; + Float Fr; + Double Dr; + J Jr; +#ifndef SKIP_EXTRA_STRUCTS + T Tr; + X Xr; +#endif + +#if (!defined(DGTEST)) || DGTEST == 52 + Ir = I_III(I1,I2,I3); + fprintf(out,"->{%d}\n",Ir.x); + fflush(out); + Ir.x = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL }; + ffi_type ffi_type_Int; + ffi_type_Int.type = FFI_TYPE_STRUCT; + ffi_type_Int.size = sizeof(Int); + ffi_type_Int.alignment = alignof_slot(Int); + ffi_type_Int.elements = ffi_type_Int_elements; + ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Int); + PREP_CALLBACK(cif,I_III_simulator,(void*)&I_III); + Ir = ((Int (ABI_ATTR *) (Int,Int,Int)) callback_code) (I1,I2,I3); + } + FREE_CALLBACK(); + fprintf(out,"->{%d}\n",Ir.x); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 53 + Cr = C_CdC(C1,d2,C3); + fprintf(out,"->{'%c'}\n",Cr.x); + fflush(out); + Cr.x = '\0'; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL }; + ffi_type ffi_type_Char; + ffi_type_Char.type = FFI_TYPE_STRUCT; + ffi_type_Char.size = sizeof(Char); + ffi_type_Char.alignment = alignof_slot(Char); + ffi_type_Char.elements = ffi_type_Char_elements; + ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Char); + PREP_CALLBACK(cif,C_CdC_simulator,(void*)&C_CdC); + Cr = ((Char (ABI_ATTR *) (Char,double,Char)) callback_code) (C1,d2,C3); + } + FREE_CALLBACK(); + fprintf(out,"->{'%c'}\n",Cr.x); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 54 + Fr = F_Ffd(F1,f2,d3); + fprintf(out,"->{%g}\n",Fr.x); + fflush(out); + Fr.x = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL }; + ffi_type ffi_type_Float; + ffi_type_Float.type = FFI_TYPE_STRUCT; + ffi_type_Float.size = sizeof(Float); + ffi_type_Float.alignment = alignof_slot(Float); + ffi_type_Float.elements = ffi_type_Float_elements; + ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Float); + PREP_CALLBACK(cif,F_Ffd_simulator,(void*)&F_Ffd); + Fr = ((Float (ABI_ATTR *) (Float,float,double)) callback_code) (F1,f2,d3); + } + FREE_CALLBACK(); + fprintf(out,"->{%g}\n",Fr.x); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 55 + Dr = D_fDd(f1,D2,d3); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); + Dr.x = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; + ffi_type ffi_type_Double; + ffi_type_Double.type = FFI_TYPE_STRUCT; + ffi_type_Double.size = sizeof(Double); + ffi_type_Double.alignment = alignof_slot(Double); + ffi_type_Double.elements = ffi_type_Double_elements; + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Double); + PREP_CALLBACK(cif,D_fDd_simulator,(void*)&D_fDd); + Dr = ((Double (ABI_ATTR *) (float,Double,double)) callback_code) (f1,D2,d3); + } + FREE_CALLBACK(); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 56 + Dr = D_Dfd(D1,f2,d3); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); + Dr.x = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL }; + ffi_type ffi_type_Double; + ffi_type_Double.type = FFI_TYPE_STRUCT; + ffi_type_Double.size = sizeof(Double); + ffi_type_Double.alignment = alignof_slot(Double); + ffi_type_Double.elements = ffi_type_Double_elements; + ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_Double); + PREP_CALLBACK(cif,D_Dfd_simulator,(void*)&D_Dfd); + Dr = ((Double (ABI_ATTR *) (Double,float,double)) callback_code) (D1,f2,d3); + } + FREE_CALLBACK(); + fprintf(out,"->{%g}\n",Dr.x); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 57 + Jr = J_JiJ(J1,i2,J2); + fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); + fflush(out); + Jr.l1 = Jr.l2 = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_J; + ffi_type_J.type = FFI_TYPE_STRUCT; + ffi_type_J.size = sizeof(J); + ffi_type_J.alignment = alignof_slot(J); + ffi_type_J.elements = ffi_type_J_elements; + ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_J); + PREP_CALLBACK(cif,J_JiJ_simulator,(void*)&J_JiJ); + Jr = ((J (ABI_ATTR *) (J,int,J)) callback_code) (J1,i2,J2); + } + FREE_CALLBACK(); + fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2); + fflush(out); +#endif + +#ifndef SKIP_EXTRA_STRUCTS +#if (!defined(DGTEST)) || DGTEST == 58 + Tr = T_TcT(T1,' ',T2); + fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); + fflush(out); + Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_T_elements[] = { ??, NULL }; + ffi_type ffi_type_T; + ffi_type_T.type = FFI_TYPE_STRUCT; + ffi_type_T.size = sizeof(T); + ffi_type_T.alignment = alignof_slot(T); + ffi_type_T.elements = ffi_type_T_elements; + ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_T); + PREP_CALLBACK(cif,T_TcT_simulator,(void*)&T_TcT); + Tr = ((T (ABI_ATTR *) (T,char,T)) callback_code) (T1,' ',T2); + } + FREE_CALLBACK(); + fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]); + fflush(out); +#endif + +#ifndef SKIP_X +#if (!defined(DGTEST)) || DGTEST == 59 + Xr = X_BcdB(B1,c2,d3,B2); + fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); + fflush(out); + Xr.c[0]=Xr.c1='\0'; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* ffi_type_X_elements[] = { ??, NULL }; + ffi_type ffi_type_X; + ffi_type_X.type = FFI_TYPE_STRUCT; + ffi_type_X.size = sizeof(X); + ffi_type_X.alignment = alignof_slot(X); + ffi_type_X.elements = ffi_type_X_elements; + ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_X); + PREP_CALLBACK(cif,X_BcdB_simulator,(void*)&X_BcdB); + Xr = ((X (ABI_ATTR *) (B,char,double,B)) callback_code) (B1,c2,d3,B2); + } + FREE_CALLBACK(); + fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1); + fflush(out); +#endif +#endif +#endif + } + + + /* gpargs boundary tests */ + { + ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_K; + ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL }; + ffi_type ffi_type_L; + long lr; + long long llr; + float fr; + double dr; + + ffi_type_K.type = FFI_TYPE_STRUCT; + ffi_type_K.size = sizeof(K); + ffi_type_K.alignment = alignof_slot(K); + ffi_type_K.elements = ffi_type_K_elements; + + ffi_type_L.type = FFI_TYPE_STRUCT; + ffi_type_L.size = sizeof(L); + ffi_type_L.alignment = alignof_slot(L); + ffi_type_L.elements = ffi_type_L_elements; + +#if (!defined(DGTEST)) || DGTEST == 60 + lr = l_l0K(K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l0K_simulator,(void*)l_l0K); + lr = ((long (ABI_ATTR *) (K,long)) callback_code) (K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 61 + lr = l_l1K(l1,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l1K_simulator,(void*)l_l1K); + lr = ((long (ABI_ATTR *) (long,K,long)) callback_code) (l1,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 62 + lr = l_l2K(l1,l2,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l2K_simulator,(void*)l_l2K); + lr = ((long (ABI_ATTR *) (long,long,K,long)) callback_code) (l1,l2,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 63 + lr = l_l3K(l1,l2,l3,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l3K_simulator,(void*)l_l3K); + lr = ((long (ABI_ATTR *) (long,long,long,K,long)) callback_code) (l1,l2,l3,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 64 + lr = l_l4K(l1,l2,l3,l4,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l4K_simulator,(void*)l_l4K); + lr = ((long (ABI_ATTR *) (long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 65 + lr = l_l5K(l1,l2,l3,l4,l5,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l5K_simulator,(void*)l_l5K); + lr = ((long (ABI_ATTR *) (long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 66 + lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9); + fprintf(out,"->%ld\n",lr); + fflush(out); + lr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slong); + PREP_CALLBACK(cif,l_l6K_simulator,(void*)l_l6K); + lr = ((long (ABI_ATTR *) (long,long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,l6,K1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%ld\n",lr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 67 + fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1); + fprintf(out,"->%g\n",fr); + fflush(out); + fr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_float); + PREP_CALLBACK(cif,f_f17l3L_simulator,(void*)&f_f17l3L); + fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,long,long,long,L)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",fr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 68 + dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_d17l3L_simulator,(void*)&d_d17l3L); + dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,long,long,long,L)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 69 + llr = ll_l2ll(l1,l2,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l2ll_simulator,(void*)ll_l2ll); + llr = ((long long (ABI_ATTR *) (long,long,long long,long)) callback_code) (l1,l2,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 70 + llr = ll_l3ll(l1,l2,l3,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l3ll_simulator,(void*)ll_l3ll); + llr = ((long long (ABI_ATTR *) (long,long,long,long long,long)) callback_code) (l1,l2,l3,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 71 + llr = ll_l4ll(l1,l2,l3,l4,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l4ll_simulator,(void*)ll_l4ll); + llr = ((long long (ABI_ATTR *) (long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 72 + llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l5ll_simulator,(void*)ll_l5ll); + llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 73 + llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l6ll_simulator,(void*)ll_l6ll); + llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 74 + llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); + llr = 0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong); + PREP_CALLBACK(cif,ll_l7ll_simulator,(void*)ll_l7ll); + llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff)); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 75 + dr = d_l2d(l1,l2,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l2d_simulator,(void*)d_l2d); + dr = ((double (ABI_ATTR *) (long,long,double,long)) callback_code) (l1,l2,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 76 + dr = d_l3d(l1,l2,l3,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l3d_simulator,(void*)d_l3d); + dr = ((double (ABI_ATTR *) (long,long,long,double,long)) callback_code) (l1,l2,l3,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 77 + dr = d_l4d(l1,l2,l3,l4,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l4d_simulator,(void*)d_l4d); + dr = ((double (ABI_ATTR *) (long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 78 + dr = d_l5d(l1,l2,l3,l4,l5,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l5d_simulator,(void*)d_l5d); + dr = ((double (ABI_ATTR *) (long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 79 + dr = d_l6d(l1,l2,l3,l4,l5,l6,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l6d_simulator,(void*)d_l6d); + dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + +#if (!defined(DGTEST)) || DGTEST == 80 + dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,ll1,l9); + fprintf(out,"->%g\n",dr); + fflush(out); + dr = 0.0; clear_traces(); + ALLOC_CALLBACK(); + { + ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong }; + ffi_cif cif; + FFI_PREP_CIF(cif,argtypes,ffi_type_double); + PREP_CALLBACK(cif,d_l7d_simulator,(void*)d_l7d); + dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9); + } + FREE_CALLBACK(); + fprintf(out,"->%g\n",dr); + fflush(out); +#endif + + } + + exit(0); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c new file mode 100644 index 0000000..d25ebf4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c @@ -0,0 +1,743 @@ +/* + * Copyright 1993 Bill Triggs + * Copyright 1995-2017 Bruno Haible + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* This file defines test functions of selected signatures, that exercise + dark corners of the various ABIs. */ + +#include + +FILE* out; + +#define uchar unsigned char +#define ushort unsigned short +#define uint unsigned int +#define ulong unsigned long + +typedef struct { char x; } Char; +typedef struct { short x; } Short; +typedef struct { int x; } Int; +typedef struct { long x; } Long; +typedef struct { float x; } Float; +typedef struct { double x; } Double; +typedef struct { char c; float f; } A; +typedef struct { double d; int i[3]; } B; +typedef struct { long l1; long l2; } J; +typedef struct { long l1; long l2; long l3; long l4; } K; +typedef struct { long l1; long l2; long l3; long l4; long l5; long l6; } L; +typedef struct { char x1; } Size1; +typedef struct { char x1; char x2; } Size2; +typedef struct { char x1; char x2; char x3; } Size3; +typedef struct { char x1; char x2; char x3; char x4; } Size4; +typedef struct { + char x1; char x2; char x3; char x4; char x5; char x6; char x7; +} Size7; +typedef struct { + char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8; +} Size8; +typedef struct { + char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8; + char x9; char x10; char x11; char x12; +} Size12; +typedef struct { + char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8; + char x9; char x10; char x11; char x12; char x13; char x14; char x15; +} Size15; +typedef struct { + char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8; + char x9; char x10; char x11; char x12; char x13; char x14; char x15; char x16; +} Size16; +typedef struct { char c[3]; } T; +typedef struct { char c[33],c1; } X; + +char c1='a', c2=127, c3=(char)128, c4=(char)255, c5=-1; +short s1=32767, s2=(short)32768, s3=3, s4=4, s5=5, s6=6, s7=7, s8=8, s9=9; +int i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9, + i10=11, i11=12, i12=13, i13=14, i14=15, i15=16, i16=17; +long l1=1, l2=2, l3=3, l4=4, l5=5, l6=6, l7=7, l8=8, l9=9; +long long ll1 = 3875056143130689530LL; +float f1=0.1f, f2=0.2f, f3=0.3f, f4=0.4f, f5=0.5f, f6=0.6f, f7=0.7f, f8=0.8f, f9=0.9f, + f10=1.1f, f11=1.2f, f12=1.3f, f13=1.4f, f14=1.5f, f15=1.6f, f16=1.7f, f17=1.8f, + f18=1.9f, f19=2.1f, f20=2.2f, f21=2.3f, f22=2.4f, f23=2.5f, f24=2.6f; +double d1=0.1, d2=0.2, d3=0.3, d4=0.4, d5=0.5, d6=0.6, d7=0.7, d8=0.8, d9=0.9, + d10=1.1, d11=1.2, d12=1.3, d13=1.4, d14=1.5, d15=1.6, d16=1.7, d17=1.8; + +uchar uc1='a', uc2=127, uc3=128, uc4=255, uc5=(uchar)-1; +ushort us1=1, us2=2, us3=3, us4=4, us5=5, us6=6, us7=7, us8=8, us9=9; +uint ui1=1, ui2=2, ui3=3, ui4=4, ui5=5, ui6=6, ui7=7, ui8=8, ui9=9; +ulong ul1=1, ul2=2, ul3=3, ul4=4, ul5=5, ul6=6, ul7=7, ul8=8, ul9=9; + +char *str1="hello",str2[]="goodbye",*str3="still here?"; +Char C1={'A'}, C2={'B'}, C3={'C'}, C4={'\377'}, C5={(char)(-1)}; +Short S1={1}, S2={2}, S3={3}, S4={4}, S5={5}, S6={6}, S7={7}, S8={8}, S9={9}; +Int I1={1}, I2={2}, I3={3}, I4={4}, I5={5}, I6={6}, I7={7}, I8={8}, I9={9}; +Float F1={0.1f}, F2={0.2f}, F3={0.3f}, F4={0.4f}, F5={0.5f}, F6={0.6f}, F7={0.7f}, F8={0.8f}, F9={0.9f}; +Double D1={0.1}, D2={0.2}, D3={0.3}, D4={0.4}, D5={0.5}, D6={0.6}, D7={0.7}, D8={0.8}, D9={0.9}; + +A A1={'a',0.1f},A2={'b',0.2f},A3={'\377',0.3f}; +B B1={0.1,{1,2,3}},B2={0.2,{5,4,3}}; +J J1={47,11},J2={73,55}; +K K1={19,69,12,28}; +L L1={561,1105,1729,2465,2821,6601}; /* A002997 */ +Size1 Size1_1={'a'}; +Size2 Size2_1={'a','b'}; +Size3 Size3_1={'a','b','c'}; +Size4 Size4_1={'a','b','c','d'}; +Size7 Size7_1={'a','b','c','d','e','f','g'}; +Size8 Size8_1={'a','b','c','d','e','f','g','h'}; +Size12 Size12_1={'a','b','c','d','e','f','g','h','i','j','k','l'}; +Size15 Size15_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'}; +Size16 Size16_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}; +T T1={{'t','h','e'}},T2={{'f','o','x'}}; +X X1={"abcdefghijklmnopqrstuvwxyzABCDEF",'G'}, X2={"123",'9'}, X3={"return-return-return",'R'}; + +#if defined(__GNUC__) +#define __STDCALL__ __attribute__((stdcall)) +#define __THISCALL__ __attribute__((thiscall)) +#define __FASTCALL__ __attribute__((fastcall)) +#define __MSABI__ __attribute__((ms_abi)) +#else +#define __STDCALL__ __stdcall +#define __THISCALL__ __thiscall +#define __FASTCALL__ __fastcall +#endif + +#ifndef ABI_ATTR +#define ABI_ATTR +#endif + +/* void tests */ +void ABI_ATTR v_v (void) +{ + fprintf(out,"void f(void):\n"); + fflush(out); +} + +/* int tests */ +int ABI_ATTR i_v (void) +{ + int r=99; + fprintf(out,"int f(void):"); + fflush(out); + return r; +} +int ABI_ATTR i_i (int a) +{ + int r=a+1; + fprintf(out,"int f(int):(%d)",a); + fflush(out); + return r; +} +int ABI_ATTR i_i2 (int a, int b) +{ + int r=a+b; + fprintf(out,"int f(2*int):(%d,%d)",a,b); + fflush(out); + return r; +} +int ABI_ATTR i_i4 (int a, int b, int c, int d) +{ + int r=a+b+c+d; + fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d); + fflush(out); + return r; +} +int ABI_ATTR i_i8 (int a, int b, int c, int d, int e, int f, int g, int h) +{ + int r=a+b+c+d+e+f+g+h; + fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h); + fflush(out); + return r; +} +int ABI_ATTR i_i16 (int a, int b, int c, int d, int e, int f, int g, int h, + int i, int j, int k, int l, int m, int n, int o, int p) +{ + int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", + a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + return r; +} + +/* float tests */ +float ABI_ATTR f_f (float a) +{ + float r=a+1.0f; + fprintf(out,"float f(float):(%g)",a); + fflush(out); + return r; +} +float ABI_ATTR f_f2 (float a, float b) +{ + float r=a+b; + fprintf(out,"float f(2*float):(%g,%g)",a,b); + fflush(out); + return r; +} +float ABI_ATTR f_f4 (float a, float b, float c, float d) +{ + float r=a+b+c+d; + fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d); + fflush(out); + return r; +} +float ABI_ATTR f_f8 (float a, float b, float c, float d, float e, float f, + float g, float h) +{ + float r=a+b+c+d+e+f+g+h; + fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); + fflush(out); + return r; +} +float ABI_ATTR f_f16 (float a, float b, float c, float d, float e, float f, float g, float h, + float i, float j, float k, float l, float m, float n, float o, float p) +{ + float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + return r; +} +float ABI_ATTR f_f24 (float a, float b, float c, float d, float e, float f, float g, float h, + float i, float j, float k, float l, float m, float n, float o, float p, + float q, float s, float t, float u, float v, float w, float x, float y) +{ + float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y; + fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y); + fflush(out); + return r; +} + +/* double tests */ +double ABI_ATTR d_d (double a) +{ + double r=a+1.0; + fprintf(out,"double f(double):(%g)",a); + fflush(out); + return r; +} +double ABI_ATTR d_d2 (double a, double b) +{ + double r=a+b; + fprintf(out,"double f(2*double):(%g,%g)",a,b); + fflush(out); + return r; +} +double ABI_ATTR d_d4 (double a, double b, double c, double d) +{ + double r=a+b+c+d; + fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d); + fflush(out); + return r; +} +double ABI_ATTR d_d8 (double a, double b, double c, double d, double e, double f, + double g, double h) +{ + double r=a+b+c+d+e+f+g+h; + fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h); + fflush(out); + return r; +} +double ABI_ATTR d_d16 (double a, double b, double c, double d, double e, double f, + double g, double h, double i, double j, double k, double l, + double m, double n, double o, double p) +{ + double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p; + fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); + fflush(out); + return r; +} + +/* pointer tests */ +void* ABI_ATTR vp_vpdpcpsp (void* a, double* b, char* c, Int* d) +{ + void* ret = (char*)b + 1; + fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d); + fflush(out); + return ret; +} + +/* mixed number tests */ +uchar ABI_ATTR uc_ucsil (uchar a, ushort b, uint c, ulong d) +{ + uchar r = (uchar)-1; + fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d); + fflush(out); + return r; +} +double ABI_ATTR d_iidd (int a, int b, double c, double d) +{ + double r = a+b+c+d; + fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d); + fflush(out); + return r; +} +double ABI_ATTR d_iiidi (int a, int b, int c, double d, int e) +{ + double r = a+b+c+d+e; + fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e); + fflush(out); + return r; +} +double ABI_ATTR d_idid (int a, double b, int c, double d) +{ + double r = a+b+c+d; + fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d); + fflush(out); + return r; +} +double ABI_ATTR d_fdi (float a, double b, int c) +{ + double r = a+b+c; + fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c); + fflush(out); + return r; +} +ushort ABI_ATTR us_cdcd (char a, double b, char c, double d) +{ + ushort r = (ushort)(a + b + c + d); + fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d); + fflush(out); + return r; +} + +long long ABI_ATTR ll_iiilli (int a, int b, int c, long long d, int e) +{ + long long r = (long long)(int)a+(long long)(int)b+(long long)(int)c+d+(long long)(int)e; + fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e); + fflush(out); + return r; +} +long long ABI_ATTR ll_flli (float a, long long b, int c) +{ + long long r = (long long)(int)a + b + (long long)c; + fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c); + fflush(out); + return r; +} + +float ABI_ATTR f_fi (float a, int z) +{ + float r = a+z; + fprintf(out,"float f(float,int):(%g,%d)",a,z); + fflush(out); + return r; +} +float ABI_ATTR f_f2i (float a, float b, int z) +{ + float r = a+b+z; + fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z); + fflush(out); + return r; +} +float ABI_ATTR f_f3i (float a, float b, float c, int z) +{ + float r = a+b+c+z; + fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z); + fflush(out); + return r; +} +float ABI_ATTR f_f4i (float a, float b, float c, float d, int z) +{ + float r = a+b+c+d+z; + fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); + fflush(out); + return r; +} +float ABI_ATTR f_f7i (float a, float b, float c, float d, float e, float f, float g, + int z) +{ + float r = a+b+c+d+e+f+g+z; + fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); + fflush(out); + return r; +} +float ABI_ATTR f_f8i (float a, float b, float c, float d, float e, float f, float g, + float h, int z) +{ + float r = a+b+c+d+e+f+g+h+z; + fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); + fflush(out); + return r; +} +float ABI_ATTR f_f12i (float a, float b, float c, float d, float e, float f, float g, + float h, float i, float j, float k, float l, int z) +{ + float r = a+b+c+d+e+f+g+h+i+j+k+l+z; + fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); + fflush(out); + return r; +} +float ABI_ATTR f_f13i (float a, float b, float c, float d, float e, float f, float g, + float h, float i, float j, float k, float l, float m, int z) +{ + float r = a+b+c+d+e+f+g+h+i+j+k+l+m+z; + fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); + fflush(out); + return r; +} + +double ABI_ATTR d_di (double a, int z) +{ + double r = a+z; + fprintf(out,"double f(double,int):(%g,%d)",a,z); + fflush(out); + return r; +} +double ABI_ATTR d_d2i (double a, double b, int z) +{ + double r = a+b+z; + fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z); + fflush(out); + return r; +} +double ABI_ATTR d_d3i (double a, double b, double c, int z) +{ + double r = a+b+c+z; + fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z); + fflush(out); + return r; +} +double ABI_ATTR d_d4i (double a, double b, double c, double d, int z) +{ + double r = a+b+c+d+z; + fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z); + fflush(out); + return r; +} +double ABI_ATTR d_d7i (double a, double b, double c, double d, double e, double f, + double g, int z) +{ + double r = a+b+c+d+e+f+g+z; + fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z); + fflush(out); + return r; +} +double ABI_ATTR d_d8i (double a, double b, double c, double d, double e, double f, + double g, double h, int z) +{ + double r = a+b+c+d+e+f+g+h+z; + fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z); + fflush(out); + return r; +} +double ABI_ATTR d_d12i (double a, double b, double c, double d, double e, double f, + double g, double h, double i, double j, double k, double l, + int z) +{ + double r = a+b+c+d+e+f+g+h+i+j+k+l+z; + fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z); + fflush(out); + return r; +} +double ABI_ATTR d_d13i (double a, double b, double c, double d, double e, double f, + double g, double h, double i, double j, double k, double l, + double m, int z) +{ + double r = a+b+c+d+e+f+g+h+i+j+k+l+m+z; + fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z); + fflush(out); + return r; +} + +/* small structure return tests */ +Size1 ABI_ATTR S1_v (void) +{ + fprintf(out,"Size1 f(void):"); + fflush(out); + return Size1_1; +} +Size2 ABI_ATTR S2_v (void) +{ + fprintf(out,"Size2 f(void):"); + fflush(out); + return Size2_1; +} +Size3 ABI_ATTR S3_v (void) +{ + fprintf(out,"Size3 f(void):"); + fflush(out); + return Size3_1; +} +Size4 ABI_ATTR S4_v (void) +{ + fprintf(out,"Size4 f(void):"); + fflush(out); + return Size4_1; +} +Size7 ABI_ATTR S7_v (void) +{ + fprintf(out,"Size7 f(void):"); + fflush(out); + return Size7_1; +} +Size8 ABI_ATTR S8_v (void) +{ + fprintf(out,"Size8 f(void):"); + fflush(out); + return Size8_1; +} +Size12 ABI_ATTR S12_v (void) +{ + fprintf(out,"Size12 f(void):"); + fflush(out); + return Size12_1; +} +Size15 ABI_ATTR S15_v (void) +{ + fprintf(out,"Size15 f(void):"); + fflush(out); + return Size15_1; +} +Size16 ABI_ATTR S16_v (void) +{ + fprintf(out,"Size16 f(void):"); + fflush(out); + return Size16_1; +} + +/* structure tests */ +Int ABI_ATTR I_III (Int a, Int b, Int c) +{ + Int r; + r.x = a.x + b.x + c.x; + fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x); + fflush(out); + return r; +} +Char ABI_ATTR C_CdC (Char a, double b, Char c) +{ + Char r; + r.x = (a.x + c.x)/2; + fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x); + fflush(out); + return r; +} +Float ABI_ATTR F_Ffd (Float a, float b, double c) +{ + Float r; + r.x = (float) (a.x + b + c); + fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c); + fflush(out); + return r; +} +Double ABI_ATTR D_fDd (float a, Double b, double c) +{ + Double r; + r.x = a + b.x + c; + fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c); + fflush(out); + return r; +} +Double ABI_ATTR D_Dfd (Double a, float b, double c) +{ + Double r; + r.x = a.x + b + c; + fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c); + fflush(out); + return r; +} +J ABI_ATTR J_JiJ (J a, int b, J c) +{ + J r; + r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2; + fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2); + fflush(out); + return r; +} +T ABI_ATTR T_TcT (T a, char b, T c) +{ + T r; + r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2]; + fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]); + fflush(out); + return r; +} +X ABI_ATTR X_BcdB (B a, char b, double c, B d) +{ + static X xr={"return val",'R'}; + X r; + r = xr; + r.c1 = b; + fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})", + a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]); + fflush(out); + return r; +} + +/* Test for cases where some argument (especially structure, 'long long', or + 'double') may be passed partially in general-purpose argument registers + and partially on the stack. Different ABIs pass between 4 and 8 arguments + (or none) in general-purpose argument registers. */ + +long ABI_ATTR l_l0K (K b, long c) +{ + long r = b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l1K (long a1, K b, long c) +{ + long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l2K (long a1, long a2, K b, long c) +{ + long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l3K (long a1, long a2, long a3, K b, long c) +{ + long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l4K (long a1, long a2, long a3, long a4, K b, long c) +{ + long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l5K (long a1, long a2, long a3, long a4, long a5, K b, long c) +{ + long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +long ABI_ATTR l_l6K (long a1, long a2, long a3, long a4, long a5, long a6, K b, long c) +{ + long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c; + fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c); + fflush(out); + return r; +} +/* These tests is crafted on the knowledge that for all known ABIs: + * 17 > number of floating-point argument registers, + * 3 < number of general-purpose argument registers < 3 + 6. */ +float ABI_ATTR f_f17l3L (float a, float b, float c, float d, float e, float f, float g, + float h, float i, float j, float k, float l, float m, float n, + float o, float p, float q, + long s, long t, long u, L z) +{ + float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; + fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); + fflush(out); + return r; +} +double ABI_ATTR d_d17l3L (double a, double b, double c, double d, double e, double f, + double g, double h, double i, double j, double k, double l, + double m, double n, double o, double p, double q, + long s, long t, long u, L z) +{ + double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6; + fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6); + fflush(out); + return r; +} + +long long ABI_ATTR ll_l2ll (long a1, long a2, long long b, long c) +{ + long long r = (long long) (a1 + a2) + b + c; + fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} +long long ABI_ATTR ll_l3ll (long a1, long a2, long a3, long long b, long c) +{ + long long r = (long long) (a1 + a2 + a3) + b + c; + fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} +long long ABI_ATTR ll_l4ll (long a1, long a2, long a3, long a4, long long b, long c) +{ + long long r = (long long) (a1 + a2 + a3 + a4) + b + c; + fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} +long long ABI_ATTR ll_l5ll (long a1, long a2, long a3, long a4, long a5, long long b, long c) +{ + long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c; + fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} +long long ABI_ATTR ll_l6ll (long a1, long a2, long a3, long a4, long a5, long a6, long long b, long c) +{ + long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; + fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} +long long ABI_ATTR ll_l7ll (long a1, long a2, long a3, long a4, long a5, long a6, long a7, long long b, long c) +{ + long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; + fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c); + fflush(out); + return r; +} + +double ABI_ATTR d_l2d (long a1, long a2, double b, long c) +{ + double r = (double) (a1 + a2) + b + c; + fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c); + fflush(out); + return r; +} +double ABI_ATTR d_l3d (long a1, long a2, long a3, double b, long c) +{ + double r = (double) (a1 + a2 + a3) + b + c; + fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c); + fflush(out); + return r; +} +double ABI_ATTR d_l4d (long a1, long a2, long a3, long a4, double b, long c) +{ + double r = (double) (a1 + a2 + a3 + a4) + b + c; + fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c); + fflush(out); + return r; +} +double ABI_ATTR d_l5d (long a1, long a2, long a3, long a4, long a5, double b, long c) +{ + double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c; + fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c); + fflush(out); + return r; +} +double ABI_ATTR d_l6d (long a1, long a2, long a3, long a4, long a5, long a6, double b, long c) +{ + double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c; + fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c); + fflush(out); + return r; +} +double ABI_ATTR d_l7d (long a1, long a2, long a3, long a4, long a5, long a6, long a7, double b, long c) +{ + double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c; + fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c); + fflush(out); + return r; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c new file mode 100644 index 0000000..5d4959c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c @@ -0,0 +1,46 @@ +/* Area: ffi_call + Purpose: Check for proper argument alignment. + Limitations: none. + PR: none. + Originator: (from many_win32.c) */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static float ABI_ATTR align_arguments(int i1, + double f2, + int i3, + double f4) +{ + return i1+f2+i3+f4; +} + +int main(void) +{ + ffi_cif cif; + ffi_type *args[4] = { + &ffi_type_sint, + &ffi_type_double, + &ffi_type_sint, + &ffi_type_double + }; + double fa[2] = {1,2}; + int ia[2] = {1,2}; + void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]}; + float f, ff; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, + &ffi_type_float, args) == FFI_OK); + + ff = align_arguments(ia[0], fa[0], ia[1], fa[1]); + + ffi_call(&cif, FFI_FN(align_arguments), &f, values); + + if (f == ff) + printf("align arguments tests ok!\n"); + else + CHECK(0); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c new file mode 100644 index 0000000..5e5cb86 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c @@ -0,0 +1,46 @@ +/* Area: ffi_call + Purpose: Check for proper argument alignment. + Limitations: none. + PR: none. + Originator: (from many_win32.c) */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static float ABI_ATTR align_arguments(int i1, + double f2, + int i3, + double f4) +{ + return i1+f2+i3+f4; +} + +int main(void) +{ + ffi_cif cif; + ffi_type *args[4] = { + &ffi_type_sint, + &ffi_type_double, + &ffi_type_sint, + &ffi_type_double + }; + double fa[2] = {1,2}; + int ia[2] = {1,2}; + void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]}; + float f, ff; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, + &ffi_type_float, args) == FFI_OK); + + ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);; + + ffi_call(&cif, FFI_FN(align_arguments), &f, values); + + if (f == ff) + printf("align arguments tests ok!\n"); + else + CHECK(0); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/call.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/call.exp new file mode 100644 index 0000000..13ba2bd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/call.exp @@ -0,0 +1,54 @@ +# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +dg-init +libffi-init + +global srcdir subdir + +if { [string match $compiler_vendor "microsoft"] } { + # -wd4005 macro redefinition + # -wd4244 implicit conversion to type of smaller size + # -wd4305 truncation to smaller type + # -wd4477 printf %lu of uintptr_t + # -wd4312 implicit conversion to type of greater size + # -wd4311 pointer truncation to unsigned long + # -EHsc C++ Exception Handling (no SEH exceptions) + set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc"; +} else { + set additional_options ""; +} + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]] + +run-many-tests $tlist $additional_options + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]] + +# No C++ for or1k +if { [istarget "or1k-*-*"] } { + foreach test $tlist { + unsupported "$test" + } +} else { + run-many-tests $tlist $additional_options +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c new file mode 100644 index 0000000..bf60161 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c @@ -0,0 +1,26 @@ +/* Area: ffi_prep_cif + Purpose: Test error return for bad typedefs. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +int main (void) +{ + ffi_cif cif; + ffi_type* arg_types[1]; + + ffi_type badType = ffi_type_void; + + arg_types[0] = NULL; + + badType.size = 0; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &badType, + arg_types) == FFI_BAD_TYPEDEF); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h new file mode 100644 index 0000000..cfce1ad --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h @@ -0,0 +1,138 @@ +#include +#include +#include +#include +#include +#include "fficonfig.h" + +#if defined HAVE_STDINT_H +#include +#endif + +#if defined HAVE_INTTYPES_H +#include +#endif + +#define MAX_ARGS 256 + +#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0) + +/* Define macros so that compilers other than gcc can run the tests. */ +#undef __UNUSED__ +#if defined(__GNUC__) +#define __UNUSED__ __attribute__((__unused__)) +#define __STDCALL__ __attribute__((stdcall)) +#define __THISCALL__ __attribute__((thiscall)) +#define __FASTCALL__ __attribute__((fastcall)) +#define __MSABI__ __attribute__((ms_abi)) +#else +#define __UNUSED__ +#define __STDCALL__ __stdcall +#define __THISCALL__ __thiscall +#define __FASTCALL__ __fastcall +#endif + +#ifndef ABI_NUM +#define ABI_NUM FFI_DEFAULT_ABI +#define ABI_ATTR +#endif + +/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a + file open. */ +#ifdef HAVE_MMAP_ANON +# undef HAVE_MMAP_DEV_ZERO + +# include +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +# endif +# define USING_MMAP + +#endif + +#ifdef HAVE_MMAP_DEV_ZERO + +# include +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# define USING_MMAP + +#endif + +/* MinGW kludge. */ +#if defined(_WIN64) | defined(_WIN32) +#define PRIdLL "I64d" +#define PRIuLL "I64u" +#else +#define PRIdLL "lld" +#define PRIuLL "llu" +#endif + +/* Tru64 UNIX kludge. */ +#if defined(__alpha__) && defined(__osf__) +/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */ +#undef PRIdLL +#define PRIdLL "ld" +#undef PRIuLL +#define PRIuLL "lu" +#define PRId8 "hd" +#define PRIu8 "hu" +#define PRId64 "ld" +#define PRIu64 "lu" +#define PRIuPTR "lu" +#endif + +/* PA HP-UX kludge. */ +#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR) +#define PRIuPTR "lu" +#endif + +/* IRIX kludge. */ +#if defined(__sgi) +/* IRIX 6.5 provides all definitions, but only for C99 + compilations. */ +#define PRId8 "hhd" +#define PRIu8 "hhu" +#if (_MIPS_SZLONG == 32) +#define PRId64 "lld" +#define PRIu64 "llu" +#endif +/* This doesn't match , which always has "lld" here, but the + arguments are uint64_t, int64_t, which are unsigned long, long for + 64-bit in . */ +#if (_MIPS_SZLONG == 64) +#define PRId64 "ld" +#define PRIu64 "lu" +#endif +/* This doesn't match , which has "u" here, but the arguments + are uintptr_t, which is always unsigned long. */ +#define PRIuPTR "lu" +#endif + +/* Solaris < 10 kludge. */ +#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR) +#if defined(__arch64__) || defined (__x86_64__) +#define PRIuPTR "lu" +#else +#define PRIuPTR "u" +#endif +#endif + +/* MSVC kludge. */ +#if defined _MSC_VER +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) +#define PRIuPTR "lu" +#define PRIu8 "u" +#define PRId8 "d" +#define PRIu64 "I64u" +#define PRId64 "I64d" +#endif +#endif + +#ifndef PRIuPTR +#define PRIuPTR "u" +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float.c new file mode 100644 index 0000000..fbc272d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float.c @@ -0,0 +1,59 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static int floating(int a, float b, double c, long double d) +{ + int i; + + i = (int) ((float)a/b + ((float)c/(float)d)); + + return i; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + + float f; + signed int si1; + double d; + long double ld; + + args[0] = &ffi_type_sint; + values[0] = &si1; + args[1] = &ffi_type_float; + values[1] = &f; + args[2] = &ffi_type_double; + values[2] = &d; + args[3] = &ffi_type_longdouble; + values[3] = &ld; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_sint, args) == FFI_OK); + + si1 = 6; + f = 3.14159; + d = (double)1.0/(double)3.0; + ld = 2.71828182846L; + + floating (si1, f, d, ld); + + ffi_call(&cif, FFI_FN(floating), &rint, values); + + printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld)); + + CHECK((int)rint == floating(si1, f, d, ld)); + + exit (0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float1.c new file mode 100644 index 0000000..c48493c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float1.c @@ -0,0 +1,60 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +#include "float.h" + +#include + +typedef union +{ + double d; + unsigned char c[sizeof (double)]; +} value_type; + +#define CANARY 0xba + +static double dblit(float f) +{ + return f/3.0; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float f; + value_type result[2]; + unsigned int i; + + args[0] = &ffi_type_float; + values[0] = &f; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_double, args) == FFI_OK); + + f = 3.14159; + + /* Put a canary in the return array. This is a regression test for + a buffer overrun. */ + memset(result[1].c, CANARY, sizeof (double)); + + ffi_call(&cif, FFI_FN(dblit), &result[0].d, values); + + /* These are not always the same!! Check for a reasonable delta */ + + CHECK(fabs(result[0].d - dblit(f)) < DBL_EPSILON); + + /* Check the canary. */ + for (i = 0; i < sizeof (double); ++i) + CHECK(result[1].c[i] == CANARY); + + exit(0); + +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float2.c new file mode 100644 index 0000000..57cd9e3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float2.c @@ -0,0 +1,61 @@ +/* Area: ffi_call + Purpose: Check return value long double. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ +/* { dg-do run } */ + +#include "ffitest.h" +#include "float.h" + +#include + +static long double ldblit(float f) +{ + return (long double) (((long double) f)/ (long double) 3.0); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float f; + long double ld; + long double original; + + args[0] = &ffi_type_float; + values[0] = &f; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_longdouble, args) == FFI_OK); + + f = 3.14159; + +#if defined(__sun) && defined(__GNUC__) + /* long double support under SunOS/gcc is pretty much non-existent. + You'll get the odd bus error in library routines like printf() */ +#else + printf ("%Lf\n", ldblit(f)); +#endif + + ld = 666; + ffi_call(&cif, FFI_FN(ldblit), &ld, values); + +#if defined(__sun) && defined(__GNUC__) + /* long double support under SunOS/gcc is pretty much non-existent. + You'll get the odd bus error in library routines like printf() */ +#else + printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON); +#endif + + /* These are not always the same!! Check for a reasonable delta */ + original = ldblit(f); + if (((ld > original) ? (ld - original) : (original - ld)) < LDBL_EPSILON) + puts("long double return value tests ok!"); + else + CHECK(0); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float3.c new file mode 100644 index 0000000..bab3206 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float3.c @@ -0,0 +1,74 @@ +/* Area: ffi_call + Purpose: Check float arguments with different orders. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" +#include "float.h" + +#include + +static double floating_1(float a, double b, long double c) +{ + return (double) a + b + (double) c; +} + +static double floating_2(long double a, double b, float c) +{ + return (double) a + b + (double) c; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + double rd; + + float f; + double d; + long double ld; + + args[0] = &ffi_type_float; + values[0] = &f; + args[1] = &ffi_type_double; + values[1] = &d; + args[2] = &ffi_type_longdouble; + values[2] = &ld; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_double, args) == FFI_OK); + + f = 3.14159; + d = (double)1.0/(double)3.0; + ld = 2.71828182846L; + + floating_1 (f, d, ld); + + ffi_call(&cif, FFI_FN(floating_1), &rd, values); + + CHECK(fabs(rd - floating_1(f, d, ld)) < DBL_EPSILON); + + args[0] = &ffi_type_longdouble; + values[0] = &ld; + args[1] = &ffi_type_double; + values[1] = &d; + args[2] = &ffi_type_float; + values[2] = &f; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_double, args) == FFI_OK); + + floating_2 (ld, d, f); + + ffi_call(&cif, FFI_FN(floating_2), &rd, values); + + CHECK(fabs(rd - floating_2(ld, d, f)) < DBL_EPSILON); + + exit (0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float4.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float4.c new file mode 100644 index 0000000..0dd6d85 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float4.c @@ -0,0 +1,62 @@ +/* Area: ffi_call + Purpose: Check denorm double value. + Limitations: none. + PR: PR26483. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +/* { dg-options "-mieee" { target alpha*-*-* } } */ + +#include "ffitest.h" +#include "float.h" + +typedef union +{ + double d; + unsigned char c[sizeof (double)]; +} value_type; + +#define CANARY 0xba + +static double dblit(double d) +{ + return d; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + double d; + value_type result[2]; + unsigned int i; + + args[0] = &ffi_type_double; + values[0] = &d; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_double, args) == FFI_OK); + + d = DBL_MIN / 2; + + /* Put a canary in the return array. This is a regression test for + a buffer overrun. */ + memset(result[1].c, CANARY, sizeof (double)); + + ffi_call(&cif, FFI_FN(dblit), &result[0].d, values); + + /* The standard delta check doesn't work for denorms. Since we didn't do + any arithmetic, we should get the original result back, and hence an + exact check should be OK here. */ + + CHECK(result[0].d == dblit(d)); + + /* Check the canary. */ + for (i = 0; i < sizeof (double); ++i) + CHECK(result[1].c[i] == CANARY); + + exit(0); + +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c new file mode 100644 index 0000000..5acff91 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c @@ -0,0 +1,107 @@ +/* Area: fp and variadics + Purpose: check fp inputs and returns work on variadics, even the fixed params + Limitations: None + PR: none + Originator: 2011-01-25 + + Intended to stress the difference in ABI on ARM vfp +*/ + +/* { dg-do run } */ + +#include + +#include "ffitest.h" + +/* prints out all the parameters, and returns the sum of them all. + * 'x' is the number of variadic parameters all of which are double in this test + */ +double float_va_fn(unsigned int x, double y,...) +{ + double total=0.0; + va_list ap; + unsigned int i; + + total+=(double)x; + total+=y; + + printf("%u: %.1f :", x, y); + + va_start(ap, y); + for(i=0;i +#include +#include + +static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) +{ +#if 0 + printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", + (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, + (double) f6, (double) f7, (double) f8, (double) f9, (double) f10, + (double) f11, (double) f12, (double) f13); +#endif + + return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[13]; + void *values[13]; + float fa[13]; + float f, ff; + int i; + + for (i = 0; i < 13; i++) + { + args[i] = &ffi_type_float; + values[i] = &fa[i]; + fa[i] = (float) i; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 13, + &ffi_type_float, args) == FFI_OK); + + ffi_call(&cif, FFI_FN(many), &f, values); + + ff = many(fa[0], fa[1], + fa[2], fa[3], + fa[4], fa[5], + fa[6], fa[7], + fa[8], fa[9], + fa[10],fa[11],fa[12]); + + if (fabs(f - ff) < FLT_EPSILON) + exit(0); + else + abort(); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many2.c new file mode 100644 index 0000000..1c85746 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many2.c @@ -0,0 +1,57 @@ +/* Area: ffi_call + Purpose: Check uint8_t arguments. + Limitations: none. + PR: PR45677. + Originator: Dan Witte 20100916 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +#define NARGS 7 + +typedef unsigned char u8; + +#ifdef __GNUC__ +__attribute__((noinline)) +#endif +uint8_t +foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d, + uint8_t e, uint8_t f, uint8_t g) +{ + return a + b + c + d + e + f + g; +} + +uint8_t ABI_ATTR +bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d, + uint8_t e, uint8_t f, uint8_t g) +{ + return foo (a, b, c, d, e, f, g); +} + +int +main (void) +{ + ffi_type *ffitypes[NARGS]; + int i; + ffi_cif cif; + ffi_arg result = 0; + uint8_t args[NARGS]; + void *argptrs[NARGS]; + + for (i = 0; i < NARGS; ++i) + ffitypes[i] = &ffi_type_uint8; + + CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS, + &ffi_type_uint8, ffitypes) == FFI_OK); + + for (i = 0; i < NARGS; ++i) + { + args[i] = i; + argptrs[i] = &args[i]; + } + ffi_call (&cif, FFI_FN (bar), &result, argptrs); + + CHECK (result == 21); + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c new file mode 100644 index 0000000..4ef8c8a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c @@ -0,0 +1,70 @@ +/* Area: ffi_call + Purpose: Check return value double, with many arguments + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +#include +#include +#include + +static double many(double f1, + double f2, + double f3, + double f4, + double f5, + double f6, + double f7, + double f8, + double f9, + double f10, + double f11, + double f12, + double f13) +{ +#if 0 + printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", + (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, + (double) f6, (double) f7, (double) f8, (double) f9, (double) f10, + (double) f11, (double) f12, (double) f13); +#endif + + return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[13]; + void *values[13]; + double fa[13]; + double f, ff; + int i; + + for (i = 0; i < 13; i++) + { + args[i] = &ffi_type_double; + values[i] = &fa[i]; + fa[i] = (double) i; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, + &ffi_type_double, args) == FFI_OK); + + ffi_call(&cif, FFI_FN(many), &f, values); + + ff = many(fa[0], fa[1], + fa[2], fa[3], + fa[4], fa[5], + fa[6], fa[7], + fa[8], fa[9], + fa[10],fa[11],fa[12]); + if (fabs(f - ff) < FLT_EPSILON) + exit(0); + else + abort(); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c new file mode 100644 index 0000000..85ec36e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c @@ -0,0 +1,78 @@ +/* Area: ffi_call + Purpose: Check return value double, with many arguments + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +#include +#include +#include + +static double many(double f1, + double f2, + long int i1, + double f3, + double f4, + long int i2, + double f5, + double f6, + long int i3, + double f7, + double f8, + long int i4, + double f9, + double f10, + long int i5, + double f11, + double f12, + long int i6, + double f13) +{ + return ((double) (i1 + i2 + i3 + i4 + i5 + i6) + (f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[19]; + void *values[19]; + double fa[19]; + long int la[19]; + double f, ff; + int i; + + for (i = 0; i < 19; i++) + { + if( (i - 2) % 3 == 0) { + args[i] = &ffi_type_slong; + la[i] = (long int) i; + values[i] = &la[i]; + } + else { + args[i] = &ffi_type_double; + fa[i] = (double) i; + values[i] = &fa[i]; + } + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 19, + &ffi_type_double, args) == FFI_OK); + + ffi_call(&cif, FFI_FN(many), &f, values); + + ff = many(fa[0], fa[1], la[2], + fa[3], fa[4], la[5], + fa[6], fa[7], la[8], + fa[9], fa[10], la[11], + fa[12], fa[13], la[14], + fa[15], fa[16], la[17], + fa[18]); + if (fabs(f - ff) < FLT_EPSILON) + exit(0); + else + abort(); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/negint.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/negint.c new file mode 100644 index 0000000..6e2f26f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/negint.c @@ -0,0 +1,52 @@ +/* Area: ffi_call + Purpose: Check that negative integers are passed correctly. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static int checking(int a, short b, signed char c) +{ + + return (a < 0 && b < 0 && c < 0); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + + signed int si; + signed short ss; + signed char sc; + + args[0] = &ffi_type_sint; + values[0] = &si; + args[1] = &ffi_type_sshort; + values[1] = &ss; + args[2] = &ffi_type_schar; + values[2] = ≻ + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_sint, args) == FFI_OK); + + si = -6; + ss = -12; + sc = -1; + + checking (si, ss, sc); + + ffi_call(&cif, FFI_FN(checking), &rint, values); + + printf ("%d vs %d\n", (int)rint, checking (si, ss, sc)); + + CHECK(rint != 0); + + exit (0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c new file mode 100644 index 0000000..23d88b3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c @@ -0,0 +1,46 @@ +/* Area: Struct layout + Purpose: Test ffi_get_struct_offsets + Limitations: none. + PR: none. + Originator: Tom Tromey. */ + +/* { dg-do run } */ +#include "ffitest.h" +#include + +struct test_1 +{ + char c; + float f; + char c2; + int i; +}; + +int +main (void) +{ + ffi_type test_1_type; + ffi_type *test_1_elements[5]; + size_t test_1_offsets[4]; + + test_1_elements[0] = &ffi_type_schar; + test_1_elements[1] = &ffi_type_float; + test_1_elements[2] = &ffi_type_schar; + test_1_elements[3] = &ffi_type_sint; + test_1_elements[4] = NULL; + + test_1_type.size = 0; + test_1_type.alignment = 0; + test_1_type.type = FFI_TYPE_STRUCT; + test_1_type.elements = test_1_elements; + + CHECK (ffi_get_struct_offsets (FFI_DEFAULT_ABI, &test_1_type, test_1_offsets) + == FFI_OK); + CHECK (test_1_type.size == sizeof (struct test_1)); + CHECK (offsetof (struct test_1, c) == test_1_offsets[0]); + CHECK (offsetof (struct test_1, f) == test_1_offsets[1]); + CHECK (offsetof (struct test_1, c2) == test_1_offsets[2]); + CHECK (offsetof (struct test_1, i) == test_1_offsets[3]); + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c new file mode 100644 index 0000000..7da1621 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c @@ -0,0 +1,127 @@ +/* Area: ffi_call + Purpose: Reproduce bug found in python ctypes + Limitations: none. + PR: Fedora 1174037 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct { + long x; + long y; +} POINT; + +typedef struct { + long left; + long top; + long right; + long bottom; +} RECT; + +static RECT ABI_ATTR pr_test(int i __UNUSED__, RECT ar __UNUSED__, + RECT* br __UNUSED__, POINT cp __UNUSED__, + RECT dr __UNUSED__, RECT *er __UNUSED__, + POINT fp, RECT gr __UNUSED__) +{ + RECT result; + + result.left = fp.x; + result.right = fp.y; + result.top = fp.x; + result.bottom = fp.y; + + return result; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type point_type, rect_type; + ffi_type *point_type_elements[3]; + ffi_type *rect_type_elements[5]; + + int i; + POINT cp, fp; + RECT ar, br, dr, er, gr; + RECT *p1, *p2; + + /* This is a hack to get a properly aligned result buffer */ + RECT *rect_result = + (RECT *) malloc (sizeof(RECT)); + + point_type.size = 0; + point_type.alignment = 0; + point_type.type = FFI_TYPE_STRUCT; + point_type.elements = point_type_elements; + point_type_elements[0] = &ffi_type_slong; + point_type_elements[1] = &ffi_type_slong; + point_type_elements[2] = NULL; + + rect_type.size = 0; + rect_type.alignment = 0; + rect_type.type = FFI_TYPE_STRUCT; + rect_type.elements = rect_type_elements; + rect_type_elements[0] = &ffi_type_slong; + rect_type_elements[1] = &ffi_type_slong; + rect_type_elements[2] = &ffi_type_slong; + rect_type_elements[3] = &ffi_type_slong; + rect_type_elements[4] = NULL; + + args[0] = &ffi_type_sint; + args[1] = &rect_type; + args[2] = &ffi_type_pointer; + args[3] = &point_type; + args[4] = &rect_type; + args[5] = &ffi_type_pointer; + args[6] = &point_type; + args[7] = &rect_type; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 8, &rect_type, args) == FFI_OK); + + i = 1; + ar.left = 2; + ar.right = 3; + ar.top = 4; + ar.bottom = 5; + br.left = 6; + br.right = 7; + br.top = 8; + br.bottom = 9; + cp.x = 10; + cp.y = 11; + dr.left = 12; + dr.right = 13; + dr.top = 14; + dr.bottom = 15; + er.left = 16; + er.right = 17; + er.top = 18; + er.bottom = 19; + fp.x = 20; + fp.y = 21; + gr.left = 22; + gr.right = 23; + gr.top = 24; + gr.bottom = 25; + + values[0] = &i; + values[1] = &ar; + p1 = &br; + values[2] = &p1; + values[3] = &cp; + values[4] = &dr; + p2 = &er; + values[5] = &p2; + values[6] = &fp; + values[7] = &gr; + + ffi_call (&cif, FFI_FN(pr_test), rect_result, values); + + CHECK(rect_result->top == 20); + + free (rect_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c new file mode 100644 index 0000000..4456161 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c @@ -0,0 +1,59 @@ +/* Area: ffi_call + Purpose: Promotion test. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +static int promotion(signed char sc, signed short ss, + unsigned char uc, unsigned short us) +{ + int r = (int) sc + (int) ss + (int) uc + (int) us; + + return r; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + signed char sc; + unsigned char uc; + signed short ss; + unsigned short us; + unsigned long ul; + + args[0] = &ffi_type_schar; + args[1] = &ffi_type_sshort; + args[2] = &ffi_type_uchar; + args[3] = &ffi_type_ushort; + values[0] = ≻ + values[1] = &ss; + values[2] = &uc; + values[3] = &us; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_sint, args) == FFI_OK); + + us = 0; + ul = 0; + + for (sc = (signed char) -127; + sc <= (signed char) 120; sc += 1) + for (ss = -30000; ss <= 30000; ss += 10000) + for (uc = (unsigned char) 0; + uc <= (unsigned char) 200; uc += 20) + for (us = 0; us <= 60000; us += 10000) + { + ul++; + ffi_call(&cif, FFI_FN(promotion), &rint, values); + CHECK((int)rint == (signed char) sc + (signed short) ss + + (unsigned char) uc + (unsigned short) us); + } + printf("%lu promotion tests run\n", ul); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c new file mode 100644 index 0000000..e29bd6c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c @@ -0,0 +1,114 @@ +/* Area: ffi_call + Purpose: Check different structures. + Limitations: none. + PR: none. + Originator: Ronald Oussoren 20030824 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct Point { + float x; + float y; +} Point; + +typedef struct Size { + float h; + float w; +} Size; + +typedef struct Rect { + Point o; + Size s; +} Rect; + +int doit(int o, char* s, Point p, Rect r, int last) +{ + printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n", + o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last); + return 42; +} + + +int main(void) +{ + ffi_type point_type; + ffi_type size_type; + ffi_type rect_type; + ffi_cif cif; + ffi_type* arglist[6]; + void* values[6]; + int r; + + /* + * First set up FFI types for the 3 struct types + */ + + point_type.size = 0; /*sizeof(Point);*/ + point_type.alignment = 0; /*__alignof__(Point);*/ + point_type.type = FFI_TYPE_STRUCT; + point_type.elements = malloc(3 * sizeof(ffi_type*)); + point_type.elements[0] = &ffi_type_float; + point_type.elements[1] = &ffi_type_float; + point_type.elements[2] = NULL; + + size_type.size = 0;/* sizeof(Size);*/ + size_type.alignment = 0;/* __alignof__(Size);*/ + size_type.type = FFI_TYPE_STRUCT; + size_type.elements = malloc(3 * sizeof(ffi_type*)); + size_type.elements[0] = &ffi_type_float; + size_type.elements[1] = &ffi_type_float; + size_type.elements[2] = NULL; + + rect_type.size = 0;/*sizeof(Rect);*/ + rect_type.alignment =0;/* __alignof__(Rect);*/ + rect_type.type = FFI_TYPE_STRUCT; + rect_type.elements = malloc(3 * sizeof(ffi_type*)); + rect_type.elements[0] = &point_type; + rect_type.elements[1] = &size_type; + rect_type.elements[2] = NULL; + + /* + * Create a CIF + */ + arglist[0] = &ffi_type_sint; + arglist[1] = &ffi_type_pointer; + arglist[2] = &point_type; + arglist[3] = &rect_type; + arglist[4] = &ffi_type_sint; + arglist[5] = NULL; + + r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, + 5, &ffi_type_sint, arglist); + if (r != FFI_OK) { + abort(); + } + + + /* And call the function through the CIF */ + + { + Point p = { 1.0, 2.0 }; + Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } }; + int o = 0; + int l = 42; + char* m = "myMethod"; + ffi_arg result; + + values[0] = &o; + values[1] = &m; + values[2] = &p; + values[3] = &r; + values[4] = &l; + values[5] = NULL; + + printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n", + o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l); + + ffi_call(&cif, FFI_FN(doit), &result, values); + + printf ("The result is %d\n", (int)result); + + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c new file mode 100644 index 0000000..fd07e50 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c @@ -0,0 +1,36 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static double return_dbl(double dbl) +{ + printf ("%f\n", dbl); + return 2 * dbl; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + double dbl, rdbl; + + args[0] = &ffi_type_double; + values[0] = &dbl; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_double, args) == FFI_OK); + + for (dbl = -127.3; dbl < 127; dbl++) + { + ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values); + printf ("%f vs %f\n", rdbl, return_dbl(dbl)); + CHECK(rdbl == 2 * dbl); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c new file mode 100644 index 0000000..0ea5d50 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c @@ -0,0 +1,43 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static double return_dbl(double dbl1, float fl2, unsigned int in3, double dbl4) +{ + return dbl1 + fl2 + in3 + dbl4; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + double dbl1, dbl4, rdbl; + float fl2; + unsigned int in3; + args[0] = &ffi_type_double; + args[1] = &ffi_type_float; + args[2] = &ffi_type_uint; + args[3] = &ffi_type_double; + values[0] = &dbl1; + values[1] = &fl2; + values[2] = &in3; + values[3] = &dbl4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_double, args) == FFI_OK); + dbl1 = 127.0; + fl2 = 128.0; + in3 = 255; + dbl4 = 512.7; + + ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values); + printf ("%f vs %f\n", rdbl, return_dbl(dbl1, fl2, in3, dbl4)); + CHECK(rdbl == dbl1 + fl2 + in3 + dbl4); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c new file mode 100644 index 0000000..b3818f8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c @@ -0,0 +1,42 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static double return_dbl(double dbl1, double dbl2, unsigned int in3, double dbl4) +{ + return dbl1 + dbl2 + in3 + dbl4; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + double dbl1, dbl2, dbl4, rdbl; + unsigned int in3; + args[0] = &ffi_type_double; + args[1] = &ffi_type_double; + args[2] = &ffi_type_uint; + args[3] = &ffi_type_double; + values[0] = &dbl1; + values[1] = &dbl2; + values[2] = &in3; + values[3] = &dbl4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_double, args) == FFI_OK); + dbl1 = 127.0; + dbl2 = 128.0; + in3 = 255; + dbl4 = 512.7; + + ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values); + printf ("%f vs %f\n", rdbl, return_dbl(dbl1, dbl2, in3, dbl4)); + CHECK(rdbl == dbl1 + dbl2 + in3 + dbl4); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c new file mode 100644 index 0000000..fb8a09e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c @@ -0,0 +1,35 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static float return_fl(float fl) +{ + return 2 * fl; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float fl, rfl; + + args[0] = &ffi_type_float; + values[0] = &fl; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_float, args) == FFI_OK); + + for (fl = -127.0; fl < 127; fl++) + { + ffi_call(&cif, FFI_FN(return_fl), &rfl, values); + printf ("%f vs %f\n", rfl, return_fl(fl)); + CHECK(rfl == 2 * fl); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c new file mode 100644 index 0000000..c3d92c2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c @@ -0,0 +1,36 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static float return_fl(float fl1, float fl2) +{ + return fl1 + fl2; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float fl1, fl2, rfl; + + args[0] = &ffi_type_float; + args[1] = &ffi_type_float; + values[0] = &fl1; + values[1] = &fl2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_float, args) == FFI_OK); + fl1 = 127.0; + fl2 = 128.0; + + ffi_call(&cif, FFI_FN(return_fl), &rfl, values); + printf ("%f vs %f\n", rfl, return_fl(fl1, fl2)); + CHECK(rfl == fl1 + fl2); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c new file mode 100644 index 0000000..ddb976c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c @@ -0,0 +1,49 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +/* Use volatile float to avoid false negative on ix86. See PR target/323. */ +static float return_fl(float fl1, float fl2, float fl3, float fl4) +{ + volatile float sum; + + sum = fl1 + fl2 + fl3 + fl4; + return sum; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float fl1, fl2, fl3, fl4, rfl; + volatile float sum; + + args[0] = &ffi_type_float; + args[1] = &ffi_type_float; + args[2] = &ffi_type_float; + args[3] = &ffi_type_float; + values[0] = &fl1; + values[1] = &fl2; + values[2] = &fl3; + values[3] = &fl4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_float, args) == FFI_OK); + fl1 = 127.0; + fl2 = 128.0; + fl3 = 255.1; + fl4 = 512.7; + + ffi_call(&cif, FFI_FN(return_fl), &rfl, values); + printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, fl3, fl4)); + + sum = fl1 + fl2 + fl3 + fl4; + CHECK(rfl == sum); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c new file mode 100644 index 0000000..c37877b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c @@ -0,0 +1,42 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 20050212 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static float return_fl(float fl1, float fl2, unsigned int in3, float fl4) +{ + return fl1 + fl2 + in3 + fl4; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + float fl1, fl2, fl4, rfl; + unsigned int in3; + args[0] = &ffi_type_float; + args[1] = &ffi_type_float; + args[2] = &ffi_type_uint; + args[3] = &ffi_type_float; + values[0] = &fl1; + values[1] = &fl2; + values[2] = &in3; + values[3] = &fl4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_float, args) == FFI_OK); + fl1 = 127.0; + fl2 = 128.0; + in3 = 255; + fl4 = 512.7; + + ffi_call(&cif, FFI_FN(return_fl), &rfl, values); + printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, in3, fl4)); + CHECK(rfl == fl1 + fl2 + in3 + fl4); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c new file mode 100644 index 0000000..52a92fe --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c @@ -0,0 +1,34 @@ +/* Area: ffi_call + Purpose: Check return value long double. + Limitations: none. + PR: none. + Originator: 20071113 */ +/* { dg-do run } */ + +#include "ffitest.h" + +static long double return_ldl(long double ldl) +{ + return 2*ldl; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + long double ldl, rldl; + + args[0] = &ffi_type_longdouble; + values[0] = &ldl; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_longdouble, args) == FFI_OK); + + for (ldl = -127.0; ldl < 127.0; ldl++) + { + ffi_call(&cif, FFI_FN(return_ldl), &rldl, values); + CHECK(rldl == 2 * ldl); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c new file mode 100644 index 0000000..ea4a1e4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c @@ -0,0 +1,41 @@ +/* Area: ffi_call + Purpose: Check return value long long. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +static long long return_ll(long long ll) +{ + return ll; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + long long rlonglong; + long long ll; + + args[0] = &ffi_type_sint64; + values[0] = ≪ + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint64, args) == FFI_OK); + + for (ll = 0LL; ll < 100LL; ll++) + { + ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); + CHECK(rlonglong == ll); + } + + for (ll = 55555555555000LL; ll < 55555555555100LL; ll++) + { + ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); + CHECK(rlonglong == ll); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c new file mode 100644 index 0000000..593e8a3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c @@ -0,0 +1,43 @@ +/* Area: ffi_call + Purpose: Check if long long are passed in the corresponding regs on ppc. + Limitations: none. + PR: 20104. + Originator: 20050222 */ + +/* { dg-do run } */ +/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ +#include "ffitest.h" +static long long return_ll(int ll0, long long ll1, int ll2) +{ + return ll0 + ll1 + ll2; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + long long rlonglong; + long long ll1; + unsigned ll0, ll2; + + args[0] = &ffi_type_sint; + args[1] = &ffi_type_sint64; + args[2] = &ffi_type_sint; + values[0] = &ll0; + values[1] = &ll1; + values[2] = &ll2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_sint64, args) == FFI_OK); + + ll0 = 11111111; + ll1 = 11111111111000LL; + ll2 = 11111111; + + ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); + printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2); + /* { dg-output "res: 11111133333222, 11111133333222" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c new file mode 100644 index 0000000..a36cf3e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c @@ -0,0 +1,36 @@ +/* Area: ffi_call + Purpose: Check return value signed char. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +static signed char return_sc(signed char sc) +{ + return sc; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + signed char sc; + + args[0] = &ffi_type_schar; + values[0] = ≻ + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_schar, args) == FFI_OK); + + for (sc = (signed char) -127; + sc < (signed char) 127; sc++) + { + ffi_call(&cif, FFI_FN(return_sc), &rint, values); + CHECK((signed char)rint == sc); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c new file mode 100644 index 0000000..f0fd345 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c @@ -0,0 +1,38 @@ +/* Area: ffi_call + Purpose: Check if long as return type is handled correctly. + Limitations: none. + PR: none. + */ + +/* { dg-do run } */ +#include "ffitest.h" +static long return_sl(long l1, long l2) +{ + return l1 - l2; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg res; + unsigned long l1, l2; + + args[0] = &ffi_type_slong; + args[1] = &ffi_type_slong; + values[0] = &l1; + values[1] = &l2; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_slong, args) == FFI_OK); + + l1 = 1073741823L; + l2 = 1073741824L; + + ffi_call(&cif, FFI_FN(return_sl), &res, values); + printf("res: %ld, %ld\n", (long)res, l1 - l2); + /* { dg-output "res: -1, -1" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c new file mode 100644 index 0000000..6fe5546 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c @@ -0,0 +1,38 @@ +/* Area: ffi_call + Purpose: Check return value unsigned char. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +static unsigned char return_uc(unsigned char uc) +{ + return uc; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + + unsigned char uc; + + args[0] = &ffi_type_uchar; + values[0] = &uc; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uchar, args) == FFI_OK); + + for (uc = (unsigned char) '\x00'; + uc < (unsigned char) '\xff'; uc++) + { + ffi_call(&cif, FFI_FN(return_uc), &rint, values); + CHECK((unsigned char)rint == uc); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c new file mode 100644 index 0000000..12b266f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c @@ -0,0 +1,38 @@ +/* Area: ffi_call + Purpose: Check if unsigned long as return type is handled correctly. + Limitations: none. + PR: none. + Originator: 20060724 */ + +/* { dg-do run } */ +#include "ffitest.h" +static unsigned long return_ul(unsigned long ul1, unsigned long ul2) +{ + return ul1 + ul2; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg res; + unsigned long ul1, ul2; + + args[0] = &ffi_type_ulong; + args[1] = &ffi_type_ulong; + values[0] = &ul1; + values[1] = &ul2; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_ulong, args) == FFI_OK); + + ul1 = 1073741823L; + ul2 = 1073741824L; + + ffi_call(&cif, FFI_FN(return_ul), &res, values); + printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2); + /* { dg-output "res: 2147483647, 2147483647" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c new file mode 100644 index 0000000..35b70ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c @@ -0,0 +1,44 @@ +/* Area: ffi_call + Purpose: Check strlen function call. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +static size_t ABI_ATTR my_strlen(char *s) +{ + return (strlen(s)); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + + args[0] = &ffi_type_pointer; + values[0] = (void*) &s; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + ffi_call(&cif, FFI_FN(my_strlen), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + ffi_call(&cif, FFI_FN(my_strlen), &rint, values); + CHECK(rint == 7); + + s = "1234567890123456789012345"; + ffi_call(&cif, FFI_FN(my_strlen), &rint, values); + CHECK(rint == 25); + + exit (0); +} + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c new file mode 100644 index 0000000..96282bc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c @@ -0,0 +1,49 @@ +/* Area: ffi_call + Purpose: Check strlen function call with additional arguments. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static size_t ABI_ATTR my_f(char *s, float a) +{ + return (size_t) ((int) strlen(s) + (int) a); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + float v2; + args[0] = &ffi_type_pointer; + args[1] = &ffi_type_float; + values[0] = (void*) &s; + values[1] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + v2 = -1.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 6); + + s = "1234567890123456789012345"; + v2 = 1.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 26); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c new file mode 100644 index 0000000..beba86e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c @@ -0,0 +1,49 @@ +/* Area: ffi_call + Purpose: Check strlen function call with additional arguments. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static size_t ABI_ATTR my_f(float a, char *s) +{ + return (size_t) ((int) strlen(s) + (int) a); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + float v2; + args[1] = &ffi_type_pointer; + args[0] = &ffi_type_float; + values[1] = (void*) &s; + values[0] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + v2 = -1.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 6); + + s = "1234567890123456789012345"; + v2 = 1.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 26); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c new file mode 100644 index 0000000..d5d42b4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c @@ -0,0 +1,55 @@ +/* Area: ffi_call + Purpose: Check strlen function call with additional arguments. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static size_t ABI_ATTR my_f(float a, char *s, int i) +{ + return (size_t) ((int) strlen(s) + (int) a + i); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + char *s; + int v1; + float v2; + args[2] = &ffi_type_sint; + args[1] = &ffi_type_pointer; + args[0] = &ffi_type_float; + values[2] = (void*) &v1; + values[1] = (void*) &s; + values[0] = (void*) &v2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 3, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + v1 = 1; + v2 = 0.0; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 2); + + s = "1234567"; + v2 = -1.0; + v1 = -2; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 4); + + s = "1234567890123456789012345"; + v2 = 1.0; + v1 = 2; + ffi_call(&cif, FFI_FN(my_f), &rint, values); + CHECK(rint == 28); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c new file mode 100644 index 0000000..c13e23f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c @@ -0,0 +1,67 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned char uc; + double d; + unsigned int ui; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.uc++; + ts.d--; + ts.ui++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[4]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uchar; + ts1_type_elements[1] = &ffi_type_double; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.uc = '\x01'; + ts1_arg.d = 3.14159; + ts1_arg.ui = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui == 556); + CHECK(ts1_result->d == 3.14159 - 1); + + free (ts1_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c new file mode 100644 index 0000000..17b1377 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c @@ -0,0 +1,57 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: Sergei Trofimovich + + The test originally discovered in ruby's bindings + for ffi in https://bugs.gentoo.org/634190 */ + +/* { dg-do run } */ +#include "ffitest.h" + +struct s { + int s32; + float f32; + signed char s8; +}; + +struct s make_s(void) { + struct s r; + r.s32 = 0x1234; + r.f32 = 7.0; + r.s8 = 0x78; + return r; +} + +int main() { + ffi_cif cif; + struct s r; + ffi_type rtype; + ffi_type* s_fields[] = { + &ffi_type_sint, + &ffi_type_float, + &ffi_type_schar, + NULL, + }; + + rtype.size = 0; + rtype.alignment = 0, + rtype.type = FFI_TYPE_STRUCT, + rtype.elements = s_fields, + + r.s32 = 0xbad; + r.f32 = 999.999; + r.s8 = 0x51; + + // Here we emulate the following call: + //r = make_s(); + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &rtype, NULL) == FFI_OK); + ffi_call(&cif, FFI_FN(make_s), &r, NULL); + + CHECK(r.s32 == 0x1234); + CHECK(r.f32 == 7.0); + CHECK(r.s8 == 0x78); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c new file mode 100644 index 0000000..5077a5e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c @@ -0,0 +1,67 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + double d1; + double d2; +} test_structure_2; + +static test_structure_2 ABI_ATTR struct2(test_structure_2 ts) +{ + ts.d1--; + ts.d2--; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + test_structure_2 ts2_arg; + ffi_type ts2_type; + ffi_type *ts2_type_elements[3]; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_2 *ts2_result = + (test_structure_2 *) malloc (sizeof(test_structure_2)); + + ts2_type.size = 0; + ts2_type.alignment = 0; + ts2_type.type = FFI_TYPE_STRUCT; + ts2_type.elements = ts2_type_elements; + ts2_type_elements[0] = &ffi_type_double; + ts2_type_elements[1] = &ffi_type_double; + ts2_type_elements[2] = NULL; + + args[0] = &ts2_type; + values[0] = &ts2_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK); + + ts2_arg.d1 = 5.55; + ts2_arg.d2 = 6.66; + + printf ("%g\n", ts2_arg.d1); + printf ("%g\n", ts2_arg.d2); + + ffi_call(&cif, FFI_FN(struct2), ts2_result, values); + + printf ("%g\n", ts2_result->d1); + printf ("%g\n", ts2_result->d2); + + CHECK(ts2_result->d1 == 5.55 - 1); + CHECK(ts2_result->d2 == 6.66 - 1); + + free (ts2_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c new file mode 100644 index 0000000..7eba0ea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c @@ -0,0 +1,60 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + int si; +} test_structure_3; + +static test_structure_3 ABI_ATTR struct3(test_structure_3 ts) +{ + ts.si = -(ts.si*2); + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + int compare_value; + ffi_type ts3_type; + ffi_type *ts3_type_elements[2]; + + test_structure_3 ts3_arg; + test_structure_3 *ts3_result = + (test_structure_3 *) malloc (sizeof(test_structure_3)); + + ts3_type.size = 0; + ts3_type.alignment = 0; + ts3_type.type = FFI_TYPE_STRUCT; + ts3_type.elements = ts3_type_elements; + ts3_type_elements[0] = &ffi_type_sint; + ts3_type_elements[1] = NULL; + + args[0] = &ts3_type; + values[0] = &ts3_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts3_type, args) == FFI_OK); + + ts3_arg.si = -123; + compare_value = ts3_arg.si; + + ffi_call(&cif, FFI_FN(struct3), ts3_result, values); + + printf ("%d %d\n", ts3_result->si, -(compare_value*2)); + + CHECK(ts3_result->si == -(compare_value*2)); + + free (ts3_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c new file mode 100644 index 0000000..66a9551 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c @@ -0,0 +1,64 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned ui1; + unsigned ui2; + unsigned ui3; +} test_structure_4; + +static test_structure_4 ABI_ATTR struct4(test_structure_4 ts) +{ + ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts4_type; + ffi_type *ts4_type_elements[4]; + + test_structure_4 ts4_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_4 *ts4_result = + (test_structure_4 *) malloc (sizeof(test_structure_4)); + + ts4_type.size = 0; + ts4_type.alignment = 0; + ts4_type.type = FFI_TYPE_STRUCT; + ts4_type.elements = ts4_type_elements; + ts4_type_elements[0] = &ffi_type_uint; + ts4_type_elements[1] = &ffi_type_uint; + ts4_type_elements[2] = &ffi_type_uint; + ts4_type_elements[3] = NULL; + + args[0] = &ts4_type; + values[0] = &ts4_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK); + + ts4_arg.ui1 = 2; + ts4_arg.ui2 = 3; + ts4_arg.ui3 = 4; + + ffi_call (&cif, FFI_FN(struct4), ts4_result, values); + + CHECK(ts4_result->ui3 == 2U * 3U * 4U); + + + free (ts4_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c new file mode 100644 index 0000000..23e2a3f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c @@ -0,0 +1,66 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +typedef struct +{ + char c1; + char c2; +} test_structure_5; + +static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2) +{ + ts1.c1 += ts2.c1; + ts1.c2 -= ts2.c2; + + return ts1; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts5_type; + ffi_type *ts5_type_elements[3]; + + test_structure_5 ts5_arg1, ts5_arg2; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_5 *ts5_result = + (test_structure_5 *) malloc (sizeof(test_structure_5)); + + ts5_type.size = 0; + ts5_type.alignment = 0; + ts5_type.type = FFI_TYPE_STRUCT; + ts5_type.elements = ts5_type_elements; + ts5_type_elements[0] = &ffi_type_schar; + ts5_type_elements[1] = &ffi_type_schar; + ts5_type_elements[2] = NULL; + + args[0] = &ts5_type; + args[1] = &ts5_type; + values[0] = &ts5_arg1; + values[1] = &ts5_arg2; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK); + + ts5_arg1.c1 = 2; + ts5_arg1.c2 = 6; + ts5_arg2.c1 = 5; + ts5_arg2.c2 = 3; + + ffi_call (&cif, FFI_FN(struct5), ts5_result, values); + + CHECK(ts5_result->c1 == 7); + CHECK(ts5_result->c2 == 3); + + + free (ts5_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c new file mode 100644 index 0000000..173c66e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c @@ -0,0 +1,64 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +typedef struct +{ + float f; + double d; +} test_structure_6; + +static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts) +{ + ts.f += 1; + ts.d += 1; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts6_type; + ffi_type *ts6_type_elements[3]; + + test_structure_6 ts6_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_6 *ts6_result = + (test_structure_6 *) malloc (sizeof(test_structure_6)); + + ts6_type.size = 0; + ts6_type.alignment = 0; + ts6_type.type = FFI_TYPE_STRUCT; + ts6_type.elements = ts6_type_elements; + ts6_type_elements[0] = &ffi_type_float; + ts6_type_elements[1] = &ffi_type_double; + ts6_type_elements[2] = NULL; + + args[0] = &ts6_type; + values[0] = &ts6_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK); + + ts6_arg.f = 5.55f; + ts6_arg.d = 6.66; + + printf ("%g\n", ts6_arg.f); + printf ("%g\n", ts6_arg.d); + + ffi_call(&cif, FFI_FN(struct6), ts6_result, values); + + CHECK(ts6_result->f == 5.55f + 1); + CHECK(ts6_result->d == 6.66 + 1); + + free (ts6_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c new file mode 100644 index 0000000..badc7e0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c @@ -0,0 +1,74 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +typedef struct +{ + float f1; + float f2; + double d; +} test_structure_7; + +static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts) +{ + ts.f1 += 1; + ts.f2 += 1; + ts.d += 1; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts7_type; + ffi_type *ts7_type_elements[4]; + + test_structure_7 ts7_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_7 *ts7_result = + (test_structure_7 *) malloc (sizeof(test_structure_7)); + + ts7_type.size = 0; + ts7_type.alignment = 0; + ts7_type.type = FFI_TYPE_STRUCT; + ts7_type.elements = ts7_type_elements; + ts7_type_elements[0] = &ffi_type_float; + ts7_type_elements[1] = &ffi_type_float; + ts7_type_elements[2] = &ffi_type_double; + ts7_type_elements[3] = NULL; + + args[0] = &ts7_type; + values[0] = &ts7_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK); + + ts7_arg.f1 = 5.55f; + ts7_arg.f2 = 55.5f; + ts7_arg.d = 6.66; + + printf ("%g\n", ts7_arg.f1); + printf ("%g\n", ts7_arg.f2); + printf ("%g\n", ts7_arg.d); + + ffi_call(&cif, FFI_FN(struct7), ts7_result, values); + + printf ("%g\n", ts7_result->f1); + printf ("%g\n", ts7_result->f2); + printf ("%g\n", ts7_result->d); + + CHECK(ts7_result->f1 == 5.55f + 1); + CHECK(ts7_result->f2 == 55.5f + 1); + CHECK(ts7_result->d == 6.66 + 1); + + free (ts7_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c new file mode 100644 index 0000000..ef204ec --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c @@ -0,0 +1,81 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" +typedef struct +{ + float f1; + float f2; + float f3; + float f4; +} test_structure_8; + +static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts) +{ + ts.f1 += 1; + ts.f2 += 1; + ts.f3 += 1; + ts.f4 += 1; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts8_type; + ffi_type *ts8_type_elements[5]; + + test_structure_8 ts8_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_8 *ts8_result = + (test_structure_8 *) malloc (sizeof(test_structure_8)); + + ts8_type.size = 0; + ts8_type.alignment = 0; + ts8_type.type = FFI_TYPE_STRUCT; + ts8_type.elements = ts8_type_elements; + ts8_type_elements[0] = &ffi_type_float; + ts8_type_elements[1] = &ffi_type_float; + ts8_type_elements[2] = &ffi_type_float; + ts8_type_elements[3] = &ffi_type_float; + ts8_type_elements[4] = NULL; + + args[0] = &ts8_type; + values[0] = &ts8_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK); + + ts8_arg.f1 = 5.55f; + ts8_arg.f2 = 55.5f; + ts8_arg.f3 = -5.55f; + ts8_arg.f4 = -55.5f; + + printf ("%g\n", ts8_arg.f1); + printf ("%g\n", ts8_arg.f2); + printf ("%g\n", ts8_arg.f3); + printf ("%g\n", ts8_arg.f4); + + ffi_call(&cif, FFI_FN(struct8), ts8_result, values); + + printf ("%g\n", ts8_result->f1); + printf ("%g\n", ts8_result->f2); + printf ("%g\n", ts8_result->f3); + printf ("%g\n", ts8_result->f4); + + CHECK(ts8_result->f1 == 5.55f + 1); + CHECK(ts8_result->f2 == 55.5f + 1); + CHECK(ts8_result->f3 == -5.55f + 1); + CHECK(ts8_result->f4 == -55.5f + 1); + + free (ts8_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c new file mode 100644 index 0000000..4a13b81 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c @@ -0,0 +1,68 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + float f; + int i; +} test_structure_9; + +static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts) +{ + ts.f += 1; + ts.i += 1; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts9_type; + ffi_type *ts9_type_elements[3]; + + test_structure_9 ts9_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_9 *ts9_result = + (test_structure_9 *) malloc (sizeof(test_structure_9)); + + ts9_type.size = 0; + ts9_type.alignment = 0; + ts9_type.type = FFI_TYPE_STRUCT; + ts9_type.elements = ts9_type_elements; + ts9_type_elements[0] = &ffi_type_float; + ts9_type_elements[1] = &ffi_type_sint; + ts9_type_elements[2] = NULL; + + args[0] = &ts9_type; + values[0] = &ts9_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK); + + ts9_arg.f = 5.55f; + ts9_arg.i = 5; + + printf ("%g\n", ts9_arg.f); + printf ("%d\n", ts9_arg.i); + + ffi_call(&cif, FFI_FN(struct9), ts9_result, values); + + printf ("%g\n", ts9_result->f); + printf ("%d\n", ts9_result->i); + + CHECK(ts9_result->f == 5.55f + 1); + CHECK(ts9_result->i == 5 + 1); + + free (ts9_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c new file mode 100644 index 0000000..f00d830 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c @@ -0,0 +1,61 @@ +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned char uc; + double d; + unsigned int ui; +} test_structure_1; + +static test_structure_1 struct1(test_structure_1 ts) +{ + ts.uc++; + ts.d--; + ts.ui++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[4]; + + memset(&cif, 1, sizeof(cif)); + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uchar; + ts1_type_elements[1] = &ffi_type_double; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = NULL; + + test_structure_1 ts1_arg; + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.uc = '\x01'; + ts1_arg.d = 3.14159; + ts1_arg.ui = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui == 556); + CHECK(ts1_result->d == 3.14159 - 1); + + free (ts1_result); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c new file mode 100644 index 0000000..59d085c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c @@ -0,0 +1,196 @@ +/* Area: ffi_call + Purpose: Test passing struct in variable argument lists. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* m68k-*-* alpha-*-* } } */ + +#include "ffitest.h" +#include + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + +static int +test_fn (int n, ...) +{ + va_list ap; + struct small_tag s1; + struct small_tag s2; + struct large_tag l; + unsigned char uc; + signed char sc; + unsigned short us; + signed short ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + float f; + double d; + + va_start (ap, n); + s1 = va_arg (ap, struct small_tag); + l = va_arg (ap, struct large_tag); + s2 = va_arg (ap, struct small_tag); + + uc = va_arg (ap, unsigned); + sc = va_arg (ap, signed); + + us = va_arg (ap, unsigned); + ss = va_arg (ap, signed); + + ui = va_arg (ap, unsigned int); + si = va_arg (ap, signed int); + + ul = va_arg (ap, unsigned long); + sl = va_arg (ap, signed long); + + f = va_arg (ap, double); /* C standard promotes float->double + when anonymous */ + d = va_arg (ap, double); + + printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n", + s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, + s2.a, s2.b, + uc, sc, + us, ss, + ui, si, + ul, sl, + f, d); + va_end (ap); + return n + 1; +} + +int +main (void) +{ + ffi_cif cif; + void* args[15]; + ffi_type* arg_types[15]; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int n; + ffi_arg res; + + unsigned char uc; + signed char sc; + unsigned short us; + signed short ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + double d1; + double f1; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = &ffi_type_uchar; + arg_types[5] = &ffi_type_schar; + arg_types[6] = &ffi_type_ushort; + arg_types[7] = &ffi_type_sshort; + arg_types[8] = &ffi_type_uint; + arg_types[9] = &ffi_type_sint; + arg_types[10] = &ffi_type_ulong; + arg_types[11] = &ffi_type_slong; + arg_types[12] = &ffi_type_double; + arg_types[13] = &ffi_type_double; + arg_types[14] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK); + + s1.a = 5; + s1.b = 6; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + s2.a = 7; + s2.b = 8; + + n = 41; + + uc = 9; + sc = 10; + us = 11; + ss = 12; + ui = 13; + si = 14; + ul = 15; + sl = 16; + f1 = 2.12; + d1 = 3.13; + + args[0] = &n; + args[1] = &s1; + args[2] = &l1; + args[3] = &s2; + args[4] = &uc; + args[5] = ≻ + args[6] = &us; + args[7] = &ss; + args[8] = &ui; + args[9] = &si; + args[10] = &ul; + args[11] = &sl; + args[12] = &f1; + args[13] = &d1; + args[14] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 42" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c new file mode 100644 index 0000000..e645206 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c @@ -0,0 +1,121 @@ +/* Area: ffi_call + Purpose: Test passing struct in variable argument lists. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* } } */ + +#include "ffitest.h" +#include + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + +static int +test_fn (int n, ...) +{ + va_list ap; + struct small_tag s1; + struct small_tag s2; + struct large_tag l; + + va_start (ap, n); + s1 = va_arg (ap, struct small_tag); + l = va_arg (ap, struct large_tag); + s2 = va_arg (ap, struct small_tag); + printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, + s2.a, s2.b); + va_end (ap); + return n + 1; +} + +int +main (void) +{ + ffi_cif cif; + void* args[5]; + ffi_type* arg_types[5]; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int n; + ffi_arg res; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint, arg_types) == FFI_OK); + + s1.a = 5; + s1.b = 6; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + s2.a = 7; + s2.b = 8; + + n = 41; + + args[0] = &n; + args[1] = &s1; + args[2] = &l1; + args[3] = &s2; + args[4] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "5 6 10 11 12 13 14 7 8" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 42" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c new file mode 100644 index 0000000..56f5b9c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c @@ -0,0 +1,123 @@ +/* Area: ffi_call + Purpose: Test passing struct in variable argument lists. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* } } */ + +#include "ffitest.h" +#include + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + +static struct small_tag +test_fn (int n, ...) +{ + va_list ap; + struct small_tag s1; + struct small_tag s2; + struct large_tag l; + + va_start (ap, n); + s1 = va_arg (ap, struct small_tag); + l = va_arg (ap, struct large_tag); + s2 = va_arg (ap, struct small_tag); + printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, + s2.a, s2.b); + va_end (ap); + s1.a += s2.a; + s1.b += s2.b; + return s1; +} + +int +main (void) +{ + ffi_cif cif; + void* args[5]; + ffi_type* arg_types[5]; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int n; + struct small_tag res; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &s_type, arg_types) == FFI_OK); + + s1.a = 5; + s1.b = 6; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + s2.a = 7; + s2.b = 8; + + n = 41; + + args[0] = &n; + args[1] = &s1; + args[2] = &l1; + args[3] = &s2; + args[4] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "5 6 10 11 12 13 14 7 8" } */ + printf("res: %d %d\n", res.a, res.b); + /* { dg-output "\nres: 12 14" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c new file mode 100644 index 0000000..9a27e7f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c @@ -0,0 +1,125 @@ +/* Area: ffi_call + Purpose: Test passing struct in variable argument lists. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* } } */ + +#include "ffitest.h" +#include + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + +static struct large_tag +test_fn (int n, ...) +{ + va_list ap; + struct small_tag s1; + struct small_tag s2; + struct large_tag l; + + va_start (ap, n); + s1 = va_arg (ap, struct small_tag); + l = va_arg (ap, struct large_tag); + s2 = va_arg (ap, struct small_tag); + printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, + s2.a, s2.b); + va_end (ap); + l.a += s1.a; + l.b += s1.b; + l.c += s2.a; + l.d += s2.b; + return l; +} + +int +main (void) +{ + ffi_cif cif; + void* args[5]; + ffi_type* arg_types[5]; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int n; + struct large_tag res; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &l_type, arg_types) == FFI_OK); + + s1.a = 5; + s1.b = 6; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + s2.a = 7; + s2.b = 8; + + n = 41; + + args[0] = &n; + args[1] = &s1; + args[2] = &l1; + args[3] = &s2; + args[4] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "5 6 10 11 12 13 14 7 8" } */ + printf("res: %d %d %d %d %d\n", res.a, res.b, res.c, res.d, res.e); + /* { dg-output "\nres: 15 17 19 21 14" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp new file mode 100644 index 0000000..ed4145c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp @@ -0,0 +1,67 @@ +# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2019 Free Software Foundation, Inc. +# Copyright (C) 2019 Anthony Green + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +dg-init +libffi-init + +global srcdir subdir + +if { [string match $compiler_vendor "microsoft"] } { + # -wd4005 macro redefinition + # -wd4244 implicit conversion to type of smaller size + # -wd4305 truncation to smaller type + # -wd4477 printf %lu of uintptr_t + # -wd4312 implicit conversion to type of greater size + # -wd4311 pointer truncation to unsigned long + # -EHsc C++ Exception Handling (no SEH exceptions) + set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc"; +} else { + set additional_options ""; +} + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]] + +if { [libffi_feature_test "#if FFI_CLOSURES"] } { + run-many-tests $tlist "" +} else { + foreach test $tlist { + unsupported "$test" + } +} + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]] + +# No C++ for or1k +if { [istarget "or1k-*-*"] } { + foreach test $tlist { + unsupported "$test" + } +} else { + if { [libffi_feature_test "#if FFI_CLOSURES"] } { + run-many-tests $tlist $additional_options + } else { + foreach test $tlist { + unsupported "$test" + } + } +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c new file mode 100644 index 0000000..a579ff6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c @@ -0,0 +1,89 @@ +/* Area: closure_call + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20030828 */ + + + + +/* { dg-do run } */ +#include "ffitest.h" + +static void +closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) + + (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] + + (int)(*(signed short *)args[4]) + + (int)(*(unsigned long long *)args[5]) + + (int)*(int *)args[6] + (int)(*(int *)args[7]) + + (int)(*(double *)args[8]) + (int)*(int *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(int *)args[13]) + + (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]), + (int)(*(unsigned long long *)args[2]), + (int)*(int *)args[3], (int)(*(signed short *)args[4]), + (int)(*(unsigned long long *)args[5]), + (int)*(int *)args[6], (int)(*(int *)args[7]), + (int)(*(double *)args[8]), (int)*(int *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(int *)args[13]), + (int)(*(int *)args[14]),*(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + +} + +typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long, + int, signed short, unsigned long long, int, + int, double, int, int, float, int, int, + int, int); + +int main (void) +{ + ffi_cif cif; + void * code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_uint64; + cl_arg_types[1] = &ffi_type_sint; + cl_arg_types[2] = &ffi_type_uint64; + cl_arg_types[3] = &ffi_type_sint; + cl_arg_types[4] = &ffi_type_sshort; + cl_arg_types[5] = &ffi_type_uint64; + cl_arg_types[6] = &ffi_type_sint; + cl_arg_types[7] = &ffi_type_sint; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_sint; + cl_arg_types[10] = &ffi_type_sint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_sint; + cl_arg_types[14] = &ffi_type_sint; + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type0)code)) + (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13, + 19, 21, 1); + /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 680" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c new file mode 100644 index 0000000..9123173 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c @@ -0,0 +1,81 @@ +/* Area: closure_call. + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + + +static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(float *)args[0] +(int)(*(float *)args[1]) + + (int)(*(float *)args[2]) + (int)*(float *)args[3] + + (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + + (int)*(float *)args[6] + (int)(*(int *)args[7]) + + (int)(*(double*)args[8]) + (int)*(int *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(int *)args[13]) + + (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(float *)args[0], (int)(*(float *)args[1]), + (int)(*(float *)args[2]), (int)*(float *)args[3], + (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), + (int)*(float *)args[6], (int)(*(int *)args[7]), + (int)(*(double *)args[8]), (int)*(int *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(int *)args[13]), + (int)(*(int *)args[14]), *(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); +} + +typedef int (*closure_test_type1)(float, float, float, float, signed short, + float, float, int, double, int, int, float, + int, int, int, int); +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_float; + cl_arg_types[1] = &ffi_type_float; + cl_arg_types[2] = &ffi_type_float; + cl_arg_types[3] = &ffi_type_float; + cl_arg_types[4] = &ffi_type_sshort; + cl_arg_types[5] = &ffi_type_float; + cl_arg_types[6] = &ffi_type_float; + cl_arg_types[7] = &ffi_type_sint; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_sint; + cl_arg_types[10] = &ffi_type_sint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_sint; + cl_arg_types[14] = &ffi_type_sint; + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type1)code)) + (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, + 19, 21, 1); + /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 255" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c new file mode 100644 index 0000000..08ff9d9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c @@ -0,0 +1,81 @@ +/* Area: closure_call + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(double *)args[0] +(int)(*(double *)args[1]) + + (int)(*(double *)args[2]) + (int)*(double *)args[3] + + (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) + + (int)*(double *)args[6] + (int)(*(int *)args[7]) + + (int)(*(double *)args[8]) + (int)*(int *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(float *)args[13]) + + (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(double *)args[0], (int)(*(double *)args[1]), + (int)(*(double *)args[2]), (int)*(double *)args[3], + (int)(*(signed short *)args[4]), (int)(*(double *)args[5]), + (int)*(double *)args[6], (int)(*(int *)args[7]), + (int)(*(double*)args[8]), (int)*(int *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(float *)args[13]), + (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata, + (int)*(ffi_arg *)resp); +} + +typedef int (*closure_test_type2)(double, double, double, double, signed short, + double, double, int, double, int, int, float, + int, float, int, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_double; + cl_arg_types[1] = &ffi_type_double; + cl_arg_types[2] = &ffi_type_double; + cl_arg_types[3] = &ffi_type_double; + cl_arg_types[4] = &ffi_type_sshort; + cl_arg_types[5] = &ffi_type_double; + cl_arg_types[6] = &ffi_type_double; + cl_arg_types[7] = &ffi_type_sint; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_sint; + cl_arg_types[10] = &ffi_type_sint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_float; + cl_arg_types[14] = &ffi_type_sint; + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn2, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type2)code)) + (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13, + 19.0, 21, 1); + /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 255" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c new file mode 100644 index 0000000..9b54d80 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c @@ -0,0 +1,82 @@ +/* Area: closure_call + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) + { + *(ffi_arg*)resp = + (int)*(float *)args[0] +(int)(*(float *)args[1]) + + (int)(*(float *)args[2]) + (int)*(float *)args[3] + + (int)(*(float *)args[4]) + (int)(*(float *)args[5]) + + (int)*(float *)args[6] + (int)(*(float *)args[7]) + + (int)(*(double *)args[8]) + (int)*(int *)args[9] + + (int)(*(float *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(float *)args[13]) + + (int)(*(float *)args[14]) + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(float *)args[0], (int)(*(float *)args[1]), + (int)(*(float *)args[2]), (int)*(float *)args[3], + (int)(*(float *)args[4]), (int)(*(float *)args[5]), + (int)*(float *)args[6], (int)(*(float *)args[7]), + (int)(*(double *)args[8]), (int)*(int *)args[9], + (int)(*(float *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(float *)args[13]), + (int)(*(float *)args[14]), *(int *)args[15], (int)(intptr_t)userdata, + (int)*(ffi_arg *)resp); + + } + +typedef int (*closure_test_type3)(float, float, float, float, float, float, + float, float, double, int, float, float, int, + float, float, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_float; + cl_arg_types[1] = &ffi_type_float; + cl_arg_types[2] = &ffi_type_float; + cl_arg_types[3] = &ffi_type_float; + cl_arg_types[4] = &ffi_type_float; + cl_arg_types[5] = &ffi_type_float; + cl_arg_types[6] = &ffi_type_float; + cl_arg_types[7] = &ffi_type_float; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_sint; + cl_arg_types[10] = &ffi_type_float; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_float; + cl_arg_types[14] = &ffi_type_float; + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn3, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type3)code)) + (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13, + 19.19, 21.21, 1); + /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 135" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c new file mode 100644 index 0000000..d4a1530 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c @@ -0,0 +1,89 @@ +/* Area: closure_call + Purpose: Check multiple long long values passing. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20031026 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static void +closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] + + (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] + + (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] + + (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] + + (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] + + (int)*(unsigned long long *)args[10] + + (int)*(unsigned long long *)args[11] + + (int)*(unsigned long long *)args[12] + + (int)*(unsigned long long *)args[13] + + (int)*(unsigned long long *)args[14] + + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(unsigned long long *)args[0], + (int)*(unsigned long long *)args[1], + (int)*(unsigned long long *)args[2], + (int)*(unsigned long long *)args[3], + (int)*(unsigned long long *)args[4], + (int)*(unsigned long long *)args[5], + (int)*(unsigned long long *)args[6], + (int)*(unsigned long long *)args[7], + (int)*(unsigned long long *)args[8], + (int)*(unsigned long long *)args[9], + (int)*(unsigned long long *)args[10], + (int)*(unsigned long long *)args[11], + (int)*(unsigned long long *)args[12], + (int)*(unsigned long long *)args[13], + (int)*(unsigned long long *)args[14], + *(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + +} + +typedef int (*closure_test_type0)(unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int i, res; + + for (i = 0; i < 15; i++) { + cl_arg_types[i] = &ffi_type_uint64; + } + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type0)code)) + (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL, + 13LL, 19LL, 21LL, 1); + /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 680" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c new file mode 100644 index 0000000..9907442 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c @@ -0,0 +1,92 @@ +/* Area: closure_call + Purpose: Check multiple long long values passing. + Exceed the limit of gpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20031026 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void +closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] + + (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] + + (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] + + (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] + + (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] + + (int)*(int *)args[10] + + (int)*(unsigned long long *)args[11] + + (int)*(unsigned long long *)args[12] + + (int)*(unsigned long long *)args[13] + + (int)*(unsigned long long *)args[14] + + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(unsigned long long *)args[0], + (int)*(unsigned long long *)args[1], + (int)*(unsigned long long *)args[2], + (int)*(unsigned long long *)args[3], + (int)*(unsigned long long *)args[4], + (int)*(unsigned long long *)args[5], + (int)*(unsigned long long *)args[6], + (int)*(unsigned long long *)args[7], + (int)*(unsigned long long *)args[8], + (int)*(unsigned long long *)args[9], + (int)*(int *)args[10], + (int)*(unsigned long long *)args[11], + (int)*(unsigned long long *)args[12], + (int)*(unsigned long long *)args[13], + (int)*(unsigned long long *)args[14], + *(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + +} + +typedef int (*closure_test_type0)(unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, unsigned long long, + int, unsigned long long, + unsigned long long, unsigned long long, + unsigned long long, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int i, res; + + for (i = 0; i < 10; i++) { + cl_arg_types[i] = &ffi_type_uint64; + } + cl_arg_types[10] = &ffi_type_sint; + for (i = 11; i < 15; i++) { + cl_arg_types[i] = &ffi_type_uint64; + } + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn5, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type0)code)) + (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL, + 13LL, 19LL, 21LL, 1); + /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 680" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c new file mode 100644 index 0000000..73c54fd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c @@ -0,0 +1,90 @@ +/* Area: closure_call + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC. + Limitations: none. + PR: PR23404 + Originator: 20050830 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void +closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(unsigned long long *)args[0] + + (int)(*(unsigned long long *)args[1]) + + (int)(*(unsigned long long *)args[2]) + + (int)*(unsigned long long *)args[3] + + (int)(*(int *)args[4]) + (int)(*(double *)args[5]) + + (int)*(double *)args[6] + (int)(*(float *)args[7]) + + (int)(*(double *)args[8]) + (int)*(double *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(int *)args[13]) + + (int)(*(double *)args[14]) + (int)*(double *)args[15] + + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(unsigned long long *)args[0], + (int)(*(unsigned long long *)args[1]), + (int)(*(unsigned long long *)args[2]), + (int)*(unsigned long long *)args[3], + (int)(*(int *)args[4]), (int)(*(double *)args[5]), + (int)*(double *)args[6], (int)(*(float *)args[7]), + (int)(*(double *)args[8]), (int)*(double *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(int *)args[13]), + (int)(*(double *)args[14]), (int)(*(double *)args[15]), + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + +} + +typedef int (*closure_test_type0)(unsigned long long, + unsigned long long, + unsigned long long, + unsigned long long, + int, double, double, float, double, double, + int, float, int, int, double, double); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_uint64; + cl_arg_types[1] = &ffi_type_uint64; + cl_arg_types[2] = &ffi_type_uint64; + cl_arg_types[3] = &ffi_type_uint64; + cl_arg_types[4] = &ffi_type_sint; + cl_arg_types[5] = &ffi_type_double; + cl_arg_types[6] = &ffi_type_double; + cl_arg_types[7] = &ffi_type_float; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_double; + cl_arg_types[10] = &ffi_type_sint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_sint; + cl_arg_types[14] = &ffi_type_double; + cl_arg_types[15] = &ffi_type_double; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*((closure_test_type0)code)) + (1, 2, 3, 4, 127, 429., 7., 8., 9.5, 10., 11, 12., 13, + 19, 21., 1.); + /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 680" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c new file mode 100644 index 0000000..b3afa0b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c @@ -0,0 +1,95 @@ +/* Area: closure_call + Purpose: Check multiple values passing from different type. + Also, exceed the limit of gpr and fpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 20030828 */ + + + + +/* { dg-do run } */ +#include "ffitest.h" + +static void +closure_loc_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata) +{ + *(ffi_arg*)resp = + (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) + + (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] + + (int)(*(signed short *)args[4]) + + (int)(*(unsigned long long *)args[5]) + + (int)*(int *)args[6] + (int)(*(int *)args[7]) + + (int)(*(double *)args[8]) + (int)*(int *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(int *)args[13]) + + (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]), + (int)(*(unsigned long long *)args[2]), + (int)*(int *)args[3], (int)(*(signed short *)args[4]), + (int)(*(unsigned long long *)args[5]), + (int)*(int *)args[6], (int)(*(int *)args[7]), + (int)(*(double *)args[8]), (int)*(int *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(int *)args[13]), + (int)(*(int *)args[14]),*(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + +} + +typedef int (*closure_loc_test_type0)(unsigned long long, int, unsigned long long, + int, signed short, unsigned long long, int, + int, double, int, int, float, int, int, + int, int); + +int main (void) +{ + ffi_cif cif; + ffi_closure *pcl; + ffi_type * cl_arg_types[17]; + int res; + void *codeloc; + + cl_arg_types[0] = &ffi_type_uint64; + cl_arg_types[1] = &ffi_type_sint; + cl_arg_types[2] = &ffi_type_uint64; + cl_arg_types[3] = &ffi_type_sint; + cl_arg_types[4] = &ffi_type_sshort; + cl_arg_types[5] = &ffi_type_uint64; + cl_arg_types[6] = &ffi_type_sint; + cl_arg_types[7] = &ffi_type_sint; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_sint; + cl_arg_types[10] = &ffi_type_sint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_sint; + cl_arg_types[13] = &ffi_type_sint; + cl_arg_types[14] = &ffi_type_sint; + cl_arg_types[15] = &ffi_type_sint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + pcl = ffi_closure_alloc(sizeof(ffi_closure), &codeloc); + CHECK(pcl != NULL); + CHECK(codeloc != NULL); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0, + (void *) 3 /* userdata */, codeloc) == FFI_OK); + + CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0); + + res = (*((closure_loc_test_type0)codeloc)) + (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13, + 19, 21, 1); + /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 680" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c new file mode 100644 index 0000000..5a4e728 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c @@ -0,0 +1,55 @@ +/* Area: closure_call + Purpose: Check simple closure handling with all ABIs + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void +closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata) +{ + *(ffi_arg*)resp = + (int)*(int *)args[0] + (int)(*(int *)args[1]) + + (int)(*(int *)args[2]) + (int)(*(int *)args[3]) + + (int)(intptr_t)userdata; + + printf("%d %d %d %d: %d\n", + (int)*(int *)args[0], (int)(*(int *)args[1]), + (int)(*(int *)args[2]), (int)(*(int *)args[3]), + (int)*(ffi_arg *)resp); + +} + +typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + int res; + + cl_arg_types[0] = &ffi_type_uint; + cl_arg_types[1] = &ffi_type_uint; + cl_arg_types[2] = &ffi_type_uint; + cl_arg_types[3] = &ffi_type_uint; + cl_arg_types[4] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test, + (void *) 3 /* userdata */, code) == FFI_OK); + + res = (*(closure_test_type0)code)(0, 1, 2, 3); + /* { dg-output "0 1 2 3: 9" } */ + + printf("res: %d\n",res); + /* { dg-output "\nres: 9" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c new file mode 100644 index 0000000..ea0825d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c @@ -0,0 +1,94 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_12byte { + int a; + int b; + int c; +} cls_struct_12byte; + +cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1, + struct cls_struct_12byte b2) +{ + struct cls_struct_12byte result; + + result.a = b1.a + b2.a; + result.b = b1.b + b2.b; + result.c = b1.c + b2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, + result.a, result.b, result.c); + + return result; +} + +static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args , void* userdata __UNUSED__) +{ + struct cls_struct_12byte b1, b2; + + b1 = *(struct cls_struct_12byte*)(args[0]); + b2 = *(struct cls_struct_12byte*)(args[1]); + + *(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_12byte h_dbl = { 7, 4, 9 }; + struct cls_struct_12byte j_dbl = { 1, 5, 3 }; + struct cls_struct_12byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_sint; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &h_dbl; + args_dbl[1] = &j_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl); + /* { dg-output "7 4 9 1 5 3: 8 9 12" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 8 9 12" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_12byte_gn, NULL, code) == FFI_OK); + + res_dbl.a = 0; + res_dbl.b = 0; + res_dbl.c = 0; + + res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(code))(h_dbl, j_dbl); + /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 8 9 12" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c new file mode 100644 index 0000000..89a08a2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c @@ -0,0 +1,95 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_16byte { + int a; + double b; + int c; +} cls_struct_16byte; + +cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1, + struct cls_struct_16byte b2) +{ + struct cls_struct_16byte result; + + result.a = b1.a + b2.a; + result.b = b1.b + b2.b; + result.c = b1.c + b2.c; + + printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, + result.a, result.b, result.c); + + return result; +} + +static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + struct cls_struct_16byte b1, b2; + + b1 = *(struct cls_struct_16byte*)(args[0]); + b2 = *(struct cls_struct_16byte*)(args[1]); + + *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_16byte h_dbl = { 7, 8.0, 9 }; + struct cls_struct_16byte j_dbl = { 1, 9.0, 3 }; + struct cls_struct_16byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &h_dbl; + args_dbl[1] = &j_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl); + /* { dg-output "7 8 9 1 9 3: 8 17 12" } */ + printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 8 17 12" } */ + + res_dbl.a = 0; + res_dbl.b = 0.0; + res_dbl.c = 0; + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_16byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(code))(h_dbl, j_dbl); + /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */ + printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 8 17 12" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c new file mode 100644 index 0000000..9f75da8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c @@ -0,0 +1,96 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Double alignment check on darwin. + Limitations: none. + PR: none. + Originator: 20030915 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_18byte { + double a; + unsigned char b; + unsigned char c; + double d; +} cls_struct_18byte; + +cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1, + struct cls_struct_18byte a2) +{ + struct cls_struct_18byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + + + printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d, + a2.a, a2.b, a2.c, a2.d, + result.a, result.b, result.c, result.d); + return result; +} + +static void +cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_18byte a1, a2; + + a1 = *(struct cls_struct_18byte*)(args[0]); + a2 = *(struct cls_struct_18byte*)(args[1]); + + *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[5]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 }; + struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 }; + struct cls_struct_18byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl); + /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */ + printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 5 252 250 8" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_18byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */ + printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 5 252 250 8" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c new file mode 100644 index 0000000..278794b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c @@ -0,0 +1,102 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Double alignment check on darwin. + Limitations: none. + PR: none. + Originator: 20030915 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_19byte { + double a; + unsigned char b; + unsigned char c; + double d; + unsigned char e; +} cls_struct_19byte; + +cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1, + struct cls_struct_19byte a2) +{ + struct cls_struct_19byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + result.e = a1.e + a2.e; + + + printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n", + a1.a, a1.b, a1.c, a1.d, a1.e, + a2.a, a2.b, a2.c, a2.d, a2.e, + result.a, result.b, result.c, result.d, result.e); + return result; +} + +static void +cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_19byte a1, a2; + + a1 = *(struct cls_struct_19byte*)(args[0]); + a2 = *(struct cls_struct_19byte*)(args[1]); + + *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[6]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 }; + struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 }; + struct cls_struct_19byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_uchar; + cls_struct_fields[5] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl); + /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */ + printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e); + /* { dg-output "\nres: 5 252 250 8 239" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_19byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */ + printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e); + /* { dg-output "\nres: 5 252 250 8 239" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c new file mode 100644 index 0000000..82492c0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c @@ -0,0 +1,89 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. + Limitations: none. + PR: none. + Originator: 20030902 */ + + + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_1_1byte { + unsigned char a; +} cls_struct_1_1byte; + +cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1, + struct cls_struct_1_1byte a2) +{ + struct cls_struct_1_1byte result; + + result.a = a1.a + a2.a; + + printf("%d %d: %d\n", a1.a, a2.a, result.a); + + return result; +} + +static void +cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_1_1byte a1, a2; + + a1 = *(struct cls_struct_1_1byte*)(args[0]); + a2 = *(struct cls_struct_1_1byte*)(args[1]); + + *(cls_struct_1_1byte*)resp = cls_struct_1_1byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[2]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_1_1byte g_dbl = { 12 }; + struct cls_struct_1_1byte f_dbl = { 178 }; + struct cls_struct_1_1byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl); + /* { dg-output "12 178: 190" } */ + printf("res: %d\n", res_dbl.a); + /* { dg-output "\nres: 190" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_1_1byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 178: 190" } */ + printf("res: %d\n", res_dbl.a); + /* { dg-output "\nres: 190" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c new file mode 100644 index 0000000..3f8bb28 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_20byte { + double a; + double b; + int c; +} cls_struct_20byte; + +cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, + struct cls_struct_20byte a2) +{ + struct cls_struct_20byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, + result.a, result.b, result.c); + return result; +} + +static void +cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_20byte a1, a2; + + a1 = *(struct cls_struct_20byte*)(args[0]); + a2 = *(struct cls_struct_20byte*)(args[1]); + + *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 }; + struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 }; + struct cls_struct_20byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ + printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 5 7 10" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */ + printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 5 7 10" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c new file mode 100644 index 0000000..6562727 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c @@ -0,0 +1,93 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + + + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_20byte { + int a; + double b; + double c; +} cls_struct_20byte; + +cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, + struct cls_struct_20byte a2) +{ + struct cls_struct_20byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, + result.a, result.b, result.c); + return result; +} + +static void +cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_20byte a1, a2; + + a1 = *(struct cls_struct_20byte*)(args[0]); + a2 = *(struct cls_struct_20byte*)(args[1]); + + *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 }; + struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 }; + struct cls_struct_20byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ + printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 5 7 10" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */ + printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 5 7 10" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c new file mode 100644 index 0000000..1d82f6e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c @@ -0,0 +1,113 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_24byte { + double a; + double b; + int c; + float d; +} cls_struct_24byte; + +cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0, + struct cls_struct_24byte b1, + struct cls_struct_24byte b2, + struct cls_struct_24byte b3) +{ + struct cls_struct_24byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + + printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n", + b0.a, b0.b, b0.c, b0.d, + b1.a, b1.b, b1.c, b1.d, + b2.a, b2.b, b2.c, b2.d, + b3.a, b3.b, b3.c, b2.d, + result.a, result.b, result.c, result.d); + + return result; +} + +static void +cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_24byte b0, b1, b2, b3; + + b0 = *(struct cls_struct_24byte*)(args[0]); + b1 = *(struct cls_struct_24byte*)(args[1]); + b2 = *(struct cls_struct_24byte*)(args[2]); + b3 = *(struct cls_struct_24byte*)(args[3]); + + *(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 }; + struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 }; + struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 }; + struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 }; + struct cls_struct_24byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = &ffi_type_float; + cls_struct_fields[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl); + /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ + printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 22 15 17 25" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte, + cls_struct_24byte, + cls_struct_24byte, + cls_struct_24byte)) + (code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ + printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 22 15 17 25" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c new file mode 100644 index 0000000..81bb0a6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_2byte { + unsigned char a; + unsigned char b; +} cls_struct_2byte; + +cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1, + struct cls_struct_2byte a2) +{ + struct cls_struct_2byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + + printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + + return result; +} + +static void +cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_2byte a1, a2; + + a1 = *(struct cls_struct_2byte*)(args[0]); + a2 = *(struct cls_struct_2byte*)(args[1]); + + *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_2byte g_dbl = { 12, 127 }; + struct cls_struct_2byte f_dbl = { 1, 13 }; + struct cls_struct_2byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl); + /* { dg-output "12 127 1 13: 13 140" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 13 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 127 1 13: 13 140" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 13 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c new file mode 100644 index 0000000..b782746 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c @@ -0,0 +1,95 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. + Limitations: none. + PR: none. + Originator: 20030902 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_3_1byte { + unsigned char a; + unsigned char b; + unsigned char c; +} cls_struct_3_1byte; + +cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1, + struct cls_struct_3_1byte a2) +{ + struct cls_struct_3_1byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, + a2.a, a2.b, a2.c, + result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_3_1byte a1, a2; + + a1 = *(struct cls_struct_3_1byte*)(args[0]); + a2 = *(struct cls_struct_3_1byte*)(args[1]); + + *(cls_struct_3_1byte*)resp = cls_struct_3_1byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_3_1byte g_dbl = { 12, 13, 14 }; + struct cls_struct_3_1byte f_dbl = { 178, 179, 180 }; + struct cls_struct_3_1byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl); + /* { dg-output "12 13 14 178 179 180: 190 192 194" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 190 192 194" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 190 192 194" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c new file mode 100644 index 0000000..a02c463 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_3byte { + unsigned short a; + unsigned char b; +} cls_struct_3byte; + +cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1, + struct cls_struct_3byte a2) +{ + struct cls_struct_3byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + + printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + + return result; +} + +static void +cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_3byte a1, a2; + + a1 = *(struct cls_struct_3byte*)(args[0]); + a2 = *(struct cls_struct_3byte*)(args[1]); + + *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_3byte g_dbl = { 12, 119 }; + struct cls_struct_3byte f_dbl = { 1, 15 }; + struct cls_struct_3byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_ushort; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl); + /* { dg-output "12 119 1 15: 13 134" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 13 134" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 119 1 15: 13 134" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 13 134" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c new file mode 100644 index 0000000..c7251ce --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_3byte_1 { + unsigned char a; + unsigned short b; +} cls_struct_3byte_1; + +cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1, + struct cls_struct_3byte_1 a2) +{ + struct cls_struct_3byte_1 result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + + printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + + return result; +} + +static void +cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_3byte_1 a1, a2; + + a1 = *(struct cls_struct_3byte_1*)(args[0]); + a2 = *(struct cls_struct_3byte_1*)(args[1]); + + *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_3byte_1 g_dbl = { 15, 125 }; + struct cls_struct_3byte_1 f_dbl = { 9, 19 }; + struct cls_struct_3byte_1 res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl); + /* { dg-output "15 125 9 19: 24 144" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 24 144" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(code))(g_dbl, f_dbl); + /* { dg-output "\n15 125 9 19: 24 144" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 24 144" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c new file mode 100644 index 0000000..48888f8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c @@ -0,0 +1,95 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations:>none. + PR: none. + Originator: 20171026 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef struct cls_struct_3float { + float f; + float g; + float h; +} cls_struct_3float; + +cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1, + struct cls_struct_3float a2) +{ + struct cls_struct_3float result; + + result.f = a1.f + a2.f; + result.g = a1.g + a2.g; + result.h = a1.h + a2.h; + + printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h, + a2.f, a2.g, a2.h, result.f, result.g, result.h); + + return result; +} + +static void +cls_struct_3float_gn(ffi_cif *cif __UNUSED__, void* resp, void **args, + void* userdata __UNUSED__) +{ + struct cls_struct_3float a1, a2; + + a1 = *(struct cls_struct_3float*)(args[0]); + a2 = *(struct cls_struct_3float*)(args[1]); + + *(cls_struct_3float*)resp = cls_struct_3float_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void *args_dbl[3]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_3float g_dbl = { 1.0f, 2.0f, 3.0f }; + struct cls_struct_3float f_dbl = { 1.0f, 2.0f, 3.0f }; + struct cls_struct_3float res_dbl; + + cls_struct_fields[0] = &ffi_type_float; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = &ffi_type_float; + cls_struct_fields[3] = NULL; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_3float_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 3 1 2 3: 2 4 6" } */ + printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h); + /* { dg-output "\nres: 2 4 6" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) == + FFI_OK); + + res_dbl = ((cls_struct_3float(*)(cls_struct_3float, + cls_struct_3float))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */ + printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h); + /* { dg-output "\nres: 2 4 6" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c new file mode 100644 index 0000000..2d6d8b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c @@ -0,0 +1,98 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Especially with small structures which may fit in one + register. Depending on the ABI. + Limitations: none. + PR: none. + Originator: 20030902 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_4_1byte { + unsigned char a; + unsigned char b; + unsigned char c; + unsigned char d; +} cls_struct_4_1byte; + +cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1, + struct cls_struct_4_1byte a2) +{ + struct cls_struct_4_1byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + + printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, + a2.a, a2.b, a2.c, a2.d, + result.a, result.b, result.c, result.d); + + return result; +} + +static void +cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_4_1byte a1, a2; + + a1 = *(struct cls_struct_4_1byte*)(args[0]); + a2 = *(struct cls_struct_4_1byte*)(args[1]); + + *(cls_struct_4_1byte*)resp = cls_struct_4_1byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 }; + struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 }; + struct cls_struct_4_1byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_uchar; + cls_struct_fields[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl); + /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 190 192 194 196" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 190 192 194 196" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c new file mode 100644 index 0000000..4ac3787 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef struct cls_struct_4byte { + unsigned short a; + unsigned short b; +} cls_struct_4byte; + +cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1, + struct cls_struct_4byte a2) +{ + struct cls_struct_4byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + + printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + + return result; +} + +static void +cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_4byte a1, a2; + + a1 = *(struct cls_struct_4byte*)(args[0]); + a2 = *(struct cls_struct_4byte*)(args[1]); + + *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_4byte g_dbl = { 127, 120 }; + struct cls_struct_4byte f_dbl = { 12, 128 }; + struct cls_struct_4byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_ushort; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 12 128: 139 248" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 139 248" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 12 128: 139 248" } */ + printf("res: %d %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 139 248" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c new file mode 100644 index 0000000..ad9d51c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c @@ -0,0 +1,109 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20050708 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_5byte { + unsigned char a; + unsigned char b; + unsigned char c; + unsigned char d; + unsigned char e; +} cls_struct_5byte; + +cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, + struct cls_struct_5byte a2) +{ + struct cls_struct_5byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + result.e = a1.e + a2.e; + + printf("%d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d\n", + a1.a, a1.b, a1.c, a1.d, a1.e, + a2.a, a2.b, a2.c, a2.d, a2.e, + result.a, result.b, result.c, result.d, result.e); + + return result; +} + +static void +cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_5byte a1, a2; + + a1 = *(struct cls_struct_5byte*)(args[0]); + a2 = *(struct cls_struct_5byte*)(args[1]); + + *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[6]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 }; + struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 }; + struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 }; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_uchar; + cls_struct_fields[4] = &ffi_type_uchar; + cls_struct_fields[5] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */ + printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e); + /* { dg-output "\nres: 139 248 10 6 8" } */ + + res_dbl.a = 0; + res_dbl.b = 0; + res_dbl.c = 0; + res_dbl.d = 0; + res_dbl.e = 0; + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */ + printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e); + /* { dg-output "\nres: 139 248 10 6 8" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c new file mode 100644 index 0000000..4e0c000 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c @@ -0,0 +1,98 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_5byte { + unsigned short a; + unsigned short b; + unsigned char c; +} cls_struct_5byte; + +cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, + struct cls_struct_5byte a2) +{ + struct cls_struct_5byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, + a2.a, a2.b, a2.c, + result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_5byte a1, a2; + + a1 = *(struct cls_struct_5byte*)(args[0]); + a2 = *(struct cls_struct_5byte*)(args[1]); + + *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_5byte g_dbl = { 127, 120, 1 }; + struct cls_struct_5byte f_dbl = { 12, 128, 9 }; + struct cls_struct_5byte res_dbl = { 0, 0, 0 }; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_ushort; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 12 128 9: 139 248 10" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 139 248 10" } */ + + res_dbl.a = 0; + res_dbl.b = 0; + res_dbl.c = 0; + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 139 248 10" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c new file mode 100644 index 0000000..a55edc2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c @@ -0,0 +1,124 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check bigger struct which overlaps + the gp and fp register count on Darwin/AIX/ppc64. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_64byte { + double a; + double b; + double c; + double d; + double e; + double f; + double g; + double h; +} cls_struct_64byte; + +cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0, + struct cls_struct_64byte b1, + struct cls_struct_64byte b2, + struct cls_struct_64byte b3) +{ + struct cls_struct_64byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + result.e = b0.e + b1.e + b2.e + b3.e; + result.f = b0.f + b1.f + b2.f + b3.f; + result.g = b0.g + b1.g + b2.g + b3.g; + result.h = b0.h + b1.h + b2.h + b3.h; + + printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c, + result.d, result.e, result.f, result.g, result.h); + + return result; +} + +static void +cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_64byte b0, b1, b2, b3; + + b0 = *(struct cls_struct_64byte*)(args[0]); + b1 = *(struct cls_struct_64byte*)(args[1]); + b2 = *(struct cls_struct_64byte*)(args[2]); + b3 = *(struct cls_struct_64byte*)(args[3]); + + *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[9]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 }; + struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 }; + struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 }; + struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 }; + struct cls_struct_64byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_double; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_double; + cls_struct_fields[7] = &ffi_type_double; + cls_struct_fields[8] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl); + /* { dg-output "22 15 17 25 6 13 19 18" } */ + printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte, + cls_struct_64byte, + cls_struct_64byte, + cls_struct_64byte)) + (code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n22 15 17 25 6 13 19 18" } */ + printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c new file mode 100644 index 0000000..b4dcdba --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c @@ -0,0 +1,113 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20050708 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_6byte { + unsigned char a; + unsigned char b; + unsigned char c; + unsigned char d; + unsigned char e; + unsigned char f; +} cls_struct_6byte; + +cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, + struct cls_struct_6byte a2) +{ + struct cls_struct_6byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + result.e = a1.e + a2.e; + result.f = a1.f + a2.f; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d\n", + a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, + a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, + result.a, result.b, result.c, result.d, result.e, result.f); + + return result; +} + +static void +cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_6byte a1, a2; + + a1 = *(struct cls_struct_6byte*)(args[0]); + a2 = *(struct cls_struct_6byte*)(args[1]); + + *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[7]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 }; + struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 }; + struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 }; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_uchar; + cls_struct_fields[4] = &ffi_type_uchar; + cls_struct_fields[5] = &ffi_type_uchar; + cls_struct_fields[6] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */ + printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f); + /* { dg-output "\nres: 139 248 10 6 8 10" } */ + + res_dbl.a = 0; + res_dbl.b = 0; + res_dbl.c = 0; + res_dbl.d = 0; + res_dbl.e = 0; + res_dbl.f = 0; + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */ + printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f); + /* { dg-output "\nres: 139 248 10 6 8 10" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c new file mode 100644 index 0000000..7406780 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c @@ -0,0 +1,99 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_6byte { + unsigned short a; + unsigned short b; + unsigned char c; + unsigned char d; +} cls_struct_6byte; + +cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, + struct cls_struct_6byte a2) +{ + struct cls_struct_6byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + + printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, + a2.a, a2.b, a2.c, a2.d, + result.a, result.b, result.c, result.d); + + return result; +} + +static void +cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_6byte a1, a2; + + a1 = *(struct cls_struct_6byte*)(args[0]); + a2 = *(struct cls_struct_6byte*)(args[1]); + + *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 }; + struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 }; + struct cls_struct_6byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_ushort; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_uchar; + cls_struct_fields[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 139 248 10 255" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 139 248 10 255" } */ + + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c new file mode 100644 index 0000000..14a7e96 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c @@ -0,0 +1,117 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20050708 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_7byte { + unsigned char a; + unsigned char b; + unsigned char c; + unsigned char d; + unsigned char e; + unsigned char f; + unsigned char g; +} cls_struct_7byte; + +cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, + struct cls_struct_7byte a2) +{ + struct cls_struct_7byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + result.e = a1.e + a2.e; + result.f = a1.f + a2.f; + result.g = a1.g + a2.g; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d %d\n", + a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, + a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, + result.a, result.b, result.c, result.d, result.e, result.f, result.g); + + return result; +} + +static void +cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_7byte a1, a2; + + a1 = *(struct cls_struct_7byte*)(args[0]); + a2 = *(struct cls_struct_7byte*)(args[1]); + + *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[8]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 }; + struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 }; + struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 }; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_uchar; + cls_struct_fields[4] = &ffi_type_uchar; + cls_struct_fields[5] = &ffi_type_uchar; + cls_struct_fields[6] = &ffi_type_uchar; + cls_struct_fields[7] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */ + printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ + + res_dbl.a = 0; + res_dbl.b = 0; + res_dbl.c = 0; + res_dbl.d = 0; + res_dbl.e = 0; + res_dbl.f = 0; + res_dbl.g = 0; + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */ + printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c new file mode 100644 index 0000000..1645cc6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c @@ -0,0 +1,97 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_7byte { + unsigned short a; + unsigned short b; + unsigned char c; + unsigned short d; +} cls_struct_7byte; + +cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, + struct cls_struct_7byte a2) +{ + struct cls_struct_7byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + result.d = a1.d + a2.d; + + printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, + a2.a, a2.b, a2.c, a2.d, + result.a, result.b, result.c, result.d); + + return result; +} + +static void +cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_7byte a1, a2; + + a1 = *(struct cls_struct_7byte*)(args[0]); + a2 = *(struct cls_struct_7byte*)(args[1]); + + *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 }; + struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 }; + struct cls_struct_7byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_ushort; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = &ffi_type_ushort; + cls_struct_fields[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl); + /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 139 248 10 509" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */ + printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); + /* { dg-output "\nres: 139 248 10 509" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c new file mode 100644 index 0000000..f6c1ea5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c @@ -0,0 +1,88 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_8byte { + int a; + float b; +} cls_struct_8byte; + +cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1, + struct cls_struct_8byte a2) +{ + struct cls_struct_8byte result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + + printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + + return result; +} + +static void +cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_8byte a1, a2; + + a1 = *(struct cls_struct_8byte*)(args[0]); + a2 = *(struct cls_struct_8byte*)(args[1]); + + *(cls_struct_8byte*)resp = cls_struct_8byte_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_8byte g_dbl = { 1, 2.0 }; + struct cls_struct_8byte f_dbl = { 4, 5.0 }; + struct cls_struct_8byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 4 5: 5 7" } */ + printf("res: %d %g\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 5 7" } */ + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 4 5: 5 7" } */ + printf("res: %d %g\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 5 7" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c new file mode 100644 index 0000000..0b85722 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Darwin/AIX do double-word + alignment of the struct if the first element is a double. + Check that it does not here. + Limitations: none. + PR: none. + Originator: 20030914 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_9byte { + int a; + double b; +} cls_struct_9byte; + +cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, + struct cls_struct_9byte b2) +{ + struct cls_struct_9byte result; + + result.a = b1.a + b2.a; + result.b = b1.b + b2.b; + + printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b, + result.a, result.b); + + return result; +} + +static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + struct cls_struct_9byte b1, b2; + + b1 = *(struct cls_struct_9byte*)(args[0]); + b2 = *(struct cls_struct_9byte*)(args[1]); + + *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_9byte h_dbl = { 7, 8.0}; + struct cls_struct_9byte j_dbl = { 1, 9.0}; + struct cls_struct_9byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &h_dbl; + args_dbl[1] = &j_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl); + /* { dg-output "7 8 1 9: 8 17" } */ + printf("res: %d %g\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 8 17" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl); + /* { dg-output "\n7 8 1 9: 8 17" } */ + printf("res: %d %g\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 8 17" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c new file mode 100644 index 0000000..edf991d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Darwin/AIX do double-word + alignment of the struct if the first element is a double. + Check that it does here. + Limitations: none. + PR: none. + Originator: 20030914 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_9byte { + double a; + int b; +} cls_struct_9byte; + +cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, + struct cls_struct_9byte b2) +{ + struct cls_struct_9byte result; + + result.a = b1.a + b2.a; + result.b = b1.b + b2.b; + + printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b, + result.a, result.b); + + return result; +} + +static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + struct cls_struct_9byte b1, b2; + + b1 = *(struct cls_struct_9byte*)(args[0]); + b2 = *(struct cls_struct_9byte*)(args[1]); + + *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_9byte h_dbl = { 7.0, 8}; + struct cls_struct_9byte j_dbl = { 1.0, 9}; + struct cls_struct_9byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_sint; + cls_struct_fields[2] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &h_dbl; + args_dbl[1] = &j_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl); + /* { dg-output "7 8 1 9: 8 17" } */ + printf("res: %g %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 8 17" } */ + + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl); + /* { dg-output "\n7 8 1 9: 8 17" } */ + printf("res: %g %d\n", res_dbl.a, res_dbl.b); + /* { dg-output "\nres: 8 17" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c new file mode 100644 index 0000000..aad5f3c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c @@ -0,0 +1,93 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of double. + Limitations: none. + PR: none. + Originator: 20031203 */ + + + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + double b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c new file mode 100644 index 0000000..37e0855 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of float. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + float b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c new file mode 100644 index 0000000..b3322d8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c @@ -0,0 +1,92 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of long double. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + long double b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_longdouble; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c new file mode 100644 index 0000000..cc1c43b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c @@ -0,0 +1,132 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of long double. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ + +#include "ffitest.h" + +typedef struct cls_struct_align { + long double a; + long double b; + long double c; + long double d; + long double e; + long double f; + long double g; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn( + cls_struct_align a1, + cls_struct_align a2) +{ + struct cls_struct_align r; + + r.a = a1.a + a2.a; + r.b = a1.b + a2.b; + r.c = a1.c + a2.c; + r.d = a1.d + a2.d; + r.e = a1.e + a2.e; + r.f = a1.f + a2.f; + r.g = a1.g + a2.g; + + printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: " + "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", + a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, + a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, + r.a, r.b, r.c, r.d, r.e, r.f, r.g); + + return r; +} + +cls_struct_align cls_struct_align_fn2( + cls_struct_align a1) +{ + struct cls_struct_align r; + + r.a = a1.a + 1; + r.b = a1.b + 1; + r.c = a1.c + 1; + r.d = a1.d + 1; + r.e = a1.e + 1; + r.f = a1.f + 1; + r.g = a1.g + 1; + + printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg: " + "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", + a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, + r.a, r.b, r.c, r.d, r.e, r.f, r.g); + + return r; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[8]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 }; + struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_longdouble; + cls_struct_fields[1] = &ffi_type_longdouble; + cls_struct_fields[2] = &ffi_type_longdouble; + cls_struct_fields[3] = &ffi_type_longdouble; + cls_struct_fields[4] = &ffi_type_longdouble; + cls_struct_fields[5] = &ffi_type_longdouble; + cls_struct_fields[6] = &ffi_type_longdouble; + cls_struct_fields[7] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */ + printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */ + printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c new file mode 100644 index 0000000..5d3bec0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c @@ -0,0 +1,115 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of long double. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/18/2007 +*/ + +/* { dg-do run { xfail strongarm*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ + +#include "ffitest.h" + +typedef struct cls_struct_align { + long double a; + long double b; + long double c; + long double d; + long double e; + double f; + long double g; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn( + cls_struct_align a1, + cls_struct_align a2) +{ + struct cls_struct_align r; + + r.a = a1.a + a2.a; + r.b = a1.b + a2.b; + r.c = a1.c + a2.c; + r.d = a1.d + a2.d; + r.e = a1.e + a2.e; + r.f = a1.f + a2.f; + r.g = a1.g + a2.g; + + printf("%Lg %Lg %Lg %Lg %Lg %g %Lg %Lg %Lg %Lg %Lg %Lg %g %Lg: " + "%Lg %Lg %Lg %Lg %Lg %g %Lg\n", + a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, + a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, + r.a, r.b, r.c, r.d, r.e, r.f, r.g); + + return r; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[8]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 }; + struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_longdouble; + cls_struct_fields[1] = &ffi_type_longdouble; + cls_struct_fields[2] = &ffi_type_longdouble; + cls_struct_fields[3] = &ffi_type_longdouble; + cls_struct_fields[4] = &ffi_type_longdouble; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_longdouble; + cls_struct_fields[7] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */ + printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */ + printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); + /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + + exit(0); +} + + + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c new file mode 100644 index 0000000..8fbf36a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c @@ -0,0 +1,95 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of pointer. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + void *b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = (void *)((uintptr_t)a1.b + (uintptr_t)a2.b); + result.c = a1.c + a2.c; + + printf("%d %" PRIuPTR " %d %d %" PRIuPTR " %d: %d %" PRIuPTR " %d\n", + a1.a, (uintptr_t)a1.b, a1.c, + a2.a, (uintptr_t)a2.b, a2.c, + result.a, (uintptr_t)result.b, + result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, (void *)4951, 127 }; + struct cls_struct_align f_dbl = { 1, (void *)9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_pointer; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c new file mode 100644 index 0000000..039b874 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint16. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + signed short b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_sshort; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c new file mode 100644 index 0000000..c96c6d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint32. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + signed int b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_sint; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c new file mode 100644 index 0000000..9aa7bdd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c @@ -0,0 +1,92 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint64. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + signed long long b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_sint64; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c new file mode 100644 index 0000000..97620b7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint16. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + unsigned short b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_ushort; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c new file mode 100644 index 0000000..5766fad --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint32. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + unsigned int b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uint; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c new file mode 100644 index 0000000..a52cb89 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c @@ -0,0 +1,93 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint64. + Limitations: none. + PR: none. + Originator: 20031203 */ + + +/* { dg-do run } */ +/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ +#include "ffitest.h" + +typedef struct cls_struct_align { + unsigned char a; + unsigned long long b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, + struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_align g_dbl = { 12, 4951, 127 }; + struct cls_struct_align f_dbl = { 1, 9320, 13 }; + struct cls_struct_align res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uint64; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &g_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); + /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); + /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ + printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); + /* { dg-output "\nres: 13 14271 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c new file mode 100644 index 0000000..e451dea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c @@ -0,0 +1,66 @@ +/* Area: ffi_call, closure_call + Purpose: Check double arguments in structs. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/23/2007 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef struct Dbls { + double x; + double y; +} Dbls; + +void +closure_test_fn(Dbls p) +{ + printf("%.1f %.1f\n", p.x, p.y); +} + +void +closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, + void** args, void* userdata __UNUSED__) +{ + closure_test_fn(*(Dbls*)args[0]); +} + +int main(int argc __UNUSED__, char** argv __UNUSED__) +{ + ffi_cif cif; + + void *code; + ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type* cl_arg_types[1]; + + ffi_type ts1_type; + ffi_type* ts1_type_elements[4]; + + Dbls arg = { 1.0, 2.0 }; + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + + ts1_type_elements[0] = &ffi_type_double; + ts1_type_elements[1] = &ffi_type_double; + ts1_type_elements[2] = NULL; + + cl_arg_types[0] = &ts1_type; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_void, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK); + + ((void*(*)(Dbls))(code))(arg); + /* { dg-output "1.0 2.0" } */ + + closure_test_fn(arg); + /* { dg-output "\n1.0 2.0" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c new file mode 100644 index 0000000..84ad4cb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c @@ -0,0 +1,43 @@ +/* Area: closure_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(double *)resp = *(double *)args[0]; + + printf("%f: %f\n",*(double *)args[0], + *(double *)resp); + } +typedef double (*cls_ret_double)(double); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + double res; + + cl_arg_types[0] = &ffi_type_double; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_double, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_double)code))(21474.789); + /* { dg-output "21474.789000: 21474.789000" } */ + printf("res: %.6f\n", res); + /* { dg-output "\nres: 21474.789000" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c new file mode 100644 index 0000000..e077f92 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c @@ -0,0 +1,61 @@ +/* Area: ffi_call, closure_call + Purpose: Test doubles passed in variable argument lists. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-output "" { xfail avr32*-*-* } } */ +/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */ + +#include "ffitest.h" + +static void +cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + char* format = *(char**)args[0]; + double doubleValue = *(double*)args[1]; + + *(ffi_arg*)resp = printf(format, doubleValue); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[3]; + ffi_type* arg_types[3]; + + char* format = "%.1f\n"; + double doubleArg = 7; + ffi_arg res = 0; + + arg_types[0] = &ffi_type_pointer; + arg_types[1] = &ffi_type_double; + arg_types[2] = NULL; + + /* This printf call is variadic */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint, + arg_types) == FFI_OK); + + args[0] = &format; + args[1] = &doubleArg; + args[2] = NULL; + + ffi_call(&cif, FFI_FN(printf), &res, args); + /* { dg-output "7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, + code) == FFI_OK); + + res = ((int(*)(char*, ...))(code))(format, doubleArg); + /* { dg-output "\n7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c new file mode 100644 index 0000000..0090fed --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c @@ -0,0 +1,42 @@ +/* Area: closure_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(float *)resp = *(float *)args[0]; + + printf("%g: %g\n",*(float *)args[0], + *(float *)resp); + } + +typedef float (*cls_ret_float)(float); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + float res; + + cl_arg_types[0] = &ffi_type_float; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_float, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_float_fn, NULL, code) == FFI_OK); + res = ((((cls_ret_float)code)(-2122.12))); + /* { dg-output "\\-2122.12: \\-2122.12" } */ + printf("res: %.6f\n", res); + /* { dg-output "\nres: \-2122.120117" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c new file mode 100644 index 0000000..d24e72e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c @@ -0,0 +1,105 @@ +/* Area: ffi_call, closure_call + Purpose: Check long double arguments. + Limitations: none. + PR: none. + Originator: Blake Chaffin */ + +/* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have + remove the xfail for arm*-*-* below, until we know more. */ +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ + +#include "ffitest.h" + +long double cls_ldouble_fn( + long double a1, + long double a2, + long double a3, + long double a4, + long double a5, + long double a6, + long double a7, + long double a8) +{ + long double r = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8; + + printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n", + a1, a2, a3, a4, a5, a6, a7, a8, r); + + return r; +} + +static void +cls_ldouble_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + long double a1 = *(long double*)args[0]; + long double a2 = *(long double*)args[1]; + long double a3 = *(long double*)args[2]; + long double a4 = *(long double*)args[3]; + long double a5 = *(long double*)args[4]; + long double a6 = *(long double*)args[5]; + long double a7 = *(long double*)args[6]; + long double a8 = *(long double*)args[7]; + + *(long double*)resp = cls_ldouble_fn( + a1, a2, a3, a4, a5, a6, a7, a8); +} + +int main(void) +{ + ffi_cif cif; + void* code; + ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[9]; + ffi_type* arg_types[9]; + long double res = 0; + + long double arg1 = 1; + long double arg2 = 2; + long double arg3 = 3; + long double arg4 = 4; + long double arg5 = 5; + long double arg6 = 6; + long double arg7 = 7; + long double arg8 = 8; + + arg_types[0] = &ffi_type_longdouble; + arg_types[1] = &ffi_type_longdouble; + arg_types[2] = &ffi_type_longdouble; + arg_types[3] = &ffi_type_longdouble; + arg_types[4] = &ffi_type_longdouble; + arg_types[5] = &ffi_type_longdouble; + arg_types[6] = &ffi_type_longdouble; + arg_types[7] = &ffi_type_longdouble; + arg_types[8] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 8, &ffi_type_longdouble, + arg_types) == FFI_OK); + + args[0] = &arg1; + args[1] = &arg2; + args[2] = &arg3; + args[3] = &arg4; + args[4] = &arg5; + args[5] = &arg6; + args[6] = &arg7; + args[7] = &arg8; + args[8] = NULL; + + ffi_call(&cif, FFI_FN(cls_ldouble_fn), &res, args); + /* { dg-output "1 2 3 4 5 6 7 8: 36" } */ + printf("res: %Lg\n", res); + /* { dg-output "\nres: 36" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK); + + res = ((long double(*)(long double, long double, long double, long double, + long double, long double, long double, long double))(code))(arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8); + /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */ + printf("res: %Lg\n", res); + /* { dg-output "\nres: 36" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c new file mode 100644 index 0000000..39b438b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c @@ -0,0 +1,61 @@ +/* Area: ffi_call, closure_call + Purpose: Test long doubles passed in variable argument lists. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-output "" { xfail avr32*-*-* x86_64-*-mingw* } } */ +/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */ + +#include "ffitest.h" + +static void +cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + char* format = *(char**)args[0]; + long double ldValue = *(long double*)args[1]; + + *(ffi_arg*)resp = printf(format, ldValue); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[3]; + ffi_type* arg_types[3]; + + char* format = "%.1Lf\n"; + long double ldArg = 7; + ffi_arg res = 0; + + arg_types[0] = &ffi_type_pointer; + arg_types[1] = &ffi_type_longdouble; + arg_types[2] = NULL; + + /* This printf call is variadic */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint, + arg_types) == FFI_OK); + + args[0] = &format; + args[1] = &ldArg; + args[2] = NULL; + + ffi_call(&cif, FFI_FN(printf), &res, args); + /* { dg-output "7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, + code) == FFI_OK); + + res = ((int(*)(char*, ...))(code))(format, ldArg); + /* { dg-output "\n7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c new file mode 100644 index 0000000..7fd6c82 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c @@ -0,0 +1,70 @@ +/* Area: closure_call + Purpose: Check closures called with many args of mixed types + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" +#include +#include + +#define NARGS 16 + +static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + int i; + double r = 0; + double t; + for(i = 0; i < NARGS; i++) + { + if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15) + { + t = *(long int *)args[i]; + CHECK(t == i+1); + } + else + { + t = *(double *)args[i]; + CHECK(fabs(t - ((i+1) * 0.1)) < FLT_EPSILON); + } + r += t; + } + *(double *)resp = r; +} +typedef double (*cls_ret_double)(double, double, double, double, long int, +double, double, double, double, long int, double, long int, double, long int, +double, long int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[NARGS]; + double res; + int i; + double expected = 64.9; + + for(i = 0; i < NARGS; i++) + { + if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15) + cl_arg_types[i] = &ffi_type_slong; + else + cl_arg_types[i] = &ffi_type_double; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NARGS, + &ffi_type_double, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK); + + res = (((cls_ret_double)code))(0.1, 0.2, 0.3, 0.4, 5, 0.6, 0.7, 0.8, 0.9, 10, + 1.1, 12, 1.3, 14, 1.5, 16); + if (fabs(res - expected) < FLT_EPSILON) + exit(0); + else + abort(); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c new file mode 100644 index 0000000..62b0697 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c @@ -0,0 +1,55 @@ +/* Area: closure_call + Purpose: Check register allocation for closure calls with many float and double arguments + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" +#include +#include + +#define NARGS 16 + +static void cls_mixed_float_double_fn(ffi_cif* cif , void* ret, void** args, + void* userdata __UNUSED__) +{ + double r = 0; + unsigned int i; + double t; + for(i=0; i < cif->nargs; i++) + { + if(cif->arg_types[i] == &ffi_type_double) { + t = *(((double**)(args))[i]); + } else { + t = *(((float**)(args))[i]); + } + r += t; + } + *((double*)ret) = r; +} +typedef double (*cls_mixed)(double, float, double, double, double, double, double, float, float, double, float, float); + +int main (void) +{ + ffi_cif cif; + ffi_closure *closure; + void* code; + ffi_type *argtypes[12] = {&ffi_type_double, &ffi_type_float, &ffi_type_double, + &ffi_type_double, &ffi_type_double, &ffi_type_double, + &ffi_type_double, &ffi_type_float, &ffi_type_float, + &ffi_type_double, &ffi_type_float, &ffi_type_float}; + + + closure = ffi_closure_alloc(sizeof(ffi_closure), (void**)&code); + if(closure ==NULL) + abort(); + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 12, &ffi_type_double, argtypes) == FFI_OK); + CHECK(ffi_prep_closure_loc(closure, &cif, cls_mixed_float_double_fn, NULL, code) == FFI_OK); + double ret = ((cls_mixed)code)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2); + ffi_closure_free(closure); + if(fabs(ret - 7.8) < FLT_EPSILON) + exit(0); + else + abort(); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c new file mode 100644 index 0000000..71df7b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c @@ -0,0 +1,74 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed char values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +signed char test_func_fn(signed char a1, signed char a2) +{ + signed char result; + + result = a1 + a2; + + printf("%d %d: %d\n", a1, a2, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + signed char a1, a2; + + a1 = *(signed char *)avals[0]; + a2 = *(signed char *)avals[1]; + + *(ffi_arg *)rval = test_func_fn(a1, a2); + +} + +typedef signed char (*test_type)(signed char, signed char); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[3]; + ffi_type * cl_arg_types[3]; + ffi_arg res_call; + signed char a, b, res_closure; + + a = 2; + b = 125; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = NULL; + + cl_arg_types[0] = &ffi_type_schar; + cl_arg_types[1] = &ffi_type_schar; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_schar, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "2 125: 127" } */ + printf("res: %d\n", (signed char)res_call); + /* { dg-output "\nres: 127" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(2, 125); + /* { dg-output "\n2 125: 127" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 127" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c new file mode 100644 index 0000000..4c39153 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c @@ -0,0 +1,74 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed short values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +signed short test_func_fn(signed short a1, signed short a2) +{ + signed short result; + + result = a1 + a2; + + printf("%d %d: %d\n", a1, a2, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + signed short a1, a2; + + a1 = *(signed short *)avals[0]; + a2 = *(signed short *)avals[1]; + + *(ffi_arg *)rval = test_func_fn(a1, a2); + +} + +typedef signed short (*test_type)(signed short, signed short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[3]; + ffi_type * cl_arg_types[3]; + ffi_arg res_call; + unsigned short a, b, res_closure; + + a = 2; + b = 32765; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = NULL; + + cl_arg_types[0] = &ffi_type_sshort; + cl_arg_types[1] = &ffi_type_sshort; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_sshort, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "2 32765: 32767" } */ + printf("res: %d\n", (unsigned short)res_call); + /* { dg-output "\nres: 32767" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(2, 32765); + /* { dg-output "\n2 32765: 32767" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 32767" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c new file mode 100644 index 0000000..1c3aeb5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c @@ -0,0 +1,86 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed short/char values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +signed short test_func_fn(signed char a1, signed short a2, + signed char a3, signed short a4) +{ + signed short result; + + result = a1 + a2 + a3 + a4; + + printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + signed char a1, a3; + signed short a2, a4; + + a1 = *(signed char *)avals[0]; + a2 = *(signed short *)avals[1]; + a3 = *(signed char *)avals[2]; + a4 = *(signed short *)avals[3]; + + *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); + +} + +typedef signed short (*test_type)(signed char, signed short, + signed char, signed short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[5]; + ffi_type * cl_arg_types[5]; + ffi_arg res_call; + signed char a, c; + signed short b, d, res_closure; + + a = 1; + b = 32765; + c = 127; + d = -128; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = &c; + args_dbl[3] = &d; + args_dbl[4] = NULL; + + cl_arg_types[0] = &ffi_type_schar; + cl_arg_types[1] = &ffi_type_sshort; + cl_arg_types[2] = &ffi_type_schar; + cl_arg_types[3] = &ffi_type_sshort; + cl_arg_types[4] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_sshort, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "1 32765 127 -128: 32765" } */ + printf("res: %d\n", (signed short)res_call); + /* { dg-output "\nres: 32765" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(1, 32765, 127, -128); + /* { dg-output "\n1 32765 127 -128: 32765" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 32765" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c new file mode 100644 index 0000000..009c02c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c @@ -0,0 +1,91 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned char values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +unsigned char test_func_fn(unsigned char a1, unsigned char a2, + unsigned char a3, unsigned char a4) +{ + unsigned char result; + + result = a1 + a2 + a3 + a4; + + printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + unsigned char a1, a2, a3, a4; + + a1 = *(unsigned char *)avals[0]; + a2 = *(unsigned char *)avals[1]; + a3 = *(unsigned char *)avals[2]; + a4 = *(unsigned char *)avals[3]; + + *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); + +} + +typedef unsigned char (*test_type)(unsigned char, unsigned char, + unsigned char, unsigned char); + +void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals, + void *data __UNUSED__) +{ + printf("%d %d %d %d\n", *(unsigned char *)avals[0], + *(unsigned char *)avals[1], *(unsigned char *)avals[2], + *(unsigned char *)avals[3]); +} +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[5]; + ffi_type * cl_arg_types[5]; + ffi_arg res_call; + unsigned char a, b, c, d, res_closure; + + a = 1; + b = 2; + c = 127; + d = 125; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = &c; + args_dbl[3] = &d; + args_dbl[4] = NULL; + + cl_arg_types[0] = &ffi_type_uchar; + cl_arg_types[1] = &ffi_type_uchar; + cl_arg_types[2] = &ffi_type_uchar; + cl_arg_types[3] = &ffi_type_uchar; + cl_arg_types[4] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_uchar, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "1 2 127 125: 255" } */ + printf("res: %d\n", (unsigned char)res_call); + /* { dg-output "\nres: 255" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(1, 2, 127, 125); + /* { dg-output "\n1 2 127 125: 255" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 255" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c new file mode 100644 index 0000000..dd10ca7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c @@ -0,0 +1,74 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned short values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +unsigned short test_func_fn(unsigned short a1, unsigned short a2) +{ + unsigned short result; + + result = a1 + a2; + + printf("%d %d: %d\n", a1, a2, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + unsigned short a1, a2; + + a1 = *(unsigned short *)avals[0]; + a2 = *(unsigned short *)avals[1]; + + *(ffi_arg *)rval = test_func_fn(a1, a2); + +} + +typedef unsigned short (*test_type)(unsigned short, unsigned short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[3]; + ffi_type * cl_arg_types[3]; + ffi_arg res_call; + unsigned short a, b, res_closure; + + a = 2; + b = 32765; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = NULL; + + cl_arg_types[0] = &ffi_type_ushort; + cl_arg_types[1] = &ffi_type_ushort; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_ushort, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "2 32765: 32767" } */ + printf("res: %d\n", (unsigned short)res_call); + /* { dg-output "\nres: 32767" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(2, 32765); + /* { dg-output "\n2 32765: 32767" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 32767" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c new file mode 100644 index 0000000..2588e97 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c @@ -0,0 +1,86 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned short/char values. + Limitations: none. + PR: PR13221. + Originator: 20031129 */ + +/* { dg-do run } */ +#include "ffitest.h" + +unsigned short test_func_fn(unsigned char a1, unsigned short a2, + unsigned char a3, unsigned short a4) +{ + unsigned short result; + + result = a1 + a2 + a3 + a4; + + printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + + return result; + +} + +static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, + void *data __UNUSED__) +{ + unsigned char a1, a3; + unsigned short a2, a4; + + a1 = *(unsigned char *)avals[0]; + a2 = *(unsigned short *)avals[1]; + a3 = *(unsigned char *)avals[2]; + a4 = *(unsigned short *)avals[3]; + + *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); + +} + +typedef unsigned short (*test_type)(unsigned char, unsigned short, + unsigned char, unsigned short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void * args_dbl[5]; + ffi_type * cl_arg_types[5]; + ffi_arg res_call; + unsigned char a, c; + unsigned short b, d, res_closure; + + a = 1; + b = 2; + c = 127; + d = 128; + + args_dbl[0] = &a; + args_dbl[1] = &b; + args_dbl[2] = &c; + args_dbl[3] = &d; + args_dbl[4] = NULL; + + cl_arg_types[0] = &ffi_type_uchar; + cl_arg_types[1] = &ffi_type_ushort; + cl_arg_types[2] = &ffi_type_uchar; + cl_arg_types[3] = &ffi_type_ushort; + cl_arg_types[4] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &ffi_type_ushort, cl_arg_types) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); + /* { dg-output "1 2 127 128: 258" } */ + printf("res: %d\n", (unsigned short)res_call); + /* { dg-output "\nres: 258" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); + + res_closure = (*((test_type)code))(1, 2, 127, 128); + /* { dg-output "\n1 2 127 128: 258" } */ + printf("res: %d\n", res_closure); + /* { dg-output "\nres: 258" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c new file mode 100644 index 0000000..d82a87a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c @@ -0,0 +1,74 @@ +/* Area: ffi_call, closure_call + Purpose: Check pointer arguments. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +#include "ffitest.h" + +void* cls_pointer_fn(void* a1, void* a2) +{ + void* result = (void*)((intptr_t)a1 + (intptr_t)a2); + + printf("0x%08x 0x%08x: 0x%08x\n", + (unsigned int)(uintptr_t) a1, + (unsigned int)(uintptr_t) a2, + (unsigned int)(uintptr_t) result); + + return result; +} + +static void +cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + void* a1 = *(void**)(args[0]); + void* a2 = *(void**)(args[1]); + + *(void**)resp = cls_pointer_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[3]; + /* ffi_type cls_pointer_type; */ + ffi_type* arg_types[3]; + +/* cls_pointer_type.size = sizeof(void*); + cls_pointer_type.alignment = 0; + cls_pointer_type.type = FFI_TYPE_POINTER; + cls_pointer_type.elements = NULL;*/ + + void* arg1 = (void*)0x12345678; + void* arg2 = (void*)0x89abcdef; + ffi_arg res = 0; + + arg_types[0] = &ffi_type_pointer; + arg_types[1] = &ffi_type_pointer; + arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer, + arg_types) == FFI_OK); + + args[0] = &arg1; + args[1] = &arg2; + args[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_pointer_fn), &res, args); + /* { dg-output "0x12345678 0x89abcdef: 0x9be02467" } */ + printf("res: 0x%08x\n", (unsigned int) res); + /* { dg-output "\nres: 0x9be02467" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK); + + res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2); + /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */ + printf("res: 0x%08x\n", (unsigned int) res); + /* { dg-output "\nres: 0x9be02467" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c new file mode 100644 index 0000000..1f1d915 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c @@ -0,0 +1,142 @@ +/* Area: ffi_call, closure_call + Purpose: Check pointer arguments across multiple hideous stack frames. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/7/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +#include "ffitest.h" + +static long dummyVar; + +long dummy_func( + long double a1, char b1, + long double a2, char b2, + long double a3, char b3, + long double a4, char b4) +{ + return a1 + b1 + a2 + b2 + a3 + b3 + a4 + b4; +} + +void* cls_pointer_fn2(void* a1, void* a2) +{ + long double trample1 = (intptr_t)a1 + (intptr_t)a2; + char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0]; + long double trample3 = (intptr_t)trample1 + (intptr_t)a1; + char trample4 = trample2 + ((char*)&a1)[1]; + long double trample5 = (intptr_t)trample3 + (intptr_t)a2; + char trample6 = trample4 + ((char*)&a2)[1]; + long double trample7 = (intptr_t)trample5 + (intptr_t)trample1; + char trample8 = trample6 + trample2; + void* result; + + dummyVar = dummy_func(trample1, trample2, trample3, trample4, + trample5, trample6, trample7, trample8); + + result = (void*)((intptr_t)a1 + (intptr_t)a2); + + printf("0x%08x 0x%08x: 0x%08x\n", + (unsigned int)(uintptr_t) a1, + (unsigned int)(uintptr_t) a2, + (unsigned int)(uintptr_t) result); + + return result; +} + +void* cls_pointer_fn1(void* a1, void* a2) +{ + long double trample1 = (intptr_t)a1 + (intptr_t)a2; + char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0]; + long double trample3 = (intptr_t)trample1 + (intptr_t)a1; + char trample4 = trample2 + ((char*)&a1)[1]; + long double trample5 = (intptr_t)trample3 + (intptr_t)a2; + char trample6 = trample4 + ((char*)&a2)[1]; + long double trample7 = (intptr_t)trample5 + (intptr_t)trample1; + char trample8 = trample6 + trample2; + void* result; + + dummyVar = dummy_func(trample1, trample2, trample3, trample4, + trample5, trample6, trample7, trample8); + + result = (void*)((intptr_t)a1 + (intptr_t)a2); + + printf("0x%08x 0x%08x: 0x%08x\n", + (unsigned int)(intptr_t) a1, + (unsigned int)(intptr_t) a2, + (unsigned int)(intptr_t) result); + + result = cls_pointer_fn2(result, a1); + + return result; +} + +static void +cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + void* a1 = *(void**)(args[0]); + void* a2 = *(void**)(args[1]); + + long double trample1 = (intptr_t)a1 + (intptr_t)a2; + char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0]; + long double trample3 = (intptr_t)trample1 + (intptr_t)a1; + char trample4 = trample2 + ((char*)&a1)[1]; + long double trample5 = (intptr_t)trample3 + (intptr_t)a2; + char trample6 = trample4 + ((char*)&a2)[1]; + long double trample7 = (intptr_t)trample5 + (intptr_t)trample1; + char trample8 = trample6 + trample2; + + dummyVar = dummy_func(trample1, trample2, trample3, trample4, + trample5, trample6, trample7, trample8); + + *(void**)resp = cls_pointer_fn1(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[3]; + /* ffi_type cls_pointer_type; */ + ffi_type* arg_types[3]; + +/* cls_pointer_type.size = sizeof(void*); + cls_pointer_type.alignment = 0; + cls_pointer_type.type = FFI_TYPE_POINTER; + cls_pointer_type.elements = NULL;*/ + + void* arg1 = (void*)0x01234567; + void* arg2 = (void*)0x89abcdef; + ffi_arg res = 0; + + arg_types[0] = &ffi_type_pointer; + arg_types[1] = &ffi_type_pointer; + arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer, + arg_types) == FFI_OK); + + args[0] = &arg1; + args[1] = &arg2; + args[2] = NULL; + + printf("\n"); + ffi_call(&cif, FFI_FN(cls_pointer_fn1), &res, args); + + printf("res: 0x%08x\n", (unsigned int) res); + /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */ + /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */ + /* { dg-output "\nres: 0x8bf258bd" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK); + + res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2); + + printf("res: 0x%08x\n", (unsigned int) res); + /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */ + /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */ + /* { dg-output "\nres: 0x8bf258bd" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c new file mode 100644 index 0000000..82986b1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c @@ -0,0 +1,44 @@ +/* Area: closure_call + Purpose: Check return value schar. + Limitations: none. + PR: none. + Originator: 20031108 */ + + + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(signed char *)args[0]; + printf("%d: %d\n",*(signed char *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef signed char (*cls_ret_schar)(signed char); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + signed char res; + + cl_arg_types[0] = &ffi_type_schar; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_schar, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_schar_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_schar)code))(127); + /* { dg-output "127: 127" } */ + printf("res: %d\n", res); + /* { dg-output "\nres: 127" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c new file mode 100644 index 0000000..c7e13b7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c @@ -0,0 +1,42 @@ +/* Area: closure_call + Purpose: Check return value sint32. + Limitations: none. + PR: none. + Originator: 20031108 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(signed int *)args[0]; + printf("%d: %d\n",*(signed int *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef signed int (*cls_ret_sint)(signed int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + signed int res; + + cl_arg_types[0] = &ffi_type_sint; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sint_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_sint)code))(65534); + /* { dg-output "65534: 65534" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 65534" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c new file mode 100644 index 0000000..846d57e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c @@ -0,0 +1,42 @@ +/* Area: closure_call + Purpose: Check return value sshort. + Limitations: none. + PR: none. + Originator: 20031108 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(signed short *)args[0]; + printf("%d: %d\n",*(signed short *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef signed short (*cls_ret_sshort)(signed short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + signed short res; + + cl_arg_types[0] = &ffi_type_sshort; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sshort, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sshort_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_sshort)code))(255); + /* { dg-output "255: 255" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 255" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c new file mode 100644 index 0000000..6d1fdae --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c @@ -0,0 +1,114 @@ +/* Area: ffi_call, closure_call + Purpose: Test doubles passed in variable argument lists. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* } } */ +#include "ffitest.h" + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + +static void +test_fn (ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + int n = *(int*)args[0]; + struct small_tag s1 = * (struct small_tag *) args[1]; + struct large_tag l1 = * (struct large_tag *) args[2]; + struct small_tag s2 = * (struct small_tag *) args[3]; + + printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b, + l1.a, l1.b, l1.c, l1.d, l1.e, + s2.a, s2.b); + * (ffi_arg*) resp = 42; +} + +int +main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc (sizeof (ffi_closure), &code); + ffi_type* arg_types[5]; + + ffi_arg res = 0; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int si; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint, + arg_types) == FFI_OK); + + si = 4; + s1.a = 5; + s1.b = 6; + + s2.a = 20; + s2.b = 21; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + CHECK(ffi_prep_closure_loc(pcl, &cif, test_fn, NULL, code) == FFI_OK); + + res = ((int (*)(int, ...))(code))(si, s1, l1, s2); + /* { dg-output "4 5 6 10 11 12 13 14 20 21" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 42" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c new file mode 100644 index 0000000..c1317e7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c @@ -0,0 +1,42 @@ +/* Area: closure_call + Purpose: Check return value uchar. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(unsigned char *)args[0]; + printf("%d: %d\n",*(unsigned char *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef unsigned char (*cls_ret_uchar)(unsigned char); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + unsigned char res; + + cl_arg_types[0] = &ffi_type_uchar; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uchar, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uchar_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_uchar)code))(127); + /* { dg-output "127: 127" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 127" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c new file mode 100644 index 0000000..6491c5b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c @@ -0,0 +1,44 @@ +/* Area: closure_call + Purpose: Test anonymous unsigned char argument. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef unsigned char T; + +static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(ffi_arg *)resp = *(T *)args[0]; + + printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]); + } + +typedef T (*cls_ret_T)(T, ...); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[3]; + T res; + + cl_arg_types[0] = &ffi_type_uchar; + cl_arg_types[1] = &ffi_type_uchar; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, + &ffi_type_uchar, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); + res = ((((cls_ret_T)code)(67, 4))); + /* { dg-output "67: 67 4" } */ + printf("res: %d\n", res); + /* { dg-output "\nres: 67" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c new file mode 100644 index 0000000..885cff5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c @@ -0,0 +1,43 @@ +/* Area: closure_call + Purpose: Check return value uint. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg *)resp = *(unsigned int *)args[0]; + + printf("%d: %d\n",*(unsigned int *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef unsigned int (*cls_ret_uint)(unsigned int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + unsigned int res; + + cl_arg_types[0] = &ffi_type_uint; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_uint)code))(2147483647); + /* { dg-output "2147483647: 2147483647" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 2147483647" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c new file mode 100644 index 0000000..b04cfd1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c @@ -0,0 +1,45 @@ +/* Area: closure_call + Purpose: Test anonymous unsigned int argument. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef unsigned int T; + +static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(ffi_arg *)resp = *(T *)args[0]; + + printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]); + } + +typedef T (*cls_ret_T)(T, ...); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[3]; + T res; + + cl_arg_types[0] = &ffi_type_uint; + cl_arg_types[1] = &ffi_type_uint; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, + &ffi_type_uint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); + res = ((((cls_ret_T)code)(67, 4))); + /* { dg-output "67: 67 4" } */ + printf("res: %d\n", res); + /* { dg-output "\nres: 67" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c new file mode 100644 index 0000000..0315082 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c @@ -0,0 +1,45 @@ +/* Area: closure_call + Purpose: Test anonymous unsigned long argument. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ + +#include "ffitest.h" + +typedef unsigned long T; + +static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(T *)resp = *(T *)args[0]; + + printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]); + } + +typedef T (*cls_ret_T)(T, ...); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[3]; + T res; + + cl_arg_types[0] = &ffi_type_ulong; + cl_arg_types[1] = &ffi_type_ulong; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, + &ffi_type_ulong, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); + res = ((((cls_ret_T)code)(67, 4))); + /* { dg-output "67: 67 4" } */ + printf("res: %ld\n", res); + /* { dg-output "\nres: 67" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c new file mode 100644 index 0000000..62f2cae --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c @@ -0,0 +1,47 @@ +/* Area: closure_call + Purpose: Check return value long long. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ +#include "ffitest.h" + +static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + *(unsigned long long *)resp= 0xfffffffffffffffLL ^ *(unsigned long long *)args[0]; + + printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0], + *(unsigned long long *)(resp)); +} +typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + unsigned long long res; + + cl_arg_types[0] = &ffi_type_uint64; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uint64, cl_arg_types) == FFI_OK); + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK); + res = (*((cls_ret_ulonglong)code))(214LL); + /* { dg-output "214: 1152921504606846761" } */ + printf("res: %" PRIdLL "\n", res); + /* { dg-output "\nres: 1152921504606846761" } */ + + res = (*((cls_ret_ulonglong)code))(9223372035854775808LL); + /* { dg-output "\n9223372035854775808: 8070450533247928831" } */ + printf("res: %" PRIdLL "\n", res); + /* { dg-output "\nres: 8070450533247928831" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c new file mode 100644 index 0000000..a00100e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c @@ -0,0 +1,43 @@ +/* Area: closure_call + Purpose: Check return value ushort. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(unsigned short *)args[0]; + + printf("%d: %d\n",*(unsigned short *)args[0], + (int)*(ffi_arg *)(resp)); +} +typedef unsigned short (*cls_ret_ushort)(unsigned short); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + unsigned short res; + + cl_arg_types[0] = &ffi_type_ushort; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_ushort, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_ushort)code))(65535); + /* { dg-output "65535: 65535" } */ + printf("res: %d\n",res); + /* { dg-output "\nres: 65535" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c new file mode 100644 index 0000000..37aa106 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c @@ -0,0 +1,44 @@ +/* Area: closure_call + Purpose: Test anonymous unsigned short argument. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef unsigned short T; + +static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + *(ffi_arg *)resp = *(T *)args[0]; + + printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]); + } + +typedef T (*cls_ret_T)(T, ...); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[3]; + T res; + + cl_arg_types[0] = &ffi_type_ushort; + cl_arg_types[1] = &ffi_type_ushort; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, + &ffi_type_ushort, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); + res = ((((cls_ret_T)code)(67, 4))); + /* { dg-output "67: 67 4" } */ + printf("res: %d\n", res); + /* { dg-output "\nres: 67" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c new file mode 100644 index 0000000..f5a7317 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c @@ -0,0 +1,36 @@ +/* Area: ffi_prep_cif, ffi_prep_closure + Purpose: Test error return for bad ABIs. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/6/2007 */ + +/* { dg-do run } */ + +#include "ffitest.h" + +static void +dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, + void** args __UNUSED__, void* userdata __UNUSED__) +{} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type* arg_types[1]; + + arg_types[0] = NULL; + + CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void, + arg_types) == FFI_BAD_ABI); + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void, + arg_types) == FFI_OK); + + cif.abi= 255; + + CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h new file mode 100644 index 0000000..cfce1ad --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h @@ -0,0 +1,138 @@ +#include +#include +#include +#include +#include +#include "fficonfig.h" + +#if defined HAVE_STDINT_H +#include +#endif + +#if defined HAVE_INTTYPES_H +#include +#endif + +#define MAX_ARGS 256 + +#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0) + +/* Define macros so that compilers other than gcc can run the tests. */ +#undef __UNUSED__ +#if defined(__GNUC__) +#define __UNUSED__ __attribute__((__unused__)) +#define __STDCALL__ __attribute__((stdcall)) +#define __THISCALL__ __attribute__((thiscall)) +#define __FASTCALL__ __attribute__((fastcall)) +#define __MSABI__ __attribute__((ms_abi)) +#else +#define __UNUSED__ +#define __STDCALL__ __stdcall +#define __THISCALL__ __thiscall +#define __FASTCALL__ __fastcall +#endif + +#ifndef ABI_NUM +#define ABI_NUM FFI_DEFAULT_ABI +#define ABI_ATTR +#endif + +/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a + file open. */ +#ifdef HAVE_MMAP_ANON +# undef HAVE_MMAP_DEV_ZERO + +# include +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +# endif +# define USING_MMAP + +#endif + +#ifdef HAVE_MMAP_DEV_ZERO + +# include +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# define USING_MMAP + +#endif + +/* MinGW kludge. */ +#if defined(_WIN64) | defined(_WIN32) +#define PRIdLL "I64d" +#define PRIuLL "I64u" +#else +#define PRIdLL "lld" +#define PRIuLL "llu" +#endif + +/* Tru64 UNIX kludge. */ +#if defined(__alpha__) && defined(__osf__) +/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */ +#undef PRIdLL +#define PRIdLL "ld" +#undef PRIuLL +#define PRIuLL "lu" +#define PRId8 "hd" +#define PRIu8 "hu" +#define PRId64 "ld" +#define PRIu64 "lu" +#define PRIuPTR "lu" +#endif + +/* PA HP-UX kludge. */ +#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR) +#define PRIuPTR "lu" +#endif + +/* IRIX kludge. */ +#if defined(__sgi) +/* IRIX 6.5 provides all definitions, but only for C99 + compilations. */ +#define PRId8 "hhd" +#define PRIu8 "hhu" +#if (_MIPS_SZLONG == 32) +#define PRId64 "lld" +#define PRIu64 "llu" +#endif +/* This doesn't match , which always has "lld" here, but the + arguments are uint64_t, int64_t, which are unsigned long, long for + 64-bit in . */ +#if (_MIPS_SZLONG == 64) +#define PRId64 "ld" +#define PRIu64 "lu" +#endif +/* This doesn't match , which has "u" here, but the arguments + are uintptr_t, which is always unsigned long. */ +#define PRIuPTR "lu" +#endif + +/* Solaris < 10 kludge. */ +#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR) +#if defined(__arch64__) || defined (__x86_64__) +#define PRIuPTR "lu" +#else +#define PRIuPTR "u" +#endif +#endif + +/* MSVC kludge. */ +#if defined _MSC_VER +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) +#define PRIuPTR "lu" +#define PRIu8 "u" +#define PRId8 "d" +#define PRIu64 "I64u" +#define PRId64 "I64d" +#endif +#endif + +#ifndef PRIuPTR +#define PRIuPTR "u" +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c new file mode 100644 index 0000000..e8e1d86 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c @@ -0,0 +1,343 @@ +/* Area: ffi_call, closure_call + Purpose: Check large structure returns. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/18/2007 +*/ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +/* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */ + +#include + +#include "ffitest.h" + +typedef struct BigStruct{ + uint8_t a; + int8_t b; + uint16_t c; + int16_t d; + uint32_t e; + int32_t f; + uint64_t g; + int64_t h; + float i; + double j; + long double k; + char* l; + uint8_t m; + int8_t n; + uint16_t o; + int16_t p; + uint32_t q; + int32_t r; + uint64_t s; + int64_t t; + float u; + double v; + long double w; + char* x; + uint8_t y; + int8_t z; + uint16_t aa; + int16_t bb; + uint32_t cc; + int32_t dd; + uint64_t ee; + int64_t ff; + float gg; + double hh; + long double ii; + char* jj; + uint8_t kk; + int8_t ll; + uint16_t mm; + int16_t nn; + uint32_t oo; + int32_t pp; + uint64_t qq; + int64_t rr; + float ss; + double tt; + long double uu; + char* vv; + uint8_t ww; + int8_t xx; +} BigStruct; + +BigStruct +test_large_fn( + uint8_t ui8_1, + int8_t si8_1, + uint16_t ui16_1, + int16_t si16_1, + uint32_t ui32_1, + int32_t si32_1, + uint64_t ui64_1, + int64_t si64_1, + float f_1, + double d_1, + long double ld_1, + char* p_1, + uint8_t ui8_2, + int8_t si8_2, + uint16_t ui16_2, + int16_t si16_2, + uint32_t ui32_2, + int32_t si32_2, + uint64_t ui64_2, + int64_t si64_2, + float f_2, + double d_2, + long double ld_2, + char* p_2, + uint8_t ui8_3, + int8_t si8_3, + uint16_t ui16_3, + int16_t si16_3, + uint32_t ui32_3, + int32_t si32_3, + uint64_t ui64_3, + int64_t si64_3, + float f_3, + double d_3, + long double ld_3, + char* p_3, + uint8_t ui8_4, + int8_t si8_4, + uint16_t ui16_4, + int16_t si16_4, + uint32_t ui32_4, + int32_t si32_4, + uint64_t ui64_4, + int64_t si64_4, + float f_4, + double d_4, + long double ld_4, + char* p_4, + uint8_t ui8_5, + int8_t si8_5) +{ + BigStruct retVal = { + ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1, + ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1), + ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2, + ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2), + ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3, + ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3), + ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4, + ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4), + ui8_5 + 5, si8_5 + 5}; + + printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 ": " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", + ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (unsigned long)p_1, + ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (unsigned long)p_2, + ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (unsigned long)p_3, + ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (unsigned long)p_4, ui8_5, si8_5, + retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + + return retVal; +} + +static void +cls_large_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) +{ + uint8_t ui8_1 = *(uint8_t*)args[0]; + int8_t si8_1 = *(int8_t*)args[1]; + uint16_t ui16_1 = *(uint16_t*)args[2]; + int16_t si16_1 = *(int16_t*)args[3]; + uint32_t ui32_1 = *(uint32_t*)args[4]; + int32_t si32_1 = *(int32_t*)args[5]; + uint64_t ui64_1 = *(uint64_t*)args[6]; + int64_t si64_1 = *(int64_t*)args[7]; + float f_1 = *(float*)args[8]; + double d_1 = *(double*)args[9]; + long double ld_1 = *(long double*)args[10]; + char* p_1 = *(char**)args[11]; + uint8_t ui8_2 = *(uint8_t*)args[12]; + int8_t si8_2 = *(int8_t*)args[13]; + uint16_t ui16_2 = *(uint16_t*)args[14]; + int16_t si16_2 = *(int16_t*)args[15]; + uint32_t ui32_2 = *(uint32_t*)args[16]; + int32_t si32_2 = *(int32_t*)args[17]; + uint64_t ui64_2 = *(uint64_t*)args[18]; + int64_t si64_2 = *(int64_t*)args[19]; + float f_2 = *(float*)args[20]; + double d_2 = *(double*)args[21]; + long double ld_2 = *(long double*)args[22]; + char* p_2 = *(char**)args[23]; + uint8_t ui8_3 = *(uint8_t*)args[24]; + int8_t si8_3 = *(int8_t*)args[25]; + uint16_t ui16_3 = *(uint16_t*)args[26]; + int16_t si16_3 = *(int16_t*)args[27]; + uint32_t ui32_3 = *(uint32_t*)args[28]; + int32_t si32_3 = *(int32_t*)args[29]; + uint64_t ui64_3 = *(uint64_t*)args[30]; + int64_t si64_3 = *(int64_t*)args[31]; + float f_3 = *(float*)args[32]; + double d_3 = *(double*)args[33]; + long double ld_3 = *(long double*)args[34]; + char* p_3 = *(char**)args[35]; + uint8_t ui8_4 = *(uint8_t*)args[36]; + int8_t si8_4 = *(int8_t*)args[37]; + uint16_t ui16_4 = *(uint16_t*)args[38]; + int16_t si16_4 = *(int16_t*)args[39]; + uint32_t ui32_4 = *(uint32_t*)args[40]; + int32_t si32_4 = *(int32_t*)args[41]; + uint64_t ui64_4 = *(uint64_t*)args[42]; + int64_t si64_4 = *(int64_t*)args[43]; + float f_4 = *(float*)args[44]; + double d_4 = *(double*)args[45]; + long double ld_4 = *(long double*)args[46]; + char* p_4 = *(char**)args[47]; + uint8_t ui8_5 = *(uint8_t*)args[48]; + int8_t si8_5 = *(int8_t*)args[49]; + + *(BigStruct*)resp = test_large_fn( + ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1, + ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2, + ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3, + ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, p_4, + ui8_5, si8_5); +} + +int +main(int argc __UNUSED__, const char** argv __UNUSED__) +{ + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + + ffi_cif cif; + ffi_type* argTypes[51]; + void* argValues[51]; + + ffi_type ret_struct_type; + ffi_type* st_fields[51]; + BigStruct retVal; + + uint8_t ui8 = 1; + int8_t si8 = 2; + uint16_t ui16 = 3; + int16_t si16 = 4; + uint32_t ui32 = 5; + int32_t si32 = 6; + uint64_t ui64 = 7; + int64_t si64 = 8; + float f = 9; + double d = 10; + long double ld = 11; + char* p = (char*)0x12345678; + + memset (&retVal, 0, sizeof(retVal)); + + ret_struct_type.size = 0; + ret_struct_type.alignment = 0; + ret_struct_type.type = FFI_TYPE_STRUCT; + ret_struct_type.elements = st_fields; + + st_fields[0] = st_fields[12] = st_fields[24] = st_fields[36] = st_fields[48] = &ffi_type_uint8; + st_fields[1] = st_fields[13] = st_fields[25] = st_fields[37] = st_fields[49] = &ffi_type_sint8; + st_fields[2] = st_fields[14] = st_fields[26] = st_fields[38] = &ffi_type_uint16; + st_fields[3] = st_fields[15] = st_fields[27] = st_fields[39] = &ffi_type_sint16; + st_fields[4] = st_fields[16] = st_fields[28] = st_fields[40] = &ffi_type_uint32; + st_fields[5] = st_fields[17] = st_fields[29] = st_fields[41] = &ffi_type_sint32; + st_fields[6] = st_fields[18] = st_fields[30] = st_fields[42] = &ffi_type_uint64; + st_fields[7] = st_fields[19] = st_fields[31] = st_fields[43] = &ffi_type_sint64; + st_fields[8] = st_fields[20] = st_fields[32] = st_fields[44] = &ffi_type_float; + st_fields[9] = st_fields[21] = st_fields[33] = st_fields[45] = &ffi_type_double; + st_fields[10] = st_fields[22] = st_fields[34] = st_fields[46] = &ffi_type_longdouble; + st_fields[11] = st_fields[23] = st_fields[35] = st_fields[47] = &ffi_type_pointer; + + st_fields[50] = NULL; + + argTypes[0] = argTypes[12] = argTypes[24] = argTypes[36] = argTypes[48] = &ffi_type_uint8; + argValues[0] = argValues[12] = argValues[24] = argValues[36] = argValues[48] = &ui8; + argTypes[1] = argTypes[13] = argTypes[25] = argTypes[37] = argTypes[49] = &ffi_type_sint8; + argValues[1] = argValues[13] = argValues[25] = argValues[37] = argValues[49] = &si8; + argTypes[2] = argTypes[14] = argTypes[26] = argTypes[38] = &ffi_type_uint16; + argValues[2] = argValues[14] = argValues[26] = argValues[38] = &ui16; + argTypes[3] = argTypes[15] = argTypes[27] = argTypes[39] = &ffi_type_sint16; + argValues[3] = argValues[15] = argValues[27] = argValues[39] = &si16; + argTypes[4] = argTypes[16] = argTypes[28] = argTypes[40] = &ffi_type_uint32; + argValues[4] = argValues[16] = argValues[28] = argValues[40] = &ui32; + argTypes[5] = argTypes[17] = argTypes[29] = argTypes[41] = &ffi_type_sint32; + argValues[5] = argValues[17] = argValues[29] = argValues[41] = &si32; + argTypes[6] = argTypes[18] = argTypes[30] = argTypes[42] = &ffi_type_uint64; + argValues[6] = argValues[18] = argValues[30] = argValues[42] = &ui64; + argTypes[7] = argTypes[19] = argTypes[31] = argTypes[43] = &ffi_type_sint64; + argValues[7] = argValues[19] = argValues[31] = argValues[43] = &si64; + argTypes[8] = argTypes[20] = argTypes[32] = argTypes[44] = &ffi_type_float; + argValues[8] = argValues[20] = argValues[32] = argValues[44] = &f; + argTypes[9] = argTypes[21] = argTypes[33] = argTypes[45] = &ffi_type_double; + argValues[9] = argValues[21] = argValues[33] = argValues[45] = &d; + argTypes[10] = argTypes[22] = argTypes[34] = argTypes[46] = &ffi_type_longdouble; + argValues[10] = argValues[22] = argValues[34] = argValues[46] = &ld; + argTypes[11] = argTypes[23] = argTypes[35] = argTypes[47] = &ffi_type_pointer; + argValues[11] = argValues[23] = argValues[35] = argValues[47] = &p; + + argTypes[50] = NULL; + argValues[50] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK); + + ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues); + /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ + printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", + retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK); + + retVal = ((BigStruct(*)( + uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*, + uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*, + uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*, + uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*, + uint8_t, int8_t))(code))( + ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p, + ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p, + ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p, + ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p, + ui8, si8); + /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ + printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " + "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", + retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c new file mode 100644 index 0000000..c15e3a0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c @@ -0,0 +1,152 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_16byte1 { + double a; + float b; + int c; +} cls_struct_16byte1; + +typedef struct cls_struct_16byte2 { + int ii; + double dd; + float ff; +} cls_struct_16byte2; + +typedef struct cls_struct_combined { + cls_struct_16byte1 d; + cls_struct_16byte2 e; +} cls_struct_combined; + +cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, + struct cls_struct_16byte2 b1, + struct cls_struct_combined b2) +{ + struct cls_struct_combined result; + + result.d.a = b0.a + b1.dd + b2.d.a; + result.d.b = b0.b + b1.ff + b2.d.b; + result.d.c = b0.c + b1.ii + b2.d.c; + result.e.ii = b0.c + b1.ii + b2.e.ii; + result.e.dd = b0.a + b1.dd + b2.e.dd; + result.e.ff = b0.b + b1.ff + b2.e.ff; + + printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n", + b0.a, b0.b, b0.c, + b1.ii, b1.dd, b1.ff, + b2.d.a, b2.d.b, b2.d.c, + b2.e.ii, b2.e.dd, b2.e.ff, + result.d.a, result.d.b, result.d.c, + result.e.ii, result.e.dd, result.e.ff); + + return result; +} + +static void +cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_16byte1 b0; + struct cls_struct_16byte2 b1; + struct cls_struct_combined b2; + + b0 = *(struct cls_struct_16byte1*)(args[0]); + b1 = *(struct cls_struct_16byte2*)(args[1]); + b2 = *(struct cls_struct_combined*)(args[2]); + + + *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type* cls_struct_fields1[5]; + ffi_type* cls_struct_fields2[5]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6}; + struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0}; + struct cls_struct_combined g_dbl = {{4.0, 5.0, 6}, + {3, 1.0, 8.0}}; + struct cls_struct_combined res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = NULL; + + cls_struct_fields1[0] = &ffi_type_sint; + cls_struct_fields1[1] = &ffi_type_double; + cls_struct_fields1[2] = &ffi_type_float; + cls_struct_fields1[3] = NULL; + + cls_struct_fields2[0] = &cls_struct_type; + cls_struct_fields2[1] = &cls_struct_type1; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl); + /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ + CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); + CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); + CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1, + cls_struct_16byte2, + cls_struct_combined)) + (code))(e_dbl, f_dbl, g_dbl); + /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ + CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); + CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); + CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c new file mode 100644 index 0000000..477a6b9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c @@ -0,0 +1,161 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_16byte1 { + double a; + float b; + int c; +} cls_struct_16byte1; + +typedef struct cls_struct_16byte2 { + int ii; + double dd; + float ff; +} cls_struct_16byte2; + +typedef struct cls_struct_combined { + cls_struct_16byte1 d; + cls_struct_16byte2 e; +} cls_struct_combined; + +cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, + struct cls_struct_16byte2 b1, + struct cls_struct_combined b2, + struct cls_struct_16byte1 b3) +{ + struct cls_struct_combined result; + + result.d.a = b0.a + b1.dd + b2.d.a; + result.d.b = b0.b + b1.ff + b2.d.b; + result.d.c = b0.c + b1.ii + b2.d.c; + result.e.ii = b0.c + b1.ii + b2.e.ii; + result.e.dd = b0.a + b1.dd + b2.e.dd; + result.e.ff = b0.b + b1.ff + b2.e.ff; + + printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n", + b0.a, b0.b, b0.c, + b1.ii, b1.dd, b1.ff, + b2.d.a, b2.d.b, b2.d.c, + b2.e.ii, b2.e.dd, b2.e.ff, + b3.a, b3.b, b3.c, + result.d.a, result.d.b, result.d.c, + result.e.ii, result.e.dd, result.e.ff); + + return result; +} + +static void +cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct cls_struct_16byte1 b0; + struct cls_struct_16byte2 b1; + struct cls_struct_combined b2; + struct cls_struct_16byte1 b3; + + b0 = *(struct cls_struct_16byte1*)(args[0]); + b1 = *(struct cls_struct_16byte2*)(args[1]); + b2 = *(struct cls_struct_combined*)(args[2]); + b3 = *(struct cls_struct_16byte1*)(args[3]); + + + *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[5]; + ffi_type* cls_struct_fields1[5]; + ffi_type* cls_struct_fields2[5]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6}; + struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0}; + struct cls_struct_combined g_dbl = {{4.0, 5.0, 6}, + {3, 1.0, 8.0}}; + struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4}; + struct cls_struct_combined res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = &ffi_type_sint; + cls_struct_fields[3] = NULL; + + cls_struct_fields1[0] = &ffi_type_sint; + cls_struct_fields1[1] = &ffi_type_double; + cls_struct_fields1[2] = &ffi_type_float; + cls_struct_fields1[3] = NULL; + + cls_struct_fields2[0] = &cls_struct_type; + cls_struct_fields2[1] = &cls_struct_type1; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl); + /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */ + CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); + CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); + CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK); + + res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1, + cls_struct_16byte2, + cls_struct_combined, + cls_struct_16byte1)) + (code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */ + CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); + CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); + CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + /* CHECK( 1 == 0); */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c new file mode 100644 index 0000000..3cf2b44 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c @@ -0,0 +1,134 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned long long a; + unsigned char b; +} A; + +typedef struct B { + unsigned char y; + struct A x; + unsigned int z; +} B; + +typedef struct C { + unsigned long long d; + unsigned char e; +} C; + +static B B_fn(struct A b2, struct B b3, struct C b4) +{ + struct B result; + + result.x.a = b2.a + b3.x.a + b3.z + b4.d; + result.x.b = b2.b + b3.x.b + b3.y + b4.e; + result.y = b2.b + b3.x.b + b4.e; + result.z = 0; + + printf("%d %d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + struct C b2; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + b2 = *(struct C*)(args[2]); + + *(B*)resp = B_fn(b0, b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[4]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[4]; + ffi_type* cls_struct_fields2[3]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[4]; + + struct A e_dbl = { 1LL, 7}; + struct B f_dbl = { 99, {12LL , 127}, 255}; + struct C g_dbl = { 2LL, 9}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_uint64; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &ffi_type_uchar; + cls_struct_fields1[1] = &cls_struct_type; + cls_struct_fields1[2] = &ffi_type_uint; + cls_struct_fields1[3] = NULL; + + cls_struct_fields2[0] = &ffi_type_uint64; + cls_struct_fields2[1] = &ffi_type_uchar; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99 255 2 9: 270 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl); + /* { dg-output "\n1 7 12 127 99 255 2 9: 270 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c new file mode 100644 index 0000000..3510493 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c @@ -0,0 +1,121 @@ +/* Area: ffi_call, closure_call + Purpose: Check parameter passing with nested structs + of a single type. This tests the special cases + for homogeneous floating-point aggregates in the + AArch64 PCS. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + float a_x; + float a_y; +} A; + +typedef struct B { + float b_x; + float b_y; +} B; + +typedef struct C { + A a; + B b; +} C; + +static C C_fn (int x, int y, int z, C source, int i, int j, int k) +{ + C result; + result.a.a_x = source.a.a_x; + result.a.a_y = source.a.a_y; + result.b.b_x = source.b.b_x; + result.b.b_y = source.b.b_y; + + printf ("%d, %d, %d, %d, %d, %d\n", x, y, z, i, j, k); + + printf ("%.1f, %.1f, %.1f, %.1f, " + "%.1f, %.1f, %.1f, %.1f\n", + source.a.a_x, source.a.a_y, + source.b.b_x, source.b.b_y, + result.a.a_x, result.a.a_y, + result.b.b_x, result.b.b_y); + + return result; +} + +int main (void) +{ + ffi_cif cif; + + ffi_type* struct_fields_source_a[3]; + ffi_type* struct_fields_source_b[3]; + ffi_type* struct_fields_source_c[3]; + ffi_type* arg_types[8]; + + ffi_type struct_type_a, struct_type_b, struct_type_c; + + struct A source_fld_a = {1.0, 2.0}; + struct B source_fld_b = {4.0, 8.0}; + int k = 1; + + struct C result; + struct C source = {source_fld_a, source_fld_b}; + + struct_type_a.size = 0; + struct_type_a.alignment = 0; + struct_type_a.type = FFI_TYPE_STRUCT; + struct_type_a.elements = struct_fields_source_a; + + struct_type_b.size = 0; + struct_type_b.alignment = 0; + struct_type_b.type = FFI_TYPE_STRUCT; + struct_type_b.elements = struct_fields_source_b; + + struct_type_c.size = 0; + struct_type_c.alignment = 0; + struct_type_c.type = FFI_TYPE_STRUCT; + struct_type_c.elements = struct_fields_source_c; + + struct_fields_source_a[0] = &ffi_type_float; + struct_fields_source_a[1] = &ffi_type_float; + struct_fields_source_a[2] = NULL; + + struct_fields_source_b[0] = &ffi_type_float; + struct_fields_source_b[1] = &ffi_type_float; + struct_fields_source_b[2] = NULL; + + struct_fields_source_c[0] = &struct_type_a; + struct_fields_source_c[1] = &struct_type_b; + struct_fields_source_c[2] = NULL; + + arg_types[0] = &ffi_type_sint32; + arg_types[1] = &ffi_type_sint32; + arg_types[2] = &ffi_type_sint32; + arg_types[3] = &struct_type_c; + arg_types[4] = &ffi_type_sint32; + arg_types[5] = &ffi_type_sint32; + arg_types[6] = &ffi_type_sint32; + arg_types[7] = NULL; + + void *args[7]; + args[0] = &k; + args[1] = &k; + args[2] = &k; + args[3] = &source; + args[4] = &k; + args[5] = &k; + args[6] = &k; + CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 7, &struct_type_c, + arg_types) == FFI_OK); + + ffi_call (&cif, FFI_FN (C_fn), &result, args); + /* { dg-output "1, 1, 1, 1, 1, 1\n" } */ + /* { dg-output "1.0, 2.0, 4.0, 8.0, 1.0, 2.0, 4.0, 8.0" } */ + CHECK (result.a.a_x == source.a.a_x); + CHECK (result.a.a_y == source.a.a_y); + CHECK (result.b.b_x == source.b.b_x); + CHECK (result.b.b_y == source.b.b_y); + exit (0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c new file mode 100644 index 0000000..69268cd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c @@ -0,0 +1,110 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20030911 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned long a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +B B_fn(struct A b0, struct B b1) +{ + struct B result; + + result.x.a = b0.a + b1.x.a; + result.x.b = b0.b + b1.x.b + b1.y; + result.y = b0.b + b1.x.b; + + printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y, + result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + struct A e_dbl = { 1, 7}; + struct B f_dbl = {{12 , 127}, 99}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_ulong; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c new file mode 100644 index 0000000..ab18cad --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20030911 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned long long a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +B B_fn(struct A b0, struct B b1) +{ + struct B result; + + result.x.a = b0.a + b1.x.a; + result.x.b = b0.b + b1.x.b + b1.y; + result.y = b0.b + b1.x.b; + + printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b, + (int)b1.x.a, b1.x.b, b1.y, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + struct A e_dbl = { 1LL, 7}; + struct B f_dbl = {{12LL , 127}, 99}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_uint64; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c new file mode 100644 index 0000000..2ffb4d6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: PR 25630. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + double a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +static B B_fn(struct A b2, struct B b3) +{ + struct B result; + + result.x.a = b2.a + b3.x.a; + result.x.b = b2.b + b3.x.b + b3.y; + result.y = b2.b + b3.x.b; + + printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + struct A e_dbl = { 1.0, 7}; + struct B f_dbl = {{12.0 , 127}, 99}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c new file mode 100644 index 0000000..6c79845 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c @@ -0,0 +1,112 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + long double a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +static B B_fn(struct A b2, struct B b3) +{ + struct B result; + + result.x.a = b2.a + b3.x.a; + result.x.b = b2.b + b3.x.b + b3.y; + result.y = b2.b + b3.x.b; + + printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + struct A e_dbl = { 1.0, 7}; + struct B f_dbl = {{12.0 , 127}, 99}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_longdouble; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c new file mode 100644 index 0000000..59d3579 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c @@ -0,0 +1,131 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: PR 25630. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + double a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +typedef struct C { + long d; + unsigned char e; +} C; + +static B B_fn(struct A b2, struct B b3, struct C b4) +{ + struct B result; + + result.x.a = b2.a + b3.x.a + b4.d; + result.x.b = b2.b + b3.x.b + b3.y + b4.e; + result.y = b2.b + b3.x.b + b4.e; + + printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + struct C b2; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + b2 = *(struct C*)(args[2]); + + *(B*)resp = B_fn(b0, b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[4]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type* cls_struct_fields2[3]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[4]; + + struct A e_dbl = { 1.0, 7}; + struct B f_dbl = {{12.0 , 127}, 99}; + struct C g_dbl = { 2, 9}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + cls_struct_fields2[0] = &ffi_type_slong; + cls_struct_fields2[1] = &ffi_type_uchar; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl); + /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c new file mode 100644 index 0000000..27595e6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned long long a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +static B B_fn(struct A b2, struct B b3) +{ + struct B result; + + result.x.a = b2.a + b3.x.a; + result.x.b = b2.b + b3.x.b + b3.y; + result.y = b2.b + b3.x.b; + + printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + struct A e_dbl = { 1LL, 7}; + struct B f_dbl = {{12.0 , 127}, 99}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_uint64; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c new file mode 100644 index 0000000..0e6c682 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c @@ -0,0 +1,131 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned long long a; + unsigned char b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +typedef struct C { + unsigned long long d; + unsigned char e; +} C; + +static B B_fn(struct A b2, struct B b3, struct C b4) +{ + struct B result; + + result.x.a = b2.a + b3.x.a + b4.d; + result.x.b = b2.b + b3.x.b + b3.y + b4.e; + result.y = b2.b + b3.x.b + b4.e; + + printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b, + (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e, + (int)result.x.a, result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + struct C b2; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + b2 = *(struct C*)(args[2]); + + *(B*)resp = B_fn(b0, b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[4]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type* cls_struct_fields2[3]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[4]; + + struct A e_dbl = { 1LL, 7}; + struct B f_dbl = {{12LL , 127}, 99}; + struct C g_dbl = { 2LL, 9}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_uint64; + cls_struct_fields[1] = &ffi_type_uchar; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + cls_struct_fields2[0] = &ffi_type_uint64; + cls_struct_fields2[1] = &ffi_type_uchar; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl); + /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c new file mode 100644 index 0000000..5f7ac67 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c @@ -0,0 +1,131 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Contains structs as parameter of the struct itself. + Sample taken from Alan Modras patch to src/prep_cif.c. + Limitations: none. + PR: none. + Originator: 20051010 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + unsigned char a; + unsigned long long b; +} A; + +typedef struct B { + struct A x; + unsigned char y; +} B; + +typedef struct C { + unsigned long d; + unsigned char e; +} C; + +static B B_fn(struct A b2, struct B b3, struct C b4) +{ + struct B result; + + result.x.a = b2.a + b3.x.a + b4.d; + result.x.b = b2.b + b3.x.b + b3.y + b4.e; + result.y = b2.b + b3.x.b + b4.e; + + printf("%d %d %d %d %d %d %d: %d %d %d\n", b2.a, (int)b2.b, + b3.x.a, (int)b3.x.b, b3.y, (int)b4.d, b4.e, + result.x.a, (int)result.x.b, result.y); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct A b0; + struct B b1; + struct C b2; + + b0 = *(struct A*)(args[0]); + b1 = *(struct B*)(args[1]); + b2 = *(struct C*)(args[2]); + + *(B*)resp = B_fn(b0, b1, b2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[4]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type* cls_struct_fields2[3]; + ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; + ffi_type* dbl_arg_types[4]; + + struct A e_dbl = { 1, 7LL}; + struct B f_dbl = {{12.0 , 127}, 99}; + struct C g_dbl = { 2, 9}; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_type2.size = 0; + cls_struct_type2.alignment = 0; + cls_struct_type2.type = FFI_TYPE_STRUCT; + cls_struct_type2.elements = cls_struct_fields2; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &ffi_type_uint64; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = &ffi_type_uchar; + cls_struct_fields1[2] = NULL; + + cls_struct_fields2[0] = &ffi_type_ulong; + cls_struct_fields2[1] = &ffi_type_uchar; + cls_struct_fields2[2] = NULL; + + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = &cls_struct_type2; + dbl_arg_types[3] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl); + /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */ + CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d)); + CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e)); + CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c new file mode 100644 index 0000000..6a91555 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Limitations: none. + PR: none. + Originator: 20030828 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct my_ffi_struct { + double a; + double b; + double c; +} my_ffi_struct; + +my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2) +{ + struct my_ffi_struct result; + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + + printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c, + a2.a, a2.b, a2.c, result.a, result.b, result.c); + + return result; +} + +void stub(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + struct my_ffi_struct a1; + struct my_ffi_struct a2; + + a1 = *(struct my_ffi_struct*)(args[0]); + a2 = *(struct my_ffi_struct*)(args[1]); + + *(my_ffi_struct *)resp = callee(a1, a2); +} + + +int main(void) +{ + ffi_type* my_ffi_struct_fields[4]; + ffi_type my_ffi_struct_type; + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[4]; + ffi_type* arg_types[3]; + + struct my_ffi_struct g = { 1.0, 2.0, 3.0 }; + struct my_ffi_struct f = { 1.0, 2.0, 3.0 }; + struct my_ffi_struct res; + + my_ffi_struct_type.size = 0; + my_ffi_struct_type.alignment = 0; + my_ffi_struct_type.type = FFI_TYPE_STRUCT; + my_ffi_struct_type.elements = my_ffi_struct_fields; + + my_ffi_struct_fields[0] = &ffi_type_double; + my_ffi_struct_fields[1] = &ffi_type_double; + my_ffi_struct_fields[2] = &ffi_type_double; + my_ffi_struct_fields[3] = NULL; + + arg_types[0] = &my_ffi_struct_type; + arg_types[1] = &my_ffi_struct_type; + arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type, + arg_types) == FFI_OK); + + args[0] = &g; + args[1] = &f; + args[2] = NULL; + ffi_call(&cif, FFI_FN(callee), &res, args); + /* { dg-output "1 2 3 1 2 3: 2 4 6" } */ + printf("res: %g %g %g\n", res.a, res.b, res.c); + /* { dg-output "\nres: 2 4 6" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, stub, NULL, code) == FFI_OK); + + res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(code))(g, f); + /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */ + printf("res: %g %g %g\n", res.a, res.b, res.c); + /* { dg-output "\nres: 2 4 6" } */ + + exit(0);; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c new file mode 100644 index 0000000..71c2469 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c @@ -0,0 +1,145 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure returning with different structure size. + Depending on the ABI. Check bigger struct which overlaps + the gp and fp register count on Darwin/AIX/ppc64. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/21/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +#include "ffitest.h" + +/* 13 FPRs: 104 bytes */ +/* 14 FPRs: 112 bytes */ + +typedef struct struct_108byte { + double a; + double b; + double c; + double d; + double e; + double f; + double g; + double h; + double i; + double j; + double k; + double l; + double m; + int n; +} struct_108byte; + +struct_108byte cls_struct_108byte_fn( + struct_108byte b0, + struct_108byte b1, + struct_108byte b2, + struct_108byte b3) +{ + struct_108byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + result.e = b0.e + b1.e + b2.e + b3.e; + result.f = b0.f + b1.f + b2.f + b3.f; + result.g = b0.g + b1.g + b2.g + b3.g; + result.h = b0.h + b1.h + b2.h + b3.h; + result.i = b0.i + b1.i + b2.i + b3.i; + result.j = b0.j + b1.j + b2.j + b3.j; + result.k = b0.k + b1.k + b2.k + b3.k; + result.l = b0.l + b1.l + b2.l + b3.l; + result.m = b0.m + b1.m + b2.m + b3.m; + result.n = b0.n + b1.n + b2.n + b3.n; + + printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c, + result.d, result.e, result.f, result.g, result.h, result.i, + result.j, result.k, result.l, result.m, result.n); + + return result; +} + +static void +cls_struct_108byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) +{ + struct_108byte b0, b1, b2, b3; + + b0 = *(struct_108byte*)(args[0]); + b1 = *(struct_108byte*)(args[1]); + b2 = *(struct_108byte*)(args[2]); + b3 = *(struct_108byte*)(args[3]); + + *(struct_108byte*)resp = cls_struct_108byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[15]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct_108byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 7 }; + struct_108byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 4 }; + struct_108byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 3 }; + struct_108byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 2 }; + struct_108byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_double; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_double; + cls_struct_fields[7] = &ffi_type_double; + cls_struct_fields[8] = &ffi_type_double; + cls_struct_fields[9] = &ffi_type_double; + cls_struct_fields[10] = &ffi_type_double; + cls_struct_fields[11] = &ffi_type_double; + cls_struct_fields[12] = &ffi_type_double; + cls_struct_fields[13] = &ffi_type_sint32; + cls_struct_fields[14] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_108byte_fn), &res_dbl, args_dbl); + /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i, + res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_108byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((struct_108byte(*)(struct_108byte, struct_108byte, + struct_108byte, struct_108byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i, + res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c new file mode 100644 index 0000000..d9c750e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c @@ -0,0 +1,148 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure returning with different structure size. + Depending on the ABI. Check bigger struct which overlaps + the gp and fp register count on Darwin/AIX/ppc64. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/21/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +#include "ffitest.h" + +/* 13 FPRs: 104 bytes */ +/* 14 FPRs: 112 bytes */ + +typedef struct struct_116byte { + double a; + double b; + double c; + double d; + double e; + double f; + double g; + double h; + double i; + double j; + double k; + double l; + double m; + double n; + int o; +} struct_116byte; + +struct_116byte cls_struct_116byte_fn( + struct_116byte b0, + struct_116byte b1, + struct_116byte b2, + struct_116byte b3) +{ + struct_116byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + result.e = b0.e + b1.e + b2.e + b3.e; + result.f = b0.f + b1.f + b2.f + b3.f; + result.g = b0.g + b1.g + b2.g + b3.g; + result.h = b0.h + b1.h + b2.h + b3.h; + result.i = b0.i + b1.i + b2.i + b3.i; + result.j = b0.j + b1.j + b2.j + b3.j; + result.k = b0.k + b1.k + b2.k + b3.k; + result.l = b0.l + b1.l + b2.l + b3.l; + result.m = b0.m + b1.m + b2.m + b3.m; + result.n = b0.n + b1.n + b2.n + b3.n; + result.o = b0.o + b1.o + b2.o + b3.o; + + printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c, + result.d, result.e, result.f, result.g, result.h, result.i, + result.j, result.k, result.l, result.m, result.n, result.o); + + return result; +} + +static void +cls_struct_116byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) +{ + struct_116byte b0, b1, b2, b3; + + b0 = *(struct_116byte*)(args[0]); + b1 = *(struct_116byte*)(args[1]); + b2 = *(struct_116byte*)(args[2]); + b3 = *(struct_116byte*)(args[3]); + + *(struct_116byte*)resp = cls_struct_116byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[16]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct_116byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 7 }; + struct_116byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 6.0, 4 }; + struct_116byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 7.0, 3 }; + struct_116byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 8.0, 2 }; + struct_116byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_double; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_double; + cls_struct_fields[7] = &ffi_type_double; + cls_struct_fields[8] = &ffi_type_double; + cls_struct_fields[9] = &ffi_type_double; + cls_struct_fields[10] = &ffi_type_double; + cls_struct_fields[11] = &ffi_type_double; + cls_struct_fields[12] = &ffi_type_double; + cls_struct_fields[13] = &ffi_type_double; + cls_struct_fields[14] = &ffi_type_sint32; + cls_struct_fields[15] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_116byte_fn), &res_dbl, args_dbl); + /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i, + res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_116byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((struct_116byte(*)(struct_116byte, struct_116byte, + struct_116byte, struct_116byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b, + res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i, + res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c new file mode 100644 index 0000000..973ee02 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c @@ -0,0 +1,124 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure returning with different structure size. + Depending on the ABI. Check bigger struct which overlaps + the gp and fp register count on Darwin/AIX/ppc64. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/21/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +#include "ffitest.h" + +typedef struct struct_72byte { + double a; + double b; + double c; + double d; + double e; + double f; + double g; + double h; + double i; +} struct_72byte; + +struct_72byte cls_struct_72byte_fn( + struct_72byte b0, + struct_72byte b1, + struct_72byte b2, + struct_72byte b3) +{ + struct_72byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + result.e = b0.e + b1.e + b2.e + b3.e; + result.f = b0.f + b1.f + b2.f + b3.f; + result.g = b0.g + b1.g + b2.g + b3.g; + result.h = b0.h + b1.h + b2.h + b3.h; + result.i = b0.i + b1.i + b2.i + b3.i; + + printf("%g %g %g %g %g %g %g %g %g\n", result.a, result.b, result.c, + result.d, result.e, result.f, result.g, result.h, result.i); + + return result; +} + +static void +cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) +{ + struct_72byte b0, b1, b2, b3; + + b0 = *(struct_72byte*)(args[0]); + b1 = *(struct_72byte*)(args[1]); + b2 = *(struct_72byte*)(args[2]); + b3 = *(struct_72byte*)(args[3]); + + *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[10]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7.0 }; + struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0 }; + struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3.0 }; + struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2.0 }; + struct_72byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_double; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_double; + cls_struct_fields[7] = &ffi_type_double; + cls_struct_fields[8] = &ffi_type_double; + cls_struct_fields[9] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl); + /* { dg-output "22 15 17 25 6 13 19 18 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte, + struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */ + printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c new file mode 100644 index 0000000..84323d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c @@ -0,0 +1,125 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure returning with different structure size. + Depending on the ABI. Check bigger struct which overlaps + the gp and fp register count on Darwin/AIX/ppc64. + Limitations: none. + PR: none. + Originator: Blake Chaffin 6/21/2007 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ +#include "ffitest.h" + +typedef struct struct_72byte { + double a; + double b; + double c; + double d; + double e; + double f; + double g; + double h; + long long i; +} struct_72byte; + +struct_72byte cls_struct_72byte_fn( + struct_72byte b0, + struct_72byte b1, + struct_72byte b2, + struct_72byte b3) +{ + struct_72byte result; + + result.a = b0.a + b1.a + b2.a + b3.a; + result.b = b0.b + b1.b + b2.b + b3.b; + result.c = b0.c + b1.c + b2.c + b3.c; + result.d = b0.d + b1.d + b2.d + b3.d; + result.e = b0.e + b1.e + b2.e + b3.e; + result.f = b0.f + b1.f + b2.f + b3.f; + result.g = b0.g + b1.g + b2.g + b3.g; + result.h = b0.h + b1.h + b2.h + b3.h; + result.i = b0.i + b1.i + b2.i + b3.i; + + printf("%g %g %g %g %g %g %g %g %" PRIdLL "\n", result.a, result.b, result.c, + result.d, result.e, result.f, result.g, result.h, result.i); + + return result; +} + +static void +cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) +{ + struct_72byte b0, b1, b2, b3; + + b0 = *(struct_72byte*)(args[0]); + b1 = *(struct_72byte*)(args[1]); + b2 = *(struct_72byte*)(args[2]); + b3 = *(struct_72byte*)(args[3]); + + *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[5]; + ffi_type* cls_struct_fields[10]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[5]; + + struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7 }; + struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4 }; + struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3 }; + struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2 }; + struct_72byte res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_double; + cls_struct_fields[1] = &ffi_type_double; + cls_struct_fields[2] = &ffi_type_double; + cls_struct_fields[3] = &ffi_type_double; + cls_struct_fields[4] = &ffi_type_double; + cls_struct_fields[5] = &ffi_type_double; + cls_struct_fields[6] = &ffi_type_double; + cls_struct_fields[7] = &ffi_type_double; + cls_struct_fields[8] = &ffi_type_sint64; + cls_struct_fields[9] = NULL; + + dbl_arg_types[0] = &cls_struct_type; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = &cls_struct_type; + dbl_arg_types[3] = &cls_struct_type; + dbl_arg_types[4] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = &g_dbl; + args_dbl[3] = &h_dbl; + args_dbl[4] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl); + /* { dg-output "22 15 17 25 6 13 19 18 16" } */ + printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK); + + res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte, + struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl); + /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */ + printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c, + res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i); + /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c new file mode 100644 index 0000000..ca31056 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c @@ -0,0 +1,70 @@ +/* Area: closure_call + Purpose: Check return value float. + Limitations: none. + PR: 41908. + Originator: 20091102 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct cls_struct_combined { + float a; + float b; + float c; + float d; +} cls_struct_combined; + +void cls_struct_combined_fn(struct cls_struct_combined arg) +{ + printf("%g %g %g %g\n", + arg.a, arg.b, + arg.c, arg.d); + fflush(stdout); +} + +static void +cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, + void** args, void* userdata __UNUSED__) +{ + struct cls_struct_combined a0; + + a0 = *(struct cls_struct_combined*)(args[0]); + + cls_struct_combined_fn(a0); +} + + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type* cls_struct_fields0[5]; + ffi_type cls_struct_type0; + ffi_type* dbl_arg_types[5]; + + struct cls_struct_combined g_dbl = {4.0, 5.0, 1.0, 8.0}; + + cls_struct_type0.size = 0; + cls_struct_type0.alignment = 0; + cls_struct_type0.type = FFI_TYPE_STRUCT; + cls_struct_type0.elements = cls_struct_fields0; + + cls_struct_fields0[0] = &ffi_type_float; + cls_struct_fields0[1] = &ffi_type_float; + cls_struct_fields0[2] = &ffi_type_float; + cls_struct_fields0[3] = &ffi_type_float; + cls_struct_fields0[4] = NULL; + + dbl_arg_types[0] = &cls_struct_type0; + dbl_arg_types[1] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, + dbl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK); + + ((void(*)(cls_struct_combined)) (code))(g_dbl); + /* { dg-output "4 5 1 8" } */ + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc new file mode 100644 index 0000000..e114565 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc @@ -0,0 +1,117 @@ +/* Area: ffi_closure, unwind info + Purpose: Check if the unwind information is passed correctly. + Limitations: none. + PR: none. + Originator: Jeff Sturm */ + +/* { dg-do run { xfail x86_64-apple-darwin* moxie*-*-* } } */ + +#include "ffitest.h" + +void ABI_ATTR +closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, + void** args __UNUSED__, void* userdata __UNUSED__) +{ + throw 9; +} + +typedef void (*closure_test_type)(); + +void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) + { + *(ffi_arg*)resp = + (int)*(float *)args[0] +(int)(*(float *)args[1]) + + (int)(*(float *)args[2]) + (int)*(float *)args[3] + + (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + + (int)*(float *)args[6] + (int)(*(int *)args[7]) + + (int)(*(double*)args[8]) + (int)*(int *)args[9] + + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + + (int)*(int *)args[12] + (int)(*(int *)args[13]) + + (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata; + + printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", + (int)*(float *)args[0], (int)(*(float *)args[1]), + (int)(*(float *)args[2]), (int)*(float *)args[3], + (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), + (int)*(float *)args[6], (int)(*(int *)args[7]), + (int)(*(double *)args[8]), (int)*(int *)args[9], + (int)(*(int *)args[10]), (int)(*(float *)args[11]), + (int)*(int *)args[12], (int)(*(int *)args[13]), + (int)(*(int *)args[14]), *(int *)args[15], + (int)(intptr_t)userdata, (int)*(ffi_arg*)resp); + + throw (int)*(ffi_arg*)resp; +} + +typedef int (*closure_test_type1)(float, float, float, float, signed short, + float, float, int, double, int, int, float, + int, int, int, int); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[17]; + + { + cl_arg_types[1] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, + &ffi_type_void, cl_arg_types) == FFI_OK); + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK); + + try + { + (*((closure_test_type)(code)))(); + } catch (int exception_code) + { + CHECK(exception_code == 9); + } + + printf("part one OK\n"); + /* { dg-output "part one OK" } */ + } + + { + + cl_arg_types[0] = &ffi_type_float; + cl_arg_types[1] = &ffi_type_float; + cl_arg_types[2] = &ffi_type_float; + cl_arg_types[3] = &ffi_type_float; + cl_arg_types[4] = &ffi_type_sshort; + cl_arg_types[5] = &ffi_type_float; + cl_arg_types[6] = &ffi_type_float; + cl_arg_types[7] = &ffi_type_uint; + cl_arg_types[8] = &ffi_type_double; + cl_arg_types[9] = &ffi_type_uint; + cl_arg_types[10] = &ffi_type_uint; + cl_arg_types[11] = &ffi_type_float; + cl_arg_types[12] = &ffi_type_uint; + cl_arg_types[13] = &ffi_type_uint; + cl_arg_types[14] = &ffi_type_uint; + cl_arg_types[15] = &ffi_type_uint; + cl_arg_types[16] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1, + (void *) 3 /* userdata */, code) == FFI_OK); + try + { + (*((closure_test_type1)code)) + (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, + 19, 21, 1); + /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ + } catch (int exception_code) + { + CHECK(exception_code == 255); + } + printf("part two OK\n"); + /* { dg-output "\npart two OK" } */ + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc new file mode 100644 index 0000000..153d240 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc @@ -0,0 +1,54 @@ +/* Area: ffi_call, unwind info + Purpose: Check if the unwind information is passed correctly. + Limitations: none. + PR: none. + Originator: Andreas Tobler 20061213 */ + +/* { dg-do run { xfail moxie*-*-* } } */ + +#include "ffitest.h" + +static int checking(int a __UNUSED__, short b __UNUSED__, + signed char c __UNUSED__) +{ + throw 9; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_arg rint; + + signed int si; + signed short ss; + signed char sc; + + args[0] = &ffi_type_sint; + values[0] = &si; + args[1] = &ffi_type_sshort; + values[1] = &ss; + args[2] = &ffi_type_schar; + values[2] = ≻ + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_sint, args) == FFI_OK); + + si = -6; + ss = -12; + sc = -1; + { + try + { + ffi_call(&cif, FFI_FN(checking), &rint, values); + } catch (int exception_code) + { + CHECK(exception_code == 9); + } + printf("part one OK\n"); + /* { dg-output "part one OK" } */ + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc new file mode 100644 index 0000000..4a812ed --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc @@ -0,0 +1,91 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +typedef struct cls_struct_align { + unsigned char a; + _Complex T_C_TYPE b; + unsigned char c; +} cls_struct_align; + +cls_struct_align cls_struct_align_fn( + struct cls_struct_align a1, struct cls_struct_align a2) +{ + struct cls_struct_align result; + + result.a = a1.a + a2.a; + result.b = a1.b + a2.b; + result.c = a1.c + a2.c; + + printf("%d %f,%fi %d %d %f,%fi %d: %d %f,%fi %d\n", + a1.a, T_CONV creal (a1.b), T_CONV cimag (a1.b), a1.c, + a2.a, T_CONV creal (a2.b), T_CONV cimag (a2.b), a2.c, + result.a, T_CONV creal (result.b), T_CONV cimag (result.b), result.c); + + return result; +} + +static void +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + + struct cls_struct_align a1, a2; + + a1 = *(struct cls_struct_align*)(args[0]); + a2 = *(struct cls_struct_align*)(args[1]); + + *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_c[5]; + ffi_type* cls_struct_fields[4]; + ffi_type cls_struct_type; + ffi_type* c_arg_types[5]; + + struct cls_struct_align g_c = { 12, 4951 + 7 * I, 127 }; + struct cls_struct_align f_c = { 1, 9320 + 1 * I, 13 }; + struct cls_struct_align res_c; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_uchar; + cls_struct_fields[1] = &T_FFI_TYPE; + cls_struct_fields[2] = &ffi_type_uchar; + cls_struct_fields[3] = NULL; + + c_arg_types[0] = &cls_struct_type; + c_arg_types[1] = &cls_struct_type; + c_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + c_arg_types) == FFI_OK); + + args_c[0] = &g_c; + args_c[1] = &f_c; + args_c[2] = NULL; + + ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_c, args_c); + /* { dg-output "12 4951,7i 127 1 9320,1i 13: 13 14271,8i 140" } */ + printf("res: %d %f,%fi %d\n", + res_c.a, T_CONV creal (res_c.b), T_CONV cimag (res_c.b), res_c.c); + /* { dg-output "\nres: 13 14271,8i 140" } */ + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); + + res_c = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_c, f_c); + /* { dg-output "\n12 4951,7i 127 1 9320,1i 13: 13 14271,8i 140" } */ + printf("res: %d %f,%fi %d\n", + res_c.a, T_CONV creal (res_c.b), T_CONV cimag (res_c.b), res_c.c); + /* { dg-output "\nres: 13 14271,8i 140" } */ + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c new file mode 100644 index 0000000..0dff23a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_align_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c new file mode 100644 index 0000000..0affbd0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_align_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c new file mode 100644 index 0000000..7889ba8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_align_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc new file mode 100644 index 0000000..f937404 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc @@ -0,0 +1,42 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +static void cls_ret_complex_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { + _Complex T_C_TYPE *pa; + _Complex T_C_TYPE *pr; + pa = (_Complex T_C_TYPE *)args[0]; + pr = (_Complex T_C_TYPE *)resp; + *pr = *pa; + + printf("%.6f,%.6fi: %.6f,%.6fi\n", + T_CONV creal (*pa), T_CONV cimag (*pa), + T_CONV creal (*pr), T_CONV cimag (*pr)); + } +typedef _Complex T_C_TYPE (*cls_ret_complex)(_Complex T_C_TYPE); + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type * cl_arg_types[2]; + _Complex T_C_TYPE res; + + cl_arg_types[0] = &T_FFI_TYPE; + cl_arg_types[1] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &T_FFI_TYPE, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_complex_fn, NULL, code) == FFI_OK); + + res = (*((cls_ret_complex)code))(0.125 + 128.0 * I); + printf("res: %.6f,%.6fi\n", T_CONV creal (res), T_CONV cimag (res)); + CHECK (res == (0.125 + 128.0 * I)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c new file mode 100644 index 0000000..05e3534 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c new file mode 100644 index 0000000..5df7849 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c new file mode 100644 index 0000000..2b1c320 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc new file mode 100644 index 0000000..df8708d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc @@ -0,0 +1,71 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +typedef struct Cs { + _Complex T_C_TYPE x; + _Complex T_C_TYPE y; +} Cs; + +Cs gc; + +void +closure_test_fn(Cs p) +{ + printf("%.1f,%.1fi %.1f,%.1fi\n", + T_CONV creal (p.x), T_CONV cimag (p.x), + T_CONV creal (p.y), T_CONV cimag (p.y)); + gc = p; +} + +void +closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, + void** args, void* userdata __UNUSED__) +{ + closure_test_fn(*(Cs*)args[0]); +} + +int main(int argc __UNUSED__, char** argv __UNUSED__) +{ + ffi_cif cif; + + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + ffi_type *cl_arg_types[1]; + + ffi_type ts1_type; + ffi_type* ts1_type_elements[4]; + + Cs arg = { 1.0 + 11.0 * I, 2.0 + 22.0 * I}; + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + + ts1_type_elements[0] = &T_FFI_TYPE; + ts1_type_elements[1] = &T_FFI_TYPE; + ts1_type_elements[2] = NULL; + + cl_arg_types[0] = &ts1_type; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_void, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK); + + gc.x = 0.0 + 0.0 * I; + gc.y = 0.0 + 0.0 * I; + ((void*(*)(Cs))(code))(arg); + /* { dg-output "1.0,11.0i 2.0,22.0i\n" } */ + CHECK (gc.x == arg.x && gc.y == arg.y); + + gc.x = 0.0 + 0.0 * I; + gc.y = 0.0 + 0.0 * I; + closure_test_fn(arg); + /* { dg-output "1.0,11.0i 2.0,22.0i\n" } */ + CHECK (gc.x == arg.x && gc.y == arg.y); + + return 0; +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c new file mode 100644 index 0000000..ec71346 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex_struct.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c new file mode 100644 index 0000000..96fdf75 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_complex_struct.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c new file mode 100644 index 0000000..005b467 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex_struct.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc new file mode 100644 index 0000000..8a3e15f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc @@ -0,0 +1,80 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include +#include +#include +#include + +static _Complex T_C_TYPE gComplexValue1 = 1 + 2 * I; +static _Complex T_C_TYPE gComplexValue2 = 3 + 4 * I; + +static int cls_variadic(const char *format, ...) +{ + va_list ap; + _Complex T_C_TYPE p1, p2; + + va_start (ap, format); + p1 = va_arg (ap, _Complex T_C_TYPE); + p2 = va_arg (ap, _Complex T_C_TYPE); + va_end (ap); + + return printf(format, T_CONV creal (p1), T_CONV cimag (p1), + T_CONV creal (p2), T_CONV cimag (p2)); +} + +static void +cls_complex_va_fn(ffi_cif* cif __UNUSED__, void* resp, + void** args, void* userdata __UNUSED__) +{ + char* format = *(char**)args[0]; + gComplexValue1 = *(_Complex T_C_TYPE*)args[1]; + gComplexValue2 = *(_Complex T_C_TYPE*)args[2]; + + *(ffi_arg*)resp = + printf(format, + T_CONV creal (gComplexValue1), T_CONV cimag (gComplexValue1), + T_CONV creal (gComplexValue2), T_CONV cimag (gComplexValue2)); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args[4]; + ffi_type* arg_types[4]; + char *format = "%.1f,%.1fi %.1f,%.1fi\n"; + + _Complex T_C_TYPE complexArg1 = 1.0 + 22.0 *I; + _Complex T_C_TYPE complexArg2 = 333.0 + 4444.0 *I; + ffi_arg res = 0; + + arg_types[0] = &ffi_type_pointer; + arg_types[1] = &T_FFI_TYPE; + arg_types[2] = &T_FFI_TYPE; + arg_types[3] = NULL; + + /* This printf call is variadic */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 3, &ffi_type_sint, + arg_types) == FFI_OK); + + args[0] = &format; + args[1] = &complexArg1; + args[2] = &complexArg2; + args[3] = NULL; + + ffi_call(&cif, FFI_FN(cls_variadic), &res, args); + printf("res: %d\n", (int) res); + CHECK (res == 24); + + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_complex_va_fn, NULL, code) + == FFI_OK); + + res = ((int(*)(char *, ...))(code))(format, complexArg1, complexArg2); + CHECK (gComplexValue1 == complexArg1); + CHECK (gComplexValue2 == complexArg2); + printf("res: %d\n", (int) res); + CHECK (res == 24); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c new file mode 100644 index 0000000..879ccf3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex_va.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c new file mode 100644 index 0000000..2b17826 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c @@ -0,0 +1,16 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +/* Alpha splits _Complex into two arguments. It's illegal to pass + float through varargs, so _Complex float goes badly. In sort of + gets passed as _Complex double, but the compiler doesn't agree + with itself on this issue. */ +/* { dg-do run { xfail alpha*-*-* } } */ + +#include "complex_defs_float.inc" +#include "cls_complex_va.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c new file mode 100644 index 0000000..6eca965 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex_va.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp new file mode 100644 index 0000000..4631db2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp @@ -0,0 +1,36 @@ +# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +dg-init +libffi-init + +global srcdir subdir + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] + +if { [libffi_feature_test "#ifdef FFI_TARGET_HAS_COMPLEX_TYPE"] } { + run-many-tests $tlist "" +} else { + foreach test $tlist { + unsupported "$test" + } +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc new file mode 100644 index 0000000..515ae3e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc @@ -0,0 +1,51 @@ +/* -*-c-*-*/ +#include "ffitest.h" +#include + +static _Complex T_C_TYPE f_complex(_Complex T_C_TYPE c, int x, int *py) +{ + c = -(2 * creal (c)) + (cimag (c) + 1)* I; + *py += x; + + return c; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + + _Complex T_C_TYPE tc_arg; + _Complex T_C_TYPE tc_result; + int tc_int_arg_x; + int tc_y; + int *tc_ptr_arg_y = &tc_y; + + args[0] = &T_FFI_TYPE; + args[1] = &ffi_type_sint; + args[2] = &ffi_type_pointer; + values[0] = &tc_arg; + values[1] = &tc_int_arg_x; + values[2] = &tc_ptr_arg_y; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &T_FFI_TYPE, args) == FFI_OK); + + tc_arg = 1 + 7 * I; + tc_int_arg_x = 1234; + tc_y = 9876; + ffi_call(&cif, FFI_FN(f_complex), &tc_result, values); + + printf ("%f,%fi %f,%fi, x %d 1234, y %d 11110\n", + T_CONV creal (tc_result), T_CONV cimag (tc_result), + T_CONV creal (2.0), T_CONV creal (8.0), tc_int_arg_x, tc_y); + + CHECK (creal (tc_result) == -2); + CHECK (cimag (tc_result) == 8); + CHECK (tc_int_arg_x == 1234); + CHECK (*tc_ptr_arg_y == 11110); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc new file mode 100644 index 0000000..3583e16 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc @@ -0,0 +1,7 @@ +/* -*-c-*- */ +/* Complex base type. */ +#define T_FFI_TYPE ffi_type_complex_double +/* C type corresponding to the base type. */ +#define T_C_TYPE double +/* C cast for a value of type T_C_TYPE that is passed to printf. */ +#define T_CONV diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc new file mode 100644 index 0000000..bbd9375 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc @@ -0,0 +1,7 @@ +/* -*-c-*- */ +/* Complex base type. */ +#define T_FFI_TYPE ffi_type_complex_float +/* C type corresponding to the base type. */ +#define T_C_TYPE float +/* C cast for a value of type T_C_TYPE that is passed to printf. */ +#define T_CONV (double) diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc new file mode 100644 index 0000000..14b9f24 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc @@ -0,0 +1,7 @@ +/* -*-c-*- */ +/* Complex base type. */ +#define T_FFI_TYPE ffi_type_complex_longdouble +/* C type corresponding to the base type. */ +#define T_C_TYPE long double +/* C cast for a value of type T_C_TYPE that is passed to printf. */ +#define T_CONV diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c new file mode 100644 index 0000000..8a3297b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c new file mode 100644 index 0000000..5044ebb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c new file mode 100644 index 0000000..bac3190 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c @@ -0,0 +1,86 @@ +/* Area: ffi_call + Purpose: Check non-standard complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "ffitest.h" +#include "ffi.h" +#include + +_Complex int f_complex(_Complex int c, int x, int *py) +{ + __real__ c = -2 * __real__ c; + __imag__ c = __imag__ c + 1; + *py += x; + return c; +} + +/* + * This macro can be used to define new complex type descriptors + * in a platform independent way. + * + * name: Name of the new descriptor is ffi_type_complex_. + * type: The C base type of the complex type. + */ +#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffitype), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ + _Complex type x; \ + }; \ + ffi_type ffi_type_complex_##name = { \ + sizeof(_Complex type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ + } + +/* Define new complex type descriptors using the macro: */ +/* ffi_type_complex_sint */ +FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint); +/* ffi_type_complex_uchar */ +FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8); + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + + _Complex int tc_arg; + _Complex int tc_result; + int tc_int_arg_x; + int tc_y; + int *tc_ptr_arg_y = &tc_y; + + args[0] = &ffi_type_complex_sint; + args[1] = &ffi_type_sint; + args[2] = &ffi_type_pointer; + values[0] = &tc_arg; + values[1] = &tc_int_arg_x; + values[2] = &tc_ptr_arg_y; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_complex_sint, args) + == FFI_OK); + + tc_arg = 1 + 7 * I; + tc_int_arg_x = 1234; + tc_y = 9876; + ffi_call(&cif, FFI_FN(f_complex), &tc_result, values); + + printf ("%d,%di %d,%di, x %d 1234, y %d 11110\n", + (int)tc_result, (int)(tc_result * -I), 2, 8, tc_int_arg_x, tc_y); + /* dg-output "-2,8i 2,8i, x 1234 1234, y 11110 11110" */ + CHECK (creal (tc_result) == -2); + CHECK (cimag (tc_result) == 8); + CHECK (tc_int_arg_x == 1234); + CHECK (*tc_ptr_arg_y == 11110); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c new file mode 100644 index 0000000..7e78366 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h new file mode 100644 index 0000000..d27d362 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h @@ -0,0 +1 @@ +#include "../libffi.call/ffitest.h" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc new file mode 100644 index 0000000..e37a774 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc @@ -0,0 +1,78 @@ +/* -*-c-*- */ +#include "ffitest.h" + +#include +#include + +static _Complex T_C_TYPE many(_Complex T_C_TYPE c1, + _Complex T_C_TYPE c2, + _Complex T_C_TYPE c3, + _Complex T_C_TYPE c4, + _Complex T_C_TYPE c5, + _Complex T_C_TYPE c6, + _Complex T_C_TYPE c7, + _Complex T_C_TYPE c8, + _Complex T_C_TYPE c9, + _Complex T_C_TYPE c10, + _Complex T_C_TYPE c11, + _Complex T_C_TYPE c12, + _Complex T_C_TYPE c13) +{ + printf("0 :%f,%fi\n" + "1 :%f,%fi\n" + "2 :%f,%fi\n" + "3 :%f,%fi\n" + "4 :%f,%fi\n" + "5 :%f,%fi\n" + "6 :%f,%fi\n" + "7 :%f,%fi\n" + "8 :%f,%fi\n" + "9 :%f,%fi\n" + "10:%f,%fi\n" + "11:%f,%fi\n" + "12:%f,%fi\n", + T_CONV creal (c1), T_CONV cimag (c1), + T_CONV creal (c2), T_CONV cimag (c2), + T_CONV creal (c3), T_CONV cimag (c3), + T_CONV creal (c4), T_CONV cimag (c4), + T_CONV creal (c5), T_CONV cimag (c5), + T_CONV creal (c6), T_CONV cimag (c6), + T_CONV creal (c7), T_CONV cimag (c7), + T_CONV creal (c8), T_CONV cimag (c8), + T_CONV creal (c9), T_CONV cimag (c9), + T_CONV creal (c10), T_CONV cimag (c10), + T_CONV creal (c11), T_CONV cimag (c11), + T_CONV creal (c12), T_CONV cimag (c12), + T_CONV creal (c13), T_CONV cimag (c13)); + + return (c1+c2-c3-c4+c5+c6+c7-c8-c9-c10-c11+c12+c13); +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[13]; + void *values[13]; + _Complex T_C_TYPE ca[13]; + _Complex T_C_TYPE c, cc; + int i; + + for (i = 0; i < 13; i++) + { + args[i] = &T_FFI_TYPE; + values[i] = &ca[i]; + ca[i] = i + (-20 - i) * I; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, &T_FFI_TYPE, args) == FFI_OK); + + ffi_call(&cif, FFI_FN(many), &c, values); + + cc = many(ca[0], ca[1], ca[2], ca[3], ca[4], ca[5], ca[6], ca[7], ca[8], + ca[9], ca[10], ca[11], ca[12]); + CHECK(creal (cc) == creal (c)); + CHECK(cimag (cc) == cimag (c)); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c new file mode 100644 index 0000000..3fd53c3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "many_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c new file mode 100644 index 0000000..c43d21c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "many_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c new file mode 100644 index 0000000..dbab723 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "many_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc new file mode 100644 index 0000000..8bf0c1f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc @@ -0,0 +1,37 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +static _Complex T_C_TYPE return_c(_Complex T_C_TYPE c) +{ + printf ("%f,%fi\n", T_CONV creal (c), T_CONV cimag (c)); + return 2 * c; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + _Complex T_C_TYPE c, rc, rc2; + T_C_TYPE cr, ci; + + args[0] = &T_FFI_TYPE; + values[0] = &c; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &T_FFI_TYPE, args) == FFI_OK); + + for (cr = -127.0; cr < 127; cr++) + { + ci = 1000.0 - cr; + c = cr + ci * I; + ffi_call(&cif, FFI_FN(return_c), &rc, values); + rc2 = return_c(c); + printf ("%f,%fi vs %f,%fi\n", + T_CONV creal (rc), T_CONV cimag (rc), + T_CONV creal (rc2), T_CONV cimag (rc2)); + CHECK(rc == 2 * c); + } + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc new file mode 100644 index 0000000..7cecc0f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc @@ -0,0 +1,41 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +static _Complex T_C_TYPE return_c(_Complex T_C_TYPE c1, float fl2, unsigned int in3, _Complex T_C_TYPE c4) +{ + return c1 + fl2 + in3 + c4; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + _Complex T_C_TYPE c1, c4, rc, rc2; + float fl2; + unsigned int in3; + args[0] = &T_FFI_TYPE; + args[1] = &ffi_type_float; + args[2] = &ffi_type_uint; + args[3] = &T_FFI_TYPE; + values[0] = &c1; + values[1] = &fl2; + values[2] = &in3; + values[3] = &c4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &T_FFI_TYPE, args) == FFI_OK); + c1 = 127.0 + 255.0 * I; + fl2 = 128.0; + in3 = 255; + c4 = 512.7 + 1024.1 * I; + + ffi_call(&cif, FFI_FN(return_c), &rc, values); + rc2 = return_c(c1, fl2, in3, c4); + printf ("%f,%fi vs %f,%fi\n", + T_CONV creal (rc), T_CONV cimag (rc), + T_CONV creal (rc2), T_CONV cimag (rc2)); + CHECK(rc == rc2); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c new file mode 100644 index 0000000..727410d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex1.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c new file mode 100644 index 0000000..a2aeada --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex1.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c new file mode 100644 index 0000000..103504b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex1.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc new file mode 100644 index 0000000..265170b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc @@ -0,0 +1,44 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +_Complex T_C_TYPE +return_c(_Complex T_C_TYPE c1, _Complex T_C_TYPE c2, + unsigned int in3, _Complex T_C_TYPE c4) +{ + volatile _Complex T_C_TYPE r = c1 + c2 + in3 + c4; + return r; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + _Complex T_C_TYPE c1, c2, c4, rc, rc2; + unsigned int in3; + args[0] = &T_FFI_TYPE; + args[1] = &T_FFI_TYPE; + args[2] = &ffi_type_uint; + args[3] = &T_FFI_TYPE; + values[0] = &c1; + values[1] = &c2; + values[2] = &in3; + values[3] = &c4; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, + &T_FFI_TYPE, args) == FFI_OK); + c1 = 127.0 + 255.0 * I; + c2 = 128.0 + 256.0; + in3 = 255; + c4 = 512.7 + 1024.1 * I; + + ffi_call(&cif, FFI_FN(return_c), &rc, values); + rc2 = return_c(c1, c2, in3, c4); + printf ("%f,%fi vs %f,%fi\n", + T_CONV creal (rc), T_CONV cimag (rc), + T_CONV creal (rc2), T_CONV cimag (rc2)); + CHECK(rc == rc2); + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c new file mode 100644 index 0000000..ab9efac --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex2.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c new file mode 100644 index 0000000..d7f22c2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex2.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c new file mode 100644 index 0000000..3edea62 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex2.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c new file mode 100644 index 0000000..e2497cc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c new file mode 100644 index 0000000..a35528f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c new file mode 100644 index 0000000..142d7be --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex.inc" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c new file mode 100644 index 0000000..b00c404 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ + +#include "static-chain.h" + +#if defined(__GNUC__) && !defined(__clang__) && defined(STATIC_CHAIN_REG) + +#include "ffitest.h" + +/* Blatent assumption here that the prologue doesn't clobber the + static chain for trivial functions. If this is not true, don't + define STATIC_CHAIN_REG, and we'll test what we can via other tests. */ +void *doit(void) +{ + register void *chain __asm__(STATIC_CHAIN_REG); + return chain; +} + +int main() +{ + ffi_cif cif; + void *result; + + CHECK(ffi_prep_cif(&cif, ABI_NUM, 0, &ffi_type_pointer, NULL) == FFI_OK); + + ffi_call_go(&cif, FFI_FN(doit), &result, NULL, &result); + + CHECK(result == &result); + + return 0; +} + +#else /* UNSUPPORTED */ +int main() { return 0; } +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c new file mode 100644 index 0000000..7b34afc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ + +#include "ffitest.h" + +void doit(ffi_cif *cif, void *rvalue, void **avalue, void *closure) +{ + (void)cif; + (void)avalue; + *(void **)rvalue = closure; +} + +typedef void * (*FN)(void); + +int main() +{ + ffi_cif cif; + ffi_go_closure cl; + void *result; + + CHECK(ffi_prep_cif(&cif, ABI_NUM, 0, &ffi_type_pointer, NULL) == FFI_OK); + CHECK(ffi_prep_go_closure(&cl, &cif, doit) == FFI_OK); + + ffi_call_go(&cif, FFI_FN(*(FN *)&cl), &result, NULL, &cl); + + CHECK(result == &cl); + + exit(0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h new file mode 100644 index 0000000..d27d362 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h @@ -0,0 +1 @@ +#include "../libffi.call/ffitest.h" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/go.exp b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/go.exp new file mode 100644 index 0000000..100c5e7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/go.exp @@ -0,0 +1,36 @@ +# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING3. If not see +# . + +dg-init +libffi-init + +global srcdir subdir + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] + +if { [libffi_feature_test "#ifdef FFI_GO_CLOSURES"] } { + run-many-tests $tlist "" +} else { + foreach test $tlist { + unsupported "$test" + } +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h new file mode 100644 index 0000000..3675b40 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h @@ -0,0 +1,19 @@ +#ifdef __aarch64__ +# define STATIC_CHAIN_REG "x18" +#elif defined(__alpha__) +# define STATIC_CHAIN_REG "$1" +#elif defined(__arm__) +# define STATIC_CHAIN_REG "ip" +#elif defined(__sparc__) +# if defined(__arch64__) || defined(__sparcv9) +# define STATIC_CHAIN_REG "g5" +# else +# define STATIC_CHAIN_REG "g2" +# endif +#elif defined(__x86_64__) +# define STATIC_CHAIN_REG "r10" +#elif defined(__i386__) +# ifndef ABI_NUM +# define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */ +# endif +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi.h new file mode 100644 index 0000000..89b3e32 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2008, 2009, Wayne Meissner + * + * Copyright (c) 2008-2013, Ruby FFI project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Ruby FFI project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RBFFI_RBFFI_H +#define RBFFI_RBFFI_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_PARAMETERS (32) + +extern VALUE rbffi_FFIModule; + +extern void rbffi_Type_Init(VALUE ffiModule); +extern void rbffi_Buffer_Init(VALUE ffiModule); +extern void rbffi_Invoker_Init(VALUE ffiModule); +extern void rbffi_Variadic_Init(VALUE ffiModule); +extern VALUE rbffi_AbstractMemoryClass, rbffi_InvokerClass; +extern int rbffi_type_size(VALUE type); +extern void rbffi_Thread_Init(VALUE moduleFFI); + +#ifdef __cplusplus +} +#endif + +#endif /* RBFFI_RBFFI_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi_endian.h b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi_endian.h new file mode 100644 index 0000000..ebb8420 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/rbffi_endian.h @@ -0,0 +1,59 @@ +#ifndef JFFI_ENDIAN_H +#define JFFI_ENDIAN_H + +#ifndef _MSC_VER +#include +#endif + +#include + +#if defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__HAIKU__) +# include +# if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN) +# define LITTLE_ENDIAN __LITTLE_ENDIAN +# endif +# if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN) +# define BIG_ENDIAN __BIG_ENDIAN +# endif +# if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) +# define BYTE_ORDER __BYTE_ORDER +# endif +#endif + +#ifdef __sun +# include +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# if defined(_BIG_ENDIAN) +# define BYTE_ORDER BIG_ENDIAN +# elif defined(_LITTLE_ENDIAN) +# define BYTE_ORDER LITTLE_ENDIAN +# else +# error "Cannot determine endian-ness" +# endif +#endif + +#if defined(_AIX) && !defined(BYTE_ORDER) +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# if defined(__BIG_ENDIAN__) +# define BYTE_ORDER BIG_ENDIAN +# elif defined(__LITTLE_ENDIAN__) +# define BYTE_ORDER LITTLE_ENDIAN +# else +# error "Cannot determine endian-ness" +# endif +#endif + +#if defined(_WIN32) +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# define BYTE_ORDER LITTLE_ENDIAN +#endif + +#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN) +# error "Cannot determine the endian-ness of this platform" +#endif + +#endif /* JFFI_ENDIAN_H */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ffi.gemspec b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ffi.gemspec new file mode 100644 index 0000000..eaae515 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ffi.gemspec @@ -0,0 +1,42 @@ +require File.expand_path("../lib/#{File.basename(__FILE__, '.gemspec')}/version", __FILE__) + +Gem::Specification.new do |s| + s.name = 'ffi' + s.version = FFI::VERSION + s.author = 'Wayne Meissner' + s.email = 'wmeissner@gmail.com' + s.homepage = 'https://github.com/ffi/ffi/wiki' + s.summary = 'Ruby FFI' + s.description = 'Ruby FFI library' + if s.respond_to?(:metadata) + s.metadata['bug_tracker_uri'] = 'https://github.com/ffi/ffi/issues' + s.metadata['changelog_uri'] = 'https://github.com/ffi/ffi/blob/master/CHANGELOG.md' + s.metadata['documentation_uri'] = 'https://github.com/ffi/ffi/wiki' + s.metadata['wiki_uri'] = 'https://github.com/ffi/ffi/wiki' + s.metadata['source_code_uri'] = 'https://github.com/ffi/ffi/' + s.metadata['mailing_list_uri'] = 'http://groups.google.com/group/ruby-ffi' + end + s.files = `git ls-files -z`.split("\x0").reject do |f| + f =~ /^(\.|bench|gen|libtest|nbproject|spec)/ + end + + # Add libffi git files + lfs = `git --git-dir ext/ffi_c/libffi/.git ls-files -z`.split("\x0") + # Add autoconf generated files of libffi + lfs += %w[ configure config.guess config.sub install-sh ltmain.sh missing fficonfig.h.in ] + # Add automake generated files of libffi + lfs += `git --git-dir ext/ffi_c/libffi/.git ls-files -z *.am */*.am`.gsub(".am\0", ".in\0").split("\x0") + s.files += lfs.map do |f| + File.join("ext/ffi_c/libffi", f) + end + + s.extensions << 'ext/ffi_c/extconf.rb' + s.rdoc_options = %w[--exclude=ext/ffi_c/.*\.o$ --exclude=ffi_c\.(bundle|so)$] + s.license = 'BSD-3-Clause' + s.require_paths << 'ext/ffi_c' + s.required_ruby_version = '>= 2.3' + s.add_development_dependency 'rake', '~> 13.0' + s.add_development_dependency 'rake-compiler', '~> 1.0' + s.add_development_dependency 'rake-compiler-dock', '~> 1.0' + s.add_development_dependency 'rspec', '~> 2.14.1' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi.rb new file mode 100644 index 0000000..3fb20a8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi.rb @@ -0,0 +1,27 @@ +if RUBY_ENGINE == 'ruby' + begin + require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c' + rescue Exception + require 'ffi_c' + end + + require 'ffi/ffi' + +elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 2, 20]) >= 0 + JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService") + require 'ffi/ffi' + +elsif RUBY_ENGINE == 'truffleruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [20, 1, 0]) >= 0 + require 'truffleruby/ffi_backend' + require 'ffi/ffi' + +else + # Remove the ffi gem dir from the load path, then reload the internal ffi implementation + $LOAD_PATH.delete(File.dirname(__FILE__)) + $LOAD_PATH.delete(File.join(File.dirname(__FILE__), 'ffi')) + unless $LOADED_FEATURES.nil? + $LOADED_FEATURES.delete(__FILE__) + $LOADED_FEATURES.delete('ffi.rb') + end + require 'ffi.rb' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/abstract_memory.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/abstract_memory.rb new file mode 100644 index 0000000..e0aa221 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/abstract_memory.rb @@ -0,0 +1,44 @@ +# +# Copyright (C) 2020 Lars Kanis +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + + +module FFI + class AbstractMemory + LONG_MAX = FFI::Pointer.new(1).size + private_constant :LONG_MAX + + # Return +true+ if +self+ has a size limit. + # + # @return [Boolean] + def size_limit? + size != LONG_MAX + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/autopointer.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/autopointer.rb new file mode 100644 index 0000000..679d7e6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/autopointer.rb @@ -0,0 +1,203 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# Copyright (C) 2008 Mike Dalessio +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +module FFI + class AutoPointer < Pointer + extend DataConverter + + # @overload initialize(pointer, method) + # @param pointer [Pointer] + # @param method [Method] + # @return [self] + # The passed Method will be invoked at GC time. + # @overload initialize(pointer, proc) + # @param pointer [Pointer] + # @return [self] + # The passed Proc will be invoked at GC time (SEE WARNING BELOW!) + # @note WARNING: passing a proc _may_ cause your pointer to never be + # GC'd, unless you're careful to avoid trapping a reference to the + # pointer in the proc. See the test specs for examples. + # @overload initialize(pointer) { |p| ... } + # @param pointer [Pointer] + # @yieldparam [Pointer] p +pointer+ passed to the block + # @return [self] + # The passed block will be invoked at GC time. + # @note + # WARNING: passing a block will cause your pointer to never be GC'd. + # This is bad. + # @overload initialize(pointer) + # @param pointer [Pointer] + # @return [self] + # The pointer's release() class method will be invoked at GC time. + # + # @note The safest, and therefore preferred, calling + # idiom is to pass a Method as the second parameter. Example usage: + # + # class PointerHelper + # def self.release(pointer) + # ... + # end + # end + # + # p = AutoPointer.new(other_pointer, PointerHelper.method(:release)) + # + # The above code will cause PointerHelper#release to be invoked at GC time. + # + # @note + # The last calling idiom (only one parameter) is generally only + # going to be useful if you subclass {AutoPointer}, and override + # #release, which by default does nothing. + def initialize(ptr, proc=nil, &block) + super(ptr.type_size, ptr) + raise TypeError, "Invalid pointer" if ptr.nil? || !ptr.kind_of?(Pointer) \ + || ptr.kind_of?(MemoryPointer) || ptr.kind_of?(AutoPointer) + + @releaser = if proc + if not proc.respond_to?(:call) + raise RuntimeError.new("proc must be callable") + end + CallableReleaser.new(ptr, proc) + + else + if not self.class.respond_to?(:release) + raise RuntimeError.new("no release method defined") + end + DefaultReleaser.new(ptr, self.class) + end + + ObjectSpace.define_finalizer(self, @releaser) + self + end + + # @return [nil] + # Free the pointer. + def free + @releaser.free + end + + # @param [Boolean] autorelease + # @return [Boolean] +autorelease+ + # Set +autorelease+ property. See {Pointer Autorelease section at Pointer}. + def autorelease=(autorelease) + @releaser.autorelease=(autorelease) + end + + # @return [Boolean] +autorelease+ + # Get +autorelease+ property. See {Pointer Autorelease section at Pointer}. + def autorelease? + @releaser.autorelease + end + + # @abstract Base class for {AutoPointer}'s releasers. + # + # All subclasses of Releaser should define a +#release(ptr)+ method. + # A releaser is an object in charge of release an {AutoPointer}. + class Releaser + attr_accessor :autorelease + + # @param [Pointer] ptr + # @param [#call] proc + # @return [nil] + # A new instance of Releaser. + def initialize(ptr, proc) + @ptr = ptr + @proc = proc + @autorelease = true + end + + # @return [nil] + # Free pointer. + def free + if @ptr + release(@ptr) + @autorelease = false + @ptr = nil + @proc = nil + end + end + + # @param args + # Release pointer if +autorelease+ is set. + def call(*args) + release(@ptr) if @autorelease && @ptr + end + end + + # DefaultReleaser is a {Releaser} used when an {AutoPointer} is defined + # without Proc or Method. In this case, the pointer to release must be of + # a class derived from AutoPointer with a {release} class method. + class DefaultReleaser < Releaser + # @param [Pointer] ptr + # @return [nil] + # Release +ptr+ using the {release} class method of its class. + def release(ptr) + @proc.release(ptr) + end + end + + # CallableReleaser is a {Releaser} used when an {AutoPointer} is defined with a + # Proc or a Method. + class CallableReleaser < Releaser + # Release +ptr+ by using Proc or Method defined at +ptr+ + # {AutoPointer#initialize initialization}. + # + # @param [Pointer] ptr + # @return [nil] + def release(ptr) + @proc.call(ptr) + end + end + + # Return native type of AutoPointer. + # + # Override {DataConverter#native_type}. + # @return [Type::POINTER] + # @raise {RuntimeError} if class does not implement a +#release+ method + def self.native_type + if not self.respond_to?(:release) + raise RuntimeError.new("no release method defined for #{self.inspect}") + end + Type::POINTER + end + + # Create a new AutoPointer. + # + # Override {DataConverter#from_native}. + # @overload self.from_native(ptr, ctx) + # @param [Pointer] ptr + # @param ctx not used. Please set +nil+. + # @return [AutoPointer] + def self.from_native(val, ctx) + self.new(val) + end + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/buffer.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/buffer.rb new file mode 100644 index 0000000..449e45b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/buffer.rb @@ -0,0 +1,4 @@ +# +# All the code from this file is now implemented in C. This file remains +# to satisfy any leftover require 'ffi/buffer' in user code +# diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/callback.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/callback.rb new file mode 100644 index 0000000..32d52f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/callback.rb @@ -0,0 +1,4 @@ +# +# All the code from this file is now implemented in C. This file remains +# to satisfy any leftover require 'ffi/callback' in user code +# diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/data_converter.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/data_converter.rb new file mode 100644 index 0000000..1527588 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/data_converter.rb @@ -0,0 +1,67 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +module FFI + # This module is used to extend somes classes and give then a common API. + # + # Most of methods defined here must be overriden. + module DataConverter + # Get native type. + # + # @overload native_type(type) + # @param [String, Symbol, Type] type + # @return [Type] + # Get native type from +type+. + # + # @overload native_type + # @raise {NotImplementedError} This method must be overriden. + def native_type(type = nil) + if type + @native_type = FFI.find_type(type) + else + native_type = @native_type + unless native_type + raise NotImplementedError, 'native_type method not overridden and no native_type set' + end + native_type + end + end + + # Convert to a native type. + def to_native(value, ctx) + value + end + + # Convert from a native type. + def from_native(value, ctx) + value + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb new file mode 100644 index 0000000..8fcb498 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb @@ -0,0 +1,296 @@ +# +# Copyright (C) 2009, 2010 Wayne Meissner +# Copyright (C) 2009 Luc Heinrich +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +module FFI + + # An instance of this class permits to manage {Enum}s. In fact, Enums is a collection of {Enum}s. + class Enums + + # @return [nil] + def initialize + @all_enums = Array.new + @tagged_enums = Hash.new + @symbol_map = Hash.new + end + + # @param [Enum] enum + # Add an {Enum} to the collection. + def <<(enum) + @all_enums << enum + @tagged_enums[enum.tag] = enum unless enum.tag.nil? + @symbol_map.merge!(enum.symbol_map) + end + + # @param query enum tag or part of an enum name + # @return [Enum] + # Find a {Enum} in collection. + def find(query) + if @tagged_enums.has_key?(query) + @tagged_enums[query] + else + @all_enums.detect { |enum| enum.symbols.include?(query) } + end + end + + # @param symbol a symbol to find in merge symbol maps of all enums. + # @return a symbol + def __map_symbol(symbol) + @symbol_map[symbol] + end + + end + + # Represents a C enum. + # + # For a C enum: + # enum fruits { + # apple, + # banana, + # orange, + # pineapple + # }; + # are defined this vocabulary: + # * a _symbol_ is a word from the enumeration (ie. _apple_, by example); + # * a _value_ is the value of a symbol in the enumeration (by example, apple has value _0_ and banana _1_). + class Enum + include DataConverter + + attr_reader :tag + attr_reader :native_type + + # @overload initialize(info, tag=nil) + # @param [nil, Enumerable] info + # @param [nil, Symbol] tag enum tag + # @overload initialize(native_type, info, tag=nil) + # @param [FFI::Type] native_type Native type for new Enum + # @param [nil, Enumerable] info symbols and values for new Enum + # @param [nil, Symbol] tag name of new Enum + def initialize(*args) + @native_type = args.first.kind_of?(FFI::Type) ? args.shift : Type::INT + info, @tag = *args + @kv_map = Hash.new + unless info.nil? + last_cst = nil + value = 0 + info.each do |i| + case i + when Symbol + raise ArgumentError, "duplicate enum key" if @kv_map.has_key?(i) + @kv_map[i] = value + last_cst = i + value += 1 + when Integer + @kv_map[last_cst] = i + value = i+1 + end + end + end + @vk_map = @kv_map.invert + end + + # @return [Array] enum symbol names + def symbols + @kv_map.keys + end + + # Get a symbol or a value from the enum. + # @overload [](query) + # Get enum value from symbol. + # @param [Symbol] query + # @return [Integer] + # @overload [](query) + # Get enum symbol from value. + # @param [Integer] query + # @return [Symbol] + def [](query) + case query + when Symbol + @kv_map[query] + when Integer + @vk_map[query] + end + end + alias find [] + + # Get the symbol map. + # @return [Hash] + def symbol_map + @kv_map + end + + alias to_h symbol_map + alias to_hash symbol_map + + # @param [Symbol, Integer, #to_int] val + # @param ctx unused + # @return [Integer] value of a enum symbol + def to_native(val, ctx) + @kv_map[val] || if val.is_a?(Integer) + val + elsif val.respond_to?(:to_int) + val.to_int + else + raise ArgumentError, "invalid enum value, #{val.inspect}" + end + end + + # @param val + # @return symbol name if it exists for +val+. + def from_native(val, ctx) + @vk_map[val] || val + end + end + + # Represents a C enum whose values are power of 2 + # + # @example + # enum { + # red = (1<<0), + # green = (1<<1), + # blue = (1<<2) + # } + # + # Contrary to classical enums, bitmask values are usually combined + # when used. + class Bitmask < Enum + + # @overload initialize(info, tag=nil) + # @param [nil, Enumerable] info symbols and bit rank for new Bitmask + # @param [nil, Symbol] tag name of new Bitmask + # @overload initialize(native_type, info, tag=nil) + # @param [FFI::Type] native_type Native type for new Bitmask + # @param [nil, Enumerable] info symbols and bit rank for new Bitmask + # @param [nil, Symbol] tag name of new Bitmask + def initialize(*args) + @native_type = args.first.kind_of?(FFI::Type) ? args.shift : Type::INT + info, @tag = *args + @kv_map = Hash.new + unless info.nil? + last_cst = nil + value = 0 + info.each do |i| + case i + when Symbol + raise ArgumentError, "duplicate bitmask key" if @kv_map.has_key?(i) + @kv_map[i] = 1 << value + last_cst = i + value += 1 + when Integer + raise ArgumentError, "bitmask index should be positive" if i<0 + @kv_map[last_cst] = 1 << i + value = i+1 + end + end + end + @vk_map = @kv_map.invert + end + + # Get a symbol list or a value from the bitmask + # @overload [](*query) + # Get bitmask value from symbol list + # @param [Symbol] query + # @return [Integer] + # @overload [](query) + # Get bitmaks value from symbol array + # @param [Array] query + # @return [Integer] + # @overload [](*query) + # Get a list of bitmask symbols corresponding to + # the or reduction of a list of integer + # @param [Integer] query + # @return [Array] + # @overload [](query) + # Get a list of bitmask symbols corresponding to + # the or reduction of a list of integer + # @param [Array] query + # @return [Array] + def [](*query) + flat_query = query.flatten + raise ArgumentError, "query should be homogeneous, #{query.inspect}" unless flat_query.all? { |o| o.is_a?(Symbol) } || flat_query.all? { |o| o.is_a?(Integer) || o.respond_to?(:to_int) } + case flat_query[0] + when Symbol + flat_query.inject(0) do |val, o| + v = @kv_map[o] + if v then val |= v else val end + end + when Integer, ->(o) { o.respond_to?(:to_int) } + val = flat_query.inject(0) { |mask, o| mask |= o.to_int } + @kv_map.select { |_, v| v & val != 0 }.keys + end + end + + # Get the native value of a bitmask + # @overload to_native(query, ctx) + # @param [Symbol, Integer, #to_int] query + # @param ctx unused + # @return [Integer] value of a bitmask + # @overload to_native(query, ctx) + # @param [Array] query + # @param ctx unused + # @return [Integer] value of a bitmask + def to_native(query, ctx) + return 0 if query.nil? + flat_query = [query].flatten + flat_query.inject(0) do |val, o| + case o + when Symbol + v = @kv_map[o] + raise ArgumentError, "invalid bitmask value, #{o.inspect}" unless v + val |= v + when Integer + val |= o + when ->(obj) { obj.respond_to?(:to_int) } + val |= o.to_int + else + raise ArgumentError, "invalid bitmask value, #{o.inspect}" + end + end + end + + # @param [Integer] val + # @param ctx unused + # @return [Array] list of symbol names corresponding to val, plus an optional remainder if some bits don't match any constant + def from_native(val, ctx) + list = @kv_map.select { |_, v| v & val != 0 }.keys + # If there are unmatch flags, + # return them in an integer, + # else information can be lost. + # Similar to Enum behavior. + remainder = val ^ list.inject(0) do |tmp, o| + v = @kv_map[o] + if v then tmp |= v else tmp end + end + list.push remainder unless remainder == 0 + return list + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/errno.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/errno.rb new file mode 100644 index 0000000..de82d89 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/errno.rb @@ -0,0 +1,43 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +module FFI + # @return (see FFI::LastError.error) + # @see FFI::LastError.error + def self.errno + FFI::LastError.error + end + # @param error (see FFI::LastError.error=) + # @return (see FFI::LastError.error=) + # @see FFI::LastError.error= + def self.errno=(error) + FFI::LastError.error = error + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/ffi.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/ffi.rb new file mode 100644 index 0000000..dfffa8c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/ffi.rb @@ -0,0 +1,47 @@ +# +# Copyright (C) 2008-2010 JRuby project +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +require 'ffi/platform' +require 'ffi/data_converter' +require 'ffi/types' +require 'ffi/library' +require 'ffi/errno' +require 'ffi/abstract_memory' +require 'ffi/pointer' +require 'ffi/memorypointer' +require 'ffi/struct' +require 'ffi/union' +require 'ffi/managedstruct' +require 'ffi/callback' +require 'ffi/io' +require 'ffi/autopointer' +require 'ffi/variadic' +require 'ffi/enum' +require 'ffi/version' diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/io.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/io.rb new file mode 100644 index 0000000..e1bb955 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/io.rb @@ -0,0 +1,62 @@ +# +# Copyright (C) 2008, 2009 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +module FFI + + # This module implements a couple of class methods to play with IO. + module IO + # @param [Integer] fd file decriptor + # @param [String] mode mode string + # @return [::IO] + # Synonym for IO::for_fd. + def self.for_fd(fd, mode = "r") + ::IO.for_fd(fd, mode) + end + + # @param [#read] io io to read from + # @param [AbstractMemory] buf destination for data read from +io+ + # @param [nil, Numeric] len maximul number of bytes to read from +io+. If +nil+, + # read until end of file. + # @return [Numeric] length really read, in bytes + # + # A version of IO#read that reads data from an IO and put then into a native buffer. + # + # This will be optimized at some future time to eliminate the double copy. + # + def self.native_read(io, buf, len) + tmp = io.read(len) + return -1 unless tmp + buf.put_bytes(0, tmp) + tmp.length + end + + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/library.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/library.rb new file mode 100644 index 0000000..43b2bfe --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/library.rb @@ -0,0 +1,592 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +module FFI + CURRENT_PROCESS = USE_THIS_PROCESS_AS_LIBRARY = Object.new + + # @param [#to_s] lib library name + # @return [String] library name formatted for current platform + # Transform a generic library name to a platform library name + # @example + # # Linux + # FFI.map_library_name 'c' # -> "libc.so.6" + # FFI.map_library_name 'jpeg' # -> "libjpeg.so" + # # Windows + # FFI.map_library_name 'c' # -> "msvcrt.dll" + # FFI.map_library_name 'jpeg' # -> "jpeg.dll" + def self.map_library_name(lib) + # Mangle the library name to reflect the native library naming conventions + lib = Library::LIBC if lib == 'c' + + if lib && File.basename(lib) == lib + lib = Platform::LIBPREFIX + lib unless lib =~ /^#{Platform::LIBPREFIX}/ + r = Platform::IS_WINDOWS || Platform::IS_MAC ? "\\.#{Platform::LIBSUFFIX}$" : "\\.so($|\\.[1234567890]+)" + lib += ".#{Platform::LIBSUFFIX}" unless lib =~ /#{r}/ + end + + lib + end + + # Exception raised when a function is not found in libraries + class NotFoundError < LoadError + def initialize(function, *libraries) + super("Function '#{function}' not found in [#{libraries[0].nil? ? 'current process' : libraries.join(", ")}]") + end + end + + # This module is the base to use native functions. + # + # A basic usage may be: + # require 'ffi' + # + # module Hello + # extend FFI::Library + # ffi_lib FFI::Library::LIBC + # attach_function 'puts', [ :string ], :int + # end + # + # Hello.puts("Hello, World") + # + # + module Library + CURRENT_PROCESS = FFI::CURRENT_PROCESS + LIBC = FFI::Platform::LIBC + + # @param mod extended object + # @return [nil] + # @raise {RuntimeError} if +mod+ is not a Module + # Test if extended object is a Module. If not, raise RuntimeError. + def self.extended(mod) + raise RuntimeError.new("must only be extended by module") unless mod.kind_of?(::Module) + end + + + # @param [Array] names names of libraries to load + # @return [Array] + # @raise {LoadError} if a library cannot be opened + # Load native libraries. + def ffi_lib(*names) + raise LoadError.new("library names list must not be empty") if names.empty? + + lib_flags = defined?(@ffi_lib_flags) ? @ffi_lib_flags : FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL + ffi_libs = names.map do |name| + + if name == FFI::CURRENT_PROCESS + FFI::DynamicLibrary.open(nil, FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL) + + else + libnames = (name.is_a?(::Array) ? name : [ name ]).map(&:to_s).map { |n| [ n, FFI.map_library_name(n) ].uniq }.flatten.compact + lib = nil + errors = {} + + libnames.each do |libname| + begin + orig = libname + lib = FFI::DynamicLibrary.open(libname, lib_flags) + break if lib + + rescue Exception => ex + ldscript = false + if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)/ + if File.binread($1) =~ /(?:GROUP|INPUT) *\( *([^ \)]+)/ + libname = $1 + ldscript = true + end + end + + if ldscript + retry + else + # TODO better library lookup logic + unless libname.start_with?("/") || FFI::Platform.windows? + path = ['/usr/lib/','/usr/local/lib/','/opt/local/lib/', '/opt/homebrew/lib/'].find do |pth| + File.exist?(pth + libname) + end + if path + libname = path + libname + retry + end + end + + libr = (orig == libname ? orig : "#{orig} #{libname}") + errors[libr] = ex + end + end + end + + if lib.nil? + raise LoadError.new(errors.values.join(".\n")) + end + + # return the found lib + lib + end + end + + @ffi_libs = ffi_libs + end + + # Set the calling convention for {#attach_function} and {#callback} + # + # @see http://en.wikipedia.org/wiki/Stdcall#stdcall + # @note +:stdcall+ is typically used for attaching Windows API functions + # + # @param [Symbol] convention one of +:default+, +:stdcall+ + # @return [Symbol] the new calling convention + def ffi_convention(convention = nil) + @ffi_convention ||= :default + @ffi_convention = convention if convention + @ffi_convention + end + + # @see #ffi_lib + # @return [Array] array of currently loaded FFI libraries + # @raise [LoadError] if no libraries have been loaded (using {#ffi_lib}) + # Get FFI libraries loaded using {#ffi_lib}. + def ffi_libraries + raise LoadError.new("no library specified") if !defined?(@ffi_libs) || @ffi_libs.empty? + @ffi_libs + end + + # Flags used in {#ffi_lib}. + # + # This map allows you to supply symbols to {#ffi_lib_flags} instead of + # the actual constants. + FlagsMap = { + :global => DynamicLibrary::RTLD_GLOBAL, + :local => DynamicLibrary::RTLD_LOCAL, + :lazy => DynamicLibrary::RTLD_LAZY, + :now => DynamicLibrary::RTLD_NOW + } + + # Sets library flags for {#ffi_lib}. + # + # @example + # ffi_lib_flags(:lazy, :local) # => 5 + # + # @param [Symbol, …] flags (see {FlagsMap}) + # @return [Fixnum] the new value + def ffi_lib_flags(*flags) + @ffi_lib_flags = flags.inject(0) { |result, f| result | FlagsMap[f] } + end + + + ## + # @overload attach_function(func, args, returns, options = {}) + # @example attach function without an explicit name + # module Foo + # extend FFI::Library + # ffi_lib FFI::Library::LIBC + # attach_function :malloc, [:size_t], :pointer + # end + # # now callable via Foo.malloc + # @overload attach_function(name, func, args, returns, options = {}) + # @example attach function with an explicit name + # module Bar + # extend FFI::Library + # ffi_lib FFI::Library::LIBC + # attach_function :c_malloc, :malloc, [:size_t], :pointer + # end + # # now callable via Bar.c_malloc + # + # Attach C function +func+ to this module. + # + # + # @param [#to_s] name name of ruby method to attach as + # @param [#to_s] func name of C function to attach + # @param [Array] args an array of types + # @param [Symbol] returns type of return value + # @option options [Boolean] :blocking (@blocking) set to true if the C function is a blocking call + # @option options [Symbol] :convention (:default) calling convention (see {#ffi_convention}) + # @option options [FFI::Enums] :enums + # @option options [Hash] :type_map + # + # @return [FFI::VariadicInvoker] + # + # @raise [FFI::NotFoundError] if +func+ cannot be found in the attached libraries (see {#ffi_lib}) + def attach_function(name, func, args, returns = nil, options = nil) + mname, a2, a3, a4, a5 = name, func, args, returns, options + cname, arg_types, ret_type, opts = (a4 && (a2.is_a?(String) || a2.is_a?(Symbol))) ? [ a2, a3, a4, a5 ] : [ mname.to_s, a2, a3, a4 ] + + # Convert :foo to the native type + arg_types = arg_types.map { |e| find_type(e) } + options = { + :convention => ffi_convention, + :type_map => defined?(@ffi_typedefs) ? @ffi_typedefs : nil, + :blocking => defined?(@blocking) && @blocking, + :enums => defined?(@ffi_enums) ? @ffi_enums : nil, + } + + @blocking = false + options.merge!(opts) if opts && opts.is_a?(Hash) + + # Try to locate the function in any of the libraries + invokers = [] + ffi_libraries.each do |lib| + if invokers.empty? + begin + function = nil + function_names(cname, arg_types).find do |fname| + function = lib.find_function(fname) + end + raise LoadError unless function + + invokers << if arg_types.length > 0 && arg_types[arg_types.length - 1] == FFI::NativeType::VARARGS + VariadicInvoker.new(function, arg_types, find_type(ret_type), options) + + else + Function.new(find_type(ret_type), arg_types, function, options) + end + + rescue LoadError + end + end + end + invoker = invokers.compact.shift + raise FFI::NotFoundError.new(cname.to_s, ffi_libraries.map { |lib| lib.name }) unless invoker + + invoker.attach(self, mname.to_s) + invoker + end + + # @param [#to_s] name function name + # @param [Array] arg_types function's argument types + # @return [Array] + # This function returns a list of possible names to lookup. + # @note Function names on windows may be decorated if they are using stdcall. See + # * http://en.wikipedia.org/wiki/Name_mangling#C_name_decoration_in_Microsoft_Windows + # * http://msdn.microsoft.com/en-us/library/zxk0tw93%28v=VS.100%29.aspx + # * http://en.wikibooks.org/wiki/X86_Disassembly/Calling_Conventions#STDCALL + # Note that decorated names can be overridden via def files. Also note that the + # windows api, although using, doesn't have decorated names. + def function_names(name, arg_types) + result = [name.to_s] + if ffi_convention == :stdcall + # Get the size of each parameter + size = arg_types.inject(0) do |mem, arg| + size = arg.size + # The size must be a multiple of 4 + size += (4 - size) % 4 + mem + size + end + + result << "_#{name.to_s}@#{size}" # win32 + result << "#{name.to_s}@#{size}" # win64 + end + result + end + + # @overload attach_variable(mname, cname, type) + # @param [#to_s] mname name of ruby method to attach as + # @param [#to_s] cname name of C variable to attach + # @param [DataConverter, Struct, Symbol, Type] type C variable's type + # @example + # module Bar + # extend FFI::Library + # ffi_lib 'my_lib' + # attach_variable :c_myvar, :myvar, :long + # end + # # now callable via Bar.c_myvar + # @overload attach_variable(cname, type) + # @param [#to_s] mname name of ruby method to attach as + # @param [DataConverter, Struct, Symbol, Type] type C variable's type + # @example + # module Bar + # extend FFI::Library + # ffi_lib 'my_lib' + # attach_variable :myvar, :long + # end + # # now callable via Bar.myvar + # @return [DynamicLibrary::Symbol] + # @raise {FFI::NotFoundError} if +cname+ cannot be found in libraries + # + # Attach C variable +cname+ to this module. + def attach_variable(mname, a1, a2 = nil) + cname, type = a2 ? [ a1, a2 ] : [ mname.to_s, a1 ] + address = nil + ffi_libraries.each do |lib| + begin + address = lib.find_variable(cname.to_s) + break unless address.nil? + rescue LoadError + end + end + + raise FFI::NotFoundError.new(cname, ffi_libraries) if address.nil? || address.null? + if type.is_a?(Class) && type < FFI::Struct + # If it is a global struct, just attach directly to the pointer + s = s = type.new(address) # Assigning twice to suppress unused variable warning + self.module_eval <<-code, __FILE__, __LINE__ + @@ffi_gvar_#{mname} = s + def self.#{mname} + @@ffi_gvar_#{mname} + end + code + + else + sc = Class.new(FFI::Struct) + sc.layout :gvar, find_type(type) + s = sc.new(address) + # + # Attach to this module as mname/mname= + # + self.module_eval <<-code, __FILE__, __LINE__ + @@ffi_gvar_#{mname} = s + def self.#{mname} + @@ffi_gvar_#{mname}[:gvar] + end + def self.#{mname}=(value) + @@ffi_gvar_#{mname}[:gvar] = value + end + code + + end + + address + end + + + # @overload callback(name, params, ret) + # @param name callback name to add to type map + # @param [Array] params array of parameters' types + # @param [DataConverter, Struct, Symbol, Type] ret callback return type + # @overload callback(params, ret) + # @param [Array] params array of parameters' types + # @param [DataConverter, Struct, Symbol, Type] ret callback return type + # @return [FFI::CallbackInfo] + def callback(*args) + raise ArgumentError, "wrong number of arguments" if args.length < 2 || args.length > 3 + name, params, ret = if args.length == 3 + args + else + [ nil, args[0], args[1] ] + end + + native_params = params.map { |e| find_type(e) } + raise ArgumentError, "callbacks cannot have variadic parameters" if native_params.include?(FFI::Type::VARARGS) + options = Hash.new + options[:convention] = ffi_convention + options[:enums] = @ffi_enums if defined?(@ffi_enums) + ret_type = find_type(ret) + if ret_type == Type::STRING + raise TypeError, ":string is not allowed as return type of callbacks" + end + cb = FFI::CallbackInfo.new(ret_type, native_params, options) + + # Add to the symbol -> type map (unless there was no name) + unless name.nil? + typedef cb, name + end + + cb + end + + # Register or get an already registered type definition. + # + # To register a new type definition, +old+ should be a {FFI::Type}. +add+ + # is in this case the type definition. + # + # If +old+ is a {DataConverter}, a {Type::Mapped} is returned. + # + # If +old+ is +:enum+ + # * and +add+ is an +Array+, a call to {#enum} is made with +add+ as single parameter; + # * in others cases, +info+ is used to create a named enum. + # + # If +old+ is a key for type map, #typedef get +old+ type definition. + # + # @param [DataConverter, Symbol, Type] old + # @param [Symbol] add + # @param [Symbol] info + # @return [FFI::Enum, FFI::Type] + def typedef(old, add, info=nil) + @ffi_typedefs = Hash.new unless defined?(@ffi_typedefs) + + @ffi_typedefs[add] = if old.kind_of?(FFI::Type) + old + + elsif @ffi_typedefs.has_key?(old) + @ffi_typedefs[old] + + elsif old.is_a?(DataConverter) + FFI::Type::Mapped.new(old) + + elsif old == :enum + if add.kind_of?(Array) + self.enum(add) + else + self.enum(info, add) + end + + else + FFI.find_type(old) + end + end + + private + # Generic enum builder + # @param [Class] klass can be one of FFI::Enum or FFI::Bitmask + # @param args (see #enum or #bitmask) + def generic_enum(klass, *args) + native_type = args.first.kind_of?(FFI::Type) ? args.shift : nil + name, values = if args[0].kind_of?(Symbol) && args[1].kind_of?(Array) + [ args[0], args[1] ] + elsif args[0].kind_of?(Array) + [ nil, args[0] ] + else + [ nil, args ] + end + @ffi_enums = FFI::Enums.new unless defined?(@ffi_enums) + @ffi_enums << (e = native_type ? klass.new(native_type, values, name) : klass.new(values, name)) + + # If called with a name, add a typedef alias + typedef(e, name) if name + e + end + + public + # @overload enum(name, values) + # Create a named enum. + # @example + # enum :foo, [:zero, :one, :two] # named enum + # @param [Symbol] name name for new enum + # @param [Array] values values for enum + # @overload enum(*args) + # Create an unnamed enum. + # @example + # enum :zero, :one, :two # unnamed enum + # @param args values for enum + # @overload enum(values) + # Create an unnamed enum. + # @example + # enum [:zero, :one, :two] # unnamed enum, equivalent to above example + # @param [Array] values values for enum + # @overload enum(native_type, name, values) + # Create a named enum and specify the native type. + # @example + # enum FFI::Type::UINT64, :foo, [:zero, :one, :two] # named enum + # @param [FFI::Type] native_type native type for new enum + # @param [Symbol] name name for new enum + # @param [Array] values values for enum + # @overload enum(native_type, *args) + # Create an unnamed enum and specify the native type. + # @example + # enum FFI::Type::UINT64, :zero, :one, :two # unnamed enum + # @param [FFI::Type] native_type native type for new enum + # @param args values for enum + # @overload enum(native_type, values) + # Create an unnamed enum and specify the native type. + # @example + # enum Type::UINT64, [:zero, :one, :two] # unnamed enum, equivalent to above example + # @param [FFI::Type] native_type native type for new enum + # @param [Array] values values for enum + # @return [FFI::Enum] + # Create a new {FFI::Enum}. + def enum(*args) + generic_enum(FFI::Enum, *args) + end + + # @overload bitmask(name, values) + # Create a named bitmask + # @example + # bitmask :foo, [:red, :green, :blue] # bits 0,1,2 are used + # bitmask :foo, [:red, :green, 5, :blue] # bits 0,5,6 are used + # @param [Symbol] name for new bitmask + # @param [Array] values for new bitmask + # @overload bitmask(*args) + # Create an unamed bitmask + # @example + # bm = bitmask :red, :green, :blue # bits 0,1,2 are used + # bm = bitmask :red, :green, 5, blue # bits 0,5,6 are used + # @param [Symbol, Integer] args values for new bitmask + # @overload bitmask(values) + # Create an unamed bitmask + # @example + # bm = bitmask [:red, :green, :blue] # bits 0,1,2 are used + # bm = bitmask [:red, :green, 5, blue] # bits 0,5,6 are used + # @param [Array] values for new bitmask + # @overload bitmask(native_type, name, values) + # Create a named enum and specify the native type. + # @example + # bitmask FFI::Type::UINT64, :foo, [:red, :green, :blue] + # @param [FFI::Type] native_type native type for new bitmask + # @param [Symbol] name for new bitmask + # @param [Array] values for new bitmask + # @overload bitmask(native_type, *args) + # @example + # bitmask FFI::Type::UINT64, :red, :green, :blue + # @param [FFI::Type] native_type native type for new bitmask + # @param [Symbol, Integer] args values for new bitmask + # @overload bitmask(native_type, values) + # Create a named enum and specify the native type. + # @example + # bitmask FFI::Type::UINT64, [:red, :green, :blue] + # @param [FFI::Type] native_type native type for new bitmask + # @param [Array] values for new bitmask + # @return [FFI::Bitmask] + # Create a new FFI::Bitmask + def bitmask(*args) + generic_enum(FFI::Bitmask, *args) + end + + # @param name + # @return [FFI::Enum] + # Find an enum by name. + def enum_type(name) + @ffi_enums.find(name) if defined?(@ffi_enums) + end + + # @param symbol + # @return [FFI::Enum] + # Find an enum by a symbol it contains. + def enum_value(symbol) + @ffi_enums.__map_symbol(symbol) + end + + # @param [DataConverter, Type, Struct, Symbol] t type to find + # @return [Type] + # Find a type definition. + def find_type(t) + if t.kind_of?(Type) + t + + elsif defined?(@ffi_typedefs) && @ffi_typedefs.has_key?(t) + @ffi_typedefs[t] + + elsif t.is_a?(Class) && t < Struct + Type::POINTER + + elsif t.is_a?(DataConverter) + # Add a typedef so next time the converter is used, it hits the cache + typedef Type::Mapped.new(t), t + + end || FFI.find_type(t) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/managedstruct.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/managedstruct.rb new file mode 100644 index 0000000..b5ec8a3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/managedstruct.rb @@ -0,0 +1,84 @@ +# Copyright (C) 2008 Mike Dalessio +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +module FFI + # + # FFI::ManagedStruct allows custom garbage-collection of your FFI::Structs. + # + # The typical use case would be when interacting with a library + # that has a nontrivial memory management design, such as a linked + # list or a binary tree. + # + # When the {Struct} instance is garbage collected, FFI::ManagedStruct will + # invoke the class's release() method during object finalization. + # + # @example Example usage: + # module MyLibrary + # ffi_lib "libmylibrary" + # attach_function :new_dlist, [], :pointer + # attach_function :destroy_dlist, [:pointer], :void + # end + # + # class DoublyLinkedList < FFI::ManagedStruct + # @@@ + # struct do |s| + # s.name 'struct dlist' + # s.include 'dlist.h' + # s.field :head, :pointer + # s.field :tail, :pointer + # end + # @@@ + # + # def self.release ptr + # MyLibrary.destroy_dlist(ptr) + # end + # end + # + # begin + # ptr = DoublyLinkedList.new(MyLibrary.new_dlist) + # # do something with the list + # end + # # struct is out of scope, and will be GC'd using DoublyLinkedList#release + # + # + class ManagedStruct < FFI::Struct + + # @overload initialize(pointer) + # @param [Pointer] pointer + # Create a new ManagedStruct which will invoke the class method #release on + # @overload initialize + # A new instance of FFI::ManagedStruct. + def initialize(pointer=nil) + raise NoMethodError, "release() not implemented for class #{self}" unless self.class.respond_to? :release + raise ArgumentError, "Must supply a pointer to memory for the Struct" unless pointer + super AutoPointer.new(pointer, self.class.method(:release)) + end + + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/memorypointer.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/memorypointer.rb new file mode 100644 index 0000000..9f07bc6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/memorypointer.rb @@ -0,0 +1 @@ +# This class is now implemented in C diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform.rb new file mode 100644 index 0000000..bf01a27 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform.rb @@ -0,0 +1,185 @@ +# +# Copyright (C) 2008, 2009 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +require 'rbconfig' +module FFI + class PlatformError < LoadError; end + + # This module defines different constants and class methods to play with + # various platforms. + module Platform + OS = case RbConfig::CONFIG['host_os'].downcase + when /linux/ + "linux" + when /darwin/ + "darwin" + when /freebsd/ + "freebsd" + when /netbsd/ + "netbsd" + when /openbsd/ + "openbsd" + when /dragonfly/ + "dragonflybsd" + when /sunos|solaris/ + "solaris" + when /mingw|mswin/ + "windows" + else + RbConfig::CONFIG['host_os'].downcase + end + + OSVERSION = RbConfig::CONFIG['host_os'].gsub(/[^\d]/, '').to_i + + CPU = RbConfig::CONFIG['host_cpu'] + + ARCH = case CPU.downcase + when /amd64|x86_64|x64/ + "x86_64" + when /i\d86|x86|i86pc/ + "i386" + when /ppc64|powerpc64/ + "powerpc64" + when /ppc|powerpc/ + "powerpc" + when /sparcv9|sparc64/ + "sparcv9" + when /arm64|aarch64/ # MacOS calls it "arm64", other operating systems "aarch64" + "aarch64" + when /^arm/ + if OS == "darwin" # Ruby before 3.0 reports "arm" instead of "arm64" as host_cpu on darwin + "aarch64" + else + "arm" + end + else + RbConfig::CONFIG['host_cpu'] + end + + private + # @param [String) os + # @return [Boolean] + # Test if current OS is +os+. + def self.is_os(os) + OS == os + end + + IS_GNU = defined?(GNU_LIBC) + IS_LINUX = is_os("linux") + IS_MAC = is_os("darwin") + IS_FREEBSD = is_os("freebsd") + IS_NETBSD = is_os("netbsd") + IS_OPENBSD = is_os("openbsd") + IS_DRAGONFLYBSD = is_os("dragonfly") + IS_SOLARIS = is_os("solaris") + IS_WINDOWS = is_os("windows") + IS_BSD = IS_MAC || IS_FREEBSD || IS_NETBSD || IS_OPENBSD || IS_DRAGONFLYBSD + + # Add the version for known ABI breaks + name_version = "12" if IS_FREEBSD && OSVERSION >= 12 # 64-bit inodes + + NAME = "#{ARCH}-#{OS}#{name_version}" + CONF_DIR = File.join(File.dirname(__FILE__), 'platform', NAME) + + public + + LIBPREFIX = case OS + when /windows|msys/ + '' + when /cygwin/ + 'cyg' + else + 'lib' + end + + LIBSUFFIX = case OS + when /darwin/ + 'dylib' + when /linux|bsd|solaris/ + 'so' + when /windows|cygwin|msys/ + 'dll' + else + # Punt and just assume a sane unix (i.e. anything but AIX) + 'so' + end + + LIBC = if IS_WINDOWS + crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase' + "#{crtname}.dll" + elsif IS_GNU + GNU_LIBC + elsif OS == 'cygwin' + "cygwin1.dll" + elsif OS == 'msys' + # Not sure how msys 1.0 behaves, tested on MSYS2. + "msys-2.0.dll" + else + "#{LIBPREFIX}c.#{LIBSUFFIX}" + end + + LITTLE_ENDIAN = 1234 unless defined?(LITTLE_ENDIAN) + BIG_ENDIAN = 4321 unless defined?(BIG_ENDIAN) + unless defined?(BYTE_ORDER) + BYTE_ORDER = [0x12345678].pack("I") == [0x12345678].pack("N") ? BIG_ENDIAN : LITTLE_ENDIAN + end + + # Test if current OS is a *BSD (include MAC) + # @return [Boolean] + def self.bsd? + IS_BSD + end + + # Test if current OS is Windows + # @return [Boolean] + def self.windows? + IS_WINDOWS + end + + # Test if current OS is Mac OS + # @return [Boolean] + def self.mac? + IS_MAC + end + + # Test if current OS is Solaris (Sun OS) + # @return [Boolean] + def self.solaris? + IS_SOLARIS + end + + # Test if current OS is a unix OS + # @return [Boolean] + def self.unix? + !IS_WINDOWS + end + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-darwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-darwin/types.conf new file mode 100644 index 0000000..68841bb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-darwin/types.conf @@ -0,0 +1,130 @@ +rbx.platform.typedef.__darwin_blkcnt_t = long_long +rbx.platform.typedef.__darwin_blksize_t = int +rbx.platform.typedef.__darwin_clock_t = ulong +rbx.platform.typedef.__darwin_ct_rune_t = int +rbx.platform.typedef.__darwin_dev_t = int +rbx.platform.typedef.__darwin_fsblkcnt_t = uint +rbx.platform.typedef.__darwin_fsfilcnt_t = uint +rbx.platform.typedef.__darwin_gid_t = uint +rbx.platform.typedef.__darwin_id_t = uint +rbx.platform.typedef.__darwin_ino64_t = ulong_long +rbx.platform.typedef.__darwin_ino_t = ulong_long +rbx.platform.typedef.__darwin_intptr_t = long +rbx.platform.typedef.__darwin_mach_port_name_t = uint +rbx.platform.typedef.__darwin_mach_port_t = uint +rbx.platform.typedef.__darwin_mode_t = ushort +rbx.platform.typedef.__darwin_natural_t = uint +rbx.platform.typedef.__darwin_off_t = long_long +rbx.platform.typedef.__darwin_pid_t = int +rbx.platform.typedef.__darwin_pthread_key_t = ulong +rbx.platform.typedef.__darwin_ptrdiff_t = long +rbx.platform.typedef.__darwin_rune_t = int +rbx.platform.typedef.__darwin_sigset_t = uint +rbx.platform.typedef.__darwin_size_t = ulong +rbx.platform.typedef.__darwin_socklen_t = uint +rbx.platform.typedef.__darwin_ssize_t = long +rbx.platform.typedef.__darwin_suseconds_t = int +rbx.platform.typedef.__darwin_time_t = long +rbx.platform.typedef.__darwin_uid_t = uint +rbx.platform.typedef.__darwin_useconds_t = uint +rbx.platform.typedef.__darwin_uuid_string_t[37] = char +rbx.platform.typedef.__darwin_uuid_t[16] = uchar +rbx.platform.typedef.__darwin_wchar_t = int +rbx.platform.typedef.__darwin_wint_t = int +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.errno_t = int +rbx.platform.typedef.fd_mask = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = uint +rbx.platform.typedef.fsfilcnt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.rsize_t = ulong +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sae_associd_t = uint +rbx.platform.typedef.sae_connid_t = uint +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.syscall_arg_t = ulong_long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.user_addr_t = ulong_long +rbx.platform.typedef.user_long_t = long_long +rbx.platform.typedef.user_off_t = long_long +rbx.platform.typedef.user_size_t = ulong_long +rbx.platform.typedef.user_ssize_t = long_long +rbx.platform.typedef.user_time_t = long_long +rbx.platform.typedef.user_ulong_t = ulong_long +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd/types.conf new file mode 100644 index 0000000..8d111e0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = int +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long_long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = int +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd12/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd12/types.conf new file mode 100644 index 0000000..3ccb8f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-freebsd12/types.conf @@ -0,0 +1,181 @@ +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.___wchar_t = uint +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__char16_t = ushort +rbx.platform.typedef.__char32_t = uint +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = long +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__daddr_t = long +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = long +rbx.platform.typedef.__intmax_t = long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = long +rbx.platform.typedef.__rman_res_t = ulong +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = long +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__u_register_t = ulong +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = ulong +rbx.platform.typedef.__uintmax_t = ulong +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = ulong +rbx.platform.typedef.__vm_paddr_t = ulong +rbx.platform.typedef.__vm_size_t = ulong +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.cap_ioctl_t = ulong +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = long +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = int +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.kpaddr_t = ulong +rbx.platform.typedef.ksize_t = ulong +rbx.platform.typedef.kssize_t = long +rbx.platform.typedef.kvaddr_t = ulong +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off64_t = long +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = long +rbx.platform.typedef.rman_res_t = ulong +rbx.platform.typedef.rsize_t = ulong +rbx.platform.typedef.rune_t = int +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sbintime_t = long +rbx.platform.typedef.segsz_t = long +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_register_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uint +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = ulong +rbx.platform.typedef.vm_ooffset_t = ulong +rbx.platform.typedef.vm_paddr_t = ulong +rbx.platform.typedef.vm_pindex_t = ulong +rbx.platform.typedef.vm_size_t = ulong +rbx.platform.typedef.wchar_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-linux/types.conf new file mode 100644 index 0000000..4cd2438 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-openbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-openbsd/types.conf new file mode 100644 index 0000000..6abc9c0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/aarch64-openbsd/types.conf @@ -0,0 +1,134 @@ +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long_long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long_long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = long_long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.sigset_t = uint +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = long_long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd/types.conf new file mode 100644 index 0000000..cfbb90f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd/types.conf @@ -0,0 +1,152 @@ + +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = uint +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpumask_t = uint +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = int +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__dev_t = uint +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long_long +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = int +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ushort +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = int +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = long_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = uint +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__u_register_t = uint +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = uint +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = uint +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = uint +rbx.platform.typedef.__vm_ooffset_t = long_long +rbx.platform.typedef.__vm_paddr_t = uint +rbx.platform.typedef.__vm_pindex_t = ulong_long +rbx.platform.typedef.__vm_size_t = uint +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = uint +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpumask_t = uint +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long_long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = long +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = long_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_register_t = uint +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = uint +rbx.platform.typedef.vm_ooffset_t = long_long +rbx.platform.typedef.vm_paddr_t = uint +rbx.platform.typedef.vm_pindex_t = ulong_long +rbx.platform.typedef.vm_size_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd12/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd12/types.conf new file mode 100644 index 0000000..523370d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-freebsd12/types.conf @@ -0,0 +1,152 @@ + +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = uint +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpumask_t = uint +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = int +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long_long +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = int +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ulong_long +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = int +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = long_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = uint +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__u_register_t = uint +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = uint +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = uint +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = uint +rbx.platform.typedef.__vm_ooffset_t = long_long +rbx.platform.typedef.__vm_paddr_t = uint +rbx.platform.typedef.__vm_pindex_t = ulong_long +rbx.platform.typedef.__vm_size_t = uint +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = uint +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpumask_t = uint +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long_long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = long +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ulong_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = long_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_register_t = uint +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = uint +rbx.platform.typedef.vm_ooffset_t = long_long +rbx.platform.typedef.vm_paddr_t = uint +rbx.platform.typedef.vm_pindex_t = ulong_long +rbx.platform.typedef.vm_size_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-linux/types.conf new file mode 100644 index 0000000..a070d39 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/arm-linux/types.conf @@ -0,0 +1,132 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = int +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-cygwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-cygwin/types.conf new file mode 100644 index 0000000..93f6b86 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-cygwin/types.conf @@ -0,0 +1,3 @@ +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.ssize_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-darwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-darwin/types.conf new file mode 100644 index 0000000..ae100f4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-darwin/types.conf @@ -0,0 +1,100 @@ +rbx.platform.typedef.__darwin_blkcnt_t = long_long +rbx.platform.typedef.__darwin_blksize_t = int +rbx.platform.typedef.__darwin_clock_t = ulong +rbx.platform.typedef.__darwin_ct_rune_t = int +rbx.platform.typedef.__darwin_dev_t = int +rbx.platform.typedef.__darwin_fsblkcnt_t = uint +rbx.platform.typedef.__darwin_fsfilcnt_t = uint +rbx.platform.typedef.__darwin_gid_t = uint +rbx.platform.typedef.__darwin_id_t = uint +rbx.platform.typedef.__darwin_ino64_t = ulong_long +rbx.platform.typedef.__darwin_ino_t = ulong_long +rbx.platform.typedef.__darwin_intptr_t = long +rbx.platform.typedef.__darwin_mach_port_name_t = uint +rbx.platform.typedef.__darwin_mach_port_t = uint +rbx.platform.typedef.__darwin_mode_t = ushort +rbx.platform.typedef.__darwin_natural_t = uint +rbx.platform.typedef.__darwin_off_t = long_long +rbx.platform.typedef.__darwin_pid_t = int +rbx.platform.typedef.__darwin_pthread_key_t = ulong +rbx.platform.typedef.__darwin_ptrdiff_t = int +rbx.platform.typedef.__darwin_rune_t = int +rbx.platform.typedef.__darwin_sigset_t = uint +rbx.platform.typedef.__darwin_size_t = ulong +rbx.platform.typedef.__darwin_socklen_t = uint +rbx.platform.typedef.__darwin_ssize_t = long +rbx.platform.typedef.__darwin_suseconds_t = int +rbx.platform.typedef.__darwin_time_t = long +rbx.platform.typedef.__darwin_uid_t = uint +rbx.platform.typedef.__darwin_useconds_t = uint +rbx.platform.typedef.__darwin_uuid_t[16] = uchar +rbx.platform.typedef.__darwin_wchar_t = int +rbx.platform.typedef.__darwin_wint_t = int +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fd_mask = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = uint +rbx.platform.typedef.fsfilcnt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.syscall_arg_t = ulong_long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.user_addr_t = ulong_long +rbx.platform.typedef.user_long_t = long_long +rbx.platform.typedef.user_size_t = ulong_long +rbx.platform.typedef.user_ssize_t = long_long +rbx.platform.typedef.user_time_t = long_long +rbx.platform.typedef.user_ulong_t = ulong_long +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd/types.conf new file mode 100644 index 0000000..6c882d4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd/types.conf @@ -0,0 +1,152 @@ + +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = uint +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpumask_t = uint +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = int +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__dev_t = uint +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long_long +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = int +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ushort +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = int +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = long_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = uint +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__u_register_t = uint +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = uint +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = uint +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = uint +rbx.platform.typedef.__vm_ooffset_t = long_long +rbx.platform.typedef.__vm_paddr_t = uint +rbx.platform.typedef.__vm_pindex_t = ulong_long +rbx.platform.typedef.__vm_size_t = uint +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = uint +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpumask_t = uint +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long_long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = long +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = long_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_register_t = uint +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = uint +rbx.platform.typedef.vm_ooffset_t = long_long +rbx.platform.typedef.vm_paddr_t = uint +rbx.platform.typedef.vm_pindex_t = ulong_long +rbx.platform.typedef.vm_size_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd12/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd12/types.conf new file mode 100644 index 0000000..523370d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-freebsd12/types.conf @@ -0,0 +1,152 @@ + +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = uint +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpumask_t = uint +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = int +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long_long +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = int +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ulong_long +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = int +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = long_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = uint +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__u_register_t = uint +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = uint +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = uint +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = uint +rbx.platform.typedef.__vm_ooffset_t = long_long +rbx.platform.typedef.__vm_paddr_t = uint +rbx.platform.typedef.__vm_pindex_t = ulong_long +rbx.platform.typedef.__vm_size_t = uint +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = uint +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpumask_t = uint +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long_long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = long +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ulong_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = long_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_register_t = uint +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = uint +rbx.platform.typedef.vm_ooffset_t = long_long +rbx.platform.typedef.vm_paddr_t = uint +rbx.platform.typedef.vm_pindex_t = ulong_long +rbx.platform.typedef.vm_size_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-gnu/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-gnu/types.conf new file mode 100644 index 0000000..fa2fa8c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-gnu/types.conf @@ -0,0 +1,107 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = uint +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsid_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__pthread_key = int +rbx.platform.typedef.__pthread_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__sigset_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.fsid_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.pthread_t = int +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sigset_t = ulong +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-linux/types.conf new file mode 100644 index 0000000..feb6bc4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-linux/types.conf @@ -0,0 +1,103 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-netbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-netbsd/types.conf new file mode 100644 index 0000000..a5aba89 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-netbsd/types.conf @@ -0,0 +1,126 @@ +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = int +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = int +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = int +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-openbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-openbsd/types.conf new file mode 100644 index 0000000..15a0d61 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-openbsd/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = int +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = int +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = int +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-solaris/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-solaris/types.conf new file mode 100644 index 0000000..22a2414 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-solaris/types.conf @@ -0,0 +1,122 @@ +rbx.platform.typedef.*caddr_t = char +rbx.platform.typedef.blkcnt64_t = long_long +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cnt_t = short +rbx.platform.typedef.cpu_flag_t = ushort +rbx.platform.typedef.ctid_t = long +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.datalink_id_t = uint +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.diskaddr_t = ulong_long +rbx.platform.typedef.disp_lock_t = uchar +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fds_mask = long +rbx.platform.typedef.fsblkcnt64_t = ulong_long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt64_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.hrtime_t = long_long +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.index_t = short +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.ipaddr_t = uint +rbx.platform.typedef.k_fltset_t = uint +rbx.platform.typedef.key_t = int +rbx.platform.typedef.len_t = ulong_long +rbx.platform.typedef.lgrp_id_t = long +rbx.platform.typedef.lock_t = uchar +rbx.platform.typedef.longlong_t = long_long +rbx.platform.typedef.major_t = ulong +rbx.platform.typedef.minor_t = ulong +rbx.platform.typedef.mode_t = ulong +rbx.platform.typedef.model_t = uint +rbx.platform.typedef.nfds_t = ulong +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.o_dev_t = short +rbx.platform.typedef.o_gid_t = ushort +rbx.platform.typedef.o_ino_t = ushort +rbx.platform.typedef.o_mode_t = ushort +rbx.platform.typedef.o_nlink_t = short +rbx.platform.typedef.o_pid_t = short +rbx.platform.typedef.o_uid_t = ushort +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.offset_t = long_long +rbx.platform.typedef.pad64_t = long_long +rbx.platform.typedef.pfn_t = ulong +rbx.platform.typedef.pgcnt_t = ulong +rbx.platform.typedef.pid_t = long +rbx.platform.typedef.poolid_t = long +rbx.platform.typedef.pri_t = short +rbx.platform.typedef.projid_t = long +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_t = uint +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.rlim64_t = ulong_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.spgcnt_t = long +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.sysid_t = short +rbx.platform.typedef.t_scalar_t = long +rbx.platform.typedef.t_uscalar_t = ulong +rbx.platform.typedef.taskid_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_longlong_t = ulong_long +rbx.platform.typedef.u_offset_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar_t = uchar +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uint_t = uint +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ulong_t = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.upad64_t = ulong_long +rbx.platform.typedef.use_t = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.ushort_t = ushort +rbx.platform.typedef.zoneid_t = long diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-windows/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-windows/types.conf new file mode 100644 index 0000000..a5d0b05 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/i386-windows/types.conf @@ -0,0 +1,52 @@ +rbx.platform.typedef.__time32_t = long +rbx.platform.typedef.__time64_t = long_long +rbx.platform.typedef._dev_t = uint +rbx.platform.typedef._ino_t = ushort +rbx.platform.typedef._mode_t = ushort +rbx.platform.typedef._off64_t = long_long +rbx.platform.typedef._off_t = long +rbx.platform.typedef._pid_t = int +rbx.platform.typedef._sigset_t = ulong +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.errno_t = int +rbx.platform.typedef.ino_t = ushort +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.off32_t = long +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.rsize_t = uint +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.wchar_t = ushort +rbx.platform.typedef.wctype_t = ushort +rbx.platform.typedef.wint_t = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/ia64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/ia64-linux/types.conf new file mode 100644 index 0000000..e0eeecc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/ia64-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips-linux/types.conf new file mode 100644 index 0000000..24e8202 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64-linux/types.conf new file mode 100644 index 0000000..b61f4f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64el-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64el-linux/types.conf new file mode 100644 index 0000000..b61f4f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mips64el-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsel-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsel-linux/types.conf new file mode 100644 index 0000000..24e8202 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsel-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6-linux/types.conf new file mode 100644 index 0000000..24e8202 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6el-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6el-linux/types.conf new file mode 100644 index 0000000..24e8202 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa32r6el-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6-linux/types.conf new file mode 100644 index 0000000..b61f4f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6el-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6el-linux/types.conf new file mode 100644 index 0000000..b61f4f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/mipsisa64r6el-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-aix/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-aix/types.conf new file mode 100644 index 0000000..cbd20e7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-aix/types.conf @@ -0,0 +1,180 @@ +rbx.platform.typedef.UTF32Char = uint +rbx.platform.typedef.UniChar = ushort +rbx.platform.typedef.__cptr32 = string +rbx.platform.typedef.__cptr64 = ulong_long +rbx.platform.typedef.__long32_t = long +rbx.platform.typedef.__long64_t = int +rbx.platform.typedef.__ptr32 = pointer +rbx.platform.typedef.__ptr64 = ulong_long +rbx.platform.typedef.__ulong32_t = ulong +rbx.platform.typedef.__ulong64_t = uint +rbx.platform.typedef.aptx_t = ushort +rbx.platform.typedef.blkcnt32_t = int +rbx.platform.typedef.blkcnt64_t = ulong_long +rbx.platform.typedef.blkcnt_t = int +rbx.platform.typedef.blksize32_t = int +rbx.platform.typedef.blksize64_t = ulong_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.boolean_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.chan_t = int +rbx.platform.typedef.class_id_t = uint +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = long_long +rbx.platform.typedef.cnt64_t = long_long +rbx.platform.typedef.cnt_t = short +rbx.platform.typedef.crid_t = int +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev32_t = uint +rbx.platform.typedef.dev64_t = ulong_long +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.esid_t = uint +rbx.platform.typedef.ext_t = int +rbx.platform.typedef.fpos64_t = long_long +rbx.platform.typedef.fpos_t = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino32_t = uint +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16 = short +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32 = int +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int32long64_t = int +rbx.platform.typedef.int64 = long_long +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8 = char +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intfast_t = int +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.krpn_t = int +rbx.platform.typedef.kvmhandle_t = ulong +rbx.platform.typedef.kvmid_t = long +rbx.platform.typedef.kvpn_t = int +rbx.platform.typedef.level_t = int +rbx.platform.typedef.liobn_t = uint +rbx.platform.typedef.long32int64_t = long +rbx.platform.typedef.longlong_t = long_long +rbx.platform.typedef.mid_t = pointer +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.mtyp_t = long +rbx.platform.typedef.nlink_t = short +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long +rbx.platform.typedef.offset_t = long_long +rbx.platform.typedef.paddr_t = long +rbx.platform.typedef.pdtx_t = int +rbx.platform.typedef.pid32_t = int +rbx.platform.typedef.pid64_t = ulong_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pshift_t = ushort +rbx.platform.typedef.psize_t = long_long +rbx.platform.typedef.psx_t = short +rbx.platform.typedef.ptex_t = ulong +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_t = uint +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.rlim64_t = ulong_long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.rpn64_t = long_long +rbx.platform.typedef.rpn_t = int +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.signal_t = int +rbx.platform.typedef.size64_t = ulong_long +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.slab_t[12] = char +rbx.platform.typedef.snidx_t = int +rbx.platform.typedef.socklen_t = ulong +rbx.platform.typedef.soff_t = int +rbx.platform.typedef.sshift_t = ushort +rbx.platform.typedef.ssize64_t = long_long +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.swhatx_t = ulong +rbx.platform.typedef.tid32_t = int +rbx.platform.typedef.tid64_t = ulong_long +rbx.platform.typedef.tid_t = int +rbx.platform.typedef.time32_t = int +rbx.platform.typedef.time64_t = long_long +rbx.platform.typedef.time_t = int +rbx.platform.typedef.timer32_t = int +rbx.platform.typedef.timer64_t = long_long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16 = ushort +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32 = uint +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64 = ulong_long +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8 = uchar +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_longlong_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar = uchar +rbx.platform.typedef.uchar_t = uchar +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint32long64_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uint_t = uint +rbx.platform.typedef.uintfast_t = uint +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ulong32int64_t = ulong +rbx.platform.typedef.ulong_t = ulong +rbx.platform.typedef.unidx_t = int +rbx.platform.typedef.unit_addr_t = ulong_long +rbx.platform.typedef.ureg_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.ushort_t = ushort +rbx.platform.typedef.va_list = string +rbx.platform.typedef.vmfkey_t = uint +rbx.platform.typedef.vmhandle32_t = uint +rbx.platform.typedef.vmhandle_t = ulong +rbx.platform.typedef.vmhwkey_t = int +rbx.platform.typedef.vmid32_t = int +rbx.platform.typedef.vmid64_t = long_long +rbx.platform.typedef.vmid_t = long +rbx.platform.typedef.vmidx_t = int +rbx.platform.typedef.vmkey_t = int +rbx.platform.typedef.vmlpghandle_t = ulong +rbx.platform.typedef.vmm_lock_t = int +rbx.platform.typedef.vmnodeidx_t = int +rbx.platform.typedef.vmprkey_t = uint +rbx.platform.typedef.vmsize_t = int +rbx.platform.typedef.vpn_t = int +rbx.platform.typedef.wchar_t = ushort +rbx.platform.typedef.wctype_t = uint +rbx.platform.typedef.wint_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-darwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-darwin/types.conf new file mode 100644 index 0000000..ae100f4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-darwin/types.conf @@ -0,0 +1,100 @@ +rbx.platform.typedef.__darwin_blkcnt_t = long_long +rbx.platform.typedef.__darwin_blksize_t = int +rbx.platform.typedef.__darwin_clock_t = ulong +rbx.platform.typedef.__darwin_ct_rune_t = int +rbx.platform.typedef.__darwin_dev_t = int +rbx.platform.typedef.__darwin_fsblkcnt_t = uint +rbx.platform.typedef.__darwin_fsfilcnt_t = uint +rbx.platform.typedef.__darwin_gid_t = uint +rbx.platform.typedef.__darwin_id_t = uint +rbx.platform.typedef.__darwin_ino64_t = ulong_long +rbx.platform.typedef.__darwin_ino_t = ulong_long +rbx.platform.typedef.__darwin_intptr_t = long +rbx.platform.typedef.__darwin_mach_port_name_t = uint +rbx.platform.typedef.__darwin_mach_port_t = uint +rbx.platform.typedef.__darwin_mode_t = ushort +rbx.platform.typedef.__darwin_natural_t = uint +rbx.platform.typedef.__darwin_off_t = long_long +rbx.platform.typedef.__darwin_pid_t = int +rbx.platform.typedef.__darwin_pthread_key_t = ulong +rbx.platform.typedef.__darwin_ptrdiff_t = int +rbx.platform.typedef.__darwin_rune_t = int +rbx.platform.typedef.__darwin_sigset_t = uint +rbx.platform.typedef.__darwin_size_t = ulong +rbx.platform.typedef.__darwin_socklen_t = uint +rbx.platform.typedef.__darwin_ssize_t = long +rbx.platform.typedef.__darwin_suseconds_t = int +rbx.platform.typedef.__darwin_time_t = long +rbx.platform.typedef.__darwin_uid_t = uint +rbx.platform.typedef.__darwin_useconds_t = uint +rbx.platform.typedef.__darwin_uuid_t[16] = uchar +rbx.platform.typedef.__darwin_wchar_t = int +rbx.platform.typedef.__darwin_wint_t = int +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fd_mask = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = uint +rbx.platform.typedef.fsfilcnt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.syscall_arg_t = ulong_long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.user_addr_t = ulong_long +rbx.platform.typedef.user_long_t = long_long +rbx.platform.typedef.user_size_t = ulong_long +rbx.platform.typedef.user_ssize_t = long_long +rbx.platform.typedef.user_time_t = long_long +rbx.platform.typedef.user_ulong_t = ulong_long +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-linux/types.conf new file mode 100644 index 0000000..42eec13 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-linux/types.conf @@ -0,0 +1,130 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = int +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = long diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-openbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-openbsd/types.conf new file mode 100644 index 0000000..aea7955 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc-openbsd/types.conf @@ -0,0 +1,156 @@ +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long_long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long_long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = long_long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = int +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.sigset_t = uint +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = long_long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uint +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong +rbx.platform.typedef.wchar_t = int +rbx.platform.typedef.wint_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64-linux/types.conf new file mode 100644 index 0000000..b61f4f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64le-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64le-linux/types.conf new file mode 100644 index 0000000..9ac9c2e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/powerpc64le-linux/types.conf @@ -0,0 +1,100 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/riscv64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/riscv64-linux/types.conf new file mode 100644 index 0000000..ede0f98 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/riscv64-linux/types.conf @@ -0,0 +1,104 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390-linux/types.conf new file mode 100644 index 0000000..291b032 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390x-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390x-linux/types.conf new file mode 100644 index 0000000..32a7feb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/s390x-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-linux/types.conf new file mode 100644 index 0000000..aea09d3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long_long +rbx.platform.typedef.__blkcnt64_t = long_long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong_long +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong_long +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong_long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = int +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long_long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long_long +rbx.platform.typedef.__rlim64_t = ulong_long +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = int +rbx.platform.typedef.__suseconds_t = int +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong_long +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong_long +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-solaris/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-solaris/types.conf new file mode 100644 index 0000000..a1548e5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc-solaris/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.() = pointer +rbx.platform.typedef.*caddr_t = char +rbx.platform.typedef.Psocklen_t = pointer +rbx.platform.typedef.avl_index_t = uint +rbx.platform.typedef.blkcnt64_t = long_long +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cnt_t = short +rbx.platform.typedef.cpu_flag_t = ushort +rbx.platform.typedef.ctid_t = long +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.diskaddr_t = ulong_long +rbx.platform.typedef.disp_lock_t = uchar +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fds_mask = long +rbx.platform.typedef.fsblkcnt64_t = ulong_long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt64_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = long +rbx.platform.typedef.hrtime_t = long_long +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.index_t = short +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int) = pointer +rbx.platform.typedef.int) = pointer +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.ipaddr_t = uint +rbx.platform.typedef.k_fltset_t = uint +rbx.platform.typedef.key_t = int +rbx.platform.typedef.kid_t = int +rbx.platform.typedef.len_t = ulong_long +rbx.platform.typedef.lock_t = uchar +rbx.platform.typedef.longlong_t = long_long +rbx.platform.typedef.major_t = ulong +rbx.platform.typedef.minor_t = ulong +rbx.platform.typedef.mode_t = ulong +rbx.platform.typedef.model_t = uint +rbx.platform.typedef.nfds_t = ulong +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.o_dev_t = short +rbx.platform.typedef.o_gid_t = ushort +rbx.platform.typedef.o_ino_t = ushort +rbx.platform.typedef.o_mode_t = ushort +rbx.platform.typedef.o_nlink_t = short +rbx.platform.typedef.o_pid_t = short +rbx.platform.typedef.o_uid_t = ushort +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.offset_t = long_long +rbx.platform.typedef.pad64_t = long_long +rbx.platform.typedef.pfn_t = ulong +rbx.platform.typedef.pgcnt_t = ulong +rbx.platform.typedef.pid_t = long +rbx.platform.typedef.poolid_t = long +rbx.platform.typedef.pri_t = short +rbx.platform.typedef.projid_t = long +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_t = uint +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.rlim64_t = ulong_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.size_t) = pointer +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.spgcnt_t = long +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.sysid_t = short +rbx.platform.typedef.t_scalar_t = long +rbx.platform.typedef.t_uscalar_t = ulong +rbx.platform.typedef.taskid_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.ts_t = long_long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_longlong_t = ulong_long +rbx.platform.typedef.u_offset_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar_t = uchar +rbx.platform.typedef.uid_t = long +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uint_t = uint +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ulong_t = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.upad64_t = ulong_long +rbx.platform.typedef.use_t = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.ushort_t = ushort +rbx.platform.typedef.zoneid_t = long diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc64-linux/types.conf new file mode 100644 index 0000000..7626bfc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparc64-linux/types.conf @@ -0,0 +1,102 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.*__qaddr_t = long +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = int +rbx.platform.typedef.__swblk_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-openbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-openbsd/types.conf new file mode 100644 index 0000000..aea7955 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-openbsd/types.conf @@ -0,0 +1,156 @@ +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long_long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long_long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = long_long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = int +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.sigset_t = uint +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = long_long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uint +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong +rbx.platform.typedef.wchar_t = int +rbx.platform.typedef.wint_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-solaris/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-solaris/types.conf new file mode 100644 index 0000000..a1548e5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/sparcv9-solaris/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.() = pointer +rbx.platform.typedef.*caddr_t = char +rbx.platform.typedef.Psocklen_t = pointer +rbx.platform.typedef.avl_index_t = uint +rbx.platform.typedef.blkcnt64_t = long_long +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cnt_t = short +rbx.platform.typedef.cpu_flag_t = ushort +rbx.platform.typedef.ctid_t = long +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.diskaddr_t = ulong_long +rbx.platform.typedef.disp_lock_t = uchar +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fds_mask = long +rbx.platform.typedef.fsblkcnt64_t = ulong_long +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt64_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = long +rbx.platform.typedef.hrtime_t = long_long +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.index_t = short +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int) = pointer +rbx.platform.typedef.int) = pointer +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = int +rbx.platform.typedef.ipaddr_t = uint +rbx.platform.typedef.k_fltset_t = uint +rbx.platform.typedef.key_t = int +rbx.platform.typedef.kid_t = int +rbx.platform.typedef.len_t = ulong_long +rbx.platform.typedef.lock_t = uchar +rbx.platform.typedef.longlong_t = long_long +rbx.platform.typedef.major_t = ulong +rbx.platform.typedef.minor_t = ulong +rbx.platform.typedef.mode_t = ulong +rbx.platform.typedef.model_t = uint +rbx.platform.typedef.nfds_t = ulong +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.o_dev_t = short +rbx.platform.typedef.o_gid_t = ushort +rbx.platform.typedef.o_ino_t = ushort +rbx.platform.typedef.o_mode_t = ushort +rbx.platform.typedef.o_nlink_t = short +rbx.platform.typedef.o_pid_t = short +rbx.platform.typedef.o_uid_t = ushort +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.offset_t = long_long +rbx.platform.typedef.pad64_t = long_long +rbx.platform.typedef.pfn_t = ulong +rbx.platform.typedef.pgcnt_t = ulong +rbx.platform.typedef.pid_t = long +rbx.platform.typedef.poolid_t = long +rbx.platform.typedef.pri_t = short +rbx.platform.typedef.projid_t = long +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_t = uint +rbx.platform.typedef.ptrdiff_t = int +rbx.platform.typedef.rlim64_t = ulong_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = uint +rbx.platform.typedef.size_t) = pointer +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.spgcnt_t = long +rbx.platform.typedef.ssize_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.sysid_t = short +rbx.platform.typedef.t_scalar_t = long +rbx.platform.typedef.t_uscalar_t = ulong +rbx.platform.typedef.taskid_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.ts_t = long_long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_longlong_t = ulong_long +rbx.platform.typedef.u_offset_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar_t = uchar +rbx.platform.typedef.uid_t = long +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uint_t = uint +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = uint +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ulong_t = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.upad64_t = ulong_long +rbx.platform.typedef.use_t = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.ushort_t = ushort +rbx.platform.typedef.zoneid_t = long diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-cygwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-cygwin/types.conf new file mode 100644 index 0000000..5bef6d7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-cygwin/types.conf @@ -0,0 +1,3 @@ +rbx.platform.typedef.ptrdiff_t = int64 +rbx.platform.typedef.size_t = uint64 +rbx.platform.typedef.ssize_t = int64 diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-darwin/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-darwin/types.conf new file mode 100644 index 0000000..68841bb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-darwin/types.conf @@ -0,0 +1,130 @@ +rbx.platform.typedef.__darwin_blkcnt_t = long_long +rbx.platform.typedef.__darwin_blksize_t = int +rbx.platform.typedef.__darwin_clock_t = ulong +rbx.platform.typedef.__darwin_ct_rune_t = int +rbx.platform.typedef.__darwin_dev_t = int +rbx.platform.typedef.__darwin_fsblkcnt_t = uint +rbx.platform.typedef.__darwin_fsfilcnt_t = uint +rbx.platform.typedef.__darwin_gid_t = uint +rbx.platform.typedef.__darwin_id_t = uint +rbx.platform.typedef.__darwin_ino64_t = ulong_long +rbx.platform.typedef.__darwin_ino_t = ulong_long +rbx.platform.typedef.__darwin_intptr_t = long +rbx.platform.typedef.__darwin_mach_port_name_t = uint +rbx.platform.typedef.__darwin_mach_port_t = uint +rbx.platform.typedef.__darwin_mode_t = ushort +rbx.platform.typedef.__darwin_natural_t = uint +rbx.platform.typedef.__darwin_off_t = long_long +rbx.platform.typedef.__darwin_pid_t = int +rbx.platform.typedef.__darwin_pthread_key_t = ulong +rbx.platform.typedef.__darwin_ptrdiff_t = long +rbx.platform.typedef.__darwin_rune_t = int +rbx.platform.typedef.__darwin_sigset_t = uint +rbx.platform.typedef.__darwin_size_t = ulong +rbx.platform.typedef.__darwin_socklen_t = uint +rbx.platform.typedef.__darwin_ssize_t = long +rbx.platform.typedef.__darwin_suseconds_t = int +rbx.platform.typedef.__darwin_time_t = long +rbx.platform.typedef.__darwin_uid_t = uint +rbx.platform.typedef.__darwin_useconds_t = uint +rbx.platform.typedef.__darwin_uuid_string_t[37] = char +rbx.platform.typedef.__darwin_uuid_t[16] = uchar +rbx.platform.typedef.__darwin_wchar_t = int +rbx.platform.typedef.__darwin_wint_t = int +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.errno_t = int +rbx.platform.typedef.fd_mask = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = uint +rbx.platform.typedef.fsfilcnt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino64_t = ulong_long +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.rsize_t = ulong +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sae_associd_t = uint +rbx.platform.typedef.sae_connid_t = uint +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.syscall_arg_t = ulong_long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.user_addr_t = ulong_long +rbx.platform.typedef.user_long_t = long_long +rbx.platform.typedef.user_off_t = long_long +rbx.platform.typedef.user_size_t = ulong_long +rbx.platform.typedef.user_ssize_t = long_long +rbx.platform.typedef.user_time_t = long_long +rbx.platform.typedef.user_ulong_t = ulong_long +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-dragonflybsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-dragonflybsd/types.conf new file mode 100644 index 0000000..889f6a3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-dragonflybsd/types.conf @@ -0,0 +1,130 @@ +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.___wchar_t = int +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = ulong +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intlp_t = long +rbx.platform.typedef.__intmax_t = long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = long +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintlp_t = ulong +rbx.platform.typedef.__uintmax_t = ulong +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = ulong +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = int +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = long +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_daddr_t = uint +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uint +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.v_caddr_t = pointer +rbx.platform.typedef.wchar_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd/types.conf new file mode 100644 index 0000000..8dbe370 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = int +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long_long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long_long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd12/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd12/types.conf new file mode 100644 index 0000000..31b1073 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-freebsd12/types.conf @@ -0,0 +1,158 @@ +rbx.platform.typedef.*) = pointer +rbx.platform.typedef.___wchar_t = int +rbx.platform.typedef.__accmode_t = int +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__char16_t = ushort +rbx.platform.typedef.__char32_t = uint +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpulevel_t = int +rbx.platform.typedef.__cpusetid_t = int +rbx.platform.typedef.__cpuwhich_t = int +rbx.platform.typedef.__critical_t = long +rbx.platform.typedef.__ct_rune_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = ulong +rbx.platform.typedef.__fflags_t = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = long +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intfptr_t = long +rbx.platform.typedef.__intmax_t = long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__lwpid_t = int +rbx.platform.typedef.__mode_t = ushort +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = long +rbx.platform.typedef.__rman_res_t = ulong +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = long +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__u_register_t = ulong +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintfptr_t = ulong +rbx.platform.typedef.__uintmax_t = ulong +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vm_offset_t = ulong +rbx.platform.typedef.__vm_paddr_t = ulong +rbx.platform.typedef.__vm_size_t = ulong +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.accmode_t = int +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.c_caddr_t = pointer +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.cap_ioctl_t = ulong +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpulevel_t = int +rbx.platform.typedef.cpusetid_t = int +rbx.platform.typedef.cpuwhich_t = int +rbx.platform.typedef.critical_t = long +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fflags_t = uint +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = long +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.ksize_t = ulong +rbx.platform.typedef.kvaddr_t = ulong +rbx.platform.typedef.lwpid_t = int +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off64_t = long +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = long +rbx.platform.typedef.rman_res_t = ulong +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sbintime_t = long +rbx.platform.typedef.segsz_t = long +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_register_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = ulong +rbx.platform.typedef.vm_ooffset_t = long +rbx.platform.typedef.vm_paddr_t = ulong +rbx.platform.typedef.vm_pindex_t = ulong +rbx.platform.typedef.vm_size_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-haiku/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-haiku/types.conf new file mode 100644 index 0000000..d5ddfa7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-haiku/types.conf @@ -0,0 +1,117 @@ +rbx.platform.typedef.__haiku_addr_t = ulong +rbx.platform.typedef.__haiku_generic_addr_t = ulong +rbx.platform.typedef.__haiku_int16 = short +rbx.platform.typedef.__haiku_int32 = int +rbx.platform.typedef.__haiku_int64 = long +rbx.platform.typedef.__haiku_int8 = char +rbx.platform.typedef.__haiku_phys_addr_t = ulong +rbx.platform.typedef.__haiku_phys_saddr_t = long +rbx.platform.typedef.__haiku_saddr_t = long +rbx.platform.typedef.__haiku_std_int16 = short +rbx.platform.typedef.__haiku_std_int32 = int +rbx.platform.typedef.__haiku_std_int64 = long +rbx.platform.typedef.__haiku_std_int8 = char +rbx.platform.typedef.__haiku_std_uint16 = ushort +rbx.platform.typedef.__haiku_std_uint32 = uint +rbx.platform.typedef.__haiku_std_uint64 = ulong +rbx.platform.typedef.__haiku_std_uint8 = uchar +rbx.platform.typedef.__haiku_uint16 = ushort +rbx.platform.typedef.__haiku_uint32 = uint +rbx.platform.typedef.__haiku_uint64 = ulong +rbx.platform.typedef.__haiku_uint8 = uchar +rbx.platform.typedef.addr_t = ulong +rbx.platform.typedef.bigtime_t = long +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = pointer +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cnt_t = int +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fd_mask = uint +rbx.platform.typedef.fsblkcnt_t = long +rbx.platform.typedef.fsfilcnt_t = long +rbx.platform.typedef.generic_addr_t = ulong +rbx.platform.typedef.generic_size_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = int +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = long +rbx.platform.typedef.int16 = short +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32 = int +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64 = long +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8 = char +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = int +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nanotime_t = long +rbx.platform.typedef.nlink_t = int +rbx.platform.typedef.off_t = long +rbx.platform.typedef.perform_code = uint +rbx.platform.typedef.phys_addr_t = ulong +rbx.platform.typedef.phys_size_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = int +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.sig_atomic_t = int +rbx.platform.typedef.sigset_t = ulong +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.status_t = int +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.type_code = uint +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar = uchar +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16 = ushort +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32 = uint +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64 = ulong +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8 = uchar +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uint +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.umode_t = uint +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.unichar = ushort +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.void*) = pointer +rbx.platform.typedef.wchar_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-linux/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-linux/types.conf new file mode 100644 index 0000000..060f161 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-linux/types.conf @@ -0,0 +1,132 @@ +rbx.platform.typedef.*__caddr_t = char +rbx.platform.typedef.__blkcnt64_t = long +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = long +rbx.platform.typedef.__clock_t = long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__daddr_t = int +rbx.platform.typedef.__dev_t = ulong +rbx.platform.typedef.__fd_mask = long +rbx.platform.typedef.__fsblkcnt64_t = ulong +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt64_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__fsword_t = long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino64_t = ulong +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__intmax_t = long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = int +rbx.platform.typedef.__loff_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = ulong +rbx.platform.typedef.__off64_t = long +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__priority_which_t = int +rbx.platform.typedef.__quad_t = long +rbx.platform.typedef.__rlim64_t = ulong +rbx.platform.typedef.__rlim_t = ulong +rbx.platform.typedef.__rlimit_resource_t = int +rbx.platform.typedef.__rusage_who_t = int +rbx.platform.typedef.__sig_atomic_t = int +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__syscall_slong_t = long +rbx.platform.typedef.__syscall_ulong_t = ulong +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = pointer +rbx.platform.typedef.__u_char = uchar +rbx.platform.typedef.__u_int = uint +rbx.platform.typedef.__u_long = ulong +rbx.platform.typedef.__u_quad_t = ulong +rbx.platform.typedef.__u_short = ushort +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = long +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = long +rbx.platform.typedef.int_fast32_t = long +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = int +rbx.platform.typedef.loff_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ulong +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_once_t = int +rbx.platform.typedef.pthread_t = ulong +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.quad_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = pointer +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ulong +rbx.platform.typedef.uint_fast32_t = ulong +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.wchar_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-msys/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-msys/types.conf new file mode 100644 index 0000000..aa827c0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-msys/types.conf @@ -0,0 +1,119 @@ +rbx.platform.typedef.*addr_t = char +rbx.platform.typedef.__ULong = uint +rbx.platform.typedef.__blkcnt_t = long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = ulong +rbx.platform.typedef.__clockid_t = ulong +rbx.platform.typedef.__cpu_mask = ulong +rbx.platform.typedef.__dev_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong +rbx.platform.typedef.__fsfilcnt_t = ulong +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__ino_t = ulong +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long_long +rbx.platform.typedef.__loff_t = long_long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nl_item = int +rbx.platform.typedef.__nlink_t = ushort +rbx.platform.typedef.__off_t = long +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__sigset_t = ulong +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = int +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__time_t = long +rbx.platform.typedef.__timer_t = ulong +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = ulong +rbx.platform.typedef._fpos64_t = long_long +rbx.platform.typedef._fpos_t = long +rbx.platform.typedef._off64_t = long_long +rbx.platform.typedef._off_t = long +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = ulong +rbx.platform.typedef.clockid_t = ulong +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.fd_mask = ulong +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = long +rbx.platform.typedef.int_fast32_t = long +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long_long +rbx.platform.typedef.loff_t = long_long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = ushort +rbx.platform.typedef.off_t = long +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sbintime_t = long +rbx.platform.typedef.sig_atomic_t = int +rbx.platform.typedef.sigset_t = ulong +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = int +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = ulong +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_register_t = ulong +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ulong +rbx.platform.typedef.uint_fast32_t = ulong +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.useconds_t = ulong +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vm_offset_t = ulong +rbx.platform.typedef.vm_size_t = ulong +rbx.platform.typedef.wint_t = uint diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-netbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-netbsd/types.conf new file mode 100644 index 0000000..15a0d61 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-netbsd/types.conf @@ -0,0 +1,128 @@ +rbx.platform.typedef.__clock_t = int +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = int +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = uint +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = int +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = int +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = int +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = int +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr64_t = long_long +rbx.platform.typedef.daddr_t = int +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = uint +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = int +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = int +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = int +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-openbsd/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-openbsd/types.conf new file mode 100644 index 0000000..6abc9c0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-openbsd/types.conf @@ -0,0 +1,134 @@ +rbx.platform.typedef.__blkcnt_t = long_long +rbx.platform.typedef.__blksize_t = int +rbx.platform.typedef.__clock_t = long_long +rbx.platform.typedef.__clockid_t = int +rbx.platform.typedef.__cpuid_t = ulong +rbx.platform.typedef.__dev_t = int +rbx.platform.typedef.__fd_mask = uint +rbx.platform.typedef.__fixpt_t = uint +rbx.platform.typedef.__fsblkcnt_t = ulong_long +rbx.platform.typedef.__fsfilcnt_t = ulong_long +rbx.platform.typedef.__gid_t = uint +rbx.platform.typedef.__id_t = uint +rbx.platform.typedef.__in_addr_t = uint +rbx.platform.typedef.__in_port_t = ushort +rbx.platform.typedef.__ino_t = ulong_long +rbx.platform.typedef.__int16_t = short +rbx.platform.typedef.__int32_t = int +rbx.platform.typedef.__int64_t = long_long +rbx.platform.typedef.__int8_t = char +rbx.platform.typedef.__int_fast16_t = int +rbx.platform.typedef.__int_fast32_t = int +rbx.platform.typedef.__int_fast64_t = long_long +rbx.platform.typedef.__int_fast8_t = int +rbx.platform.typedef.__int_least16_t = short +rbx.platform.typedef.__int_least32_t = int +rbx.platform.typedef.__int_least64_t = long_long +rbx.platform.typedef.__int_least8_t = char +rbx.platform.typedef.__intmax_t = long_long +rbx.platform.typedef.__intptr_t = long +rbx.platform.typedef.__key_t = long +rbx.platform.typedef.__mode_t = uint +rbx.platform.typedef.__nlink_t = uint +rbx.platform.typedef.__off_t = long_long +rbx.platform.typedef.__paddr_t = ulong +rbx.platform.typedef.__pid_t = int +rbx.platform.typedef.__psize_t = ulong +rbx.platform.typedef.__ptrdiff_t = long +rbx.platform.typedef.__register_t = long +rbx.platform.typedef.__rlim_t = ulong_long +rbx.platform.typedef.__rune_t = int +rbx.platform.typedef.__sa_family_t = uchar +rbx.platform.typedef.__segsz_t = int +rbx.platform.typedef.__size_t = ulong +rbx.platform.typedef.__socklen_t = uint +rbx.platform.typedef.__ssize_t = long +rbx.platform.typedef.__suseconds_t = long +rbx.platform.typedef.__swblk_t = int +rbx.platform.typedef.__time_t = long_long +rbx.platform.typedef.__timer_t = int +rbx.platform.typedef.__uid_t = uint +rbx.platform.typedef.__uint16_t = ushort +rbx.platform.typedef.__uint32_t = uint +rbx.platform.typedef.__uint64_t = ulong_long +rbx.platform.typedef.__uint8_t = uchar +rbx.platform.typedef.__uint_fast16_t = uint +rbx.platform.typedef.__uint_fast32_t = uint +rbx.platform.typedef.__uint_fast64_t = ulong_long +rbx.platform.typedef.__uint_fast8_t = uint +rbx.platform.typedef.__uint_least16_t = ushort +rbx.platform.typedef.__uint_least32_t = uint +rbx.platform.typedef.__uint_least64_t = ulong_long +rbx.platform.typedef.__uint_least8_t = uchar +rbx.platform.typedef.__uintmax_t = ulong_long +rbx.platform.typedef.__uintptr_t = ulong +rbx.platform.typedef.__useconds_t = uint +rbx.platform.typedef.__vaddr_t = ulong +rbx.platform.typedef.__vsize_t = ulong +rbx.platform.typedef.__wchar_t = int +rbx.platform.typedef.__wctrans_t = pointer +rbx.platform.typedef.__wctype_t = pointer +rbx.platform.typedef.__wint_t = int +rbx.platform.typedef.blkcnt_t = long_long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.caddr_t = string +rbx.platform.typedef.clock_t = long_long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cpuid_t = ulong +rbx.platform.typedef.daddr32_t = int +rbx.platform.typedef.daddr_t = long_long +rbx.platform.typedef.dev_t = int +rbx.platform.typedef.fixpt_t = uint +rbx.platform.typedef.fsblkcnt_t = ulong_long +rbx.platform.typedef.fsfilcnt_t = ulong_long +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.id_t = uint +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.ino_t = ulong_long +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.key_t = long +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.paddr_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.psize_t = ulong +rbx.platform.typedef.qaddr_t = pointer +rbx.platform.typedef.quad_t = long_long +rbx.platform.typedef.register_t = long +rbx.platform.typedef.rlim_t = ulong_long +rbx.platform.typedef.sa_family_t = uchar +rbx.platform.typedef.segsz_t = int +rbx.platform.typedef.sigset_t = uint +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.swblk_t = int +rbx.platform.typedef.time_t = long_long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_int16_t = ushort +rbx.platform.typedef.u_int32_t = uint +rbx.platform.typedef.u_int64_t = ulong_long +rbx.platform.typedef.u_int8_t = uchar +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_quad_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.vaddr_t = ulong +rbx.platform.typedef.vsize_t = ulong diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-solaris/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-solaris/types.conf new file mode 100644 index 0000000..a7890d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-solaris/types.conf @@ -0,0 +1,122 @@ +rbx.platform.typedef.*caddr_t = char +rbx.platform.typedef.blkcnt64_t = long +rbx.platform.typedef.blkcnt_t = long +rbx.platform.typedef.blksize_t = int +rbx.platform.typedef.clock_t = long +rbx.platform.typedef.clockid_t = int +rbx.platform.typedef.cnt_t = short +rbx.platform.typedef.cpu_flag_t = ushort +rbx.platform.typedef.ctid_t = int +rbx.platform.typedef.daddr_t = long +rbx.platform.typedef.datalink_id_t = uint +rbx.platform.typedef.dev_t = ulong +rbx.platform.typedef.diskaddr_t = ulong_long +rbx.platform.typedef.disp_lock_t = uchar +rbx.platform.typedef.fd_mask = long +rbx.platform.typedef.fds_mask = long +rbx.platform.typedef.fsblkcnt64_t = ulong +rbx.platform.typedef.fsblkcnt_t = ulong +rbx.platform.typedef.fsfilcnt64_t = ulong +rbx.platform.typedef.fsfilcnt_t = ulong +rbx.platform.typedef.gid_t = uint +rbx.platform.typedef.hrtime_t = long_long +rbx.platform.typedef.id_t = int +rbx.platform.typedef.in_addr_t = uint +rbx.platform.typedef.in_port_t = ushort +rbx.platform.typedef.index_t = short +rbx.platform.typedef.ino64_t = ulong +rbx.platform.typedef.ino_t = ulong +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = int +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long +rbx.platform.typedef.intptr_t = long +rbx.platform.typedef.ipaddr_t = uint +rbx.platform.typedef.k_fltset_t = uint +rbx.platform.typedef.key_t = int +rbx.platform.typedef.len_t = ulong_long +rbx.platform.typedef.lgrp_id_t = int +rbx.platform.typedef.lock_t = uchar +rbx.platform.typedef.longlong_t = long_long +rbx.platform.typedef.major_t = uint +rbx.platform.typedef.minor_t = uint +rbx.platform.typedef.mode_t = uint +rbx.platform.typedef.model_t = uint +rbx.platform.typedef.nfds_t = ulong +rbx.platform.typedef.nlink_t = uint +rbx.platform.typedef.o_dev_t = short +rbx.platform.typedef.o_gid_t = ushort +rbx.platform.typedef.o_ino_t = ushort +rbx.platform.typedef.o_mode_t = ushort +rbx.platform.typedef.o_nlink_t = short +rbx.platform.typedef.o_pid_t = short +rbx.platform.typedef.o_uid_t = ushort +rbx.platform.typedef.off64_t = long +rbx.platform.typedef.off_t = long +rbx.platform.typedef.offset_t = long_long +rbx.platform.typedef.pad64_t = long +rbx.platform.typedef.pfn_t = ulong +rbx.platform.typedef.pgcnt_t = ulong +rbx.platform.typedef.pid_t = int +rbx.platform.typedef.poolid_t = int +rbx.platform.typedef.pri_t = short +rbx.platform.typedef.projid_t = int +rbx.platform.typedef.pthread_key_t = uint +rbx.platform.typedef.pthread_t = uint +rbx.platform.typedef.ptrdiff_t = long +rbx.platform.typedef.rlim64_t = ulong_long +rbx.platform.typedef.rlim_t = ulong +rbx.platform.typedef.sa_family_t = ushort +rbx.platform.typedef.size_t = ulong +rbx.platform.typedef.socklen_t = uint +rbx.platform.typedef.spgcnt_t = long +rbx.platform.typedef.ssize_t = long +rbx.platform.typedef.suseconds_t = long +rbx.platform.typedef.sysid_t = short +rbx.platform.typedef.t_scalar_t = int +rbx.platform.typedef.t_uscalar_t = uint +rbx.platform.typedef.taskid_t = int +rbx.platform.typedef.time_t = long +rbx.platform.typedef.timer_t = int +rbx.platform.typedef.u_char = uchar +rbx.platform.typedef.u_int = uint +rbx.platform.typedef.u_long = ulong +rbx.platform.typedef.u_longlong_t = ulong_long +rbx.platform.typedef.u_offset_t = ulong_long +rbx.platform.typedef.u_short = ushort +rbx.platform.typedef.uchar_t = uchar +rbx.platform.typedef.uid_t = uint +rbx.platform.typedef.uint = uint +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint32_t = uint +rbx.platform.typedef.uint64_t = ulong +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = uint +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least32_t = uint +rbx.platform.typedef.uint_least64_t = ulong +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uint_t = uint +rbx.platform.typedef.uintmax_t = ulong +rbx.platform.typedef.uintptr_t = ulong +rbx.platform.typedef.ulong = ulong +rbx.platform.typedef.ulong_t = ulong +rbx.platform.typedef.unchar = uchar +rbx.platform.typedef.upad64_t = ulong +rbx.platform.typedef.use_t = uchar +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.ushort = ushort +rbx.platform.typedef.ushort_t = ushort +rbx.platform.typedef.zoneid_t = int diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-windows/types.conf b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-windows/types.conf new file mode 100644 index 0000000..5bdbbde --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/platform/x86_64-windows/types.conf @@ -0,0 +1,52 @@ +rbx.platform.typedef.__time32_t = long +rbx.platform.typedef.__time64_t = long_long +rbx.platform.typedef._dev_t = uint +rbx.platform.typedef._ino_t = ushort +rbx.platform.typedef._mode_t = ushort +rbx.platform.typedef._off64_t = long_long +rbx.platform.typedef._off_t = long +rbx.platform.typedef._pid_t = long_long +rbx.platform.typedef._sigset_t = ulong_long +rbx.platform.typedef.dev_t = uint +rbx.platform.typedef.errno_t = int +rbx.platform.typedef.ino_t = ushort +rbx.platform.typedef.int16_t = short +rbx.platform.typedef.int32_t = int +rbx.platform.typedef.int64_t = long_long +rbx.platform.typedef.int8_t = char +rbx.platform.typedef.int_fast16_t = short +rbx.platform.typedef.int_fast32_t = int +rbx.platform.typedef.int_fast64_t = long_long +rbx.platform.typedef.int_fast8_t = char +rbx.platform.typedef.int_least16_t = short +rbx.platform.typedef.int_least32_t = int +rbx.platform.typedef.int_least64_t = long_long +rbx.platform.typedef.int_least8_t = char +rbx.platform.typedef.intmax_t = long_long +rbx.platform.typedef.intptr_t = long_long +rbx.platform.typedef.mode_t = ushort +rbx.platform.typedef.off32_t = long +rbx.platform.typedef.off64_t = long_long +rbx.platform.typedef.off_t = long_long +rbx.platform.typedef.pid_t = long_long +rbx.platform.typedef.ptrdiff_t = long_long +rbx.platform.typedef.rsize_t = ulong_long +rbx.platform.typedef.size_t = ulong_long +rbx.platform.typedef.ssize_t = long_long +rbx.platform.typedef.time_t = long_long +rbx.platform.typedef.uint16_t = ushort +rbx.platform.typedef.uint64_t = ulong_long +rbx.platform.typedef.uint8_t = uchar +rbx.platform.typedef.uint_fast16_t = ushort +rbx.platform.typedef.uint_fast32_t = uint +rbx.platform.typedef.uint_fast64_t = ulong_long +rbx.platform.typedef.uint_fast8_t = uchar +rbx.platform.typedef.uint_least16_t = ushort +rbx.platform.typedef.uint_least64_t = ulong_long +rbx.platform.typedef.uint_least8_t = uchar +rbx.platform.typedef.uintmax_t = ulong_long +rbx.platform.typedef.uintptr_t = ulong_long +rbx.platform.typedef.useconds_t = uint +rbx.platform.typedef.wchar_t = ushort +rbx.platform.typedef.wctype_t = ushort +rbx.platform.typedef.wint_t = ushort diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/pointer.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/pointer.rb new file mode 100644 index 0000000..37a054b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/pointer.rb @@ -0,0 +1,167 @@ +# +# Copyright (C) 2008, 2009 Wayne Meissner +# Copyright (c) 2007, 2008 Evan Phoenix +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +require 'ffi/platform' + +# NOTE: all method definitions in this file are conditional on +# whether they are not already defined. This is needed because +# some Ruby implementations (e.g., TruffleRuby) might already +# provide these methods due to using FFI internally, and we +# should not override them to avoid warnings. + +module FFI + class Pointer + + # Pointer size + SIZE = Platform::ADDRESS_SIZE / 8 unless const_defined?(:SIZE) + + # Return the size of a pointer on the current platform, in bytes + # @return [Numeric] + def self.size + SIZE + end unless respond_to?(:size) + + # @param [nil,Numeric] len length of string to return + # @return [String] + # Read pointer's contents as a string, or the first +len+ bytes of the + # equivalent string if +len+ is not +nil+. + def read_string(len=nil) + if len + return ''.b if len == 0 + get_bytes(0, len) + else + get_string(0) + end + end unless method_defined?(:read_string) + + # @param [Numeric] len length of string to return + # @return [String] + # Read the first +len+ bytes of pointer's contents as a string. + # + # Same as: + # ptr.read_string(len) # with len not nil + def read_string_length(len) + get_bytes(0, len) + end unless method_defined?(:read_string_length) + + # @return [String] + # Read pointer's contents as a string. + # + # Same as: + # ptr.read_string # with no len + def read_string_to_null + get_string(0) + end unless method_defined?(:read_string_to_null) + + # @param [String] str string to write + # @param [Numeric] len length of string to return + # @return [self] + # Write +len+ first bytes of +str+ in pointer's contents. + # + # Same as: + # ptr.write_string(str, len) # with len not nil + def write_string_length(str, len) + put_bytes(0, str, 0, len) + end unless method_defined?(:write_string_length) + + # @param [String] str string to write + # @param [Numeric] len length of string to return + # @return [self] + # Write +str+ in pointer's contents, or first +len+ bytes if + # +len+ is not +nil+. + def write_string(str, len=nil) + len = str.bytesize unless len + # Write the string data without NUL termination + put_bytes(0, str, 0, len) + end unless method_defined?(:write_string) + + # @param [Type] type type of data to read from pointer's contents + # @param [Symbol] reader method to send to +self+ to read +type+ + # @param [Numeric] length + # @return [Array] + # Read an array of +type+ of length +length+. + # @example + # ptr.read_array_of_type(TYPE_UINT8, :read_uint8, 4) # -> [1, 2, 3, 4] + def read_array_of_type(type, reader, length) + ary = [] + size = FFI.type_size(type) + tmp = self + length.times { |j| + ary << tmp.send(reader) + tmp += size unless j == length-1 # avoid OOB + } + ary + end unless method_defined?(:read_array_of_type) + + # @param [Type] type type of data to write to pointer's contents + # @param [Symbol] writer method to send to +self+ to write +type+ + # @param [Array] ary + # @return [self] + # Write +ary+ in pointer's contents as +type+. + # @example + # ptr.write_array_of_type(TYPE_UINT8, :put_uint8, [1, 2, 3 ,4]) + def write_array_of_type(type, writer, ary) + size = FFI.type_size(type) + ary.each_with_index { |val, i| + break unless i < self.size + self.send(writer, i * size, val) + } + self + end unless method_defined?(:write_array_of_type) + + # @return [self] + def to_ptr + self + end unless method_defined?(:to_ptr) + + # @param [Symbol,Type] type of data to read + # @return [Object] + # Read pointer's contents as +type+ + # + # Same as: + # ptr.get(type, 0) + def read(type) + get(type, 0) + end unless method_defined?(:read) + + # @param [Symbol,Type] type of data to read + # @param [Object] value to write + # @return [nil] + # Write +value+ of type +type+ to pointer's content + # + # Same as: + # ptr.put(type, 0) + def write(type, value) + put(type, 0, value) + end unless method_defined?(:write) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct.rb new file mode 100644 index 0000000..7028258 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct.rb @@ -0,0 +1,316 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# Copyright (C) 2008, 2009 Andrea Fazzi +# Copyright (C) 2008, 2009 Luc Heinrich +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +require 'ffi/platform' +require 'ffi/struct_layout' +require 'ffi/struct_layout_builder' +require 'ffi/struct_by_reference' + +module FFI + + class Struct + + # Get struct size + # @return [Numeric] + def size + self.class.size + end + + # @return [Fixnum] Struct alignment + def alignment + self.class.alignment + end + alias_method :align, :alignment + + # (see FFI::StructLayout#offset_of) + def offset_of(name) + self.class.offset_of(name) + end + + # (see FFI::StructLayout#members) + def members + self.class.members + end + + # @return [Array] + # Get array of values from Struct fields. + def values + members.map { |m| self[m] } + end + + # (see FFI::StructLayout#offsets) + def offsets + self.class.offsets + end + + # Clear the struct content. + # @return [self] + def clear + pointer.clear + self + end + + # Get {Pointer} to struct content. + # @return [AbstractMemory] + def to_ptr + pointer + end + + # Get struct size + # @return [Numeric] + def self.size + defined?(@layout) ? @layout.size : defined?(@size) ? @size : 0 + end + + # set struct size + # @param [Numeric] size + # @return [size] + def self.size=(size) + raise ArgumentError, "Size already set" if defined?(@size) || defined?(@layout) + @size = size + end + + # @return (see Struct#alignment) + def self.alignment + @layout.alignment + end + + # (see FFI::Type#members) + def self.members + @layout.members + end + + # (see FFI::StructLayout#offsets) + def self.offsets + @layout.offsets + end + + # (see FFI::StructLayout#offset_of) + def self.offset_of(name) + @layout.offset_of(name) + end + + def self.in + ptr(:in) + end + + def self.out + ptr(:out) + end + + def self.ptr(flags = :inout) + @ref_data_type ||= Type::Mapped.new(StructByReference.new(self)) + end + + def self.val + @val_data_type ||= StructByValue.new(self) + end + + def self.by_value + self.val + end + + def self.by_ref(flags = :inout) + self.ptr(flags) + end + + class ManagedStructConverter < StructByReference + + # @param [Struct] struct_class + def initialize(struct_class) + super(struct_class) + + raise NoMethodError, "release() not implemented for class #{struct_class}" unless struct_class.respond_to? :release + @method = struct_class.method(:release) + end + + # @param [Pointer] ptr + # @param [nil] ctx + # @return [Struct] + def from_native(ptr, ctx) + struct_class.new(AutoPointer.new(ptr, @method)) + end + end + + def self.auto_ptr + @managed_type ||= Type::Mapped.new(ManagedStructConverter.new(self)) + end + + + class << self + public + + # @return [StructLayout] + # @overload layout + # @return [StructLayout] + # Get struct layout. + # @overload layout(*spec) + # @param [Array,Array(Hash)] spec + # @return [StructLayout] + # Create struct layout from +spec+. + # @example Creating a layout from an array +spec+ + # class MyStruct < Struct + # layout :field1, :int, + # :field2, :pointer, + # :field3, :string + # end + # @example Creating a layout from an array +spec+ with offset + # class MyStructWithOffset < Struct + # layout :field1, :int, + # :field2, :pointer, 6, # set offset to 6 for this field + # :field3, :string + # end + # @example Creating a layout from a hash +spec+ + # class MyStructFromHash < Struct + # layout :field1 => :int, + # :field2 => :pointer, + # :field3 => :string + # end + # @example Creating a layout with pointers to functions + # class MyFunctionTable < Struct + # layout :function1, callback([:int, :int], :int), + # :function2, callback([:pointer], :void), + # :field3, :string + # end + def layout(*spec) + warn "[DEPRECATION] Struct layout is already defined for class #{self.inspect}. Redefinition as in #{caller[0]} will be disallowed in ffi-2.0." if defined?(@layout) + return @layout if spec.size == 0 + + builder = StructLayoutBuilder.new + builder.union = self < Union + builder.packed = @packed if defined?(@packed) + builder.alignment = @min_alignment if defined?(@min_alignment) + + if spec[0].kind_of?(Hash) + hash_layout(builder, spec) + else + array_layout(builder, spec) + end + builder.size = @size if defined?(@size) && @size > builder.size + cspec = builder.build + @layout = cspec unless self == Struct + @size = cspec.size + return cspec + end + + + protected + + def callback(params, ret) + mod = enclosing_module + ret_type = find_type(ret, mod) + if ret_type == Type::STRING + raise TypeError, ":string is not allowed as return type of callbacks" + end + FFI::CallbackInfo.new(ret_type, params.map { |e| find_type(e, mod) }) + end + + def packed(packed = 1) + @packed = packed + end + alias :pack :packed + + def aligned(alignment = 1) + @min_alignment = alignment + end + alias :align :aligned + + def enclosing_module + begin + mod = self.name.split("::")[0..-2].inject(Object) { |obj, c| obj.const_get(c) } + if mod.respond_to?(:find_type) && (mod.is_a?(FFI::Library) || mod < FFI::Struct) + mod + end + rescue Exception + nil + end + end + + + def find_field_type(type, mod = enclosing_module) + if type.kind_of?(Class) && type < Struct + FFI::Type::Struct.new(type) + + elsif type.kind_of?(Class) && type < FFI::StructLayout::Field + type + + elsif type.kind_of?(::Array) + FFI::Type::Array.new(find_field_type(type[0]), type[1]) + + else + find_type(type, mod) + end + end + + def find_type(type, mod = enclosing_module) + if mod + mod.find_type(type) + end || FFI.find_type(type) + end + + private + + # @param [StructLayoutBuilder] builder + # @param [Hash] spec + # @return [builder] + # Add hash +spec+ to +builder+. + def hash_layout(builder, spec) + spec[0].each do |name, type| + builder.add name, find_field_type(type), nil + end + end + + # @param [StructLayoutBuilder] builder + # @param [Array] spec + # @return [builder] + # Add array +spec+ to +builder+. + def array_layout(builder, spec) + i = 0 + while i < spec.size + name, type = spec[i, 2] + i += 2 + + # If the next param is a Integer, it specifies the offset + if spec[i].kind_of?(Integer) + offset = spec[i] + i += 1 + else + offset = nil + end + + builder.add name, find_field_type(type), offset + end + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_by_reference.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_by_reference.rb new file mode 100644 index 0000000..27f25ec --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_by_reference.rb @@ -0,0 +1,72 @@ +# +# Copyright (C) 2010 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# + +module FFI + # This class includes the {FFI::DataConverter} module. + class StructByReference + include DataConverter + + attr_reader :struct_class + + # @param [Struct] struct_class + def initialize(struct_class) + unless Class === struct_class and struct_class < FFI::Struct + raise TypeError, 'wrong type (expected subclass of FFI::Struct)' + end + @struct_class = struct_class + end + + # Always get {FFI::Type}::POINTER. + def native_type + FFI::Type::POINTER + end + + # @param [nil, Struct] value + # @param [nil] ctx + # @return [AbstractMemory] Pointer on +value+. + def to_native(value, ctx) + return Pointer::NULL if value.nil? + + unless @struct_class === value + raise TypeError, "wrong argument type #{value.class} (expected #{@struct_class})" + end + + value.pointer + end + + # @param [AbstractMemory] value + # @param [nil] ctx + # @return [Struct] + # Create a struct from content of memory +value+. + def from_native(value, ctx) + @struct_class.new(value) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout.rb new file mode 100644 index 0000000..d5a78a7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout.rb @@ -0,0 +1,96 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# Copyright (C) 2008, 2009 Andrea Fazzi +# Copyright (C) 2008, 2009 Luc Heinrich +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +module FFI + + class StructLayout + + # @return [Array + # Get an array of tuples (field name, offset of the field). + def offsets + members.map { |m| [ m, self[m].offset ] } + end + + # @return [Numeric] + # Get the offset of a field. + def offset_of(field_name) + self[field_name].offset + end + + # An enum {Field} in a {StructLayout}. + class Enum < Field + + # @param [AbstractMemory] ptr pointer on a {Struct} + # @return [Object] + # Get an object of type {#type} from memory pointed by +ptr+. + def get(ptr) + type.find(ptr.get_int(offset)) + end + + # @param [AbstractMemory] ptr pointer on a {Struct} + # @param value + # @return [nil] + # Set +value+ into memory pointed by +ptr+. + def put(ptr, value) + ptr.put_int(offset, type.find(value)) + end + + end + + class InnerStruct < Field + def get(ptr) + type.struct_class.new(ptr.slice(self.offset, self.size)) + end + + def put(ptr, value) + raise TypeError, "wrong value type (expected #{type.struct_class})" unless value.is_a?(type.struct_class) + ptr.slice(self.offset, self.size).__copy_from__(value.pointer, self.size) + end + end + + class Mapped < Field + def initialize(name, offset, type, orig_field) + super(name, offset, type) + @orig_field = orig_field + end + + def get(ptr) + type.from_native(@orig_field.get(ptr), nil) + end + + def put(ptr, value) + @orig_field.put(ptr, type.to_native(value, nil)) + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout_builder.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout_builder.rb new file mode 100644 index 0000000..4d6a464 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/struct_layout_builder.rb @@ -0,0 +1,227 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +module FFI + + # Build a {StructLayout struct layout}. + class StructLayoutBuilder + attr_reader :size + attr_reader :alignment + + def initialize + @size = 0 + @alignment = 1 + @min_alignment = 1 + @packed = false + @union = false + @fields = Array.new + end + + # Set size attribute with +size+ only if +size+ is greater than attribute value. + # @param [Numeric] size + def size=(size) + @size = size if size > @size + end + + # Set alignment attribute with +align+ only if it is greater than attribute value. + # @param [Numeric] align + def alignment=(align) + @alignment = align if align > @alignment + @min_alignment = align + end + + # Set union attribute. + # Set to +true+ to build a {Union} instead of a {Struct}. + # @param [Boolean] is_union + # @return [is_union] + def union=(is_union) + @union = is_union + end + + # Building a {Union} or a {Struct} ? + # + # @return [Boolean] + # + def union? + @union + end + + # Set packed attribute + # @overload packed=(packed) Set alignment and packed attributes to + # +packed+. + # + # @param [Fixnum] packed + # + # @return [packed] + # @overload packed=(packed) Set packed attribute. + # @param packed + # + # @return [0,1] + # + def packed=(packed) + if packed.is_a?(0.class) + @alignment = packed + @packed = packed + else + @packed = packed ? 1 : 0 + end + end + + + # List of number types + NUMBER_TYPES = [ + Type::INT8, + Type::UINT8, + Type::INT16, + Type::UINT16, + Type::INT32, + Type::UINT32, + Type::LONG, + Type::ULONG, + Type::INT64, + Type::UINT64, + Type::FLOAT32, + Type::FLOAT64, + Type::LONGDOUBLE, + Type::BOOL, + ] + + # @param [String, Symbol] name name of the field + # @param [Array, DataConverter, Struct, StructLayout::Field, Symbol, Type] type type of the field + # @param [Numeric, nil] offset + # @return [self] + # Add a field to the builder. + # @note Setting +offset+ to +nil+ or +-1+ is equivalent to +0+. + def add(name, type, offset = nil) + + if offset.nil? || offset == -1 + offset = @union ? 0 : align(@size, @packed ? [ @packed, type.alignment ].min : [ @min_alignment, type.alignment ].max) + end + + # + # If a FFI::Type type was passed in as the field arg, try and convert to a StructLayout::Field instance + # + field = type.is_a?(StructLayout::Field) ? type : field_for_type(name, offset, type) + @fields << field + @alignment = [ @alignment, field.alignment ].max unless @packed + @size = [ @size, field.size + (@union ? 0 : field.offset) ].max + + return self + end + + # @param (see #add) + # @return (see #add) + # Same as {#add}. + # @see #add + def add_field(name, type, offset = nil) + add(name, type, offset) + end + + # @param (see #add) + # @return (see #add) + # Add a struct as a field to the builder. + def add_struct(name, type, offset = nil) + add(name, Type::Struct.new(type), offset) + end + + # @param name (see #add) + # @param type (see #add) + # @param [Numeric] count array length + # @param offset (see #add) + # @return (see #add) + # Add an array as a field to the builder. + def add_array(name, type, count, offset = nil) + add(name, Type::Array.new(type, count), offset) + end + + # @return [StructLayout] + # Build and return the struct layout. + def build + # Add tail padding if the struct is not packed + size = @packed ? @size : align(@size, @alignment) + + layout = StructLayout.new(@fields, size, @alignment) + layout.__union! if @union + layout + end + + private + + # @param [Numeric] offset + # @param [Numeric] align + # @return [Numeric] + def align(offset, align) + align + ((offset - 1) & ~(align - 1)); + end + + # @param (see #add) + # @return [StructLayout::Field] + def field_for_type(name, offset, type) + field_class = case + when type.is_a?(Type::Function) + StructLayout::Function + + when type.is_a?(Type::Struct) + StructLayout::InnerStruct + + when type.is_a?(Type::Array) + StructLayout::Array + + when type.is_a?(FFI::Enum) + StructLayout::Enum + + when NUMBER_TYPES.include?(type) + StructLayout::Number + + when type == Type::POINTER + StructLayout::Pointer + + when type == Type::STRING + StructLayout::String + + when type.is_a?(Class) && type < StructLayout::Field + type + + when type.is_a?(DataConverter) + return StructLayout::Mapped.new(name, offset, Type::Mapped.new(type), field_for_type(name, offset, type.native_type)) + + when type.is_a?(Type::Mapped) + return StructLayout::Mapped.new(name, offset, type, field_for_type(name, offset, type.native_type)) + + else + raise TypeError, "invalid struct field type #{type.inspect}" + end + + field_class.new(name, offset, type) + end + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb new file mode 100644 index 0000000..70ba9c2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb @@ -0,0 +1,232 @@ +require 'tempfile' +require 'open3' + +module FFI + + # ConstGenerator turns C constants into ruby values. + # + # @example a simple example for stdio + # require 'ffi/tools/const_generator' + # cg = FFI::ConstGenerator.new('stdio') do |gen| + # gen.const(:SEEK_SET) + # gen.const('SEEK_CUR') + # gen.const('seek_end') # this constant does not exist + # end # #calculate called automatically at the end of the block + # + # cg['SEEK_SET'] # => 0 + # cg['SEEK_CUR'] # => 1 + # cg['seek_end'] # => nil + # cg.to_ruby # => "SEEK_SET = 0\nSEEK_CUR = 1\n# seek_end not available" + class ConstGenerator + @options = {} + attr_reader :constants + + # Creates a new constant generator that uses +prefix+ as a name, and an + # options hash. + # + # The only option is +:required+, which if set to +true+ raises an error if a + # constant you have requested was not found. + # + # @param [#to_s] prefix + # @param [Hash] options + # @return + # @option options [Boolean] :required + # @overload initialize(prefix, options) + # @overload initialize(prefix, options) { |gen| ... } + # @yieldparam [ConstGenerator] gen new generator is passed to the block + # When passed a block, {#calculate} is automatically called at the end of + # the block, otherwise you must call it yourself. + def initialize(prefix = nil, options = {}) + @includes = ['stdio.h', 'stddef.h'] + @constants = {} + @prefix = prefix + + @required = options[:required] + @options = options + + if block_given? then + yield self + calculate self.class.options.merge(options) + end + end + # Set class options + # These options are merged with {#initialize} options when it is called with a block. + # @param [Hash] options + # @return [Hash] class options + def self.options=(options) + @options = options + end + # Get class options. + # @return [Hash] class options + def self.options + @options + end + # @param [String] name + # @return constant value (converted if a +converter+ was defined). + # Access a constant by name. + def [](name) + @constants[name].converted_value + end + + # Request the value for C constant +name+. + # + # @param [#to_s] name C constant name + # @param [String] format a printf format string to print the value out + # @param [String] cast a C cast for the value + # @param ruby_name alternate ruby name for {#to_ruby} + # + # @overload const(name, format=nil, cast='', ruby_name=nil, converter=nil) + # +converter+ is a Method or a Proc. + # @param [#call] converter convert the value from a string to the appropriate + # type for {#to_ruby}. + # @overload const(name, format=nil, cast='', ruby_name=nil) { |value| ... } + # Use a converter block. This block convert the value from a string to the + # appropriate type for {#to_ruby}. + # @yieldparam value constant value + def const(name, format = nil, cast = '', ruby_name = nil, converter = nil, + &converter_proc) + format ||= '%d' + cast ||= '' + + if converter_proc and converter then + raise ArgumentError, "Supply only converter or converter block" + end + + converter = converter_proc if converter.nil? + + const = Constant.new name, format, cast, ruby_name, converter + @constants[name.to_s] = const + return const + end + + # Calculate constants values. + # @param [Hash] options + # @option options [String] :cppflags flags for C compiler + # @return [nil] + # @raise if a constant is missing and +:required+ was set to +true+ (see {#initialize}) + def calculate(options = {}) + binary_path = nil + + Tempfile.open("#{@prefix}.const_generator") do |f| + binary_path = f.path + ".bin" + @includes.each do |inc| + f.puts "#include <#{inc}>" + end + f.puts "\nint main(int argc, char **argv)\n{" + + @constants.each_value do |const| + f.puts <<-EOF + #ifdef #{const.name} + printf("#{const.name} #{const.format}\\n", #{const.cast}#{const.name}); + #endif + EOF + end + + f.puts "\n\treturn 0;\n}" + f.flush + + cc = ENV['CC'] || 'gcc' + output = `#{cc} #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary_path} 2>&1` + + unless $?.success? then + output = output.split("\n").map { |l| "\t#{l}" }.join "\n" + raise "Compilation error generating constants #{@prefix}:\n#{output}" + end + end + + output = `#{binary_path}` + File.unlink(binary_path + (FFI::Platform.windows? ? ".exe" : "")) + output.each_line do |line| + line =~ /^(\S+)\s(.*)$/ + const = @constants[$1] + const.value = $2 + end + + missing_constants = @constants.select do |name, constant| + constant.value.nil? + end.map { |name,| name } + + if @required and not missing_constants.empty? then + raise "Missing required constants for #{@prefix}: #{missing_constants.join ', '}" + end + end + + # Dump constants to +io+. + # @param [#puts] io + # @return [nil] + def dump_constants(io) + @constants.each do |name, constant| + name = [@prefix, name].join '.' if @prefix + io.puts "#{name} = #{constant.converted_value}" + end + end + + # Outputs values for discovered constants. If the constant's value was + # not discovered it is not omitted. + # @return [String] + def to_ruby + @constants.sort_by { |name,| name }.map do |name, constant| + if constant.value.nil? then + "# #{name} not available" + else + constant.to_ruby + end + end.join "\n" + end + + # Add additional C include file(s) to calculate constants from. + # @note +stdio.h+ and +stddef.h+ automatically included + # @param [List, Array] i include file(s) + # @return [Array] array of include files + def include(*i) + @includes |= i.flatten + end + + end + + # This class hold constants for {ConstGenerator} + class ConstGenerator::Constant + + attr_reader :name, :format, :cast + attr_accessor :value + + # @param [#to_s] name + # @param [String] format a printf format string to print the value out + # @param [String] cast a C cast for the value + # @param ruby_name alternate ruby name for {#to_ruby} + # @param [#call] converter convert the value from a string to the appropriate + # type for {#to_ruby}. + def initialize(name, format, cast, ruby_name = nil, converter=nil) + @name = name + @format = format + @cast = cast + @ruby_name = ruby_name + @converter = converter + @value = nil + end + + # Return constant value (converted if a +converter+ was defined). + # @return constant value. + def converted_value + if @converter + @converter.call(@value) + else + @value + end + end + + # get constant ruby name + # @return [String] + def ruby_name + @ruby_name || @name + end + + # Get an evaluable string from constant. + # @return [String] + def to_ruby + "#{ruby_name} = #{converted_value}" + end + + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator.rb new file mode 100644 index 0000000..5552ea5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator.rb @@ -0,0 +1,105 @@ +require 'ffi/tools/struct_generator' +require 'ffi/tools/const_generator' + +module FFI + + ## + # Generate files with C structs for FFI::Struct and C constants. + # + # == A simple example + # + # In file +zlib.rb.ffi+: + # module Zlib + # @@@ + # constants do |c| + # c.include "zlib.h" + # c.const :ZLIB_VERNUM + # end + # @@@ + # + # class ZStream < FFI::Struct + # + # struct do |s| + # s.name "struct z_stream_s" + # s.include "zlib.h" + # + # s.field :next_in, :pointer + # s.field :avail_in, :uint + # s.field :total_in, :ulong + # end + # @@@ + # end + # end + # + # Translate the file: + # require "ffi/tools/generator" + # FFI::Generator.new "zlib.rb.ffi", "zlib.rb" + # + # Generates the file +zlib.rb+ with constant values and offsets: + # module Zlib + # ZLIB_VERNUM = 4784 + # + # class ZStream < FFI::Struct + # layout :next_in, :pointer, 0, + # :avail_in, :uint, 8, + # :total_in, :ulong, 16 + # end + # + # @see FFI::Generator::Task for easy integration in a Rakefile + class Generator + + def initialize(ffi_name, rb_name, options = {}) + @ffi_name = ffi_name + @rb_name = rb_name + @options = options + @name = File.basename rb_name, '.rb' + + file = File.read @ffi_name + + new_file = file.gsub(/^( *)@@@(.*?)@@@/m) do + @constants = [] + @structs = [] + + indent = $1 + original_lines = $2.count "\n" + + instance_eval $2, @ffi_name, $`.count("\n") + + new_lines = [] + @constants.each { |c| new_lines << c.to_ruby } + @structs.each { |s| new_lines << s.generate_layout } + + new_lines = new_lines.join("\n").split "\n" # expand multiline blocks + new_lines = new_lines.map { |line| indent + line } + + padding = original_lines - new_lines.length + new_lines += [nil] * padding if padding >= 0 + + new_lines.join "\n" + end + + open @rb_name, 'w' do |f| + f.puts "# This file is generated from `#{@ffi_name}'. Do not edit." + f.puts + f.puts new_file + end + end + + def constants(options = {}, &block) + @constants << FFI::ConstGenerator.new(@name, @options.merge(options), &block) + end + + def struct(options = {}, &block) + @structs << FFI::StructGenerator.new(@name, @options.merge(options), &block) + end + + ## + # Utility converter for constants + + def to_s + proc { |obj| obj.to_s.inspect } + end + + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator_task.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator_task.rb new file mode 100644 index 0000000..da72968 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/generator_task.rb @@ -0,0 +1,32 @@ +require 'ffi/tools/generator' +require 'rake' +require 'rake/tasklib' + +## +# Add Rake tasks that generate files with C structs for FFI::Struct and C constants. +# +# @example a simple example for your Rakefile +# require "ffi/tools/generator_task" +# # Add a task to generate my_object.rb out of my_object.rb.ffi +# FFI::Generator::Task.new ["my_object.rb"], cflags: "-I/usr/local/mylibrary" +# +# The generated files are also added to the 'clear' task. +# +# @see FFI::Generator for a description of the file content +class FFI::Generator::Task < Rake::TaskLib + + def initialize(rb_names, options={}) + task :clean do rm_f rb_names end + + rb_names.each do |rb_name| + ffi_name = "#{rb_name}.ffi" + + file rb_name => ffi_name do |t| + puts "Generating #{rb_name}..." if Rake.application.options.trace + + FFI::Generator.new ffi_name, rb_name, options + end + end + end + +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/struct_generator.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/struct_generator.rb new file mode 100644 index 0000000..3a951c3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/struct_generator.rb @@ -0,0 +1,195 @@ +require 'tempfile' + +module FFI + + ## + # Generates an FFI Struct layout. + # + # Given the @@@ portion in: + # + # class Zlib::ZStream < FFI::Struct + # @@@ + # name "struct z_stream_s" + # include "zlib.h" + # + # field :next_in, :pointer + # field :avail_in, :uint + # field :total_in, :ulong + # + # # ... + # @@@ + # end + # + # StructGenerator will create the layout: + # + # layout :next_in, :pointer, 0, + # :avail_in, :uint, 4, + # :total_in, :ulong, 8, + # # ... + # + # StructGenerator does its best to pad the layout it produces to preserve + # line numbers. Place the struct definition as close to the top of the file + # for best results. + + class StructGenerator + @options = {} + attr_accessor :size + attr_reader :fields + + def initialize(name, options = {}) + @name = name + @struct_name = nil + @includes = [] + @fields = [] + @found = false + @size = nil + + if block_given? then + yield self + calculate self.class.options.merge(options) + end + end + def self.options=(options) + @options = options + end + def self.options + @options + end + def calculate(options = {}) + binary = File.join Dir.tmpdir, "rb_struct_gen_bin_#{Process.pid}" + + raise "struct name not set" if @struct_name.nil? + + Tempfile.open("#{@name}.struct_generator") do |f| + f.puts "#include " + + @includes.each do |inc| + f.puts "#include <#{inc}>" + end + + f.puts "#include \n\n" + f.puts "int main(int argc, char **argv)\n{" + f.puts " #{@struct_name} s;" + f.puts %[ printf("sizeof(#{@struct_name}) %u\\n", (unsigned int) sizeof(#{@struct_name}));] + + @fields.each do |field| + f.puts <<-EOF + printf("#{field.name} %u %u\\n", (unsigned int) offsetof(#{@struct_name}, #{field.name}), + (unsigned int) sizeof(s.#{field.name})); + EOF + end + + f.puts "\n return 0;\n}" + f.flush + + cc = ENV['CC'] || 'gcc' + output = `#{cc} #{options[:cppflags]} #{options[:cflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1` + + unless $?.success? then + @found = false + output = output.split("\n").map { |l| "\t#{l}" }.join "\n" + raise "Compilation error generating struct #{@name} (#{@struct_name}):\n#{output}" + end + end + + output = `#{binary}`.split "\n" + File.unlink(binary + (FFI::Platform.windows? ? ".exe" : "")) + sizeof = output.shift + unless @size + m = /\s*sizeof\([^)]+\) (\d+)/.match sizeof + @size = m[1] + end + + line_no = 0 + output.each do |line| + md = line.match(/.+ (\d+) (\d+)/) + @fields[line_no].offset = md[1].to_i + @fields[line_no].size = md[2].to_i + + line_no += 1 + end + + @found = true + end + + def field(name, type=nil) + field = Field.new(name, type) + @fields << field + return field + end + + def found? + @found + end + + def dump_config(io) + io.puts "rbx.platform.#{@name}.sizeof = #{@size}" + + @fields.each { |field| io.puts field.to_config(@name) } + end + + def generate_layout + buf = "" + + @fields.each_with_index do |field, i| + if buf.empty? + buf << "layout :#{field.name}, :#{field.type}, #{field.offset}" + else + buf << " :#{field.name}, :#{field.type}, #{field.offset}" + end + + if i < @fields.length - 1 + buf << ",\n" + end + end + + buf + end + + def get_field(name) + @fields.find { |f| name == f.name } + end + + def include(i) + @includes << i + end + + def name(n) + @struct_name = n + end + + end + + ## + # A field in a Struct. + + class StructGenerator::Field + + attr_reader :name + attr_reader :type + attr_reader :offset + attr_accessor :size + + def initialize(name, type) + @name = name + @type = type + @offset = nil + @size = nil + end + + def offset=(o) + @offset = o + end + + def to_config(name) + buf = [] + buf << "rbx.platform.#{name}.#{@name}.offset = #{@offset}" + buf << "rbx.platform.#{name}.#{@name}.size = #{@size}" + buf << "rbx.platform.#{name}.#{@name}.type = #{@type}" if @type + buf + end + + end + +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/types_generator.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/types_generator.rb new file mode 100644 index 0000000..ba2d8c5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/tools/types_generator.rb @@ -0,0 +1,137 @@ +require 'tempfile' + +module FFI + + # @private + class TypesGenerator + + ## + # Maps different C types to the C type representations we use + + TYPE_MAP = { + "char" => :char, + "signed char" => :char, + "__signed char" => :char, + "unsigned char" => :uchar, + + "short" => :short, + "signed short" => :short, + "signed short int" => :short, + "unsigned short" => :ushort, + "unsigned short int" => :ushort, + + "int" => :int, + "signed int" => :int, + "unsigned int" => :uint, + + "long" => :long, + "long int" => :long, + "signed long" => :long, + "signed long int" => :long, + "unsigned long" => :ulong, + "unsigned long int" => :ulong, + "long unsigned int" => :ulong, + + "long long" => :long_long, + "long long int" => :long_long, + "signed long long" => :long_long, + "signed long long int" => :long_long, + "unsigned long long" => :ulong_long, + "unsigned long long int" => :ulong_long, + + "char *" => :string, + "void *" => :pointer, + } + + def self.generate(options = {}) + typedefs = nil + Tempfile.open 'ffi_types_generator' do |io| + io.puts <<-C +#include +#include +#include +#if !(defined(WIN32)) +#include +#include +#include +#endif + C + + io.close + cc = ENV['CC'] || 'gcc' + cmd = "#{cc} -E -x c #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c" + if options[:input] + typedefs = File.read(options[:input]) + elsif options[:remote] + typedefs = `ssh #{options[:remote]} #{cmd} - < #{io.path}` + else + typedefs = `#{cmd} #{io.path}` + end + end + + code = [] + + typedefs.each_line do |type| + # We only care about single line typedef + next unless type =~ /typedef/ + # Ignore unions or structs + next if type =~ /union|struct/ + + # strip off the starting typedef and ending ; + type.gsub!(/^(.*typedef\s*)/, "") + type.gsub!(/\s*;\s*$/, "") + + parts = type.split(/\s+/) + def_type = parts.join(" ") + + # GCC does mapping with __attribute__ stuf, also see + # http://hal.cs.berkeley.edu/cil/cil016.html section 16.2.7. Problem + # with this is that the __attribute__ stuff can either occur before or + # after the new type that is defined... + if type =~ /__attribute__/ + if parts.last =~ /__QI__|__HI__|__SI__|__DI__|__word__/ + + # In this case, the new type is BEFORE __attribute__ we need to + # find the final_type as the type before the part that starts with + # __attribute__ + final_type = "" + parts.each do |p| + break if p =~ /__attribute__/ + final_type = p + end + else + final_type = parts.pop + end + + def_type = case type + when /__QI__/ then "char" + when /__HI__/ then "short" + when /__SI__/ then "int" + when /__DI__/ then "long long" + when /__word__/ then "long" + else "int" + end + + def_type = "unsigned #{def_type}" if type =~ /unsigned/ + else + final_type = parts.pop + def_type = parts.join(" ") + end + + if type = TYPE_MAP[def_type] + code << "rbx.platform.typedef.#{final_type} = #{type}" + TYPE_MAP[final_type] = TYPE_MAP[def_type] + else + # Fallback to an ordinary pointer if we don't know the type + if def_type =~ /\*/ + code << "rbx.platform.typedef.#{final_type} = pointer" + TYPE_MAP[final_type] = :pointer + end + end + end + + code.sort.join("\n") + end + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/types.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/types.rb new file mode 100644 index 0000000..90f50c1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/types.rb @@ -0,0 +1,194 @@ +# +# Copyright (C) 2008-2010 Wayne Meissner +# Copyright (c) 2007, 2008 Evan Phoenix +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# see {file:README} +module FFI + + # @param [Type, DataConverter, Symbol] old type definition used by {FFI.find_type} + # @param [Symbol] add new type definition's name to add + # @return [Type] + # Add a definition type to type definitions. + def self.typedef(old, add) + TypeDefs[add] = self.find_type(old) + end + + # (see FFI.typedef) + def self.add_typedef(old, add) + typedef old, add + end + + + # @param [Type, DataConverter, Symbol] name + # @param [Hash] type_map if nil, {FFI::TypeDefs} is used + # @return [Type] + # Find a type in +type_map+ ({FFI::TypeDefs}, by default) from + # a type objet, a type name (symbol). If +name+ is a {DataConverter}, + # a new {Type::Mapped} is created. + def self.find_type(name, type_map = nil) + if name.is_a?(Type) + name + + elsif type_map && type_map.has_key?(name) + type_map[name] + + elsif TypeDefs.has_key?(name) + TypeDefs[name] + + elsif name.is_a?(DataConverter) + (type_map || TypeDefs)[name] = Type::Mapped.new(name) + else + raise TypeError, "unable to resolve type '#{name}'" + end + end + + # List of type definitions + TypeDefs.merge!({ + # The C void type; only useful for function return types + :void => Type::VOID, + + # C boolean type + :bool => Type::BOOL, + + # C nul-terminated string + :string => Type::STRING, + + # C signed char + :char => Type::CHAR, + # C unsigned char + :uchar => Type::UCHAR, + + # C signed short + :short => Type::SHORT, + # C unsigned short + :ushort => Type::USHORT, + + # C signed int + :int => Type::INT, + # C unsigned int + :uint => Type::UINT, + + # C signed long + :long => Type::LONG, + + # C unsigned long + :ulong => Type::ULONG, + + # C signed long long integer + :long_long => Type::LONG_LONG, + + # C unsigned long long integer + :ulong_long => Type::ULONG_LONG, + + # C single precision float + :float => Type::FLOAT, + + # C double precision float + :double => Type::DOUBLE, + + # C long double + :long_double => Type::LONGDOUBLE, + + # Native memory address + :pointer => Type::POINTER, + + # 8 bit signed integer + :int8 => Type::INT8, + # 8 bit unsigned integer + :uint8 => Type::UINT8, + + # 16 bit signed integer + :int16 => Type::INT16, + # 16 bit unsigned integer + :uint16 => Type::UINT16, + + # 32 bit signed integer + :int32 => Type::INT32, + # 32 bit unsigned integer + :uint32 => Type::UINT32, + + # 64 bit signed integer + :int64 => Type::INT64, + # 64 bit unsigned integer + :uint64 => Type::UINT64, + + :buffer_in => Type::BUFFER_IN, + :buffer_out => Type::BUFFER_OUT, + :buffer_inout => Type::BUFFER_INOUT, + + # Used in function prototypes to indicate the arguments are variadic + :varargs => Type::VARARGS, + }) + + # This will convert a pointer to a Ruby string (just like `:string`), but + # also allow to work with the pointer itself. This is useful when you want + # a Ruby string already containing a copy of the data, but also the pointer + # to the data for you to do something with it, like freeing it, in case the + # library handed the memory off to the caller (Ruby-FFI). + # + # It's {typedef}'d as +:strptr+. + class StrPtrConverter + extend DataConverter + native_type Type::POINTER + + # @param [Pointer] val + # @param ctx not used + # @return [Array(String, Pointer)] + # Returns a [ String, Pointer ] tuple so the C memory for the string can be freed + def self.from_native(val, ctx) + [ val.null? ? nil : val.get_string(0), val ] + end + end + + typedef(StrPtrConverter, :strptr) + + # @param type +type+ is an instance of class accepted by {FFI.find_type} + # @return [Numeric] + # Get +type+ size, in bytes. + def self.type_size(type) + find_type(type).size + end + + # Load all the platform dependent types + begin + File.open(File.join(Platform::CONF_DIR, 'types.conf'), "r") do |f| + prefix = "rbx.platform.typedef." + f.each_line { |line| + if line.index(prefix) == 0 + new_type, orig_type = line.chomp.slice(prefix.length..-1).split(/\s*=\s*/) + typedef(orig_type.to_sym, new_type.to_sym) + end + } + end + typedef :pointer, :caddr_t + rescue Errno::ENOENT + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/union.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/union.rb new file mode 100644 index 0000000..38414ab --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/union.rb @@ -0,0 +1,43 @@ +# +# Copyright (C) 2009 Andrea Fazzi +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +require 'ffi/struct' + +module FFI + + class Union < FFI::Struct + def self.builder + b = StructLayoutBuilder.new + b.union = true + b + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/variadic.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/variadic.rb new file mode 100644 index 0000000..743ce7f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/variadic.rb @@ -0,0 +1,69 @@ +# +# Copyright (C) 2008, 2009 Wayne Meissner +# Copyright (C) 2009 Luc Heinrich +# +# This file is part of ruby-ffi. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Ruby FFI project nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +module FFI + class VariadicInvoker + def call(*args, &block) + param_types = Array.new(@fixed) + param_values = Array.new + @fixed.each_with_index do |t, i| + param_values << args[i] + end + i = @fixed.length + while i < args.length + param_types << FFI.find_type(args[i], @type_map) + param_values << args[i + 1] + i += 2 + end + invoke(param_types, param_values, &block) + end + + # + # Attach the invoker to module +mod+ as +mname+ + # + def attach(mod, mname) + invoker = self + params = "*args" + call = "call" + mod.module_eval <<-code + @@#{mname} = invoker + def self.#{mname}(#{params}) + @@#{mname}.#{call}(#{params}) + end + def #{mname}(#{params}) + @@#{mname}.#{call}(#{params}) + end + code + invoker + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/version.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/version.rb new file mode 100644 index 0000000..3027569 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/version.rb @@ -0,0 +1,3 @@ +module FFI + VERSION = '1.15.5' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi_c.so b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi_c.so new file mode 100755 index 0000000..9347d1f Binary files /dev/null and b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi_c.so differ diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/rakelib/ffi_gem_helper.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/rakelib/ffi_gem_helper.rb new file mode 100644 index 0000000..74be131 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/rakelib/ffi_gem_helper.rb @@ -0,0 +1,65 @@ +require 'bundler' +require 'bundler/gem_helper' + +class FfiGemHelper < Bundler::GemHelper + attr_accessor :cross_platforms + + def install + super + + task "release:guard_clean" => ["release:update_history"] + + task "release:update_history" do + update_history + end + + task "release:rubygem_push" => ["gem:native", "gem:java"] + end + + def hfile + "CHANGELOG.md" + end + + def headline + '([^\w]*)(\d+\.\d+\.\d+(?:\.\w+)?)([^\w]+)([2Y][0Y][0-9Y][0-9Y]-[0-1M][0-9M]-[0-3D][0-9D])([^\w]*|$)' + end + + def reldate + Time.now.strftime("%Y-%m-%d") + end + + def update_history + hin = File.read(hfile) + hout = hin.sub(/#{headline}/) do + raise "#{hfile} isn't up-to-date for version #{version}" unless $2==version.to_s + $1 + $2 + $3 + reldate + $5 + end + if hout != hin + Bundler.ui.confirm "Updating #{hfile} for release." + File.write(hfile, hout) + Rake::FileUtilsExt.sh "git", "commit", hfile, "-m", "Update release date in #{hfile}" + end + end + + def tag_version + Bundler.ui.confirm "Tag release with annotation:" + m = File.read(hfile).match(/(?#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}") + Bundler.ui.info(m[:annotation].gsub(/^/, " ")) + IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd| + fd.write m[:annotation] + end + yield if block_given? + rescue + Bundler.ui.error "Untagging #{version_tag} due to error." + sh_with_code "git tag -d #{version_tag}" + raise + end + + def rubygem_push(path) + cross_platforms.each do |ruby_platform| + super(path.gsub(/\.gem\z/, "-#{ruby_platform}.gem")) + end + super(path.gsub(/\.gem\z/, "-java.gem")) + super(path) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getlogin.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getlogin.rb new file mode 100644 index 0000000..6713021 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getlogin.rb @@ -0,0 +1,8 @@ +require 'ffi' + +module Foo + extend FFI::Library + ffi_lib FFI::Library::LIBC + attach_function :getlogin, [ ], :string +end +puts "getlogin=#{Foo.getlogin}" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getpid.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getpid.rb new file mode 100644 index 0000000..1720635 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/getpid.rb @@ -0,0 +1,8 @@ +require 'ffi' + +module Foo + extend FFI::Library + ffi_lib FFI::Library::LIBC + attach_function :getpid, [ ], :int +end +puts "My pid=#{Foo.getpid}" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/gettimeofday.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/gettimeofday.rb new file mode 100644 index 0000000..864bbb6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/gettimeofday.rb @@ -0,0 +1,18 @@ +require 'ffi' +require 'rbconfig' + +class Timeval < FFI::Struct + layout tv_sec: :ulong, tv_usec: :ulong +end +module LibC + extend FFI::Library + if FFI::Platform.windows? + ffi_lib RbConfig::CONFIG["LIBRUBY_SO"] + else + ffi_lib FFI::Library::LIBC + end + attach_function :gettimeofday, [ :pointer, :pointer ], :int +end +t = Timeval.new +LibC.gettimeofday(t.pointer, nil) +puts "t.tv_sec=#{t[:tv_sec]} t.tv_usec=#{t[:tv_usec]}" diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/hello.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/hello.rb new file mode 100644 index 0000000..f2ccf37 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/hello.rb @@ -0,0 +1,8 @@ +require 'ffi' + +module Foo + extend FFI::Library + ffi_lib FFI::Library::LIBC + attach_function("cputs", "puts", [ :string ], :int) +end +Foo.cputs("Hello, World via libc puts using FFI on MRI ruby") diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/inotify.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/inotify.rb new file mode 100644 index 0000000..018d78c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/inotify.rb @@ -0,0 +1,60 @@ +require 'ffi' + +module Inotify + extend FFI::Library + ffi_lib FFI::Library::LIBC + class Event < FFI::Struct + layout \ + :wd, :int, + :mask, :uint, + :cookie, :uint, + :len, :uint + end + attach_function :init, :inotify_init, [ ], :int + attach_function :add_watch, :inotify_add_watch, [ :int, :string, :uint ], :int + attach_function :rm_watch, :inotify_rm_watch, [ :int, :uint ], :int + attach_function :read, [ :int, :buffer_out, :uint ], :int + IN_ACCESS=0x00000001 + IN_MODIFY=0x00000002 + IN_ATTRIB=0x00000004 + IN_CLOSE_WRITE=0x00000008 + IN_CLOSE_NOWRITE=0x00000010 + IN_CLOSE=(IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) + IN_OPEN=0x00000020 + IN_MOVED_FROM=0x00000040 + IN_MOVED_TO=0x00000080 + IN_MOVE= (IN_MOVED_FROM | IN_MOVED_TO) + IN_CREATE=0x00000100 + IN_DELETE=0x00000200 + IN_DELETE_SELF=0x00000400 + IN_MOVE_SELF=0x00000800 + # Events sent by the kernel. + IN_UNMOUNT=0x00002000 + IN_Q_OVERFLOW=0x00004000 + IN_IGNORED=0x00008000 + IN_ONLYDIR=0x01000000 + IN_DONT_FOLLOW=0x02000000 + IN_MASK_ADD=0x20000000 + IN_ISDIR=0x40000000 + IN_ONESHOT=0x80000000 + IN_ALL_EVENTS=(IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \ + | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \ + | IN_MOVED_TO | IN_CREATE | IN_DELETE \ + | IN_DELETE_SELF | IN_MOVE_SELF) + +end +if $0 == __FILE__ + fd = Inotify.init + puts "fd=#{fd}" + wd = Inotify.add_watch(fd, "/tmp/", Inotify::IN_ALL_EVENTS) + fp = FFI::IO.for_fd(fd) + puts "wfp=#{fp}" + while true + buf = FFI::Buffer.alloc_out(Inotify::Event.size + 4096, 1, false) + ev = Inotify::Event.new buf + ready = IO.select([ fp ], nil, nil, nil) + n = Inotify.read(fd, buf, buf.total) + puts "Read #{n} bytes from inotify fd" + puts "event.wd=#{ev[:wd]} mask=#{ev[:mask]} len=#{ev[:len]} name=#{ev[:len] > 0 ? buf.get_string(16) : 'unknown'}" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/pty.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/pty.rb new file mode 100644 index 0000000..8b6b885 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/pty.rb @@ -0,0 +1,75 @@ +require 'ffi' + +module PTY + private + module LibC + extend FFI::Library + ffi_lib FFI::Library::LIBC + attach_function :forkpty, [ :buffer_out, :buffer_out, :buffer_in, :buffer_in ], :int + attach_function :openpty, [ :buffer_out, :buffer_out, :buffer_out, :buffer_in, :buffer_in ], :int + attach_function :login_tty, [ :int ], :int + attach_function :close, [ :int ], :int + attach_function :strerror, [ :int ], :string + attach_function :fork, [], :int + attach_function :execv, [ :string, :buffer_in ], :int + attach_function :execvp, [ :string, :buffer_in ], :int + attach_function :dup2, [ :int, :int ], :int + attach_function :dup, [ :int ], :int + end + Buffer = FFI::Buffer + def self.build_args(args) + cmd = args.shift + cmd_args = args.map do |arg| + MemoryPointer.from_string(arg) + end + exec_args = MemoryPointer.new(:pointer, 1 + cmd_args.length + 1) + exec_cmd = MemoryPointer.from_string(cmd) + exec_args[0].put_pointer(0, exec_cmd) + cmd_args.each_with_index do |arg, i| + exec_args[i + 1].put_pointer(0, arg) + end + [ cmd, exec_args ] + end + public + def self.getpty(*args) + mfdp = Buffer.new :int + name = Buffer.new 1024 + # + # All the execv setup is done in the parent, since doing anything other than + # execv in the child after fork is really flakey + # + exec_cmd, exec_args = build_args(args) + pid = LibC.forkpty(mfdp, name, nil, nil) + raise "forkpty failed: #{LibC.strerror(FFI.errno)}" if pid < 0 + if pid == 0 + LibC.execvp(exec_cmd, exec_args) + exit 1 + end + masterfd = mfdp.get_int(0) + rfp = FFI::IO.for_fd(masterfd, "r") + wfp = FFI::IO.for_fd(LibC.dup(masterfd), "w") + if block_given? + yield rfp, wfp, pid + rfp.close unless rfp.closed? + wfp.close unless wfp.closed? + else + [ rfp, wfp, pid ] + end + end + def self.spawn(*args, &block) + self.getpty("/bin/sh", "-c", args[0], &block) + end +end +module LibC + extend FFI::Library + attach_function :close, [ :int ], :int + attach_function :write, [ :int, :buffer_in, :ulong ], :long + attach_function :read, [ :int, :buffer_out, :ulong ], :long +end +PTY.getpty("/bin/ls", "-alR", "/") { |rfd, wfd, pid| +#PTY.spawn("ls -laR /") { |rfd, wfd, pid| + puts "child pid=#{pid}" + while !rfd.eof? && (buf = rfd.gets) + puts "child: '#{buf.strip}'" + end +} diff --git a/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/qsort.rb b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/qsort.rb new file mode 100644 index 0000000..58622c1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/samples/qsort.rb @@ -0,0 +1,20 @@ +require 'ffi' + +module LibC + extend FFI::Library + ffi_lib FFI::Library::LIBC + callback :qsort_cmp, [ :pointer, :pointer ], :int + attach_function :qsort, [ :pointer, :ulong, :ulong, :qsort_cmp ], :int +end + +p = FFI::MemoryPointer.new(:int, 2) +p.put_array_of_int32(0, [ 2, 1 ]) +puts "ptr=#{p.inspect}" +puts "Before qsort #{p.get_array_of_int32(0, 2).join(', ')}" +LibC.qsort(p, 2, 4) do |p1, p2| + i1 = p1.get_int32(0) + i2 = p2.get_int32(0) + puts "In block: comparing #{i1} and #{i2}" + i1 < i2 ? -1 : i1 > i2 ? 1 : 0 +end +puts "After qsort #{p.get_array_of_int32(0, 2).join(', ')}" diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.gitignore b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.gitignore new file mode 100644 index 0000000..0cb6eeb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.gitignore @@ -0,0 +1,9 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.rspec b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.rspec new file mode 100644 index 0000000..baef103 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.rspec @@ -0,0 +1,4 @@ +--color +--format documentation +--backtrace +--warnings \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.simplecov b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.simplecov new file mode 100644 index 0000000..112e5db --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.simplecov @@ -0,0 +1,9 @@ + +SimpleCov.start do + add_filter "/spec/" +end + +if ENV['TRAVIS'] + require 'coveralls' + Coveralls.wear! +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.travis.yml new file mode 100644 index 0000000..391699f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/.travis.yml @@ -0,0 +1,5 @@ +language: ruby +sudo: false +env: COVERAGE=true +rvm: + - 2.3.0 diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Gemfile b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Gemfile new file mode 100644 index 0000000..c47c10a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in http-accept.gemspec +gemspec + +group :test do + gem 'simplecov' + gem 'coveralls', require: false +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/README.md b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/README.md new file mode 100644 index 0000000..d0346a7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/README.md @@ -0,0 +1,137 @@ +# HTTP::Accept + +Provides a robust set of parsers for dealing with HTTP `Accept`, `Accept-Language`, `Accept-Encoding`, `Accept-Charset` headers. + +[![Build Status](https://secure.travis-ci.org/ioquatix/http-accept.svg)](http://travis-ci.org/ioquatix/http-accept) +[![Code Climate](https://codeclimate.com/github/ioquatix/http-accept.svg)](https://codeclimate.com/github/ioquatix/http-accept) +[![Coverage Status](https://coveralls.io/repos/ioquatix/http-accept/badge.svg)](https://coveralls.io/r/ioquatix/http-accept) + +## Motivation + +I've been [developing some tools for building RESTful endpoints](https://github.com/ioquatix/utopia/blob/master/lib/utopia/controller/respond.rb) and part of that involved versioning. After reviewing the options, I settled on using the `Accept: application/json;version=1` method [as outlined here](http://labs.qandidate.com/blog/2014/10/16/using-the-accept-header-to-version-your-api/). + +The `version=1` part of the `media-type` is a `parameter` as defined by [RFC7231 Section 3.1.1.1](https://tools.ietf.org/html/rfc7231#section-3.1.1.1). After reviewing several existing different options for parsing the `Accept:` header, I noticed a disturbing trend: `header.split(',')`. Because parameters may contain quoted strings which contain commas, this is clearly not an appropriate way to parse the header. + +I am concerned about correctness, security and performance. As such, I implemented this gem to provide a simple high level interface for both parsing and correctly interpreting these headers. + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'http-accept' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install http-accept + +## Usage + +Here are some examples of how to parse various headers. + +### Parsing Accept: headers + +You can parse the incoming `Accept:` header: + +```ruby +media_types = HTTP::Accept::MediaTypes.parse("text/html;q=0.5, application/json; version=1") + +expect(media_types[0].mime_type).to be == "application/json" +expect(media_types[0].parameters).to be == {'version' => '1'} +expect(media_types[1].mime_type).to be == "text/html" +expect(media_types[1].parameters).to be == {'q' => '0.5'} +``` + +Normally, you'd want to match the media types against some set of available mime types: + +```ruby +module ToJSON + def content_type + HTTP::Accept::ContentType.new("application/json", charset: 'utf-8') + end + + # Used for inserting into map. + def split(*args) + content_type.split(*args) + end + + def convert(object, options) + object.to_json + end +end + +module ToXML + # Are you kidding? +end + +map = HTTP::Accept::MediaTypes::Map.new +map << ToJSON +map << ToXML + +object, media_range = map.for(media_types) +content = object.convert(model, media_range.parameters) +response = [200, {'Content-Type' => object.content_type}, [content]] +``` + +### Parsing Accept-Language: headers + +You can parse the incoming `Accept-Language:` header: + +```ruby +languages = HTTP::Accept::Languages.parse("da, en-gb;q=0.8, en;q=0.7") + +expect(languages[0].locale).to be == "da" +expect(languages[1].locale).to be == "en-gb" +expect(languages[2].locale).to be == "en" +``` + +Normally, you'd want to match the languages against some set of available localizations: + +```ruby +available_localizations = HTTP::Accept::Languages::Locales.new(["en-nz", "en-us"]) + +# Given the languages that the user wants, and the localizations available, compute the set of desired localizations. +desired_localizations = available_localizations & languages +``` + +The `desired_localizations` in the example above is a subset of `available_localizations`. + +`HTTP::Accept::Languages::Locales` provides an efficient data-structure for matching the Accept-Languages header to set of available localizations according to https://tools.ietf.org/html/rfc7231#section-5.3.5 and https://tools.ietf.org/html/rfc4647#section-2.3 + +## Contributing + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request + +## License + +Released under the MIT license. + +Copyright, 2016, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams). +Copyright, 2016, by [Matthew Kerwin](http://kerwin.net.au). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Rakefile b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Rakefile new file mode 100644 index 0000000..64aae46 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/Rakefile @@ -0,0 +1,8 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) do |task| + task.rspec_opts = ["--require", "simplecov"] if ENV['COVERAGE'] +end + +task :default => :spec diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/http-accept.gemspec b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/http-accept.gemspec new file mode 100644 index 0000000..363bfb1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/http-accept.gemspec @@ -0,0 +1,23 @@ +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'http/accept/version' + +Gem::Specification.new do |spec| + spec.name = "http-accept" + spec.version = HTTP::Accept::VERSION + spec.authors = ["Samuel Williams"] + spec.email = ["samuel.williams@oriontransfer.co.nz"] + + spec.summary = %q{Parse Accept and Accept-Language HTTP headers.} + spec.homepage = "https://github.com/ioquatix/http-accept" + + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.11" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rspec", "~> 3.0" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept.rb new file mode 100644 index 0000000..9963626 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept.rb @@ -0,0 +1,38 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require "http/accept/version" + +require_relative 'accept/version' + +# Accept: header +require_relative 'accept/media_types' +require_relative 'accept/content_type' + +# Accept-Encoding: header +require_relative 'accept/encodings' + +# Accept-Language: header +require_relative 'accept/languages' + +module HTTP + module Accept + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/charsets.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/charsets.rb new file mode 100644 index 0000000..fb596e7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/charsets.rb @@ -0,0 +1,89 @@ +# Copyright (C) 2016, Matthew Kerwin +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require 'strscan' + +require_relative 'parse_error' +require_relative 'quoted_string' +require_relative 'sort' + +module HTTP + module Accept + module Charsets + # https://tools.ietf.org/html/rfc7231#section-5.3.1 + QVALUE = /0(\.[0-9]{0,3})?|1(\.[0]{0,3})?/ + + # https://tools.ietf.org/html/rfc7231#section-5.3.3 + CHARSETS = /(?#{TOKEN})(;q=(?#{QVALUE}))?/ + + Charset = Struct.new(:charset, :q) do + def quality_factor + (q || 1.0).to_f + end + + def self.parse(scanner) + return to_enum(:parse, scanner) unless block_given? + + while scanner.scan(CHARSETS) + yield self.new(scanner[:charset], scanner[:q]) + + # Are there more? + break unless scanner.scan(/\s*,\s*/) + end + + raise ParseError.new('Could not parse entire string!') unless scanner.eos? + end + end + + def self.parse(text) + scanner = StringScanner.new(text) + + charsets = Charset.parse(scanner) + + return Sort.by_quality_factor(charsets) + end + + HTTP_ACCEPT_CHARSET = 'HTTP_ACCEPT_CHARSET'.freeze + WILDCARD_CHARSET = Charset.new('*', nil).freeze + + # Parse the list of browser preferred charsets and return ordered by priority. + def self.browser_preferred_charsets(env) + if accept_charsets = env[HTTP_ACCEPT_CHARSET] + accept_charsets.strip! + + if accept_charsets.empty? + # https://tools.ietf.org/html/rfc7231#section-5.3.3 : + # + # Accept-Charset = 1#( ( charset / "*" ) [ weight ] ) + # + # Because of the `1#` rule, an empty header value is not considered valid. + raise ParseError.new('Could not parse entire string!') + else + return HTTP::Accept::Charsets.parse(accept_charsets) + end + end + + # "A request without any Accept-Charset header field implies that the + # user agent will accept any charset in response." + return [WILDCARD_CHARSET] + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/content_type.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/content_type.rb new file mode 100644 index 0000000..d2836ef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/content_type.rb @@ -0,0 +1,36 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require_relative 'media_types' +require_relative 'quoted_string' + +module HTTP + module Accept + # A content type is different from a media range, in that a content type should not have any wild cards. + class ContentType < MediaTypes::MediaRange + def initialize(mime_type, parameters = {}) + # We do some basic validation here: + raise ArgumentError.new("#{self.class} can not have wildcards: #{mime_type}") if mime_type.include? '*' + + super + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/encodings.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/encodings.rb new file mode 100644 index 0000000..7318aee --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/encodings.rb @@ -0,0 +1,94 @@ +# Copyright (C) 2016, Matthew Kerwin +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require 'strscan' + +require_relative 'parse_error' +require_relative 'quoted_string' +require_relative 'sort' + +module HTTP + module Accept + module Encodings + # https://tools.ietf.org/html/rfc7231#section-5.3.4 + CONTENT_CODING = TOKEN + + # https://tools.ietf.org/html/rfc7231#section-5.3.1 + QVALUE = /0(\.[0-9]{0,3})?|1(\.[0]{0,3})?/ + + CODINGS = /(?#{CONTENT_CODING})(;q=(?#{QVALUE}))?/ + + ContentCoding = Struct.new(:encoding, :q) do + def quality_factor + (q || 1.0).to_f + end + + def self.parse(scanner) + return to_enum(:parse, scanner) unless block_given? + + while scanner.scan(CODINGS) + yield self.new(scanner[:encoding], scanner[:q]) + + # Are there more? + break unless scanner.scan(/\s*,\s*/) + end + + raise ParseError.new('Could not parse entire string!') unless scanner.eos? + end + end + + def self.parse(text) + scanner = StringScanner.new(text) + + encodings = ContentCoding.parse(scanner) + + return Sort.by_quality_factor(encodings) + end + + HTTP_ACCEPT_ENCODING = 'HTTP_ACCEPT_ENCODING'.freeze + WILDCARD_CONTENT_CODING = ContentCoding.new('*', nil).freeze + IDENTITY_CONTENT_CODING = ContentCoding.new('identity', nil).freeze + + # Parse the list of browser preferred content codings and return ordered by priority. If no + # `Accept-Encoding:` header is specified, the behaviour is the same as if + # `Accept-Encoding: *` was provided, and if a blank `Accept-Encoding:` header value is + # specified, the behaviour is the same as if `Accept-Encoding: identity` was provided + # (according to RFC). + def self.browser_preferred_content_codings(env) + if accept_content_codings = env[HTTP_ACCEPT_ENCODING] + accept_content_codings.strip! + + if accept_content_codings.empty? + # "An Accept-Encoding header field with a combined field-value that is + # empty implies that the user agent does not want any content-coding in + # response." + return [IDENTITY_CONTENT_CODING] + else + return HTTP::Accept::Encodings.parse(accept_content_codings) + end + end + + # "If no Accept-Encoding field is in the request, any content-coding + # is considered acceptable by the user agent." + return [WILDCARD_CONTENT_CODING] + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/languages.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/languages.rb new file mode 100644 index 0000000..a035b3e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/languages.rb @@ -0,0 +1,127 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require 'strscan' + +require_relative 'parse_error' +require_relative 'sort' + +module HTTP + module Accept + module Languages + # https://tools.ietf.org/html/rfc3066#section-2.1 + LOCALE = /\*|[A-Z]{1,8}(-[A-Z0-9]{1,8})*/i + + # https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9 + QVALUE = /0(\.[0-9]{0,3})?|1(\.[0]{0,3})?/ + + # https://greenbytes.de/tech/webdav/rfc7231.html#quality.values + LANGUAGE_RANGE = /(?#{LOCALE})(\s*;\s*q=(?#{QVALUE}))?/ + + # Provides an efficient data-structure for matching the Accept-Languages header to set of available locales according to https://tools.ietf.org/html/rfc7231#section-5.3.5 and https://tools.ietf.org/html/rfc4647#section-2.3 + class Locales + def self.expand(locale, into) + parts = locale.split('-') + + while parts.size > 0 + key = parts.join('-') + + into[key] ||= locale + + parts.pop + end + end + + def initialize(names) + @names = names + @patterns = {} + + @names.each{|name| self.class.expand(name, @patterns)} + + self.freeze + end + + def freeze + @names.freeze + @patterns.freeze + + super + end + + def each(&block) + return to_enum unless block_given? + + @names.each(&block) + end + + attr :names + attr :patterns + + # Returns the intersection of others retaining order. + def & languages + languages.collect{|language_range| @patterns[language_range.locale]}.compact + end + + def include? locale_name + @patterns.include? locale_name + end + + def join(*args) + @names.join(*args) + end + + def + others + self.class.new(@names + others.to_a) + end + + def to_a + @names + end + end + + LanguageRange = Struct.new(:locale, :q) do + def quality_factor + (q || 1.0).to_f + end + + def self.parse(scanner) + return to_enum(:parse, scanner) unless block_given? + + while scanner.scan(LANGUAGE_RANGE) + yield self.new(scanner[:locale], scanner[:q]) + + # Are there more? + break unless scanner.scan(/\s*,\s*/) + end + + raise ParseError.new("Could not parse entire string!") unless scanner.eos? + end + end + + def self.parse(text) + scanner = StringScanner.new(text) + + languages = LanguageRange.parse(scanner) + + return Sort.by_quality_factor(languages) + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types.rb new file mode 100644 index 0000000..a171d2e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types.rb @@ -0,0 +1,131 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +require 'strscan' + +require_relative 'parse_error' +require_relative 'quoted_string' +require_relative 'sort' + +require_relative 'media_types/map' + +module HTTP + module Accept + # Parse and process the HTTP Accept: header. + module MediaTypes + # According to https://tools.ietf.org/html/rfc7231#section-5.3.2 + MIME_TYPE = /(#{TOKEN})\/(#{TOKEN})/ + PARAMETER = /\s*;\s*(?#{TOKEN})=((?#{TOKEN})|(?#{QUOTED_STRING}))/ + + # A single entry in the Accept: header, which includes a mime type and associated parameters. + MediaRange = Struct.new(:mime_type, :parameters) do + def parameters_string + return '' if parameters == nil or parameters.empty? + + parameters.collect do |key, value| + "; #{key.to_s}=#{QuotedString.quote(value.to_s)}" + end.join + end + + def === other + if other.is_a? self.class + super + else + return self.mime_type === other + end + end + + def to_s + "#{mime_type}#{parameters_string}" + end + + alias to_str to_s + + def quality_factor + parameters.fetch('q', 1.0).to_f + end + + def split(on = '/', count = 2) + mime_type.split(on, count) + end + + def self.parse_parameters(scanner, normalize_whitespace) + parameters = {} + + while scanner.scan(PARAMETER) + key = scanner[:key] + + # If the regular expression PARAMETER matched, it must be one of these two: + if value = scanner[:value] + parameters[key] = value + elsif quoted_value = scanner[:quoted_value] + parameters[key] = QuotedString.unquote(quoted_value, normalize_whitespace) + end + end + + return parameters + end + + def self.parse(scanner, normalize_whitespace = true) + return to_enum(:parse, scanner, normalize_whitespace) unless block_given? + + while mime_type = scanner.scan(MIME_TYPE) + parameters = parse_parameters(scanner, normalize_whitespace) + + yield self.new(mime_type, parameters) + + # Are there more? + break unless scanner.scan(/\s*,\s*/) + end + + raise ParseError.new("Could not parse entire string!") unless scanner.eos? + end + end + + def self.parse(text, normalize_whitespace = true) + scanner = StringScanner.new(text) + + media_types = MediaRange.parse(scanner, normalize_whitespace) + + return Sort.by_quality_factor(media_types) + end + + HTTP_ACCEPT = 'HTTP_ACCEPT'.freeze + WILDCARD_MEDIA_RANGE = MediaRange.new("*/*", {}).freeze + + # Parse the list of browser preferred content types and return ordered by priority. If no `Accept:` header is specified, the behaviour is the same as if `Accept: */*` was provided (according to RFC). + def self.browser_preferred_media_types(env) + if accept_content_types = env[HTTP_ACCEPT] + accept_content_types.strip! + + unless accept_content_types.empty? + return HTTP::Accept::MediaTypes.parse(accept_content_types) + end + end + + # According to http://tools.ietf.org/html/rfc7231#section-5.3.2: + # A request without any Accept header field implies that the user agent will accept any media type in response. + # You should treat a non-existent Accept header as */*. + return [WILDCARD_MEDIA_RANGE] + end + end + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types/map.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types/map.rb new file mode 100644 index 0000000..40fffe9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/media_types/map.rb @@ -0,0 +1,86 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +module HTTP + module Accept + module MediaTypes + # Map a set of mime types to objects. + class Map + WILDCARD = "*/*".freeze + + def initialize + @media_types = {} + end + + def freeze + unless frozen? + @media_types.freeze + @media_types.each{|key,value| value.freeze} + + super + end + end + + # Given a list of content types (e.g. from browser_preferred_content_types), return the best converter. Media types can be an array of MediaRange or String values. + def for(media_types) + media_types.each do |media_range| + mime_type = case media_range + when String then media_range + else media_range.mime_type + end + + if object = @media_types[mime_type] + return object, media_range + end + end + + return nil + end + + def []= media_range, object + @media_types[media_range] = object + end + + def [] media_range + @media_types[media_range] + end + + # Add a converter to the collection. A converter can be anything that responds to #content_type. Objects will be considered in the order they are added, subsequent objects cannot override previously defined media types. `object` must respond to #split('/', 2) which should give the type and subtype. + def << object + type, subtype = object.split('/', 2) + + # We set the default if not specified already: + @media_types[WILDCARD] = object if @media_types.empty? + + if type != '*' + @media_types["#{type}/*"] ||= object + + if subtype != '*' + @media_types["#{type}/#{subtype}"] ||= object + end + end + + return self + end + end + end + end +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/parse_error.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/parse_error.rb new file mode 100644 index 0000000..15ea70d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/parse_error.rb @@ -0,0 +1,26 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +module HTTP + module Accept + class ParseError < ArgumentError + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/quoted_string.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/quoted_string.rb new file mode 100644 index 0000000..5dc44b7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/quoted_string.rb @@ -0,0 +1,53 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +module HTTP + module Accept + # According to https://tools.ietf.org/html/rfc7231#appendix-C + TOKEN = /[!#$%&'*+\-.^_`|~0-9A-Z]+/i + QUOTED_STRING = /"(?:.(?!(? +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +module HTTP + module Accept + module Sort + # This sorts items with higher priority first, and keeps items with the same priority in the same relative order. + def self.by_quality_factor(items) + # We do this to get a stable sort: + items.sort_by.with_index{|object, index| [-object.quality_factor, index]} + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/version.rb b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/version.rb new file mode 100644 index 0000000..a7b76f2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-accept-1.7.0/lib/http/accept/version.rb @@ -0,0 +1,25 @@ +# Copyright, 2016, by Samuel G. D. Williams. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +module HTTP + module Accept + VERSION = "1.7.0" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.gitignore b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.gitignore new file mode 100644 index 0000000..d87d4be --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.gitignore @@ -0,0 +1,17 @@ +*.gem +*.rbc +.bundle +.config +.yardoc +Gemfile.lock +InstalledFiles +_yardoc +coverage +doc/ +lib/bundler/man +pkg +rdoc +spec/reports +test/tmp +test/version_tmp +tmp diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.travis.yml new file mode 100644 index 0000000..b778b6b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: ruby +cache: bundler +rvm: + - 1.8.7 + - ree + - 1.9.3 + - 2.0.0 + - 2.1 + - 2.2 + - 2.3.0 + - ruby-head + - jruby-1.7 + - jruby-9 + - rbx-2 +matrix: + allow_failures: + - rvm: ruby-head + - rvm: rbx-2 +before_install: + - gem update bundler diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/CHANGELOG.md new file mode 100644 index 0000000..769c27e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/CHANGELOG.md @@ -0,0 +1,29 @@ +## Unreleased + +- Support Mozilla's cookie storage format up to version 7. + +- Fix the time representation with creationTime and lastAccessed in + MozillaStore. (#8) + +## 1.0.3 (2016-09-30) + +- Treat comma as normal character in HTTP::Cookie.cookie_value_to_hash + instead of key-value pair separator. This should fix the problem + described in CVE-2016-7401. + +## 1.0.2 (2013-09-10) + + - Fix HTTP::Cookie.parse so that it does not raise ArgumentError + when it finds a bad name or value that is parsable but considered + invalid. + +## 1.0.1 (2013-04-21) + + - Minor error handling improvements and documentation updates. + + - Argument error regarding specifying store/saver classes no longer + raises IndexError, but either ArgumentError or TypeError. + +## 1.0.0 (2013-04-17) + + - Initial Release. diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Gemfile b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Gemfile new file mode 100644 index 0000000..527e606 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in http-cookie.gemspec +gemspec diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/LICENSE.txt b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/LICENSE.txt new file mode 100644 index 0000000..673c214 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (c) 2013 Akinori MUSHA +Copyright (c) 2011-2012 Akinori MUSHA, Eric Hodel +Copyright (c) 2006-2011 Aaron Patterson, Mike Dalessio + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/README.md b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/README.md new file mode 100644 index 0000000..62acbd6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/README.md @@ -0,0 +1,235 @@ +# HTTP::Cookie + +HTTP::Cookie is a ruby library to handle HTTP cookies in a way both +compliant with RFCs and compatible with today's major browsers. + +It was originally a part of the +[Mechanize](https://github.com/sparklemotion/mechanize) library, +separated as an independent library in the hope of serving as a common +component that is reusable from any HTTP related piece of software. + +The following is an incomplete list of its features: + +* Its behavior is highly compatible with that of today's major web + browsers. + +* It is based on and conforms to RFC 6265 (the latest standard for the + HTTP cookie mechanism) to a high extent, with real world conventions + deeply in mind. + +* It takes eTLD (effective TLD, also known as "Public Suffix") into + account just as major browsers do, to reject cookies with an eTLD + domain like "org", "co.jp", or "appspot.com". This feature is + brought to you by the domain_name gem. + +* The number of cookies and the size are properly capped so that a + cookie store does not get flooded. + +* It supports the legacy Netscape cookies.txt format for + serialization, maximizing the interoperability with other + implementations. + +* It supports the cookies.sqlite format adopted by Mozilla Firefox for + backend store database which can be shared among multiple program + instances. + +* It is relatively easy to add a new serialization format or a backend + store because of its modular API. + +## Installation + +Add this line to your application's `Gemfile`: + + gem 'http-cookie' + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install http-cookie + +## Usage + + ######################## + # Client side example 1 + ######################## + + # Initialize a cookie jar + jar = HTTP::CookieJar.new + + # Load from a file + jar.load(filename) if File.exist?(filename) + + # Store received cookies, where uri is the origin of this header + header["Set-Cookie"].each { |value| + jar.parse(value, uri) + } + + # ... + + # Set the Cookie header value, where uri is the destination URI + header["Cookie"] = HTTP::Cookie.cookie_value(jar.cookies(uri)) + + # Save to a file + jar.save(filename) + + + ######################## + # Client side example 2 + ######################## + + # Initialize a cookie jar using a Mozilla compatible SQLite3 backend + jar = HTTP::CookieJar.new(store: :mozilla, filename: 'cookies.sqlite') + + # There is no need for load & save in this backend. + + # Store received cookies, where uri is the origin of this header + header["Set-Cookie"].each { |value| + jar.parse(value, uri) + } + + # ... + + # Set the Cookie header value, where uri is the destination URI + header["Cookie"] = HTTP::Cookie.cookie_value(jar.cookies(uri)) + + + ######################## + # Server side example + ######################## + + # Generate a domain cookie + cookie1 = HTTP::Cookie.new("uid", "u12345", domain: 'example.org', + for_domain: true, + path: '/', + max_age: 7*86400) + + # Add it to the Set-Cookie response header + header['Set-Cookie'] = cookie1.set_cookie_value + + # Generate a host-only cookie + cookie2 = HTTP::Cookie.new("aid", "a12345", origin: my_url, + path: '/', + max_age: 7*86400) + + # Add it to the Set-Cookie response header + header['Set-Cookie'] = cookie2.set_cookie_value + + +## Incompatibilities with Mechanize::Cookie/CookieJar + +There are several incompatibilities between +Mechanize::Cookie/CookieJar and HTTP::Cookie/CookieJar. Below +is how to rewrite existing code written for Mechanize::Cookie with +equivalent using HTTP::Cookie: + +- Mechanize::Cookie.parse + + The parameter order changed in HTTP::Cookie.parse. + + # before + cookies1 = Mechanize::Cookie.parse(uri, set_cookie1) + cookies2 = Mechanize::Cookie.parse(uri, set_cookie2, log) + + # after + cookies1 = HTTP::Cookie.parse(set_cookie1, uri_or_url) + cookies2 = HTTP::Cookie.parse(set_cookie2, uri_or_url, logger: log) + # or you can directly store parsed cookies in your jar + jar.parse(set_cookie1, uri_or_url) + jar.parse(set_cookie1, uri_or_url, logger: log) + +- Mechanize::Cookie#version, #version= + + There is no longer a sense of version in the HTTP cookie + specification. The only version number ever defined was zero, and + there will be no other version defined since the version attribute + has been removed in RFC 6265. + +- Mechanize::Cookie#comment, #comment= + + Ditto. The comment attribute has been removed in RFC 6265. + +- Mechanize::Cookie#set_domain + + This method was unintentionally made public. Simply use + HTTP::Cookie#domain=. + + # before + cookie.set_domain(domain) + + # after + cookie.domain = domain + +- Mechanize::CookieJar#add, #add! + + Always use HTTP::CookieJar#add. + + # before + jar.add!(cookie1) + jar.add(uri, cookie2) + + # after + jar.add(cookie1) + cookie2.origin = uri; jar.add(cookie2) # or specify origin in parse() or new() + +- Mechanize::CookieJar#clear! + + Use HTTP::Cookiejar#clear. + + # before + jar.clear! + + # after + jar.clear + +- Mechanize::CookieJar#save_as + + Use HTTP::CookieJar#save. + + # before + jar.save_as(file) + + # after + jar.save(file) + +- Mechanize::CookieJar#jar + + There is no direct access to the internal hash in HTTP::CookieJar + since it has introduced an abstract store layer. If you want to + tweak the internals of the hash store, try creating a new store + class referring to the default store class + HTTP::CookieJar::HashStore. + + If you desperately need it you can access it by + `jar.store.instance_variable_get(:@jar)`, but there is no + guarantee that it will remain available in the future. + + +HTTP::Cookie/CookieJar raise runtime errors to help migration, so +after replacing the class names, try running your test code once to +find out how to fix your code base. + +### File formats + +The YAML serialization format has changed, and HTTP::CookieJar#load +cannot import what is written in a YAML file saved by +Mechanize::CookieJar#save_as. HTTP::CookieJar#load will not raise an +exception if an incompatible YAML file is given, but the content is +silently ignored. + +Note that there is (obviously) no forward compatibillity with this. +Trying to load a YAML file saved by HTTP::CookieJar with +Mechanize::CookieJar will fail in runtime error. + +On the other hand, there has been (and will ever be) no change in the +cookies.txt format, so use it instead if compatibility is significant. + +## Contributing + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Rakefile b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Rakefile new file mode 100644 index 0000000..382ee63 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/Rakefile @@ -0,0 +1,20 @@ +require 'bundler/gem_tasks' +require 'rake/testtask' + +Rake::TestTask.new(:test) do |test| + test.ruby_opts << '-r./test/simplecov_start.rb' if RUBY_VERSION >= '1.9' + test.pattern = 'test/**/test_*.rb' + test.verbose = true +end + +task :default => :test + +require 'rdoc/task' +Rake::RDocTask.new do |rdoc| + version = HTTP::Cookie::VERSION + + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "http-cookie #{version}" + rdoc.rdoc_files.include('lib/**/*.rb') + rdoc.rdoc_files.include(Bundler::GemHelper.gemspec.extra_rdoc_files) +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/http-cookie.gemspec b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/http-cookie.gemspec new file mode 100644 index 0000000..0d6f799 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/http-cookie.gemspec @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'http/cookie/version' + +Gem::Specification.new do |gem| + gem.name = "http-cookie" + gem.version = HTTP::Cookie::VERSION + gem.authors, gem.email = { + 'Akinori MUSHA' => 'knu@idaemons.org', + 'Aaron Patterson' => 'aaronp@rubyforge.org', + 'Eric Hodel' => 'drbrain@segment7.net', + 'Mike Dalessio' => 'mike.dalessio@gmail.com', + }.instance_eval { [keys, values] } + + gem.description = %q{HTTP::Cookie is a Ruby library to handle HTTP Cookies based on RFC 6265. It has with security, standards compliance and compatibility in mind, to behave just the same as today's major web browsers. It has builtin support for the legacy cookies.txt and the latest cookies.sqlite formats of Mozilla Firefox, and its modular API makes it easy to add support for a new backend store.} + gem.summary = %q{A Ruby library to handle HTTP Cookies based on RFC 6265} + gem.homepage = "https://github.com/sparklemotion/http-cookie" + gem.license = "MIT" + + gem.files = `git ls-files`.split($/) + gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.require_paths = ["lib"] + gem.extra_rdoc_files = ['README.md', 'LICENSE.txt'] + + gem.add_runtime_dependency("domain_name", ["~> 0.5"]) + gem.add_development_dependency("sqlite3", ["~> 1.3.3"]) unless defined?(JRUBY_VERSION) + gem.add_development_dependency("bundler", [">= 1.2.0"]) + gem.add_development_dependency("test-unit", [">= 2.4.3", *("< 3" if RUBY_VERSION < "1.9")]) + gem.add_development_dependency("rake", [">= 0.9.2.2", *("< 11" if RUBY_VERSION < "1.9")]) + gem.add_development_dependency("rdoc", RUBY_VERSION > "1.9" ? "> 2.4.2" : "~> 2.4.2") + gem.add_development_dependency("simplecov", [">= 0"]) + gem.add_development_dependency("json", ["< 2"]) if RUBY_VERSION < "2.0" +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http-cookie.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http-cookie.rb new file mode 100644 index 0000000..eac38ef --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http-cookie.rb @@ -0,0 +1 @@ +require 'http/cookie' diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie.rb new file mode 100644 index 0000000..01e8254 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie.rb @@ -0,0 +1,685 @@ +# :markup: markdown +require 'http/cookie/version' +require 'time' +require 'uri' +require 'domain_name' +require 'http/cookie/ruby_compat' + +module HTTP + autoload :CookieJar, 'http/cookie_jar' +end + +# This class is used to represent an HTTP Cookie. +class HTTP::Cookie + # Maximum number of bytes per cookie (RFC 6265 6.1 requires 4096 at + # least) + MAX_LENGTH = 4096 + # Maximum number of cookies per domain (RFC 6265 6.1 requires 50 at + # least) + MAX_COOKIES_PER_DOMAIN = 50 + # Maximum number of cookies total (RFC 6265 6.1 requires 3000 at + # least) + MAX_COOKIES_TOTAL = 3000 + + # :stopdoc: + UNIX_EPOCH = Time.at(0) + + PERSISTENT_PROPERTIES = %w[ + name value + domain for_domain path + secure httponly + expires max_age + created_at accessed_at + ] + # :startdoc: + + # The cookie name. It may not be nil or empty. + # + # Assign a string containing any of the following characters will + # raise ArgumentError: control characters (`\x00-\x1F` and `\x7F`), + # space and separators `,;\"=`. + # + # Note that RFC 6265 4.1.1 lists more characters disallowed for use + # in a cookie name, which are these: `<>@:/[]?{}`. Using these + # characters will reduce interoperability. + # + # :attr_accessor: name + + # The cookie value. + # + # Assign a string containing a control character (`\x00-\x1F` and + # `\x7F`) will raise ArgumentError. + # + # Assigning nil sets the value to an empty string and the expiration + # date to the Unix epoch. This is a handy way to make a cookie for + # expiration. + # + # Note that RFC 6265 4.1.1 lists more characters disallowed for use + # in a cookie value, which are these: ` ",;\`. Using these + # characters will reduce interoperability. + # + # :attr_accessor: value + + # The cookie domain. + # + # Setting a domain with a leading dot implies that the #for_domain + # flag should be turned on. The setter accepts a DomainName object + # as well as a string-like. + # + # :attr_accessor: domain + + # The path attribute value. + # + # The setter treats an empty path ("") as the root path ("/"). + # + # :attr_accessor: path + + # The origin of the cookie. + # + # Setting this will initialize the #domain and #path attribute + # values if unknown yet. If the cookie already has a domain value + # set, it is checked against the origin URL to see if the origin is + # allowed to issue a cookie of the domain, and ArgumentError is + # raised if the check fails. + # + # :attr_accessor: origin + + # The Expires attribute value as a Time object. + # + # The setter method accepts a Time object, a string representation + # of date/time that Time.parse can understand, or `nil`. + # + # Setting this value resets #max_age to nil. When #max_age is + # non-nil, #expires returns `created_at + max_age`. + # + # :attr_accessor: expires + + # The Max-Age attribute value as an integer, the number of seconds + # before expiration. + # + # The setter method accepts an integer, or a string-like that + # represents an integer which will be stringified and then + # integerized using #to_i. + # + # This value is reset to nil when #expires= is called. + # + # :attr_accessor: max_age + + # :call-seq: + # new(name, value = nil) + # new(name, value = nil, **attr_hash) + # new(**attr_hash) + # + # Creates a cookie object. For each key of `attr_hash`, the setter + # is called if defined and any error (typically ArgumentError or + # TypeError) that is raised will be passed through. Each key can be + # either a downcased symbol or a string that may be mixed case. + # Support for the latter may, however, be obsoleted in future when + # Ruby 2.0's keyword syntax is adopted. + # + # If `value` is omitted or it is nil, an expiration cookie is + # created unless `max_age` or `expires` (`expires_at`) is given. + # + # e.g. + # + # new("uid", "a12345") + # new("uid", "a12345", :domain => 'example.org', + # :for_domain => true, :expired => Time.now + 7*86400) + # new("name" => "uid", "value" => "a12345", "Domain" => 'www.example.org') + # + def initialize(*args) + @name = @origin = @domain = @path = + @expires = @max_age = nil + @for_domain = @secure = @httponly = false + @session = true + @created_at = @accessed_at = Time.now + case argc = args.size + when 1 + if attr_hash = Hash.try_convert(args.last) + args.pop + else + self.name, self.value = args # value is set to nil + return + end + when 2..3 + if attr_hash = Hash.try_convert(args.last) + args.pop + self.name, value = args + else + argc == 2 or + raise ArgumentError, "wrong number of arguments (#{argc} for 1-3)" + self.name, self.value = args + return + end + else + raise ArgumentError, "wrong number of arguments (#{argc} for 1-3)" + end + for_domain = false + domain = max_age = origin = nil + attr_hash.each_pair { |okey, val| + case key ||= okey + when :name + self.name = val + when :value + value = val + when :domain + domain = val + when :path + self.path = val + when :origin + origin = val + when :for_domain, :for_domain? + for_domain = val + when :max_age + # Let max_age take precedence over expires + max_age = val + when :expires, :expires_at + self.expires = val unless max_age + when :httponly, :httponly? + @httponly = val + when :secure, :secure? + @secure = val + when Symbol + setter = :"#{key}=" + if respond_to?(setter) + __send__(setter, val) + else + warn "unknown attribute name: #{okey.inspect}" if $VERBOSE + next + end + when String + warn "use downcased symbol for keyword: #{okey.inspect}" if $VERBOSE + key = key.downcase.to_sym + redo + else + warn "invalid keyword ignored: #{okey.inspect}" if $VERBOSE + next + end + } + if @name.nil? + raise ArgumentError, "name must be specified" + end + @for_domain = for_domain + self.domain = domain if domain + self.origin = origin if origin + self.max_age = max_age if max_age + self.value = value.nil? && (@expires || @max_age) ? '' : value + end + + autoload :Scanner, 'http/cookie/scanner' + + class << self + # Tests if +target_path+ is under +base_path+ as described in RFC + # 6265 5.1.4. +base_path+ must be an absolute path. + # +target_path+ may be empty, in which case it is treated as the + # root path. + # + # e.g. + # + # path_match?('/admin/', '/admin/index') == true + # path_match?('/admin/', '/Admin/index') == false + # path_match?('/admin/', '/admin/') == true + # path_match?('/admin/', '/admin') == false + # + # path_match?('/admin', '/admin') == true + # path_match?('/admin', '/Admin') == false + # path_match?('/admin', '/admins') == false + # path_match?('/admin', '/admin/') == true + # path_match?('/admin', '/admin/index') == true + def path_match?(base_path, target_path) + base_path.start_with?('/') or return false + # RFC 6265 5.1.4 + bsize = base_path.size + tsize = target_path.size + return bsize == 1 if tsize == 0 # treat empty target_path as "/" + return false unless target_path.start_with?(base_path) + return true if bsize == tsize || base_path.end_with?('/') + target_path[bsize] == ?/ + end + + # Parses a Set-Cookie header value `set_cookie` assuming that it + # is sent from a source URI/URL `origin`, and returns an array of + # Cookie objects. Parts (separated by commas) that are malformed + # or considered unacceptable are silently ignored. + # + # If a block is given, each cookie object is passed to the block. + # + # Available option keywords are below: + # + # :created_at + # : The creation time of the cookies parsed. + # + # :logger + # : Logger object useful for debugging + # + # ### Compatibility Note for Mechanize::Cookie users + # + # * Order of parameters changed in HTTP::Cookie.parse: + # + # Mechanize::Cookie.parse(uri, set_cookie[, log]) + # + # HTTP::Cookie.parse(set_cookie, uri[, :logger => # log]) + # + # * HTTP::Cookie.parse does not accept nil for `set_cookie`. + # + # * HTTP::Cookie.parse does not yield nil nor include nil in an + # returned array. It simply ignores unparsable parts. + # + # * HTTP::Cookie.parse is made to follow RFC 6265 to the extent + # not terribly breaking interoperability with broken + # implementations. In particular, it is capable of parsing + # cookie definitions containing double-quotes just as naturally + # expected. + def parse(set_cookie, origin, options = nil, &block) + if options + logger = options[:logger] + created_at = options[:created_at] + end + origin = URI(origin) + + [].tap { |cookies| + Scanner.new(set_cookie, logger).scan_set_cookie { |name, value, attrs| + break if name.nil? || name.empty? + + begin + cookie = new(name, value) + rescue => e + logger.warn("Invalid name or value: #{e}") if logger + next + end + cookie.created_at = created_at if created_at + attrs.each { |aname, avalue| + begin + case aname + when 'domain' + cookie.for_domain = true + # The following may negate @for_domain if the value is + # an eTLD or IP address, hence this order. + cookie.domain = avalue + when 'path' + cookie.path = avalue + when 'expires' + # RFC 6265 4.1.2.2 + # The Max-Age attribute has precedence over the Expires + # attribute. + cookie.expires = avalue unless cookie.max_age + when 'max-age' + cookie.max_age = avalue + when 'secure' + cookie.secure = avalue + when 'httponly' + cookie.httponly = avalue + end + rescue => e + logger.warn("Couldn't parse #{aname} '#{avalue}': #{e}") if logger + end + } + + cookie.origin = origin + + cookie.acceptable? or next + + yield cookie if block_given? + + cookies << cookie + } + } + end + + # Takes an array of cookies and returns a string for use in the + # Cookie header, like "name1=value2; name2=value2". + def cookie_value(cookies) + cookies.join('; ') + end + + # Parses a Cookie header value into a hash of name-value string + # pairs. The first appearance takes precedence if multiple pairs + # with the same name occur. + def cookie_value_to_hash(cookie_value) + {}.tap { |hash| + Scanner.new(cookie_value).scan_cookie { |name, value| + hash[name] ||= value + } + } + end + end + + attr_reader :name + + # See #name. + def name= name + name = (String.try_convert(name) or + raise TypeError, "#{name.class} is not a String") + if name.empty? + raise ArgumentError, "cookie name cannot be empty" + elsif name.match(/[\x00-\x20\x7F,;\\"=]/) + raise ArgumentError, "invalid cookie name" + end + # RFC 6265 4.1.1 + # cookie-name may not match: + # /[\x00-\x20\x7F()<>@,;:\\"\/\[\]?={}]/ + @name = name + end + + attr_reader :value + + # See #value. + def value= value + if value.nil? + self.expires = UNIX_EPOCH + return @value = '' + end + value = (String.try_convert(value) or + raise TypeError, "#{value.class} is not a String") + if value.match(/[\x00-\x1F\x7F]/) + raise ArgumentError, "invalid cookie value" + end + # RFC 6265 4.1.1 + # cookie-name may not match: + # /[^\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/ + @value = value + end + + attr_reader :domain + + # See #domain. + def domain= domain + case domain + when nil + @for_domain = false + if @origin + @domain_name = DomainName.new(@origin.host) + @domain = @domain_name.hostname + else + @domain_name = @domain = nil + end + return nil + when DomainName + @domain_name = domain + else + domain = (String.try_convert(domain) or + raise TypeError, "#{domain.class} is not a String") + if domain.start_with?('.') + for_domain = true + domain = domain[1..-1] + end + if domain.empty? + return self.domain = nil + end + # Do we really need to support this? + if domain.match(/\A([^:]+):[0-9]+\z/) + domain = $1 + end + @domain_name = DomainName.new(domain) + end + # RFC 6265 5.3 5. + if domain_name.domain.nil? # a public suffix or IP address + @for_domain = false + else + @for_domain = for_domain unless for_domain.nil? + end + @domain = @domain_name.hostname + end + + # Returns the domain, with a dot prefixed only if the domain flag is + # on. + def dot_domain + @for_domain ? '.' << @domain : @domain + end + + # Returns the domain attribute value as a DomainName object. + attr_reader :domain_name + + # The domain flag. (the opposite of host-only-flag) + # + # If this flag is true, this cookie will be sent to any host in the + # \#domain, including the host domain itself. If it is false, this + # cookie will be sent only to the host indicated by the #domain. + attr_accessor :for_domain + alias for_domain? for_domain + + attr_reader :path + + # See #path. + def path= path + path = (String.try_convert(path) or + raise TypeError, "#{path.class} is not a String") + @path = path.start_with?('/') ? path : '/' + end + + attr_reader :origin + + # See #origin. + def origin= origin + return origin if origin == @origin + @origin.nil? or + raise ArgumentError, "origin cannot be changed once it is set" + # Delay setting @origin because #domain= or #path= may fail + origin = URI(origin) + if URI::HTTP === origin + self.domain ||= origin.host + self.path ||= (origin + './').path + end + @origin = origin + end + + # The secure flag. (secure-only-flag) + # + # A cookie with this flag on should only be sent via a secure + # protocol like HTTPS. + attr_accessor :secure + alias secure? secure + + # The HttpOnly flag. (http-only-flag) + # + # A cookie with this flag on should be hidden from a client script. + attr_accessor :httponly + alias httponly? httponly + + # The session flag. (the opposite of persistent-flag) + # + # A cookie with this flag on should be hidden from a client script. + attr_reader :session + alias session? session + + def expires + @expires or @created_at && @max_age ? @created_at + @max_age : nil + end + + # See #expires. + def expires= t + case t + when nil, Time + else + t = Time.parse(t) + end + @max_age = nil + @session = t.nil? + @expires = t + end + + alias expires_at expires + alias expires_at= expires= + + attr_reader :max_age + + # See #max_age. + def max_age= sec + case sec + when Integer, nil + else + str = String.try_convert(sec) or + raise TypeError, "#{sec.class} is not an Integer or String" + /\A-?\d+\z/.match(str) or + raise ArgumentError, "invalid Max-Age: #{sec.inspect}" + sec = str.to_i + end + @expires = nil + if @session = sec.nil? + @max_age = nil + else + @max_age = sec + end + end + + # Tests if this cookie is expired by now, or by a given time. + def expired?(time = Time.now) + if expires = self.expires + expires <= time + else + false + end + end + + # Expires this cookie by setting the expires attribute value to a + # past date. + def expire! + self.expires = UNIX_EPOCH + self + end + + # The time this cookie was created at. This value is used as a base + # date for interpreting the Max-Age attribute value. See #expires. + attr_accessor :created_at + + # The time this cookie was last accessed at. + attr_accessor :accessed_at + + # Tests if it is OK to accept this cookie if it is sent from a given + # URI/URL, `uri`. + def acceptable_from_uri?(uri) + uri = URI(uri) + return false unless URI::HTTP === uri && uri.host + host = DomainName.new(uri.host) + + # RFC 6265 5.3 + case + when host.hostname == @domain + true + when @for_domain # !host-only-flag + host.cookie_domain?(@domain_name) + else + @domain.nil? + end + end + + # Tests if it is OK to accept this cookie considering its origin. + # If either domain or path is missing, raises ArgumentError. If + # origin is missing, returns true. + def acceptable? + case + when @domain.nil? + raise "domain is missing" + when @path.nil? + raise "path is missing" + when @origin.nil? + true + else + acceptable_from_uri?(@origin) + end + end + + # Tests if it is OK to send this cookie to a given `uri`. A + # RuntimeError is raised if the cookie's domain is unknown. + def valid_for_uri?(uri) + if @domain.nil? + raise "cannot tell if this cookie is valid because the domain is unknown" + end + uri = URI(uri) + # RFC 6265 5.4 + return false if secure? && !(URI::HTTPS === uri) + acceptable_from_uri?(uri) && HTTP::Cookie.path_match?(@path, uri.path) + end + + # Returns a string for use in the Cookie header, i.e. `name=value` + # or `name="value"`. + def cookie_value + "#{@name}=#{Scanner.quote(@value)}" + end + alias to_s cookie_value + + # Returns a string for use in the Set-Cookie header. If necessary + # information like a path or domain (when `for_domain` is set) is + # missing, RuntimeError is raised. It is always the best to set an + # origin before calling this method. + def set_cookie_value + string = cookie_value + if @for_domain + if @domain + string << "; Domain=#{@domain}" + else + raise "for_domain is specified but domain is unknown" + end + end + if @path + if !@origin || (@origin + './').path != @path + string << "; Path=#{@path}" + end + else + raise "path is unknown" + end + if @max_age + string << "; Max-Age=#{@max_age}" + elsif @expires + string << "; Expires=#{@expires.httpdate}" + end + if @httponly + string << "; HttpOnly" + end + if @secure + string << "; Secure" + end + string + end + + def inspect + '#<%s:' % self.class << PERSISTENT_PROPERTIES.map { |key| + '%s=%s' % [key, instance_variable_get(:"@#{key}").inspect] + }.join(', ') << ' origin=%s>' % [@origin ? @origin.to_s : 'nil'] + end + + # Compares the cookie with another. When there are many cookies with + # the same name for a URL, the value of the smallest must be used. + def <=> other + # RFC 6265 5.4 + # Precedence: 1. longer path 2. older creation + (@name <=> other.name).nonzero? || + (other.path.length <=> @path.length).nonzero? || + (@created_at <=> other.created_at).nonzero? || + @value <=> other.value + end + include Comparable + + # YAML serialization helper for Syck. + def to_yaml_properties + PERSISTENT_PROPERTIES.map { |name| "@#{name}" } + end + + # YAML serialization helper for Psych. + def encode_with(coder) + PERSISTENT_PROPERTIES.each { |key| + coder[key.to_s] = instance_variable_get(:"@#{key}") + } + end + + # YAML deserialization helper for Syck. + def init_with(coder) + yaml_initialize(coder.tag, coder.map) + end + + # YAML deserialization helper for Psych. + def yaml_initialize(tag, map) + expires = nil + @origin = nil + map.each { |key, value| + case key + when 'expires' + # avoid clobbering max_age + expires = value + when *PERSISTENT_PROPERTIES + __send__(:"#{key}=", value) + end + } + self.expires = expires if self.max_age.nil? + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/ruby_compat.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/ruby_compat.rb new file mode 100644 index 0000000..60c746b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/ruby_compat.rb @@ -0,0 +1,63 @@ +class Array + def select! # :yield: x + i = 0 + each_with_index { |x, j| + yield x or next + self[i] = x if i != j + i += 1 + } + return nil if i == size + self[i..-1] = [] + self + end unless method_defined?(:select!) + + def sort_by!(&block) # :yield: x + replace(sort_by(&block)) + end unless method_defined?(:sort_by!) +end + +class Hash + class << self + def try_convert(object) + if object.is_a?(Hash) || + (object.respond_to?(:to_hash) && (object = object.to_hash).is_a?(Hash)) + object + else + nil + end + end unless method_defined?(:try_convert) + end +end + +class String + class << self + def try_convert(object) + if object.is_a?(String) || + (object.respond_to?(:to_str) && (object = object.to_str).is_a?(String)) + object + else + nil + end + end unless method_defined?(:try_convert) + end +end + +# In Ruby < 1.9.3 URI() does not accept a URI object. +if RUBY_VERSION < "1.9.3" + require 'uri' + + begin + URI(URI('')) + rescue + def URI(url) # :nodoc: + case url + when URI + url + when String + URI.parse(url) + else + raise ArgumentError, 'bad argument (expected URI object or URI string)' + end + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/scanner.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/scanner.rb new file mode 100644 index 0000000..8dbd086 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/scanner.rb @@ -0,0 +1,231 @@ +require 'http/cookie' +require 'strscan' +require 'time' + +class HTTP::Cookie::Scanner < StringScanner + # Whitespace. + RE_WSP = /[ \t]+/ + + # A pattern that matches a cookie name or attribute name which may + # be empty, capturing trailing whitespace. + RE_NAME = /(?!#{RE_WSP})[^,;\\"=]*/ + + RE_BAD_CHAR = /([\x00-\x20\x7F",;\\])/ + + # A pattern that matches the comma in a (typically date) value. + RE_COOKIE_COMMA = /,(?=#{RE_WSP}?#{RE_NAME}=)/ + + def initialize(string, logger = nil) + @logger = logger + super(string) + end + + class << self + def quote(s) + return s unless s.match(RE_BAD_CHAR) + '"' << s.gsub(/([\\"])/, "\\\\\\1") << '"' + end + end + + def skip_wsp + skip(RE_WSP) + end + + def scan_dquoted + ''.tap { |s| + case + when skip(/"/) + break + when skip(/\\/) + s << getch + when scan(/[^"\\]+/) + s << matched + end until eos? + } + end + + def scan_name + scan(RE_NAME).tap { |s| + s.rstrip! if s + } + end + + def scan_value(comma_as_separator = false) + ''.tap { |s| + case + when scan(/[^,;"]+/) + s << matched + when skip(/"/) + # RFC 6265 2.2 + # A cookie-value may be DQUOTE'd. + s << scan_dquoted + when check(/;/) + break + when comma_as_separator && check(RE_COOKIE_COMMA) + break + else + s << getch + end until eos? + s.rstrip! + } + end + + def scan_name_value(comma_as_separator = false) + name = scan_name + if skip(/\=/) + value = scan_value(comma_as_separator) + else + scan_value(comma_as_separator) + value = nil + end + [name, value] + end + + if Time.respond_to?(:strptime) + def tuple_to_time(day_of_month, month, year, time) + Time.strptime( + '%02d %s %04d %02d:%02d:%02d UTC' % [day_of_month, month, year, *time], + '%d %b %Y %T %Z' + ).tap { |date| + date.day == day_of_month or return nil + } + end + else + def tuple_to_time(day_of_month, month, year, time) + Time.parse( + '%02d %s %04d %02d:%02d:%02d UTC' % [day_of_month, month, year, *time] + ).tap { |date| + date.day == day_of_month or return nil + } + end + end + private :tuple_to_time + + def parse_cookie_date(s) + # RFC 6265 5.1.1 + time = day_of_month = month = year = nil + + s.split(/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]+/).each { |token| + case + when time.nil? && token.match(/\A(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?=\D|\z)/) + sec = + if $3 + $3.to_i + else + # violation of the RFC + @logger.warn("Time lacks the second part: #{token}") if @logger + 0 + end + time = [$1.to_i, $2.to_i, sec] + when day_of_month.nil? && token.match(/\A(\d{1,2})(?=\D|\z)/) + day_of_month = $1.to_i + when month.nil? && token.match(/\A(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i) + month = $1.capitalize + when year.nil? && token.match(/\A(\d{2,4})(?=\D|\z)/) + year = $1.to_i + end + } + + if day_of_month.nil? || month.nil? || year.nil? || time.nil? + return nil + end + + case day_of_month + when 1..31 + else + return nil + end + + case year + when 100..1600 + return nil + when 70..99 + year += 1900 + when 0..69 + year += 2000 + end + + hh, mm, ss = time + if hh > 23 || mm > 59 || ss > 59 + return nil + end + + tuple_to_time(day_of_month, month, year, time) + end + + def scan_set_cookie + # RFC 6265 4.1.1 & 5.2 + until eos? + start = pos + len = nil + + skip_wsp + + name, value = scan_name_value(true) + if value.nil? + @logger.warn("Cookie definition lacks a name-value pair.") if @logger + elsif name.empty? + @logger.warn("Cookie definition has an empty name.") if @logger + value = nil + end + attrs = {} + + case + when skip(/,/) + # The comma is used as separator for concatenating multiple + # values of a header. + len = (pos - 1) - start + break + when skip(/;/) + skip_wsp + aname, avalue = scan_name_value(true) + next if aname.empty? || value.nil? + aname.downcase! + case aname + when 'expires' + # RFC 6265 5.2.1 + avalue &&= parse_cookie_date(avalue) or next + when 'max-age' + # RFC 6265 5.2.2 + next unless /\A-?\d+\z/.match(avalue) + when 'domain' + # RFC 6265 5.2.3 + # An empty value SHOULD be ignored. + next if avalue.nil? || avalue.empty? + when 'path' + # RFC 6265 5.2.4 + # A relative path must be ignored rather than normalizing it + # to "/". + next unless /\A\//.match(avalue) + when 'secure', 'httponly' + # RFC 6265 5.2.5, 5.2.6 + avalue = true + end + attrs[aname] = avalue + end until eos? + + len ||= pos - start + + if len > HTTP::Cookie::MAX_LENGTH + @logger.warn("Cookie definition too long: #{name}") if @logger + next + end + + yield name, value, attrs if value + end + end + + def scan_cookie + # RFC 6265 4.1.1 & 5.4 + until eos? + skip_wsp + + # Do not treat comma in a Cookie header value as separator; see CVE-2016-7401 + name, value = scan_name_value(false) + + yield name, value if value + + skip(/;/) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/version.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/version.rb new file mode 100644 index 0000000..8c49d3d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie/version.rb @@ -0,0 +1,5 @@ +module HTTP + class Cookie + VERSION = "1.0.4" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar.rb new file mode 100644 index 0000000..ef5429b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar.rb @@ -0,0 +1,344 @@ +# :markup: markdown +require 'http/cookie' + +## +# This class is used to manage the Cookies that have been returned from +# any particular website. + +class HTTP::CookieJar + class << self + def const_missing(name) + case name.to_s + when /\A([A-Za-z]+)Store\z/ + file = 'http/cookie_jar/%s_store' % $1.downcase + when /\A([A-Za-z]+)Saver\z/ + file = 'http/cookie_jar/%s_saver' % $1.downcase + end + begin + require file + rescue LoadError + raise NameError, 'can\'t resolve constant %s; failed to load %s' % [name, file] + end + if const_defined?(name) + const_get(name) + else + raise NameError, 'can\'t resolve constant %s after loading %s' % [name, file] + end + end + end + + attr_reader :store + + def get_impl(base, value, *args) + case value + when base + value + when Symbol + begin + base.implementation(value).new(*args) + rescue IndexError => e + raise ArgumentError, e.message + end + when Class + if base >= value + value.new(*args) + else + raise TypeError, 'not a subclass of %s: %s' % [base, value] + end + else + raise TypeError, 'invalid object: %s' % value.inspect + end + end + private :get_impl + + # Generates a new cookie jar. + # + # Available option keywords are as below: + # + # :store + # : The store class that backs this jar. (default: `:hash`) + # A symbol addressing a store class, a store class, or an instance + # of a store class is accepted. Symbols are mapped to store + # classes, like `:hash` to HTTP::CookieJar::HashStore and `:mozilla` + # to HTTP::CookieJar::MozillaStore. + # + # Any options given are passed through to the initializer of the + # specified store class. For example, the `:mozilla` + # (HTTP::CookieJar::MozillaStore) store class requires a `:filename` + # option. See individual store classes for details. + def initialize(options = nil) + opthash = { + :store => :hash, + } + opthash.update(options) if options + @store = get_impl(AbstractStore, opthash[:store], opthash) + end + + # The copy constructor. Not all backend store classes support cloning. + def initialize_copy(other) + @store = other.instance_eval { @store.dup } + end + + # Adds a cookie to the jar if it is acceptable, and returns self in + # any case. A given cookie must have domain and path attributes + # set, or ArgumentError is raised. + # + # Whether a cookie with the `for_domain` flag on overwrites another + # with the flag off or vice versa depends on the store used. See + # individual store classes for that matter. + # + # ### Compatibility Note for Mechanize::Cookie users + # + # In HTTP::Cookie, each cookie object can store its origin URI + # (cf. #origin). While the origin URI of a cookie can be set + # manually by #origin=, one is typically given in its generation. + # To be more specific, HTTP::Cookie.new takes an `:origin` option + # and HTTP::Cookie.parse takes one via the second argument. + # + # # Mechanize::Cookie + # jar.add(origin, cookie) + # jar.add!(cookie) # no acceptance check is performed + # + # # HTTP::Cookie + # jar.origin = origin + # jar.add(cookie) # acceptance check is performed + def add(cookie) + @store.add(cookie) if + begin + cookie.acceptable? + rescue RuntimeError => e + raise ArgumentError, e.message + end + self + end + alias << add + + # Deletes a cookie that has the same name, domain and path as a + # given cookie from the jar and returns self. + # + # How the `for_domain` flag value affects the set of deleted cookies + # depends on the store used. See individual store classes for that + # matter. + def delete(cookie) + @store.delete(cookie) + self + end + + # Gets an array of cookies sorted by the path and creation time. If + # `url` is given, only ones that should be sent to the URL/URI are + # selected, with the access time of each of them updated. + def cookies(url = nil) + each(url).sort + end + + # Tests if the jar is empty. If `url` is given, tests if there is + # no cookie for the URL. + def empty?(url = nil) + if url + each(url) { return false } + return true + else + @store.empty? + end + end + + # Iterates over all cookies that are not expired in no particular + # order. + # + # An optional argument `uri` specifies a URI/URL indicating the + # destination of the cookies being selected. Every cookie yielded + # should be good to send to the given URI, + # i.e. cookie.valid_for_uri?(uri) evaluates to true. + # + # If (and only if) the `uri` option is given, last access time of + # each cookie is updated to the current time. + def each(uri = nil, &block) # :yield: cookie + block_given? or return enum_for(__method__, uri) + + if uri + uri = URI(uri) + return self unless URI::HTTP === uri && uri.host + end + + @store.each(uri, &block) + self + end + include Enumerable + + # Parses a Set-Cookie field value `set_cookie` assuming that it is + # sent from a source URL/URI `origin`, and adds the cookies parsed + # as valid and considered acceptable to the jar. Returns an array + # of cookies that have been added. + # + # If a block is given, it is called for each cookie and the cookie + # is added only if the block returns a true value. + # + # `jar.parse(set_cookie, origin)` is a shorthand for this: + # + # HTTP::Cookie.parse(set_cookie, origin) { |cookie| + # jar.add(cookie) + # } + # + # See HTTP::Cookie.parse for available options. + def parse(set_cookie, origin, options = nil) # :yield: cookie + if block_given? + HTTP::Cookie.parse(set_cookie, origin, options).tap { |cookies| + cookies.select! { |cookie| + yield(cookie) && add(cookie) + } + } + else + HTTP::Cookie.parse(set_cookie, origin, options) { |cookie| + add(cookie) + } + end + end + + # call-seq: + # jar.save(filename_or_io, **options) + # jar.save(filename_or_io, format = :yaml, **options) + # + # Saves the cookie jar into a file or an IO in the format specified + # and returns self. If a given object responds to #write it is + # taken as an IO, or taken as a filename otherwise. + # + # Available option keywords are below: + # + # * `:format` + # + # Specifies the format for saving. A saver class, a symbol + # addressing a saver class, or a pre-generated instance of a + # saver class is accepted. + # + #
+ #
:yaml
+ #
YAML structure (default)
+ #
:cookiestxt
+ #
Mozilla's cookies.txt format
+ #
+ # + # * `:session` + # + #
+ #
true
+ #
Save session cookies as well.
+ #
false
+ #
Do not save session cookies. (default)
+ #
+ # + # All options given are passed through to the underlying cookie + # saver module's constructor. + def save(writable, *options) + opthash = { + :format => :yaml, + :session => false, + } + case options.size + when 0 + when 1 + case options = options.first + when Symbol + opthash[:format] = options + else + if hash = Hash.try_convert(options) + opthash.update(hash) + end + end + when 2 + opthash[:format], options = options + if hash = Hash.try_convert(options) + opthash.update(hash) + end + else + raise ArgumentError, 'wrong number of arguments (%d for 1-3)' % (1 + options.size) + end + + saver = get_impl(AbstractSaver, opthash[:format], opthash) + + if writable.respond_to?(:write) + saver.save(writable, self) + else + File.open(writable, 'w') { |io| + saver.save(io, self) + } + end + + self + end + + # call-seq: + # jar.load(filename_or_io, **options) + # jar.load(filename_or_io, format = :yaml, **options) + # + # Loads cookies recorded in a file or an IO in the format specified + # into the jar and returns self. If a given object responds to + # \#read it is taken as an IO, or taken as a filename otherwise. + # + # Available option keywords are below: + # + # * `:format` + # + # Specifies the format for loading. A saver class, a symbol + # addressing a saver class, or a pre-generated instance of a + # saver class is accepted. + # + #
+ #
:yaml
+ #
YAML structure (default)
+ #
:cookiestxt
+ #
Mozilla's cookies.txt format
+ #
+ # + # All options given are passed through to the underlying cookie + # saver module's constructor. + def load(readable, *options) + opthash = { + :format => :yaml, + :session => false, + } + case options.size + when 0 + when 1 + case options = options.first + when Symbol + opthash[:format] = options + else + if hash = Hash.try_convert(options) + opthash.update(hash) + end + end + when 2 + opthash[:format], options = options + if hash = Hash.try_convert(options) + opthash.update(hash) + end + else + raise ArgumentError, 'wrong number of arguments (%d for 1-3)' % (1 + options.size) + end + + saver = get_impl(AbstractSaver, opthash[:format], opthash) + + if readable.respond_to?(:write) + saver.load(readable, self) + else + File.open(readable, 'r') { |io| + saver.load(io, self) + } + end + + self + end + + # Clears the cookie jar and returns self. + def clear + @store.clear + self + end + + # Removes expired cookies and returns self. If `session` is true, + # all session cookies are removed as well. + def cleanup(session = false) + @store.cleanup session + self + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_saver.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_saver.rb new file mode 100644 index 0000000..9d82873 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_saver.rb @@ -0,0 +1,65 @@ +# :markup: markdown + +# An abstract superclass for all saver classes. +class HTTP::CookieJar::AbstractSaver + class << self + @@class_map = {} + + # Gets an implementation class by the name, optionally trying to + # load "http/cookie_jar/*_saver" if not found. If loading fails, + # IndexError is raised. + def implementation(symbol) + @@class_map.fetch(symbol) + rescue IndexError + begin + require 'http/cookie_jar/%s_saver' % symbol + @@class_map.fetch(symbol) + rescue LoadError, IndexError + raise IndexError, 'cookie saver unavailable: %s' % symbol.inspect + end + end + + def inherited(subclass) # :nodoc: + @@class_map[class_to_symbol(subclass)] = subclass + end + + def class_to_symbol(klass) # :nodoc: + klass.name[/[^:]+?(?=Saver$|$)/].downcase.to_sym + end + end + + # Defines options and their default values. + def default_options + # {} + end + private :default_options + + # :call-seq: + # new(**options) + # + # Called by the constructor of each subclass using super(). + def initialize(options = nil) + options ||= {} + @logger = options[:logger] + @session = options[:session] + # Initializes each instance variable of the same name as option + # keyword. + default_options.each_pair { |key, default| + instance_variable_set("@#{key}", options.fetch(key, default)) + } + end + + # Implements HTTP::CookieJar#save(). + # + # This is an abstract method that each subclass must override. + def save(io, jar) + # self + end + + # Implements HTTP::CookieJar#load(). + # + # This is an abstract method that each subclass must override. + def load(io, jar) + # self + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_store.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_store.rb new file mode 100644 index 0000000..9c062ed --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/abstract_store.rb @@ -0,0 +1,124 @@ +# :markup: markdown +require 'monitor' + +# An abstract superclass for all store classes. +class HTTP::CookieJar::AbstractStore + include MonitorMixin + + class << self + @@class_map = {} + + # Gets an implementation class by the name, optionally trying to + # load "http/cookie_jar/*_store" if not found. If loading fails, + # IndexError is raised. + def implementation(symbol) + @@class_map.fetch(symbol) + rescue IndexError + begin + require 'http/cookie_jar/%s_store' % symbol + @@class_map.fetch(symbol) + rescue LoadError, IndexError => e + raise IndexError, 'cookie store unavailable: %s, error: %s' % symbol.inspect, e.message + end + end + + def inherited(subclass) # :nodoc: + @@class_map[class_to_symbol(subclass)] = subclass + end + + def class_to_symbol(klass) # :nodoc: + klass.name[/[^:]+?(?=Store$|$)/].downcase.to_sym + end + end + + # Defines options and their default values. + def default_options + # {} + end + private :default_options + + # :call-seq: + # new(**options) + # + # Called by the constructor of each subclass using super(). + def initialize(options = nil) + super() # MonitorMixin + options ||= {} + @logger = options[:logger] + # Initializes each instance variable of the same name as option + # keyword. + default_options.each_pair { |key, default| + instance_variable_set("@#{key}", options.fetch(key, default)) + } + end + + # This is an abstract method that each subclass must override. + def initialize_copy(other) + # self + end + + # Implements HTTP::CookieJar#add(). + # + # This is an abstract method that each subclass must override. + def add(cookie) + # self + end + + # Implements HTTP::CookieJar#delete(). + # + # This is an abstract method that each subclass must override. + def delete(cookie) + # self + end + + # Iterates over all cookies that are not expired. + # + # An optional argument +uri+ specifies a URI object indicating the + # destination of the cookies being selected. Every cookie yielded + # should be good to send to the given URI, + # i.e. cookie.valid_for_uri?(uri) evaluates to true. + # + # If (and only if) the +uri+ option is given, last access time of + # each cookie is updated to the current time. + # + # This is an abstract method that each subclass must override. + def each(uri = nil, &block) # :yield: cookie + # if uri + # ... + # else + # synchronize { + # ... + # } + # end + # self + end + include Enumerable + + # Implements HTTP::CookieJar#empty?(). + def empty? + each { return false } + true + end + + # Implements HTTP::CookieJar#clear(). + # + # This is an abstract method that each subclass must override. + def clear + # self + end + + # Implements HTTP::CookieJar#cleanup(). + # + # This is an abstract method that each subclass must override. + def cleanup(session = false) + # if session + # select { |cookie| cookie.session? || cookie.expired? } + # else + # select(&:expired?) + # end.each { |cookie| + # delete(cookie) + # } + # # subclasses can optionally remove over-the-limit cookies. + # self + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/cookiestxt_saver.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/cookiestxt_saver.rb new file mode 100644 index 0000000..df0ca01 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/cookiestxt_saver.rb @@ -0,0 +1,106 @@ +# :markup: markdown +require 'http/cookie_jar' + +# CookiestxtSaver saves and loads cookies in the cookies.txt format. +class HTTP::CookieJar::CookiestxtSaver < HTTP::CookieJar::AbstractSaver + # :singleton-method: new + # :call-seq: + # new(**options) + # + # Available option keywords are below: + # + # * `:header` + # + # Specifies the header line not including a line feed, which is + # only used by #save(). None is output if nil is + # given. (default: `"# HTTP Cookie File"`) + # + # * `:linefeed` + # + # Specifies the line separator (default: `"\n"`). + + ## + + def save(io, jar) + io.puts @header if @header + jar.each { |cookie| + next if !@session && cookie.session? + io.print cookie_to_record(cookie) + } + end + + def load(io, jar) + io.each_line { |line| + cookie = parse_record(line) and jar.add(cookie) + } + end + + private + + def default_options + { + :header => "# HTTP Cookie File", + :linefeed => "\n", + } + end + + # :stopdoc: + True = "TRUE" + False = "FALSE" + + HTTPONLY_PREFIX = '#HttpOnly_' + RE_HTTPONLY_PREFIX = /\A#{HTTPONLY_PREFIX}/ + # :startdoc: + + # Serializes the cookie into a cookies.txt line. + def cookie_to_record(cookie) + cookie.instance_eval { + [ + @httponly ? HTTPONLY_PREFIX + dot_domain : dot_domain, + @for_domain ? True : False, + @path, + @secure ? True : False, + expires.to_i, + @name, + @value + ] + }.join("\t") << @linefeed + end + + # Parses a line from cookies.txt and returns a cookie object if the + # line represents a cookie record or returns nil otherwise. + def parse_record(line) + case line + when RE_HTTPONLY_PREFIX + httponly = true + line = $' + when /\A#/ + return nil + else + httponly = false + end + + domain, + s_for_domain, # Whether this cookie is for domain + path, # Path for which the cookie is relevant + s_secure, # Requires a secure connection + s_expires, # Time the cookie expires (Unix epoch time) + name, value = line.split("\t", 7) + return nil if value.nil? + + value.chomp! + + if (expires_seconds = s_expires.to_i).nonzero? + expires = Time.at(expires_seconds) + return nil if expires < Time.now + end + + HTTP::Cookie.new(name, value, + :domain => domain, + :for_domain => s_for_domain == True, + :path => path, + :secure => s_secure == True, + :httponly => httponly, + :expires => expires) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/hash_store.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/hash_store.rb new file mode 100644 index 0000000..258be46 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/hash_store.rb @@ -0,0 +1,161 @@ +# :markup: markdown +require 'http/cookie_jar' + +class HTTP::CookieJar + # A store class that uses a hash-based cookie store. + # + # In this store, cookies that share the same name, domain and path + # will overwrite each other regardless of the `for_domain` flag + # value. This store is built after the storage model described in + # RFC 6265 5.3 where there is no mention of how the host-only-flag + # affects in storing cookies. On the other hand, in MozillaStore + # two cookies with the same name, domain and path coexist as long as + # they differ in the `for_domain` flag value, which means they need + # to be expired individually. + class HashStore < AbstractStore + def default_options + { + :gc_threshold => HTTP::Cookie::MAX_COOKIES_TOTAL / 20 + } + end + + # :call-seq: + # new(**options) + # + # Generates a hash based cookie store. + # + # Available option keywords are as below: + # + # :gc_threshold + # : GC threshold; A GC happens when this many times cookies have + # been stored (default: `HTTP::Cookie::MAX_COOKIES_TOTAL / 20`) + def initialize(options = nil) + super + + @jar = { + # hostname => { + # path => { + # name => cookie, + # ... + # }, + # ... + # }, + # ... + } + + @gc_index = 0 + end + + # The copy constructor. This store class supports cloning. + def initialize_copy(other) + @jar = Marshal.load(Marshal.dump(other.instance_variable_get(:@jar))) + end + + def add(cookie) + path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {}) + path_cookies[cookie.name] = cookie + cleanup if (@gc_index += 1) >= @gc_threshold + self + end + + def delete(cookie) + path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {}) + path_cookies.delete(cookie.name) + self + end + + def each(uri = nil) # :yield: cookie + now = Time.now + if uri + tpath = uri.path + @jar.each { |domain, paths| + paths.each { |path, hash| + next unless HTTP::Cookie.path_match?(path, tpath) + hash.delete_if { |name, cookie| + if cookie.expired?(now) + true + else + if cookie.valid_for_uri?(uri) + cookie.accessed_at = now + yield cookie + end + false + end + } + } + } + else + synchronize { + @jar.each { |domain, paths| + paths.each { |path, hash| + hash.delete_if { |name, cookie| + if cookie.expired?(now) + true + else + yield cookie + false + end + } + } + } + } + end + self + end + + def clear + @jar.clear + self + end + + def cleanup(session = false) + now = Time.now + all_cookies = [] + + synchronize { + break if @gc_index == 0 + + @jar.each { |domain, paths| + domain_cookies = [] + + paths.each { |path, hash| + hash.delete_if { |name, cookie| + if cookie.expired?(now) || (session && cookie.session?) + true + else + domain_cookies << cookie + false + end + } + } + + if (debt = domain_cookies.size - HTTP::Cookie::MAX_COOKIES_PER_DOMAIN) > 0 + domain_cookies.sort_by!(&:created_at) + domain_cookies.slice!(0, debt).each { |cookie| + delete(cookie) + } + end + + all_cookies.concat(domain_cookies) + } + + if (debt = all_cookies.size - HTTP::Cookie::MAX_COOKIES_TOTAL) > 0 + all_cookies.sort_by!(&:created_at) + all_cookies.slice!(0, debt).each { |cookie| + delete(cookie) + } + end + + @jar.delete_if { |domain, paths| + paths.delete_if { |path, hash| + hash.empty? + } + paths.empty? + } + + @gc_index = 0 + } + self + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/mozilla_store.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/mozilla_store.rb new file mode 100644 index 0000000..8cb2a6a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/mozilla_store.rb @@ -0,0 +1,581 @@ +# :markup: markdown +require 'http/cookie_jar' +require 'sqlite3' + +class HTTP::CookieJar + # A store class that uses Mozilla compatible SQLite3 database as + # backing store. + # + # Session cookies are stored separately on memory and will not be + # stored persistently in the SQLite3 database. + class MozillaStore < AbstractStore + # :stopdoc: + SCHEMA_VERSION = 7 + + def default_options + { + :gc_threshold => HTTP::Cookie::MAX_COOKIES_TOTAL / 20, + :app_id => 0, + :in_browser_element => false, + } + end + + ALL_COLUMNS = %w[ + baseDomain + originAttributes + name value + host path + expiry creationTime lastAccessed + isSecure isHttpOnly + appId inBrowserElement + ] + + SQL = {} + + Callable = proc { |obj, meth, *args| + proc { + obj.__send__(meth, *args) + } + } + + class Database < SQLite3::Database + def initialize(file, options = {}) + @stmts = [] + options = { + :results_as_hash => true, + }.update(options) + super + end + + def prepare(sql) + case st = super + when SQLite3::Statement + @stmts << st + end + st + end + + def close + return self if closed? + @stmts.reject! { |st| + st.closed? || st.close + } + super + end + end + # :startdoc: + + # :call-seq: + # new(**options) + # + # Generates a Mozilla cookie store. If the file does not exist, + # it is created. If it does and its schema is old, it is + # automatically upgraded with a new schema keeping the existing + # data. + # + # Available option keywords are as below: + # + # :filename + # : A file name of the SQLite3 database to open. This option is + # mandatory. + # + # :gc_threshold + # : GC threshold; A GC happens when this many times cookies have + # been stored (default: `HTTP::Cookie::MAX_COOKIES_TOTAL / 20`) + # + # :app_id + # : application ID (default: `0`) to have per application jar. + # + # :in_browser_element + # : a flag to tell if cookies are stored in an in browser + # element. (default: `false`) + def initialize(options = nil) + super + + @origin_attributes = encode_www_form({}.tap { |params| + params['appId'] = @app_id if @app_id.nonzero? + params['inBrowserElement'] = 1 if @in_browser_element + }) + + @filename = options[:filename] or raise ArgumentError, ':filename option is missing' + + @sjar = HTTP::CookieJar::HashStore.new + + @db = Database.new(@filename) + + @stmt = Hash.new { |st, key| + st[key] = @db.prepare(SQL[key]) + } + + ObjectSpace.define_finalizer(self, Callable[@db, :close]) + + upgrade_database + + @gc_index = 0 + end + + # Raises TypeError. Cloning is inhibited in this store class. + def initialize_copy(other) + raise TypeError, 'can\'t clone %s' % self.class + end + + # The file name of the SQLite3 database given in initialization. + attr_reader :filename + + # Closes the SQLite3 database. After closing, any operation may + # raise an error. + def close + @db.closed? || @db.close + self + end + + # Tests if the SQLite3 database is closed. + def closed? + @db.closed? + end + + # Returns the schema version of the database. + def schema_version + @schema_version ||= @db.execute("PRAGMA user_version").first[0] + rescue SQLite3::SQLException + @logger.warn "couldn't get schema version!" if @logger + return nil + end + + protected + + def schema_version= version + @db.execute("PRAGMA user_version = %d" % version) + @schema_version = version + end + + def create_table_v5 + self.schema_version = 5 + @db.execute("DROP TABLE IF EXISTS moz_cookies") + @db.execute(<<-'SQL') + CREATE TABLE moz_cookies ( + id INTEGER PRIMARY KEY, + baseDomain TEXT, + appId INTEGER DEFAULT 0, + inBrowserElement INTEGER DEFAULT 0, + name TEXT, + value TEXT, + host TEXT, + path TEXT, + expiry INTEGER, + lastAccessed INTEGER, + creationTime INTEGER, + isSecure INTEGER, + isHttpOnly INTEGER, + CONSTRAINT moz_uniqueid UNIQUE (name, host, path, appId, inBrowserElement) + ) + SQL + @db.execute(<<-'SQL') + CREATE INDEX moz_basedomain + ON moz_cookies (baseDomain, + appId, + inBrowserElement); + SQL + end + + def create_table_v6 + self.schema_version = 6 + @db.execute("DROP TABLE IF EXISTS moz_cookies") + @db.execute(<<-'SQL') + CREATE TABLE moz_cookies ( + id INTEGER PRIMARY KEY, + baseDomain TEXT, + originAttributes TEXT NOT NULL DEFAULT '', + name TEXT, + value TEXT, + host TEXT, + path TEXT, + expiry INTEGER, + lastAccessed INTEGER, + creationTime INTEGER, + isSecure INTEGER, + isHttpOnly INTEGER, + CONSTRAINT moz_uniqueid UNIQUE (name, host, path, originAttributes) + ) + SQL + @db.execute(<<-'SQL') + CREATE INDEX moz_basedomain + ON moz_cookies (baseDomain, + originAttributes); + SQL + end + + def create_table + self.schema_version = SCHEMA_VERSION + @db.execute("DROP TABLE IF EXISTS moz_cookies") + @db.execute(<<-'SQL') + CREATE TABLE moz_cookies ( + id INTEGER PRIMARY KEY, + baseDomain TEXT, + originAttributes TEXT NOT NULL DEFAULT '', + name TEXT, + value TEXT, + host TEXT, + path TEXT, + expiry INTEGER, + lastAccessed INTEGER, + creationTime INTEGER, + isSecure INTEGER, + isHttpOnly INTEGER, + appId INTEGER DEFAULT 0, + inBrowserElement INTEGER DEFAULT 0, + CONSTRAINT moz_uniqueid UNIQUE (name, host, path, originAttributes) + ) + SQL + @db.execute(<<-'SQL') + CREATE INDEX moz_basedomain + ON moz_cookies (baseDomain, + originAttributes); + SQL + end + + def db_prepare(sql) + st = @db.prepare(sql) + yield st + ensure + st.close if st + end + + def upgrade_database + loop { + case schema_version + when nil, 0 + self.schema_version = SCHEMA_VERSION + break + when 1 + @db.execute("ALTER TABLE moz_cookies ADD lastAccessed INTEGER") + self.schema_version += 1 + when 2 + @db.execute("ALTER TABLE moz_cookies ADD baseDomain TEXT") + + db_prepare("UPDATE moz_cookies SET baseDomain = :baseDomain WHERE id = :id") { |st_update| + @db.execute("SELECT id, host FROM moz_cookies") { |row| + domain_name = DomainName.new(row['host'][/\A\.?(.*)/, 1]) + domain = domain_name.domain || domain_name.hostname + st_update.execute(:baseDomain => domain, :id => row['id']) + } + } + + @db.execute("CREATE INDEX moz_basedomain ON moz_cookies (baseDomain)") + self.schema_version += 1 + when 3 + db_prepare("DELETE FROM moz_cookies WHERE id = :id") { |st_delete| + prev_row = nil + @db.execute(<<-'SQL') { |row| + SELECT id, name, host, path FROM moz_cookies + ORDER BY name ASC, host ASC, path ASC, expiry ASC + SQL + if %w[name host path].all? { |col| prev_row and row[col] == prev_row[col] } + st_delete.execute(prev_row['id']) + end + prev_row = row + } + } + + @db.execute("ALTER TABLE moz_cookies ADD creationTime INTEGER") + @db.execute("UPDATE moz_cookies SET creationTime = (SELECT id WHERE id = moz_cookies.id)") + @db.execute("CREATE UNIQUE INDEX moz_uniqueid ON moz_cookies (name, host, path)") + self.schema_version += 1 + when 4 + @db.execute("ALTER TABLE moz_cookies RENAME TO moz_cookies_old") + @db.execute("DROP INDEX moz_basedomain") + create_table_v5 + @db.execute(<<-'SQL') + INSERT INTO moz_cookies + (baseDomain, appId, inBrowserElement, name, value, host, path, expiry, + lastAccessed, creationTime, isSecure, isHttpOnly) + SELECT baseDomain, 0, 0, name, value, host, path, expiry, + lastAccessed, creationTime, isSecure, isHttpOnly + FROM moz_cookies_old + SQL + @db.execute("DROP TABLE moz_cookies_old") + when 5 + @db.execute("ALTER TABLE moz_cookies RENAME TO moz_cookies_old") + @db.execute("DROP INDEX moz_basedomain") + create_table_v6 + @db.create_function('CONVERT_TO_ORIGIN_ATTRIBUTES', 2) { |func, appId, inBrowserElement| + params = {} + params['appId'] = appId if appId.nonzero? + params['inBrowserElement'] = inBrowserElement if inBrowserElement.nonzero? + func.result = encode_www_form(params) + } + @db.execute(<<-'SQL') + INSERT INTO moz_cookies + (baseDomain, originAttributes, name, value, host, path, expiry, + lastAccessed, creationTime, isSecure, isHttpOnly) + SELECT baseDomain, + CONVERT_TO_ORIGIN_ATTRIBUTES(appId, inBrowserElement), + name, value, host, path, expiry, lastAccessed, creationTime, + isSecure, isHttpOnly + FROM moz_cookies_old + SQL + @db.execute("DROP TABLE moz_cookies_old") + when 6 + @db.execute("ALTER TABLE moz_cookies ADD appId INTEGER DEFAULT 0") + @db.execute("ALTER TABLE moz_cookies ADD inBrowserElement INTEGER DEFAULT 0") + @db.create_function('SET_APP_ID', 1) { |func, originAttributes| + func.result = get_query_param(originAttributes, 'appId').to_i # nil.to_i == 0 + } + @db.create_function('SET_IN_BROWSER', 1) { |func, originAttributes| + func.result = get_query_param(originAttributes, 'inBrowserElement').to_i # nil.to_i == 0 + } + @db.execute(<<-'SQL') + UPDATE moz_cookies SET appId = SET_APP_ID(originAttributes), + inBrowserElement = SET_IN_BROWSER(originAttributes) + SQL + @logger.info("Upgraded database to schema version %d" % schema_version) if @logger + self.schema_version += 1 + else + break + end + } + + begin + @db.execute("SELECT %s from moz_cookies limit 1" % ALL_COLUMNS.join(', ')) + rescue SQLite3::SQLException + create_table + end + end + + SQL[:add] = <<-'SQL' % [ + INSERT OR REPLACE INTO moz_cookies (%s) VALUES (%s) + SQL + ALL_COLUMNS.join(', '), + ALL_COLUMNS.map { |col| ":#{col}" }.join(', ') + ] + + def db_add(cookie) + @stmt[:add].execute({ + :baseDomain => cookie.domain_name.domain || cookie.domain, + :originAttributes => @origin_attributes, + :name => cookie.name, :value => cookie.value, + :host => cookie.dot_domain, + :path => cookie.path, + :expiry => cookie.expires_at.to_i, + :creationTime => serialize_usectime(cookie.created_at), + :lastAccessed => serialize_usectime(cookie.accessed_at), + :isSecure => cookie.secure? ? 1 : 0, + :isHttpOnly => cookie.httponly? ? 1 : 0, + :appId => @app_id, + :inBrowserElement => @in_browser_element ? 1 : 0, + }) + cleanup if (@gc_index += 1) >= @gc_threshold + + self + end + + SQL[:delete] = <<-'SQL' + DELETE FROM moz_cookies + WHERE appId = :appId AND + inBrowserElement = :inBrowserElement AND + name = :name AND + host = :host AND + path = :path + SQL + + def db_delete(cookie) + @stmt[:delete].execute({ + :appId => @app_id, + :inBrowserElement => @in_browser_element ? 1 : 0, + :name => cookie.name, + :host => cookie.dot_domain, + :path => cookie.path, + }) + self + end + + if RUBY_VERSION >= '1.9' + def encode_www_form(enum) + URI.encode_www_form(enum) + end + + def get_query_param(str, key) + URI.decode_www_form(str).find { |k, v| + break v if k == key + } + end + else + require 'cgi' + + def encode_www_form(enum) + enum.map { |k, v| "#{CGI.escape(k)}=#{CGI.escape(v)}" }.join('&') + end + + def get_query_param(str, key) + CGI.parse(str)[key].first + end + end + + def serialize_usectime(time) + time ? (time.to_f * 1e6).floor : 0 + end + + def deserialize_usectime(value) + Time.at(value ? value / 1e6 : 0) + end + + public + + def add(cookie) + if cookie.session? + @sjar.add(cookie) + db_delete(cookie) + else + @sjar.delete(cookie) + db_add(cookie) + end + end + + def delete(cookie) + @sjar.delete(cookie) + db_delete(cookie) + end + + SQL[:cookies_for_domain] = <<-'SQL' + SELECT * FROM moz_cookies + WHERE baseDomain = :baseDomain AND + appId = :appId AND + inBrowserElement = :inBrowserElement AND + expiry >= :expiry + SQL + + SQL[:update_lastaccessed] = <<-'SQL' + UPDATE moz_cookies + SET lastAccessed = :lastAccessed + WHERE id = :id + SQL + + SQL[:all_cookies] = <<-'SQL' + SELECT * FROM moz_cookies + WHERE appId = :appId AND + inBrowserElement = :inBrowserElement AND + expiry >= :expiry + SQL + + def each(uri = nil, &block) # :yield: cookie + now = Time.now + if uri + thost = DomainName.new(uri.host) + + @stmt[:cookies_for_domain].execute({ + :baseDomain => thost.domain || thost.hostname, + :appId => @app_id, + :inBrowserElement => @in_browser_element ? 1 : 0, + :expiry => now.to_i, + }).each { |row| + if secure = row['isSecure'] != 0 + next unless URI::HTTPS === uri + end + + cookie = HTTP::Cookie.new({}.tap { |attrs| + attrs[:name] = row['name'] + attrs[:value] = row['value'] + attrs[:domain] = row['host'] + attrs[:path] = row['path'] + attrs[:expires_at] = Time.at(row['expiry']) + attrs[:accessed_at] = deserialize_usectime(row['lastAccessed']) + attrs[:created_at] = deserialize_usectime(row['creationTime']) + attrs[:secure] = secure + attrs[:httponly] = row['isHttpOnly'] != 0 + }) + + if cookie.valid_for_uri?(uri) + cookie.accessed_at = now + @stmt[:update_lastaccessed].execute({ + 'lastAccessed' => serialize_usectime(now), + 'id' => row['id'], + }) + yield cookie + end + } + @sjar.each(uri, &block) + else + @stmt[:all_cookies].execute({ + :appId => @app_id, + :inBrowserElement => @in_browser_element ? 1 : 0, + :expiry => now.to_i, + }).each { |row| + cookie = HTTP::Cookie.new({}.tap { |attrs| + attrs[:name] = row['name'] + attrs[:value] = row['value'] + attrs[:domain] = row['host'] + attrs[:path] = row['path'] + attrs[:expires_at] = Time.at(row['expiry']) + attrs[:accessed_at] = deserialize_usectime(row['lastAccessed']) + attrs[:created_at] = deserialize_usectime(row['creationTime']) + attrs[:secure] = row['isSecure'] != 0 + attrs[:httponly] = row['isHttpOnly'] != 0 + }) + + yield cookie + } + @sjar.each(&block) + end + self + end + + def clear + @db.execute("DELETE FROM moz_cookies") + @sjar.clear + self + end + + SQL[:delete_expired] = <<-'SQL' + DELETE FROM moz_cookies WHERE expiry < :expiry + SQL + + SQL[:overusing_domains] = <<-'SQL' + SELECT LTRIM(host, '.') domain, COUNT(*) count + FROM moz_cookies + GROUP BY domain + HAVING count > :count + SQL + + SQL[:delete_per_domain_overuse] = <<-'SQL' + DELETE FROM moz_cookies WHERE id IN ( + SELECT id FROM moz_cookies + WHERE LTRIM(host, '.') = :domain + ORDER BY creationtime + LIMIT :limit) + SQL + + SQL[:delete_total_overuse] = <<-'SQL' + DELETE FROM moz_cookies WHERE id IN ( + SELECT id FROM moz_cookies ORDER BY creationTime ASC LIMIT :limit + ) + SQL + + def cleanup(session = false) + synchronize { + break if @gc_index == 0 + + @stmt[:delete_expired].execute({ 'expiry' => Time.now.to_i }) + + @stmt[:overusing_domains].execute({ + 'count' => HTTP::Cookie::MAX_COOKIES_PER_DOMAIN + }).each { |row| + domain, count = row['domain'], row['count'] + + @stmt[:delete_per_domain_overuse].execute({ + 'domain' => domain, + 'limit' => count - HTTP::Cookie::MAX_COOKIES_PER_DOMAIN, + }) + } + + overrun = count - HTTP::Cookie::MAX_COOKIES_TOTAL + + if overrun > 0 + @stmt[:delete_total_overuse].execute({ 'limit' => overrun }) + end + + @gc_index = 0 + } + self + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/yaml_saver.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/yaml_saver.rb new file mode 100644 index 0000000..bc83f04 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/lib/http/cookie_jar/yaml_saver.rb @@ -0,0 +1,86 @@ +# :markup: markdown +require 'http/cookie_jar' +require 'psych' if !defined?(YAML) && RUBY_VERSION == "1.9.2" +require 'yaml' + +# YAMLSaver saves and loads cookies in the YAML format. It can load a +# YAML file saved by Mechanize, but the saving format is not +# compatible with older versions of Mechanize (< 2.7). +class HTTP::CookieJar::YAMLSaver < HTTP::CookieJar::AbstractSaver + # :singleton-method: new + # :call-seq: + # new(**options) + # + # There is no option keyword supported at the moment. + + ## + + def save(io, jar) + YAML.dump(@session ? jar.to_a : jar.reject(&:session?), io) + end + + def load(io, jar) + begin + data = load_yaml(io) + rescue ArgumentError => e + case e.message + when %r{\Aundefined class/module Mechanize::} + # backward compatibility with Mechanize::Cookie + begin + io.rewind # hopefully + yaml = io.read + # a gross hack + yaml.gsub!(%r{^( [^ ].*:) !ruby/object:Mechanize::Cookie$}, "\\1") + data = load_yaml(yaml) + rescue Errno::ESPIPE + @logger.warn "could not rewind the stream for conversion" if @logger + rescue ArgumentError + end + end + end + + case data + when Array + data.each { |cookie| + jar.add(cookie) + } + when Hash + # backward compatibility with Mechanize::Cookie + data.each { |domain, paths| + paths.each { |path, names| + names.each { |cookie_name, cookie_hash| + if cookie_hash.respond_to?(:ivars) + # YAML::Object of Syck + cookie_hash = cookie_hash.ivars + end + cookie = HTTP::Cookie.new({}.tap { |hash| + cookie_hash.each_pair { |key, value| + hash[key.to_sym] = value + } + }) + jar.add(cookie) + } + } + } + else + @logger.warn "incompatible YAML cookie data discarded" if @logger + return + end + end + + private + + def default_options + {} + end + + if YAML.name == 'Psych' && Psych::VERSION >= '3.1' + def load_yaml(yaml) + YAML.safe_load(yaml, :permitted_classes => %w[Time HTTP::Cookie Mechanize::Cookie DomainName], :aliases => true) + end + else + def load_yaml(yaml) + YAML.load(yaml) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/helper.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/helper.rb new file mode 100644 index 0000000..6b463ad --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/helper.rb @@ -0,0 +1,55 @@ +require 'rubygems' +require 'test-unit' +require 'uri' +require 'http/cookie' + +module Test + module Unit + module Assertions + def assert_warn(pattern, message = nil, &block) + class << (output = "") + alias write << + end + stderr, $stderr = $stderr, output + yield + assert_match(pattern, output, message) + ensure + $stderr = stderr + end + + def assert_warning(pattern, message = nil, &block) + verbose, $VERBOSE = $VERBOSE, true + assert_warn(pattern, message, &block) + ensure + $VERBOSE = verbose + end + end + end +end + +module Enumerable + def combine + masks = inject([[], 1]){|(ar, m), e| [ar << m, m << 1 ] }[0] + all = masks.inject(0){ |al, m| al|m } + + result = [] + for i in 1..all do + tmp = [] + each_with_index do |e, idx| + tmp << e unless (masks[idx] & i) == 0 + end + result << tmp + end + result + end +end + +def test_file(filename) + File.expand_path(filename, File.dirname(__FILE__)) +end + +def sleep_until(time) + if (s = time - Time.now) > 0 + sleep s + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/mechanize.yml b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/mechanize.yml new file mode 100644 index 0000000..9df5152 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/mechanize.yml @@ -0,0 +1,101 @@ +--- +google.com: + /: + PREF: !ruby/object:Mechanize::Cookie + version: 0 + port: + discard: + comment_url: + expires: Tue, 24 Mar 2065 08:20:15 GMT + max_age: + comment: + secure: false + path: / + domain: google.com + accessed_at: 2013-03-24 17:20:15.822619000 +09:00 + created_at: 2013-03-24 17:20:15.822619000 +09:00 + name: PREF + value: ID=7571a59c059e09db:FF=0:TM=1364199615:LM=1364199615:S=BxUqnqPrchd2cVmC + for_domain: true + domain_name: !ruby/object:DomainName + ipaddr: + hostname: google.com + uri_host: google.com + tld: com + canonical_tld_p: true + domain: google.com + session: false + NID: !ruby/object:Mechanize::Cookie + version: 0 + port: + discard: + comment_url: + expires: Sun, 23 Sep 2063 08:20:15 GMT + max_age: + comment: + secure: false + path: / + domain: google.com + accessed_at: 2013-03-24 17:20:15.828434000 +09:00 + created_at: 2013-03-24 17:20:15.828434000 +09:00 + name: NID + value: 67=Kn2osS6wOzILpl7sCM1QIDmGg2VESBiwCyt6zx4vOVSWKOYDlwGIpgIGrpD8FpkbS9eqizo3QWFa5YkOygnCF6vRIQpbvlTxWB2Hq1Oo-qXWy0317yCqQ-B25eJLfUcC + for_domain: true + domain_name: !ruby/object:DomainName + ipaddr: + hostname: google.com + uri_host: google.com + tld: com + canonical_tld_p: true + domain: google.com + session: false +google.co.jp: + /: + PREF: !ruby/object:Mechanize::Cookie + version: 0 + port: + discard: + comment_url: + expires: Tue, 24 Mar 2065 08:20:16 GMT + max_age: + comment: + secure: false + path: / + domain: google.co.jp + accessed_at: 2013-03-24 17:20:17.136581000 +09:00 + created_at: 2013-03-24 17:20:17.136581000 +09:00 + name: PREF + value: ID=cb25dd1567d8b5c8:FF=0:TM=1364199616:LM=1364199616:S=c3PbhRq79Wo5T_vV + for_domain: true + domain_name: !ruby/object:DomainName + ipaddr: + hostname: google.co.jp + uri_host: google.co.jp + tld: jp + canonical_tld_p: true + domain: google.co.jp + session: false + NID: !ruby/object:Mechanize::Cookie + version: 0 + port: + discard: + comment_url: + expires: Sun, 23 Sep 2063 08:20:16 GMT + max_age: + comment: + secure: false + path: / + domain: google.co.jp + accessed_at: 2013-03-24 17:20:17.139782000 +09:00 + created_at: 2013-03-24 17:20:17.139782000 +09:00 + name: NID + value: 67=GS7P-68zgm_KRA0e0dpN_XbYpmw9uBDe56qUeoCGiSRTahsM7dtOBCKfCoIFRKlzSuOiwJQdIZNpwv3DSXQNHXDKltucgfv2qkHlGeoj8-5VlowPXLLesz2VIpLOLw-a + for_domain: true + domain_name: !ruby/object:DomainName + ipaddr: + hostname: google.co.jp + uri_host: google.co.jp + tld: jp + canonical_tld_p: true + domain: google.co.jp + session: false diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/simplecov_start.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/simplecov_start.rb new file mode 100644 index 0000000..39e075f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/simplecov_start.rb @@ -0,0 +1,2 @@ +require 'simplecov' +SimpleCov.start diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie.rb new file mode 100644 index 0000000..48da791 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie.rb @@ -0,0 +1,1122 @@ +# -*- coding: utf-8 -*- +require File.expand_path('helper', File.dirname(__FILE__)) + +class TestHTTPCookie < Test::Unit::TestCase + def setup + httpdate = 'Sun, 27-Sep-2037 00:00:00 GMT' + + @cookie_params = { + 'expires' => 'expires=%s' % httpdate, + 'path' => 'path=/', + 'domain' => 'domain=.rubyforge.org', + 'httponly' => 'HttpOnly', + } + + @expires = Time.parse(httpdate) + end + + def test_parse_dates + url = URI.parse('http://localhost/') + + yesterday = Time.now - 86400 + + dates = [ "14 Apr 89 03:20:12", + "14 Apr 89 03:20 GMT", + "Fri, 17 Mar 89 4:01:33", + "Fri, 17 Mar 89 4:01 GMT", + "Mon Jan 16 16:12 PDT 1989", + #"Mon Jan 16 16:12 +0130 1989", + "6 May 1992 16:41-JST (Wednesday)", + #"22-AUG-1993 10:59:12.82", + "22-AUG-1993 10:59pm", + "22-AUG-1993 12:59am", + "22-AUG-1993 12:59 PM", + #"Friday, August 04, 1995 3:54 PM", + #"06/21/95 04:24:34 PM", + #"20/06/95 21:07", + #"95-06-08 19:32:48 EDT", + ] + + dates.each do |date| + cookie = "PREF=1; expires=#{date}" + assert_equal 1, HTTP::Cookie.parse(cookie, url) { |c| + assert c.expires, "Tried parsing: #{date}" + assert_send [c.expires, :<, yesterday] + }.size + end + + [ + ["PREF=1; expires=Wed, 01 Jan 100 12:34:56 GMT", nil], + ["PREF=1; expires=Sat, 01 Jan 1600 12:34:56 GMT", nil], + ["PREF=1; expires=Tue, 01 Jan 69 12:34:56 GMT", 2069], + ["PREF=1; expires=Thu, 01 Jan 70 12:34:56 GMT", 1970], + ["PREF=1; expires=Wed, 01 Jan 20 12:34:56 GMT", 2020], + ["PREF=1; expires=Sat, 01 Jan 2020 12:34:60 GMT", nil], + ["PREF=1; expires=Sat, 01 Jan 2020 12:60:56 GMT", nil], + ["PREF=1; expires=Sat, 01 Jan 2020 24:00:00 GMT", nil], + ["PREF=1; expires=Sat, 32 Jan 2020 12:34:56 GMT", nil], + ].each { |set_cookie, year| + cookie, = HTTP::Cookie.parse(set_cookie, url) + if year + assert_equal year, cookie.expires.year, "#{set_cookie}: expires in #{year}" + else + assert_equal nil, cookie.expires, "#{set_cookie}: invalid expiry date" + end + } + end + + def test_parse_empty + cookie_str = 'a=b; ; c=d' + + uri = URI.parse 'http://example' + + assert_equal 1, HTTP::Cookie.parse(cookie_str, uri) { |cookie| + assert_equal 'a', cookie.name + assert_equal 'b', cookie.value + }.size + end + + def test_parse_no_space + cookie_str = "foo=bar;Expires=Sun, 06 Nov 2011 00:28:06 GMT;Path=/" + + uri = URI.parse 'http://example' + + assert_equal 1, HTTP::Cookie.parse(cookie_str, uri) { |cookie| + assert_equal 'foo', cookie.name + assert_equal 'bar', cookie.value + assert_equal '/', cookie.path + assert_equal Time.at(1320539286), cookie.expires + }.size + end + + def test_parse_too_long_cookie + uri = URI.parse 'http://example' + + cookie_str = "foo=#{'Cookie' * 680}; path=/ab/" + assert_equal(HTTP::Cookie::MAX_LENGTH - 1, cookie_str.bytesize) + + assert_equal 1, HTTP::Cookie.parse(cookie_str, uri).size + + assert_equal 1, HTTP::Cookie.parse(cookie_str.sub(';', 'x;'), uri).size + + assert_equal 0, HTTP::Cookie.parse(cookie_str.sub(';', 'xx;'), uri).size + end + + def test_parse_quoted + cookie_str = + "quoted=\"value\"; Expires=Sun, 06 Nov 2011 00:11:18 GMT; Path=/; comment=\"comment is \\\"comment\\\"\"" + + uri = URI.parse 'http://example' + + assert_equal 1, HTTP::Cookie.parse(cookie_str, uri) { |cookie| + assert_equal 'quoted', cookie.name + assert_equal 'value', cookie.value + }.size + end + + def test_parse_no_nothing + cookie = '; "", ;' + url = URI.parse('http://www.example.com/') + assert_equal 0, HTTP::Cookie.parse(cookie, url).size + end + + def test_parse_no_name + cookie = '=no-name; path=/' + url = URI.parse('http://www.example.com/') + assert_equal 0, HTTP::Cookie.parse(cookie, url).size + end + + def test_parse_bad_name + cookie = "a\001b=c" + url = URI.parse('http://www.example.com/') + assert_nothing_raised { + assert_equal 0, HTTP::Cookie.parse(cookie, url).size + } + end + + def test_parse_bad_value + cookie = "a=b\001c" + url = URI.parse('http://www.example.com/') + assert_nothing_raised { + assert_equal 0, HTTP::Cookie.parse(cookie, url).size + } + end + + def test_parse_weird_cookie + cookie = 'n/a, ASPSESSIONIDCSRRQDQR=FBLDGHPBNDJCPCGNCPAENELB; path=/' + url = URI.parse('http://www.searchinnovation.com/') + assert_equal 1, HTTP::Cookie.parse(cookie, url) { |c| + assert_equal('ASPSESSIONIDCSRRQDQR', c.name) + assert_equal('FBLDGHPBNDJCPCGNCPAENELB', c.value) + }.size + end + + def test_double_semicolon + double_semi = 'WSIDC=WEST;; domain=.williams-sonoma.com; path=/' + url = URI.parse('http://williams-sonoma.com/') + assert_equal 1, HTTP::Cookie.parse(double_semi, url) { |cookie| + assert_equal('WSIDC', cookie.name) + assert_equal('WEST', cookie.value) + }.size + end + + def test_parse_bad_version + bad_cookie = 'PRETANET=TGIAqbFXtt; Name=/PRETANET; Path=/; Version=1.2; Content-type=text/html; Domain=192.168.6.196; expires=Friday, 13-November-2026 23:01:46 GMT;' + url = URI.parse('http://192.168.6.196/') + # The version attribute is obsolete and simply ignored + cookies = HTTP::Cookie.parse(bad_cookie, url) + assert_equal 1, cookies.size + end + + def test_parse_bad_max_age + bad_cookie = 'PRETANET=TGIAqbFXtt; Name=/PRETANET; Path=/; Max-Age=forever; Content-type=text/html; Domain=192.168.6.196; expires=Friday, 13-November-2026 23:01:46 GMT;' + url = URI.parse('http://192.168.6.196/') + # A bad max-age is simply ignored + cookies = HTTP::Cookie.parse(bad_cookie, url) + assert_equal 1, cookies.size + assert_equal nil, cookies.first.max_age + end + + def test_parse_date_fail + url = URI.parse('http://localhost/') + + dates = [ + "20/06/95 21:07", + ] + + dates.each { |date| + cookie = "PREF=1; expires=#{date}" + assert_equal 1, HTTP::Cookie.parse(cookie, url) { |c| + assert_equal(true, c.expires.nil?) + }.size + } + end + + def test_parse_domain_dot + url = URI.parse('http://host.example.com/') + + cookie_str = 'a=b; domain=.example.com' + + cookie = HTTP::Cookie.parse(cookie_str, url).first + + assert_equal 'example.com', cookie.domain + assert cookie.for_domain? + assert_equal '.example.com', cookie.dot_domain + end + + def test_parse_domain_no_dot + url = URI.parse('http://host.example.com/') + + cookie_str = 'a=b; domain=example.com' + + cookie = HTTP::Cookie.parse(cookie_str, url).first + + assert_equal 'example.com', cookie.domain + assert cookie.for_domain? + assert_equal '.example.com', cookie.dot_domain + end + + def test_parse_public_suffix + cookie = HTTP::Cookie.new('a', 'b', :domain => 'com') + assert_equal('com', cookie.domain) + assert_equal(false, cookie.for_domain?) + + cookie.origin = 'http://com/' + assert_equal('com', cookie.domain) + assert_equal(false, cookie.for_domain?) + + assert_raises(ArgumentError) { + cookie.origin = 'http://example.com/' + } + end + + def test_parse_domain_none + url = URI.parse('http://example.com/') + + cookie_str = 'a=b;' + + cookie = HTTP::Cookie.parse(cookie_str, url).first + + assert_equal 'example.com', cookie.domain + assert !cookie.for_domain? + assert_equal 'example.com', cookie.dot_domain + end + + def test_parse_max_age + url = URI.parse('http://localhost/') + + epoch, date = 4485353164, 'Fri, 19 Feb 2112 19:26:04 GMT' + base = Time.at(1363014000) + + cookie = HTTP::Cookie.parse("name=Akinori; expires=#{date}", url).first + assert_equal Time.at(epoch), cookie.expires + + cookie = HTTP::Cookie.parse('name=Akinori; max-age=3600', url).first + assert_in_delta Time.now + 3600, cookie.expires, 1 + cookie = HTTP::Cookie.parse('name=Akinori; max-age=3600', url, :created_at => base).first + assert_equal base + 3600, cookie.expires + + # Max-Age has precedence over Expires + cookie = HTTP::Cookie.parse("name=Akinori; max-age=3600; expires=#{date}", url).first + assert_in_delta Time.now + 3600, cookie.expires, 1 + cookie = HTTP::Cookie.parse("name=Akinori; max-age=3600; expires=#{date}", url, :created_at => base).first + assert_equal base + 3600, cookie.expires + + cookie = HTTP::Cookie.parse("name=Akinori; expires=#{date}; max-age=3600", url).first + assert_in_delta Time.now + 3600, cookie.expires, 1 + cookie = HTTP::Cookie.parse("name=Akinori; expires=#{date}; max-age=3600", url, :created_at => base).first + assert_equal base + 3600, cookie.expires + end + + def test_parse_expires_session + url = URI.parse('http://localhost/') + + [ + 'name=Akinori', + 'name=Akinori; expires', + 'name=Akinori; max-age', + 'name=Akinori; expires=', + 'name=Akinori; max-age=', + ].each { |str| + cookie = HTTP::Cookie.parse(str, url).first + assert cookie.session?, str + } + + [ + 'name=Akinori; expires=Mon, 19 Feb 2012 19:26:04 GMT', + 'name=Akinori; max-age=3600', + ].each { |str| + cookie = HTTP::Cookie.parse(str, url).first + assert !cookie.session?, str + } + end + + def test_parse_many + url = URI 'http://localhost/' + cookie_str = + "abc, " \ + "name=Aaron; Domain=localhost; Expires=Sun, 06 Nov 2011 00:29:51 GMT; Path=/, " \ + "name=Aaron; Domain=localhost; Expires=Sun, 06 Nov 2011 00:29:51 GMT; Path=/, " \ + "name=Aaron; Domain=localhost; Expires=Sun, 06 Nov 2011 00:29:51 GMT; Path=/, " \ + "name=Aaron; Domain=localhost; Expires=Sun, 06 Nov 2011 00:29:51 GMT; Path=/; HttpOnly, " \ + "expired=doh; Expires=Fri, 04 Nov 2011 00:29:51 GMT; Path=/, " \ + "a_path=some_path; Expires=Sun, 06 Nov 2011 00:29:51 GMT; Path=/some_path, " \ + "no_path1=no_path; Expires=Sun, 06 Nov 2011 00:29:52 GMT, no_expires=nope; Path=/, " \ + "no_path2=no_path; Expires=Sun, 06 Nov 2011 00:29:52 GMT; no_expires=nope; Path, " \ + "no_path3=no_path; Expires=Sun, 06 Nov 2011 00:29:52 GMT; no_expires=nope; Path=, " \ + "rel_path1=rel_path; Expires=Sun, 06 Nov 2011 00:29:52 GMT; no_expires=nope; Path=foo/bar, " \ + "rel_path1=rel_path; Expires=Sun, 06 Nov 2011 00:29:52 GMT; no_expires=nope; Path=foo, " \ + "no_domain1=no_domain; Expires=Sun, 06 Nov 2011 00:29:53 GMT; no_expires=nope, " \ + "no_domain2=no_domain; Expires=Sun, 06 Nov 2011 00:29:53 GMT; no_expires=nope; Domain, " \ + "no_domain3=no_domain; Expires=Sun, 06 Nov 2011 00:29:53 GMT; no_expires=nope; Domain=" + + cookies = HTTP::Cookie.parse cookie_str, url + assert_equal 15, cookies.length + + name = cookies.find { |c| c.name == 'name' } + assert_equal "Aaron", name.value + assert_equal "/", name.path + assert_equal Time.at(1320539391), name.expires + + a_path = cookies.find { |c| c.name == 'a_path' } + assert_equal "some_path", a_path.value + assert_equal "/some_path", a_path.path + assert_equal Time.at(1320539391), a_path.expires + + no_expires = cookies.find { |c| c.name == 'no_expires' } + assert_equal "nope", no_expires.value + assert_equal "/", no_expires.path + assert_nil no_expires.expires + + no_path_cookies = cookies.select { |c| c.value == 'no_path' } + assert_equal 3, no_path_cookies.size + no_path_cookies.each { |c| + assert_equal "/", c.path, c.name + assert_equal Time.at(1320539392), c.expires, c.name + } + + rel_path_cookies = cookies.select { |c| c.value == 'rel_path' } + assert_equal 2, rel_path_cookies.size + rel_path_cookies.each { |c| + assert_equal "/", c.path, c.name + assert_equal Time.at(1320539392), c.expires, c.name + } + + no_domain_cookies = cookies.select { |c| c.value == 'no_domain' } + assert_equal 3, no_domain_cookies.size + no_domain_cookies.each { |c| + assert !c.for_domain?, c.name + assert_equal c.domain, url.host, c.name + assert_equal Time.at(1320539393), c.expires, c.name + } + + assert cookies.find { |c| c.name == 'expired' } + end + + def test_parse_valid_cookie + url = URI.parse('http://rubyforge.org/') + cookie_params = @cookie_params + cookie_value = '12345%7D=ASDFWEE345%3DASda' + + cookie_params.keys.combine.each do |keys| + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join('; ') + cookie, = HTTP::Cookie.parse(cookie_text, url) + + assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s) + assert_equal('/', cookie.path) + + assert_equal(keys.include?('expires') ? @expires : nil, cookie.expires) + assert_equal(keys.include?('httponly'), cookie.httponly?) + end + end + + def test_parse_valid_cookie_empty_value + url = URI.parse('http://rubyforge.org/') + cookie_params = @cookie_params + cookie_value = '12345%7D=' + + cookie_params.keys.combine.each do |keys| + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join('; ') + cookie, = HTTP::Cookie.parse(cookie_text, url) + + assert_equal('12345%7D=', cookie.to_s) + assert_equal('', cookie.value) + assert_equal('/', cookie.path) + + assert_equal(keys.include?('expires') ? @expires : nil, cookie.expires) + assert_equal(keys.include?('httponly'), cookie.httponly?) + end + end + + # If no path was given, use the one from the URL + def test_cookie_using_url_path + url = URI.parse('http://rubyforge.org/login.php') + cookie_params = @cookie_params + cookie_value = '12345%7D=ASDFWEE345%3DASda' + + cookie_params.keys.combine.each do |keys| + next if keys.include?('path') + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join('; ') + cookie, = HTTP::Cookie.parse(cookie_text, url) + + assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s) + assert_equal('/', cookie.path) + + assert_equal(keys.include?('expires') ? @expires : nil, cookie.expires) + assert_equal(keys.include?('httponly'), cookie.httponly?) + end + end + + # Test using secure cookies + def test_cookie_with_secure + url = URI.parse('http://rubyforge.org/') + cookie_params = @cookie_params.merge('secure' => 'secure') + cookie_value = '12345%7D=ASDFWEE345%3DASda' + + cookie_params.keys.combine.each do |keys| + next unless keys.include?('secure') + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join('; ') + cookie, = HTTP::Cookie.parse(cookie_text, url) + + assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s) + assert_equal('/', cookie.path) + assert_equal(true, cookie.secure) + + assert_equal(keys.include?('expires') ? @expires : nil, cookie.expires) + assert_equal(keys.include?('httponly'), cookie.httponly?) + end + end + + def test_cookie_value + [ + ['foo="bar baz"', 'bar baz'], + ['foo="bar\"; \"baz"', 'bar"; "baz'], + ].each { |cookie_value, value| + cookie = HTTP::Cookie.new('foo', value) + assert_equal(cookie_value, cookie.cookie_value) + } + + pairs = [ + ['Foo', 'value1'], + ['Bar', 'value 2'], + ['Baz', 'value3'], + ['Bar', 'value"4'], + ['Quux', 'x, value=5'], + ] + + cookie_value = HTTP::Cookie.cookie_value(pairs.map { |name, value| + HTTP::Cookie.new(:name => name, :value => value) + }) + + assert_equal 'Foo=value1; Bar="value 2"; Baz=value3; Bar="value\\"4"; Quux="x, value=5"', cookie_value + + hash = HTTP::Cookie.cookie_value_to_hash(cookie_value) + + assert_equal pairs.map(&:first).uniq.size, hash.size + + hash.each_pair { |name, value| + _, pvalue = pairs.assoc(name) + assert_equal pvalue, value + } + + # Do not treat comma in a Cookie header value as separator; see CVE-2016-7401 + hash = HTTP::Cookie.cookie_value_to_hash('Quux=x, value=5; Foo=value1; Bar="value 2"; Baz=value3; Bar="value\\"4"') + + assert_equal pairs.map(&:first).uniq.size, hash.size + + hash.each_pair { |name, value| + _, pvalue = pairs.assoc(name) + assert_equal pvalue, value + } + end + + def test_set_cookie_value + url = URI.parse('http://rubyforge.org/path/') + + [ + HTTP::Cookie.new('a', 'b', :domain => 'rubyforge.org', :path => '/path/'), + HTTP::Cookie.new('a', 'b', :origin => url), + ].each { |cookie| + cookie.set_cookie_value + } + + [ + HTTP::Cookie.new('a', 'b', :domain => 'rubyforge.org'), + HTTP::Cookie.new('a', 'b', :for_domain => true, :path => '/path/'), + ].each { |cookie| + assert_raises(RuntimeError) { + cookie.set_cookie_value + } + } + + ['foo=bar', 'foo="bar"', 'foo="ba\"r baz"'].each { |cookie_value| + cookie_params = @cookie_params.merge('path' => '/path/', 'secure' => 'secure', 'max-age' => 'Max-Age=1000') + date = Time.at(Time.now.to_i) + cookie_params.keys.combine.each do |keys| + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join('; ') + cookie, = HTTP::Cookie.parse(cookie_text, url, :created_at => date) + cookie2, = HTTP::Cookie.parse(cookie.set_cookie_value, url, :created_at => date) + + assert_equal(cookie.name, cookie2.name) + assert_equal(cookie.value, cookie2.value) + assert_equal(cookie.domain, cookie2.domain) + assert_equal(cookie.for_domain?, cookie2.for_domain?) + assert_equal(cookie.path, cookie2.path) + assert_equal(cookie.expires, cookie2.expires) + if keys.include?('max-age') + assert_equal(date + 1000, cookie2.expires) + elsif keys.include?('expires') + assert_equal(@expires, cookie2.expires) + else + assert_equal(nil, cookie2.expires) + end + assert_equal(cookie.secure?, cookie2.secure?) + assert_equal(cookie.httponly?, cookie2.httponly?) + end + } + end + + def test_parse_cookie_no_spaces + url = URI.parse('http://rubyforge.org/') + cookie_params = @cookie_params + cookie_value = '12345%7D=ASDFWEE345%3DASda' + + cookie_params.keys.combine.each do |keys| + cookie_text = [cookie_value, *keys.map { |key| cookie_params[key] }].join(';') + cookie, = HTTP::Cookie.parse(cookie_text, url) + + assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s) + assert_equal('/', cookie.path) + + assert_equal(keys.include?('expires') ? @expires : nil, cookie.expires) + assert_equal(keys.include?('httponly'), cookie.httponly?) + end + end + + def test_new + cookie = HTTP::Cookie.new('key', 'value') + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal nil, cookie.expires + assert_raises(RuntimeError) { + cookie.acceptable? + } + + # Minimum unit for the expires attribute is second + expires = Time.at((Time.now + 3600).to_i) + + cookie = HTTP::Cookie.new('key', 'value', :expires => expires.dup) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires + assert_raises(RuntimeError) { + cookie.acceptable? + } + + # various keywords + [ + ["Expires", /use downcased symbol/], + ].each { |key, pattern| + assert_warning(pattern, "warn of key: #{key.inspect}") { + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', key => expires.dup) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires, "key: #{key.inspect}" + } + } + [ + [:Expires, /unknown attribute name/], + [:expires?, /unknown attribute name/], + [[:expires], /invalid keyword/], + ].each { |key, pattern| + assert_warning(pattern, "warn of key: #{key.inspect}") { + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', key => expires.dup) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal nil, cookie.expires, "key: #{key.inspect}" + } + } + + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', :expires => expires.dup) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires + assert_equal false, cookie.for_domain? + assert_raises(RuntimeError) { + # domain and path are missing + cookie.acceptable? + } + + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', :expires => expires.dup, :domain => '.example.com') + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires + assert_equal true, cookie.for_domain? + assert_raises(RuntimeError) { + # path is missing + cookie.acceptable? + } + + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', :expires => expires.dup, :domain => 'example.com', :for_domain => false) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires + assert_equal false, cookie.for_domain? + assert_raises(RuntimeError) { + # path is missing + cookie.acceptable? + } + + cookie = HTTP::Cookie.new(:value => 'value', :name => 'key', :expires => expires.dup, :domain => 'example.org', :for_domain? => true) + assert_equal 'key', cookie.name + assert_equal 'value', cookie.value + assert_equal expires, cookie.expires + assert_equal 'example.org', cookie.domain + assert_equal true, cookie.for_domain? + assert_raises(RuntimeError) { + # path is missing + cookie.acceptable? + } + + assert_raises(ArgumentError) { HTTP::Cookie.new() } + assert_raises(ArgumentError) { HTTP::Cookie.new(:value => 'value') } + assert_raises(ArgumentError) { HTTP::Cookie.new('', 'value') } + assert_raises(ArgumentError) { HTTP::Cookie.new('key=key', 'value') } + assert_raises(ArgumentError) { HTTP::Cookie.new("key\tkey", 'value') } + assert_raises(ArgumentError) { HTTP::Cookie.new('key', 'value', 'something') } + assert_raises(ArgumentError) { HTTP::Cookie.new('key', 'value', {}, 'something') } + + [ + HTTP::Cookie.new(:name => 'name'), + HTTP::Cookie.new("key", nil, :for_domain => true), + HTTP::Cookie.new("key", nil), + HTTP::Cookie.new("key", :secure => true), + HTTP::Cookie.new("key"), + ].each { |cookie| + assert_equal '', cookie.value + assert_equal true, cookie.expired? + } + + [ + HTTP::Cookie.new(:name => 'name', :max_age => 3600), + HTTP::Cookie.new("key", nil, :expires => Time.now + 3600), + HTTP::Cookie.new("key", :expires => Time.now + 3600), + HTTP::Cookie.new("key", :expires => Time.now + 3600, :value => nil), + ].each { |cookie| + assert_equal '', cookie.value + assert_equal false, cookie.expired? + } + end + + def cookie_values(options = {}) + { + :name => 'Foo', + :value => 'Bar', + :path => '/', + :expires => Time.now + (10 * 86400), + :for_domain => true, + :domain => 'rubyforge.org', + :origin => 'http://rubyforge.org/' + }.merge(options) + end + + def test_bad_name + [ + "a\tb", "a\vb", "a\rb", "a\nb", 'a b', + "a\\b", 'a"b', # 'a:b', 'a/b', 'a[b]', + 'a=b', 'a,b', 'a;b', + ].each { |name| + assert_raises(ArgumentError) { + HTTP::Cookie.new(cookie_values(:name => name)) + } + cookie = HTTP::Cookie.new(cookie_values) + assert_raises(ArgumentError) { + cookie.name = name + } + } + end + + def test_bad_value + [ + "a\tb", "a\vb", "a\rb", "a\nb", + "a\\b", 'a"b', # 'a:b', 'a/b', 'a[b]', + ].each { |name| + assert_raises(ArgumentError) { + HTTP::Cookie.new(cookie_values(:name => name)) + } + cookie = HTTP::Cookie.new(cookie_values) + assert_raises(ArgumentError) { + cookie.name = name + } + } + end + + def test_compare + time = Time.now + cookies = [ + { :created_at => time + 1 }, + { :created_at => time - 1 }, + { :created_at => time }, + { :created_at => time, :path => '/foo/bar/' }, + { :created_at => time, :path => '/foo/' }, + { :created_at => time, :path => '/foo' }, + ].map { |attrs| HTTP::Cookie.new(cookie_values(attrs)) } + + assert_equal([3, 4, 5, 1, 2, 0], cookies.sort.map { |i| + cookies.find_index { |j| j.equal?(i) } + }) + end + + def test_expiration + cookie = HTTP::Cookie.new(cookie_values) + + assert_equal false, cookie.expired? + assert_equal true, cookie.expired?(cookie.expires + 1) + assert_equal false, cookie.expired?(cookie.expires - 1) + cookie.expire! + assert_equal true, cookie.expired? + end + + def test_max_age= + cookie = HTTP::Cookie.new(cookie_values) + expires = cookie.expires + + assert_raises(ArgumentError) { + cookie.max_age = "+1" + } + # make sure #expires is not destroyed + assert_equal expires, cookie.expires + + assert_raises(ArgumentError) { + cookie.max_age = "1.5" + } + # make sure #expires is not destroyed + assert_equal expires, cookie.expires + + assert_raises(ArgumentError) { + cookie.max_age = "1 day" + } + # make sure #expires is not destroyed + assert_equal expires, cookie.expires + + assert_raises(TypeError) { + cookie.max_age = [1] + } + # make sure #expires is not destroyed + assert_equal expires, cookie.expires + + cookie.max_age = "12" + assert_equal 12, cookie.max_age + + cookie.max_age = -3 + assert_equal -3, cookie.max_age + end + + def test_session + cookie = HTTP::Cookie.new(cookie_values) + + assert_equal false, cookie.session? + assert_equal nil, cookie.max_age + + cookie.expires = nil + assert_equal true, cookie.session? + assert_equal nil, cookie.max_age + + cookie.expires = Time.now + 3600 + assert_equal false, cookie.session? + assert_equal nil, cookie.max_age + + cookie.max_age = 3600 + assert_equal false, cookie.session? + assert_equal cookie.created_at + 3600, cookie.expires + + cookie.max_age = nil + assert_equal true, cookie.session? + assert_equal nil, cookie.expires + end + + def test_equal + assert_not_equal(HTTP::Cookie.new(cookie_values), + HTTP::Cookie.new(cookie_values(:value => 'bar'))) + end + + def test_new_tld_domain + url = URI 'http://rubyforge.org/' + + tld_cookie1 = HTTP::Cookie.new(cookie_values(:domain => 'org', :origin => url)) + assert_equal false, tld_cookie1.for_domain? + assert_equal 'org', tld_cookie1.domain + assert_equal false, tld_cookie1.acceptable? + + tld_cookie2 = HTTP::Cookie.new(cookie_values(:domain => '.org', :origin => url)) + assert_equal false, tld_cookie1.for_domain? + assert_equal 'org', tld_cookie2.domain + assert_equal false, tld_cookie2.acceptable? + end + + def test_new_tld_domain_from_tld + url = URI 'http://org/' + + tld_cookie1 = HTTP::Cookie.new(cookie_values(:domain => 'org', :origin => url)) + assert_equal false, tld_cookie1.for_domain? + assert_equal 'org', tld_cookie1.domain + assert_equal true, tld_cookie1.acceptable? + + tld_cookie2 = HTTP::Cookie.new(cookie_values(:domain => '.org', :origin => url)) + assert_equal false, tld_cookie1.for_domain? + assert_equal 'org', tld_cookie2.domain + assert_equal true, tld_cookie2.acceptable? + end + + def test_fall_back_rules_for_local_domains + url = URI 'http://www.example.local' + + tld_cookie = HTTP::Cookie.new(cookie_values(:domain => '.local', :origin => url)) + assert_equal false, tld_cookie.acceptable? + + sld_cookie = HTTP::Cookie.new(cookie_values(:domain => '.example.local', :origin => url)) + assert_equal true, sld_cookie.acceptable? + end + + def test_new_rejects_cookies_with_ipv4_address_subdomain + url = URI 'http://192.168.0.1/' + + cookie = HTTP::Cookie.new(cookie_values(:domain => '.0.1', :origin => url)) + assert_equal false, cookie.acceptable? + end + + def test_value + cookie = HTTP::Cookie.new('name', 'value') + assert_equal 'value', cookie.value + + cookie.value = 'new value' + assert_equal 'new value', cookie.value + + assert_raises(ArgumentError) { cookie.value = "a\tb" } + assert_raises(ArgumentError) { cookie.value = "a\nb" } + + assert_equal false, cookie.expired? + cookie.value = nil + assert_equal '', cookie.value + assert_equal true, cookie.expired? + end + + def test_path + uri = URI.parse('http://example.com/foo/bar') + + assert_equal '/foo/bar', uri.path + + cookie_str = 'a=b' + cookie = HTTP::Cookie.parse(cookie_str, uri).first + assert '/foo/', cookie.path + + cookie_str = 'a=b; path=/foo' + cookie = HTTP::Cookie.parse(cookie_str, uri).first + assert '/foo', cookie.path + + uri = URI.parse('http://example.com') + + assert_equal '', uri.path + + cookie_str = 'a=b' + cookie = HTTP::Cookie.parse(cookie_str, uri).first + assert '/', cookie.path + + cookie_str = 'a=b; path=/foo' + cookie = HTTP::Cookie.parse(cookie_str, uri).first + assert '/foo', cookie.path + end + + def test_domain_nil + cookie = HTTP::Cookie.new('a', 'b') + assert_raises(RuntimeError) { + cookie.valid_for_uri?('http://example.com/') + } + end + + def test_domain= + url = URI.parse('http://host.dom.example.com:8080/') + + cookie_str = 'a=b; domain=Example.Com' + cookie = HTTP::Cookie.parse(cookie_str, url).first + assert 'example.com', cookie.domain + + cookie.domain = DomainName(url.host) + assert 'host.dom.example.com', cookie.domain + + cookie.domain = 'Dom.example.com' + assert 'dom.example.com', cookie.domain + + cookie.domain = Object.new.tap { |o| + def o.to_str + 'Example.com' + end + } + assert 'example.com', cookie.domain + + url = URI 'http://rubyforge.org/' + + [nil, '', '.'].each { |d| + cookie = HTTP::Cookie.new('Foo', 'Bar', :path => '/') + cookie.domain = d + assert_equal nil, cookie.domain, "domain=#{d.inspect}" + assert_equal nil, cookie.domain_name, "domain=#{d.inspect}" + assert_raises(RuntimeError) { + cookie.acceptable? + } + + cookie = HTTP::Cookie.new('Foo', 'Bar', :path => '/') + cookie.origin = url + cookie.domain = d + assert_equal url.host, cookie.domain, "domain=#{d.inspect}" + assert_equal true, cookie.acceptable?, "domain=#{d.inspect}" + } + end + + def test_origin= + url = URI.parse('http://example.com/path/') + + cookie = HTTP::Cookie.new('a', 'b') + assert_raises(ArgumentError) { + cookie.origin = 123 + } + cookie.origin = url + assert_equal '/path/', cookie.path + assert_equal 'example.com', cookie.domain + assert_equal false, cookie.for_domain + assert_raises(ArgumentError) { + # cannot change the origin once set + cookie.origin = URI.parse('http://www.example.com/') + } + + cookie = HTTP::Cookie.new('a', 'b', :domain => '.example.com', :path => '/') + cookie.origin = url + assert_equal '/', cookie.path + assert_equal 'example.com', cookie.domain + assert_equal true, cookie.for_domain + assert_raises(ArgumentError) { + # cannot change the origin once set + cookie.origin = URI.parse('http://www.example.com/') + } + + cookie = HTTP::Cookie.new('a', 'b', :domain => '.example.com') + cookie.origin = URI.parse('http://example.org/') + assert_equal false, cookie.acceptable? + + cookie = HTTP::Cookie.new('a', 'b', :domain => '.example.com') + cookie.origin = 'file:///tmp/test.html' + assert_equal nil, cookie.path + + cookie = HTTP::Cookie.new('a', 'b', :domain => '.example.com', :path => '/') + cookie.origin = 'file:///tmp/test.html' + assert_equal false, cookie.acceptable? + end + + def test_acceptable_from_uri? + cookie = HTTP::Cookie.new(cookie_values( + :domain => 'uk', + :for_domain => true, + :origin => nil)) + assert_equal false, cookie.for_domain? + assert_equal true, cookie.acceptable_from_uri?('http://uk/') + assert_equal false, cookie.acceptable_from_uri?('http://foo.uk/') + end + + def test_valid_for_uri? + { + HTTP::Cookie.parse('a1=b', + 'http://example.com/dir/file.html').first => { + true => [ + 'http://example.com/dir/', + 'http://example.com/dir/test.html', + 'https://example.com/dir/', + 'https://example.com/dir/test.html', + ], + false => [ + 'file:///dir/test.html', + 'http://example.com/dir', + 'http://example.com/dir2/test.html', + 'http://www.example.com/dir/test.html', + 'http://www.example.com/dir2/test.html', + 'https://example.com/dir', + 'https://example.com/dir2/test.html', + 'https://www.example.com/dir/test.html', + 'https://www.example.com/dir2/test.html', + ] + }, + HTTP::Cookie.parse('a2=b; path=/dir2/', + 'http://example.com/dir/file.html').first => { + true => [ + 'http://example.com/dir2/', + 'http://example.com/dir2/test.html', + 'https://example.com/dir2/', + 'https://example.com/dir2/test.html', + ], + false => [ + 'file:///dir/test.html', + 'http://example.com/dir/test.html', + 'http://www.example.com/dir/test.html', + 'http://www.example.com/dir2', + 'http://www.example.com/dir2/test.html', + 'https://example.com/dir/test.html', + 'https://www.example.com/dir/test.html', + 'https://www.example.com/dir2', + 'https://www.example.com/dir2/test.html', + ] + }, + HTTP::Cookie.parse('a4=b; domain=example.com; path=/dir2/', + URI('http://example.com/dir/file.html')).first => { + true => [ + 'https://example.com/dir2/test.html', + 'http://example.com/dir2/test.html', + 'https://www.example.com/dir2/test.html', + 'http://www.example.com/dir2/test.html', + ], + false => [ + 'https://example.com/dir/test.html', + 'http://example.com/dir/test.html', + 'https://www.example.com/dir/test.html', + 'http://www.example.com/dir/test.html', + 'file:///dir2/test.html', + ] + }, + HTTP::Cookie.parse('a4=b; secure', + URI('https://example.com/dir/file.html')).first => { + true => [ + 'https://example.com/dir/test.html', + ], + false => [ + 'http://example.com/dir/test.html', + 'https://example.com/dir2/test.html', + 'http://example.com/dir2/test.html', + 'file:///dir2/test.html', + ] + }, + HTTP::Cookie.parse('a5=b', + URI('https://example.com/')).first => { + true => [ + 'https://example.com', + ], + false => [ + 'file:///', + ] + }, + HTTP::Cookie.parse('a6=b; path=/dir', + 'http://example.com/dir/file.html').first => { + true => [ + 'http://example.com/dir', + 'http://example.com/dir/', + 'http://example.com/dir/test.html', + 'https://example.com/dir', + 'https://example.com/dir/', + 'https://example.com/dir/test.html', + ], + false => [ + 'file:///dir/test.html', + 'http://example.com/dir2', + 'http://example.com/dir2/test.html', + 'http://www.example.com/dir/test.html', + 'http://www.example.com/dir2/test.html', + 'https://example.com/dir2', + 'https://example.com/dir2/test.html', + 'https://www.example.com/dir/test.html', + 'https://www.example.com/dir2/test.html', + ] + }, + }.each { |cookie, hash| + hash.each { |expected, urls| + urls.each { |url| + assert_equal expected, cookie.valid_for_uri?(url), '%s: %s' % [cookie.name, url] + assert_equal expected, cookie.valid_for_uri?(URI(url)), "%s: URI(%s)" % [cookie.name, url] + } + } + } + end + + def test_yaml_expires + require 'yaml' + cookie = HTTP::Cookie.new(cookie_values) + + assert_equal false, cookie.session? + assert_equal nil, cookie.max_age + + ycookie = YAML.load(cookie.to_yaml) + assert_equal false, ycookie.session? + assert_equal nil, ycookie.max_age + assert_in_delta cookie.expires, ycookie.expires, 1 + + cookie.expires = nil + ycookie = YAML.load(cookie.to_yaml) + assert_equal true, ycookie.session? + assert_equal nil, ycookie.max_age + + cookie.expires = Time.now + 3600 + ycookie = YAML.load(cookie.to_yaml) + assert_equal false, ycookie.session? + assert_equal nil, ycookie.max_age + assert_in_delta cookie.expires, ycookie.expires, 1 + + cookie.max_age = 3600 + ycookie = YAML.load(cookie.to_yaml) + assert_equal false, ycookie.session? + assert_in_delta cookie.created_at + 3600, ycookie.expires, 1 + + cookie.max_age = nil + ycookie = YAML.load(cookie.to_yaml) + assert_equal true, ycookie.session? + assert_equal nil, ycookie.expires + end + + def test_s_path_match? + assert_equal true, HTTP::Cookie.path_match?('/admin/', '/admin/index') + assert_equal false, HTTP::Cookie.path_match?('/admin/', '/Admin/index') + assert_equal true, HTTP::Cookie.path_match?('/admin/', '/admin/') + assert_equal false, HTTP::Cookie.path_match?('/admin/', '/admin') + + assert_equal true, HTTP::Cookie.path_match?('/admin', '/admin') + assert_equal false, HTTP::Cookie.path_match?('/admin', '/Admin') + assert_equal false, HTTP::Cookie.path_match?('/admin', '/admins') + assert_equal true, HTTP::Cookie.path_match?('/admin', '/admin/') + assert_equal true, HTTP::Cookie.path_match?('/admin', '/admin/index') + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie_jar.rb b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie_jar.rb new file mode 100644 index 0000000..8f57abf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/http-cookie-1.0.4/test/test_http_cookie_jar.rb @@ -0,0 +1,988 @@ +require File.expand_path('helper', File.dirname(__FILE__)) +require 'tmpdir' + +module TestHTTPCookieJar + class TestAutoloading < Test::Unit::TestCase + def test_nonexistent_store + assert_raises(NameError) { + HTTP::CookieJar::NonexistentStore + } + end + + def test_erroneous_store + Dir.mktmpdir { |dir| + Dir.mkdir(File.join(dir, 'http')) + Dir.mkdir(File.join(dir, 'http', 'cookie_jar')) + rb = File.join(dir, 'http', 'cookie_jar', 'erroneous_store.rb') + File.open(rb, 'w').close + $LOAD_PATH.unshift(dir) + + assert_raises(NameError) { + HTTP::CookieJar::ErroneousStore + } + assert($LOADED_FEATURES.any? { |file| FileTest.identical?(file, rb) }) + } + end + + def test_nonexistent_saver + assert_raises(NameError) { + HTTP::CookieJar::NonexistentSaver + } + end + + def test_erroneous_saver + Dir.mktmpdir { |dir| + Dir.mkdir(File.join(dir, 'http')) + Dir.mkdir(File.join(dir, 'http', 'cookie_jar')) + rb = File.join(dir, 'http', 'cookie_jar', 'erroneous_saver.rb') + File.open(rb, 'w').close + $LOAD_PATH.unshift(dir) + + assert_raises(NameError) { + HTTP::CookieJar::ErroneousSaver + } + assert($LOADED_FEATURES.any? { |file| FileTest.identical?(file, rb) }) + } + end + end + + module CommonTests + def setup(options = nil, options2 = nil) + default_options = { + :store => :hash, + :gc_threshold => 1500, # increased by 10 for shorter test time + } + new_options = default_options.merge(options || {}) + new_options2 = new_options.merge(options2 || {}) + @store_type = new_options[:store] + @gc_threshold = new_options[:gc_threshold] + @jar = HTTP::CookieJar.new(new_options) + @jar2 = HTTP::CookieJar.new(new_options2) + end + + #def hash_store? + # @store_type == :hash + #end + + def mozilla_store? + @store_type == :mozilla + end + + def cookie_values(options = {}) + { + :name => 'Foo', + :value => 'Bar', + :path => '/', + :expires => Time.at(Time.now.to_i + 10 * 86400), # to_i is important here + :for_domain => true, + :domain => 'rubyforge.org', + :origin => 'http://rubyforge.org/' + }.merge(options) + end + + def test_empty? + assert_equal true, @jar.empty? + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + assert_equal false, @jar.empty? + assert_equal false, @jar.empty?('http://rubyforge.org/') + assert_equal true, @jar.empty?('http://example.local/') + end + + def test_two_cookies_same_domain_and_name_different_paths + url = URI 'http://rubyforge.org/' + + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + @jar.add(HTTP::Cookie.new(cookie_values(:path => '/onetwo'))) + + assert_equal(1, @jar.cookies(url).length) + assert_equal 2, @jar.cookies(URI('http://rubyforge.org/onetwo')).length + end + + def test_domain_case + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + @jar.add(HTTP::Cookie.new(cookie_values(:domain => 'RuByForge.Org', :name => 'aaron'))) + + assert_equal(2, @jar.cookies(url).length) + + url2 = URI 'http://RuByFoRgE.oRg/' + assert_equal(2, @jar.cookies(url2).length) + end + + def test_host_only + url = URI.parse('http://rubyforge.org/') + + @jar.add(HTTP::Cookie.new( + cookie_values(:domain => 'rubyforge.org', :for_domain => false))) + + assert_equal(1, @jar.cookies(url).length) + + assert_equal(1, @jar.cookies(URI('http://RubyForge.org/')).length) + + assert_equal(1, @jar.cookies(URI('https://RubyForge.org/')).length) + + assert_equal(0, @jar.cookies(URI('http://www.rubyforge.org/')).length) + end + + def test_host_only_with_unqualified_hostname + @jar.add(HTTP::Cookie.new(cookie_values( + :origin => 'http://localhost/', :domain => 'localhost', :for_domain => false))) + + assert_equal(1, @jar.cookies(URI('http://localhost/')).length) + + assert_equal(1, @jar.cookies(URI('http://Localhost/')).length) + + assert_equal(1, @jar.cookies(URI('https://Localhost/')).length) + end + + def test_empty_value + url = URI 'http://rubyforge.org/' + values = cookie_values(:value => "") + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + @jar.add HTTP::Cookie.new(values.merge(:domain => 'RuByForge.Org', + :name => 'aaron')) + + assert_equal(2, @jar.cookies(url).length) + + url2 = URI 'http://RuByFoRgE.oRg/' + assert_equal(2, @jar.cookies(url2).length) + end + + def test_add_future_cookies + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + # Add the same cookie, and we should still only have one + @jar.add(HTTP::Cookie.new(cookie_values)) + assert_equal(1, @jar.cookies(url).length) + + # Make sure we can get the cookie from different paths + assert_equal(1, @jar.cookies(URI('http://rubyforge.org/login')).length) + + # Make sure we can't get the cookie from different domains + assert_equal(0, @jar.cookies(URI('http://google.com/')).length) + end + + def test_add_multiple_cookies + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + # Add the same cookie, and we should still only have one + @jar.add(HTTP::Cookie.new(cookie_values(:name => 'Baz'))) + assert_equal(2, @jar.cookies(url).length) + + # Make sure we can get the cookie from different paths + assert_equal(2, @jar.cookies(URI('http://rubyforge.org/login')).length) + + # Make sure we can't get the cookie from different domains + assert_equal(0, @jar.cookies(URI('http://google.com/')).length) + end + + def test_add_multiple_cookies_with_the_same_name + now = Time.now + + cookies = [ + { :value => 'a', :path => '/', }, + { :value => 'b', :path => '/abc/def/', :created_at => now - 1 }, + { :value => 'c', :path => '/abc/def/', :domain => 'www.rubyforge.org', :origin => 'http://www.rubyforge.org/abc/def/', :created_at => now }, + { :value => 'd', :path => '/abc/' }, + ].map { |attrs| + HTTP::Cookie.new(cookie_values(attrs)) + } + + url = URI 'http://www.rubyforge.org/abc/def/ghi' + + cookies.permutation(cookies.size) { |shuffled| + @jar.clear + shuffled.each { |cookie| @jar.add(cookie) } + assert_equal %w[b c d a], @jar.cookies(url).map { |cookie| cookie.value } + } + end + + def test_fall_back_rules_for_local_domains + url = URI 'http://www.example.local' + + sld_cookie = HTTP::Cookie.new(cookie_values(:domain => '.example.local', :origin => url)) + @jar.add(sld_cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_add_makes_exception_for_localhost + url = URI 'http://localhost' + + tld_cookie = HTTP::Cookie.new(cookie_values(:domain => 'localhost', :origin => url)) + @jar.add(tld_cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_add_cookie_for_the_parent_domain + url = URI 'http://x.foo.com' + + cookie = HTTP::Cookie.new(cookie_values(:domain => '.foo.com', :origin => url)) + @jar.add(cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_add_rejects_cookies_with_unknown_domain_or_path + cookie = HTTP::Cookie.new(cookie_values.reject { |k,v| [:origin, :domain].include?(k) }) + assert_raises(ArgumentError) { + @jar.add(cookie) + } + + cookie = HTTP::Cookie.new(cookie_values.reject { |k,v| [:origin, :path].include?(k) }) + assert_raises(ArgumentError) { + @jar.add(cookie) + } + end + + def test_add_does_not_reject_cookies_from_a_nested_subdomain + url = URI 'http://y.x.foo.com' + + cookie = HTTP::Cookie.new(cookie_values(:domain => '.foo.com', :origin => url)) + @jar.add(cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookie_without_leading_dot_does_not_cause_substring_match + url = URI 'http://arubyforge.org/' + + cookie = HTTP::Cookie.new(cookie_values(:domain => 'rubyforge.org')) + @jar.add(cookie) + + assert_equal(0, @jar.cookies(url).length) + end + + def test_cookie_without_leading_dot_matches_subdomains + url = URI 'http://admin.rubyforge.org/' + + cookie = HTTP::Cookie.new(cookie_values(:domain => 'rubyforge.org', :origin => url)) + @jar.add(cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookies_with_leading_dot_match_subdomains + url = URI 'http://admin.rubyforge.org/' + + @jar.add(HTTP::Cookie.new(cookie_values(:domain => '.rubyforge.org', :origin => url))) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookies_with_leading_dot_match_parent_domains + url = URI 'http://rubyforge.org/' + + @jar.add(HTTP::Cookie.new(cookie_values(:domain => '.rubyforge.org', :origin => url))) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookies_with_leading_dot_match_parent_domains_exactly + url = URI 'http://arubyforge.org/' + + @jar.add(HTTP::Cookie.new(cookie_values(:domain => '.rubyforge.org'))) + + assert_equal(0, @jar.cookies(url).length) + end + + def test_cookie_for_ipv4_address_matches_the_exact_ipaddress + url = URI 'http://192.168.0.1/' + + cookie = HTTP::Cookie.new(cookie_values(:domain => '192.168.0.1', :origin => url)) + @jar.add(cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookie_for_ipv6_address_matches_the_exact_ipaddress + url = URI 'http://[fe80::0123:4567:89ab:cdef]/' + + cookie = HTTP::Cookie.new(cookie_values(:domain => '[fe80::0123:4567:89ab:cdef]', :origin => url)) + @jar.add(cookie) + + assert_equal(1, @jar.cookies(url).length) + end + + def test_cookies_dot + url = URI 'http://www.host.example/' + + @jar.add(HTTP::Cookie.new(cookie_values(:domain => 'www.host.example', :origin => url))) + + url = URI 'http://wwwxhost.example/' + assert_equal(0, @jar.cookies(url).length) + end + + def test_cookies_no_host + url = URI 'file:///path/' + + @jar.add(HTTP::Cookie.new(cookie_values(:origin => url))) + + assert_equal(0, @jar.cookies(url).length) + end + + def test_clear + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values(:origin => url)) + @jar.add(cookie) + @jar.add(HTTP::Cookie.new(cookie_values(:name => 'Baz', :origin => url))) + assert_equal(2, @jar.cookies(url).length) + + @jar.clear + + assert_equal(0, @jar.cookies(url).length) + end + + def test_save_cookies_yaml + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values(:origin => url)) + s_cookie = HTTP::Cookie.new(cookie_values(:name => 'Bar', + :expires => nil, + :origin => url)) + + @jar.add(cookie) + @jar.add(s_cookie) + @jar.add(HTTP::Cookie.new(cookie_values(:name => 'Baz', :for_domain => false, :origin => url))) + + assert_equal(3, @jar.cookies(url).length) + + Dir.mktmpdir do |dir| + value = @jar.save(File.join(dir, "cookies.yml")) + assert_same @jar, value + + @jar2.load(File.join(dir, "cookies.yml")) + cookies = @jar2.cookies(url).sort_by { |cookie| cookie.name } + assert_equal(2, cookies.length) + assert_equal('Baz', cookies[0].name) + assert_equal(false, cookies[0].for_domain) + assert_equal('Foo', cookies[1].name) + assert_equal(true, cookies[1].for_domain) + end + + assert_equal(3, @jar.cookies(url).length) + end + + def test_save_load_signature + Dir.mktmpdir { |dir| + filename = File.join(dir, "cookies.yml") + + @jar.save(filename, :format => :cookiestxt, :session => true) + @jar.save(filename, :format => :cookiestxt, :session => true) + @jar.save(filename, :format => :cookiestxt) + @jar.save(filename, :cookiestxt, :session => true) + @jar.save(filename, :cookiestxt) + @jar.save(filename, HTTP::CookieJar::CookiestxtSaver) + @jar.save(filename, HTTP::CookieJar::CookiestxtSaver.new) + @jar.save(filename, :session => true) + @jar.save(filename) + + assert_raises(ArgumentError) { + @jar.save() + } + assert_raises(ArgumentError) { + @jar.save(filename, :nonexistent) + } + assert_raises(TypeError) { + @jar.save(filename, { :format => :cookiestxt }, { :session => true }) + } + assert_raises(ArgumentError) { + @jar.save(filename, :cookiestxt, { :session => true }, { :format => :cookiestxt }) + } + + @jar.load(filename, :format => :cookiestxt, :linefeed => "\n") + @jar.load(filename, :format => :cookiestxt, :linefeed => "\n") + @jar.load(filename, :format => :cookiestxt) + @jar.load(filename, HTTP::CookieJar::CookiestxtSaver) + @jar.load(filename, HTTP::CookieJar::CookiestxtSaver.new) + @jar.load(filename, :cookiestxt, :linefeed => "\n") + @jar.load(filename, :cookiestxt) + @jar.load(filename, :linefeed => "\n") + @jar.load(filename) + assert_raises(ArgumentError) { + @jar.load() + } + assert_raises(ArgumentError) { + @jar.load(filename, :nonexistent) + } + assert_raises(TypeError) { + @jar.load(filename, { :format => :cookiestxt }, { :linefeed => "\n" }) + } + assert_raises(ArgumentError) { + @jar.load(filename, :cookiestxt, { :linefeed => "\n" }, { :format => :cookiestxt }) + } + } + end + + def test_save_session_cookies_yaml + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + s_cookie = HTTP::Cookie.new(cookie_values(:name => 'Bar', + :expires => nil)) + + @jar.add(cookie) + @jar.add(s_cookie) + @jar.add(HTTP::Cookie.new(cookie_values(:name => 'Baz'))) + + assert_equal(3, @jar.cookies(url).length) + + Dir.mktmpdir do |dir| + @jar.save(File.join(dir, "cookies.yml"), :format => :yaml, :session => true) + + @jar2.load(File.join(dir, "cookies.yml")) + assert_equal(3, @jar2.cookies(url).length) + end + + assert_equal(3, @jar.cookies(url).length) + end + + def test_save_and_read_cookiestxt + url = URI 'http://rubyforge.org/foo/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + expires = cookie.expires + s_cookie = HTTP::Cookie.new(cookie_values(:name => 'Bar', + :expires => nil)) + cookie2 = HTTP::Cookie.new(cookie_values(:name => 'Baz', + :value => 'Foo#Baz', + :path => '/foo/', + :for_domain => false)) + h_cookie = HTTP::Cookie.new(cookie_values(:name => 'Quux', + :value => 'Foo#Quux', + :httponly => true)) + ma_cookie = HTTP::Cookie.new(cookie_values(:name => 'Maxage', + :value => 'Foo#Maxage', + :max_age => 15000)) + @jar.add(cookie) + @jar.add(s_cookie) + @jar.add(cookie2) + @jar.add(h_cookie) + @jar.add(ma_cookie) + + assert_equal(5, @jar.cookies(url).length) + + Dir.mktmpdir do |dir| + filename = File.join(dir, "cookies.txt") + @jar.save(filename, :cookiestxt) + + content = File.read(filename) + + filename2 = File.join(dir, "cookies2.txt") + open(filename2, 'w') { |w| + w.puts '# HTTP Cookie File' + @jar.save(w, :cookiestxt, :header => nil) + } + assert_equal content, File.read(filename2) + + assert_match(/^\.rubyforge\.org\t.*\tFoo\t/, content) + assert_match(/^rubyforge\.org\t.*\tBaz\t/, content) + assert_match(/^#HttpOnly_\.rubyforge\.org\t/, content) + + @jar2.load(filename, :cookiestxt) # HACK test the format + cookies = @jar2.cookies(url) + assert_equal(4, cookies.length) + cookies.each { |cookie| + case cookie.name + when 'Foo' + assert_equal 'Bar', cookie.value + assert_equal expires, cookie.expires + assert_equal 'rubyforge.org', cookie.domain + assert_equal true, cookie.for_domain + assert_equal '/', cookie.path + assert_equal false, cookie.httponly? + when 'Baz' + assert_equal 'Foo#Baz', cookie.value + assert_equal 'rubyforge.org', cookie.domain + assert_equal false, cookie.for_domain + assert_equal '/foo/', cookie.path + assert_equal false, cookie.httponly? + when 'Quux' + assert_equal 'Foo#Quux', cookie.value + assert_equal expires, cookie.expires + assert_equal 'rubyforge.org', cookie.domain + assert_equal true, cookie.for_domain + assert_equal '/', cookie.path + assert_equal true, cookie.httponly? + when 'Maxage' + assert_equal 'Foo#Maxage', cookie.value + assert_equal nil, cookie.max_age + assert_in_delta ma_cookie.expires, cookie.expires, 1 + else + raise + end + } + end + + assert_equal(5, @jar.cookies(url).length) + end + + def test_load_yaml_mechanize + @jar.load(test_file('mechanize.yml'), :yaml) + + assert_equal 4, @jar.to_a.size + + com_nid, com_pref = @jar.cookies('http://www.google.com/') + + assert_equal 'NID', com_nid.name + assert_equal 'Sun, 23 Sep 2063 08:20:15 GMT', com_nid.expires.httpdate + assert_equal 'google.com', com_nid.domain_name.hostname + + assert_equal 'PREF', com_pref.name + assert_equal 'Tue, 24 Mar 2065 08:20:15 GMT', com_pref.expires.httpdate + assert_equal 'google.com', com_pref.domain_name.hostname + + cojp_nid, cojp_pref = @jar.cookies('http://www.google.co.jp/') + + assert_equal 'NID', cojp_nid.name + assert_equal 'Sun, 23 Sep 2063 08:20:16 GMT', cojp_nid.expires.httpdate + assert_equal 'google.co.jp', cojp_nid.domain_name.hostname + + assert_equal 'PREF', cojp_pref.name + assert_equal 'Tue, 24 Mar 2065 08:20:16 GMT', cojp_pref.expires.httpdate + assert_equal 'google.co.jp', cojp_pref.domain_name.hostname + end + + def test_expire_cookies + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(cookie_values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + # Add a second cookie + @jar.add(HTTP::Cookie.new(cookie_values(:name => 'Baz'))) + assert_equal(2, @jar.cookies(url).length) + + # Make sure we can get the cookie from different paths + assert_equal(2, @jar.cookies(URI('http://rubyforge.org/login')).length) + + # Expire the first cookie + @jar.add(HTTP::Cookie.new(cookie_values(:expires => Time.now - (10 * 86400)))) + assert_equal(1, @jar.cookies(url).length) + + # Expire the second cookie + @jar.add(HTTP::Cookie.new(cookie_values( :name => 'Baz', :expires => Time.now - (10 * 86400)))) + assert_equal(0, @jar.cookies(url).length) + end + + def test_session_cookies + values = cookie_values(:expires => nil) + url = URI 'http://rubyforge.org/' + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + # Add a second cookie + @jar.add(HTTP::Cookie.new(values.merge(:name => 'Baz'))) + assert_equal(2, @jar.cookies(url).length) + + # Make sure we can get the cookie from different paths + assert_equal(2, @jar.cookies(URI('http://rubyforge.org/login')).length) + + # Expire the first cookie + @jar.add(HTTP::Cookie.new(values.merge(:expires => Time.now - (10 * 86400)))) + assert_equal(1, @jar.cookies(url).length) + + # Expire the second cookie + @jar.add(HTTP::Cookie.new(values.merge(:name => 'Baz', :expires => Time.now - (10 * 86400)))) + assert_equal(0, @jar.cookies(url).length) + + # When given a URI with a blank path, CookieJar#cookies should return + # cookies with the path '/': + url = URI 'http://rubyforge.org' + assert_equal '', url.path + assert_equal(0, @jar.cookies(url).length) + # Now add a cookie with the path set to '/': + @jar.add(HTTP::Cookie.new(values.merge(:name => 'has_root_path', :path => '/'))) + assert_equal(1, @jar.cookies(url).length) + end + + def test_paths + url = URI 'http://rubyforge.org/login' + values = cookie_values(:path => "/login", :expires => nil, :origin => url) + + # Add one cookie with an expiration date in the future + cookie = HTTP::Cookie.new(values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length) + + # Add a second cookie + @jar.add(HTTP::Cookie.new(values.merge( :name => 'Baz' ))) + assert_equal(2, @jar.cookies(url).length) + + # Make sure we don't get the cookie in a different path + assert_equal(0, @jar.cookies(URI('http://rubyforge.org/hello')).length) + assert_equal(0, @jar.cookies(URI('http://rubyforge.org/')).length) + + # Expire the first cookie + @jar.add(HTTP::Cookie.new(values.merge( :expires => Time.now - (10 * 86400)))) + assert_equal(1, @jar.cookies(url).length) + + # Expire the second cookie + @jar.add(HTTP::Cookie.new(values.merge( :name => 'Baz', + :expires => Time.now - (10 * 86400)))) + assert_equal(0, @jar.cookies(url).length) + end + + def test_ssl_cookies + # thanks to michal "ocher" ochman for reporting the bug responsible for this test. + values = cookie_values(:expires => nil) + values_ssl = values.merge(:name => 'Baz', :domain => "#{values[:domain]}:443") + url = URI 'https://rubyforge.org/login' + + cookie = HTTP::Cookie.new(values) + @jar.add(cookie) + assert_equal(1, @jar.cookies(url).length, "did not handle SSL cookie") + + cookie = HTTP::Cookie.new(values_ssl) + @jar.add(cookie) + assert_equal(2, @jar.cookies(url).length, "did not handle SSL cookie with :443") + end + + def test_secure_cookie + nurl = URI 'http://rubyforge.org/login' + surl = URI 'https://rubyforge.org/login' + + nncookie = HTTP::Cookie.new(cookie_values(:name => 'Foo1', :origin => nurl)) + sncookie = HTTP::Cookie.new(cookie_values(:name => 'Foo1', :origin => surl)) + nscookie = HTTP::Cookie.new(cookie_values(:name => 'Foo2', :secure => true, :origin => nurl)) + sscookie = HTTP::Cookie.new(cookie_values(:name => 'Foo2', :secure => true, :origin => surl)) + + @jar.add(nncookie) + @jar.add(sncookie) + @jar.add(nscookie) + @jar.add(sscookie) + + assert_equal('Foo1', @jar.cookies(nurl).map { |c| c.name }.sort.join(' ') ) + assert_equal('Foo1 Foo2', @jar.cookies(surl).map { |c| c.name }.sort.join(' ') ) + end + + def test_delete + cookie1 = HTTP::Cookie.new(cookie_values) + cookie2 = HTTP::Cookie.new(:name => 'Foo', :value => '', + :domain => 'rubyforge.org', + :for_domain => false, + :path => '/') + cookie3 = HTTP::Cookie.new(:name => 'Foo', :value => '', + :domain => 'rubyforge.org', + :for_domain => true, + :path => '/') + + @jar.add(cookie1) + @jar.delete(cookie2) + + if mozilla_store? + assert_equal(1, @jar.to_a.length) + @jar.delete(cookie3) + end + + assert_equal(0, @jar.to_a.length) + end + + def test_accessed_at + orig = HTTP::Cookie.new(cookie_values(:expires => nil)) + @jar.add(orig) + + time = orig.accessed_at + + assert_in_delta 1.0, time, Time.now, "accessed_at is initialized to the current time" + + cookie, = @jar.to_a + + assert_equal time, cookie.accessed_at, "accessed_at is not updated by each()" + + cookie, = @jar.cookies("http://rubyforge.org/") + + assert_send [cookie.accessed_at, :>, time], "accessed_at is not updated by each(url)" + end + + def test_max_cookies + slimit = HTTP::Cookie::MAX_COOKIES_TOTAL + @gc_threshold + + limit_per_domain = HTTP::Cookie::MAX_COOKIES_PER_DOMAIN + uri = URI('http://www.example.org/') + date = Time.at(Time.now.to_i + 86400) + (1..(limit_per_domain + 1)).each { |i| + @jar << HTTP::Cookie.new(cookie_values( + :name => 'Foo%d' % i, + :value => 'Bar%d' % i, + :domain => uri.host, + :for_domain => true, + :path => '/dir%d/' % (i / 2), + :origin => uri + )).tap { |cookie| + cookie.created_at = i == 42 ? date - i : date + } + } + assert_equal limit_per_domain + 1, @jar.to_a.size + @jar.cleanup + count = @jar.to_a.size + assert_equal limit_per_domain, count + assert_equal [*1..(limit_per_domain + 1)] - [42], @jar.map { |cookie| + cookie.name[/(\d+)$/].to_i + }.sort + + hlimit = HTTP::Cookie::MAX_COOKIES_TOTAL + + n = hlimit / limit_per_domain * 2 + + (1..n).each { |i| + (1..(limit_per_domain + 1)).each { |j| + uri = URI('http://www%d.example.jp/' % i) + @jar << HTTP::Cookie.new(cookie_values( + :name => 'Baz%d' % j, + :value => 'www%d.example.jp' % j, + :domain => uri.host, + :for_domain => true, + :path => '/dir%d/' % (i / 2), + :origin => uri + )).tap { |cookie| + cookie.created_at = i == j ? date - i : date + } + count += 1 + } + } + + assert_send [count, :>, slimit] + assert_send [@jar.to_a.size, :<=, slimit] + @jar.cleanup + assert_equal hlimit, @jar.to_a.size + assert_equal false, @jar.any? { |cookie| + cookie.domain == cookie.value + } + end + + def test_parse + set_cookie = [ + "name=Akinori; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + "country=Japan; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + "city=Tokyo; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + ].join(', ') + + cookies = @jar.parse(set_cookie, 'http://rubyforge.org/') + assert_equal %w[Akinori Japan Tokyo], cookies.map { |c| c.value } + assert_equal %w[Tokyo Japan Akinori], @jar.to_a.sort_by { |c| c.name }.map { |c| c.value } + end + + def test_parse_with_block + set_cookie = [ + "name=Akinori; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + "country=Japan; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + "city=Tokyo; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + ].join(', ') + + cookies = @jar.parse(set_cookie, 'http://rubyforge.org/') { |c| c.name != 'city' } + assert_equal %w[Akinori Japan], cookies.map { |c| c.value } + assert_equal %w[Japan Akinori], @jar.to_a.sort_by { |c| c.name }.map { |c| c.value } + end + + def test_expire_by_each_and_cleanup + uri = URI('http://www.example.org/') + + ts = Time.now.to_f + if ts % 1 > 0.5 + sleep 0.5 + ts += 0.5 + end + expires = Time.at(ts.floor) + time = expires + + if mozilla_store? + # MozillaStore only has the time precision of seconds. + time = expires + expires -= 1 + end + + 0.upto(2) { |i| + c = HTTP::Cookie.new('Foo%d' % (3 - i), 'Bar', :expires => expires + i, :origin => uri) + @jar << c + @jar2 << c + } + + assert_equal %w[Foo1 Foo2], @jar.cookies.map(&:name) + assert_equal %w[Foo1 Foo2], @jar2.cookies(uri).map(&:name) + + sleep_until time + 1 + + assert_equal %w[Foo1], @jar.cookies.map(&:name) + assert_equal %w[Foo1], @jar2.cookies(uri).map(&:name) + + sleep_until time + 2 + + @jar.cleanup + @jar2.cleanup + + assert_send [@jar, :empty?] + assert_send [@jar2, :empty?] + end + end + + class WithHashStore < Test::Unit::TestCase + include CommonTests + + def test_new + jar = HTTP::CookieJar.new(:store => :hash) + assert_instance_of HTTP::CookieJar::HashStore, jar.store + + assert_raises(ArgumentError) { + jar = HTTP::CookieJar.new(:store => :nonexistent) + } + + jar = HTTP::CookieJar.new(:store => HTTP::CookieJar::HashStore.new) + assert_instance_of HTTP::CookieJar::HashStore, jar.store + + jar = HTTP::CookieJar.new(:store => HTTP::CookieJar::HashStore) + end + + def test_clone + jar = @jar.clone + assert_not_send [ + @jar.store, + :equal?, + jar.store + ] + assert_not_send [ + @jar.store.instance_variable_get(:@jar), + :equal?, + jar.store.instance_variable_get(:@jar) + ] + assert_equal @jar.cookies, jar.cookies + end + end + + class WithMozillaStore < Test::Unit::TestCase + include CommonTests + + def setup + super( + { :store => :mozilla, :filename => ":memory:" }, + { :store => :mozilla, :filename => ":memory:" }) + end + + def add_and_delete(jar) + jar.parse("name=Akinori; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + 'http://rubyforge.org/') + jar.parse("country=Japan; Domain=rubyforge.org; Expires=Sun, 08 Aug 2076 19:00:00 GMT; Path=/", + 'http://rubyforge.org/') + jar.delete(HTTP::Cookie.new("name", :domain => 'rubyforge.org')) + end + + def test_clone + assert_raises(TypeError) { + @jar.clone + } + end + + def test_close + add_and_delete(@jar) + + assert_not_send [@jar.store, :closed?] + @jar.store.close + assert_send [@jar.store, :closed?] + @jar.store.close # should do nothing + assert_send [@jar.store, :closed?] + end + + def test_finalizer + db = nil + loop { + jar = HTTP::CookieJar.new(:store => :mozilla, :filename => ':memory:') + add_and_delete(jar) + db = jar.store.instance_variable_get(:@db) + class << db + alias close_orig close + def close + STDERR.print "[finalizer is called]" + STDERR.flush + close_orig + end + end + break + } + end + + def test_upgrade_mozillastore + Dir.mktmpdir { |dir| + filename = File.join(dir, 'cookies.sqlite') + + sqlite = SQLite3::Database.new(filename) + sqlite.execute(<<-'SQL') + CREATE TABLE moz_cookies ( + id INTEGER PRIMARY KEY, + name TEXT, + value TEXT, + host TEXT, + path TEXT, + expiry INTEGER, + isSecure INTEGER, + isHttpOnly INTEGER) + SQL + sqlite.execute(<<-'SQL') + PRAGMA user_version = 1 + SQL + + begin + st_insert = sqlite.prepare(<<-'SQL') + INSERT INTO moz_cookies ( + id, name, value, host, path, expiry, isSecure, isHttpOnly + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + SQL + + st_insert.execute(1, 'name1', 'value1', '.example.co.jp', '/', 2312085765, 0, 0) + st_insert.execute(2, 'name1', 'value2', '.example.co.jp', '/', 2312085765, 0, 0) + st_insert.execute(3, 'name1', 'value3', 'www.example.co.jp', '/', 2312085765, 0, 0) + ensure + st_insert.close if st_insert + end + + sqlite.close + jar = HTTP::CookieJar.new(:store => :mozilla, :filename => filename) + + assert_equal 2, jar.to_a.size + assert_equal 2, jar.cookies('http://www.example.co.jp/').size + + cookie, *rest = jar.cookies('http://host.example.co.jp/') + assert_send [rest, :empty?] + assert_equal 'value2', cookie.value + } + end + end if begin + require 'sqlite3' + true + rescue LoadError + STDERR.puts 'sqlite3 missing?' + false + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Code-of-Conduct.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Code-of-Conduct.md new file mode 100644 index 0000000..306de4e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Code-of-Conduct.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Contributing.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Contributing.md new file mode 100644 index 0000000..56d4df5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Contributing.md @@ -0,0 +1,132 @@ +# Contributing + +I value any contribution to mime-types you can provide: a bug report, a feature +request, or code contributions. + +There are a few guidelines for contributing to mime-types: + +- Code changes _will_ _not_ be accepted without tests. The test suite is + written with [minitest]. +- Match my coding style. +- Use a thoughtfully-named topic branch that contains your change. Rebase your + commits into logical chunks as necessary. +- Use [quality commit messages]. +- Do not change the version number; when your patch is accepted and a release + is made, the version will be updated at that point. +- Submit a GitHub pull request with your changes. +- New or changed behaviours require new or updated documentation. + +## Adding or Modifying MIME Types + +The mime-types registry is no longer contained in mime-types, but in +[mime-types-data]. Please see that project for contributions there. + +### Test Dependencies + +mime-types uses Ryan Davis’s [Hoe] to manage the release process, and it adds +a number of rake tasks. You will mostly be interested in `rake`, which runs +the tests the same way that `rake test` or `rake travis` will do. + +To assist with the installation of the development dependencies for +mime-types, I have provided the simplest possible Gemfile pointing to the +(generated) `mime-types.gemspec` file. This will permit you to do `bundle +install` to get the development dependencies. If you aleady have `hoe` +installed, you can accomplish the same thing with `rake newb`. + +This task will install any missing dependencies, run the tests/specs, and +generate the RDoc. + +You can run tests with code coverage analysis by running `rake +test:coverage`. + +## Benchmarks + +mime-types offers several benchmark tasks to measure different measures of +performance. + +There is a repeated load test, measuring how long it takes to start and load +mime-types with its full registry. By default, it runs fifty loops and uses the +built-in benchmark library: + +- `rake benchmark:load` + +There are two allocation tracing benchmarks (for normal and columnar loads). +These can only be run on Ruby 2.1 or better and requires the +[allocation\_tracer] gem (not installed by default). + +- `rake benchmark:allocations` +- `rake benchmark:allocations:columnar` + +There are two loaded object count benchmarks (for normal and columnar loads). +These use `ObjectSpace.count_objects`. + +- `rake benchmark:objects` +- `rake benchmark:objects:columnar` + +## Workflow + +Here's the most direct way to get your work merged into the project: + +- Fork the project. +- Clone down your fork (`git clone git://github.com//ruby-mime-types.git`). +- Create a topic branch to contain your change (`git checkout -b my_awesome_feature`). +- Hack away, add tests. Not necessarily in that order. +- Make sure everything still passes by running `rake`. +- If necessary, rebase your commits into logical chunks, without errors. +- Push the branch up (`git push origin my_awesome_feature`). +- Create a pull request against mime-types/ruby-mime-types and describe what + your change does and the why you think it should be merged. + +## Contributors + +- Austin Ziegler created mime-types. + +Thanks to everyone else who has contributed to mime-types over the years: + +- Aaron Patterson +- Aggelos Avgerinos +- Al Snow +- Andre Pankratz +- Andy Brody +- Arnaud Meuret +- Brandon Galbraith +- Burke Libbey +- Chris Gat +- David Genord +- Dillon Welch +- Eric Marden +- Edward Betts +- Garret Alfert +- Godfrey Chan +- Greg Brockman +- Hans de Graaff +- Henrik Hodne +- Igor Victor +- Janko Marohnić +- Jean Boussier +- Jeremy Evans +- Juanito Fatas +- Jun Aruga +- Łukasz Śliwa +- Keerthi Siva +- Ken Ip +- Kevin Menard +- Koichi ITO +- Martin d'Allens +- Mauricio Linhares +- Nicolas Leger +- Nicholas La Roux +- nycvotes-dev +- Olle Jonsson +- Postmodern +- Richard Hirner +- Richard Hurt +- Richard Schneeman +- Tibor Szolár +- Todd Carrico + +[minitest]: https://github.com/seattlerb/minitest +[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +[mime-types-data]: https://github.com/mime-types/mime-types-data +[hoe]: https://github.com/seattlerb/hoe +[allocation\_tracer]: https://github.com/ko1/allocation_tracer diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/History.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/History.md new file mode 100644 index 0000000..6e88f45 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/History.md @@ -0,0 +1,269 @@ +# Changelog + +## 3.4.1 / 2021-11-16 + +- 1 bugfix: + + - Fixed a Ruby < 2.3 incompatibility introduced by the use of standardrb, + where `<<-` heredocs were converted to `<<~` heredocs. These have been + reverted back to `<<-` with the indentation kept and a `.strip` call + to prevent excess whitespace. + +## 3.4.0 / 2021-11-15 + +- 1 minor enhancement: + + - Added a new field to `MIME::Type` for checking provisional registrations + from IANA. [#157] + +- Documentation: + + - Kevin Menard synced the documentation so that all examples are correct. + [#153] + +- Administrivia: + + - Added Ruby 3.0 to the CI test matrix. Added `windows/jruby` to the + CI exclusion list; it refuses to run successfully. + - Removed the Travis CI configuration and changed it to Github Workflows + [#150]. Removed Coveralls configuration. + - Igor Victor added TruffleRuby to the Travis CI configuration. [#149] + - Koichi ITO loosened an excessively tight dependency. [#147] + - Started using `standardrb` for Ruby formatting and validation. + - Moved `deps:top` functionality to a support file. + +## 3.3.1 / 2019-12-26 + +- 1 minor bugfix: + + - Al Snow fixed a warning with MIME::Types::Logger producing a warning + because Ruby 2.7 introduces numbered block parameters. Because of the way + that the MIME::Types::Logger works for deprecation messages, the + initializer parameters had been named `_1`, `_2`, and `_3`. This has now + been resolved. [#146] + +- Administrivia: + + - Olle Jonsson removed an outdated Travis configuration option (`sudo: false`). [#142] + +## 3.3 / 2019-09-04 + +- 1 minor enhancement + + - Jean Boussier reduced memory usage for Ruby versions 2.3 or higher by + interning various string values in each type. This is done with a + backwards-compatible call that _freezes_ the strings on older versions of + Ruby. [#141] + +- Administrivia: + + - Nicholas La Roux updated Travis build configurations. [#139] + +## 3.2.2 / 2018-08-12 + +- Hiroto Fukui removed a stray `debugger` statement that I had used in + producing v3.2.1. [#137] + +## 3.2.1 / 2018-08-12 + +- A few bugs related to MIME::Types::Container and its use in the + mime-types-data helper tools reared their head because I released 3.2 + before verifying against mime-types-data. + +## 3.2 / 2018-08-12 + +- 2 minor enhancements + + - Janko Marohnić contributed a change to `MIME::Type#priority_order` that + should improve on strict sorting when dealing with MIME types that appear + to be in the same family even if strict sorting would cause an + unregistered type to be sorted first. [#132] + + - Dillon Welch contributed a change that added `frozen_string_literal: true` to files so that modern Rubies can automatically reduce duplicate + string allocations. [#135] + +- 2 bug fixes + + - Burke Libbey fixed a problem with cached data loading. [#126] + + - Resolved an issue where Enumerable#inject returns `nil` when provided an + empty enumerable and a default value has not been provided. This is + because when Enumerable#inject isn't provided a starting value, the first + value is used as the default value. In every case where this error was + happening, the result was supposed to be an array containing Set objects + so they can be reduced to a single Set. [#117], [#127], [#134] + + - Fixed an uncontrolled growth bug in MIME::Types::Container where a key + miss would create a new entry with an empty Set in the container. This + was working as designed (this particular feature was heavily used during + MIME::Type registry construction), but the design was flawed in that it + did not have any way of determining the difference between construction + and querying. This would mean that, if you have a function in your web + app that queries the MIME::Types registry by extension, the extension + registry would grow uncontrollably. [#136] + +- Deprecations: + + - Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated. + +- Documentation Changes: + + - Supporting files are now Markdown instead of rdoc, except for the README. + + - The history file has been modified to remove all history prior to 3.0. + This history can be found in previous commits. + + - A spelling error was corrected by Edward Betts ([#129]). + +- Administrivia: + + - CI configuration for more modern versions of Ruby were added by Nicolas + Leger ([#130]), Jun Aruga ([#125]), and Austin Ziegler. Removed + ruby-head-clang and rbx (Rubinius) from CI. + + - Fixed tests which were asserting equality against nil, which will become + an error in Minitest 6. + +## 3.1 / 2016-05-22 + +- 1 documentation change: + + - Tim Smith (@tas50) updated the build badges to be SVGs to improve + readability on high-density (retina) screens with pull request [#112]. + +- 3 bug fixes + + - A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen + strings, [#118]. This has been fixed. + + - The JSON data has been incorrectly encoded since the release of + mime-types 3 on the `xrefs` field, because of the switch to using a Set + to store cross-reference information. This has been fixed. + + - A tentative fix for [#117] has been applied, removing the only circular + require dependencies that exist (and for which there was code to prevent, + but the current fix is simpler). I have no way to verify this fix and + depending on how things are loaded by `delayed_job`, this fix may not be + sufficient. + +- 1 governance change + + - Updated to Contributor Covenant 1.4. + +## 3.0 / 2015-11-21 + +- 2 governance changes + + - This project and the related mime-types-data project are now exclusively + MIT licensed. Resolves [#95]. + + - All projects under the mime-types organization now have a standard code + of conduct adapted from the [Contributor Covenant]. This text can be + found in the [Code-of-Conduct.md] file. + +- 3 major changes + + - All methods deprecated in mime-types 2.x have been removed. + + - mime-types now requires Ruby 2.0 compatibility or later. Resolves + [#97]. + + - The registry data has been removed from mime-types and put into + mime-types-data, maintained and released separately. It can be found at + [mime-types-data]. + +- 17 minor changes: + + - `MIME::Type` changes: + + - Changed the way that simplified types representations are created to + reflect the fact that `x-` prefixes are no longer considered special + according to IANA. A simplified MIME type is case-folded to lowercase. + A new keyword parameter, `remove_x_prefix`, can be provided to remove + `x-` prefixes. + + - Improved initialization with an Array works so that extensions do not + need to be wrapped in another array. This means that `%w(text/yaml yaml yml)` works in the same way that `['text/yaml', %w(yaml yml)]` did (and + still does). + + - Changed `priority_compare` to conform with attributes that no longer + exist. + + - Changed the internal implementation of extensions to use a frozen Set. + + - When extensions are set or modified with `add_extensions`, the primary + registry will be informed of a need to reindex extensions. Resolves + [#84]. + + - The preferred extension can be set explicitly. If not set, it will be + the first extension. If the preferred extension is not in the extension + list, it will be added. + + - Improved how xref URLs are generated. + + - Converted `obsolete`, `registered` and `signature` to `attr_accessors`. + + - `MIME::Types` changes: + + - Modified `MIME::Types.new` to track instances of `MIME::Types` so that + they can be told to reindex the extensions as necessary. + + - Removed `data_version` attribute. + + - Changed `#[]` so that the `complete` and `registered` flags are + keywords instead of a generic options parameter. + + - Extracted the class methods to a separate file. + + - Changed the container implementation to use a Set instead of an Array + to prevent data duplication. Resolves [#79]. + + - `MIME::Types::Cache` changes: + + - Caching is now based on the data gem version instead of the mime-types + version. + + - Caching is compatible with columnar registry stores. + + - `MIME::Types::Loader` changes: + + - `MIME::Types::Loader::PATH` has been removed and replaced with + `MIME::Types::Data::PATH` from the mime-types-data gem. The environment + variable `RUBY_MIME_TYPES_DATA` is still used. + + - Support for the long-deprecated mime-types v1 format has been removed. + + - The registry is default loaded from the columnar store by default. The + internal format of the columnar store has changed; many of the boolean + flags are now loaded from a single file. Resolves [#85]. + +[#79]: https://github.com/mime-types/ruby-mime-types/pull/79 +[#84]: https://github.com/mime-types/ruby-mime-types/pull/84 +[#85]: https://github.com/mime-types/ruby-mime-types/pull/85 +[#95]: https://github.com/mime-types/ruby-mime-types/pull/95 +[#97]: https://github.com/mime-types/ruby-mime-types/pull/97 +[#112]: https://github.com/mime-types/ruby-mime-types/pull/112 +[#117]: https://github.com/mime-types/ruby-mime-types/issues/117 +[#118]: https://github.com/mime-types/ruby-mime-types/pull/118 +[#125]: https://github.com/mime-types/ruby-mime-types/pull/125 +[#126]: https://github.com/mime-types/ruby-mime-types/pull/126 +[#127]: https://github.com/mime-types/ruby-mime-types/issues/127 +[#129]: https://github.com/mime-types/ruby-mime-types/pull/129 +[#130]: https://github.com/mime-types/ruby-mime-types/pull/130 +[#127]: https://github.com/mime-types/ruby-mime-types/issues/127 +[#132]: https://github.com/mime-types/ruby-mime-types/pull/132 +[#134]: https://github.com/mime-types/ruby-mime-types/issues/134 +[#135]: https://github.com/mime-types/ruby-mime-types/pull/135 +[#136]: https://github.com/mime-types/ruby-mime-types/issues/136 +[#137]: https://github.com/mime-types/ruby-mime-types/pull/137 +[#139]: https://github.com/mime-types/ruby-mime-types/pull/139 +[#141]: https://github.com/mime-types/ruby-mime-types/pull/141 +[#142]: https://github.com/mime-types/ruby-mime-types/pull/142 +[#146]: https://github.com/mime-types/ruby-mime-types/pull/146 +[#147]: https://github.com/mime-types/ruby-mime-types/pull/147 +[#149]: https://github.com/mime-types/ruby-mime-types/pull/149 +[#150]: https://github.com/mime-types/ruby-mime-types/pull/150 +[#153]: https://github.com/mime-types/ruby-mime-types/pull/153 +[code-of-conduct.md]: Code-of-Conduct_md.html +[contributor covenant]: http://contributor-covenant.org +[mime-types-data]: https://github.com/mime-types/mime-types-data diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Licence.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Licence.md new file mode 100644 index 0000000..d928f71 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Licence.md @@ -0,0 +1,25 @@ +# Licence + +- Copyright 2003–2019 Austin Ziegler and contributors. + +The software in this repository is made available under the MIT license. + +## MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Manifest.txt b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Manifest.txt new file mode 100644 index 0000000..9462df0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Manifest.txt @@ -0,0 +1,31 @@ +Code-of-Conduct.md +Contributing.md +History.md +Licence.md +Manifest.txt +README.rdoc +Rakefile +lib/mime-types.rb +lib/mime/type.rb +lib/mime/type/columnar.rb +lib/mime/types.rb +lib/mime/types/_columnar.rb +lib/mime/types/cache.rb +lib/mime/types/columnar.rb +lib/mime/types/container.rb +lib/mime/types/deprecations.rb +lib/mime/types/full.rb +lib/mime/types/loader.rb +lib/mime/types/logger.rb +lib/mime/types/registry.rb +test/bad-fixtures/malformed +test/fixture/json.json +test/fixture/old-data +test/fixture/yaml.yaml +test/minitest_helper.rb +test/test_mime_type.rb +test/test_mime_types.rb +test/test_mime_types_cache.rb +test/test_mime_types_class.rb +test/test_mime_types_lazy.rb +test/test_mime_types_loader.rb diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/README.rdoc b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/README.rdoc new file mode 100644 index 0000000..1f3dca5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/README.rdoc @@ -0,0 +1,194 @@ += mime-types for Ruby + +home :: https://github.com/mime-types/ruby-mime-types/ +code :: https://github.com/mime-types/ruby-mime-types/ +bugs :: https://github.com/mime-types/ruby-mime-types/issues +rdoc :: http://rdoc.info/gems/mime-types/ +clog :: https://github.com/mime-types/ruby-mime-types/blob/master/History.md +continuous integration :: {Build Status}[https://travis-ci.org/mime-types/ruby-mime-types] +test coverage :: {Coverage Status}[https://coveralls.io/github/mime-types/ruby-mime-types?branch=master] + +== Description + +The mime-types library provides a library and registry for information about +MIME content type definitions. It can be used to determine defined filename +extensions for MIME types, or to use filename extensions to look up the likely +MIME type definitions. + +Version 3.0 is a major release that requires Ruby 2.0 compatibility and removes +deprecated functions. The columnar registry format introduced in 2.6 has been +made the primary format; the registry data has been extracted from this library +and put into {mime-types-data}[https://github.com/mime-types/mime-types-data]. +Additionally, mime-types is now licensed exclusively under the MIT licence and +there is a code of conduct in effect. There are a number of other smaller +changes described in the History file. + +=== About MIME Media Types + +MIME content types are used in MIME-compliant communications, as in e-mail or +HTTP traffic, to indicate the type of content which is transmitted. The +mime-types library provides the ability for detailed information about MIME +entities (provided as an enumerable collection of MIME::Type objects) to be +determined and used. There are many types defined by RFCs and vendors, so the +list is long but by definition incomplete; don't hesitate to add additional +type definitions. MIME type definitions found in mime-types are from RFCs, W3C +recommendations, the {IANA Media Types +registry}[https://www.iana.org/assignments/media-types/media-types.xhtml], and +user contributions. It conforms to RFCs 2045 and 2231. + +=== mime-types 3.x + +Users are encouraged to upgrade to mime-types 3.x as soon as is practical. +mime-types 3.x requires Ruby 2.0 compatibility and a simpler licensing scheme. + +== Synopsis + +MIME types are used in MIME entities, as in email or HTTP traffic. It is useful +at times to have information available about MIME types (or, inversely, about +files). A MIME::Type stores the known information about one MIME type. + + require 'mime/types' + + plaintext = MIME::Types['text/plain'] # => [ text/plain ] + text = plaintext.first + puts text.media_type # => 'text' + puts text.sub_type # => 'plain' + + puts text.extensions.join(' ') # => 'txt asc c cc h hh cpp hpp dat hlp' + puts text.preferred_extension # => 'txt' + puts text.friendly # => 'Text Document' + puts text.i18n_key # => 'text.plain' + + puts text.encoding # => quoted-printable + puts text.default_encoding # => quoted-printable + puts text.binary? # => false + puts text.ascii? # => true + puts text.obsolete? # => false + puts text.registered? # => true + puts text.provisional? # => false + puts text.complete? # => true + + puts text # => 'text/plain' + + puts text == 'text/plain' # => true + puts 'text/plain' == text # => true + puts text == 'text/x-plain' # => false + puts 'text/x-plain' == text # => false + + puts MIME::Type.simplified('x-appl/x-zip') # => 'x-appl/x-zip' + puts MIME::Type.i18n_key('x-appl/x-zip') # => 'x-appl.x-zip' + + puts text.like?('text/x-plain') # => true + puts text.like?(MIME::Type.new('x-text/x-plain')) # => true + + puts text.xrefs.inspect # => { "rfc" => [ "rfc2046", "rfc3676", "rfc5147" ] } + puts text.xref_urls # => [ "http://www.iana.org/go/rfc2046", + # "http://www.iana.org/go/rfc3676", + # "http://www.iana.org/go/rfc5147" ] + + xtext = MIME::Type.new('x-text/x-plain') + puts xtext.media_type # => 'text' + puts xtext.raw_media_type # => 'x-text' + puts xtext.sub_type # => 'plain' + puts xtext.raw_sub_type # => 'x-plain' + puts xtext.complete? # => false + + puts MIME::Types.any? { |type| type.content_type == 'text/plain' } # => true + puts MIME::Types.all?(&:registered?) # => false + + # Various string representations of MIME types + qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP + puts qcelp.content_type # => 'audio/QCELP' + puts qcelp.simplified # => 'audio/qcelp' + + xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz + puts xwingz.content_type # => 'application/x-Wingz' + puts xwingz.simplified # => 'application/x-wingz' + +=== Columnar Store + +mime-types uses as its primary registry storage format a columnar storage +format reducing the default memory footprint. This is done by selectively +loading the data on a per-attribute basis. When the registry is first loaded +from the columnar store, only the canonical MIME content type and known +extensions and the MIME type will be connected to its loading registry. When +other data about the type is required (including +preferred_extension+, +obsolete?, and registered?) that data is loaded from its own +column file for all types in the registry. + +The load of any column data is performed with a Mutex to ensure that types are +updated safely in a multithreaded environment. Benchmarks show that while +columnar data loading is slower than the JSON store, it cuts the memory use by +a third over the JSON store. + +If you prefer to load all the data at once, this can be specified in your +application Gemfile as: + + gem 'mime-types', require: 'mime/types/full' + +Projects that do not use Bundler should +require+ the same: + + require 'mime/types/full' + +Libraries that use mime-types are discouraged from choosing the JSON store. + +For applications and clients that used mime-types 2.6 when the columnar store +was introduced, the require used previously will still work through at least +{version +4}[https://github.com/mime-types/ruby-mime-types/pull/96#issuecomment-100725400] +and possibly beyond; it is effectively an empty operation. You are recommended +to change your Gemfile as soon as is practical. + + require 'mime/types/columnar' + +Note that MIME::Type::Columnar and MIME::Types::Columnar are considered private +variant implementations of MIME::Type and MIME::Types and the specific +implementation should not be relied upon by consumers of the mime-types +library. Instead, depend on the public implementations (MIME::Type and +MIME::Types) only. + +=== Cached Storage + +mime-types supports a cache of MIME types using Marshal.dump. The +cache is invalidated for each version of the mime-types-data gem so that data +version 3.2015.1201 will not be reused with data version 3.2016.0101. If the +environment variable +RUBY_MIME_TYPES_CACHE+ is set to a cache file, mime-types +will attempt to load the MIME type registry from the cache file. If it cannot, +it will load the types normally and then saves the registry to the cache file. + +The caching works with both full stores and columnar stores. Only the data that +has been loaded prior to saving the cache will be stored. + +== mime-types Modified Semantic Versioning + +The mime-types library has one version number, but this single version number +tracks both API changes and registry data changes; this is not wholly +compatible with all aspects of {Semantic Versioning}[http://semver.org/]; +removing a MIME type from the registry *could* be considered a breaking change +under some interpretations of semantic versioning (as lookups for that +particular type would no longer work by default). + +mime-types uses a modified semantic versioning scheme. Given the version +MAJOR.MINOR: + +1. If an incompatible API (code) change is made, the MAJOR version will be + incremented, MINOR will be set to zero, and PATCH will be reset to the + implied zero. + +2. If an API (code) feature is added that does not break compatibility, the + MINOR version will be incremented and PATCH will be reset to the implied zero. + +3. If there is a bugfix to a feature added in the most recent MAJOR.MINOR + release, the implied PATCH value will be incremented resulting in + MAJOR.MINOR.PATCH. + +In practical terms, there will be fewer releases of mime-types focussing on +features because of the existence of the [mime-types-data][] gem, and if +features are marked deprecated in the course of mime-types 3.x, they will not +be removed until mime-types 4.x or possibly later. + +{Code of Conduct}[Code-of-Conduct_md.html] + +{Contributing}[Contributing_md.html] + +{Licence}[Licence_md.html] diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Rakefile b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Rakefile new file mode 100644 index 0000000..712141a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/Rakefile @@ -0,0 +1,270 @@ +# frozen_string_literal: true + +require "rubygems" +require "hoe" +require "rake/clean" + +# This is required until https://github.com/seattlerb/hoe/issues/112 is fixed +class Hoe + def with_config + config = Hoe::DEFAULT_CONFIG + + rc = File.expand_path("~/.hoerc") + homeconfig = load_config(rc) + config = config.merge(homeconfig) + + localconfig = load_config(File.expand_path(File.join(Dir.pwd, ".hoerc"))) + config = config.merge(localconfig) + + yield config, rc + end + + def load_config(name) + File.exist?(name) ? safe_load_yaml(name) : {} + end + + def safe_load_yaml(name) + return safe_load_yaml_file(name) if YAML.respond_to?(:safe_load_file) + + data = IO.binread(name) + YAML.safe_load(data, permitted_classes: [Regexp]) + rescue + YAML.safe_load(data, [Regexp]) + end + + def safe_load_yaml_file(name) + YAML.safe_load_file(name, permitted_classes: [Regexp]) + rescue + YAML.safe_load_file(name, [Regexp]) + end +end + +Hoe.plugin :doofus +Hoe.plugin :gemspec2 +Hoe.plugin :git +Hoe.plugin :minitest +Hoe.plugin :email unless ENV["CI"] + +spec = Hoe.spec "mime-types" do + developer("Austin Ziegler", "halostatue@gmail.com") + self.need_tar = true + + require_ruby_version ">= 2.0" + + self.history_file = "History.md" + self.readme_file = "README.rdoc" + + license "MIT" + + extra_deps << ["mime-types-data", "~> 3.2015"] + + extra_dev_deps << ["hoe-doofus", "~> 1.0"] + extra_dev_deps << ["hoe-gemspec2", "~> 1.1"] + extra_dev_deps << ["hoe-git", "~> 1.6"] + extra_dev_deps << ["hoe-rubygems", "~> 1.0"] + extra_dev_deps << ["standard", "~> 1.0"] + extra_dev_deps << ["minitest", "~> 5.4"] + extra_dev_deps << ["minitest-autotest", "~> 1.0"] + extra_dev_deps << ["minitest-focus", "~> 1.0"] + extra_dev_deps << ["minitest-bonus-assertions", "~> 3.0"] + extra_dev_deps << ["minitest-hooks", "~> 1.4"] + extra_dev_deps << ["rake", ">= 10.0", "< 14.0"] + + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.0") + extra_dev_deps << ["simplecov", "~> 0.7"] + end +end + +namespace :benchmark do + task :support do + %w[lib support].each { |path| + $LOAD_PATH.unshift(File.join(Rake.application.original_dir, path)) + } + end + + desc "Benchmark Load Times" + task :load, [:repeats] => "benchmark:support" do |_, args| + require "benchmarks/load" + Benchmarks::Load.report( + File.join(Rake.application.original_dir, "lib"), + args.repeats + ) + end + + desc "Allocation counts" + task :allocations, [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/load_allocations" + Benchmarks::LoadAllocations.report( + top_x: args.top_x, + mime_types_only: args.mime_types_only + ) + end + + desc "Columnar allocation counts" + task "allocations:columnar", [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/load_allocations" + Benchmarks::LoadAllocations.report( + columnar: true, + top_x: args.top_x, + mime_types_only: args.mime_types_only + ) + end + + desc "Columnar allocation counts (full load)" + task "allocations:columnar:full", [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/load_allocations" + Benchmarks::LoadAllocations.report( + columnar: true, + top_x: args.top_x, + mime_types_only: args.mime_types_only, + full: true + ) + end + + desc "Memory profiler" + task :memory, [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/memory_profiler" + Benchmarks::ProfileMemory.report( + mime_types_only: args.mime_types_only, + top_x: args.top_x + ) + end + + desc "Columnar memory profiler" + task "memory:columnar", [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/memory_profiler" + Benchmarks::ProfileMemory.report( + columnar: true, + mime_types_only: args.mime_types_only, + top_x: args.top_x + ) + end + + desc "Columnar allocation counts (full load)" + task "memory:columnar:full", [:top_x, :mime_types_only] => "benchmark:support" do |_, args| + require "benchmarks/memory_profiler" + Benchmarks::ProfileMemory.report( + columnar: true, + full: true, + top_x: args.top_x, + mime_types_only: args.mime_types_only + ) + end + + desc "Object counts" + task objects: "benchmark:support" do + require "benchmarks/object_counts" + Benchmarks::ObjectCounts.report + end + + desc "Columnar object counts" + task "objects:columnar" => "benchmark:support" do + require "benchmarks/object_counts" + Benchmarks::ObjectCounts.report(columnar: true) + end + + desc "Columnar object counts (full load)" + task "objects:columnar:full" => "benchmark:support" do + require "benchmarks/object_counts" + Benchmarks::ObjectCounts.report(columnar: true, full: true) + end +end + +namespace :profile do + directory "tmp/profile" + + CLEAN.add "tmp" + + def ruby_prof(script) + require "pathname" + output = Pathname("tmp/profile").join(script) + output.mkpath + script = Pathname("support/profile").join("#{script}.rb") + + args = [ + "-W0", + "-Ilib", + "-S", "ruby-prof", + "-R", "mime/types", + "-s", "self", + "-p", "multi", + "-f", output.to_s, + script.to_s + ] + ruby args.join(" ") + end + + task full: "tmp/profile" do + ruby_prof "full" + end + + task columnar: :support do + ruby_prof "columnar" + end + + task "columnar:full" => :support do + ruby_prof "columnar_full" + end +end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.0") + namespace :test do + desc "Run test coverage" + task :coverage do + spec.test_prelude = [ + 'require "simplecov"', + 'SimpleCov.start("test_frameworks") { command_name "Minitest" }', + 'gem "minitest"' + ].join("; ") + Rake::Task["test"].execute + end + end +end + +namespace :convert do + namespace :docs do + task :setup do + gem "rdoc" + require "rdoc/rdoc" + @doc_converter ||= RDoc::Markup::ToMarkdown.new + end + + FileList["*.rdoc"].each do |name| + rdoc = name + mark = "#{File.basename(name, ".rdoc")}.md" + + file mark => [rdoc, :setup] do |t| + puts "#{rdoc} => #{mark}" + File.open(t.name, "wb") { |target| + target.write @doc_converter.convert(IO.read(t.prerequisites.first)) + } + end + + CLEAN.add mark + + task run: [mark] + end + end + + desc "Convert documentation from RDoc to Markdown" + task docs: "convert:docs:run" +end + +namespace :deps do + task :top, [:number] => "benchmark:support" do |_, args| + require "deps" + Deps.run(args) + end +end + +task :console do + arguments = %w[irb] + arguments.push(*spec.spec.require_paths.map { |dir| "-I#{dir}" }) + arguments.push("-r#{spec.spec.name.gsub("-", File::SEPARATOR)}") + unless system(*arguments) + error "Command failed: #{show_command}" + abort + end +end + +# vim: syntax=ruby diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime-types.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime-types.rb new file mode 100644 index 0000000..dcb87cf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime-types.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "mime/types" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type.rb new file mode 100644 index 0000000..db1cb20 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type.rb @@ -0,0 +1,634 @@ +# frozen_string_literal: true + +## +module MIME +end + +# The definition of one MIME content-type. +# +# == Usage +# require 'mime/types' +# +# plaintext = MIME::Types['text/plain'] # => [ text/plain ] +# text = plaintext.first +# puts text.media_type # => 'text' +# puts text.sub_type # => 'plain' +# +# puts text.extensions.join(' ') # => 'txt asc c cc h hh cpp hpp dat hlp' +# puts text.preferred_extension # => 'txt' +# puts text.friendly # => 'Text Document' +# puts text.i18n_key # => 'text.plain' +# +# puts text.encoding # => quoted-printable +# puts text.default_encoding # => quoted-printable +# puts text.binary? # => false +# puts text.ascii? # => true +# puts text.obsolete? # => false +# puts text.registered? # => true +# puts text.provisional? # => false +# puts text.complete? # => true +# +# puts text # => 'text/plain' +# +# puts text == 'text/plain' # => true +# puts 'text/plain' == text # => true +# puts text == 'text/x-plain' # => false +# puts 'text/x-plain' == text # => false +# +# puts MIME::Type.simplified('x-appl/x-zip') # => 'x-appl/x-zip' +# puts MIME::Type.i18n_key('x-appl/x-zip') # => 'x-appl.x-zip' +# +# puts text.like?('text/x-plain') # => true +# puts text.like?(MIME::Type.new('x-text/x-plain')) # => true +# +# puts text.xrefs.inspect # => { "rfc" => [ "rfc2046", "rfc3676", "rfc5147" ] } +# puts text.xref_urls # => [ "http://www.iana.org/go/rfc2046", +# # "http://www.iana.org/go/rfc3676", +# # "http://www.iana.org/go/rfc5147" ] +# +# xtext = MIME::Type.new('x-text/x-plain') +# puts xtext.media_type # => 'text' +# puts xtext.raw_media_type # => 'x-text' +# puts xtext.sub_type # => 'plain' +# puts xtext.raw_sub_type # => 'x-plain' +# puts xtext.complete? # => false +# +# puts MIME::Types.any? { |type| type.content_type == 'text/plain' } # => true +# puts MIME::Types.all?(&:registered?) # => false +# +# # Various string representations of MIME types +# qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP +# puts qcelp.content_type # => 'audio/QCELP' +# puts qcelp.simplified # => 'audio/qcelp' +# +# xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz +# puts xwingz.content_type # => 'application/x-Wingz' +# puts xwingz.simplified # => 'application/x-wingz' +class MIME::Type + # Reflects a MIME content-type specification that is not correctly + # formatted (it isn't +type+/+subtype+). + class InvalidContentType < ArgumentError + # :stopdoc: + def initialize(type_string) + @type_string = type_string + end + + def to_s + "Invalid Content-Type #{@type_string.inspect}" + end + # :startdoc: + end + + # Reflects an unsupported MIME encoding. + class InvalidEncoding < ArgumentError + # :stopdoc: + def initialize(encoding) + @encoding = encoding + end + + def to_s + "Invalid Encoding #{@encoding.inspect}" + end + # :startdoc: + end + + # The released version of the mime-types library. + VERSION = "3.4.1" + + include Comparable + + # :stopdoc: + # TODO verify mime-type character restrictions; I am pretty sure that this is + # too wide open. + MEDIA_TYPE_RE = %r{([-\w.+]+)/([-\w.+]*)}.freeze + I18N_RE = /[^[:alnum:]]/.freeze + BINARY_ENCODINGS = %w[base64 8bit].freeze + ASCII_ENCODINGS = %w[7bit quoted-printable].freeze + # :startdoc: + + private_constant :MEDIA_TYPE_RE, :I18N_RE, :BINARY_ENCODINGS, + :ASCII_ENCODINGS + + # Builds a MIME::Type object from the +content_type+, a MIME Content Type + # value (e.g., 'text/plain' or 'application/x-eruby'). The constructed object + # is yielded to an optional block for additional configuration, such as + # associating extensions and encoding information. + # + # * When provided a Hash or a MIME::Type, the MIME::Type will be + # constructed with #init_with. + # * When provided an Array, the MIME::Type will be constructed using + # the first element as the content type and the remaining flattened + # elements as extensions. + # * Otherwise, the content_type will be used as a string. + # + # Yields the newly constructed +self+ object. + def initialize(content_type) # :yields: self + @friendly = {} + @obsolete = @registered = @provisional = false + @preferred_extension = @docs = @use_instead = nil + self.extensions = [] + + case content_type + when Hash + init_with(content_type) + when Array + self.content_type = content_type.shift + self.extensions = content_type.flatten + when MIME::Type + init_with(content_type.to_h) + else + self.content_type = content_type + end + + self.encoding ||= :default + self.xrefs ||= {} + + yield self if block_given? + end + + # Indicates that a MIME type is like another type. This differs from + # == because x- prefixes are removed for this comparison. + def like?(other) + other = + if other.respond_to?(:simplified) + MIME::Type.simplified(other.simplified, remove_x_prefix: true) + else + MIME::Type.simplified(other.to_s, remove_x_prefix: true) + end + MIME::Type.simplified(simplified, remove_x_prefix: true) == other + end + + # Compares the +other+ MIME::Type against the exact content type or the + # simplified type (the simplified type will be used if comparing against + # something that can be treated as a String with #to_s). In comparisons, this + # is done against the lowercase version of the MIME::Type. + def <=>(other) + if other.nil? + -1 + elsif other.respond_to?(:simplified) + simplified <=> other.simplified + else + filtered = "silent" if other == :silent + filtered ||= "true" if other == true + filtered ||= other.to_s + + simplified <=> MIME::Type.simplified(filtered) + end + end + + # Compares the +other+ MIME::Type based on how reliable it is before doing a + # normal <=> comparison. Used by MIME::Types#[] to sort types. The + # comparisons involved are: + # + # 1. self.simplified <=> other.simplified (ensures that we + # don't try to compare different types) + # 2. IANA-registered definitions < other definitions. + # 3. Complete definitions < incomplete definitions. + # 4. Current definitions < obsolete definitions. + # 5. Obselete with use-instead names < obsolete without. + # 6. Obsolete use-instead definitions are compared. + # + # While this method is public, its use is strongly discouraged by consumers + # of mime-types. In mime-types 3, this method is likely to see substantial + # revision and simplification to ensure current registered content types sort + # before unregistered or obsolete content types. + def priority_compare(other) + pc = simplified <=> other.simplified + if pc.zero? || !(extensions & other.extensions).empty? + pc = + if (reg = registered?) != other.registered? + reg ? -1 : 1 # registered < unregistered + elsif (comp = complete?) != other.complete? + comp ? -1 : 1 # complete < incomplete + elsif (obs = obsolete?) != other.obsolete? + obs ? 1 : -1 # current < obsolete + elsif obs && ((ui = use_instead) != (oui = other.use_instead)) + if ui.nil? + 1 + elsif oui.nil? + -1 + else + ui <=> oui + end + else + 0 + end + end + + pc + end + + # Returns +true+ if the +other+ object is a MIME::Type and the content types + # match. + def eql?(other) + other.is_a?(MIME::Type) && (self == other) + end + + # Returns the whole MIME content-type string. + # + # The content type is a presentation value from the MIME type registry and + # should not be used for comparison. The case of the content type is + # preserved, and extension markers (x-) are kept. + # + # text/plain => text/plain + # x-chemical/x-pdb => x-chemical/x-pdb + # audio/QCELP => audio/QCELP + attr_reader :content_type + # A simplified form of the MIME content-type string, suitable for + # case-insensitive comparison, with the content_type converted to lowercase. + # + # text/plain => text/plain + # x-chemical/x-pdb => x-chemical/x-pdb + # audio/QCELP => audio/qcelp + attr_reader :simplified + # Returns the media type of the simplified MIME::Type. + # + # text/plain => text + # x-chemical/x-pdb => x-chemical + # audio/QCELP => audio + attr_reader :media_type + # Returns the media type of the unmodified MIME::Type. + # + # text/plain => text + # x-chemical/x-pdb => x-chemical + # audio/QCELP => audio + attr_reader :raw_media_type + # Returns the sub-type of the simplified MIME::Type. + # + # text/plain => plain + # x-chemical/x-pdb => pdb + # audio/QCELP => QCELP + attr_reader :sub_type + # Returns the media type of the unmodified MIME::Type. + # + # text/plain => plain + # x-chemical/x-pdb => x-pdb + # audio/QCELP => qcelp + attr_reader :raw_sub_type + + ## + # The list of extensions which are known to be used for this MIME::Type. + # Non-array values will be coerced into an array with #to_a. Array values + # will be flattened, +nil+ values removed, and made unique. + # + # :attr_accessor: extensions + def extensions + @extensions.to_a + end + + ## + def extensions=(value) # :nodoc: + @extensions = Set[*Array(value).flatten.compact].freeze + MIME::Types.send(:reindex_extensions, self) + end + + # Merge the +extensions+ provided into this MIME::Type. The extensions added + # will be merged uniquely. + def add_extensions(*extensions) + self.extensions += extensions + end + + ## + # The preferred extension for this MIME type. If one is not set and there are + # exceptions defined, the first extension will be used. + # + # When setting #preferred_extensions, if #extensions does not contain this + # extension, this will be added to #xtensions. + # + # :attr_accessor: preferred_extension + + ## + def preferred_extension + @preferred_extension || extensions.first + end + + ## + def preferred_extension=(value) # :nodoc: + add_extensions(value) if value + @preferred_extension = value + end + + ## + # The encoding (+7bit+, +8bit+, quoted-printable, or +base64+) + # required to transport the data of this content type safely across a + # network, which roughly corresponds to Content-Transfer-Encoding. A value of + # +nil+ or :default will reset the #encoding to the + # #default_encoding for the MIME::Type. Raises ArgumentError if the encoding + # provided is invalid. + # + # If the encoding is not provided on construction, this will be either + # 'quoted-printable' (for text/* media types) and 'base64' for eveything + # else. + # + # :attr_accessor: encoding + + ## + attr_reader :encoding + + ## + def encoding=(enc) # :nodoc: + if enc.nil? || (enc == :default) + @encoding = default_encoding + elsif BINARY_ENCODINGS.include?(enc) || ASCII_ENCODINGS.include?(enc) + @encoding = enc + else + fail InvalidEncoding, enc + end + end + + # Returns the default encoding for the MIME::Type based on the media type. + def default_encoding + @media_type == "text" ? "quoted-printable" : "base64" + end + + ## + # Returns the media type or types that should be used instead of this media + # type, if it is obsolete. If there is no replacement media type, or it is + # not obsolete, +nil+ will be returned. + # + # :attr_accessor: use_instead + + ## + def use_instead + obsolete? ? @use_instead : nil + end + + ## + attr_writer :use_instead + + # Returns +true+ if the media type is obsolete. + attr_accessor :obsolete + alias_method :obsolete?, :obsolete + + # The documentation for this MIME::Type. + attr_accessor :docs + + # A friendly short description for this MIME::Type. + # + # call-seq: + # text_plain.friendly # => "Text File" + # text_plain.friendly('en') # => "Text File" + def friendly(lang = "en") + @friendly ||= {} + + case lang + when String, Symbol + @friendly[lang.to_s] + when Array + @friendly.update(Hash[*lang]) + when Hash + @friendly.update(lang) + else + fail ArgumentError, + "Expected a language or translation set, not #{lang.inspect}" + end + end + + # A key suitable for use as a lookup key for translations, such as with + # the I18n library. + # + # call-seq: + # text_plain.i18n_key # => "text.plain" + # 3gpp_xml.i18n_key # => "application.vnd-3gpp-bsf-xml" + # # from application/vnd.3gpp.bsf+xml + # x_msword.i18n_key # => "application.word" + # # from application/x-msword + attr_reader :i18n_key + + ## + # The cross-references list for this MIME::Type. + # + # :attr_accessor: xrefs + + ## + attr_reader :xrefs + + ## + def xrefs=(xrefs) # :nodoc: + @xrefs = MIME::Types::Container.new(xrefs) + end + + # The decoded cross-reference URL list for this MIME::Type. + def xref_urls + xrefs.flat_map { |type, values| + name = :"xref_url_for_#{type.tr("-", "_")}" + respond_to?(name, true) && xref_map(values, name) || values.to_a + } + end + + # Indicates whether the MIME type has been registered with IANA. + attr_accessor :registered + alias_method :registered?, :registered + + # Indicates whether the MIME type's registration with IANA is provisional. + attr_accessor :provisional + + # Indicates whether the MIME type's registration with IANA is provisional. + def provisional? + registered? && @provisional + end + + # MIME types can be specified to be sent across a network in particular + # formats. This method returns +true+ when the MIME::Type encoding is set + # to base64. + def binary? + BINARY_ENCODINGS.include?(encoding) + end + + # MIME types can be specified to be sent across a network in particular + # formats. This method returns +false+ when the MIME::Type encoding is + # set to base64. + def ascii? + ASCII_ENCODINGS.include?(encoding) + end + + # Indicateswhether the MIME type is declared as a signature type. + attr_accessor :signature + alias_method :signature?, :signature + + # Returns +true+ if the MIME::Type specifies an extension list, + # indicating that it is a complete MIME::Type. + def complete? + !@extensions.empty? + end + + # Returns the MIME::Type as a string. + def to_s + content_type + end + + # Returns the MIME::Type as a string for implicit conversions. This allows + # MIME::Type objects to appear on either side of a comparison. + # + # 'text/plain' == MIME::Type.new('text/plain') + def to_str + content_type + end + + # Converts the MIME::Type to a JSON string. + def to_json(*args) + require "json" + to_h.to_json(*args) + end + + # Converts the MIME::Type to a hash. The output of this method can also be + # used to initialize a MIME::Type. + def to_h + encode_with({}) + end + + # Populates the +coder+ with attributes about this record for + # serialization. The structure of +coder+ should match the structure used + # with #init_with. + # + # This method should be considered a private implementation detail. + def encode_with(coder) + coder["content-type"] = @content_type + coder["docs"] = @docs unless @docs.nil? || @docs.empty? + coder["friendly"] = @friendly unless @friendly.nil? || @friendly.empty? + coder["encoding"] = @encoding + coder["extensions"] = @extensions.to_a unless @extensions.empty? + coder["preferred-extension"] = @preferred_extension if @preferred_extension + if obsolete? + coder["obsolete"] = obsolete? + coder["use-instead"] = use_instead if use_instead + end + unless xrefs.empty? + {}.tap do |hash| + xrefs.each do |k, v| + hash[k] = v.to_a.sort + end + coder["xrefs"] = hash + end + end + coder["registered"] = registered? + coder["provisional"] = provisional? if provisional? + coder["signature"] = signature? if signature? + coder + end + + # Initialize an empty object from +coder+, which must contain the + # attributes necessary for initializing an empty object. + # + # This method should be considered a private implementation detail. + def init_with(coder) + self.content_type = coder["content-type"] + self.docs = coder["docs"] || "" + self.encoding = coder["encoding"] + self.extensions = coder["extensions"] || [] + self.preferred_extension = coder["preferred-extension"] + self.obsolete = coder["obsolete"] || false + self.registered = coder["registered"] || false + self.provisional = coder["provisional"] || false + self.signature = coder["signature"] + self.xrefs = coder["xrefs"] || {} + self.use_instead = coder["use-instead"] + + friendly(coder["friendly"] || {}) + end + + def inspect # :nodoc: + # We are intentionally lying here because MIME::Type::Columnar is an + # implementation detail. + "#" + end + + class << self + # MIME media types are case-insensitive, but are typically presented in a + # case-preserving format in the type registry. This method converts + # +content_type+ to lowercase. + # + # In previous versions of mime-types, this would also remove any extension + # prefix (x-). This is no longer default behaviour, but may be + # provided by providing a truth value to +remove_x_prefix+. + def simplified(content_type, remove_x_prefix: false) + simplify_matchdata(match(content_type), remove_x_prefix) + end + + # Converts a provided +content_type+ into a translation key suitable for + # use with the I18n library. + def i18n_key(content_type) + simplify_matchdata(match(content_type), joiner: ".") { |e| + e.gsub!(I18N_RE, "-") + } + end + + # Return a +MatchData+ object of the +content_type+ against pattern of + # media types. + def match(content_type) + case content_type + when MatchData + content_type + else + MEDIA_TYPE_RE.match(content_type) + end + end + + private + + def simplify_matchdata(matchdata, remove_x = false, joiner: "/") + return nil unless matchdata + + matchdata.captures.map { |e| + e.downcase! + e.sub!(/^x-/, "") if remove_x + yield e if block_given? + e + }.join(joiner) + end + end + + private + + def content_type=(type_string) + match = MEDIA_TYPE_RE.match(type_string) + fail InvalidContentType, type_string if match.nil? + + @content_type = intern_string(type_string) + @raw_media_type, @raw_sub_type = match.captures + @simplified = intern_string(MIME::Type.simplified(match)) + @i18n_key = intern_string(MIME::Type.i18n_key(match)) + @media_type, @sub_type = MEDIA_TYPE_RE.match(@simplified).captures + + @raw_media_type = intern_string(@raw_media_type) + @raw_sub_type = intern_string(@raw_sub_type) + @media_type = intern_string(@media_type) + @sub_type = intern_string(@sub_type) + end + + if String.method_defined?(:-@) + def intern_string(string) + -string + end + else + # MRI 2.2 and older don't have a method for string interning, + # so we simply freeze them for keeping a similar interface + def intern_string(string) + string.freeze + end + end + + def xref_map(values, helper) + values.map { |value| send(helper, value) } + end + + def xref_url_for_rfc(value) + "http://www.iana.org/go/%s" % value + end + + def xref_url_for_draft(value) + "http://www.iana.org/go/%s" % value.sub(/\ARFC/, "draft") + end + + def xref_url_for_rfc_errata(value) + "http://www.rfc-editor.org/errata_search.php?eid=%s" % value + end + + def xref_url_for_person(value) + "http://www.iana.org/assignments/media-types/media-types.xhtml#%s" % value + end + + def xref_url_for_template(value) + "http://www.iana.org/assignments/media-types/%s" % value + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type/columnar.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type/columnar.rb new file mode 100644 index 0000000..1b7c3ca --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/type/columnar.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require "mime/type" + +# A version of MIME::Type that works hand-in-hand with a MIME::Types::Columnar +# container to load data by columns. +# +# When a field is has not yet been loaded, that data will be loaded for all +# types in the container before forwarding the message to MIME::Type. +# +# More information can be found in MIME::Types::Columnar. +# +# MIME::Type::Columnar is *not* intended to be created except by +# MIME::Types::Columnar containers. +class MIME::Type::Columnar < MIME::Type + def initialize(container, content_type, extensions) # :nodoc: + @container = container + self.content_type = content_type + self.extensions = extensions + end + + def self.column(*methods, file: nil) # :nodoc: + file ||= methods.first + + file_method = :"load_#{file}" + methods.each do |m| + define_method m do |*args| + @container.send(file_method) + super(*args) + end + end + end + + column :friendly + column :encoding, :encoding= + column :docs, :docs= + column :preferred_extension, :preferred_extension= + column :obsolete, :obsolete=, :obsolete?, :registered, :registered=, :registered?, :signature, :signature=, + :signature?, :provisional, :provisional=, :provisional?, file: "flags" + column :xrefs, :xrefs=, :xref_urls + column :use_instead, :use_instead= + + def encode_with(coder) # :nodoc: + @container.send(:load_friendly) + @container.send(:load_encoding) + @container.send(:load_docs) + @container.send(:load_flags) + @container.send(:load_use_instead) + @container.send(:load_xrefs) + @container.send(:load_preferred_extension) + super + end + + class << self + undef column + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types.rb new file mode 100644 index 0000000..31692ca --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +## +module MIME + ## + class Types + end +end + +require "mime/type" + +# MIME::Types is a registry of MIME types. It is both a class (created with +# MIME::Types.new) and a default registry (loaded automatically or through +# interactions with MIME::Types.[] and MIME::Types.type_for). +# +# == The Default mime-types Registry +# +# The default mime-types registry is loaded automatically when the library +# is required (require 'mime/types'), but it may be lazily loaded +# (loaded on first use) with the use of the environment variable +# +RUBY_MIME_TYPES_LAZY_LOAD+ having any value other than +false+. The +# initial startup is about 14× faster (~10 ms vs ~140 ms), but the +# registry will be loaded at some point in the future. +# +# The default mime-types registry can also be loaded from a Marshal cache +# file specific to the version of MIME::Types being loaded. This will be +# handled automatically with the use of a file referred to in the +# environment variable +RUBY_MIME_TYPES_CACHE+. MIME::Types will attempt to +# load the registry from this cache file (MIME::Type::Cache.load); if it +# cannot be loaded (because the file does not exist, there is an error, or +# the data is for a different version of mime-types), the default registry +# will be loaded from the normal JSON version and then the cache file will +# be *written* to the location indicated by +RUBY_MIME_TYPES_CACHE+. Cache +# file loads just over 4½× faster (~30 ms vs ~140 ms). +# loads. +# +# Notes: +# * The loading of the default registry is *not* atomic; when using a +# multi-threaded environment, it is recommended that lazy loading is not +# used and mime-types is loaded as early as possible. +# * Cache files should be specified per application in a multiprocess +# environment and should be initialized during deployment or before +# forking to minimize the chance that the multiple processes will be +# trying to write to the same cache file at the same time, or that two +# applications that are on different versions of mime-types would be +# thrashing the cache. +# * Unless cache files are preinitialized, the application using the +# mime-types cache file must have read/write permission to the cache file. +# +# == Usage +# require 'mime/types' +# +# plaintext = MIME::Types['text/plain'] +# print plaintext.media_type # => 'text' +# print plaintext.sub_type # => 'plain' +# +# puts plaintext.extensions.join(" ") # => 'asc txt c cc h hh cpp' +# +# puts plaintext.encoding # => 8bit +# puts plaintext.binary? # => false +# puts plaintext.ascii? # => true +# puts plaintext.obsolete? # => false +# puts plaintext.registered? # => true +# puts plaintext.provisional? # => false +# puts plaintext == 'text/plain' # => true +# puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip' +# +class MIME::Types + # The release version of Ruby MIME::Types + VERSION = MIME::Type::VERSION + + include Enumerable + + # Creates a new MIME::Types registry. + def initialize + @type_variants = Container.new + @extension_index = Container.new + end + + # Returns the number of known type variants. + def count + @type_variants.values.inject(0) { |a, e| a + e.size } + end + + def inspect # :nodoc: + "#<#{self.class}: #{count} variants, #{@extension_index.count} extensions>" + end + + # Iterates through the type variants. + def each + if block_given? + @type_variants.each_value { |tv| tv.each { |t| yield t } } + else + enum_for(:each) + end + end + + @__types__ = nil + + # Returns a list of MIME::Type objects, which may be empty. The optional + # flag parameters are :complete (finds only complete MIME::Type + # objects) and :registered (finds only MIME::Types that are + # registered). It is possible for multiple matches to be returned for + # either type (in the example below, 'text/plain' returns two values -- + # one for the general case, and one for VMS systems). + # + # puts "\nMIME::Types['text/plain']" + # MIME::Types['text/plain'].each { |t| puts t.to_a.join(", ") } + # + # puts "\nMIME::Types[/^image/, complete: true]" + # MIME::Types[/^image/, :complete => true].each do |t| + # puts t.to_a.join(", ") + # end + # + # If multiple type definitions are returned, returns them sorted as + # follows: + # 1. Complete definitions sort before incomplete ones; + # 2. IANA-registered definitions sort before LTSW-recorded + # definitions. + # 3. Current definitions sort before obsolete ones; + # 4. Obsolete definitions with use-instead clauses sort before those + # without; + # 5. Obsolete definitions use-instead clauses are compared. + # 6. Sort on name. + def [](type_id, complete: false, registered: false) + matches = + case type_id + when MIME::Type + @type_variants[type_id.simplified] + when Regexp + match(type_id) + else + @type_variants[MIME::Type.simplified(type_id)] + end + + prune_matches(matches, complete, registered).sort { |a, b| + a.priority_compare(b) + } + end + + # Return the list of MIME::Types which belongs to the file based on its + # filename extension. If there is no extension, the filename will be used + # as the matching criteria on its own. + # + # This will always return a merged, flatten, priority sorted, unique array. + # + # puts MIME::Types.type_for('citydesk.xml') + # => [application/xml, text/xml] + # puts MIME::Types.type_for('citydesk.gif') + # => [image/gif] + # puts MIME::Types.type_for(%w(citydesk.xml citydesk.gif)) + # => [application/xml, image/gif, text/xml] + def type_for(filename) + Array(filename).flat_map { |fn| + @extension_index[fn.chomp.downcase[/\.?([^.]*?)$/, 1]] + }.compact.inject(Set.new, :+).sort { |a, b| + a.priority_compare(b) + } + end + alias_method :of, :type_for + + # Add one or more MIME::Type objects to the set of known types. If the + # type is already known, a warning will be displayed. + # + # The last parameter may be the value :silent or +true+ which + # will suppress duplicate MIME type warnings. + def add(*types) + quiet = ((types.last == :silent) || (types.last == true)) + + types.each do |mime_type| + case mime_type + when true, false, nil, Symbol + nil + when MIME::Types + variants = mime_type.instance_variable_get(:@type_variants) + add(*variants.values.inject(Set.new, :+).to_a, quiet) + when Array + add(*mime_type, quiet) + else + add_type(mime_type, quiet) + end + end + end + + # Add a single MIME::Type object to the set of known types. If the +type+ is + # already known, a warning will be displayed. The +quiet+ parameter may be a + # truthy value to suppress that warning. + def add_type(type, quiet = false) + if !quiet && @type_variants[type.simplified].include?(type) + MIME::Types.logger.warn <<-WARNING.chomp.strip + Type #{type} is already registered as a variant of #{type.simplified}. + WARNING + end + + add_type_variant!(type) + index_extensions!(type) + end + + private + + def add_type_variant!(mime_type) + @type_variants.add(mime_type.simplified, mime_type) + end + + def reindex_extensions!(mime_type) + return unless @type_variants[mime_type.simplified].include?(mime_type) + + index_extensions!(mime_type) + end + + def index_extensions!(mime_type) + mime_type.extensions.each { |ext| @extension_index.add(ext, mime_type) } + end + + def prune_matches(matches, complete, registered) + matches.delete_if { |e| !e.complete? } if complete + matches.delete_if { |e| !e.registered? } if registered + matches + end + + def match(pattern) + @type_variants.select { |k, _| + k =~ pattern + }.values.inject(Set.new, :+) + end +end + +require "mime/types/cache" +require "mime/types/container" +require "mime/types/loader" +require "mime/types/logger" +require "mime/types/_columnar" +require "mime/types/registry" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/_columnar.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/_columnar.rb new file mode 100644 index 0000000..9f8c132 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/_columnar.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +require "mime/type/columnar" + +# MIME::Types::Columnar is used to extend a MIME::Types container to load data +# by columns instead of from JSON or YAML. Column loads of MIME types loaded +# through the columnar store are synchronized with a Mutex. +# +# MIME::Types::Columnar is not intended to be used directly, but will be added +# to an instance of MIME::Types when it is loaded with +# MIME::Types::Loader#load_columnar. +module MIME::Types::Columnar + LOAD_MUTEX = Mutex.new # :nodoc: + + def self.extended(obj) # :nodoc: + super + obj.instance_variable_set(:@__mime_data__, []) + obj.instance_variable_set(:@__files__, Set.new) + end + + # Load the first column data file (type and extensions). + def load_base_data(path) # :nodoc: + @__root__ = path + + each_file_line("content_type", false) do |line| + line = line.split + content_type = line.shift + extensions = line + # content_type, *extensions = line.split + + type = MIME::Type::Columnar.new(self, content_type, extensions) + @__mime_data__ << type + add(type) + end + + self + end + + private + + def each_file_line(name, lookup = true) + LOAD_MUTEX.synchronize do + next if @__files__.include?(name) + + i = -1 + column = File.join(@__root__, "mime.#{name}.column") + + IO.readlines(column, encoding: "UTF-8").each do |line| + line.chomp! + + if lookup + (type = @__mime_data__[i += 1]) || next + yield type, line + else + yield line + end + end + + @__files__ << name + end + end + + def load_encoding + each_file_line("encoding") do |type, line| + pool ||= {} + type.instance_variable_set(:@encoding, (pool[line] ||= line)) + end + end + + def load_docs + each_file_line("docs") do |type, line| + type.instance_variable_set(:@docs, opt(line)) + end + end + + def load_preferred_extension + each_file_line("pext") do |type, line| + type.instance_variable_set(:@preferred_extension, opt(line)) + end + end + + def load_flags + each_file_line("flags") do |type, line| + line = line.split + type.instance_variable_set(:@obsolete, flag(line.shift)) + type.instance_variable_set(:@registered, flag(line.shift)) + type.instance_variable_set(:@signature, flag(line.shift)) + type.instance_variable_set(:@provisional, flag(line.shift)) + end + end + + def load_xrefs + each_file_line("xrefs") { |type, line| + type.instance_variable_set(:@xrefs, dict(line, array: true)) + } + end + + def load_friendly + each_file_line("friendly") { |type, line| + type.instance_variable_set(:@friendly, dict(line)) + } + end + + def load_use_instead + each_file_line("use_instead") do |type, line| + type.instance_variable_set(:@use_instead, opt(line)) + end + end + + def dict(line, array: false) + if line == "-" + {} + else + line.split("|").each_with_object({}) { |l, h| + k, v = l.split("^") + v = nil if v.empty? + h[k] = array ? Array(v) : v + } + end + end + + def arr(line) + if line == "-" + [] + else + line.split("|").flatten.compact.uniq + end + end + + def opt(line) + line unless line == "-" + end + + def flag(line) + line == "1" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/cache.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/cache.rb new file mode 100644 index 0000000..71d488e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/cache.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +MIME::Types::Cache = Struct.new(:version, :data) # :nodoc: + +# Caching of MIME::Types registries is advisable if you will be loading +# the default registry relatively frequently. With the class methods on +# MIME::Types::Cache, any MIME::Types registry can be marshaled quickly +# and easily. +# +# The cache is invalidated on a per-data-version basis; a cache file for +# version 3.2015.1118 will not be reused with version 3.2015.1201. +class << MIME::Types::Cache + # Attempts to load the cache from the file provided as a parameter or in + # the environment variable +RUBY_MIME_TYPES_CACHE+. Returns +nil+ if the + # file does not exist, if the file cannot be loaded, or if the data in + # the cache version is different than this version. + def load(cache_file = nil) + cache_file ||= ENV["RUBY_MIME_TYPES_CACHE"] + return nil unless cache_file && File.exist?(cache_file) + + cache = Marshal.load(File.binread(cache_file)) + if cache.version == MIME::Types::Data::VERSION + Marshal.load(cache.data) + else + MIME::Types.logger.warn <<-WARNING.chomp.strip + Could not load MIME::Types cache: invalid version + WARNING + nil + end + rescue => e + MIME::Types.logger.warn <<-WARNING.chomp.strip + Could not load MIME::Types cache: #{e} + WARNING + nil + end + + # Attempts to save the types provided to the cache file provided. + # + # If +types+ is not provided or is +nil+, the cache will contain the + # current MIME::Types default registry. + # + # If +cache_file+ is not provided or is +nil+, the cache will be written + # to the file specified in the environment variable + # +RUBY_MIME_TYPES_CACHE+. If there is no cache file specified either + # directly or through the environment, this method will return +nil+ + def save(types = nil, cache_file = nil) + cache_file ||= ENV["RUBY_MIME_TYPES_CACHE"] + return nil unless cache_file + + types ||= MIME::Types.send(:__types__) + + File.open(cache_file, "wb") do |f| + f.write( + Marshal.dump(new(MIME::Types::Data::VERSION, Marshal.dump(types))) + ) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/columnar.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/columnar.rb new file mode 100644 index 0000000..dcb87cf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/columnar.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "mime/types" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/container.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/container.rb new file mode 100644 index 0000000..441debe --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/container.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +require "set" +require "forwardable" + +# MIME::Types requires a serializable keyed container that returns an empty Set +# on a key miss. Hash#default_value cannot be used because, while it traverses +# the Marshal format correctly, it won't survive any other serialization +# format (plus, a default of a mutable object resuls in a shared mess). +# Hash#default_proc cannot be used without a wrapper because it prevents +# Marshal serialization (and doesn't survive the round-trip). +class MIME::Types::Container # :nodoc: + extend Forwardable + + def initialize(hash = {}) + @container = {} + merge!(hash) + end + + def [](key) + container[key] || EMPTY_SET + end + + def []=(key, value) + container[key] = + case value + when Set + value + else + Set[*value] + end + end + + def merge(other) + self.class.new(other) + end + + def merge!(other) + tap { + other = other.is_a?(MIME::Types::Container) ? other.container : other + container.merge!(other) + normalize + } + end + + def to_hash + container + end + + def_delegators :@container, + :==, + :count, + :each, + :each_value, + :empty?, + :flat_map, + :keys, + :select, + :values + + def add(key, value) + (container[key] ||= Set.new).add(value) + end + + def marshal_dump + {}.merge(container) + end + + def marshal_load(hash) + @container = hash + end + + def encode_with(coder) + container.each { |k, v| coder[k] = v.to_a } + end + + def init_with(coder) + @container = {} + coder.map.each { |k, v| container[k] = Set[*v] } + end + + protected + + attr_accessor :container + + def normalize + container.each do |k, v| + next if v.is_a?(Set) + + container[k] = Set[*v] + end + end + + EMPTY_SET = Set.new.freeze + private_constant :EMPTY_SET +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/deprecations.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/deprecations.rb new file mode 100644 index 0000000..3c64977 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/deprecations.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require "mime/types/logger" + +# The namespace for MIME applications, tools, and libraries. +module MIME + ## + class Types + # Used to mark a method as deprecated in the mime-types interface. + def self.deprecated(klass, sym, message = nil, &block) # :nodoc: + level = + case klass + when Class, Module + "." + else + klass = klass.class + "#" + end + message = + case message + when :private, :protected + "and will be #{message}" + when nil + "and will be removed" + else + message + end + MIME::Types.logger.warn <<-WARNING.chomp.strip + #{caller(2..2).first}: #{klass}#{level}#{sym} is deprecated #{message}. + WARNING + + return unless block + block.call + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/full.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/full.rb new file mode 100644 index 0000000..a69e6bd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/full.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +## +module MIME + ## + class Types + unless private_method_defined?(:load_mode) + class << self + private + + def load_mode + {columnar: false} + end + end + end + end +end + +require "mime/types" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/loader.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/loader.rb new file mode 100644 index 0000000..d6450c5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/loader.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +## +module MIME; end + +## +class MIME::Types; end + +require "mime/types/data" + +# This class is responsible for initializing the MIME::Types registry from +# the data files supplied with the mime-types library. +# +# The Loader will use one of the following paths: +# 1. The +path+ provided in its constructor argument; +# 2. The value of ENV['RUBY_MIME_TYPES_DATA']; or +# 3. The value of MIME::Types::Data::PATH. +# +# When #load is called, the +path+ will be searched recursively for all YAML +# (.yml or .yaml) files. By convention, there is one file for each media +# type (application.yml, audio.yml, etc.), but this is not required. +class MIME::Types::Loader + # The path that will be read for the MIME::Types files. + attr_reader :path + # The MIME::Types container instance that will be loaded. If not provided + # at initialization, a new MIME::Types instance will be constructed. + attr_reader :container + + # Creates a Loader object that can be used to load MIME::Types registries + # into memory, using YAML, JSON, or Columnar registry format loaders. + def initialize(path = nil, container = nil) + path = path || ENV["RUBY_MIME_TYPES_DATA"] || MIME::Types::Data::PATH + @container = container || MIME::Types.new + @path = File.expand_path(path) + end + + # Loads a MIME::Types registry from YAML files (*.yml or + # *.yaml) recursively found in +path+. + # + # It is expected that the YAML objects contained within the registry array + # will be tagged as !ruby/object:MIME::Type. + # + # Note that the YAML format is about 2½ times *slower* than the JSON format. + # + # NOTE: The purpose of this format is purely for maintenance reasons. + def load_yaml + Dir[yaml_path].sort.each do |f| + container.add(*self.class.load_from_yaml(f), :silent) + end + container + end + + # Loads a MIME::Types registry from JSON files (*.json) + # recursively found in +path+. + # + # It is expected that the JSON objects will be an array of hash objects. + # The JSON format is the registry format for the MIME types registry + # shipped with the mime-types library. + def load_json + Dir[json_path].sort.each do |f| + types = self.class.load_from_json(f) + container.add(*types, :silent) + end + container + end + + # Loads a MIME::Types registry from columnar files recursively found in + # +path+. + def load_columnar + require "mime/types/columnar" unless defined?(MIME::Types::Columnar) + container.extend(MIME::Types::Columnar) + container.load_base_data(path) + + container + end + + # Loads a MIME::Types registry. Loads from JSON files by default + # (#load_json). + # + # This will load from columnar files (#load_columnar) if columnar: + # true is provided in +options+ and there are columnar files in +path+. + def load(options = {columnar: false}) + if options[:columnar] && !Dir[columnar_path].empty? + load_columnar + else + load_json + end + end + + class << self + # Loads the default MIME::Type registry. + def load(options = {columnar: false}) + new.load(options) + end + + # Loads MIME::Types from a single YAML file. + # + # It is expected that the YAML objects contained within the registry + # array will be tagged as !ruby/object:MIME::Type. + # + # Note that the YAML format is about 2½ times *slower* than the JSON + # format. + # + # NOTE: The purpose of this format is purely for maintenance reasons. + def load_from_yaml(filename) + begin + require "psych" + rescue LoadError + nil + end + + require "yaml" + + if old_yaml? + YAML.safe_load(read_file(filename), [MIME::Type]) + else + YAML.safe_load(read_file(filename), permitted_classes: [MIME::Type]) + end + end + + # Loads MIME::Types from a single JSON file. + # + # It is expected that the JSON objects will be an array of hash objects. + # The JSON format is the registry format for the MIME types registry + # shipped with the mime-types library. + def load_from_json(filename) + require "json" + JSON.parse(read_file(filename)).map { |type| MIME::Type.new(type) } + end + + private + + def read_file(filename) + File.open(filename, "r:UTF-8:-", &:read) + end + + def old_yaml? + @old_yaml ||= + begin + require "rubygems/version" + Gem::Version.new(YAML::VERSION) < Gem::Version.new("3.1") + end + end + end + + private + + def yaml_path + File.join(path, "*.y{,a}ml") + end + + def json_path + File.join(path, "*.json") + end + + def columnar_path + File.join(path, "*.column") + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb new file mode 100644 index 0000000..894f47c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require "logger" + +## +module MIME + ## + class Types + class << self + # Configure the MIME::Types logger. This defaults to an instance of a + # logger that passes messages (unformatted) through to Kernel#warn. + attr_accessor :logger + end + + class WarnLogger < ::Logger # :nodoc: + class WarnLogDevice < ::Logger::LogDevice # :nodoc: + def initialize(*) + end + + def write(m) + Kernel.warn(m) + end + + def close + end + end + + def initialize(_one, _two = nil, _three = nil) + super nil + @logdev = WarnLogDevice.new + @formatter = ->(_s, _d, _p, m) { m } + end + end + + self.logger = WarnLogger.new(nil) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/registry.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/registry.rb new file mode 100644 index 0000000..e557a5c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/registry.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +class << MIME::Types + include Enumerable + + ## + def new(*) # :nodoc: + super.tap do |types| + __instances__.add types + end + end + + # MIME::Types#[] against the default MIME::Types registry. + def [](type_id, complete: false, registered: false) + __types__[type_id, complete: complete, registered: registered] + end + + # MIME::Types#count against the default MIME::Types registry. + def count + __types__.count + end + + # MIME::Types#each against the default MIME::Types registry. + def each + if block_given? + __types__.each { |t| yield t } + else + enum_for(:each) + end + end + + # MIME::Types#type_for against the default MIME::Types registry. + def type_for(filename) + __types__.type_for(filename) + end + alias_method :of, :type_for + + # MIME::Types#add against the default MIME::Types registry. + def add(*types) + __types__.add(*types) + end + + private + + def lazy_load? + return unless ENV.key?("RUBY_MIME_TYPES_LAZY_LOAD") + + MIME::Types.logger.warn <<-WARNING.chomp.strip + Lazy loading ($RUBY_MIME_TYPES_LAZY_LOAD) is deprecated and will be removed. + WARNING + + (lazy = ENV["RUBY_MIME_TYPES_LAZY_LOAD"]) && (lazy != "false") + end + + def __types__ + (defined?(@__types__) && @__types__) || load_default_mime_types + end + + unless private_method_defined?(:load_mode) + def load_mode + {columnar: true} + end + end + + def load_default_mime_types(mode = load_mode) + if (@__types__ = MIME::Types::Cache.load) + __instances__.add(@__types__) + else + @__types__ = MIME::Types::Loader.load(mode) + MIME::Types::Cache.save(@__types__) + end + @__types__ + end + + def __instances__ + @__instances__ ||= Set.new + end + + def reindex_extensions(type) + __instances__.each do |instance| + instance.send(:reindex_extensions!, type) + end + true + end +end + +## +class MIME::Types + load_default_mime_types(load_mode) unless lazy_load? +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/bad-fixtures/malformed b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/bad-fixtures/malformed new file mode 100644 index 0000000..2c716d4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/bad-fixtures/malformed @@ -0,0 +1,9 @@ +!application.smil @smi,smil :8bit 'IANA,RFC4536 =use-instead:application/smil+xml +!audio/vnd.qcelp @qcp 'IANA,RFC3625 =use-instead:audio/QCELP +*!image/bmp @bmp =use-instead:image/x-bmp +*application/acad 'LTSW +*audio/webm @webm '{WebM=http://www.webmproject.org/code/specs/container/} +*image/pjpeg :base64 =Fixes a bug with IE6 and progressive JPEGs +application/1d-interleaved-parityfec 'IANA,RFC6015 +audio/1d-interleaved-parityfec 'IANA,RFC6015 +mac:application/x-apple-diskimage @dmg diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/json.json b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/json.json new file mode 100644 index 0000000..4c65663 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/json.json @@ -0,0 +1 @@ +[{"content-type":"application/smil","encoding":"8bit","extensions":["smi","smil"],"obsolete":true,"use-instead":"application/smil+xml","registered":true},{"content-type":"audio/vnd.qcelp","encoding":"base64","extensions":["qcp"],"obsolete":true,"use-instead":"audio/QCELP","registered":true},{"content-type":"image/bmp","encoding":"base64","extensions":["bmp"],"obsolete":true,"use-instead":"image/x-bmp","registered":false},{"content-type":"application/acad","encoding":"base64","registered":false},{"content-type":"audio/webm","encoding":"base64","extensions":["webm"],"registered":false},{"content-type":"image/pjpeg","docs":"Fixes a bug with IE6 and progressive JPEGs","encoding":"base64","registered":false},{"content-type":"application/1d-interleaved-parityfec","encoding":"base64","registered":true},{"content-type":"audio/1d-interleaved-parityfec","encoding":"base64","registered":true},{"content-type":"application/x-apple-diskimage","encoding":"base64","extensions":["dmg"],"registered":false}] diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/old-data b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/old-data new file mode 100644 index 0000000..0905137 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/old-data @@ -0,0 +1,9 @@ +!application/smil @smi,smil :8bit 'IANA,RFC4536 =use-instead:application/smil+xml +!audio/vnd.qcelp @qcp 'IANA,RFC3625 =use-instead:audio/QCELP +*!image/bmp @bmp =use-instead:image/x-bmp +*application/acad 'LTSW +*audio/webm @webm '{WebM=http://www.webmproject.org/code/specs/container/} +*image/pjpeg :base64 =Fixes a bug with IE6 and progressive JPEGs +application/1d-interleaved-parityfec 'IANA,RFC6015 +audio/1d-interleaved-parityfec 'IANA,RFC6015 +mac:application/x-apple-diskimage @dmg diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/yaml.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/yaml.yaml new file mode 100644 index 0000000..6e72bbf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/fixture/yaml.yaml @@ -0,0 +1,55 @@ +--- +- !ruby/object:MIME::Type + content-type: application/smil + encoding: 8bit + extensions: + - smi + - smil + obsolete: true + use-instead: application/smil+xml + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.qcelp + encoding: base64 + extensions: + - qcp + obsolete: true + use-instead: audio/QCELP + registered: true +- !ruby/object:MIME::Type + content-type: image/bmp + encoding: base64 + extensions: + - bmp + obsolete: true + use-instead: image/x-bmp + registered: false +- !ruby/object:MIME::Type + content-type: application/acad + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: audio/webm + encoding: base64 + extensions: + - webm + registered: false +- !ruby/object:MIME::Type + content-type: image/pjpeg + docs: Fixes a bug with IE6 and progressive JPEGs + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/1d-interleaved-parityfec + encoding: base64 + registered: true +- !ruby/object:MIME::Type + content-type: audio/1d-interleaved-parityfec + encoding: base64 + registered: true +- !ruby/object:MIME::Type + content-type: application/x-apple-diskimage + encoding: base64 + extensions: + - dmg + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/minitest_helper.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/minitest_helper.rb new file mode 100644 index 0000000..44973e3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/minitest_helper.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require "mime/type" +require "fileutils" + +gem "minitest" +require "minitest/focus" +require "minitest-bonus-assertions" +require "minitest/hooks" + +ENV["RUBY_MIME_TYPES_LAZY_LOAD"] = "yes" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_type.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_type.rb new file mode 100644 index 0000000..5ef4aeb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_type.rb @@ -0,0 +1,621 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +describe MIME::Type do + def mime_type(content_type) + MIME::Type.new(content_type) { |mt| yield mt if block_given? } + end + + let(:x_appl_x_zip) { + mime_type("x-appl/x-zip") { |t| t.extensions = %w[zip zp] } + } + let(:text_plain) { mime_type("text/plain") } + let(:text_html) { mime_type("text/html") } + let(:image_jpeg) { mime_type("image/jpeg") } + let(:application_javascript) { + mime_type("application/javascript") do |js| + js.friendly("en" => "JavaScript") + js.xrefs = { + "rfc" => %w[rfc4239 rfc4239], + "template" => %w[application/javascript] + } + js.encoding = "8bit" + js.extensions = %w[js sj] + js.registered = true + end + } + let(:text_x_yaml) { + mime_type("text/x-yaml") do |yaml| + yaml.extensions = %w[yaml yml] + yaml.encoding = "8bit" + yaml.friendly("en" => "YAML Structured Document") + end + } + let(:text_x_yaml_with_docs) { + text_x_yaml.dup.tap do |yaml| + yaml.docs = "Test YAML" + end + } + + describe ".simplified" do + it "leaves normal types alone" do + assert_equal "text/plain", MIME::Type.simplified("text/plain") + end + + it "does not remove x- prefixes by default" do + assert_equal "application/x-msword", + MIME::Type.simplified("application/x-msword") + assert_equal "x-xyz/abc", MIME::Type.simplified("x-xyz/abc") + end + + it "removes x- prefixes when requested" do + assert_equal "application/msword", + MIME::Type.simplified("application/x-msword", remove_x_prefix: true) + assert_equal "xyz/abc", + MIME::Type.simplified("x-xyz/abc", remove_x_prefix: true) + end + + it "lowercases mixed-case types" do + assert_equal "text/vcard", MIME::Type.simplified("text/vCard") + end + + it "returns nil when the value provided is not a valid content type" do + assert_nil MIME::Type.simplified("text") + end + end + + describe ".i18n_key" do + it "converts text/plain to text.plain" do + assert_equal "text.plain", MIME::Type.i18n_key("text/plain") + end + + it "does not remove x-prefixes" do + assert_equal "application.x-msword", + MIME::Type.i18n_key("application/x-msword") + end + + it "converts text/vCard to text.vcard" do + assert_equal "text.vcard", MIME::Type.i18n_key("text/vCard") + end + + it "returns nil when the value provided is not a valid content type" do + assert_nil MIME::Type.i18n_key("text") + end + end + + describe ".new" do + it "fails if an invalid content type is provided" do + exception = assert_raises MIME::Type::InvalidContentType do + MIME::Type.new("apps") + end + assert_equal 'Invalid Content-Type "apps"', exception.to_s + end + + it "creates a valid content type just from a string" do + type = MIME::Type.new("text/x-yaml") + + assert_instance_of MIME::Type, type + assert_equal "text/x-yaml", type.content_type + end + + it "yields the content type in a block" do + MIME::Type.new("text/x-yaml") do |type| + assert_instance_of MIME::Type, type + assert_equal "text/x-yaml", type.content_type + end + end + + it "creates a valid content type from a hash" do + type = MIME::Type.new( + "content-type" => "text/x-yaml", + "obsolete" => true + ) + assert_instance_of MIME::Type, type + assert_equal "text/x-yaml", type.content_type + assert type.obsolete? + end + + it "creates a valid content type from an array" do + type = MIME::Type.new(%w[text/x-yaml yaml yml yz]) + assert_instance_of MIME::Type, type + assert_equal "text/x-yaml", type.content_type + assert_equal %w[yaml yml yz], type.extensions + end + end + + describe "#like?" do + it "compares two MIME::Types on #simplified values without x- prefixes" do + assert text_plain.like?(text_plain) + refute text_plain.like?(text_html) + end + + it "compares MIME::Type against string without x- prefixes" do + assert text_plain.like?(text_plain.to_s) + refute text_plain.like?(text_html.to_s) + end + end + + describe "#<=>" do + it "correctly compares identical types" do + assert_equal text_plain, text_plain + end + + it "correctly compares equivalent types" do + right = mime_type("text/Plain") + refute_same text_plain, right + assert_equal text_plain, right + end + + it "correctly compares types that sort earlier" do + refute_equal text_html, text_plain + assert_operator text_html, :<, text_plain + end + + it "correctly compares types that sort later" do + refute_equal text_plain, text_html + assert_operator text_plain, :>, text_html + end + + it "correctly compares types against equivalent strings" do + assert_equal text_plain, "text/plain" + end + + it "correctly compares types against strings that sort earlier" do + refute_equal text_html, "text/plain" + assert_operator text_html, :<, "text/plain" + end + + it "correctly compares types against strings that sort later" do + refute_equal text_plain, "text/html" + assert_operator text_plain, :>, "text/html" + end + + it "correctly compares against nil" do + refute_equal text_html, nil + assert_operator text_plain, :<, nil + end + end + + describe "#ascii?" do + it "defaults to true for text/* types" do + assert text_plain.ascii? + end + + it "defaults to false for non-text/* types" do + refute image_jpeg.ascii? + end + end + + describe "#binary?" do + it "defaults to false for text/* types" do + refute text_plain.binary? + end + + it "defaults to true for non-text/* types" do + assert image_jpeg.binary? + end + end + + describe "#complete?" do + it "is true when there are extensions" do + assert text_x_yaml.complete? + end + + it "is false when there are no extensions" do + refute mime_type("text/plain").complete? + end + end + + describe "#content_type" do + it "preserves the original case" do + assert_equal "text/plain", text_plain.content_type + assert_equal "text/vCard", mime_type("text/vCard").content_type + end + + it "does not remove x- prefixes" do + assert_equal "x-appl/x-zip", x_appl_x_zip.content_type + end + end + + describe "#default_encoding" do + it "is quoted-printable for text/* types" do + assert_equal "quoted-printable", text_plain.default_encoding + end + + it "is base64 for non-text/* types" do + assert_equal "base64", image_jpeg.default_encoding + end + end + + describe "#encoding, #encoding=" do + it "returns #default_encoding if not set explicitly" do + assert_equal "quoted-printable", text_plain.encoding + assert_equal "base64", image_jpeg.encoding + end + + it "returns the set value when set" do + text_plain.encoding = "8bit" + assert_equal "8bit", text_plain.encoding + end + + it "resets to the default encoding when set to nil or :default" do + text_plain.encoding = "8bit" + text_plain.encoding = nil + assert_equal text_plain.default_encoding, text_plain.encoding + text_plain.encoding = :default + assert_equal text_plain.default_encoding, text_plain.encoding + end + + it "raises a MIME::Type::InvalidEncoding for an invalid encoding" do + exception = assert_raises MIME::Type::InvalidEncoding do + text_plain.encoding = "binary" + end + assert_equal 'Invalid Encoding "binary"', exception.to_s + end + end + + describe "#eql?" do + it "is not true for a non-MIME::Type" do + refute text_plain.eql?("text/plain") + end + + it "is not true for a different MIME::Type" do + refute text_plain.eql?(image_jpeg) + end + + it "is true for an equivalent MIME::Type" do + assert text_plain, mime_type("text/Plain") + end + end + + describe "#extensions, #extensions=" do + it "returns an array of extensions" do + assert_equal %w[yaml yml], text_x_yaml.extensions + assert_equal %w[zip zp], x_appl_x_zip.extensions + end + + it "sets a single extension when provided a single value" do + text_x_yaml.extensions = "yaml" + assert_equal %w[yaml], text_x_yaml.extensions + end + + it "deduplicates extensions" do + text_x_yaml.extensions = %w[yaml yaml] + assert_equal %w[yaml], text_x_yaml.extensions + end + end + + describe "#add_extensions" do + it "does not modify extensions when provided nil" do + text_x_yaml.add_extensions(nil) + assert_equal %w[yaml yml], text_x_yaml.extensions + end + + it "remains deduplicated with duplicate values" do + text_x_yaml.add_extensions("yaml") + assert_equal %w[yaml yml], text_x_yaml.extensions + text_x_yaml.add_extensions(%w[yaml yz]) + assert_equal %w[yaml yml yz], text_x_yaml.extensions + end + end + + describe "#priority_compare" do + def assert_priority_less(left, right) + assert_equal(-1, left.priority_compare(right)) + end + + def assert_priority_same(left, right) + assert_equal 0, left.priority_compare(right) + end + + def assert_priority_more(left, right) + assert_equal 1, left.priority_compare(right) + end + + def assert_priority(left, middle, right) + assert_priority_less left, right + assert_priority_same left, middle + assert_priority_more right, left + end + + let(:text_1) { mime_type("text/1") } + let(:text_1p) { mime_type("text/1") } + let(:text_2) { mime_type("text/2") } + + it "sorts (1) based on the simplified type" do + assert_priority text_1, text_1p, text_2 + end + + it "sorts (2) based on extensions" do + text_1.extensions = ["foo", "bar"] + text_2.extensions = ["foo"] + + assert_priority_same text_1, text_2 + + text_2.registered = true + + assert_priority_more text_1, text_2 + end + + it "sorts (3) based on the registration state" do + text_1.registered = text_1p.registered = true + text_1b = mime_type(text_1) { |t| t.registered = false } + + assert_priority text_1, text_1p, text_1b + end + + it "sorts (4) based on the completeness" do + text_1.extensions = text_1p.extensions = "1" + text_1b = mime_type(text_1) { |t| t.extensions = nil } + + assert_priority text_1, text_1p, text_1b + end + + it "sorts (5) based on obsolete status" do + text_1.obsolete = text_1p.obsolete = false + text_1b = mime_type(text_1) { |t| t.obsolete = true } + + assert_priority text_1, text_1p, text_1b + end + + it "sorts (5) based on the use-instead value" do + text_1.obsolete = text_1p.obsolete = true + text_1.use_instead = text_1p.use_instead = "abc/xyz" + text_1b = mime_type(text_1) { |t| t.use_instead = nil } + + assert_priority text_1, text_1p, text_1b + + text_1b.use_instead = "abc/zzz" + + assert_priority text_1, text_1p, text_1b + end + end + + describe "#raw_media_type" do + it "extracts the media type as case-preserved" do + assert_equal "Text", mime_type("Text/plain").raw_media_type + end + + it "does not remove x- prefixes" do + assert_equal("x-appl", x_appl_x_zip.raw_media_type) + end + end + + describe "#media_type" do + it "extracts the media type as lowercase" do + assert_equal "text", text_plain.media_type + end + + it "does not remove x- prefixes" do + assert_equal("x-appl", x_appl_x_zip.media_type) + end + end + + describe "#raw_media_type" do + it "extracts the media type as case-preserved" do + assert_equal "Text", mime_type("Text/plain").raw_media_type + end + + it "does not remove x- prefixes" do + assert_equal("x-appl", x_appl_x_zip.raw_media_type) + end + end + + describe "#sub_type" do + it "extracts the sub type as lowercase" do + assert_equal "plain", text_plain.sub_type + end + + it "does not remove x- prefixes" do + assert_equal("x-zip", x_appl_x_zip.sub_type) + end + end + + describe "#raw_sub_type" do + it "extracts the sub type as case-preserved" do + assert_equal "Plain", mime_type("text/Plain").raw_sub_type + end + + it "does not remove x- prefixes" do + assert_equal("x-zip", x_appl_x_zip.raw_sub_type) + end + end + + describe "#to_h" do + let(:t) { mime_type("a/b") } + + it "has the required keys (content-type, registered, encoding)" do + assert_has_keys t.to_h, %w[content-type registered encoding] + end + + it "has the docs key if there are documents" do + assert_has_keys mime_type(t) { |v| v.docs = "a" }.to_h, %w[docs] + end + + it "has the extensions key if set" do + assert_has_keys mime_type(t) { |v| v.extensions = "a" }.to_h, + "extensions" + end + + it "has the preferred-extension key if set" do + assert_has_keys mime_type(t) { |v| v.preferred_extension = "a" }.to_h, + "preferred-extension" + end + + it "has the obsolete key if set" do + assert_has_keys mime_type(t) { |v| v.obsolete = true }.to_h, "obsolete" + end + + it "has the obsolete and use-instead keys if set" do + assert_has_keys mime_type(t) { |v| + v.obsolete = true + v.use_instead = "c/d" + }.to_h, %w[obsolete use-instead] + end + + it "has the signature key if set" do + assert_has_keys mime_type(t) { |v| v.signature = true }.to_h, "signature" + end + end + + describe "#to_json" do + let(:expected_1) { + '{"content-type":"a/b","encoding":"base64","registered":false}' + } + let(:expected_2) { + '{"content-type":"a/b","encoding":"base64","registered":true,"provisional":true}' + } + + it "converts to JSON when requested" do + assert_equal expected_1, mime_type("a/b").to_json + end + + it "converts to JSON with provisional when requested" do + type = mime_type("a/b") do |t| + t.registered = true + t.provisional = true + end + assert_equal expected_2, type.to_json + end + end + + describe "#to_s, #to_str" do + it "represents itself as a string of the canonical content_type" do + assert_equal "text/plain", text_plain.to_s + end + + it "acts like a string of the canonical content_type for comparison" do + assert_equal text_plain, "text/plain" + end + + it "acts like a string for other purposes" do + assert_equal "stringy", "text/plain".sub(text_plain, "stringy") + end + end + + describe "#xrefs, #xrefs=" do + let(:expected) { + MIME::Types::Container.new("rfc" => Set["rfc1234", "rfc5678"]) + } + + it "returns the expected results" do + application_javascript.xrefs = { + "rfc" => %w[rfc5678 rfc1234 rfc1234] + } + + assert_equal expected, application_javascript.xrefs + end + end + + describe "#xref_urls" do + let(:expected) { + [ + "http://www.iana.org/go/draft1", + "http://www.iana.org/assignments/media-types/a/b", + "http://www.iana.org/assignments/media-types/media-types.xhtml#p-1", + "http://www.iana.org/go/rfc-1", + "http://www.rfc-editor.org/errata_search.php?eid=err-1", + "http://example.org", + "text" + ] + } + + let(:type) { + mime_type("a/b").tap do |t| + t.xrefs = { + "draft" => ["RFC1"], + "template" => ["a/b"], + "person" => ["p-1"], + "rfc" => ["rfc-1"], + "rfc-errata" => ["err-1"], + "uri" => ["http://example.org"], + "text" => ["text"] + } + end + } + + it "translates according to given rules" do + assert_equal expected, type.xref_urls + end + end + + describe "#use_instead" do + it "is nil unless the type is obsolete" do + assert_nil text_plain.use_instead + end + + it "is nil if not set and the type is obsolete" do + text_plain.obsolete = true + assert_nil text_plain.use_instead + end + + it "is a different type if set and the type is obsolete" do + text_plain.obsolete = true + text_plain.use_instead = "text/html" + assert_equal "text/html", text_plain.use_instead + end + end + + describe "#preferred_extension, #preferred_extension=" do + it "is nil when not set and there are no extensions" do + assert_nil text_plain.preferred_extension + end + + it "is the first extension when not set but there are extensions" do + assert_equal "yaml", text_x_yaml.preferred_extension + end + + it "is the extension provided when set" do + text_x_yaml.preferred_extension = "yml" + assert_equal "yml", text_x_yaml.preferred_extension + end + + it "is adds the preferred extension if it does not exist" do + text_x_yaml.preferred_extension = "yz" + assert_equal "yz", text_x_yaml.preferred_extension + assert_includes text_x_yaml.extensions, "yz" + end + end + + describe "#friendly" do + it "returns English by default" do + assert_equal "YAML Structured Document", text_x_yaml.friendly + end + + it "returns English when requested" do + assert_equal "YAML Structured Document", text_x_yaml.friendly("en") + assert_equal "YAML Structured Document", text_x_yaml.friendly(:en) + end + + it "returns nothing for an unknown language" do + assert_nil text_x_yaml.friendly("zz") + end + + it "merges new values from an array parameter" do + expected = {"en" => "Text files"} + assert_equal expected, text_plain.friendly(["en", "Text files"]) + expected.update("fr" => "des fichiers texte") + assert_equal expected, + text_plain.friendly(["fr", "des fichiers texte"]) + end + + it "merges new values from a hash parameter" do + expected = {"en" => "Text files"} + assert_equal expected, text_plain.friendly(expected) + french = {"fr" => "des fichiers texte"} + expected.update(french) + assert_equal expected, text_plain.friendly(french) + end + + it "raises an ArgumentError if an unknown value is provided" do + exception = assert_raises ArgumentError do + text_plain.friendly(1) + end + + assert_equal "Expected a language or translation set, not 1", + exception.message + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types.rb new file mode 100644 index 0000000..b01b702 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +describe MIME::Types do + def mime_types + @mime_types ||= MIME::Types.new.tap { |mt| + mt.add MIME::Type.new(["text/plain", %w[txt]]), + MIME::Type.new(["image/jpeg", %w[jpg jpeg]]), + MIME::Type.new("application/x-wordperfect6.1"), + MIME::Type.new( + "content-type" => "application/x-www-form-urlencoded", + "registered" => true + ), + MIME::Type.new(["application/x-gzip", %w[gz]]), + MIME::Type.new( + "content-type" => "application/gzip", + "extensions" => "gz", + "registered" => true + ) + } + end + + describe "is enumerable" do + it "correctly uses an Enumerable method like #any?" do + assert(mime_types.any? { |type| type.content_type == "text/plain" }) + end + + it "implements each with no parameters to return an Enumerator" do + assert_kind_of Enumerator, mime_types.each + assert_kind_of Enumerator, mime_types.map + end + + it "will create a lazy enumerator" do + assert_kind_of Enumerator::Lazy, mime_types.lazy + assert_kind_of Enumerator::Lazy, mime_types.map.lazy + end + + it "is countable with an enumerator" do + assert_equal 6, mime_types.each.count + assert_equal 6, mime_types.lazy.count + end + end + + describe "#[]" do + it "can be searched with a MIME::Type" do + text_plain = MIME::Type.new("text/plain") + assert_includes mime_types[text_plain], "text/plain" + assert_equal 1, mime_types[text_plain].size + end + + it "can be searched with a regular expression" do + assert_includes mime_types[/plain$/], "text/plain" + assert_equal 1, mime_types[/plain$/].size + end + + it "sorts by priority with multiple matches" do + assert_equal %w[application/gzip application/x-gzip], mime_types[/gzip$/] + assert_equal 2, mime_types[/gzip$/].size + end + + it "can be searched with a string" do + assert_includes mime_types["text/plain"], "text/plain" + assert_equal 1, mime_types["text/plain"].size + end + + it "can be searched with the complete flag" do + assert_empty mime_types[ + "application/x-www-form-urlencoded", + complete: true + ] + assert_includes mime_types["text/plain", complete: true], "text/plain" + assert_equal 1, mime_types["text/plain", complete: true].size + end + + it "can be searched with the registered flag" do + assert_empty mime_types["application/x-wordperfect6.1", registered: true] + refute_empty mime_types[ + "application/x-www-form-urlencoded", + registered: true + ] + refute_empty mime_types[/gzip/, registered: true] + refute_equal mime_types[/gzip/], mime_types[/gzip/, registered: true] + end + + it "properly returns an empty result on a regular expression miss" do + assert_empty mime_types[/^foo/] + assert_empty mime_types[/^foo/, registered: true] + assert_empty mime_types[/^foo/, complete: true] + end + end + + describe "#add" do + let(:eruby) { MIME::Type.new("application/x-eruby") } + let(:jinja) { MIME::Type.new("application/jinja2") } + + it "successfully adds a new type" do + mime_types.add(eruby) + assert_equal mime_types["application/x-eruby"], [eruby] + end + + it "complains about adding a duplicate type" do + mime_types.add(eruby) + assert_output "", /is already registered as a variant/ do + mime_types.add(eruby) + end + assert_equal mime_types["application/x-eruby"], [eruby] + end + + it "does not complain about adding a duplicate type when quiet" do + mime_types.add(eruby) + assert_output "", "" do + mime_types.add(eruby, :silent) + end + assert_equal mime_types["application/x-eruby"], [eruby] + end + + it "successfully adds from an array" do + mime_types.add([eruby, jinja]) + assert_equal mime_types["application/x-eruby"], [eruby] + assert_equal mime_types["application/jinja2"], [jinja] + end + + it "successfully adds from another MIME::Types" do + mt = MIME::Types.new + mt.add(mime_types) + assert_equal mime_types.count, mt.count + + mime_types.each do |type| + assert_equal mt[type.content_type], [type] + end + end + end + + describe "#type_for" do + it "finds all types for a given extension" do + assert_equal %w[application/gzip application/x-gzip], + mime_types.type_for("gz") + end + + it "separates the extension from filenames" do + assert_equal %w[image/jpeg], mime_types.of(["foo.jpeg", "bar.jpeg"]) + end + + it "finds multiple extensions" do + assert_equal %w[image/jpeg text/plain], + mime_types.type_for(%w[foo.txt foo.jpeg]) + end + + it "does not find unknown extensions" do + keys = mime_types.instance_variable_get(:@extension_index).keys + assert_empty mime_types.type_for("zzz") + assert_equal keys, mime_types.instance_variable_get(:@extension_index).keys + end + + it "modifying type extensions causes reindexing" do + plain_text = mime_types["text/plain"].first + plain_text.add_extensions("xtxt") + assert_includes mime_types.type_for("xtxt"), "text/plain" + end + end + + describe "#count" do + it "can count the number of types inside" do + assert_equal 6, mime_types.count + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_cache.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_cache.rb new file mode 100644 index 0000000..909f18c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_cache.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +MUTEX = Mutex.new + +describe MIME::Types::Cache do + include Minitest::Hooks + + def around + require "fileutils" + + MUTEX.synchronize do + @cache_file = File.expand_path("../cache.tst", __FILE__) + ENV["RUBY_MIME_TYPES_CACHE"] = @cache_file + clear_cache_file + + super + + clear_cache_file + ENV.delete("RUBY_MIME_TYPES_CACHE") + end + end + + def reset_mime_types + MIME::Types.instance_variable_set(:@__types__, nil) + MIME::Types.send(:load_default_mime_types) + end + + def clear_cache_file + FileUtils.rm @cache_file if File.exist? @cache_file + end + + describe ".load" do + it "does not use cache when RUBY_MIME_TYPES_CACHE is unset" do + ENV.delete("RUBY_MIME_TYPES_CACHE") + assert_nil MIME::Types::Cache.load + end + + it "does not use cache when missing" do + assert_nil MIME::Types::Cache.load + end + + it "registers the data to be updated by #add_extensions" do + MIME::Types::Cache.save + reset_mime_types + assert_equal([], MIME::Types.type_for("foo.additional")) + html = MIME::Types["text/html"][0] + html.add_extensions("additional") + assert_equal([html], MIME::Types.type_for("foo.additional")) + end + + it "outputs an error when there is an invalid version" do + v = MIME::Types::Data::VERSION + MIME::Types::Data.send(:remove_const, :VERSION) + MIME::Types::Data.const_set(:VERSION, "0.0") + MIME::Types::Cache.save + MIME::Types::Data.send(:remove_const, :VERSION) + MIME::Types::Data.const_set(:VERSION, v) + MIME::Types.instance_variable_set(:@__types__, nil) + assert_output "", /MIME::Types cache: invalid version/ do + MIME::Types["text/html"] + end + end + + it "outputs an error when there is a marshal file incompatibility" do + MIME::Types::Cache.save + data = File.binread(@cache_file).reverse + File.open(@cache_file, "wb") { |f| f.write(data) } + MIME::Types.instance_variable_set(:@__types__, nil) + assert_output "", /incompatible marshal file format/ do + MIME::Types["text/html"] + end + end + end + + describe ".save" do + it "does not create cache when RUBY_MIME_TYPES_CACHE is unset" do + ENV.delete("RUBY_MIME_TYPES_CACHE") + assert_nil MIME::Types::Cache.save + end + + it "creates the cache " do + assert_equal(false, File.exist?(@cache_file)) + MIME::Types::Cache.save + assert_equal(true, File.exist?(@cache_file)) + end + + it "uses the cache" do + MIME::Types["text/html"].first.add_extensions("hex") + MIME::Types::Cache.save + MIME::Types.instance_variable_set(:@__types__, nil) + + assert_includes MIME::Types["text/html"].first.extensions, "hex" + + reset_mime_types + end + end +end + +describe MIME::Types::Container do + it "marshals and unmarshals correctly" do + container = MIME::Types::Container.new + container.add("xyz", "abc") + + # default proc should return Set[] + assert_equal(Set[], container["abc"]) + assert_equal(Set["abc"], container["xyz"]) + + marshalled = Marshal.dump(container) + loaded_container = Marshal.load(marshalled) + + # default proc should still return Set[] + assert_equal(Set[], loaded_container["abc"]) + assert_equal(Set["abc"], container["xyz"]) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_class.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_class.rb new file mode 100644 index 0000000..b47bca2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_class.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +describe MIME::Types, "registry" do + def setup + MIME::Types.send(:load_default_mime_types) + end + + describe "is enumerable" do + it "correctly uses an Enumerable method like #any?" do + assert(MIME::Types.any? { |type| type.content_type == "text/plain" }) + end + + it "implements each with no parameters to return an Enumerator" do + assert_kind_of Enumerator, MIME::Types.each + assert_kind_of Enumerator, MIME::Types.map + end + + it "will create a lazy enumerator" do + assert_kind_of Enumerator::Lazy, MIME::Types.lazy + assert_kind_of Enumerator::Lazy, MIME::Types.map.lazy + end + + it "is countable with an enumerator" do + assert MIME::Types.each.count > 999 + assert MIME::Types.lazy.count > 999 + end + end + + describe ".[]" do + it "can be searched with a MIME::Type" do + text_plain = MIME::Type.new("text/plain") + assert_includes MIME::Types[text_plain], "text/plain" + assert_equal 1, MIME::Types[text_plain].size + end + + it "can be searched with a regular expression" do + assert_includes MIME::Types[/plain$/], "text/plain" + assert_equal 1, MIME::Types[/plain$/].size + end + + it "sorts by priority with multiple matches" do + types = MIME::Types[/gzip$/].select { |t| + %w[application/gzip application/x-gzip multipart/x-gzip].include?(t) + } + # This is this way because of a new type ending with gzip that only + # appears in some data files. + assert_equal %w[application/gzip application/x-gzip multipart/x-gzip], types + assert_equal 3, types.size + end + + it "can be searched with a string" do + assert_includes MIME::Types["text/plain"], "text/plain" + assert_equal 1, MIME::Types["text/plain"].size + end + + it "can be searched with the complete flag" do + assert_empty MIME::Types[ + "application/x-www-form-urlencoded", + complete: true + ] + assert_includes MIME::Types["text/plain", complete: true], "text/plain" + assert_equal 1, MIME::Types["text/plain", complete: true].size + end + + it "can be searched with the registered flag" do + assert_empty MIME::Types["application/x-wordperfect6.1", registered: true] + refute_empty MIME::Types[ + "application/x-www-form-urlencoded", + registered: true + ] + refute_empty MIME::Types[/gzip/, registered: true] + refute_equal MIME::Types[/gzip/], MIME::Types[/gzip/, registered: true] + end + end + + describe ".type_for" do + it "finds all types for a given extension" do + assert_equal %w[application/gzip application/x-gzip], + MIME::Types.type_for("gz") + end + + it "separates the extension from filenames" do + assert_equal %w[image/jpeg], MIME::Types.of(["foo.jpeg", "bar.jpeg"]) + end + + it "finds multiple extensions" do + assert_equal %w[image/jpeg text/plain], + MIME::Types.type_for(%w[foo.txt foo.jpeg]) + end + + it "does not find unknown extensions" do + assert_empty MIME::Types.type_for("zzz") + end + + it "modifying type extensions causes reindexing" do + plain_text = MIME::Types["text/plain"].first + plain_text.add_extensions("xtxt") + assert_includes MIME::Types.type_for("xtxt"), "text/plain" + end + end + + describe ".count" do + it "can count the number of types inside" do + assert MIME::Types.count > 999 + end + end + + describe ".add" do + def setup + MIME::Types.instance_variable_set(:@__types__, nil) + MIME::Types.send(:load_default_mime_types) + end + + let(:eruby) { MIME::Type.new("application/x-eruby") } + let(:jinja) { MIME::Type.new("application/jinja2") } + + it "successfully adds a new type" do + MIME::Types.add(eruby) + assert_equal MIME::Types["application/x-eruby"], [eruby] + end + + it "complains about adding a duplicate type" do + MIME::Types.add(eruby) + assert_output "", /is already registered as a variant/ do + MIME::Types.add(eruby) + end + assert_equal MIME::Types["application/x-eruby"], [eruby] + end + + it "does not complain about adding a duplicate type when quiet" do + MIME::Types.add(eruby) + assert_silent do + MIME::Types.add(eruby, :silent) + end + assert_equal MIME::Types["application/x-eruby"], [eruby] + end + + it "successfully adds from an array" do + MIME::Types.add([eruby, jinja]) + assert_equal MIME::Types["application/x-eruby"], [eruby] + assert_equal MIME::Types["application/jinja2"], [jinja] + end + + it "successfully adds from another MIME::Types" do + old_count = MIME::Types.count + + mt = MIME::Types.new + mt.add(eruby) + + MIME::Types.add(mt) + assert_equal old_count + 1, MIME::Types.count + + assert_equal MIME::Types[eruby.content_type], [eruby] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_lazy.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_lazy.rb new file mode 100644 index 0000000..04f81f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_lazy.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +describe MIME::Types, "lazy loading" do + def setup + ENV["RUBY_MIME_TYPES_LAZY_LOAD"] = "true" + end + + def teardown + reset_mime_types + ENV.delete("RUBY_MIME_TYPES_LAZY_LOAD") + end + + def reset_mime_types + MIME::Types.instance_variable_set(:@__types__, nil) + MIME::Types.send(:load_default_mime_types) + end + + describe ".lazy_load?" do + it "is true when RUBY_MIME_TYPES_LAZY_LOAD is set" do + assert_output "", /RUBY_MIME_TYPES_LAZY_LOAD/ do + assert_equal true, MIME::Types.send(:lazy_load?) + end + end + + it "is nil when RUBY_MIME_TYPES_LAZY_LOAD is unset" do + ENV["RUBY_MIME_TYPES_LAZY_LOAD"] = nil + assert_output "", "" do + assert_nil MIME::Types.send(:lazy_load?) + end + end + + it "is false when RUBY_MIME_TYPES_LAZY_LOAD is false" do + ENV["RUBY_MIME_TYPES_LAZY_LOAD"] = "false" + assert_output "", /RUBY_MIME_TYPES_LAZY_LOAD/ do + assert_equal false, MIME::Types.send(:lazy_load?) + end + end + end + + it "loads lazily when RUBY_MIME_TYPES_LAZY_LOAD is set" do + MIME::Types.instance_variable_set(:@__types__, nil) + assert_nil MIME::Types.instance_variable_get(:@__types__) + refute_nil MIME::Types["text/html"].first + refute_nil MIME::Types.instance_variable_get(:@__types__) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_loader.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_loader.rb new file mode 100644 index 0000000..af5d851 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/test/test_mime_types_loader.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require "mime/types" +require "minitest_helper" + +describe MIME::Types::Loader do + def setup + @path = File.expand_path("../fixture", __FILE__) + @loader = MIME::Types::Loader.new(@path) + @bad_path = File.expand_path("../bad-fixtures", __FILE__) + end + + def assert_correctly_loaded(types) + assert_includes(types, "application/1d-interleaved-parityfec") + assert_equal(%w[webm], types["audio/webm"].first.extensions) + refute(types["audio/webm"].first.registered?) + + assert_equal("Fixes a bug with IE6 and progressive JPEGs", + types["image/pjpeg"].first.docs) + + assert(types["audio/vnd.qcelp"].first.obsolete?) + assert_equal("audio/QCELP", types["audio/vnd.qcelp"].first.use_instead) + end + + it "loads YAML files correctly" do + assert_correctly_loaded @loader.load_yaml + end + + it "loads JSON files correctly" do + assert_correctly_loaded @loader.load_json + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Code-of-Conduct.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Code-of-Conduct.md new file mode 100644 index 0000000..725c341 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Code-of-Conduct.md @@ -0,0 +1,75 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, nationality, personal appearance, race, religion, or sexual identity +and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an +incident. Further details of specific enforcement policies may be posted +separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Contributing.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Contributing.md new file mode 100644 index 0000000..7a39e8f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Contributing.md @@ -0,0 +1,241 @@ +## Contributing + +Contributions to mime-types-data is encouraged in any form: a bug report, new +MIME type definitions, or additional code to help manage the MIME types. As with +many of my projects, I have a few suggestions for improving the chance of +acceptance of your code contributions: + +- The support files are written in Ruby and should remain in the coding style + that already exists, and I use hoe for releasing the mime-types-data RubyGem. +- Use a thoughtfully-named topic branch that contains your change. Rebase your + commits into logical chunks as necessary. +- Use [quality commit messages][qcm]. +- Do not change the version number; when your patch is accepted and a release + is made, the version will be updated at that point. +- Submit a GitHub pull request with your changes. +- New or changed behaviours require new or updated documentation. + +Although mime-types-data was extracted from the [Ruby mime-types][rmt] gem and +the support files are written in Ruby, the _target_ of mime-types-data is any +implementation that wishes to use the data as a MIME types registry, so I am +particularly interested in tools that will create a mime-types-data package for +other languages. + +### Adding or Modifying MIME Types + +The Ruby mime-types gem loads its data from files encoded in the `data` +directory in this gem by loading `mime-types-data` and reading +MIME::Types::Data::PATH. These files are compiled files from the collection of +data in the `types` directory. Pull requests that include changes to these files +will require amendment to revert these files. + +New or modified MIME types should be edited in the appropriate YAML file under +`types`. The format is as shown below for the `application/xml` MIME type in +`types/application.yml`. + +```yaml +- !ruby/object:MIME::Type + content-type: application/xml + encoding: 8bit + extensions: + - xml + - xsl + references: + - IANA + - RFC3023 + xrefs: + rfc: + - rfc3023 + registered: true +``` + +There are other fields that can be added, matching the fields discussed in the +documentation for MIME::Type. Pull requests for MIME types should just contain +the changes to the YAML files for the new or modified MIME types; I will convert +the YAML files to JSON prior to a new release. I would rather not have to verify +that the JSON matches the YAML changes, which is why it is not necessary to +convert for the pull request. + +If you are making a change for a private fork, use `rake convert:yaml:json` to +convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the +new columnar format. + +#### Updating Types from the IANA or Apache Lists + +If you are maintaining a private fork and wish to update your copy of the MIME +types registry used by this gem, you can do this with the rake tasks: + +```sh +$ rake mime:iana +$ rake mime:apache +``` + +##### A Note on Provisional Types + +The file `types/provisional-standard-types.yaml` contains the provisionally +registered types from IANA. Per IANA, + +> This registry, unlike some other provisional IANA registries, is only for +> temporary use. Entries in this registry are either finalized and moved to the +> main media types registry or are abandoned and deleted. Entries in this +> registry are suitable for use for development and test purposes only. + +The provisional types file is rewritten when updated, so pull requests to +manually promote or customize provisional types (such as with extensions). It is +recommended that any updates required to the data be performed in your +application if you require provisional types. + +### Development Dependencies + +mime-types-data uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to +manage the release process, and it adds a number of rake tasks. You will mostly +be interested in: + +```sh +$ rake +``` + +which runs the tests the same way that: + +```sh +$ rake test +$ rake travis +``` + +will do. + +To assist with the installation of the development dependencies for +mime-types-data, I have provided the simplest possible Gemfile pointing to the +(generated) `mime-types-data.gemspec` file. This will permit you to do: + +```sh +$ bundle install +``` + +to get the development dependencies. If you aleady have `hoe` installed, you +can accomplish the same thing with: + +```sh +$ rake newb +``` + +This task will install any missing dependencies, run the tests/specs, and +generate the RDoc. + +You can run tests with code coverage analysis by running: + +```sh +$ rake test:coverage +``` + +### Workflow + +Here's the most direct way to get your work merged into the project: + +- Fork the project. +- Clone down your fork (`git clone git://github.com//mime-types-data.git`). +- Create a topic branch to contain your change (`git checkout -b my\_awesome\_feature`). +- Hack away, add tests. Not necessarily in that order. +- Make sure everything still passes by running `rake`. +- If necessary, rebase your commits into logical chunks, without errors. +- Push the branch up (`git push origin my\_awesome\_feature`). +- Create a pull request against mime-types/mime-types-data and describe what + your change does and the why you think it should be merged. + +### The Release Process + +The release process needs automation; as it includes generating code and +committing to the repository, it is not clear how this will happen safely. + +1. Review any outstanding issues or pull requests to see if anything needs to be + addressed. This is necessary because there is currently no automated source + for extensions for the thousands of MIME entries. (Suggestions and/or pull + requests for same would be deeply appreciated.) +2. `bundle install` +3. `bundle exec rake mime:apache` +4. `bundle exec rake mime:iana` +5. Review the changes to make sure that the changes are sane. The IANA data + source changes from time to time, resulting in big changes or even a broken + step 4. (The most recent change was the addition of the font/\* top-level + category.) +6. `bundle exec rake convert` +7. `bundle exec rake update:version` +8. Write up the changes in History.md. If any PRs have been merged, these should + be noted specifically. +9. Commit the changes and push to GitHub. +10. `bundle exec rake release VERSION=newversion` + +### Automating the Release + +If anyone wishes to provide suggestions on automation, this would be a two-phase +process: + +1. A system would need to periodically create PRs to the GitHub repository with + the output of the following commands (steps 2, 3, and 4): + + ```sh + bundle install + bundle exec rake mime:apache + bundle exec rake mime:iana + git add . + git commit -m "[Automated] MIME Type update for $(date)" + # Somehow make the PR from here. + ``` + +2. Once this PR is approved and merged, the next steps would be conversion, + version update, automatic update of History.md, and release (steps 6–10). + +This is based on an issue [#18][]. + +### Contributors + +- Austin Ziegler created mime-types. + +Thanks to everyone else who has contributed to mime-types: + +- Aaron Patterson +- Aggelos Avgerinos +- Alessio Parma +- Alex Balhatchet +- Andre Pankratz +- Andrey Eremin +- Andy Brody +- Arnaud Meuret +- Bradley Meck +- Brandon Galbraith +- Chris Gat +- David Genord +- Eric Marden +- Garret Alfert +- Godfrey Chan +- Greg Brockman +- Hans de Graaff +- Henrik Hodne +- Jeremy Evans +- John Gardner +- Jon Sneyers +- Jonas Petersen +- Juanito Fatas +- Keerthi Siva +- Ken Ip +- Łukasz Śliwa +- Lucia +- Martin d'Allens +- Mauricio Linhares +- Myk Klemme +- nycvotes-dev +- Postmodern +- Richard Hirner +- Richard Hurt +- Richard Schneeman +- Robert Buchberger +- Sergio Baptista +- Tao Guo +- Thomas Leese +- Tibor Szolár +- Todd Carrico +- Yoran Brondsema + +[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +[rmt]: https://github.com/mime-types/ruby-mime-types/ +[#18]: https://github.com/mime-types/mime-types-data/issues/18 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/History.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/History.md new file mode 100644 index 0000000..8f0a2f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/History.md @@ -0,0 +1,502 @@ +# MIME Types Changes by Version + + + +## 3.2022.0105 / 2022-01-05 + +- Updated the Apache and IANA media registry entries as of release date. + +- Fixed an incorrect definition of `image/bmp`, which had been marked obsolete + and later registered. Fixed [#48], found by William T. Nelson. + +## 3.2021.1115 / 2021-11-15 + +- Updated the Apache and IANA media registry entries as of release date. + +- Added conversion utilities that support the `mini_mime` data format. These + have been ported from the [mini_mime] repository. [#47] + +- Added IANA provisional media registries. Added some notes to Contributing.md + about the transient nature of the provisional registration data. This was + triggered in part by a pull request by Jon Sneyers. Thanks! [#45], [#43] + +## 3.2021.0901 / 2021-09-01 + +- Updated the Apache and IANA media registry entries as of release date. + +- Added file extension for WebVTT text format. [#46] + +## 3.2021.0704 / 2021-07-04 + +- Updated the Apache and IANA media registry entries as of release date. + +## 3.2021.0225 / 2021-02-25 + +- Updated the Apache and IANA media registry entries as of release date. + +- Added file extension for AVIF video format. [#40] + +## 3.2021.0212 / 2021-02-12 + +- Updated the IANA media registry entries as of release date. + +- Added a new rake task (`release:automatic`) that downloads and converts the + data from Apache and IANA; if there are changes detected, it updates the + release version, changelog, manifest, and gemspec and commits the changes + to git. + +## 3.2020.1104 / 2020-11-04 + +- Updated the IANA media registry entries as of release date. + +- Added `application/x-zip-compressed`. [#36] + +- Updated the contributing guide to include information about the release + process as described in [#18] + +- Corrected a misspelling of Yoran Brondsema’s name. Sorry, Yoran. [#35] + +## 3.2020.0512 / 2020-05-12 + +- Updated the IANA media registry entries as of release date. + +- Added file extensions for HEIC image types. [#34] + +## 3.2020.0425 / 2020-04-25 + +- Updated the IANA media registry entries as of release date. + +- Added several RAW image types based on data from GNOME RAW Thumbnailer. + [#33] fixing [#32] + +- Added `audio/wav`. [#31] + +- Added a type for Smarttech notebook files. [#30] + +- Added an alias for audio/m4a files. [#29] + +- Added application/x-ms-dos-executable. [#28] + +## 3.2019.1009 / 2019-10-09 + +- Updated the IANA media registry entries as of release date. + +- Reordered the `.ai` extension so that it is not the preferred extension for + `application/pdf` [#24] + +## 3.2019.0904 / 2019-09-04 + +- Updated the IANA media registry entries as of release date. + +- Moved the `.ai` extension from `application/postscript` to `application/pdf`. + [#23] fixing [#22] + +## 3.2019.0331 / 2019-03-31 + +- Updated the IANA media registry entries as of release date. + +- Added support for `application/wasm` with extension `.wasm`. [#21] + +- Fixed `application/ecmascript` extensions. [#20] + +## 3.2018.0812 / 2018-08-12 + +- Added `.xsd` extension to `text/xml`. [#10] + +- Added `.js` and `.mjs` extensions to `text/ecmascript` and + `text/javascript`. [#11] + +- Added `.ipa` extension to `application/octet-stream`. [#12] + +- Moved extensions `.markdown` and `.md` and added `.mkd` extension to + `text/markdown`. [#13] + +- Because of a bug found with mime-types 3 before 3.2.1, this version + requires mime-types 3.1 or later to manage data. + +- Updated the IANA media registry entries as of release date. The biggest + major change here is the addition of the `font/` top-level media type. + +- MIME type changes not introduced by pull requests will no longer be + individually tracked. + +- Clarified that the YAML editable format is not shipped with the Ruby gem + for size considerations. + +## 3.2016.0521 / 2016-05-21 + +- Updated the known extension list for application/octet-stream and + application/pgp-encrypted to include gpg as an extension. Fixes + [#3](https://github.com/mime-types/mime-types-data/pull/3) by Tao Guo + (@taoza). +- Updated the IANA media registry entries as of release date: + + - Updated metadata for application/EmergencyCallData.Comment+xml, + application/EmergencyCallData.DeviceInfo+xml, + application/EmergencyCallData.ProviderInfo+xml, + application/EmergencyCallData.ServiceInfo+xml, + application/EmergencyCallData.SubscriberInfo+xml, + application/ogg, application/problem+json, application/problem+xml, + audio/ogg, text/markdown, video/H265, video/ogg. + - Added application/efi, application/vnd.3gpp.sms+xml, + application/vnd.3lightssoftware.imagescal, + application/vnd.coreos.ignition+json, application/vnd.oma.lwm2m+json, + application/vnd.onepager, application/vnd.quarantainenet, + application/vnd.vel+json, image/emf, image/wmf, text/prs.prop.logic. + - image/bmp has a draft RFC which would make it official; it has been + finally been registered. As such, this version _reverses_ the + use-instead relationship of image/bmp and image/x-bmp. + +- This version requires mime-types 3.1 or later to manage data because of an + issue with JSON data encoding for the `xrefs` field. + +## 3.2016.0221 / 2016-02-21 + +- Updated the known extensions list for audio/mp4. +- Updated the IANA media registry entries as of release date: + + - Updated metadata for 3GPP-defined types (there are many), + application/cdni, and application/rfc+xml. + - Added application/EmergencyCallData.Comment+xml, + application/EmergencyCallData.DeviceInfo+xml, + application/EmergencyCallData.ProviderInfo+xml, + application/EmergencyCallData.ServiceInfo+xml, + application/ppsp-tracker+json, application/problem+json, + application/problem+xml, application/vnd.filmit.zfc, + application/vnd.hdt, application/vnd.mapbox-vector-tile, + application/vnd.ms-PrintDeviceCapabilities+xml, + application/vnd.ms-PrintSchemaTicket+xml, + application/vnd.ms-windows.nwprinting.oob, application/vnd.tml, + model/vnd.rosette.annotated-data-model, and video/H265. + +- Updated to [Contributor Covenant 1.4][code of conduct]. +- Shift the support code in this repository to be developed with Ruby 2.3. + This involves: + + - Adding `frozen_string_literal: true` to all Ruby files. + - Applied some recommended readability and performance suggestions from + Rubocop. Ignored some style recommendations, too. + - Replaced some cases of `foo.bar rescue nil` with `foo&.bar`. + +## 3.2015.1120 / 2015-11-20 + +- Extracted from [ruby-mime-types][rmt]. +- Added a [Code of Conduct]. +- The versioning has changed to be semantic on format plus date in two parts. + + - All registry formats have been updated to remove deprecated data. + - The columnar format has been updated to store three boolean flags in a + single flags file. + +- Updated the conversion and management utilities to work with + ruby-mime-types 3.x. + +- Updated the IANA media registry entries as of release date: + + - Updated metadata for application/scim+json, audio/G711-0, text/markdown. + + - Added application/cdni, application/csvm+json, application/rfc+xml, + application/vnd.3gpp.access-transfer-events+xml, + application/vnd.3gpp.srvcc-ext+xml, application/vnd.3gpp.SRVCC-info+xml, + application/vnd.ms-windows.devicepairing, + application/vnd.ms-windows.wsd.oob, application/vnd.oxli.countgraph, + application/vnd.pagerduty+json, video/VP8. + +## 2.6.2 / 2015-09-13 + +- Updated the IANA media registry entries as of release date: + + - Updated metadata for application/cals-1840, application/index.obj, + application/ocsp-response, application/vnd.dtg.local.html, + application/vnd.pwg-multiplexed, audio/G7221, audio/opus. + + - Added application/pkcs12, application/scim+json, multipart/form-data. + application/vnd.3gpp-prose+xml, application/vnd.3gpp-prose-pc3ch+xml, + application/vnd.3gpp.mid-call+xml, + application/vnd.3gpp-state-and-event-info+xml, + application.3gpp.ussd+xml, application/vnd.anki, + application/vnd.biopax.rdf+xml, application/vnd.drive+json, + application/vnd.firemonkeys.cloudcell, + application/vnd.hyperdrive+json, application/vnd.openblox.game+xml, + application/vnd.openblox.game-binary, application/vnd.uri-map, + audio/G711-0, image/vnd.mozilla.apng. + +## 2.6 / 2015-05-25 + +- Steven Michael Thomas (@stevenmichaelthomas) added `woff2` as an extension + to application/font-woff, + [ruby-mime-types#99](https://github.com/mime-types/ruby-mime-types/pull/99). +- Updated the IANA media registry entries as of release date: + - Updated metadata for application/jose, application/jose+json, + application/jwk+json, application/jwk-set+json, application/jwt to + reflect the adoption of RFC7519. + - Added application/vnd.balsamiq.bmpr. + +## 2.5 / 2015-04-25 + +- Updated the IANA media registry entries as of release date: + - Added MIME types: application/A2L, application/AML, application/ATFX, + application/ATXML, application/CDFX+XML, application/CEA, + application/DII, application/DIT, application/jose, + application/jose+json, application/json-seq, application/jwk+json, + application/jwk-set+json, application/jwt, application/LXF, + application/MF4, application/rdap+json, + application/vnd.apache.thrift.compact, vnd.apache.thrift.json, + application/vnd.citationstyles.style+xml, application/vnd.coffeescript, + application/vnd.enphase.envoy, application/vnd.fastcopy-disk-image, + application/vnd.gerber, application/vnd.gov.sk.e-form+xml, + application/vnd.gov.sk.e-form+zip, + application/vnd.gov.sk.xmldatacontainer+xml, + application/vnd.ims.imsccv1p1, application/vnd.ims.imsccv1p2, + application/vnd.ims.imsccv1p3, application/vnd.micro+json, + application/vnd.microsoft.portable-executable, + application/vnd.msa-disk-image, application/vnd.oracle.resource+json, + application/vnd.tmd.mediaflex.api+xml, audio/opus, + image/vnd.zbrush.pcx, text/csv-schema, text/markdown (marked as + TEMPORARY). + - Updated metadata for application/coap-group+json (RFC7390), + application/epub+zip (now registered), application/merge-patch+json + (RFC7396), application/smil, application/vnd.arastra.swi, + application/vnd.geocube+xml, application/vnd.gmx, + application/xhtml+xml, text/directory. +- Andy Brody (@ab) fixed a pair of embarrassing typos in text/csv and + text/tab-separated-values, + [ruby-mime-types#89](https://github.com/mime-types/ruby-mime-types/pull/89). +- Aggelos Avgerinos (@eavgerinos) added the unregistered MIME type + image/x-ms-bmp with the extension `bmp`, + [ruby-mime-types#90](https://github.com/mime-types/ruby-mime-types/pull/90). + +## 2.4.2 / 2014-10-15 + +- Added application/vnd.ms-outlook as an unregistered MIME type with the + extension `msg`. Provided by @keerthisiv in + [ruby-mime-types#72](https://github.com/mime-types/ruby-mime-types/pull/72). + +## 2.4.1 / 2014-10-07 + +- Changed the sort order of many of the extensions to restore behaviour from + mime-types 1.25.1. +- Added `friendly` MIME::Type descriptions where known. +- Added `reg`, `ps1`, and `vbs` extensions to application/x-msdos-program and + application/x-msdownload. +- Updated the IANA media registry entries as of release date. + - Several MIME types had updated metadata (application/alto-\*, RFC7285; + application/calendar+json, RFC7265; application/http, RFC7230; + application/xml, RFC7303; application/xml-dtd, RFC7303; + application/xml-external-parsed-entity, RFC7303; audio/AMR-WB, RFC4867; + audio/aptx, RFC7310; message/http, RFC7230; multipart/byteranges, + RFC7233; text/xml, RFC7303; text/xml-external-parsed-entity, RFC7303) + - MIME::Type application/EDI-Consent was renamed to + application/EDI-consent. + - Obsoleted application/vnd.informix-visionary in favour of + application/vnd.visionary. Obsoleted + application/vnd.nokia.n-gage.symbian.install with no replacement. + - Added MIME types: application/ATF, application/coap-group+json, + application/DCD, application/merge-patch+json, application/scaip+xml, + application/vnd.apache.thrift.binary, application/vnd.artsquare, + application/vnd.doremir.scorecloud-binary-document, + application/vnd.dzr, application/vnd.maxmind.maxmind-db, + application/vnd.ntt-local.ogw_remote-access, application/xml-patch+xml, + image/vnd.tencent.tap. + +## 2.3 / 2014-05-23 + +- Updated the IANA media registry entries as of release date. + - Several MIME types had additional metadata added on the most recent + import. + - MIME::Type application/pidfxml was renamed to application/pidf+xml. + - Added MIME types: application/3gpdash-qoe-report+xml, + application/alto-costmap+json, application/alto-costmapfilter+json, + application/alto-directory+json, application/alto-endpointcost+json, + application/alto-endpointcostparams+json, + application/alto-endpointprop+json, + application/alto-endpointpropparams+json, application/alto-error+json, + application/alto-networkmap+json, + application/alto-networkmapfilter+json, application/calendar+json, + application/vnd.debian.binary-package, application/vnd.geo+json, + application/vnd.ims.lis.v2.result+json, + application/vnd.ims.lti.v2.toolconsumerprofile+json, + application/vnd.ims.lti.v2.toolproxy+json, + application/vnd.ims.lti.v2.toolproxy.id+json, + application/vnd.ims.lti.v2.toolsettings+json, + application/vnd.ims.lti.v2.toolsettings.simple+json, + application/vnd.mason+json, application/vnd.miele+json, + application/vnd.ms-3mfdocument, application/vnd.panoply, + application/vnd.valve.source.material, application/vnd.yaoweme, + audio/aptx, image/vnd.valve.source.texture, model/vnd.opengex, + model/vnd.valve.source.compiled-map, model/x3d+fastinfoset, + text/cache-manifest + +## 2.2 / 2014-03-14 + +- Added .sj to `application/javascript` as provided by Brandon + Galbraith (@brandongalbraith) in + [ruby-mime-types#58](https://github.com/mime-types/ruby-mime-types/pull/58). +- Marked application/excel and application/x-excel as obsolete in favour of + application/vnd.ms-excel per + [ruby-mime-types#60](https://github.com/mime-types/ruby-mime-types/pull/60). +- Merged duplicate MIME types into the registered MIME type. The only + difference between the MIME types was capitalization; the MIME type + registry is case-preserving. + + - Affected MIME types: application/vnd.3M.Post-it-Notes, + application/vnd.FloGraphIt, application/vnd.HandHeld-Entertainment+xml, + application/vnd.hp-HPGL, application/vnd.hp-PCL, + application/vnd.hp-PCLXL, application/vnd.ibm.MiniPay, + application/vnd.Kinar, application/vnd.MFER, + application/vnd.Mobius.DAF, application/vnd.Mobius.DIS, + application/vnd.Mobius.MBK, application/vnd.Mobius.MSL, + application/vnd.Mobius.MQY, application/vnd.Mobius.PLC, + application/vnd.Mobius.TXF, + application/vnd.ms-excel.addin.macroEnabled.12, + application/vnd.ms-excel.sheet.binary.macroEnabled.12, + application/vnd.ms-excel.sheet.macroEnabled.12, + application/vnd.ms-excel.template.macroEnabled.12, + application/vnd.ms-powerpoint.addin.macroEnabled.12, + application/vnd.ms-powerpoint.presentation.macroEnabled.12, + application/vnd.ms-powerpoint.slide.macroEnabled.12, + application/vnd.ms-powerpoint.slideshow.macroEnabled.12, + application/vnd.ms-powerpoint.template.macroEnabled.12, + application/vnd.ms-word.document.macroEnabled.12, + application/vnd.ms-word.template.macroEnabled.12, + application/vnd.novadigm.EDM, application/vnd.novadigm.EDX, + application/vnd.novadigm.EXT, application/vnd.Quark.QuarkXPress, + application/vnd.SimTech-MindMapper, audio/AMR-WB, video/H261, + video/H263, video/H264, video/JPEG, video/MJ2. + +- Updated the IANA media registry entries as of release date. + - Registered type person names have been updated from surname only to + full name. + - Several types had updated RFC or draft RFC references. + - Added application/bacnet-xdd+zip, application/cms, + application/load-control+xml, application/PDX, application/ttml+xml, + application/vnd.collection.doc+json, + application/vnd.iptc.g2.catalogitem+xml, application/vnd.pcos, + text/parameters, text/vnd.a, video/iso.segment + +## 2.1 / 2014-01-25 + +- The IANA media type registry format changed, resulting in updates to most + of the 1,427 registered MIME types. + - Many registered MIME types have had some metadata updates due to the + change in the IANA registry format. + - MIME types having a publicly available registry application now + include a link to that file in references. + - Added `xrefs` data as discovered (see the API changes noted above). +- The Apache mime types configuration has been added to track additional + common but unregistered MIME types and known extensions for those MIME + types. This has affected many of the available MIME types. +- Added newly registered MIME types: + - application/emotionml+xml, application/ODX, application/prs.hpub+zip, + application/vcard+json, application/vnd.bekitzur-stech+json, + application/vnd.etsi.timestamp-token, + application/vnd.oma.cab-feature-handler+xml, + application/vnd.openeye.oeb, application/vnd.tcpdump.pcap, + audio/amr-wb, model/x3d+xml, model/x3d-vrml +- Added 180 unregistered MIME types from the Apache list: + - application/applixware, application/cu-seeme, application/docbook+xml, + application/gml+xml, application/gpx+xml, application/gxf, + application/java-archive, application/java-serialized-object, + application/java-vm, application/jsonml+json, application/metalink+xml, + application/omdoc+xml, application/onenote, application/pics-rules, + application/rsd+xml, application/ssdl+xml, + application/vnd.3m.post-it-notes, application/vnd.amazon.ebook, + application/vnd.anser-web-funds-transfer-initiation, + application/vnd.curl.car, application/vnd.curl.pcurl, + application/vnd.dolby.mlp, application/vnd.ds-keypoint, + application/vnd.flographit, application/vnd.handheld-entertainment+xml, + application/vnd.hp-hpgl, application/vnd.hp-pcl, + application/vnd.hp-pclxl, application/vnd.ibm.minipay, + application/vnd.kinar, application/vnd.mfer, + application/vnd.mobius.daf, application/vnd.mobius.dis, + application/vnd.mobius.mbk, application/vnd.mobius.mqy, + application/vnd.mobius.msl, application/vnd.mobius.plc, + application/vnd.mobius.txf, + application/vnd.ms-excel.addin.macroenabled.12, + application/vnd.ms-excel.sheet.binary.macroenabled.12, + application/vnd.ms-excel.sheet.macroenabled.12, + application/vnd.ms-excel.template.macroenabled.12, + application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, + application/vnd.ms-powerpoint.addin.macroenabled.12, + application/vnd.ms-powerpoint.presentation.macroenabled.12, + application/vnd.ms-powerpoint.slide.macroenabled.12, + application/vnd.ms-powerpoint.slideshow.macroenabled.12, + application/vnd.ms-powerpoint.template.macroenabled.12, + application/vnd.ms-word.document.macroenabled.12, + application/vnd.ms-word.template.macroenabled.12, + application/vnd.novadigm.edm, application/vnd.novadigm.edx, + application/vnd.novadigm.ext, application/vnd.quark.quarkxpress, + application/vnd.rim.cod, application/vnd.rn-realmedia-vbr, + application/vnd.simtech-mindmapper, application/vnd.symbian.install, + application/winhlp, application/x-abiword, + application/x-ace-compressed, application/x-authorware-bin, + application/x-authorware-map, application/x-authorware-seg, + application/x-bittorrent, application/x-blorb, application/x-bzip, + application/x-cbr, application/x-cfs-compressed, application/x-chat, + application/x-conference, application/x-dgc-compressed, + application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, + application/x-dtbresource+xml, application/x-envoy, application/x-eva, + application/x-font-bdf, application/x-font-ghostscript, + application/x-font-linux-psf, application/x-font-otf, + application/x-font-pcf, application/x-font-snf, application/x-font-ttf, + application/x-font-type1, application/x-freearc, + application/x-gca-compressed, application/x-glulx, + application/x-gnumeric, application/x-gramps-xml, + application/x-install-instructions, application/x-iso9660-image, + application/x-lzh-compressed, application/x-mie, + application/x-ms-application, application/x-ms-shortcut, + application/x-ms-xbap, application/x-msbinder, + application/x-mscardfile, application/x-msclip, + application/x-msmediaview, application/x-msmetafile, + application/x-msmoney, application/x-mspublisher, + application/x-msschedule, application/x-msterminal, + application/x-mswrite, application/x-nzb, application/x-pkcs12, + application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, + application/x-research-info-systems, application/x-silverlight-app, + application/x-sql, application/x-stuffitx, application/x-subrip, + application/x-t3vm-image, application/x-tads, application/x-tex-tfm, + application/x-tgif, application/x-xfig, application/x-xliff+xml, + application/x-xz, application/x-zmachine, application/xaml+xml, + application/xproc+xml, application/xspf+xml, audio/adpcm, audio/amr-wb, + audio/AMR-WB, audio/midi, audio/s3m, audio/silk, audio/x-caf, + audio/x-flac, audio/x-matroska, audio/x-mpegurl, audio/xm, + chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, + chemical/x-csml, image/sgi, image/vnd.ms-photo, image/x-3ds, + image/x-cmx, image/x-freehand, image/x-icon, image/x-mrsid-image, + image/x-pcx, image/x-tga, model/x3d+binary, model/x3d+vrml, text/plain, + text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, + text/x-asm, text/x-c, text/x-fortran, text/x-java-source, text/x-nfo, + text/x-opml, text/x-pascal, text/x-sfv, text/x-uuencode, video/h261, + video/h263, video/h264, video/jpeg, video/jpm, video/mj2, video/x-f4v, + video/x-m4v, video/x-mng, video/x-ms-vob, video/x-smv +- Merged the non-standard VMS platform text/plain with the standard + text/plain. + +[#10]: https://github.com/mime-types/mime-types-data/pull/10 +[#11]: https://github.com/mime-types/mime-types-data/pull/11 +[#12]: https://github.com/mime-types/mime-types-data/pull/12 +[#13]: https://github.com/mime-types/mime-types-data/pull/13 +[#18]: https://github.com/mime-types/mime-types-data/issues/18 +[#20]: https://github.com/mime-types/mime-types-data/pull/20 +[#21]: https://github.com/mime-types/mime-types-data/pull/21 +[#22]: https://github.com/mime-types/mime-types-data/issues/22 +[#23]: https://github.com/mime-types/mime-types-data/pull/23 +[#24]: https://github.com/mime-types/mime-types-data/pull/24 +[#28]: https://github.com/mime-types/mime-types-data/pull/28 +[#29]: https://github.com/mime-types/mime-types-data/pull/29 +[#30]: https://github.com/mime-types/mime-types-data/pull/30 +[#31]: https://github.com/mime-types/mime-types-data/pull/31 +[#32]: https://github.com/mime-types/mime-types-data/issues/32 +[#33]: https://github.com/mime-types/mime-types-data/pull/33 +[#34]: https://github.com/mime-types/mime-types-data/pull/34 +[#35]: https://github.com/mime-types/mime-types-data/pull/35 +[#36]: https://github.com/mime-types/mime-types-data/pull/36 +[#40]: https://github.com/mime-types/mime-types-data/pull/40 +[#43]: https://github.com/mime-types/mime-types-data/pull/43 +[#45]: https://github.com/mime-types/mime-types-data/pull/45 +[#46]: https://github.com/mime-types/mime-types-data/pull/46 +[#47]: https://github.com/mime-types/mime-types-data/pull/47 +[#48]: https://github.com/mime-types/mime-types-data/issues/48 +[rmt]: https://github.com/mime-types/ruby-mime-types +[code of conduct]: Code-of-Conduct.md +[mini_mime]: https://github.com/discourse/mini_mime/issues/41 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Licence.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Licence.md new file mode 100644 index 0000000..5a17d63 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Licence.md @@ -0,0 +1,24 @@ +## Licence + +- Copyright 2003–2021 Austin Ziegler and other contributors. + +The software in this repository is made available under the MIT license. + +### MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Manifest.txt b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Manifest.txt new file mode 100644 index 0000000..3e81b69 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Manifest.txt @@ -0,0 +1,34 @@ +Code-of-Conduct.md +Contributing.md +History.md +Licence.md +Manifest.txt +README.md +Rakefile +data/content_type_mime.db +data/ext_mime.db +data/mime-types.json +data/mime.content_type.column +data/mime.docs.column +data/mime.encoding.column +data/mime.flags.column +data/mime.friendly.column +data/mime.pext.column +data/mime.use_instead.column +data/mime.xrefs.column +lib/mime-types-data.rb +lib/mime/types/data.rb +types/application.yaml +types/audio.yaml +types/chemical.yaml +types/conference.yaml +types/drawing.yaml +types/font.yaml +types/image.yaml +types/message.yaml +types/model.yaml +types/multipart.yaml +types/provisional-standard-types.yaml +types/text.yaml +types/video.yaml +types/world.yaml diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/README.md b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/README.md new file mode 100644 index 0000000..5b9b6a4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/README.md @@ -0,0 +1,73 @@ +# mime-types-data + +- home :: https://github.com/mime-types/mime-types-data/ +- code :: https://github.com/mime-types/mime-types-data/ +- issues :: https://github.com/mime-types/mime-types-data/issues + +## Description + +mime-types-data provides a registry for information about MIME media type +definitions. It can be used with the Ruby mime-types library or other software +to determine defined filename extensions for MIME types, or to use filename +extensions to look up the likely MIME type definitions. + +### About MIME Media Types + +MIME media types are used in MIME-compliant communications, as in e-mail or +HTTP traffic, to indicate the type of content which is transmitted. The +registry provided in mime-types-data contains detailed information about MIME +entities. There are many types defined by RFCs and vendors, so the list is long +but invariably; don't hesitate to offer additional type definitions for +consideration. MIME type definitions found in mime-types are from RFCs, W3C +recommendations, the [IANA Media Types registry][registry], and user +contributions. It conforms to RFCs 2045 and 2231. + +### Data Formats Supported in this Registry + +This registry contains the MIME media types in four formats: + +- A YAML format matching the Ruby mime-types library objects (MIME::Type). + This is the primary user-editable format for developers. It is _not_ + shipped with the gem due to size considerations. +- A JSON format converted from the YAML format. Prior to Ruby mime-types 3.0, + this was the main consumption format and is still recommended for any + implementation that does not wish to implement the columnar format, which + has a significant implementation effort cost. +- An encoded text format splitting the data for each MIME type across + multiple files. This columnar data format reduces the minimal data load + substantially, resulting in a performance improvement at the cost of more + complex code for loading the data on-demand. This is the default format for + Ruby mime-types 3.0. +- An encoded text format for use with [`mini_mime`][] (as of 3.2021.1108). This + can be enabled with: + + ```ruby + MiniMime::Configuration.ext_db_path = + File.join(MIME::Types::Data::PATH, "ext_mime.db") + MiniMime::Configuration.content_type_db_path = + File.join(MIME::Types::Data::PATH, "content_type_mime.db") + ``` + +## mime-types-data Modified Semantic Versioning + +mime-types-data uses a heavily modified [Semantic Versioning][] scheme to +indicate that the data formats compatibility based on a `SCHEMA` version and +the date of the data update: `SCHEMA.YEAR.MONTHDAY`. + +1. If an incompatible data format change is made to any of the supported + formts, `SCHEMA` will be incremented. The current `SCHEMA` is 3, supporting + the YAML, JSON, and columnar formats required for Ruby mime-types 3.0. + +2. When the data is updated, the `YEAR.MONTHDAY` combination will be updated. + An update on the last day of October 2015 would be written as `2015.1031`, + resulting in the full version of `3.2015.1031`. + +3. If multiple versions of the data need to be released on the same day due to + error, there will be an additional `REVISION` field incremented on the end + of the version. Thus, if three revisions need to be published on October + 31st, 2015, the last release would be `3.2015.1031.2` (remember that the + first release has an implied `0`.) + +[registry]: https://www.iana.org/assignments/media-types/media-types.xhtml +[semantic versioning]: http://semver.org/ +[`mini_mime`]: https://github.com/discourse/mini_mime diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Rakefile b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Rakefile new file mode 100644 index 0000000..f7f8c76 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/Rakefile @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +require "rubygems" +require "hoe" +require "rake/clean" + +Hoe.plugin :doofus +Hoe.plugin :gemspec2 +Hoe.plugin :git +Hoe.plugin :travis +Hoe.plugin :email unless ENV["CI"] || ENV["TRAVIS"] + +Hoe.spec "mime-types-data" do + developer("Austin Ziegler", "halostatue@gmail.com") + + require_ruby_version ">= 2.0" + + self.history_file = "History.md" + self.readme_file = "README.md" + + license "MIT" + + extra_dev_deps << ["nokogiri", "~> 1.6"] + extra_dev_deps << ["hoe-doofus", "~> 1.0"] + extra_dev_deps << ["hoe-gemspec2", "~> 1.1"] + extra_dev_deps << ["hoe-git", "~> 1.6"] + extra_dev_deps << ["hoe-rubygems", "~> 1.0"] + extra_dev_deps << ["rake", ">= 10.0", "< 14"] + extra_dev_deps << ["mime-types", ">= 3.4.0", "< 4"] + extra_dev_deps << ["standardrb", "~> 1.0"] + extra_dev_deps << ["psych", "~> 3.0"] +end + +$LOAD_PATH.unshift "lib" +$LOAD_PATH.unshift "support" + +def new_version + version = + IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4})['"]/).flatten.first + + major = Gem::Version.new(version).canonical_segments.first + minor = Date.today.strftime("%Y.%m%d") + + "#{major}.#{minor}" +end + +def release_header + "#{new_version} / #{Date.today.strftime("%Y-%m-%d")}" +end + +namespace :mime do + desc "Download the current MIME type registrations from IANA." + task :iana, [:destination] do |_, args| + require "iana_registry" + IANARegistry.download(to: args.destination) + end + + desc "Download the current MIME type configuration from Apache." + task :apache, [:destination] do |_, args| + require "apache_mime_types" + ApacheMIMETypes.download(to: args.destination) + end +end + +namespace :release do + task __pull: %w[mime:apache mime:iana convert] + task __prepare: %w[update:version update:history git:manifest] + task :__commit do + history = IO.read("History.md") + message = history.scan(%r{## (#{release_header}.+?)## \d\.\d{4}\.\d{4} /}m).flatten.first + + IO.popen("git commit -a -F -", "w") { |commit| + commit.puts message + } + end + + desc "Prepare a new automatic release" + task automatic: :__pull do + if system("git diff --quiet --exit-code") == false + Rake::Task["release:__prepare"].invoke + Rake::Task["gemspec"].invoke + Rake::Task["release:__commit"].invoke + else + warn "No changes detected." + end + end +end + +namespace :convert do + namespace :yaml do + desc "Convert from YAML to JSON" + task :json, [:source, :destination, :multiple_files] => :support do |_, args| + require "convert" + Convert.from_yaml_to_json(args) + end + + desc "Convert from YAML to Columnar" + task :columnar, [:source, :destination] => :support do |_, args| + require "convert/columnar" + Convert::Columnar.from_yaml_to_columnar(args) + end + + desc "Convert from YAML to mini_mime db format" + task :mini_mime, [:source, :destination] => :support do |_, args| + require "convert/mini_mime_db" + Convert::MiniMimeDb.from_yaml_to_mini_mime(args) + end + end + + namespace :json do + desc "Convert from JSON to YAML" + task :yaml, [:source, :destination, :multiple_files] => :support do |_, args| + require "convert" + Convert.from_json_to_yaml(args) + end + end +end + +namespace :update do + desc "Update the release version" + task :version do + file = IO.read("lib/mime/types/data.rb") + updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %Q(VERSION = "#{new_version}")) + + IO.write("lib/mime/types/data.rb", updated) + end + + desc "Update the history file with automatic release notes" + task :history do + history = IO.read("History.md") + + if !/^## #{release_header}$/.match?(history) + note = <<-NOTE + + +## #{release_header} + +- Updated the Apache and IANA media registry entries as of release date. + NOTE + + updated = history.sub(/\n/, note) + + IO.write("History.md", updated) + end + end +end + +desc "Default conversion from YAML to JSON and Columnar" +task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"] + +Rake::Task["gem"].prerequisites.unshift("convert") +Rake::Task["gem"].prerequisites.unshift("git:manifest") +Rake::Task["gem"].prerequisites.unshift("gemspec") + +# vim: syntax=ruby diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/content_type_mime.db b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/content_type_mime.db new file mode 100644 index 0000000..95d6d86 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/content_type_mime.db @@ -0,0 +1,878 @@ +ez application/andrew-inset base64 +aw application/applixware base64 +atom application/atom+xml 8bit +atomcat application/atomcat+xml 8bit +atomsvc application/atomsvc+xml 8bit +ccxml application/ccxml+xml base64 +cdmia application/cdmi-capability base64 +cdmic application/cdmi-container base64 +cdmid application/cdmi-domain base64 +cdmio application/cdmi-object base64 +cdmiq application/cdmi-queue base64 +cu application/cu-seeme base64 +davmount application/davmount+xml base64 +dcm application/dicom base64 +dbk application/docbook+xml base64 +dssc application/dssc+der base64 +xdssc application/dssc+xml base64 +ecma application/ecmascript base64 +emma application/emma+xml base64 +epub application/epub+zip base64 +exi application/exi base64 +pfr application/font-tdpfr base64 +gml application/gml+xml base64 +gpx application/gpx+xml base64 +gxf application/gxf base64 +gz application/gzip base64 +stk application/hyperstudio base64 +ink application/inkml+xml base64 +ipfix application/ipfix base64 +jar application/java-archive base64 +ser application/java-serialized-object base64 +js application/javascript 8bit +json application/json 8bit +jsonml application/jsonml+json base64 +lostxml application/lost+xml base64 +hqx application/mac-binhex40 8bit +mads application/mads+xml base64 +webmanifest application/manifest+json base64 +mrc application/marc base64 +mrcx application/marcxml+xml base64 +ma application/mathematica base64 +mathml application/mathml+xml base64 +mbox application/mbox base64 +mscml application/mediaservercontrol+xml base64 +metalink application/metalink+xml base64 +meta4 application/metalink4+xml base64 +mets application/mets+xml base64 +mods application/mods+xml base64 +m21 application/mp21 base64 +mp4 application/mp4 base64 +doc application/msword base64 +mxf application/mxf base64 +nc application/netcdf base64 +bin application/octet-stream base64 +oda application/oda base64 +opf application/oebps-package+xml base64 +ogx application/ogg base64 +omdoc application/omdoc+xml base64 +onepkg application/onenote base64 +oxps application/oxps base64 +xer application/patch-ops-error+xml base64 +pdf application/pdf base64 +asc application/pgp-signature base64 +prf application/pics-rules base64 +p10 application/pkcs10 base64 +p7m application/pkcs7-mime base64 +p7s application/pkcs7-signature base64 +p8 application/pkcs8 base64 +ac application/pkix-attr-cert base64 +cer application/pkix-cert base64 +crl application/pkix-crl base64 +pkipath application/pkix-pkipath base64 +pki application/pkixcmp base64 +pls application/pls+xml base64 +eps application/postscript 8bit +cw application/prs.cww base64 +rnd application/prs.nprend base64 +pskcxml application/pskc+xml base64 +rdf application/rdf+xml 8bit +rif application/reginfo+xml base64 +rnc application/relax-ng-compact-syntax base64 +rl application/resource-lists+xml base64 +rld application/resource-lists-diff+xml base64 +rs application/rls-services+xml base64 +gbr application/rpki-ghostbusters base64 +mft application/rpki-manifest base64 +roa application/rpki-roa base64 +rsd application/rsd+xml base64 +rss application/rss+xml base64 +rtf application/rtf base64 +sbml application/sbml+xml base64 +scq application/scvp-cv-request base64 +scs application/scvp-cv-response base64 +spq application/scvp-vp-request base64 +spp application/scvp-vp-response base64 +sdp application/sdp base64 +setpay application/set-payment-initiation base64 +setreg application/set-registration-initiation base64 +sgml application/sgml base64 +soc application/sgml-open-catalog base64 +shf application/shf+xml base64 +siv application/sieve base64 +smi application/smil+xml 8bit +rq application/sparql-query base64 +srx application/sparql-results+xml base64 +gram application/srgs base64 +grxml application/srgs+xml base64 +sru application/sru+xml base64 +ssdl application/ssdl+xml base64 +ssml application/ssml+xml base64 +tei application/tei+xml base64 +tfi application/thraud+xml base64 +tsd application/timestamped-data base64 +pwn application/vnd.3M.Post-it-Notes base64 +plb application/vnd.3gpp.pic-bw-large base64 +psb application/vnd.3gpp.pic-bw-small base64 +pvb application/vnd.3gpp.pic-bw-var base64 +sms application/vnd.3gpp.sms base64 +tcap application/vnd.3gpp2.tcap base64 +gph application/vnd.FloGraphIt base64 +zmm application/vnd.HandHeld-Entertainment+xml base64 +kne application/vnd.Kinar base64 +mwf application/vnd.MFER base64 +daf application/vnd.Mobius.DAF base64 +dis application/vnd.Mobius.DIS base64 +mbk application/vnd.Mobius.MBK base64 +mqy application/vnd.Mobius.MQY base64 +msl application/vnd.Mobius.MSL base64 +plc application/vnd.Mobius.PLC base64 +txf application/vnd.Mobius.TXF base64 +qxd application/vnd.Quark.QuarkXPress 8bit +twd application/vnd.SimTech-MindMapper base64 +aso application/vnd.accpac.simply.aso base64 +imp application/vnd.accpac.simply.imp base64 +acu application/vnd.acucobol base64 +atc application/vnd.acucorp 7bit +air application/vnd.adobe.air-application-installer-package+zip base64 +fcdt application/vnd.adobe.formscentral.fcdt base64 +fxp application/vnd.adobe.fxp base64 +xdp application/vnd.adobe.xdp+xml base64 +xfdf application/vnd.adobe.xfdf base64 +ahead application/vnd.ahead.space base64 +azf application/vnd.airzip.filesecure.azf base64 +azs application/vnd.airzip.filesecure.azs base64 +azw application/vnd.amazon.ebook base64 +acc application/vnd.americandynamics.acc base64 +ami application/vnd.amiga.ami base64 +apk application/vnd.android.package-archive base64 +cii application/vnd.anser-web-certificate-issue-initiation base64 +fti application/vnd.anser-web-funds-transfer-initiation base64 +atx application/vnd.antix.game-component base64 +mpkg application/vnd.apple.installer+xml base64 +m3u8 application/vnd.apple.mpegurl base64 +pkpass application/vnd.apple.pkpass base64 +swi application/vnd.aristanetworks.swi base64 +iota application/vnd.astraea-software.iota base64 +aep application/vnd.audiograph base64 +mpm application/vnd.blueice.multipass base64 +bmi application/vnd.bmi base64 +rep application/vnd.businessobjects base64 +cdxml application/vnd.chemdraw+xml base64 +mmd application/vnd.chipnuts.karaoke-mmd base64 +cdy application/vnd.cinderella base64 +cla application/vnd.claymore base64 +rp9 application/vnd.cloanto.rp9 base64 +c4d application/vnd.clonk.c4group base64 +c11amc application/vnd.cluetrust.cartomobile-config base64 +c11amz application/vnd.cluetrust.cartomobile-config-pkg base64 +csp application/vnd.commonspace base64 +cdbcmsg application/vnd.contact.cmsg base64 +cmc application/vnd.cosmocaller base64 +clkx application/vnd.crick.clicker base64 +clkk application/vnd.crick.clicker.keyboard base64 +clkp application/vnd.crick.clicker.palette base64 +clkt application/vnd.crick.clicker.template base64 +clkw application/vnd.crick.clicker.wordbank base64 +wbs application/vnd.criticaltools.wbs+xml base64 +pml application/vnd.ctc-posml base64 +ppd application/vnd.cups-ppd base64 +curl application/vnd.curl base64 +car application/vnd.curl.car base64 +pcurl application/vnd.curl.pcurl base64 +dart application/vnd.dart base64 +rdz application/vnd.data-vision.rdz base64 +uvd application/vnd.dece.data base64 +uvt application/vnd.dece.ttml+xml base64 +uvvx application/vnd.dece.unspecified base64 +uvvz application/vnd.dece.zip base64 +fe_launch application/vnd.denovo.fcselayout-link base64 +dna application/vnd.dna base64 +mlp application/vnd.dolby.mlp base64 +dpg application/vnd.dpgraph base64 +dfac application/vnd.dreamfactory base64 +kpxx application/vnd.ds-keypoint base64 +ait application/vnd.dvb.ait base64 +svc application/vnd.dvb.service base64 +geo application/vnd.dynageo base64 +mag application/vnd.ecowin.chart base64 +nml application/vnd.enliven base64 +esf application/vnd.epson.esf base64 +msf application/vnd.epson.msf base64 +qam application/vnd.epson.quickanime base64 +slt application/vnd.epson.salt base64 +ssf application/vnd.epson.ssf base64 +es3 application/vnd.eszigno3+xml base64 +ez2 application/vnd.ezpix-album base64 +ez3 application/vnd.ezpix-package base64 +fdf application/vnd.fdf base64 +mseed application/vnd.fdsn.mseed base64 +dataless application/vnd.fdsn.seed base64 +ftc application/vnd.fluxtime.clip base64 +frm application/vnd.framemaker base64 +fnc application/vnd.frogans.fnc base64 +ltf application/vnd.frogans.ltf base64 +fsc application/vnd.fsc.weblaunch 7bit +oas application/vnd.fujitsu.oasys base64 +oa2 application/vnd.fujitsu.oasys2 base64 +oa3 application/vnd.fujitsu.oasys3 base64 +fg5 application/vnd.fujitsu.oasysgp base64 +bh2 application/vnd.fujitsu.oasysprs base64 +ddd application/vnd.fujixerox.ddd base64 +xdw application/vnd.fujixerox.docuworks base64 +xbd application/vnd.fujixerox.docuworks.binder base64 +fzs application/vnd.fuzzysheet base64 +txd application/vnd.genomatix.tuxedo base64 +ggb application/vnd.geogebra.file base64 +ggt application/vnd.geogebra.tool base64 +gex application/vnd.geometry-explorer base64 +gxt application/vnd.geonext base64 +g2w application/vnd.geoplan base64 +g3w application/vnd.geospace base64 +gmx application/vnd.gmx base64 +kml application/vnd.google-earth.kml+xml 8bit +kmz application/vnd.google-earth.kmz 8bit +gqf application/vnd.grafeq base64 +gac application/vnd.groove-account base64 +ghf application/vnd.groove-help base64 +gim application/vnd.groove-identity-message base64 +grv application/vnd.groove-injector base64 +gtm application/vnd.groove-tool-message base64 +tpl application/vnd.groove-tool-template base64 +vcg application/vnd.groove-vcard base64 +hal application/vnd.hal+xml base64 +hbci application/vnd.hbci base64 +les application/vnd.hhe.lesson-player base64 +plt application/vnd.hp-HPGL base64 +pcl application/vnd.hp-PCL base64 +pclxl application/vnd.hp-PCLXL base64 +hpid application/vnd.hp-hpid base64 +hps application/vnd.hp-hps base64 +jlt application/vnd.hp-jlyt base64 +sfd-hdstx application/vnd.hydrostatix.sof-data base64 +mpy application/vnd.ibm.MiniPay base64 +emm application/vnd.ibm.electronic-media base64 +afp application/vnd.ibm.modcap base64 +irm application/vnd.ibm.rights-management base64 +sc application/vnd.ibm.secure-container base64 +icc application/vnd.iccprofile base64 +igl application/vnd.igloader base64 +ivp application/vnd.immervision-ivp base64 +ivu application/vnd.immervision-ivu base64 +igm application/vnd.insors.igm base64 +xpw application/vnd.intercon.formnet base64 +i2g application/vnd.intergeo base64 +qbo application/vnd.intu.qbo base64 +qfx application/vnd.intu.qfx base64 +rcprofile application/vnd.ipunplugged.rcprofile base64 +irp application/vnd.irepository.package+xml base64 +xpr application/vnd.is-xpr base64 +fcs application/vnd.isac.fcs base64 +jam application/vnd.jam base64 +rms application/vnd.jcp.javame.midlet-rms base64 +jisp application/vnd.jisp base64 +joda application/vnd.joost.joda-archive base64 +ktr application/vnd.kahootz base64 +karbon application/vnd.kde.karbon base64 +chrt application/vnd.kde.kchart base64 +kfo application/vnd.kde.kformula base64 +flw application/vnd.kde.kivio base64 +kon application/vnd.kde.kontour base64 +kpr application/vnd.kde.kpresenter base64 +ksp application/vnd.kde.kspread base64 +kwd application/vnd.kde.kword base64 +htke application/vnd.kenameaapp base64 +kia application/vnd.kidspiration base64 +skd application/vnd.koan base64 +sse application/vnd.kodak-descriptor base64 +lasxml application/vnd.las.las+xml base64 +lbd application/vnd.llamagraphics.life-balance.desktop base64 +lbe application/vnd.llamagraphics.life-balance.exchange+xml base64 +wks application/vnd.lotus-1-2-3 base64 +apr application/vnd.lotus-approach base64 +pre application/vnd.lotus-freelance base64 +nsf application/vnd.lotus-notes base64 +org application/vnd.lotus-organizer base64 +scm application/vnd.lotus-screencam base64 +lwp application/vnd.lotus-wordpro base64 +portpkg application/vnd.macports.portpkg base64 +mcd application/vnd.mcd base64 +mc1 application/vnd.medcalcdata base64 +cdkey application/vnd.mediastation.cdkey base64 +mfm application/vnd.mfmp base64 +flo application/vnd.micrografx.flo base64 +igx application/vnd.micrografx.igx base64 +mif application/vnd.mif base64 +mpn application/vnd.mophun.application base64 +mpc application/vnd.mophun.certificate base64 +xul application/vnd.mozilla.xul+xml base64 +cil application/vnd.ms-artgalry base64 +asf application/vnd.ms-asf base64 +cab application/vnd.ms-cab-compressed base64 +xls application/vnd.ms-excel base64 +xlam application/vnd.ms-excel.addin.macroEnabled.12 base64 +xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 base64 +xlsm application/vnd.ms-excel.sheet.macroEnabled.12 base64 +xltm application/vnd.ms-excel.template.macroEnabled.12 base64 +eot application/vnd.ms-fontobject base64 +chm application/vnd.ms-htmlhelp base64 +ims application/vnd.ms-ims base64 +lrm application/vnd.ms-lrm base64 +thmx application/vnd.ms-officetheme base64 +msg application/vnd.ms-outlook base64 +cat application/vnd.ms-pki.seccat base64 +stl application/vnd.ms-pki.stl base64 +ppt application/vnd.ms-powerpoint base64 +ppam application/vnd.ms-powerpoint.addin.macroEnabled.12 base64 +pptm application/vnd.ms-powerpoint.presentation.macroEnabled.12 base64 +sldm application/vnd.ms-powerpoint.slide.macroEnabled.12 base64 +ppsm application/vnd.ms-powerpoint.slideshow.macroEnabled.12 base64 +potm application/vnd.ms-powerpoint.template.macroEnabled.12 base64 +mpp application/vnd.ms-project base64 +docm application/vnd.ms-word.document.macroEnabled.12 base64 +dotm application/vnd.ms-word.template.macroEnabled.12 base64 +wcm application/vnd.ms-works base64 +wpl application/vnd.ms-wpl base64 +xps application/vnd.ms-xpsdocument 8bit +mseq application/vnd.mseq base64 +mus application/vnd.musician base64 +msty application/vnd.muvee.style base64 +taglet application/vnd.mynfc base64 +ent application/vnd.nervana base64 +nlu application/vnd.neurolanguage.nlu base64 +nitf application/vnd.nitf base64 +nnd application/vnd.noblenet-directory base64 +nns application/vnd.noblenet-sealer base64 +nnw application/vnd.noblenet-web base64 +ngdat application/vnd.nokia.n-gage.data base64 +n-gage application/vnd.nokia.n-gage.symbian.install base64 +rpst application/vnd.nokia.radio-preset base64 +rpss application/vnd.nokia.radio-presets base64 +edm application/vnd.novadigm.EDM base64 +edx application/vnd.novadigm.EDX base64 +ext application/vnd.novadigm.EXT base64 +odc application/vnd.oasis.opendocument.chart base64 +odc application/vnd.oasis.opendocument.chart-template base64 +odb application/vnd.oasis.opendocument.database base64 +odf application/vnd.oasis.opendocument.formula base64 +odf application/vnd.oasis.opendocument.formula-template base64 +odg application/vnd.oasis.opendocument.graphics base64 +otg application/vnd.oasis.opendocument.graphics-template base64 +odi application/vnd.oasis.opendocument.image base64 +odi application/vnd.oasis.opendocument.image-template base64 +odp application/vnd.oasis.opendocument.presentation base64 +otp application/vnd.oasis.opendocument.presentation-template base64 +ods application/vnd.oasis.opendocument.spreadsheet base64 +ots application/vnd.oasis.opendocument.spreadsheet-template base64 +odt application/vnd.oasis.opendocument.text base64 +odm application/vnd.oasis.opendocument.text-master base64 +ott application/vnd.oasis.opendocument.text-template base64 +oth application/vnd.oasis.opendocument.text-web base64 +xo application/vnd.olpc-sugar base64 +dd2 application/vnd.oma.dd2+xml base64 +oxt application/vnd.openofficeorg.extension base64 +pptx application/vnd.openxmlformats-officedocument.presentationml.presentation base64 +sldx application/vnd.openxmlformats-officedocument.presentationml.slide base64 +ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow base64 +potx application/vnd.openxmlformats-officedocument.presentationml.template base64 +xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet base64 +xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template base64 +docx application/vnd.openxmlformats-officedocument.wordprocessingml.document base64 +dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template base64 +mgp application/vnd.osgeo.mapguide.package base64 +dp application/vnd.osgi.dp base64 +esa application/vnd.osgi.subsystem base64 +prc application/vnd.palm base64 +paw application/vnd.pawaafile base64 +str application/vnd.pg.format base64 +ei6 application/vnd.pg.osasli base64 +efif application/vnd.picsel base64 +wg application/vnd.pmi.widget base64 +plf application/vnd.pocketlearn base64 +pbd application/vnd.powerbuilder6 base64 +box application/vnd.previewsystems.box base64 +mgz application/vnd.proteus.magazine base64 +qps application/vnd.publishare-delta-tree base64 +pti application/vnd.pvi.ptid1 base64 +bed application/vnd.realvnc.bed base64 +mxl application/vnd.recordare.musicxml base64 +musicxml application/vnd.recordare.musicxml+xml base64 +cryptonote application/vnd.rig.cryptonote base64 +cod application/vnd.rim.cod base64 +rm application/vnd.rn-realmedia base64 +rmvb application/vnd.rn-realmedia-vbr base64 +link66 application/vnd.route66.link66+xml base64 +st application/vnd.sailingtracker.track base64 +sdoc application/vnd.sealed.doc base64 +seml application/vnd.sealed.eml base64 +smht application/vnd.sealed.mht base64 +sppt application/vnd.sealed.ppt base64 +sxls application/vnd.sealed.xls base64 +stml application/vnd.sealedmedia.softseal.html base64 +spdf application/vnd.sealedmedia.softseal.pdf base64 +see application/vnd.seemail base64 +sema application/vnd.sema base64 +semd application/vnd.semd base64 +semf application/vnd.semf base64 +ifm application/vnd.shana.informed.formdata base64 +itp application/vnd.shana.informed.formtemplate base64 +iif application/vnd.shana.informed.interchange base64 +ipk application/vnd.shana.informed.package base64 +mmf application/vnd.smaf base64 +teacher application/vnd.smart.teacher base64 +sdkd application/vnd.solent.sdkm+xml base64 +dxp application/vnd.spotfire.dxp base64 +sfs application/vnd.spotfire.sfs base64 +sdc application/vnd.stardivision.calc base64 +sds application/vnd.stardivision.chart base64 +sda application/vnd.stardivision.draw base64 +sdd application/vnd.stardivision.impress base64 +sdf application/vnd.stardivision.math base64 +sdw application/vnd.stardivision.writer base64 +sgl application/vnd.stardivision.writer-global base64 +smzip application/vnd.stepmania.package base64 +sm application/vnd.stepmania.stepchart base64 +sxc application/vnd.sun.xml.calc base64 +stc application/vnd.sun.xml.calc.template base64 +sxd application/vnd.sun.xml.draw base64 +std application/vnd.sun.xml.draw.template base64 +sxi application/vnd.sun.xml.impress base64 +sti application/vnd.sun.xml.impress.template base64 +sxm application/vnd.sun.xml.math base64 +sxw application/vnd.sun.xml.writer base64 +sxg application/vnd.sun.xml.writer.global base64 +stw application/vnd.sun.xml.writer.template base64 +sus application/vnd.sus-calendar base64 +svd application/vnd.svd base64 +sis application/vnd.symbian.install base64 +xsm application/vnd.syncml+xml base64 +bdm application/vnd.syncml.dm+wbxml base64 +xdm application/vnd.syncml.dm+xml base64 +tao application/vnd.tao.intent-module-archive base64 +cap application/vnd.tcpdump.pcap base64 +tmo application/vnd.tmobile-livetv base64 +tpt application/vnd.trid.tpt base64 +mxs application/vnd.triscape.mxs base64 +tra application/vnd.trueapp base64 +ufd application/vnd.ufdl base64 +utz application/vnd.uiq.theme base64 +umj application/vnd.umajin base64 +unityweb application/vnd.unity base64 +uoml application/vnd.uoml+xml base64 +vcx application/vnd.vcx base64 +vsc application/vnd.vidsoft.vidconference 8bit +vsd application/vnd.visio base64 +vis application/vnd.visionary base64 +vsf application/vnd.vsf base64 +sic application/vnd.wap.sic base64 +slc application/vnd.wap.slc base64 +wbxml application/vnd.wap.wbxml base64 +wmlc application/vnd.wap.wmlc base64 +wmlsc application/vnd.wap.wmlscriptc base64 +wtb application/vnd.webturbo base64 +nbp application/vnd.wolfram.player base64 +wpd application/vnd.wordperfect base64 +wqd application/vnd.wqd base64 +stf application/vnd.wt.stf base64 +wv application/vnd.wv.csp+wbxml base64 +xar application/vnd.xara base64 +xfdl application/vnd.xfdl base64 +hvd application/vnd.yamaha.hv-dic base64 +hvs application/vnd.yamaha.hv-script base64 +hvp application/vnd.yamaha.hv-voice base64 +osf application/vnd.yamaha.openscoreformat base64 +osfpvg application/vnd.yamaha.openscoreformat.osfpvg+xml base64 +saf application/vnd.yamaha.smaf-audio base64 +spf application/vnd.yamaha.smaf-phrase base64 +cmp application/vnd.yellowriver-custom-menu base64 +zir application/vnd.zul base64 +zaz application/vnd.zzazz.deck+xml base64 +vxml application/voicexml+xml base64 +wasm application/wasm 8bit +wif application/watcherinfo+xml base64 +wgt application/widget base64 +wp5 application/wordperfect5.1 base64 +wsdl application/wsdl+xml base64 +wspolicy application/wspolicy+xml base64 +wk application/x-123 base64 +7z application/x-7z-compressed base64 +bck application/x-VMSBACKUP base64 +wz application/x-Wingz base64 +abw application/x-abiword base64 +ace application/x-ace-compressed base64 +dmg application/x-apple-diskimage base64 +aab application/x-authorware-bin base64 +aam application/x-authorware-map base64 +aas application/x-authorware-seg base64 +bcpio application/x-bcpio base64 +torrent application/x-bittorrent base64 +bleep application/x-bleeper base64 +blb application/x-blorb base64 +bz application/x-bzip base64 +boz application/x-bzip2 base64 +cb7 application/x-cbr base64 +vcd application/x-cdlink base64 +cfs application/x-cfs-compressed base64 +chat application/x-chat base64 +pgn application/x-chess-pgn base64 +crx application/x-chrome-extension base64 +z application/x-compressed base64 +nsc application/x-conference base64 +cpio application/x-cpio base64 +csh application/x-csh 8bit +csm application/x-cu-seeme base64 +deb application/x-debian-package base64 +dgc application/x-dgc-compressed base64 +dcr application/x-director base64 +wad application/x-doom base64 +ncx application/x-dtbncx+xml base64 +dtb application/x-dtbook+xml base64 +res application/x-dtbresource+xml base64 +dvi application/x-dvi base64 +evy application/x-envoy base64 +eva application/x-eva base64 +bdf application/x-font-bdf base64 +gsf application/x-font-ghostscript base64 +psf application/x-font-linux-psf base64 +pcf application/x-font-pcf base64 +snf application/x-font-snf base64 +afm application/x-font-type1 base64 +arc application/x-freearc base64 +spl application/x-futuresplash base64 +gca application/x-gca-compressed base64 +ulx application/x-glulx base64 +gnumeric application/x-gnumeric base64 +gramps application/x-gramps-xml base64 +gtar application/x-gtar base64 +hdf application/x-hdf base64 +hep application/x-hep base64 +rhtml application/x-html+ruby 8bit +phtml application/x-httpd-php 8bit +ibooks application/x-ibooks+zip base64 +ica application/x-ica base64 +imagemap application/x-imagemap 8bit +install application/x-install-instructions base64 +iso application/x-iso9660-image base64 +key application/x-iwork-keynote-sffkey base64 +numbers application/x-iwork-numbers-sffnumbers base64 +pages application/x-iwork-pages-sffpages base64 +jnlp application/x-java-jnlp-file base64 +ltx application/x-latex 8bit +cpt application/x-mac-compactpro base64 +mie application/x-mie base64 +mobi application/x-mobipocket-ebook base64 +application application/x-ms-application base64 +exe application/x-ms-dos-executable base64 +lnk application/x-ms-shortcut base64 +wmd application/x-ms-wmd base64 +wmz application/x-ms-wmz base64 +xbap application/x-ms-xbap base64 +mda application/x-msaccess base64 +obd application/x-msbinder base64 +crd application/x-mscardfile base64 +clp application/x-msclip base64 +cmd application/x-msdos-program base64 +exe application/x-msdownload base64 +m13 application/x-msmediaview base64 +emf application/x-msmetafile base64 +mny application/x-msmoney base64 +pub application/x-mspublisher base64 +scd application/x-msschedule base64 +trm application/x-msterminal base64 +wri application/x-mswrite base64 +pac application/x-ns-proxy-autoconfig base64 +nzb application/x-nzb base64 +oex application/x-opera-extension base64 +pm application/x-pagemaker base64 +pl application/x-perl 8bit +p12 application/x-pkcs12 base64 +p7b application/x-pkcs7-certificates base64 +p7r application/x-pkcs7-certreqresp base64 +py application/x-python 8bit +qtl application/x-quicktimeplayer base64 +rar application/x-rar-compressed base64 +ris application/x-research-info-systems base64 +rb application/x-ruby 8bit +sh application/x-sh 8bit +shar application/x-shar 8bit +swf application/x-shockwave-flash base64 +xap application/x-silverlight-app base64 +notebook application/x-smarttech-notebook base64 +sav application/x-spss base64 +sql application/x-sql base64 +sit application/x-stuffit base64 +sitx application/x-stuffitx base64 +srt application/x-subrip base64 +sv4cpio application/x-sv4cpio base64 +sv4crc application/x-sv4crc base64 +t3 application/x-t3vm-image base64 +gam application/x-tads base64 +tar application/x-tar base64 +tcl application/x-tcl 8bit +tex application/x-tex 8bit +tfm application/x-tex-tfm base64 +texinfo application/x-texinfo 8bit +obj application/x-tgif base64 +tbk application/x-toolbook base64 +ustar application/x-ustar base64 +src application/x-wais-source base64 +webapp application/x-web-app-manifest+json base64 +wp6 application/x-wordperfect6.1 base64 +crt application/x-x509-ca-cert base64 +fig application/x-xfig base64 +xlf application/x-xliff+xml base64 +xpi application/x-xpinstall base64 +xz application/x-xz base64 +z1 application/x-zmachine base64 +xaml application/xaml+xml base64 +xdf application/xcap-diff+xml base64 +xenc application/xenc+xml base64 +xht application/xhtml+xml 8bit +xml application/xml 8bit +dtd application/xml-dtd 8bit +xop application/xop+xml base64 +xpl application/xproc+xml base64 +xslt application/xslt+xml base64 +xspf application/xspf+xml base64 +mxml application/xv+xml base64 +yang application/yang base64 +yin application/yin+xml base64 +zip application/zip base64 +amr audio/AMR base64 +awb audio/AMR-WB base64 +evc audio/EVRC base64 +l16 audio/L16 base64 +smv audio/SMV base64 +adp audio/adpcm base64 +au audio/basic base64 +kar audio/midi base64 +mp4 audio/mp4 base64 +mpga audio/mpeg base64 +oga audio/ogg base64 +s3m audio/s3m base64 +sil audio/silk base64 +uva audio/vnd.dece.audio base64 +eol audio/vnd.digital-winds 7bit +dra audio/vnd.dra base64 +dts audio/vnd.dts base64 +dtshd audio/vnd.dts.hd base64 +plj audio/vnd.everad.plj base64 +lvp audio/vnd.lucent.voice base64 +pya audio/vnd.ms-playready.media.pya base64 +mxmf audio/vnd.nokia.mobile-xmf base64 +vbk audio/vnd.nortel.vbk base64 +ecelp4800 audio/vnd.nuera.ecelp4800 base64 +ecelp7470 audio/vnd.nuera.ecelp7470 base64 +ecelp9600 audio/vnd.nuera.ecelp9600 base64 +qcp audio/vnd.qcelp base64 +rip audio/vnd.rip base64 +smp3 audio/vnd.sealedmedia.softseal.mpeg base64 +wav audio/wav base64 +weba audio/webm base64 +aac audio/x-aac base64 +aif audio/x-aiff base64 +caf audio/x-caf base64 +flac audio/x-flac base64 +mka audio/x-matroska base64 +m3u audio/x-mpegurl base64 +wax audio/x-ms-wax base64 +wma audio/x-ms-wma base64 +wmv audio/x-ms-wmv base64 +ra audio/x-pn-realaudio base64 +rmp audio/x-pn-realaudio-plugin base64 +xm audio/xm base64 +cdx chemical/x-cdx base64 +cif chemical/x-cif base64 +cmdf chemical/x-cmdf base64 +cml chemical/x-cml base64 +csml chemical/x-csml base64 +ttc font/collection base64 +otf font/otf base64 +ttf font/ttf base64 +woff font/woff base64 +woff2 font/woff2 base64 +avif image/avif base64 +bmp image/bmp base64 +cgm image/cgm base64 +g3 image/g3fax base64 +gif image/gif base64 +heic image/heic base64 +heics image/heic-sequence base64 +heif image/heif base64 +heifs image/heif-sequence base64 +ief image/ief base64 +jp2 image/jp2 base64 +jpeg image/jpeg base64 +jpm image/jpm base64 +jpx image/jpx base64 +ktx image/ktx base64 +png image/png base64 +btif image/prs.btif base64 +sgi image/sgi base64 +svg image/svg+xml 8bit +tiff image/tiff base64 +psd image/vnd.adobe.photoshop base64 +uvg image/vnd.dece.graphic base64 +djvu image/vnd.djvu base64 +sub image/vnd.dvb.subtitle base64 +dwg image/vnd.dwg base64 +dxf image/vnd.dxf base64 +fbs image/vnd.fastbidsheet base64 +fpx image/vnd.fpx base64 +fst image/vnd.fst base64 +mmr image/vnd.fujixerox.edmics-mmr base64 +rlc image/vnd.fujixerox.edmics-rlc base64 +pgb image/vnd.globalgraphics.pgb base64 +ico image/vnd.microsoft.icon base64 +mdi image/vnd.ms-modi base64 +wdp image/vnd.ms-photo base64 +npx image/vnd.net-fpx base64 +wbmp image/vnd.wap.wbmp base64 +xif image/vnd.xiff base64 +webp image/webp base64 +3ds image/x-3ds base64 +dng image/x-adobe-dng base64 +cr2 image/x-canon-cr2 base64 +crw image/x-canon-crw base64 +ras image/x-cmu-raster base64 +cmx image/x-cmx base64 +xcfbz2 image/x-compressed-xcf base64 +erf image/x-epson-erf base64 +fh image/x-freehand base64 +raf image/x-fuji-raf base64 +3fr image/x-hasselblad-3fr base64 +k25 image/x-kodak-k25 base64 +kdc image/x-kodak-kdc base64 +mrw image/x-minolta-mrw base64 +sid image/x-mrsid-image base64 +nef image/x-nikon-nef base64 +orf image/x-olympus-orf base64 +psp image/x-paintshoppro base64 +raw image/x-panasonic-raw base64 +pcx image/x-pcx base64 +pef image/x-pentax-pef base64 +pct image/x-pict base64 +pnm image/x-portable-anymap base64 +pbm image/x-portable-bitmap base64 +pgm image/x-portable-graymap base64 +ppm image/x-portable-pixmap base64 +rgb image/x-rgb base64 +x3f image/x-sigma-x3f base64 +arw image/x-sony-arw base64 +sr2 image/x-sony-sr2 base64 +srf image/x-sony-srf base64 +tga image/x-targa base64 +dgn image/x-vnd.dgn base64 +xbm image/x-xbitmap 7bit +xcf image/x-xcf base64 +xpm image/x-xpixmap 8bit +xwd image/x-xwindowdump base64 +eml message/rfc822 8bit +igs model/iges base64 +msh model/mesh base64 +dae model/vnd.collada+xml base64 +dwf model/vnd.dwf base64 +gdl model/vnd.gdl base64 +gtw model/vnd.gtw base64 +mts model/vnd.mts base64 +x_b model/vnd.parasolid.transmit.binary base64 +x_t model/vnd.parasolid.transmit.text quoted-printable +vtu model/vnd.vtu base64 +wrl model/vrml base64 +x3db model/x3d+binary base64 +x3dv model/x3d+vrml base64 +x3d model/x3d+xml base64 +appcache text/cache-manifest quoted-printable +ics text/calendar quoted-printable +css text/css 8bit +csv text/csv 8bit +html text/html 8bit +markdown text/markdown quoted-printable +n3 text/n3 quoted-printable +txt text/plain quoted-printable +dsc text/prs.lines.tag quoted-printable +rtx text/richtext 8bit +sgml text/sgml quoted-printable +tsv text/tab-separated-values quoted-printable +t text/troff 8bit +ttl text/turtle quoted-printable +uri text/uri-list quoted-printable +vcard text/vcard quoted-printable +dcurl text/vnd.curl.dcurl quoted-printable +mcurl text/vnd.curl.mcurl quoted-printable +scurl text/vnd.curl.scurl quoted-printable +fly text/vnd.fly quoted-printable +flx text/vnd.fmi.flexstor quoted-printable +gv text/vnd.graphviz quoted-printable +3dml text/vnd.in3d.3dml quoted-printable +spot text/vnd.in3d.spot quoted-printable +ccc text/vnd.net2phone.commcenter.command quoted-printable +jad text/vnd.sun.j2me.app-descriptor 8bit +si text/vnd.wap.si quoted-printable +sl text/vnd.wap.sl quoted-printable +wml text/vnd.wap.wml quoted-printable +wmls text/vnd.wap.wmlscript quoted-printable +vtt text/vtt quoted-printable +asm text/x-asm quoted-printable +c text/x-c quoted-printable +coffee text/x-coffescript 8bit +htc text/x-component 8bit +f text/x-fortran quoted-printable +java text/x-java-source quoted-printable +nfo text/x-nfo quoted-printable +opml text/x-opml quoted-printable +p text/x-pascal quoted-printable +etx text/x-setext quoted-printable +sfv text/x-sfv quoted-printable +uu text/x-uuencode quoted-printable +vcs text/x-vcalendar 8bit +vcf text/x-vcard 8bit +yaml text/x-yaml 8bit +xml text/xml 8bit +3gp video/3gpp base64 +3g2 video/3gpp2 base64 +dv video/DV base64 +h261 video/H261 base64 +h263 video/H263 base64 +h264 video/H264 base64 +jpgv video/JPEG base64 +mj2 video/MJ2 base64 +ts video/MP2T base64 +mp4 video/mp4 base64 +mp2 video/mpeg base64 +ogg video/ogg base64 +qt video/quicktime base64 +uvh video/vnd.dece.hd base64 +uvm video/vnd.dece.mobile base64 +uvp video/vnd.dece.pd base64 +uvs video/vnd.dece.sd base64 +uvv video/vnd.dece.video base64 +dvb video/vnd.dvb.file base64 +fvt video/vnd.fvt base64 +mxu video/vnd.mpegurl 8bit +pyv video/vnd.ms-playready.media.pyv base64 +nim video/vnd.nokia.interleaved-multimedia base64 +mp4 video/vnd.objectvideo base64 +s11 video/vnd.sealed.mpeg1 base64 +smpg video/vnd.sealed.mpeg4 base64 +sswf video/vnd.sealed.swf base64 +smov video/vnd.sealedmedia.softseal.mov base64 +uvu video/vnd.uvvu.mp4 base64 +viv video/vnd.vivo base64 +dl video/x-dl base64 +fli video/x-fli base64 +flv video/x-flv base64 +gl video/x-gl base64 +ivf video/x-ivf base64 +mk3d video/x-matroska base64 +mng video/x-mng base64 +mjpg video/x-motion-jpeg base64 +asf video/x-ms-asf base64 +vob video/x-ms-vob base64 +wm video/x-ms-wm base64 +wmx video/x-ms-wmx base64 +wvx video/x-ms-wvx base64 +avi video/x-msvideo base64 +movie video/x-sgi-movie base64 +xyz x-chemical/x-xyz base64 +ice x-conference/x-cooltalk base64 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/ext_mime.db b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/ext_mime.db new file mode 100644 index 0000000..a07c697 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/ext_mime.db @@ -0,0 +1,1198 @@ +123 application/vnd.lotus-1-2-3 base64 +3dml text/vnd.in3d.3dml quoted-printable +3ds image/x-3ds base64 +3fr image/x-hasselblad-3fr base64 +3g2 video/3gpp2 base64 +3gp video/3gpp base64 +3gpp video/3gpp base64 +3gpp2 video/3gpp2 base64 +7z application/x-7z-compressed base64 +@dir application/x-director base64 +@dxr application/x-director base64 +aab application/x-authorware-bin base64 +aac audio/x-aac base64 +aam application/x-authorware-map base64 +aas application/x-authorware-seg base64 +abw application/x-abiword base64 +ac application/pkix-attr-cert base64 +acc application/vnd.americandynamics.acc base64 +ace application/x-ace-compressed base64 +acu application/vnd.acucobol base64 +acutc application/vnd.acucorp 7bit +adp audio/adpcm base64 +aep application/vnd.audiograph base64 +afm application/x-font-type1 base64 +afp application/vnd.ibm.modcap base64 +ahead application/vnd.ahead.space base64 +ai application/pdf base64 +aif audio/x-aiff base64 +aifc audio/x-aiff base64 +aiff audio/x-aiff base64 +air application/vnd.adobe.air-application-installer-package+zip base64 +ait application/vnd.dvb.ait base64 +ami application/vnd.amiga.ami base64 +amr audio/AMR base64 +ani application/octet-stream base64 +apk application/vnd.android.package-archive base64 +appcache text/cache-manifest quoted-printable +application application/x-ms-application base64 +apr application/vnd.lotus-approach base64 +arc application/x-freearc base64 +arw image/x-sony-arw base64 +asc application/pgp-signature base64 +asf application/vnd.ms-asf base64 +asm text/x-asm quoted-printable +aso application/vnd.accpac.simply.aso base64 +asx video/x-ms-asf base64 +atc application/vnd.acucorp 7bit +atom application/atom+xml 8bit +atomcat application/atomcat+xml 8bit +atomsvc application/atomsvc+xml 8bit +atx application/vnd.antix.game-component base64 +au audio/basic base64 +avi video/x-msvideo base64 +avif image/avif base64 +aw application/applixware base64 +awb audio/AMR-WB base64 +azf application/vnd.airzip.filesecure.azf base64 +azs application/vnd.airzip.filesecure.azs base64 +azw application/vnd.amazon.ebook base64 +bat application/x-msdos-program base64 +bck application/x-VMSBACKUP base64 +bcpio application/x-bcpio base64 +bdf application/x-font-bdf base64 +bdm application/vnd.syncml.dm+wbxml base64 +bed application/vnd.realvnc.bed base64 +bh2 application/vnd.fujitsu.oasysprs base64 +bin application/octet-stream base64 +bkm application/vnd.nervana base64 +blb application/x-blorb base64 +bleep application/x-bleeper base64 +blorb application/x-blorb base64 +bmi application/vnd.bmi base64 +bmp image/bmp base64 +book application/vnd.framemaker base64 +box application/vnd.previewsystems.box base64 +boz application/x-bzip2 base64 +bpd application/vnd.hbci base64 +bpk application/octet-stream base64 +btif image/prs.btif base64 +bz application/x-bzip base64 +bz2 application/x-bzip2 base64 +c text/plain quoted-printable +c11amc application/vnd.cluetrust.cartomobile-config base64 +c11amz application/vnd.cluetrust.cartomobile-config-pkg base64 +c4d application/vnd.clonk.c4group base64 +c4f application/vnd.clonk.c4group base64 +c4g application/vnd.clonk.c4group base64 +c4p application/vnd.clonk.c4group base64 +c4u application/vnd.clonk.c4group base64 +cab application/vnd.ms-cab-compressed base64 +caf audio/x-caf base64 +cap application/vnd.tcpdump.pcap base64 +car application/vnd.curl.car base64 +cat application/vnd.ms-pki.seccat base64 +cb7 application/x-cbr base64 +cba application/x-cbr base64 +cbr application/x-cbr base64 +cbt application/x-cbr base64 +cbz application/x-cbr base64 +cc text/plain quoted-printable +ccc text/vnd.net2phone.commcenter.command quoted-printable +cct application/x-director base64 +ccxml application/ccxml+xml base64 +cdbcmsg application/vnd.contact.cmsg base64 +cdf application/netcdf base64 +cdkey application/vnd.mediastation.cdkey base64 +cdmia application/cdmi-capability base64 +cdmic application/cdmi-container base64 +cdmid application/cdmi-domain base64 +cdmio application/cdmi-object base64 +cdmiq application/cdmi-queue base64 +cdx chemical/x-cdx base64 +cdxml application/vnd.chemdraw+xml base64 +cdy application/vnd.cinderella base64 +cer application/pkix-cert base64 +cfs application/x-cfs-compressed base64 +cgm image/cgm base64 +chat application/x-chat base64 +chm application/vnd.ms-htmlhelp base64 +chrt application/vnd.kde.kchart base64 +cif chemical/x-cif base64 +cii application/vnd.anser-web-certificate-issue-initiation base64 +cil application/vnd.ms-artgalry base64 +cla application/vnd.claymore base64 +class application/octet-stream base64 +clkk application/vnd.crick.clicker.keyboard base64 +clkp application/vnd.crick.clicker.palette base64 +clkt application/vnd.crick.clicker.template base64 +clkw application/vnd.crick.clicker.wordbank base64 +clkx application/vnd.crick.clicker base64 +clp application/x-msclip base64 +clpi video/MP2T base64 +cmc application/vnd.cosmocaller base64 +cmd application/x-msdos-program base64 +cmdf chemical/x-cmdf base64 +cml chemical/x-cml base64 +cmp application/vnd.yellowriver-custom-menu base64 +cmx image/x-cmx base64 +cod application/vnd.rim.cod base64 +coffee text/x-coffescript 8bit +com application/x-msdos-program base64 +conf text/plain quoted-printable +cpi video/MP2T base64 +cpio application/x-cpio base64 +cpp text/plain quoted-printable +cpt application/x-mac-compactpro base64 +cr2 image/x-canon-cr2 base64 +crd application/x-mscardfile base64 +crl application/pkix-crl base64 +crt application/x-x509-ca-cert base64 +crw image/x-canon-crw base64 +crx application/x-chrome-extension base64 +cryptonote application/vnd.rig.cryptonote base64 +csh application/x-csh 8bit +csm application/x-cu-seeme base64 +csml chemical/x-csml base64 +csp application/vnd.commonspace base64 +css text/css 8bit +cst application/x-director base64 +csv text/csv 8bit +cu application/cu-seeme base64 +curl application/vnd.curl base64 +cw application/prs.cww base64 +cww application/prs.cww base64 +cxt application/x-director base64 +cxx text/x-c quoted-printable +dae model/vnd.collada+xml base64 +daf application/vnd.Mobius.DAF base64 +dart application/vnd.dart base64 +dat text/plain quoted-printable +dataless application/vnd.fdsn.seed base64 +davmount application/davmount+xml base64 +dbk application/docbook+xml base64 +dcm application/dicom base64 +dcr application/x-director base64 +dcurl text/vnd.curl.dcurl quoted-printable +dd2 application/vnd.oma.dd2+xml base64 +ddd application/vnd.fujixerox.ddd base64 +deb application/x-debian-package base64 +def text/plain quoted-printable +deploy application/octet-stream base64 +der application/x-x509-ca-cert base64 +dfac application/vnd.dreamfactory base64 +dgc application/x-dgc-compressed base64 +dgn image/x-vnd.dgn base64 +dic text/x-c quoted-printable +dir application/x-director base64 +dis application/vnd.Mobius.DIS base64 +dist application/octet-stream base64 +distz application/octet-stream base64 +djv image/vnd.djvu base64 +djvu image/vnd.djvu base64 +dl video/x-dl base64 +dll application/octet-stream base64 +dmg application/x-apple-diskimage base64 +dmp application/vnd.tcpdump.pcap base64 +dms application/octet-stream base64 +dna application/vnd.dna base64 +dng image/x-adobe-dng base64 +doc application/msword base64 +docm application/vnd.ms-word.document.macroEnabled.12 base64 +docx application/vnd.openxmlformats-officedocument.wordprocessingml.document base64 +dot application/msword base64 +dotm application/vnd.ms-word.template.macroEnabled.12 base64 +dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template base64 +dp application/vnd.osgi.dp base64 +dpg application/vnd.dpgraph base64 +dra audio/vnd.dra base64 +dsc text/prs.lines.tag quoted-printable +dssc application/dssc+der base64 +dtb application/x-dtbook+xml base64 +dtd application/xml-dtd 8bit +dts audio/vnd.dts base64 +dtshd audio/vnd.dts.hd base64 +dump application/octet-stream base64 +dv video/DV base64 +dvb video/vnd.dvb.file base64 +dvi application/x-dvi base64 +dwf model/vnd.dwf base64 +dwg image/vnd.dwg base64 +dxf image/vnd.dxf base64 +dxp application/vnd.spotfire.dxp base64 +dxr application/x-director base64 +dylib application/octet-stream base64 +ecelp4800 audio/vnd.nuera.ecelp4800 base64 +ecelp7470 audio/vnd.nuera.ecelp7470 base64 +ecelp9600 audio/vnd.nuera.ecelp9600 base64 +ecma application/ecmascript base64 +edm application/vnd.novadigm.EDM base64 +edx application/vnd.novadigm.EDX base64 +efif application/vnd.picsel base64 +ei6 application/vnd.pg.osasli base64 +elc application/octet-stream base64 +emf application/x-msmetafile base64 +eml message/rfc822 8bit +emm application/vnd.ibm.electronic-media base64 +emma application/emma+xml base64 +emz application/x-msmetafile base64 +ent application/vnd.nervana base64 +entity application/vnd.nervana base64 +eol audio/vnd.digital-winds 7bit +eot application/vnd.ms-fontobject base64 +eps application/postscript 8bit +epub application/epub+zip base64 +erf image/x-epson-erf base64 +es application/ecmascript base64 +es3 application/vnd.eszigno3+xml base64 +esa application/vnd.osgi.subsystem base64 +esf application/vnd.epson.esf base64 +et3 application/vnd.eszigno3+xml base64 +etx text/x-setext quoted-printable +eva application/x-eva base64 +evc audio/EVRC base64 +evy application/x-envoy base64 +exe application/x-ms-dos-executable base64 +exi application/exi base64 +ext application/vnd.novadigm.EXT base64 +ez application/andrew-inset base64 +ez2 application/vnd.ezpix-album base64 +ez3 application/vnd.ezpix-package base64 +f text/x-fortran quoted-printable +f4a audio/mp4 base64 +f4b audio/mp4 base64 +f4p video/mp4 base64 +f4v video/mp4 base64 +f77 text/x-fortran quoted-printable +f90 text/x-fortran quoted-printable +fb application/vnd.framemaker base64 +fbdoc application/vnd.framemaker base64 +fbs image/vnd.fastbidsheet base64 +fcdt application/vnd.adobe.formscentral.fcdt base64 +fcs application/vnd.isac.fcs base64 +fdf application/vnd.fdf base64 +fe_launch application/vnd.denovo.fcselayout-link base64 +fg5 application/vnd.fujitsu.oasysgp base64 +fgd application/x-director base64 +fh image/x-freehand base64 +fh4 image/x-freehand base64 +fh5 image/x-freehand base64 +fh7 image/x-freehand base64 +fhc image/x-freehand base64 +fig application/x-xfig base64 +flac audio/x-flac base64 +fli video/x-fli base64 +flo application/vnd.micrografx.flo base64 +flv video/x-flv base64 +flw application/vnd.kde.kivio base64 +flx text/vnd.fmi.flexstor quoted-printable +fly text/vnd.fly quoted-printable +fm application/vnd.framemaker base64 +fnc application/vnd.frogans.fnc base64 +for text/x-fortran quoted-printable +fpx image/vnd.fpx base64 +frame application/vnd.framemaker base64 +frm application/vnd.framemaker base64 +fsc application/vnd.fsc.weblaunch 7bit +fst image/vnd.fst base64 +ftc application/vnd.fluxtime.clip base64 +fti application/vnd.anser-web-funds-transfer-initiation base64 +fvt video/vnd.fvt base64 +fxp application/vnd.adobe.fxp base64 +fxpl application/vnd.adobe.fxp base64 +fzs application/vnd.fuzzysheet base64 +g2w application/vnd.geoplan base64 +g3 image/g3fax base64 +g3w application/vnd.geospace base64 +gac application/vnd.groove-account base64 +gam application/x-tads base64 +gbr application/rpki-ghostbusters base64 +gca application/x-gca-compressed base64 +gdl model/vnd.gdl base64 +geo application/vnd.dynageo base64 +gex application/vnd.geometry-explorer base64 +ggb application/vnd.geogebra.file base64 +ggt application/vnd.geogebra.tool base64 +ghf application/vnd.groove-help base64 +gif image/gif base64 +gim application/vnd.groove-identity-message base64 +gl video/x-gl base64 +gml application/gml+xml base64 +gmx application/vnd.gmx base64 +gnumeric application/x-gnumeric base64 +gpg application/octet-stream base64 +gph application/vnd.FloGraphIt base64 +gpx application/gpx+xml base64 +gqf application/vnd.grafeq base64 +gqs application/vnd.grafeq base64 +gram application/srgs base64 +gramps application/x-gramps-xml base64 +gre application/vnd.geometry-explorer base64 +grv application/vnd.groove-injector base64 +grxml application/srgs+xml base64 +gsf application/x-font-ghostscript base64 +gtar application/x-gtar base64 +gtm application/vnd.groove-tool-message base64 +gtw model/vnd.gtw base64 +gv text/vnd.graphviz quoted-printable +gxf application/gxf base64 +gxt application/vnd.geonext base64 +gz application/gzip base64 +h text/plain quoted-printable +h261 video/H261 base64 +h263 video/H263 base64 +h264 video/H264 base64 +hal application/vnd.hal+xml base64 +hbc application/vnd.hbci base64 +hbci application/vnd.hbci base64 +hdf application/x-hdf base64 +heic image/heic base64 +heics image/heic-sequence base64 +heif image/heif base64 +heifs image/heif-sequence base64 +hep application/x-hep base64 +hh text/plain quoted-printable +hif image/heic base64 +hlp text/plain quoted-printable +hpgl application/vnd.hp-HPGL base64 +hpid application/vnd.hp-hpid base64 +hpp text/plain quoted-printable +hps application/vnd.hp-hps base64 +hqx application/mac-binhex40 8bit +htc text/x-component 8bit +htke application/vnd.kenameaapp base64 +htm text/html 8bit +html text/html 8bit +htmlx text/html 8bit +htx text/html 8bit +hvd application/vnd.yamaha.hv-dic base64 +hvp application/vnd.yamaha.hv-voice base64 +hvs application/vnd.yamaha.hv-script base64 +i2g application/vnd.intergeo base64 +ibooks application/x-ibooks+zip base64 +ica application/x-ica base64 +icc application/vnd.iccprofile base64 +ice x-conference/x-cooltalk base64 +icm application/vnd.iccprofile base64 +ico image/vnd.microsoft.icon base64 +ics text/calendar quoted-printable +ief image/ief base64 +ifb text/calendar quoted-printable +ifm application/vnd.shana.informed.formdata base64 +iges model/iges base64 +igl application/vnd.igloader base64 +igm application/vnd.insors.igm base64 +igs model/iges base64 +igx application/vnd.micrografx.igx base64 +iif application/vnd.shana.informed.interchange base64 +imagemap application/x-imagemap 8bit +imap application/x-imagemap 8bit +imp application/vnd.accpac.simply.imp base64 +ims application/vnd.ms-ims base64 +in text/plain quoted-printable +ink application/inkml+xml base64 +inkml application/inkml+xml base64 +install application/x-install-instructions base64 +iota application/vnd.astraea-software.iota base64 +ipa application/octet-stream base64 +ipfix application/ipfix base64 +ipk application/vnd.shana.informed.package base64 +irm application/vnd.ibm.rights-management base64 +irp application/vnd.irepository.package+xml base64 +iso application/x-iso9660-image base64 +itp application/vnd.shana.informed.formtemplate base64 +ivf video/x-ivf base64 +ivp application/vnd.immervision-ivp base64 +ivu application/vnd.immervision-ivu base64 +jad text/vnd.sun.j2me.app-descriptor 8bit +jam application/vnd.jam base64 +jar application/java-archive base64 +java text/x-java-source quoted-printable +jisp application/vnd.jisp base64 +jlt application/vnd.hp-jlyt base64 +jnlp application/x-java-jnlp-file base64 +joda application/vnd.joost.joda-archive base64 +jp2 image/jp2 base64 +jpe image/jpeg base64 +jpeg image/jpeg base64 +jpf image/jpx base64 +jpg image/jpeg base64 +jpg2 image/jp2 base64 +jpgm image/jpm base64 +jpgv video/JPEG base64 +jpm image/jpm base64 +jpx image/jpx base64 +js application/javascript 8bit +json application/json 8bit +jsonml application/jsonml+json base64 +k25 image/x-kodak-k25 base64 +kar audio/midi base64 +karbon application/vnd.kde.karbon base64 +kcm application/vnd.nervana base64 +kdc image/x-kodak-kdc base64 +key application/x-iwork-keynote-sffkey base64 +kfo application/vnd.kde.kformula base64 +kia application/vnd.kidspiration base64 +kml application/vnd.google-earth.kml+xml 8bit +kmz application/vnd.google-earth.kmz 8bit +kne application/vnd.Kinar base64 +knp application/vnd.Kinar base64 +kom application/vnd.hbci base64 +kon application/vnd.kde.kontour base64 +kpr application/vnd.kde.kpresenter base64 +kpt application/vnd.kde.kpresenter base64 +kpxx application/vnd.ds-keypoint base64 +ksp application/vnd.kde.kspread base64 +ktr application/vnd.kahootz base64 +ktx image/ktx base64 +ktz application/vnd.kahootz base64 +kwd application/vnd.kde.kword base64 +kwt application/vnd.kde.kword base64 +l16 audio/L16 base64 +lasxml application/vnd.las.las+xml base64 +latex application/x-latex 8bit +lbd application/vnd.llamagraphics.life-balance.desktop base64 +lbe application/vnd.llamagraphics.life-balance.exchange+xml base64 +les application/vnd.hhe.lesson-player base64 +lha application/octet-stream base64 +link66 application/vnd.route66.link66+xml base64 +list text/plain quoted-printable +list3820 application/vnd.ibm.modcap base64 +listafp application/vnd.ibm.modcap base64 +lnk application/x-ms-shortcut base64 +log text/plain quoted-printable +lostxml application/lost+xml base64 +lrf application/octet-stream base64 +lrm application/vnd.ms-lrm base64 +ltf application/vnd.frogans.ltf base64 +ltx application/x-latex 8bit +lvp audio/vnd.lucent.voice base64 +lwp application/vnd.lotus-wordpro base64 +lzh application/octet-stream base64 +m13 application/x-msmediaview base64 +m14 application/x-msmediaview base64 +m1v video/mpeg base64 +m21 application/mp21 base64 +m2a audio/mpeg base64 +m2ts video/MP2T base64 +m2v video/mpeg base64 +m3a audio/mpeg base64 +m3u audio/x-mpegurl base64 +m3u8 application/vnd.apple.mpegurl base64 +m4a audio/mp4 base64 +m4u video/vnd.mpegurl 8bit +m4v video/vnd.objectvideo base64 +ma application/mathematica base64 +mads application/mads+xml base64 +mag application/vnd.ecowin.chart base64 +maker application/vnd.framemaker base64 +man text/troff 8bit +manifest text/cache-manifest quoted-printable +mar application/octet-stream base64 +markdown text/markdown quoted-printable +mathml application/mathml+xml base64 +mb application/mathematica base64 +mbk application/vnd.Mobius.MBK base64 +mbox application/mbox base64 +mc1 application/vnd.medcalcdata base64 +mcd application/vnd.mcd base64 +mcurl text/vnd.curl.mcurl quoted-printable +md text/markdown quoted-printable +mda application/x-msaccess base64 +mdb application/x-msaccess base64 +mde application/x-msaccess base64 +mdf application/x-msaccess base64 +mdi image/vnd.ms-modi base64 +me text/troff 8bit +mesh model/mesh base64 +meta4 application/metalink4+xml base64 +metalink application/metalink+xml base64 +mets application/mets+xml base64 +mfm application/vnd.mfmp base64 +mft application/rpki-manifest base64 +mgp application/vnd.osgeo.mapguide.package base64 +mgz application/vnd.proteus.magazine base64 +mid audio/midi base64 +midi audio/midi base64 +mie application/x-mie base64 +mif application/vnd.mif base64 +mime message/rfc822 8bit +mj2 video/MJ2 base64 +mjp2 video/MJ2 base64 +mjpeg video/x-motion-jpeg base64 +mjpg video/x-motion-jpeg base64 +mjs application/javascript 8bit +mk3d video/x-matroska base64 +mka audio/x-matroska base64 +mkd text/markdown quoted-printable +mks video/x-matroska base64 +mkv video/x-matroska base64 +mlp application/vnd.dolby.mlp base64 +mmd application/vnd.chipnuts.karaoke-mmd base64 +mmf application/vnd.smaf base64 +mmr image/vnd.fujixerox.edmics-mmr base64 +mng video/x-mng base64 +mny application/x-msmoney base64 +mobi application/x-mobipocket-ebook base64 +mods application/mods+xml base64 +mov video/quicktime base64 +movie video/x-sgi-movie base64 +mp2 audio/mpeg base64 +mp21 application/mp21 base64 +mp2a audio/mpeg base64 +mp3 audio/mpeg base64 +mp3g video/mpeg base64 +mp4 application/mp4 base64 +mp4a audio/mp4 base64 +mp4s application/mp4 base64 +mp4v video/mp4 base64 +mpc application/vnd.mophun.certificate base64 +mpe video/mpeg base64 +mpeg video/mpeg base64 +mpg video/mpeg base64 +mpg4 application/mp4 base64 +mpga audio/mpeg base64 +mpkg application/vnd.apple.installer+xml base64 +mpl video/MP2T base64 +mpls video/MP2T base64 +mpm application/vnd.blueice.multipass base64 +mpn application/vnd.mophun.application base64 +mpp application/vnd.ms-project base64 +mpt application/vnd.ms-project base64 +mpy application/vnd.ibm.MiniPay base64 +mqy application/vnd.Mobius.MQY base64 +mrc application/marc base64 +mrcx application/marcxml+xml base64 +mrw image/x-minolta-mrw base64 +ms text/troff 8bit +mscml application/mediaservercontrol+xml base64 +mseed application/vnd.fdsn.mseed base64 +mseq application/vnd.mseq base64 +msf application/vnd.epson.msf base64 +msg application/vnd.ms-outlook base64 +msh model/mesh base64 +msi application/x-msdownload base64 +msl application/vnd.Mobius.MSL base64 +msty application/vnd.muvee.style base64 +mts model/vnd.mts base64 +mus application/vnd.musician base64 +musicxml application/vnd.recordare.musicxml+xml base64 +mvb application/x-msmediaview base64 +mwf application/vnd.MFER base64 +mxf application/mxf base64 +mxl application/vnd.recordare.musicxml base64 +mxmf audio/vnd.nokia.mobile-xmf base64 +mxml application/xv+xml base64 +mxs application/vnd.triscape.mxs base64 +mxu video/vnd.mpegurl 8bit +n-gage application/vnd.nokia.n-gage.symbian.install base64 +n3 text/n3 quoted-printable +nb application/mathematica base64 +nbp application/vnd.wolfram.player base64 +nc application/netcdf base64 +ncx application/x-dtbncx+xml base64 +nef image/x-nikon-nef base64 +nfo text/x-nfo quoted-printable +ngdat application/vnd.nokia.n-gage.data base64 +nim video/vnd.nokia.interleaved-multimedia base64 +nitf application/vnd.nitf base64 +nlu application/vnd.neurolanguage.nlu base64 +nml application/vnd.enliven base64 +nnd application/vnd.noblenet-directory base64 +nns application/vnd.noblenet-sealer base64 +nnw application/vnd.noblenet-web base64 +notebook application/x-smarttech-notebook base64 +npx image/vnd.net-fpx base64 +nsc application/x-conference base64 +nsf application/vnd.lotus-notes base64 +ntf application/vnd.nitf base64 +numbers application/x-iwork-numbers-sffnumbers base64 +nzb application/x-nzb base64 +oa2 application/vnd.fujitsu.oasys2 base64 +oa3 application/vnd.fujitsu.oasys3 base64 +oas application/vnd.fujitsu.oasys base64 +obd application/x-msbinder base64 +obj application/x-tgif base64 +oda application/oda base64 +odb application/vnd.oasis.opendocument.database base64 +odc application/vnd.oasis.opendocument.chart base64 +odf application/vnd.oasis.opendocument.formula base64 +odft application/vnd.oasis.opendocument.formula-template base64 +odg application/vnd.oasis.opendocument.graphics base64 +odi application/vnd.oasis.opendocument.image base64 +odm application/vnd.oasis.opendocument.text-master base64 +odp application/vnd.oasis.opendocument.presentation base64 +ods application/vnd.oasis.opendocument.spreadsheet base64 +odt application/vnd.oasis.opendocument.text base64 +oex application/x-opera-extension base64 +oga audio/ogg base64 +ogg audio/ogg base64 +ogv video/ogg base64 +ogx application/ogg base64 +omdoc application/omdoc+xml base64 +onepkg application/onenote base64 +onetmp application/onenote base64 +onetoc application/onenote base64 +onetoc2 application/onenote base64 +opf application/oebps-package+xml base64 +opml text/x-opml quoted-printable +oprc application/vnd.palm base64 +opus audio/ogg base64 +orf image/x-olympus-orf base64 +org application/vnd.lotus-organizer base64 +osf application/vnd.yamaha.openscoreformat base64 +osfpvg application/vnd.yamaha.openscoreformat.osfpvg+xml base64 +otc application/vnd.oasis.opendocument.chart-template base64 +otf font/otf base64 +otg application/vnd.oasis.opendocument.graphics-template base64 +oth application/vnd.oasis.opendocument.text-web base64 +oti application/vnd.oasis.opendocument.image-template base64 +otp application/vnd.oasis.opendocument.presentation-template base64 +ots application/vnd.oasis.opendocument.spreadsheet-template base64 +ott application/vnd.oasis.opendocument.text-template base64 +oxps application/oxps base64 +oxt application/vnd.openofficeorg.extension base64 +p text/x-pascal quoted-printable +p10 application/pkcs10 base64 +p12 application/x-pkcs12 base64 +p7b application/x-pkcs7-certificates base64 +p7c application/pkcs7-mime base64 +p7m application/pkcs7-mime base64 +p7r application/x-pkcs7-certreqresp base64 +p7s application/pkcs7-signature base64 +p8 application/pkcs8 base64 +pac application/x-ns-proxy-autoconfig base64 +pages application/x-iwork-pages-sffpages base64 +pas text/x-pascal quoted-printable +paw application/vnd.pawaafile base64 +pbd application/vnd.powerbuilder6 base64 +pbm image/x-portable-bitmap base64 +pcap application/vnd.tcpdump.pcap base64 +pcf application/x-font-pcf base64 +pcl application/vnd.hp-PCL base64 +pclxl application/vnd.hp-PCLXL base64 +pct image/x-pict base64 +pcurl application/vnd.curl.pcurl base64 +pcx image/x-pcx base64 +pdb application/vnd.palm base64 +pdf application/pdf base64 +pef image/x-pentax-pef base64 +pfa application/x-font-type1 base64 +pfb application/x-font-type1 base64 +pfm application/x-font-type1 base64 +pfr application/font-tdpfr base64 +pfx application/x-pkcs12 base64 +pgb image/vnd.globalgraphics.pgb base64 +pgm image/x-portable-graymap base64 +pgn application/x-chess-pgn base64 +pgp application/octet-stream base64 +php application/x-httpd-php 8bit +pht application/x-httpd-php 8bit +phtml application/x-httpd-php 8bit +pic image/x-pict base64 +pkd application/vnd.hbci base64 +pkg application/octet-stream base64 +pki application/pkixcmp base64 +pkipath application/pkix-pkipath base64 +pkpass application/vnd.apple.pkpass base64 +pl application/x-perl 8bit +plb application/vnd.3gpp.pic-bw-large base64 +plc application/vnd.Mobius.PLC base64 +plf application/vnd.pocketlearn base64 +plj audio/vnd.everad.plj base64 +pls application/pls+xml base64 +plt application/vnd.hp-HPGL base64 +pm application/x-pagemaker base64 +pm5 application/x-pagemaker base64 +pml application/vnd.ctc-posml base64 +png image/png base64 +pnm image/x-portable-anymap base64 +portpkg application/vnd.macports.portpkg base64 +pot application/vnd.ms-powerpoint base64 +potm application/vnd.ms-powerpoint.template.macroEnabled.12 base64 +potx application/vnd.openxmlformats-officedocument.presentationml.template base64 +ppam application/vnd.ms-powerpoint.addin.macroEnabled.12 base64 +ppd application/vnd.cups-ppd base64 +ppm image/x-portable-pixmap base64 +pps application/vnd.ms-powerpoint base64 +ppsm application/vnd.ms-powerpoint.slideshow.macroEnabled.12 base64 +ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow base64 +ppt application/vnd.ms-powerpoint base64 +pptm application/vnd.ms-powerpoint.presentation.macroEnabled.12 base64 +pptx application/vnd.openxmlformats-officedocument.presentationml.presentation base64 +pqa application/vnd.palm base64 +prc application/vnd.palm base64 +pre application/vnd.lotus-freelance base64 +prf application/pics-rules base64 +ps application/postscript 8bit +ps1 application/x-msdos-program base64 +psb application/vnd.3gpp.pic-bw-small base64 +psd image/vnd.adobe.photoshop base64 +psf application/x-font-linux-psf base64 +pskcxml application/pskc+xml base64 +psp image/x-paintshoppro base64 +pspimage image/x-paintshoppro base64 +pt5 application/x-pagemaker base64 +pti application/vnd.pvi.ptid1 base64 +ptid application/vnd.pvi.ptid1 base64 +pub application/x-mspublisher base64 +pvb application/vnd.3gpp.pic-bw-var base64 +pwn application/vnd.3M.Post-it-Notes base64 +py application/x-python 8bit +pya audio/vnd.ms-playready.media.pya base64 +pyv video/vnd.ms-playready.media.pyv base64 +qam application/vnd.epson.quickanime base64 +qbo application/vnd.intu.qbo base64 +qcp audio/vnd.qcelp base64 +qfx application/vnd.intu.qfx base64 +qps application/vnd.publishare-delta-tree base64 +qt video/quicktime base64 +qtl application/x-quicktimeplayer base64 +qwd application/vnd.Quark.QuarkXPress 8bit +qwt application/vnd.Quark.QuarkXPress 8bit +qxb application/vnd.Quark.QuarkXPress 8bit +qxd application/vnd.Quark.QuarkXPress 8bit +qxl application/vnd.Quark.QuarkXPress 8bit +qxt application/vnd.Quark.QuarkXPress 8bit +ra audio/x-pn-realaudio base64 +raf image/x-fuji-raf base64 +ram audio/x-pn-realaudio base64 +rar application/x-rar-compressed base64 +ras image/x-cmu-raster base64 +raw image/x-panasonic-raw base64 +rb application/x-ruby 8bit +rbw application/x-ruby 8bit +rcprofile application/vnd.ipunplugged.rcprofile base64 +rct application/prs.nprend base64 +rdf application/rdf+xml 8bit +rdz application/vnd.data-vision.rdz base64 +reg application/x-msdos-program base64 +rep application/vnd.businessobjects base64 +req application/vnd.nervana base64 +request application/vnd.nervana base64 +res application/x-dtbresource+xml base64 +rgb image/x-rgb base64 +rhtml application/x-html+ruby 8bit +rif application/reginfo+xml base64 +rip audio/vnd.rip base64 +ris application/x-research-info-systems base64 +rl application/resource-lists+xml base64 +rlc image/vnd.fujixerox.edmics-rlc base64 +rld application/resource-lists-diff+xml base64 +rm application/vnd.rn-realmedia base64 +rmi audio/midi base64 +rmp audio/x-pn-realaudio-plugin base64 +rms application/vnd.jcp.javame.midlet-rms base64 +rmvb application/vnd.rn-realmedia-vbr base64 +rnc application/relax-ng-compact-syntax base64 +rnd application/prs.nprend base64 +roa application/rpki-roa base64 +roff text/troff 8bit +rp9 application/vnd.cloanto.rp9 base64 +rpm audio/x-pn-realaudio-plugin base64 +rpss application/vnd.nokia.radio-presets base64 +rpst application/vnd.nokia.radio-preset base64 +rq application/sparql-query base64 +rs application/rls-services+xml base64 +rsd application/rsd+xml base64 +rss application/rss+xml base64 +rst text/plain quoted-printable +rtf application/rtf base64 +rtx text/richtext 8bit +s text/x-asm quoted-printable +s11 video/vnd.sealed.mpeg1 base64 +s14 video/vnd.sealed.mpeg4 base64 +s1a application/vnd.sealedmedia.softseal.pdf base64 +s1e application/vnd.sealed.xls base64 +s1h application/vnd.sealedmedia.softseal.html base64 +s1m audio/vnd.sealedmedia.softseal.mpeg base64 +s1p application/vnd.sealed.ppt base64 +s1q video/vnd.sealedmedia.softseal.mov base64 +s1w application/vnd.sealed.doc base64 +s3m audio/s3m base64 +saf application/vnd.yamaha.smaf-audio base64 +sav application/x-spss base64 +sbml application/sbml+xml base64 +sbs application/x-spss base64 +sc application/vnd.ibm.secure-container base64 +scd application/x-msschedule base64 +scm application/vnd.lotus-screencam base64 +scq application/scvp-cv-request base64 +scs application/scvp-cv-response base64 +scurl text/vnd.curl.scurl quoted-printable +sda application/vnd.stardivision.draw base64 +sdc application/vnd.stardivision.calc base64 +sdd application/vnd.stardivision.impress base64 +sdf application/vnd.Kinar base64 +sdkd application/vnd.solent.sdkm+xml base64 +sdkm application/vnd.solent.sdkm+xml base64 +sdo application/vnd.sealed.doc base64 +sdoc application/vnd.sealed.doc base64 +sdp application/sdp base64 +sds application/vnd.stardivision.chart base64 +sdw application/vnd.stardivision.writer base64 +see application/vnd.seemail base64 +seed application/vnd.fdsn.seed base64 +sem application/vnd.sealed.eml base64 +sema application/vnd.sema base64 +semd application/vnd.semd base64 +semf application/vnd.semf base64 +seml application/vnd.sealed.eml base64 +ser application/java-serialized-object base64 +setpay application/set-payment-initiation base64 +setreg application/set-registration-initiation base64 +sfd-hdstx application/vnd.hydrostatix.sof-data base64 +sfs application/vnd.spotfire.sfs base64 +sfv text/x-sfv quoted-printable +sgi image/sgi base64 +sgl application/vnd.stardivision.writer-global base64 +sgm text/sgml quoted-printable +sgml application/sgml base64 +sh application/x-sh 8bit +shar application/x-shar 8bit +shf application/shf+xml base64 +shtml text/html 8bit +si text/vnd.wap.si quoted-printable +sic application/vnd.wap.sic base64 +sid image/x-mrsid-image base64 +sig application/pgp-signature base64 +sil audio/silk base64 +silo model/mesh base64 +sis application/vnd.symbian.install base64 +sisx application/vnd.symbian.install base64 +sit application/x-stuffit base64 +sitx application/x-stuffitx base64 +siv application/sieve base64 +sj application/javascript 8bit +skd application/vnd.koan base64 +skm application/vnd.koan base64 +skp application/vnd.koan base64 +skt application/vnd.koan base64 +sl text/vnd.wap.sl quoted-printable +slc application/vnd.wap.slc base64 +sldm application/vnd.ms-powerpoint.slide.macroEnabled.12 base64 +sldx application/vnd.openxmlformats-officedocument.presentationml.slide base64 +slt application/vnd.epson.salt base64 +sm application/vnd.stepmania.stepchart base64 +smf application/vnd.stardivision.math base64 +smh application/vnd.sealed.mht base64 +smht application/vnd.sealed.mht base64 +smi application/smil+xml 8bit +smil application/smil+xml 8bit +smo video/vnd.sealedmedia.softseal.mov base64 +smov video/vnd.sealedmedia.softseal.mov base64 +smp audio/vnd.sealedmedia.softseal.mpeg base64 +smp3 audio/vnd.sealedmedia.softseal.mpeg base64 +smpg video/vnd.sealed.mpeg4 base64 +sms application/vnd.3gpp.sms base64 +smv audio/SMV base64 +smzip application/vnd.stepmania.package base64 +snd audio/basic base64 +snf application/x-font-snf base64 +so application/octet-stream base64 +soc application/sgml-open-catalog base64 +spc application/x-pkcs7-certificates base64 +spd application/vnd.sealedmedia.softseal.pdf base64 +spdf application/vnd.sealedmedia.softseal.pdf base64 +spf application/vnd.yamaha.smaf-phrase base64 +spl application/x-futuresplash base64 +spo application/x-spss base64 +spot text/vnd.in3d.spot quoted-printable +spp application/scvp-vp-response base64 +sppt application/vnd.sealed.ppt base64 +spq application/scvp-vp-request base64 +sps application/x-spss base64 +spx audio/ogg base64 +sql application/x-sql base64 +sr2 image/x-sony-sr2 base64 +src application/x-wais-source base64 +srf image/x-sony-srf base64 +srt application/x-subrip base64 +sru application/sru+xml base64 +srx application/sparql-results+xml base64 +ssdl application/ssdl+xml base64 +sse application/vnd.kodak-descriptor base64 +ssf application/vnd.epson.ssf base64 +ssml application/ssml+xml base64 +ssw video/vnd.sealed.swf base64 +sswf video/vnd.sealed.swf base64 +st application/vnd.sailingtracker.track base64 +stc application/vnd.sun.xml.calc.template base64 +std application/vnd.sun.xml.draw.template base64 +stf application/vnd.wt.stf base64 +sti application/vnd.sun.xml.impress.template base64 +stk application/hyperstudio base64 +stl application/vnd.ms-pki.stl base64 +stm application/vnd.sealedmedia.softseal.html base64 +stml application/vnd.sealedmedia.softseal.html base64 +str application/vnd.pg.format base64 +stw application/vnd.sun.xml.writer.template base64 +sub image/vnd.dvb.subtitle base64 +sus application/vnd.sus-calendar base64 +susp application/vnd.sus-calendar base64 +sv4cpio application/x-sv4cpio base64 +sv4crc application/x-sv4crc base64 +svc application/vnd.dvb.service base64 +svd application/vnd.svd base64 +svg image/svg+xml 8bit +svgz image/svg+xml 8bit +swa application/x-director base64 +swf application/x-shockwave-flash base64 +swi application/vnd.aristanetworks.swi base64 +sxc application/vnd.sun.xml.calc base64 +sxd application/vnd.sun.xml.draw base64 +sxg application/vnd.sun.xml.writer.global base64 +sxi application/vnd.sun.xml.impress base64 +sxl application/vnd.sealed.xls base64 +sxls application/vnd.sealed.xls base64 +sxm application/vnd.sun.xml.math base64 +sxw application/vnd.sun.xml.writer base64 +t text/troff 8bit +t3 application/x-t3vm-image base64 +taglet application/vnd.mynfc base64 +tao application/vnd.tao.intent-module-archive base64 +tar application/x-tar base64 +tbk application/x-toolbook base64 +tbz application/x-gtar base64 +tbz2 application/x-gtar base64 +tcap application/vnd.3gpp2.tcap base64 +tcl application/x-tcl 8bit +teacher application/vnd.smart.teacher base64 +tei application/tei+xml base64 +teicorpus application/tei+xml base64 +tex application/x-tex 8bit +texi application/x-texinfo 8bit +texinfo application/x-texinfo 8bit +text text/plain quoted-printable +textile text/plain quoted-printable +tfi application/thraud+xml base64 +tfm application/x-tex-tfm base64 +tga image/x-targa base64 +tgz application/x-gtar base64 +thmx application/vnd.ms-officetheme base64 +tif image/tiff base64 +tiff image/tiff base64 +tmo application/vnd.tmobile-livetv base64 +torrent application/x-bittorrent base64 +tpl application/vnd.groove-tool-template base64 +tpt application/vnd.trid.tpt base64 +tr text/troff 8bit +tra application/vnd.trueapp base64 +trm application/x-msterminal base64 +troff text/troff 8bit +ts video/MP2T base64 +tsd application/timestamped-data base64 +tsv text/tab-separated-values quoted-printable +ttc font/collection base64 +ttf font/ttf base64 +ttl text/turtle quoted-printable +twd application/vnd.SimTech-MindMapper base64 +twds application/vnd.SimTech-MindMapper base64 +txd application/vnd.genomatix.tuxedo base64 +txf application/vnd.Mobius.TXF base64 +txt text/plain quoted-printable +u32 application/x-authorware-bin base64 +udeb application/x-debian-package base64 +ufd application/vnd.ufdl base64 +ufdl application/vnd.ufdl base64 +ulx application/x-glulx base64 +umj application/vnd.umajin base64 +unityweb application/vnd.unity base64 +uoml application/vnd.uoml+xml base64 +upa application/vnd.hbci base64 +uri text/uri-list quoted-printable +uris text/uri-list quoted-printable +urls text/uri-list quoted-printable +ustar application/x-ustar base64 +utz application/vnd.uiq.theme base64 +uu text/x-uuencode quoted-printable +uva audio/vnd.dece.audio base64 +uvd application/vnd.dece.data base64 +uvf application/vnd.dece.data base64 +uvg image/vnd.dece.graphic base64 +uvh video/vnd.dece.hd base64 +uvi image/vnd.dece.graphic base64 +uvm video/vnd.dece.mobile base64 +uvp video/vnd.dece.pd base64 +uvs video/vnd.dece.sd base64 +uvt application/vnd.dece.ttml+xml base64 +uvu video/vnd.uvvu.mp4 base64 +uvv video/vnd.dece.video base64 +uvva audio/vnd.dece.audio base64 +uvvd application/vnd.dece.data base64 +uvvf application/vnd.dece.data base64 +uvvg image/vnd.dece.graphic base64 +uvvh video/vnd.dece.hd base64 +uvvi image/vnd.dece.graphic base64 +uvvm video/vnd.dece.mobile base64 +uvvp video/vnd.dece.pd base64 +uvvs video/vnd.dece.sd base64 +uvvt application/vnd.dece.ttml+xml base64 +uvvu video/vnd.uvvu.mp4 base64 +uvvv video/vnd.dece.video base64 +uvvx application/vnd.dece.unspecified base64 +uvvz application/vnd.dece.zip base64 +uvx application/vnd.dece.unspecified base64 +uvz application/vnd.dece.zip base64 +vbk audio/vnd.nortel.vbk base64 +vbs application/x-msdos-program base64 +vcard text/vcard quoted-printable +vcd application/x-cdlink base64 +vcf text/x-vcard 8bit +vcg application/vnd.groove-vcard base64 +vcs text/x-vcalendar 8bit +vcx application/vnd.vcx base64 +vis application/vnd.visionary base64 +viv video/vnd.vivo base64 +vivo video/vnd.vivo base64 +vob video/x-ms-vob base64 +vor application/vnd.stardivision.writer base64 +vox application/x-authorware-bin base64 +vrml model/vrml base64 +vsc application/vnd.vidsoft.vidconference 8bit +vsd application/vnd.visio base64 +vsf application/vnd.vsf base64 +vss application/vnd.visio base64 +vst application/vnd.visio base64 +vsw application/vnd.visio base64 +vtt text/vtt quoted-printable +vtu model/vnd.vtu base64 +vxml application/voicexml+xml base64 +w3d application/x-director base64 +wad application/x-doom base64 +wasm application/wasm 8bit +wav audio/wav base64 +wax audio/x-ms-wax base64 +wbmp image/vnd.wap.wbmp base64 +wbs application/vnd.criticaltools.wbs+xml base64 +wbxml application/vnd.wap.wbxml base64 +wcm application/vnd.ms-works base64 +wdb application/vnd.ms-works base64 +wdp image/vnd.ms-photo base64 +weba audio/webm base64 +webapp application/x-web-app-manifest+json base64 +webm audio/webm base64 +webmanifest application/manifest+json base64 +webp image/webp base64 +wg application/vnd.pmi.widget base64 +wgt application/widget base64 +wif application/watcherinfo+xml base64 +wk application/x-123 base64 +wks application/vnd.lotus-1-2-3 base64 +wkz application/x-Wingz base64 +wm video/x-ms-wm base64 +wma audio/x-ms-wma base64 +wmd application/x-ms-wmd base64 +wmf application/x-msmetafile base64 +wml text/vnd.wap.wml quoted-printable +wmlc application/vnd.wap.wmlc base64 +wmls text/vnd.wap.wmlscript quoted-printable +wmlsc application/vnd.wap.wmlscriptc base64 +wmv audio/x-ms-wmv base64 +wmx video/x-ms-wmx base64 +wmz application/x-ms-wmz base64 +woff font/woff base64 +woff2 font/woff2 base64 +wp application/wordperfect5.1 base64 +wp5 application/wordperfect5.1 base64 +wp6 application/x-wordperfect6.1 base64 +wpd application/vnd.wordperfect base64 +wpl application/vnd.ms-wpl base64 +wps application/vnd.ms-works base64 +wqd application/vnd.wqd base64 +wrd application/msword base64 +wri application/x-mswrite base64 +wrl model/vrml base64 +wsdl application/wsdl+xml base64 +wspolicy application/wspolicy+xml base64 +wtb application/vnd.webturbo base64 +wv application/vnd.wv.csp+wbxml base64 +wvx video/x-ms-wvx base64 +wz application/x-Wingz base64 +x32 application/x-authorware-bin base64 +x3d model/x3d+xml base64 +x3db model/x3d+binary base64 +x3dbz model/x3d+binary base64 +x3dv model/x3d+vrml base64 +x3dvz model/x3d+vrml base64 +x3dz model/x3d+xml base64 +x3f image/x-sigma-x3f base64 +x_b model/vnd.parasolid.transmit.binary base64 +x_t model/vnd.parasolid.transmit.text quoted-printable +xaml application/xaml+xml base64 +xap application/x-silverlight-app base64 +xar application/vnd.xara base64 +xbap application/x-ms-xbap base64 +xbd application/vnd.fujixerox.docuworks.binder base64 +xbm image/x-xbitmap 7bit +xcf image/x-xcf base64 +xcfbz2 image/x-compressed-xcf base64 +xcfgz image/x-compressed-xcf base64 +xdf application/xcap-diff+xml base64 +xdm application/vnd.syncml.dm+xml base64 +xdp application/vnd.adobe.xdp+xml base64 +xdssc application/dssc+xml base64 +xdw application/vnd.fujixerox.docuworks base64 +xenc application/xenc+xml base64 +xer application/patch-ops-error+xml base64 +xfdf application/vnd.adobe.xfdf base64 +xfdl application/vnd.xfdl base64 +xht application/xhtml+xml 8bit +xhtml application/xhtml+xml 8bit +xhvml application/xv+xml base64 +xif image/vnd.xiff base64 +xla application/vnd.ms-excel base64 +xlam application/vnd.ms-excel.addin.macroEnabled.12 base64 +xlc application/vnd.ms-excel base64 +xlf application/x-xliff+xml base64 +xlm application/vnd.ms-excel base64 +xls application/vnd.ms-excel base64 +xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 base64 +xlsm application/vnd.ms-excel.sheet.macroEnabled.12 base64 +xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet base64 +xlt application/vnd.ms-excel base64 +xltm application/vnd.ms-excel.template.macroEnabled.12 base64 +xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template base64 +xlw application/vnd.ms-excel base64 +xm audio/xm base64 +xml application/xml 8bit +xmt_bin model/vnd.parasolid.transmit.binary base64 +xmt_txt model/vnd.parasolid.transmit.text quoted-printable +xo application/vnd.olpc-sugar base64 +xop application/xop+xml base64 +xpi application/x-xpinstall base64 +xpl application/xproc+xml base64 +xpm image/x-xpixmap 8bit +xpr application/vnd.is-xpr base64 +xps application/vnd.ms-xpsdocument 8bit +xpw application/vnd.intercon.formnet base64 +xpx application/vnd.intercon.formnet base64 +xsd text/xml 8bit +xsl application/xml 8bit +xslt application/xslt+xml base64 +xsm application/vnd.syncml+xml base64 +xspf application/xspf+xml base64 +xul application/vnd.mozilla.xul+xml base64 +xvm application/xv+xml base64 +xvml application/xv+xml base64 +xwd image/x-xwindowdump base64 +xyz x-chemical/x-xyz base64 +xz application/x-xz base64 +yaml text/x-yaml 8bit +yang application/yang base64 +yin application/yin+xml base64 +yml text/x-yaml 8bit +z application/x-compressed base64 +z1 application/x-zmachine base64 +z2 application/x-zmachine base64 +z3 application/x-zmachine base64 +z4 application/x-zmachine base64 +z5 application/x-zmachine base64 +z6 application/x-zmachine base64 +z7 application/x-zmachine base64 +z8 application/x-zmachine base64 +zaz application/vnd.zzazz.deck+xml base64 +zip application/zip base64 +zir application/vnd.zul base64 +zirz application/vnd.zul base64 +zmm application/vnd.HandHeld-Entertainment+xml base64 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime-types.json b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime-types.json new file mode 100644 index 0000000..80d15a5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime-types.json @@ -0,0 +1 @@ +[{"content-type":"application/1d-interleaved-parityfec","encoding":"base64","xrefs":{"rfc":["rfc6015"],"template":["application/1d-interleaved-parityfec"]},"registered":true},{"content-type":"application/3gpdash-qoe-report+xml","encoding":"base64","xrefs":{"person":["Ozgur_Oyman","_3GPP"],"template":["application/3gpdash-qoe-report+xml"]},"registered":true},{"content-type":"application/3gpp-ims+xml","encoding":"base64","xrefs":{"person":["John_M_Meredith","_3GPP"],"template":["application/3gpp-ims+xml"]},"registered":true},{"content-type":"application/3gppHal+json","encoding":"base64","xrefs":{"person":["Ulrich_Wiehe","_3GPP"],"template":["application/3gppHal+json"]},"registered":true},{"content-type":"application/3gppHalForms+json","encoding":"base64","xrefs":{"person":["Ulrich_Wiehe","_3GPP"],"template":["application/3gppHalForms+json"]},"registered":true},{"content-type":"application/A2L","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/A2L"]},"registered":true},{"content-type":"application/acad","encoding":"base64","registered":false},{"content-type":"application/access","encoding":"base64","extensions":["mdf","mda","mdb","mde"],"obsolete":true,"use-instead":"application/x-msaccess","registered":false},{"content-type":"application/ace+cbor","encoding":"base64","xrefs":{"draft":["RFC-ietf-ace-oauth-authz-46"],"template":["application/ace+cbor"]},"registered":true},{"content-type":"application/activemessage","encoding":"base64","xrefs":{"person":["Ehud_Shapiro"],"template":["application/activemessage"]},"registered":true},{"content-type":"application/activity+json","encoding":"base64","xrefs":{"person":["Benjamin_Goering","W3C"],"template":["application/activity+json"]},"registered":true},{"content-type":"application/akn+xml","encoding":"base64","xrefs":{"person":["Chet_Ensign"]},"registered":true,"provisional":true},{"content-type":"application/alto-costmap+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-costmap+json"]},"registered":true},{"content-type":"application/alto-costmapfilter+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-costmapfilter+json"]},"registered":true},{"content-type":"application/alto-directory+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-directory+json"]},"registered":true},{"content-type":"application/alto-endpointcost+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-endpointcost+json"]},"registered":true},{"content-type":"application/alto-endpointcostparams+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-endpointcostparams+json"]},"registered":true},{"content-type":"application/alto-endpointprop+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-endpointprop+json"]},"registered":true},{"content-type":"application/alto-endpointpropparams+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-endpointpropparams+json"]},"registered":true},{"content-type":"application/alto-error+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-error+json"]},"registered":true},{"content-type":"application/alto-networkmap+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-networkmap+json"]},"registered":true},{"content-type":"application/alto-networkmapfilter+json","encoding":"base64","xrefs":{"rfc":["rfc7285"],"template":["application/alto-networkmapfilter+json"]},"registered":true},{"content-type":"application/alto-updatestreamcontrol+json","encoding":"base64","xrefs":{"rfc":["rfc8895"],"template":["application/alto-updatestreamcontrol+json"]},"registered":true},{"content-type":"application/alto-updatestreamparams+json","encoding":"base64","xrefs":{"rfc":["rfc8895"],"template":["application/alto-updatestreamparams+json"]},"registered":true},{"content-type":"application/AML","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/AML"]},"registered":true},{"content-type":"application/andrew-inset","friendly":{"en":"Andrew Toolkit"},"encoding":"base64","extensions":["ez"],"xrefs":{"person":["Nathaniel_Borenstein"],"template":["application/andrew-inset"]},"registered":true},{"content-type":"application/appledouble","encoding":"base64","registered":false},{"content-type":"application/applefile","encoding":"base64","xrefs":{"person":["Patrik_Faltstrom"],"template":["application/applefile"]},"registered":true},{"content-type":"application/applixware","friendly":{"en":"Applixware"},"encoding":"base64","extensions":["aw"],"registered":false},{"content-type":"application/at+jwt","encoding":"base64","xrefs":{"rfc":["rfc9068"],"template":["application/at+jwt"]},"registered":true},{"content-type":"application/ATF","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/ATF"]},"registered":true},{"content-type":"application/ATFX","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/ATFX"]},"registered":true},{"content-type":"application/atom+xml","friendly":{"en":"Atom Syndication Format"},"encoding":"8bit","extensions":["atom"],"xrefs":{"rfc":["rfc4287","rfc5023"],"template":["application/atom+xml"]},"registered":true},{"content-type":"application/atomcat+xml","friendly":{"en":"Atom Publishing Protocol"},"encoding":"8bit","extensions":["atomcat"],"xrefs":{"rfc":["rfc5023"],"template":["application/atomcat+xml"]},"registered":true},{"content-type":"application/atomdeleted+xml","encoding":"8bit","xrefs":{"rfc":["rfc6721"],"template":["application/atomdeleted+xml"]},"registered":true},{"content-type":"application/atomicmail","encoding":"base64","xrefs":{"person":["Nathaniel_Borenstein"],"template":["application/atomicmail"]},"registered":true},{"content-type":"application/atomsvc+xml","friendly":{"en":"Atom Publishing Protocol Service Document"},"encoding":"8bit","extensions":["atomsvc"],"xrefs":{"rfc":["rfc5023"],"template":["application/atomsvc+xml"]},"registered":true},{"content-type":"application/atsc-dwd+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/atsc-dwd+xml"]},"registered":true},{"content-type":"application/atsc-dynamic-event-message","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/atsc-dynamic-event-message"]},"registered":true},{"content-type":"application/atsc-held+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/atsc-held+xml"]},"registered":true},{"content-type":"application/atsc-rdt+json","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/atsc-rdt+json"]},"registered":true},{"content-type":"application/atsc-rsat+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/atsc-rsat+xml"]},"registered":true},{"content-type":"application/ATXML","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/ATXML"]},"registered":true},{"content-type":"application/auth-policy+xml","encoding":"8bit","xrefs":{"rfc":["rfc4745"],"template":["application/auth-policy+xml"]},"registered":true},{"content-type":"application/bacnet-xdd+zip","encoding":"base64","xrefs":{"person":["ASHRAE","Dave_Robin"],"template":["application/bacnet-xdd+zip"]},"registered":true},{"content-type":"application/batch-SMTP","encoding":"base64","xrefs":{"rfc":["rfc2442"],"template":["application/batch-SMTP"]},"registered":true},{"content-type":"application/beep+xml","encoding":"base64","xrefs":{"rfc":["rfc3080"],"template":["application/beep+xml"]},"registered":true},{"content-type":"application/bleeper","encoding":"base64","extensions":["bleep"],"obsolete":true,"use-instead":"application/x-bleeper","registered":false},{"content-type":"application/calendar+json","encoding":"base64","xrefs":{"rfc":["rfc7265"],"template":["application/calendar+json"]},"registered":true},{"content-type":"application/calendar+xml","encoding":"base64","xrefs":{"rfc":["rfc6321"],"template":["application/calendar+xml"]},"registered":true},{"content-type":"application/call-completion","encoding":"base64","xrefs":{"rfc":["rfc6910"],"template":["application/call-completion"]},"registered":true},{"content-type":"application/cals-1840","encoding":"base64","xrefs":{"rfc":["rfc1895"],"template":["application/CALS-1840"]},"registered":true},{"content-type":"application/cals1840","encoding":"base64","obsolete":true,"use-instead":"application/cals-1840","registered":false},{"content-type":"application/cap+xml","encoding":"base64","xrefs":{"draft":["RFC-ietf-ecrit-data-only-ea-22"],"template":["application/cap+xml"]},"registered":true},{"content-type":"application/captive+json","encoding":"base64","xrefs":{"rfc":["rfc8908"],"template":["application/captive+json"]},"registered":true},{"content-type":"application/cbor","encoding":"base64","xrefs":{"rfc":["rfc8949"],"template":["application/cbor"]},"registered":true},{"content-type":"application/cbor-seq","encoding":"base64","xrefs":{"rfc":["rfc8742"],"template":["application/cbor-seq"]},"registered":true},{"content-type":"application/cccex","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/cccex"]},"registered":true},{"content-type":"application/ccmp+xml","encoding":"base64","xrefs":{"rfc":["rfc6503"],"template":["application/ccmp+xml"]},"registered":true},{"content-type":"application/ccxml+xml","friendly":{"en":"Voice Browser Call Control"},"encoding":"base64","extensions":["ccxml"],"xrefs":{"rfc":["rfc4267"],"template":["application/ccxml+xml"]},"registered":true},{"content-type":"application/CDFX+XML","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/CDFX+XML"]},"registered":true},{"content-type":"application/cdmi-capability","friendly":{"en":"Cloud Data Management Interface (CDMI) - Capability"},"encoding":"base64","extensions":["cdmia"],"xrefs":{"rfc":["rfc6208"],"template":["application/cdmi-capability"]},"registered":true},{"content-type":"application/cdmi-container","friendly":{"en":"Cloud Data Management Interface (CDMI) - Contaimer"},"encoding":"base64","extensions":["cdmic"],"xrefs":{"rfc":["rfc6208"],"template":["application/cdmi-container"]},"registered":true},{"content-type":"application/cdmi-domain","friendly":{"en":"Cloud Data Management Interface (CDMI) - Domain"},"encoding":"base64","extensions":["cdmid"],"xrefs":{"rfc":["rfc6208"],"template":["application/cdmi-domain"]},"registered":true},{"content-type":"application/cdmi-object","friendly":{"en":"Cloud Data Management Interface (CDMI) - Object"},"encoding":"base64","extensions":["cdmio"],"xrefs":{"rfc":["rfc6208"],"template":["application/cdmi-object"]},"registered":true},{"content-type":"application/cdmi-queue","friendly":{"en":"Cloud Data Management Interface (CDMI) - Queue"},"encoding":"base64","extensions":["cdmiq"],"xrefs":{"rfc":["rfc6208"],"template":["application/cdmi-queue"]},"registered":true},{"content-type":"application/cdni","encoding":"base64","xrefs":{"rfc":["rfc7736"],"template":["application/cdni"]},"registered":true},{"content-type":"application/CEA","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/CEA"]},"registered":true},{"content-type":"application/cea-2018+xml","encoding":"base64","xrefs":{"person":["Gottfried_Zimmermann"],"template":["application/cea-2018+xml"]},"registered":true},{"content-type":"application/cellml+xml","encoding":"base64","xrefs":{"rfc":["rfc4708"],"template":["application/cellml+xml"]},"registered":true},{"content-type":"application/cert-chain+cbor","encoding":"base64","xrefs":{"draft":["draft-yasskin-http-origin-signed-responses"]},"registered":true,"provisional":true},{"content-type":"application/cfw","encoding":"base64","xrefs":{"rfc":["rfc6230"],"template":["application/cfw"]},"registered":true},{"content-type":"application/city+json","encoding":"base64","xrefs":{"person":["Hugo_Ledoux"]},"registered":true,"provisional":true},{"content-type":"application/clariscad","encoding":"base64","registered":false},{"content-type":"application/clr","encoding":"base64","xrefs":{"person":["Andy_Miller","IMS_Global"],"template":["application/clr"]},"registered":true},{"content-type":"application/clue+xml","encoding":"base64","xrefs":{"rfc":["rfc8847"],"template":["application/clue+xml"]},"registered":true},{"content-type":"application/clue_info+xml","encoding":"base64","xrefs":{"rfc":["rfc8846"],"template":["application/clue_info+xml"]},"registered":true},{"content-type":"application/cms","encoding":"base64","xrefs":{"rfc":["rfc7193"],"template":["application/cms"]},"registered":true},{"content-type":"application/cnrp+xml","encoding":"base64","xrefs":{"rfc":["rfc3367"],"template":["application/cnrp+xml"]},"registered":true},{"content-type":"application/coap-group+json","encoding":"base64","xrefs":{"rfc":["rfc7390"],"template":["application/coap-group+json"]},"registered":true},{"content-type":"application/coap-payload","encoding":"base64","xrefs":{"rfc":["rfc8075"],"template":["application/coap-payload"]},"registered":true},{"content-type":"application/commonground","encoding":"base64","xrefs":{"person":["David_Glazer"],"template":["application/commonground"]},"registered":true},{"content-type":"application/conference-info+xml","encoding":"base64","xrefs":{"rfc":["rfc4575"],"template":["application/conference-info+xml"]},"registered":true},{"content-type":"application/cose","encoding":"base64","xrefs":{"draft":["RFC-ietf-cose-rfc8152bis-struct-15"],"template":["application/cose"]},"registered":true},{"content-type":"application/cose-key","encoding":"base64","xrefs":{"draft":["RFC-ietf-cose-rfc8152bis-struct-15"],"template":["application/cose-key"]},"registered":true},{"content-type":"application/cose-key-set","encoding":"base64","xrefs":{"draft":["RFC-ietf-cose-rfc8152bis-struct-15"],"template":["application/cose-key-set"]},"registered":true},{"content-type":"application/cpl+xml","encoding":"base64","xrefs":{"rfc":["rfc3880"],"template":["application/cpl+xml"]},"registered":true},{"content-type":"application/csrattrs","encoding":"base64","xrefs":{"rfc":["rfc7030"],"template":["application/csrattrs"]},"registered":true},{"content-type":"application/csta+xml","encoding":"base64","xrefs":{"person":["Ecma_International_Helpdesk"],"template":["application/csta+xml"]},"registered":true},{"content-type":"application/CSTAdata+xml","encoding":"base64","xrefs":{"person":["Ecma_International_Helpdesk"],"template":["application/CSTAdata+xml"]},"registered":true},{"content-type":"application/csvm+json","encoding":"base64","xrefs":{"person":["Ivan_Herman","W3C"],"template":["application/csvm+json"]},"registered":true},{"content-type":"application/cu-seeme","friendly":{"en":"CU-SeeMe"},"encoding":"base64","extensions":["cu"],"registered":false},{"content-type":"application/cwt","encoding":"base64","xrefs":{"rfc":["rfc8392"],"template":["application/cwt"]},"registered":true},{"content-type":"application/cybercash","encoding":"base64","xrefs":{"person":["Donald_E._Eastlake_3rd"],"template":["application/cybercash"]},"registered":true},{"content-type":"application/dash+xml","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","Thomas_Stockhammer"],"template":["application/dash+xml"]},"registered":true},{"content-type":"application/dash-patch+xml","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1"],"template":["application/dash-patch+xml"]},"registered":true},{"content-type":"application/dashdelta","encoding":"base64","xrefs":{"person":["David_Furbeck"],"template":["application/dashdelta"]},"registered":true},{"content-type":"application/davmount+xml","friendly":{"en":"Web Distributed Authoring and Versioning"},"encoding":"base64","extensions":["davmount"],"xrefs":{"rfc":["rfc4709"],"template":["application/davmount+xml"]},"registered":true},{"content-type":"application/dca-rft","encoding":"base64","xrefs":{"person":["Larry_Campbell"],"template":["application/dca-rft"]},"registered":true},{"content-type":"application/DCD","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/DCD"]},"registered":true},{"content-type":"application/dec-dx","encoding":"base64","xrefs":{"person":["Larry_Campbell"],"template":["application/dec-dx"]},"registered":true},{"content-type":"application/dialog-info+xml","encoding":"base64","xrefs":{"rfc":["rfc4235"],"template":["application/dialog-info+xml"]},"registered":true},{"content-type":"application/dicom","encoding":"base64","extensions":["dcm"],"xrefs":{"rfc":["rfc3240"],"template":["application/dicom"]},"registered":true},{"content-type":"application/dicom+json","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","David_Clunie"],"template":["application/dicom+json"]},"registered":true},{"content-type":"application/dicom+xml","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","David_Clunie"],"template":["application/dicom+xml"]},"registered":true},{"content-type":"application/DII","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/DII"]},"registered":true},{"content-type":"application/DIT","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/DIT"]},"registered":true},{"content-type":"application/dns","encoding":"base64","xrefs":{"rfc":["rfc4027"],"template":["application/dns"]},"registered":true},{"content-type":"application/dns+json","encoding":"base64","xrefs":{"rfc":["rfc8427"],"template":["application/dns+json"]},"registered":true},{"content-type":"application/dns-message","encoding":"base64","xrefs":{"rfc":["rfc8484"],"template":["application/dns-message"]},"registered":true},{"content-type":"application/docbook+xml","encoding":"base64","extensions":["dbk"],"registered":false},{"content-type":"application/dots+cbor","encoding":"base64","xrefs":{"rfc":["rfc9132"],"template":["application/dots+cbor"]},"registered":true},{"content-type":"application/drafting","encoding":"base64","registered":false},{"content-type":"application/dskpp+xml","encoding":"base64","xrefs":{"rfc":["rfc6063"],"template":["application/dskpp+xml"]},"registered":true},{"content-type":"application/dssc+der","friendly":{"en":"Data Structure for the Security Suitability of Cryptographic Algorithms"},"encoding":"base64","extensions":["dssc"],"xrefs":{"rfc":["rfc5698"],"template":["application/dssc+der"]},"registered":true},{"content-type":"application/dssc+xml","friendly":{"en":"Data Structure for the Security Suitability of Cryptographic Algorithms"},"encoding":"base64","extensions":["xdssc"],"xrefs":{"rfc":["rfc5698"],"template":["application/dssc+xml"]},"registered":true},{"content-type":"application/dvcs","encoding":"base64","xrefs":{"rfc":["rfc3029"],"template":["application/dvcs"]},"registered":true},{"content-type":"application/dxf","encoding":"base64","registered":false},{"content-type":"application/ecmascript","friendly":{"en":"ECMAScript"},"encoding":"base64","extensions":["ecma","es"],"xrefs":{"rfc":["rfc4329"],"template":["application/ecmascript"]},"registered":true},{"content-type":"application/EDI-consent","encoding":"base64","xrefs":{"rfc":["rfc1767"],"template":["application/EDI-consent"]},"registered":true},{"content-type":"application/EDI-X12","encoding":"base64","xrefs":{"rfc":["rfc1767"],"template":["application/EDI-X12"]},"registered":true},{"content-type":"application/EDIFACT","encoding":"base64","xrefs":{"rfc":["rfc1767"],"template":["application/EDIFACT"]},"registered":true},{"content-type":"application/efi","encoding":"base64","xrefs":{"person":["Samer_El-Haj-Mahmoud","UEFI_Forum"],"template":["application/efi"]},"registered":true},{"content-type":"application/elm+json","encoding":"base64","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["application/elm+json"]},"registered":true},{"content-type":"application/elm+xml","encoding":"base64","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["application/elm+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.cap+xml","encoding":"base64","xrefs":{"rfc":["rfc8876"],"template":["application/EmergencyCallData.cap+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.Comment+xml","encoding":"base64","xrefs":{"rfc":["rfc7852"],"template":["application/EmergencyCallData.Comment+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.Control+xml","encoding":"base64","xrefs":{"rfc":["rfc8147"],"template":["application/EmergencyCallData.Control+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.DeviceInfo+xml","encoding":"base64","xrefs":{"rfc":["rfc7852"],"template":["application/EmergencyCallData.DeviceInfo+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.eCall.MSD","encoding":"base64","xrefs":{"rfc":["rfc8147"],"template":["application/EmergencyCallData.eCall.MSD"]},"registered":true},{"content-type":"application/EmergencyCallData.ProviderInfo+xml","encoding":"base64","xrefs":{"rfc":["rfc7852"],"template":["application/EmergencyCallData.ProviderInfo+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.ServiceInfo+xml","encoding":"base64","xrefs":{"rfc":["rfc7852"],"template":["application/EmergencyCallData.ServiceInfo+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.SubscriberInfo+xml","encoding":"base64","xrefs":{"rfc":["rfc7852"],"template":["application/EmergencyCallData.SubscriberInfo+xml"]},"registered":true},{"content-type":"application/EmergencyCallData.VEDS+xml","encoding":"base64","xrefs":{"rfc":["rfc8148"],"template":["application/EmergencyCallData.VEDS+xml"]},"registered":true},{"content-type":"application/emma+xml","friendly":{"en":"Extensible MultiModal Annotation"},"encoding":"base64","extensions":["emma"],"xrefs":{"person":["ISO-IEC_JTC1","W3C"],"uri":["http://www.w3.org/TR/2007/CR-emma-20071211/#media-type-registration"],"template":["application/emma+xml"]},"registered":true},{"content-type":"application/emotionml+xml","encoding":"base64","xrefs":{"person":["Kazuyuki_Ashimura","W3C"],"template":["application/emotionml+xml"]},"registered":true},{"content-type":"application/encaprtp","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["application/encaprtp"]},"registered":true},{"content-type":"application/epp+xml","encoding":"base64","xrefs":{"rfc":["rfc5730"],"template":["application/epp+xml"]},"registered":true},{"content-type":"application/epub+zip","friendly":{"en":"Electronic Publication"},"encoding":"base64","extensions":["epub"],"xrefs":{"person":["International_Digital_Publishing_Forum","William_McCoy"],"template":["application/epub+zip"]},"registered":true},{"content-type":"application/eshop","encoding":"base64","xrefs":{"person":["Steve_Katz"],"template":["application/eshop"]},"registered":true},{"content-type":"application/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["application/example"]},"registered":true},{"content-type":"application/excel","encoding":"base64","extensions":["xls","xlt"],"obsolete":true,"use-instead":"application/vnd.ms-excel","registered":false},{"content-type":"application/exi","friendly":{"en":"Efficient XML Interchange"},"encoding":"base64","extensions":["exi"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/2009/CR-exi-20091208/#mediaTypeRegistration"],"template":["application/exi"]},"registered":true},{"content-type":"application/expect-ct-report+json","encoding":"base64","xrefs":{"draft":["RFC-ietf-httpbis-expect-ct-08"],"template":["application/expect-ct-report+json"]},"registered":true},{"content-type":"application/express","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["application/express"]},"registered":true},{"content-type":"application/fastinfoset","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1_SC6_ASN.1_Rapporteur","ITU-T_ASN.1_Rapporteur"],"template":["application/fastinfoset"]},"registered":true},{"content-type":"application/fastsoap","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1_SC6_ASN.1_Rapporteur","ITU-T_ASN.1_Rapporteur"],"template":["application/fastsoap"]},"registered":true},{"content-type":"application/fdt+xml","encoding":"base64","xrefs":{"rfc":["rfc6726"],"template":["application/fdt+xml"]},"registered":true},{"content-type":"application/fhir+json","encoding":"base64","xrefs":{"person":["Grahame_Grieve","HL7"],"template":["application/fhir+json"]},"registered":true},{"content-type":"application/fhir+xml","encoding":"base64","xrefs":{"person":["Grahame_Grieve","HL7"],"template":["application/fhir+xml"]},"registered":true},{"content-type":"application/fits","encoding":"base64","xrefs":{"rfc":["rfc4047"],"template":["application/fits"]},"registered":true},{"content-type":"application/flexfec","encoding":"base64","xrefs":{"rfc":["rfc8627"],"template":["application/flexfec"]},"registered":true},{"content-type":"application/font-sfnt","encoding":"base64","extensions":["otf","ttf"],"obsolete":true,"use-instead":"font/sfnt","xrefs":{"person":["ISO-IEC_JTC1","Levantovsky"],"rfc":["rfc8081"],"template":["application/font-sfnt"],"notes":["- DEPRECATED in favor of font/sfnt"]},"registered":true},{"content-type":"application/font-tdpfr","friendly":{"en":"Portable Font Resource"},"encoding":"base64","extensions":["pfr"],"xrefs":{"rfc":["rfc3073"],"template":["application/font-tdpfr"]},"registered":true},{"content-type":"application/font-woff","friendly":{"en":"Web Open Font Format"},"encoding":"base64","extensions":["woff","woff2"],"obsolete":true,"use-instead":"font/woff","xrefs":{"person":["W3C"],"rfc":["rfc8081"],"template":["application/font-woff"],"notes":["- DEPRECATED in favor of font/woff"]},"registered":true},{"content-type":"application/fractals","encoding":"base64","registered":false},{"content-type":"application/framework-attributes+xml","encoding":"base64","xrefs":{"rfc":["rfc6230"],"template":["application/framework-attributes+xml"]},"registered":true},{"content-type":"application/futuresplash","encoding":"base64","extensions":["spl"],"obsolete":true,"use-instead":"application/x-futuresplash","registered":false},{"content-type":"application/geo+json","encoding":"base64","xrefs":{"rfc":["rfc7946"],"template":["application/geo+json"]},"registered":true},{"content-type":"application/geo+json-seq","encoding":"base64","xrefs":{"rfc":["rfc8142"],"template":["application/geo+json-seq"]},"registered":true},{"content-type":"application/geopackage+sqlite3","encoding":"base64","xrefs":{"person":["OGC","Scott_Simmons"],"template":["application/geopackage+sqlite3"]},"registered":true},{"content-type":"application/geoxacml+xml","encoding":"base64","xrefs":{"person":["OGC","Scott_Simmons"],"template":["application/geoxacml+xml"]},"registered":true},{"content-type":"application/ghostview","encoding":"base64","obsolete":true,"use-instead":"application/x-ghostview","registered":false},{"content-type":"application/gltf-buffer","encoding":"base64","xrefs":{"person":["Khronos","Saurabh_Bhatia"],"template":["application/gltf-buffer"]},"registered":true},{"content-type":"application/gml+xml","encoding":"base64","extensions":["gml"],"xrefs":{"person":["Clemens_Portele","OGC"],"template":["application/gml+xml"]},"registered":true},{"content-type":"application/gpx+xml","encoding":"base64","extensions":["gpx"],"registered":false},{"content-type":"application/gxf","encoding":"base64","extensions":["gxf"],"registered":false},{"content-type":"application/gzip","encoding":"base64","extensions":["gz"],"xrefs":{"rfc":["rfc6713"],"template":["application/gzip"]},"registered":true},{"content-type":"application/H224","encoding":"base64","xrefs":{"rfc":["rfc4573"],"template":["application/H224"]},"registered":true},{"content-type":"application/held+xml","encoding":"base64","xrefs":{"rfc":["rfc5985"],"template":["application/held+xml"]},"registered":true},{"content-type":"application/hep","encoding":"base64","extensions":["hep"],"obsolete":true,"use-instead":"application/x-hep","registered":false},{"content-type":"application/http","encoding":"base64","xrefs":{"draft":["RFC-ietf-httpbis-messaging-19"],"template":["application/http"]},"registered":true},{"content-type":"application/hyperstudio","friendly":{"en":"Hyperstudio"},"encoding":"base64","extensions":["stk"],"xrefs":{"person":["Michael_Domino"],"template":["application/hyperstudio"]},"registered":true},{"content-type":"application/i-deas","encoding":"base64","registered":false},{"content-type":"application/ibe-key-request+xml","encoding":"base64","xrefs":{"rfc":["rfc5408"],"template":["application/ibe-key-request+xml"]},"registered":true},{"content-type":"application/ibe-pkg-reply+xml","encoding":"base64","xrefs":{"rfc":["rfc5408"],"template":["application/ibe-pkg-reply+xml"]},"registered":true},{"content-type":"application/ibe-pp-data","encoding":"base64","xrefs":{"rfc":["rfc5408"],"template":["application/ibe-pp-data"]},"registered":true},{"content-type":"application/iges","encoding":"base64","xrefs":{"person":["Curtis_Parks"],"template":["application/iges"]},"registered":true},{"content-type":"application/im-iscomposing+xml","encoding":"base64","xrefs":{"rfc":["rfc3994"],"template":["application/im-iscomposing+xml"]},"registered":true},{"content-type":"application/imagemap","encoding":"8bit","extensions":["imagemap","imap"],"obsolete":true,"use-instead":"application/x-imagemap","registered":false},{"content-type":"application/index","encoding":"base64","xrefs":{"rfc":["rfc2652"],"template":["application/index"]},"registered":true},{"content-type":"application/index.cmd","encoding":"base64","xrefs":{"rfc":["rfc2652"],"template":["application/index.cmd"]},"registered":true},{"content-type":"application/index.obj","encoding":"base64","xrefs":{"rfc":["rfc2652"],"template":["application/index.obj"]},"registered":true},{"content-type":"application/index.response","encoding":"base64","xrefs":{"rfc":["rfc2652"],"template":["application/index.response"]},"registered":true},{"content-type":"application/index.vnd","encoding":"base64","xrefs":{"rfc":["rfc2652"],"template":["application/index.vnd"]},"registered":true},{"content-type":"application/inkml+xml","encoding":"base64","extensions":["ink","inkml"],"xrefs":{"person":["Kazuyuki_Ashimura"],"template":["application/inkml+xml"]},"registered":true},{"content-type":"application/ion","encoding":"base64","xrefs":{"person":["Jonathan_Hohle"]},"registered":true,"provisional":true},{"content-type":"application/iotp","encoding":"base64","xrefs":{"rfc":["rfc2935"],"template":["application/IOTP"]},"registered":true},{"content-type":"application/ipfix","friendly":{"en":"Internet Protocol Flow Information Export"},"encoding":"base64","extensions":["ipfix"],"xrefs":{"rfc":["rfc5655"],"template":["application/ipfix"]},"registered":true},{"content-type":"application/ipp","encoding":"base64","xrefs":{"rfc":["rfc8010"],"template":["application/ipp"]},"registered":true},{"content-type":"application/isup","encoding":"base64","xrefs":{"rfc":["rfc3204"],"template":["application/ISUP"]},"registered":true},{"content-type":"application/its+xml","encoding":"base64","xrefs":{"person":["ITS-IG-W3C","W3C"],"template":["application/its+xml"]},"registered":true},{"content-type":"application/java-archive","friendly":{"en":"Java Archive"},"encoding":"base64","extensions":["jar"],"registered":false},{"content-type":"application/java-serialized-object","friendly":{"en":"Java Serialized Object"},"encoding":"base64","extensions":["ser"],"registered":false},{"content-type":"application/java-vm","friendly":{"en":"Java Bytecode File"},"encoding":"base64","extensions":["class"],"registered":false},{"content-type":"application/javascript","friendly":{"en":"JavaScript"},"encoding":"8bit","extensions":["js","mjs","sj"],"xrefs":{"rfc":["rfc4329"],"template":["application/javascript"]},"registered":true},{"content-type":"application/jf2feed+json","encoding":"base64","xrefs":{"person":["Ivan_Herman","W3C"],"template":["application/jf2feed+json"]},"registered":true},{"content-type":"application/jose","encoding":"base64","xrefs":{"rfc":["rfc7515"],"template":["application/jose"]},"registered":true},{"content-type":"application/jose+json","encoding":"base64","xrefs":{"rfc":["rfc7515"],"template":["application/jose+json"]},"registered":true},{"content-type":"application/jrd+json","encoding":"base64","xrefs":{"rfc":["rfc7033"],"template":["application/jrd+json"]},"registered":true},{"content-type":"application/jscalendar+json","encoding":"base64","xrefs":{"rfc":["rfc8984"],"template":["application/jscalendar+json"]},"registered":true},{"content-type":"application/json","friendly":{"en":"JavaScript Object Notation (JSON)"},"encoding":"8bit","extensions":["json"],"xrefs":{"rfc":["rfc8259"],"template":["application/json"]},"registered":true},{"content-type":"application/json-nd","encoding":"base64","xrefs":{"person":["Glen_Kleidon"]},"registered":true,"provisional":true},{"content-type":"application/json-patch+json","encoding":"base64","xrefs":{"rfc":["rfc6902"],"template":["application/json-patch+json"]},"registered":true},{"content-type":"application/json-seq","encoding":"base64","xrefs":{"rfc":["rfc7464"],"template":["application/json-seq"]},"registered":true},{"content-type":"application/jsonml+json","encoding":"base64","extensions":["jsonml"],"registered":false},{"content-type":"application/jwk+json","encoding":"base64","xrefs":{"rfc":["rfc7517"],"template":["application/jwk+json"]},"registered":true},{"content-type":"application/jwk-set+json","encoding":"base64","xrefs":{"rfc":["rfc7517"],"template":["application/jwk-set+json"]},"registered":true},{"content-type":"application/jwt","encoding":"base64","xrefs":{"rfc":["rfc7519"],"template":["application/jwt"]},"registered":true},{"content-type":"application/kpml-request+xml","encoding":"base64","xrefs":{"rfc":["rfc4730"],"template":["application/kpml-request+xml"]},"registered":true},{"content-type":"application/kpml-response+xml","encoding":"base64","xrefs":{"rfc":["rfc4730"],"template":["application/kpml-response+xml"]},"registered":true},{"content-type":"application/ld+json","encoding":"base64","xrefs":{"person":["Ivan_Herman","W3C"],"template":["application/ld+json"]},"registered":true},{"content-type":"application/lgr+xml","encoding":"base64","xrefs":{"rfc":["rfc7940"],"template":["application/lgr+xml"]},"registered":true},{"content-type":"application/link-format","encoding":"base64","xrefs":{"rfc":["rfc6690"],"template":["application/link-format"]},"registered":true},{"content-type":"application/load-control+xml","encoding":"base64","xrefs":{"rfc":["rfc7200"],"template":["application/load-control+xml"]},"registered":true},{"content-type":"application/lost+xml","encoding":"base64","extensions":["lostxml"],"xrefs":{"rfc":["rfc5222"],"template":["application/lost+xml"]},"registered":true},{"content-type":"application/lostsync+xml","encoding":"base64","xrefs":{"rfc":["rfc6739"],"template":["application/lostsync+xml"]},"registered":true},{"content-type":"application/lotus-123","encoding":"base64","extensions":["wks"],"obsolete":true,"use-instead":"application/vnd.lotus-1-2-3","registered":false},{"content-type":"application/lpf+zip","encoding":"base64","xrefs":{"person":["Ivan_Herman","W3C"],"template":["application/lpf+zip"]},"registered":true},{"content-type":"application/LXF","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/LXF"]},"registered":true},{"content-type":"application/mac-binhex40","friendly":{"en":"Macintosh BinHex 4.0"},"encoding":"8bit","extensions":["hqx"],"xrefs":{"person":["Patrik_Faltstrom"],"template":["application/mac-binhex40"]},"registered":true},{"content-type":"application/mac-compactpro","friendly":{"en":"Compact Pro"},"encoding":"base64","extensions":["cpt"],"obsolete":true,"use-instead":"application/x-mac-compactpro","registered":false},{"content-type":"application/macbinary","encoding":"base64","registered":false},{"content-type":"application/macwriteii","encoding":"base64","xrefs":{"person":["Paul_Lindner"],"template":["application/macwriteii"]},"registered":true},{"content-type":"application/mads+xml","friendly":{"en":"Metadata Authority Description Schema"},"encoding":"base64","extensions":["mads"],"xrefs":{"rfc":["rfc6207"],"template":["application/mads+xml"]},"registered":true},{"content-type":"application/manifest+json","encoding":"base64","extensions":["webmanifest"],"xrefs":{"person":["Marcos_Caceres","W3C"],"template":["application/manifest+json"]},"registered":true},{"content-type":"application/marc","friendly":{"en":"MARC Formats"},"encoding":"base64","extensions":["mrc"],"xrefs":{"rfc":["rfc2220"],"template":["application/marc"]},"registered":true},{"content-type":"application/marcxml+xml","friendly":{"en":"MARC21 XML Schema"},"encoding":"base64","extensions":["mrcx"],"xrefs":{"rfc":["rfc6207"],"template":["application/marcxml+xml"]},"registered":true},{"content-type":"application/mathcad","encoding":"base64","extensions":["mcd"],"obsolete":true,"use-instead":"application/vnd.mcd","registered":false},{"content-type":"application/mathematica","friendly":{"en":"Mathematica Notebooks"},"encoding":"base64","extensions":["ma","mb","nb"],"xrefs":{"person":["Wolfram"],"template":["application/mathematica"]},"registered":true},{"content-type":"application/mathematica-old","encoding":"base64","obsolete":true,"use-instead":"application/x-mathematica-old","registered":false},{"content-type":"application/mathml+xml","friendly":{"en":"Mathematical Markup Language"},"encoding":"base64","extensions":["mathml"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/MathML3/appendixb.html"],"template":["application/mathml+xml"]},"registered":true},{"content-type":"application/mathml-content+xml","encoding":"base64","xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/MathML3/appendixb.html"],"template":["application/mathml-content+xml"]},"registered":true},{"content-type":"application/mathml-presentation+xml","encoding":"base64","xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/MathML3/appendixb.html"],"template":["application/mathml-presentation+xml"]},"registered":true},{"content-type":"application/mbms-associated-procedure-description+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-associated-procedure-description+xml"]},"registered":true},{"content-type":"application/mbms-deregister+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-deregister+xml"]},"registered":true},{"content-type":"application/mbms-envelope+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-envelope+xml"]},"registered":true},{"content-type":"application/mbms-msk+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-msk+xml"]},"registered":true},{"content-type":"application/mbms-msk-response+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-msk-response+xml"]},"registered":true},{"content-type":"application/mbms-protection-description+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-protection-description+xml"]},"registered":true},{"content-type":"application/mbms-reception-report+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-reception-report+xml"]},"registered":true},{"content-type":"application/mbms-register+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-register+xml"]},"registered":true},{"content-type":"application/mbms-register-response+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-register-response+xml"]},"registered":true},{"content-type":"application/mbms-schedule+xml","encoding":"base64","xrefs":{"person":["Eric_Turcotte","_3GPP"],"template":["application/mbms-schedule+xml"]},"registered":true},{"content-type":"application/mbms-user-service-description+xml","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/mbms-user-service-description+xml"]},"registered":true},{"content-type":"application/mbox","friendly":{"en":"Mbox database files"},"encoding":"base64","extensions":["mbox"],"xrefs":{"rfc":["rfc4155"],"template":["application/mbox"]},"registered":true},{"content-type":"application/media-policy-dataset+xml","encoding":"base64","xrefs":{"rfc":["rfc6796"],"template":["application/media-policy-dataset+xml"]},"registered":true},{"content-type":"application/media_control+xml","encoding":"base64","xrefs":{"rfc":["rfc5168"],"template":["application/media_control+xml"]},"registered":true},{"content-type":"application/mediaservercontrol+xml","friendly":{"en":"Media Server Control Markup Language"},"encoding":"base64","extensions":["mscml"],"xrefs":{"rfc":["rfc5022"],"template":["application/mediaservercontrol+xml"]},"registered":true},{"content-type":"application/merge-patch+json","encoding":"base64","xrefs":{"rfc":["rfc7396"],"template":["application/merge-patch+json"]},"registered":true},{"content-type":"application/metalink+xml","encoding":"base64","extensions":["metalink"],"registered":false},{"content-type":"application/metalink4+xml","friendly":{"en":"Metalink"},"encoding":"base64","extensions":["meta4"],"xrefs":{"rfc":["rfc5854"],"template":["application/metalink4+xml"]},"registered":true},{"content-type":"application/mets+xml","friendly":{"en":"Metadata Encoding and Transmission Standard"},"encoding":"base64","extensions":["mets"],"xrefs":{"rfc":["rfc6207"],"template":["application/mets+xml"]},"registered":true},{"content-type":"application/MF4","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/MF4"]},"registered":true},{"content-type":"application/mikey","encoding":"base64","xrefs":{"rfc":["rfc3830"],"template":["application/mikey"]},"registered":true},{"content-type":"application/mipc","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/mipc"]},"registered":true},{"content-type":"application/missing-blocks+cbor-seq","encoding":"base64","xrefs":{"draft":["RFC-ietf-core-new-block-14"],"template":["application/missing-blocks+cbor-seq"]},"registered":true},{"content-type":"application/mmt-aei+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/mmt-aei+xml"]},"registered":true},{"content-type":"application/mmt-usd+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/mmt-usd+xml"]},"registered":true},{"content-type":"application/mods+xml","friendly":{"en":"Metadata Object Description Schema"},"encoding":"base64","extensions":["mods"],"xrefs":{"rfc":["rfc6207"],"template":["application/mods+xml"]},"registered":true},{"content-type":"application/moss-keys","encoding":"base64","xrefs":{"rfc":["rfc1848"],"template":["application/moss-keys"]},"registered":true},{"content-type":"application/moss-signature","encoding":"base64","xrefs":{"rfc":["rfc1848"],"template":["application/moss-signature"]},"registered":true},{"content-type":"application/mosskey-data","encoding":"base64","xrefs":{"rfc":["rfc1848"],"template":["application/mosskey-data"]},"registered":true},{"content-type":"application/mosskey-request","encoding":"base64","xrefs":{"rfc":["rfc1848"],"template":["application/mosskey-request"]},"registered":true},{"content-type":"application/mp21","friendly":{"en":"MPEG-21"},"encoding":"base64","extensions":["m21","mp21"],"xrefs":{"rfc":["rfc6381"],"person":["David_Singer"],"template":["application/mp21"]},"registered":true},{"content-type":"application/mp4","friendly":{"en":"MPEG4"},"encoding":"base64","extensions":["mp4","mpg4","mp4s"],"xrefs":{"rfc":["rfc4337","rfc6381"],"template":["application/mp4"]},"registered":true},{"content-type":"application/mpeg4-generic","encoding":"base64","xrefs":{"rfc":["rfc3640"],"template":["application/mpeg4-generic"]},"registered":true},{"content-type":"application/mpeg4-iod","encoding":"base64","xrefs":{"rfc":["rfc4337"],"template":["application/mpeg4-iod"]},"registered":true},{"content-type":"application/mpeg4-iod-xmt","encoding":"base64","xrefs":{"rfc":["rfc4337"],"template":["application/mpeg4-iod-xmt"]},"registered":true},{"content-type":"application/mrb-consumer+xml","encoding":"base64","xrefs":{"rfc":["rfc6917"],"template":["application/mrb-consumer+xml"]},"registered":true},{"content-type":"application/mrb-publish+xml","encoding":"base64","xrefs":{"rfc":["rfc6917"],"template":["application/mrb-publish+xml"]},"registered":true},{"content-type":"application/msc-ivr+xml","encoding":"base64","xrefs":{"rfc":["rfc6231"],"template":["application/msc-ivr+xml"]},"registered":true},{"content-type":"application/msc-mixer+xml","encoding":"base64","xrefs":{"rfc":["rfc6505"],"template":["application/msc-mixer+xml"]},"registered":true},{"content-type":"application/msword","friendly":{"en":"Microsoft Word"},"encoding":"base64","extensions":["doc","dot","wrd"],"xrefs":{"person":["Paul_Lindner"],"template":["application/msword"]},"registered":true},{"content-type":"application/mud+json","encoding":"base64","xrefs":{"rfc":["rfc8520"],"template":["application/mud+json"]},"registered":true},{"content-type":"application/multipart-core","encoding":"base64","xrefs":{"rfc":["rfc8710"],"template":["application/multipart-core"]},"registered":true},{"content-type":"application/mxf","friendly":{"en":"Material Exchange Format"},"encoding":"base64","extensions":["mxf"],"xrefs":{"rfc":["rfc4539"],"template":["application/mxf"]},"registered":true},{"content-type":"application/n-quads","encoding":"base64","xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["application/n-quads"]},"registered":true},{"content-type":"application/n-triples","encoding":"base64","xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["application/n-triples"]},"registered":true},{"content-type":"application/nasdata","encoding":"base64","xrefs":{"rfc":["rfc4707"],"template":["application/nasdata"]},"registered":true},{"content-type":"application/netcdf","encoding":"base64","xrefs":{"person":["Ethan_Davis"]},"registered":true,"provisional":true},{"content-type":"application/netcdf","encoding":"base64","extensions":["nc","cdf"],"registered":false},{"content-type":"application/news-checkgroups","encoding":"base64","xrefs":{"rfc":["rfc5537"],"template":["application/news-checkgroups"]},"registered":true},{"content-type":"application/news-groupinfo","encoding":"base64","xrefs":{"rfc":["rfc5537"],"template":["application/news-groupinfo"]},"registered":true},{"content-type":"application/news-message-id","encoding":"base64","obsolete":true,"registered":false},{"content-type":"application/news-transmission","encoding":"base64","xrefs":{"rfc":["rfc5537"],"template":["application/news-transmission"]},"registered":true},{"content-type":"application/nlsml+xml","encoding":"base64","xrefs":{"rfc":["rfc6787"],"template":["application/nlsml+xml"]},"registered":true},{"content-type":"application/node","encoding":"base64","xrefs":{"person":["Node.js_TSC"],"template":["application/node"]},"registered":true},{"content-type":"application/nss","encoding":"base64","xrefs":{"person":["Michael_Hammer"],"template":["application/nss"]},"registered":true},{"content-type":"application/oauth-authz-req+jwt","encoding":"base64","xrefs":{"rfc":["rfc9101"],"template":["application/oauth-authz-req+jwt"]},"registered":true},{"content-type":"application/ocsp-request","encoding":"base64","xrefs":{"rfc":["rfc6960"],"template":["application/ocsp-request"]},"registered":true},{"content-type":"application/ocsp-response","encoding":"base64","xrefs":{"rfc":["rfc6960"],"template":["application/ocsp-response"]},"registered":true},{"content-type":"application/octet-stream","friendly":{"en":"Binary Data"},"encoding":"base64","extensions":["bin","dms","lha","lzh","class","ani","pgp","gpg","so","dll","dylib","bpk","deploy","dist","distz","dump","elc","lrf","mar","pkg","ipa"],"xrefs":{"rfc":["rfc2045","rfc2046"],"template":["application/octet-stream"]},"registered":true},{"content-type":"application/oda","friendly":{"en":"Office Document Architecture"},"encoding":"base64","extensions":["oda"],"xrefs":{"rfc":["rfc1494"],"template":["application/ODA"]},"registered":true},{"content-type":"application/odm+json","encoding":"base64","xrefs":{"person":["Sam_Hume"]},"registered":true,"provisional":true},{"content-type":"application/odm+xml","encoding":"base64","xrefs":{"person":["CDISC","Sam_Hume"],"template":["application/odm+xml"]},"registered":true},{"content-type":"application/ODX","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/ODX"]},"registered":true},{"content-type":"application/oebps-package+xml","friendly":{"en":"Open eBook Publication Structure"},"encoding":"base64","extensions":["opf"],"xrefs":{"rfc":["rfc4839"],"template":["application/oebps-package+xml"]},"registered":true},{"content-type":"application/ogg","friendly":{"en":"Ogg"},"encoding":"base64","extensions":["ogx"],"xrefs":{"rfc":["rfc5334","rfc7845"],"template":["application/ogg"]},"registered":true},{"content-type":"application/omdoc+xml","encoding":"base64","extensions":["omdoc"],"registered":false},{"content-type":"application/onenote","friendly":{"en":"Microsoft OneNote"},"encoding":"base64","extensions":["onepkg","onetmp","onetoc","onetoc2"],"registered":false},{"content-type":"application/opc-nodeset+xml","encoding":"base64","xrefs":{"person":["OPC_Foundation"],"template":["application/opc-nodeset+xml"]},"registered":true},{"content-type":"application/oscore","encoding":"base64","xrefs":{"rfc":["rfc8613"],"template":["application/oscore"]},"registered":true},{"content-type":"application/oxps","encoding":"base64","extensions":["oxps"],"xrefs":{"person":["Ecma_International_Helpdesk"],"template":["application/oxps"]},"registered":true},{"content-type":"application/p21","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["application/p21"]},"registered":true},{"content-type":"application/p21+zip","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["application/p21+zip"]},"registered":true},{"content-type":"application/p2p-overlay+xml","encoding":"base64","xrefs":{"rfc":["rfc6940"],"template":["application/p2p-overlay+xml"]},"registered":true},{"content-type":"application/parityfec","encoding":"base64","xrefs":{"rfc":["rfc3009"],"template":["application/parityfec"]},"registered":true},{"content-type":"application/passport","encoding":"base64","xrefs":{"rfc":["rfc8225"],"template":["application/passport"]},"registered":true},{"content-type":"application/patch-ops-error+xml","friendly":{"en":"XML Patch Framework"},"encoding":"base64","extensions":["xer"],"xrefs":{"rfc":["rfc5261"],"template":["application/patch-ops-error+xml"]},"registered":true},{"content-type":"application/pdf","friendly":{"en":"Adobe Portable Document Format"},"encoding":"base64","extensions":["pdf","ai"],"xrefs":{"rfc":["rfc8118"],"template":["application/pdf"]},"registered":true},{"content-type":"application/PDX","encoding":"base64","xrefs":{"person":["ASAM","Thomas_Thomsen"],"template":["application/PDX"]},"registered":true},{"content-type":"application/pem-certificate-chain","encoding":"base64","xrefs":{"rfc":["rfc8555"],"template":["application/pem-certificate-chain"]},"registered":true},{"content-type":"application/pgp-encrypted","friendly":{"en":"Pretty Good Privacy"},"encoding":"7bit","extensions":["pgp","gpg"],"xrefs":{"rfc":["rfc3156"],"template":["application/pgp-encrypted"]},"registered":true},{"content-type":"application/pgp-keys","encoding":"7bit","xrefs":{"rfc":["rfc3156"],"template":["application/pgp-keys"]},"registered":true,"signature":true},{"content-type":"application/pgp-signature","friendly":{"en":"Pretty Good Privacy - Signature"},"encoding":"base64","extensions":["asc","sig"],"xrefs":{"rfc":["rfc3156"],"template":["application/pgp-signature"]},"registered":true,"signature":true},{"content-type":"application/pics-rules","friendly":{"en":"PICSRules"},"encoding":"base64","extensions":["prf"],"registered":false},{"content-type":"application/pidf+xml","encoding":"base64","xrefs":{"rfc":["rfc3863"],"template":["application/pidf+xml"]},"registered":true},{"content-type":"application/pidf-diff+xml","encoding":"base64","xrefs":{"rfc":["rfc5262"],"template":["application/pidf-diff+xml"]},"registered":true},{"content-type":"application/pkcs10","friendly":{"en":"PKCS #10 - Certification Request Standard"},"encoding":"base64","extensions":["p10"],"xrefs":{"rfc":["rfc5967"],"template":["application/pkcs10"]},"registered":true,"signature":true},{"content-type":"application/pkcs12","encoding":"base64","xrefs":{"person":["IETF"],"template":["application/pkcs12"]},"registered":true},{"content-type":"application/pkcs7-mime","friendly":{"en":"PKCS #7 - Cryptographic Message Syntax Standard"},"encoding":"base64","extensions":["p7m","p7c"],"xrefs":{"rfc":["rfc7114","rfc8551"],"template":["application/pkcs7-mime"]},"registered":true,"signature":true},{"content-type":"application/pkcs7-signature","friendly":{"en":"PKCS #7 - Cryptographic Message Syntax Standard"},"encoding":"base64","extensions":["p7s"],"xrefs":{"rfc":["rfc8551"],"template":["application/pkcs7-signature"]},"registered":true,"signature":true},{"content-type":"application/pkcs8","friendly":{"en":"PKCS #8 - Private-Key Information Syntax Standard"},"encoding":"base64","extensions":["p8"],"xrefs":{"rfc":["rfc5958"],"template":["application/pkcs8"]},"registered":true},{"content-type":"application/pkcs8-encrypted","encoding":"base64","xrefs":{"rfc":["rfc8351"],"template":["application/pkcs8-encrypted"]},"registered":true},{"content-type":"application/pkix-attr-cert","friendly":{"en":"Attribute Certificate"},"encoding":"base64","extensions":["ac"],"xrefs":{"rfc":["rfc5877"],"template":["application/pkix-attr-cert"]},"registered":true},{"content-type":"application/pkix-cert","friendly":{"en":"Internet Public Key Infrastructure - Certificate"},"encoding":"base64","extensions":["cer"],"xrefs":{"rfc":["rfc2585"],"template":["application/pkix-cert"]},"registered":true},{"content-type":"application/pkix-crl","friendly":{"en":"Internet Public Key Infrastructure - Certificate Revocation Lists"},"encoding":"base64","extensions":["crl"],"xrefs":{"rfc":["rfc2585"],"template":["application/pkix-crl"]},"registered":true},{"content-type":"application/pkix-keyinfo","encoding":"base64","xrefs":{"draft":["draft-hallambaker-mesh-udf"]},"registered":true,"provisional":true},{"content-type":"application/pkix-pkipath","friendly":{"en":"Internet Public Key Infrastructure - Certification Path"},"encoding":"base64","extensions":["pkipath"],"xrefs":{"rfc":["rfc6066"],"template":["application/pkix-pkipath"]},"registered":true},{"content-type":"application/pkixcmp","friendly":{"en":"Internet Public Key Infrastructure - Certificate Management Protocole"},"encoding":"base64","extensions":["pki"],"xrefs":{"rfc":["rfc2510"],"template":["application/pkixcmp"]},"registered":true},{"content-type":"application/pls+xml","friendly":{"en":"Pronunciation Lexicon Specification"},"encoding":"base64","extensions":["pls"],"xrefs":{"rfc":["rfc4267"],"template":["application/pls+xml"]},"registered":true},{"content-type":"application/poc-settings+xml","encoding":"base64","xrefs":{"rfc":["rfc4354"],"template":["application/poc-settings+xml"]},"registered":true},{"content-type":"application/postscript","friendly":{"en":"PostScript"},"encoding":"8bit","extensions":["eps","ps","ai"],"xrefs":{"rfc":["rfc2045","rfc2046"],"template":["application/postscript"]},"registered":true},{"content-type":"application/powerpoint","encoding":"base64","extensions":["ppt","pps","pot"],"registered":false},{"content-type":"application/ppsp-tracker+json","encoding":"base64","xrefs":{"rfc":["rfc7846"],"template":["application/ppsp-tracker+json"]},"registered":true},{"content-type":"application/pro_eng","encoding":"base64","registered":false},{"content-type":"application/problem+json","encoding":"base64","xrefs":{"rfc":["rfc7807"],"template":["application/problem+json"]},"registered":true},{"content-type":"application/problem+xml","encoding":"base64","xrefs":{"rfc":["rfc7807"],"template":["application/problem+xml"]},"registered":true},{"content-type":"application/provenance+xml","encoding":"base64","xrefs":{"person":["Ivan_Herman","W3C"],"template":["application/provenance+xml"]},"registered":true},{"content-type":"application/prs.alvestrand.titrax-sheet","encoding":"base64","xrefs":{"person":["Harald_T._Alvestrand"],"template":["application/prs.alvestrand.titrax-sheet"]},"registered":true},{"content-type":"application/prs.cww","friendly":{"en":"CU-Writer"},"encoding":"base64","extensions":["cw","cww"],"xrefs":{"person":["Khemchart_Rungchavalnont"],"template":["application/prs.cww"]},"registered":true},{"content-type":"application/prs.cyn","encoding":"base64","xrefs":{"person":["Cynthia_Revström"],"template":["application/prs.cyn"]},"registered":true},{"content-type":"application/prs.hpub+zip","encoding":"base64","xrefs":{"person":["Giulio_Zambon"],"template":["application/prs.hpub+zip"]},"registered":true},{"content-type":"application/prs.nprend","encoding":"base64","extensions":["rnd","rct"],"xrefs":{"person":["Jay_Doggett"],"template":["application/prs.nprend"]},"registered":true},{"content-type":"application/prs.plucker","encoding":"base64","xrefs":{"person":["Bill_Janssen"],"template":["application/prs.plucker"]},"registered":true},{"content-type":"application/prs.rdf-xml-crypt","encoding":"base64","xrefs":{"person":["Toby_Inkster"],"template":["application/prs.rdf-xml-crypt"]},"registered":true},{"content-type":"application/prs.xsf+xml","encoding":"base64","xrefs":{"person":["Maik_Stührenberg"],"template":["application/prs.xsf+xml"]},"registered":true},{"content-type":"application/pskc+xml","friendly":{"en":"Portable Symmetric Key Container"},"encoding":"base64","extensions":["pskcxml"],"xrefs":{"rfc":["rfc6030"],"template":["application/pskc+xml"]},"registered":true},{"content-type":"application/pvd+json","encoding":"base64","xrefs":{"rfc":["rfc8801"],"template":["application/pvd+json"]},"registered":true},{"content-type":"application/qsig","encoding":"base64","xrefs":{"rfc":["rfc3204"],"template":["application/QSIG"]},"registered":true},{"content-type":"application/quicktimeplayer","encoding":"base64","extensions":["qtl"],"obsolete":true,"use-instead":"application/x-quicktimeplayer","registered":false},{"content-type":"application/raptorfec","encoding":"base64","xrefs":{"rfc":["rfc6682"],"template":["application/raptorfec"]},"registered":true},{"content-type":"application/rdap+json","encoding":"base64","xrefs":{"rfc":["rfc9083"],"template":["application/rdap+json"]},"registered":true},{"content-type":"application/rdf+xml","friendly":{"en":"Resource Description Framework"},"encoding":"8bit","extensions":["rdf"],"xrefs":{"rfc":["rfc3870"],"template":["application/rdf+xml"]},"registered":true},{"content-type":"application/reginfo+xml","friendly":{"en":"IMS Networks"},"encoding":"base64","extensions":["rif"],"xrefs":{"rfc":["rfc3680"],"template":["application/reginfo+xml"]},"registered":true},{"content-type":"application/relax-ng-compact-syntax","friendly":{"en":"Relax NG Compact Syntax"},"encoding":"base64","extensions":["rnc"],"xrefs":{"uri":["http://www.jtc1sc34.org/repository/0661.pdf"],"template":["application/relax-ng-compact-syntax"]},"registered":true},{"content-type":"application/remote-printing","encoding":"base64","xrefs":{"rfc":["rfc1486"],"person":["Marshall_Rose"],"template":["application/remote-printing"]},"registered":true},{"content-type":"application/remote_printing","encoding":"base64","obsolete":true,"use-instead":"application/remote-printing","registered":false},{"content-type":"application/reports+json","encoding":"base64","xrefs":{"person":["Douglas_Creager"]},"registered":true,"provisional":true},{"content-type":"application/reputon+json","encoding":"base64","xrefs":{"rfc":["rfc7071"],"template":["application/reputon+json"]},"registered":true},{"content-type":"application/resource-lists+xml","friendly":{"en":"XML Resource Lists"},"encoding":"base64","extensions":["rl"],"xrefs":{"rfc":["rfc4826"],"template":["application/resource-lists+xml"]},"registered":true},{"content-type":"application/resource-lists-diff+xml","friendly":{"en":"XML Resource Lists Diff"},"encoding":"base64","extensions":["rld"],"xrefs":{"rfc":["rfc5362"],"template":["application/resource-lists-diff+xml"]},"registered":true},{"content-type":"application/rfc+xml","encoding":"base64","xrefs":{"rfc":["rfc7991"],"template":["application/rfc+xml"]},"registered":true},{"content-type":"application/rif+xml","encoding":"base64","xrefs":{"person":["Sandro_Hawke"]},"registered":true,"provisional":true},{"content-type":"application/riscos","encoding":"base64","xrefs":{"person":["Nick_Smith"],"template":["application/riscos"]},"registered":true},{"content-type":"application/rlmi+xml","encoding":"base64","xrefs":{"rfc":["rfc4662"],"template":["application/rlmi+xml"]},"registered":true},{"content-type":"application/rls-services+xml","friendly":{"en":"XML Resource Lists"},"encoding":"base64","extensions":["rs"],"xrefs":{"rfc":["rfc4826"],"template":["application/rls-services+xml"]},"registered":true},{"content-type":"application/route-apd+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/route-apd+xml"]},"registered":true},{"content-type":"application/route-s-tsid+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/route-s-tsid+xml"]},"registered":true},{"content-type":"application/route-usd+xml","encoding":"base64","xrefs":{"person":["ATSC"],"template":["application/route-usd+xml"]},"registered":true},{"content-type":"application/rpki-checklist","encoding":"base64","xrefs":{"draft":["draft-ietf-sidrops-rpki-rsc-02"]},"registered":true,"provisional":true},{"content-type":"application/rpki-ghostbusters","encoding":"base64","extensions":["gbr"],"xrefs":{"rfc":["rfc6493"],"template":["application/rpki-ghostbusters"]},"registered":true},{"content-type":"application/rpki-manifest","encoding":"base64","extensions":["mft"],"xrefs":{"rfc":["rfc6481"],"template":["application/rpki-manifest"]},"registered":true},{"content-type":"application/rpki-publication","encoding":"base64","xrefs":{"rfc":["rfc8181"],"template":["application/rpki-publication"]},"registered":true},{"content-type":"application/rpki-roa","encoding":"base64","extensions":["roa"],"xrefs":{"rfc":["rfc6481"],"template":["application/rpki-roa"]},"registered":true},{"content-type":"application/rpki-updown","encoding":"base64","xrefs":{"rfc":["rfc6492"],"template":["application/rpki-updown"]},"registered":true},{"content-type":"application/rsd+xml","friendly":{"en":"Really Simple Discovery"},"encoding":"base64","extensions":["rsd"],"registered":false},{"content-type":"application/rss+xml","friendly":{"en":"RSS - Really Simple Syndication"},"encoding":"base64","extensions":["rss"],"registered":false},{"content-type":"application/rtf","friendly":{"en":"Rich Text Format"},"encoding":"base64","extensions":["rtf"],"xrefs":{"person":["Paul_Lindner"],"template":["application/rtf"]},"registered":true},{"content-type":"application/rtploopback","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["application/rtploopback"]},"registered":true},{"content-type":"application/rtx","encoding":"base64","xrefs":{"rfc":["rfc4588"],"template":["application/rtx"]},"registered":true},{"content-type":"application/samlassertion+xml","encoding":"base64","xrefs":{"person":["OASIS_Security_Services_Technical_Committee_SSTC"],"template":["application/samlassertion+xml"]},"registered":true},{"content-type":"application/samlmetadata+xml","encoding":"base64","xrefs":{"person":["OASIS_Security_Services_Technical_Committee_SSTC"],"template":["application/samlmetadata+xml"]},"registered":true},{"content-type":"application/sarif+json","encoding":"base64","xrefs":{"person":["Laurence_J._Golding","Michael_C._Fanning","OASIS"],"template":["application/sarif+json"]},"registered":true},{"content-type":"application/sarif-external-properties+json","encoding":"base64","xrefs":{"person":["David_Keaton","Michael_C._Fanning","OASIS"],"template":["application/sarif-external-properties+json"]},"registered":true},{"content-type":"application/sbe","encoding":"base64","xrefs":{"person":["Donald_L._Mendelson","FIX_Trading_Community"],"template":["application/sbe"]},"registered":true},{"content-type":"application/sbml+xml","friendly":{"en":"Systems Biology Markup Language"},"encoding":"base64","extensions":["sbml"],"xrefs":{"rfc":["rfc3823"],"template":["application/sbml+xml"]},"registered":true},{"content-type":"application/scaip+xml","encoding":"base64","xrefs":{"person":["Oskar_Jonsson","SIS"],"template":["application/scaip+xml"]},"registered":true},{"content-type":"application/scim+json","encoding":"base64","xrefs":{"rfc":["rfc7644"],"template":["application/scim+json"]},"registered":true},{"content-type":"application/scvp-cv-request","friendly":{"en":"Server-Based Certificate Validation Protocol - Validation Request"},"encoding":"base64","extensions":["scq"],"xrefs":{"rfc":["rfc5055"],"template":["application/scvp-cv-request"]},"registered":true},{"content-type":"application/scvp-cv-response","friendly":{"en":"Server-Based Certificate Validation Protocol - Validation Response"},"encoding":"base64","extensions":["scs"],"xrefs":{"rfc":["rfc5055"],"template":["application/scvp-cv-response"]},"registered":true},{"content-type":"application/scvp-vp-request","friendly":{"en":"Server-Based Certificate Validation Protocol - Validation Policies - Request"},"encoding":"base64","extensions":["spq"],"xrefs":{"rfc":["rfc5055"],"template":["application/scvp-vp-request"]},"registered":true},{"content-type":"application/scvp-vp-response","friendly":{"en":"Server-Based Certificate Validation Protocol - Validation Policies - Response"},"encoding":"base64","extensions":["spp"],"xrefs":{"rfc":["rfc5055"],"template":["application/scvp-vp-response"]},"registered":true},{"content-type":"application/sdp","friendly":{"en":"Session Description Protocol"},"encoding":"base64","extensions":["sdp"],"xrefs":{"rfc":["rfc8866"],"template":["application/sdp"]},"registered":true},{"content-type":"application/secevent+jwt","encoding":"base64","xrefs":{"rfc":["rfc8417"],"template":["application/secevent+jwt"]},"registered":true},{"content-type":"application/senml+cbor","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/senml+cbor"]},"registered":true},{"content-type":"application/senml+json","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/senml+json"]},"registered":true},{"content-type":"application/senml+xml","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/senml+xml"]},"registered":true},{"content-type":"application/senml-etch+cbor","encoding":"base64","xrefs":{"rfc":["rfc8790"],"template":["application/senml-etch+cbor"]},"registered":true},{"content-type":"application/senml-etch+json","encoding":"base64","xrefs":{"rfc":["rfc8790"],"template":["application/senml-etch+json"]},"registered":true},{"content-type":"application/senml-exi","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/senml-exi"]},"registered":true},{"content-type":"application/sensml+cbor","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/sensml+cbor"]},"registered":true},{"content-type":"application/sensml+json","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/sensml+json"]},"registered":true},{"content-type":"application/sensml+xml","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/sensml+xml"]},"registered":true},{"content-type":"application/sensml-exi","encoding":"base64","xrefs":{"rfc":["rfc8428"],"template":["application/sensml-exi"]},"registered":true},{"content-type":"application/sep+xml","encoding":"base64","xrefs":{"person":["Robby_Simpson","ZigBee"],"template":["application/sep+xml"]},"registered":true},{"content-type":"application/sep-exi","encoding":"base64","xrefs":{"person":["Robby_Simpson","ZigBee"],"template":["application/sep-exi"]},"registered":true},{"content-type":"application/session-info","encoding":"base64","xrefs":{"person":["Frederic_Firmin","_3GPP"],"template":["application/session-info"]},"registered":true},{"content-type":"application/set","encoding":"base64","registered":false},{"content-type":"application/set-payment","encoding":"base64","xrefs":{"person":["Brian_Korver"],"template":["application/set-payment"]},"registered":true},{"content-type":"application/set-payment-initiation","friendly":{"en":"Secure Electronic Transaction - Payment"},"encoding":"base64","extensions":["setpay"],"xrefs":{"person":["Brian_Korver"],"template":["application/set-payment-initiation"]},"registered":true},{"content-type":"application/set-registration","encoding":"base64","xrefs":{"person":["Brian_Korver"],"template":["application/set-registration"]},"registered":true},{"content-type":"application/set-registration-initiation","friendly":{"en":"Secure Electronic Transaction - Registration"},"encoding":"base64","extensions":["setreg"],"xrefs":{"person":["Brian_Korver"],"template":["application/set-registration-initiation"]},"registered":true},{"content-type":"application/sgml","encoding":"base64","extensions":["sgml"],"xrefs":{"rfc":["rfc1874"],"template":["application/SGML"]},"registered":true},{"content-type":"application/sgml-open-catalog","encoding":"base64","extensions":["soc"],"xrefs":{"person":["Paul_Grosso"],"template":["application/sgml-open-catalog"]},"registered":true},{"content-type":"application/shf+xml","friendly":{"en":"S Hexdump Format"},"encoding":"base64","extensions":["shf"],"xrefs":{"rfc":["rfc4194"],"template":["application/shf+xml"]},"registered":true},{"content-type":"application/sieve","encoding":"base64","extensions":["siv"],"xrefs":{"rfc":["rfc5228"],"template":["application/sieve"]},"registered":true},{"content-type":"application/signed-exchange","encoding":"base64","xrefs":{"draft":["draft-yasskin-http-origin-signed-responses"]},"registered":true,"provisional":true},{"content-type":"application/simple-filter+xml","encoding":"base64","xrefs":{"rfc":["rfc4661"],"template":["application/simple-filter+xml"]},"registered":true},{"content-type":"application/simple-message-summary","encoding":"base64","xrefs":{"rfc":["rfc3842"],"template":["application/simple-message-summary"]},"registered":true},{"content-type":"application/simpleSymbolContainer","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["application/simpleSymbolContainer"]},"registered":true},{"content-type":"application/sipc","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/sipc"]},"registered":true},{"content-type":"application/SLA","encoding":"base64","registered":false},{"content-type":"application/slate","encoding":"base64","xrefs":{"person":["Terry_Crowley"],"template":["application/slate"]},"registered":true},{"content-type":"application/smil","encoding":"8bit","extensions":["smi","smil"],"obsolete":true,"use-instead":"application/smil+xml","xrefs":{"rfc":["rfc4536"],"template":["application/smil"],"notes":["(OBSOLETED in favor of application/smil+xml)"]},"registered":true},{"content-type":"application/smil+xml","friendly":{"en":"Synchronized Multimedia Integration Language"},"encoding":"8bit","extensions":["smi","smil"],"xrefs":{"rfc":["rfc4536"],"template":["application/smil+xml"]},"registered":true},{"content-type":"application/smpte336m","encoding":"base64","xrefs":{"rfc":["rfc6597"],"template":["application/smpte336m"]},"registered":true},{"content-type":"application/soap+fastinfoset","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1_SC6_ASN.1_Rapporteur","ITU-T_ASN.1_Rapporteur"],"template":["application/soap+fastinfoset"]},"registered":true},{"content-type":"application/soap+xml","encoding":"base64","xrefs":{"rfc":["rfc3902"],"template":["application/soap+xml"]},"registered":true},{"content-type":"application/solids","encoding":"base64","registered":false},{"content-type":"application/sparql-query","friendly":{"en":"SPARQL - Query"},"encoding":"base64","extensions":["rq"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/#mediaType"],"template":["application/sparql-query"]},"registered":true},{"content-type":"application/sparql-results+xml","friendly":{"en":"SPARQL - Results"},"encoding":"base64","extensions":["srx"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/2007/CR-rdf-sparql-XMLres-20070925/#mime"],"template":["application/sparql-results+xml"]},"registered":true},{"content-type":"application/spdx+json","encoding":"base64","xrefs":{"person":["Linux_Foundation","Rose_Judge"],"template":["application/spdx+json"]},"registered":true},{"content-type":"application/spirits-event+xml","encoding":"base64","xrefs":{"rfc":["rfc3910"],"template":["application/spirits-event+xml"]},"registered":true},{"content-type":"application/sql","encoding":"base64","xrefs":{"rfc":["rfc6922"],"template":["application/sql"]},"registered":true},{"content-type":"application/srgs","friendly":{"en":"Speech Recognition Grammar Specification"},"encoding":"base64","extensions":["gram"],"xrefs":{"rfc":["rfc4267"],"template":["application/srgs"]},"registered":true},{"content-type":"application/srgs+xml","friendly":{"en":"Speech Recognition Grammar Specification - XML"},"encoding":"base64","extensions":["grxml"],"xrefs":{"rfc":["rfc4267"],"template":["application/srgs+xml"]},"registered":true},{"content-type":"application/sru+xml","friendly":{"en":"Search/Retrieve via URL Response Format"},"encoding":"base64","extensions":["sru"],"xrefs":{"rfc":["rfc6207"],"template":["application/sru+xml"]},"registered":true},{"content-type":"application/ssdl+xml","encoding":"base64","extensions":["ssdl"],"registered":false},{"content-type":"application/ssml+xml","friendly":{"en":"Speech Synthesis Markup Language"},"encoding":"base64","extensions":["ssml"],"xrefs":{"rfc":["rfc4267"],"template":["application/ssml+xml"]},"registered":true},{"content-type":"application/STEP","encoding":"base64","registered":false},{"content-type":"application/stix+json","encoding":"base64","xrefs":{"person":["Chet_Ensign","OASIS"],"template":["application/stix+json"]},"registered":true},{"content-type":"application/swid+xml","encoding":"base64","xrefs":{"person":["David_Waltermire","ISO-IEC_JTC1","Ron_Brill"],"template":["application/swid+xml"]},"registered":true},{"content-type":"application/tamp-apex-update","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-apex-update"]},"registered":true},{"content-type":"application/tamp-apex-update-confirm","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-apex-update-confirm"]},"registered":true},{"content-type":"application/tamp-community-update","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-community-update"]},"registered":true},{"content-type":"application/tamp-community-update-confirm","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-community-update-confirm"]},"registered":true},{"content-type":"application/tamp-error","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-error"]},"registered":true},{"content-type":"application/tamp-sequence-adjust","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-sequence-adjust"]},"registered":true},{"content-type":"application/tamp-sequence-adjust-confirm","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-sequence-adjust-confirm"]},"registered":true},{"content-type":"application/tamp-status-query","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-status-query"]},"registered":true},{"content-type":"application/tamp-status-response","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-status-response"]},"registered":true},{"content-type":"application/tamp-update","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-update"]},"registered":true},{"content-type":"application/tamp-update-confirm","encoding":"base64","xrefs":{"rfc":["rfc5934"],"template":["application/tamp-update-confirm"]},"registered":true},{"content-type":"application/taxii+json","encoding":"base64","xrefs":{"person":["Chet_Ensign","OASIS"],"template":["application/taxii+json"]},"registered":true},{"content-type":"application/td+json","encoding":"base64","xrefs":{"person":["Matthias_Kovatsch","W3C"],"template":["application/td+json"]},"registered":true},{"content-type":"application/tei+xml","friendly":{"en":"Text Encoding and Interchange"},"encoding":"base64","extensions":["tei","teicorpus"],"xrefs":{"rfc":["rfc6129"],"template":["application/tei+xml"]},"registered":true},{"content-type":"application/TETRA_ISI","encoding":"base64","xrefs":{"person":["ETSI","Miguel_Angel_Reina_Ortega"],"template":["application/TETRA_ISI"]},"registered":true},{"content-type":"application/thraud+xml","friendly":{"en":"Sharing Transaction Fraud Data"},"encoding":"base64","extensions":["tfi"],"xrefs":{"rfc":["rfc5941"],"template":["application/thraud+xml"]},"registered":true},{"content-type":"application/timestamp-query","encoding":"base64","xrefs":{"rfc":["rfc3161"],"template":["application/timestamp-query"]},"registered":true},{"content-type":"application/timestamp-reply","encoding":"base64","xrefs":{"rfc":["rfc3161"],"template":["application/timestamp-reply"]},"registered":true},{"content-type":"application/timestamped-data","friendly":{"en":"Time Stamped Data Envelope"},"encoding":"base64","extensions":["tsd"],"xrefs":{"rfc":["rfc5955"],"template":["application/timestamped-data"]},"registered":true},{"content-type":"application/tlsrpt+gzip","encoding":"base64","xrefs":{"rfc":["rfc8460"],"template":["application/tlsrpt+gzip"]},"registered":true},{"content-type":"application/tlsrpt+json","encoding":"base64","xrefs":{"rfc":["rfc8460"],"template":["application/tlsrpt+json"]},"registered":true},{"content-type":"application/tnauthlist","encoding":"base64","xrefs":{"rfc":["rfc8226"],"template":["application/tnauthlist"]},"registered":true},{"content-type":"application/token-introspection+jwt","encoding":"base64","xrefs":{"draft":["RFC-oauth-jwt-introspection-response-12"],"template":["application/token-introspection+jwt"]},"registered":true},{"content-type":"application/toolbook","encoding":"base64","extensions":["tbk"],"obsolete":true,"use-instead":"application/x-toolbook","registered":false},{"content-type":"application/trickle-ice-sdpfrag","encoding":"base64","xrefs":{"rfc":["rfc8840"],"template":["application/trickle-ice-sdpfrag"]},"registered":true},{"content-type":"application/trig","encoding":"base64","xrefs":{"person":["W3C","W3C_RDF_Working_Group"],"template":["application/trig"]},"registered":true},{"content-type":"application/ttml+xml","encoding":"base64","xrefs":{"person":["W3C","W3C_Timed_Text_Working_Group"],"template":["application/ttml+xml"]},"registered":true},{"content-type":"application/tve-trigger","encoding":"base64","xrefs":{"person":["Linda_Welsh"],"template":["application/tve-trigger"]},"registered":true},{"content-type":"application/tzif","encoding":"base64","xrefs":{"rfc":["rfc8536"],"template":["application/tzif"]},"registered":true},{"content-type":"application/tzif-leap","encoding":"base64","xrefs":{"rfc":["rfc8536"],"template":["application/tzif-leap"]},"registered":true},{"content-type":"application/ulpfec","encoding":"base64","xrefs":{"rfc":["rfc5109"],"template":["application/ulpfec"]},"registered":true},{"content-type":"application/urc-grpsheet+xml","encoding":"base64","xrefs":{"person":["Gottfried_Zimmermann","ISO-IEC_JTC1"],"template":["application/urc-grpsheet+xml"]},"registered":true},{"content-type":"application/urc-ressheet+xml","encoding":"base64","xrefs":{"person":["Gottfried_Zimmermann","ISO-IEC_JTC1"],"template":["application/urc-ressheet+xml"]},"registered":true},{"content-type":"application/urc-targetdesc+xml","encoding":"base64","xrefs":{"person":["Gottfried_Zimmermann","ISO-IEC_JTC1"],"template":["application/urc-targetdesc+xml"]},"registered":true},{"content-type":"application/urc-uisocketdesc+xml","encoding":"base64","xrefs":{"person":["Gottfried_Zimmermann"],"template":["application/urc-uisocketdesc+xml"]},"registered":true},{"content-type":"application/vcard+json","encoding":"base64","xrefs":{"rfc":["rfc7095"],"template":["application/vcard+json"]},"registered":true},{"content-type":"application/vcard+xml","encoding":"base64","xrefs":{"rfc":["rfc6351"],"template":["application/vcard+xml"]},"registered":true},{"content-type":"application/vda","encoding":"base64","registered":false},{"content-type":"application/vemmi","encoding":"base64","xrefs":{"rfc":["rfc2122"],"template":["application/vemmi"]},"registered":true},{"content-type":"application/VMSBACKUP","encoding":"base64","extensions":["bck"],"obsolete":true,"use-instead":"application/x-VMSBACKUP","registered":false},{"content-type":"application/vnd.1000minds.decision-model+xml","encoding":"base64","xrefs":{"person":["Franz_Ombler"],"template":["application/vnd.1000minds.decision-model+xml"]},"registered":true},{"content-type":"application/vnd.3gpp-prose+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp-prose+xml"]},"registered":true},{"content-type":"application/vnd.3gpp-prose-pc3ch+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp-prose-pc3ch+xml"]},"registered":true},{"content-type":"application/vnd.3gpp-v2x-local-service-information","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp-v2x-local-service-information"]},"registered":true},{"content-type":"application/vnd.3gpp.5gnas","encoding":"base64","xrefs":{"person":["Jones_Lu_Yunjie","_3GPP"],"template":["application/vnd.3gpp.5gnas"]},"registered":true},{"content-type":"application/vnd.3gpp.access-transfer-events+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.access-transfer-events+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.bsf+xml","encoding":"base64","xrefs":{"person":["John_M_Meredith"],"template":["application/vnd.3gpp.bsf+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.GMOP+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.GMOP+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.gtpc","encoding":"base64","xrefs":{"person":["Yang_Yong","_3GPP"],"template":["application/vnd.3gpp.gtpc"]},"registered":true},{"content-type":"application/vnd.3gpp.interworking-data","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.interworking-data"]},"registered":true},{"content-type":"application/vnd.3gpp.lpp","encoding":"base64","xrefs":{"person":["Jones_Lu_Yunjie","_3GPP"],"template":["application/vnd.3gpp.lpp"]},"registered":true},{"content-type":"application/vnd.3gpp.mc-signalling-ear","encoding":"base64","xrefs":{"person":["Tim_Woodward"],"template":["application/vnd.3gpp.mc-signalling-ear"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-affiliation-command+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-affiliation-command+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-payload","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-payload"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-service-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-service-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-signalling","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-signalling"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-ue-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-ue-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcdata-user-profile+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcdata-user-profile+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-affiliation-command+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-affiliation-command+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-floor-request+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-floor-request+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-location-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-location-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-mbms-usage-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-mbms-usage-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-service-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-service-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-signed+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-signed+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-ue-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-ue-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-ue-init-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-ue-init-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcptt-user-profile+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcptt-user-profile+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-affiliation-command+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-affiliation-command+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-affiliation-info+xml","encoding":"base64","obsolete":true,"use-instead":"application/vnd.3gpp.mcvideo-info+xml","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-affiliation-info+xml"],"notes":["(OBSOLETED in favor of application/vnd.3gpp.mcvideo-info+xml)"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-location-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-location-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-mbms-usage-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-mbms-usage-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-service-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-service-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-transmission-request+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-transmission-request+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-ue-config+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-ue-config+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mcvideo-user-profile+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mcvideo-user-profile+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.mid-call+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.mid-call+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.ngap","encoding":"base64","xrefs":{"person":["Yang_Yong","_3GPP"],"template":["application/vnd.3gpp.ngap"]},"registered":true},{"content-type":"application/vnd.3gpp.pfcp","encoding":"base64","xrefs":{"person":["Bruno_Landais","_3GPP"],"template":["application/vnd.3gpp.pfcp"]},"registered":true},{"content-type":"application/vnd.3gpp.pic-bw-large","friendly":{"en":"3rd Generation Partnership Project - Pic Large"},"encoding":"base64","extensions":["plb"],"xrefs":{"person":["John_M_Meredith"],"template":["application/vnd.3gpp.pic-bw-large"]},"registered":true},{"content-type":"application/vnd.3gpp.pic-bw-small","friendly":{"en":"3rd Generation Partnership Project - Pic Small"},"encoding":"base64","extensions":["psb"],"xrefs":{"person":["John_M_Meredith"],"template":["application/vnd.3gpp.pic-bw-small"]},"registered":true},{"content-type":"application/vnd.3gpp.pic-bw-var","friendly":{"en":"3rd Generation Partnership Project - Pic Var"},"encoding":"base64","extensions":["pvb"],"xrefs":{"person":["John_M_Meredith"],"template":["application/vnd.3gpp.pic-bw-var"]},"registered":true},{"content-type":"application/vnd.3gpp.s1ap","encoding":"base64","xrefs":{"person":["Yang_Yong","_3GPP"],"template":["application/vnd.3gpp.s1ap"]},"registered":true},{"content-type":"application/vnd.3gpp.sms","encoding":"base64","extensions":["sms"],"xrefs":{"person":["John_M_Meredith"],"template":["application/vnd.3gpp.sms"]},"registered":true},{"content-type":"application/vnd.3gpp.sms+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.sms+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.srvcc-ext+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.srvcc-ext+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.SRVCC-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.SRVCC-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.state-and-event-info+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.state-and-event-info+xml"]},"registered":true},{"content-type":"application/vnd.3gpp.ussd+xml","encoding":"base64","xrefs":{"person":["Frederic_Firmin"],"template":["application/vnd.3gpp.ussd+xml"]},"registered":true},{"content-type":"application/vnd.3gpp2.bcmcsinfo+xml","encoding":"base64","xrefs":{"person":["AC_Mahendran"],"template":["application/vnd.3gpp2.bcmcsinfo+xml"]},"registered":true},{"content-type":"application/vnd.3gpp2.sms","encoding":"base64","xrefs":{"person":["AC_Mahendran"],"template":["application/vnd.3gpp2.sms"]},"registered":true},{"content-type":"application/vnd.3gpp2.tcap","friendly":{"en":"3rd Generation Partnership Project - Transaction Capabilities Application Part"},"encoding":"base64","extensions":["tcap"],"xrefs":{"person":["AC_Mahendran"],"template":["application/vnd.3gpp2.tcap"]},"registered":true},{"content-type":"application/vnd.3lightssoftware.imagescal","encoding":"base64","xrefs":{"person":["Gus_Asadi"],"template":["application/vnd.3lightssoftware.imagescal"]},"registered":true},{"content-type":"application/vnd.3M.Post-it-Notes","friendly":{"en":"3M Post It Notes"},"encoding":"base64","extensions":["pwn"],"xrefs":{"person":["Michael_OBrien"],"template":["application/vnd.3M.Post-it-Notes"]},"registered":true},{"content-type":"application/vnd.accpac.simply.aso","friendly":{"en":"Simply Accounting"},"encoding":"base64","extensions":["aso"],"xrefs":{"person":["Steve_Leow"],"template":["application/vnd.accpac.simply.aso"]},"registered":true},{"content-type":"application/vnd.accpac.simply.imp","friendly":{"en":"Simply Accounting - Data Import"},"encoding":"base64","extensions":["imp"],"xrefs":{"person":["Steve_Leow"],"template":["application/vnd.accpac.simply.imp"]},"registered":true},{"content-type":"application/vnd.acucobol","friendly":{"en":"ACU Cobol"},"encoding":"base64","extensions":["acu"],"xrefs":{"person":["Dovid_Lubin"],"template":["application/vnd.acucobol"]},"registered":true},{"content-type":"application/vnd.acucorp","friendly":{"en":"ACU Cobol"},"encoding":"7bit","extensions":["atc","acutc"],"xrefs":{"person":["Dovid_Lubin"],"template":["application/vnd.acucorp"]},"registered":true},{"content-type":"application/vnd.adobe.air-application-installer-package+zip","friendly":{"en":"Adobe AIR Application"},"encoding":"base64","extensions":["air"],"registered":false},{"content-type":"application/vnd.adobe.flash.movie","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.adobe.flash.movie"]},"registered":true},{"content-type":"application/vnd.adobe.formscentral.fcdt","encoding":"base64","extensions":["fcdt"],"xrefs":{"person":["Chris_Solc"],"template":["application/vnd.adobe.formscentral.fcdt"]},"registered":true},{"content-type":"application/vnd.adobe.fxp","friendly":{"en":"Adobe Flex Project"},"encoding":"base64","extensions":["fxp","fxpl"],"xrefs":{"person":["Steven_Heintz"],"template":["application/vnd.adobe.fxp"]},"registered":true},{"content-type":"application/vnd.adobe.partial-upload","encoding":"base64","xrefs":{"person":["Tapani_Otala"],"template":["application/vnd.adobe.partial-upload"]},"registered":true},{"content-type":"application/vnd.adobe.xdp+xml","friendly":{"en":"Adobe XML Data Package"},"encoding":"base64","extensions":["xdp"],"xrefs":{"person":["John_Brinkman"],"template":["application/vnd.adobe.xdp+xml"]},"registered":true},{"content-type":"application/vnd.adobe.xfdf","friendly":{"en":"Adobe XML Forms Data Format"},"encoding":"base64","extensions":["xfdf"],"xrefs":{"person":["Roberto_Perelman"],"template":["application/vnd.adobe.xfdf"]},"registered":true},{"content-type":"application/vnd.aether.imp","encoding":"base64","xrefs":{"person":["Jay_Moskowitz"],"template":["application/vnd.aether.imp"]},"registered":true},{"content-type":"application/vnd.afpc.afplinedata","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.afplinedata"]},"registered":true},{"content-type":"application/vnd.afpc.afplinedata-pagedef","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.afplinedata-pagedef"]},"registered":true},{"content-type":"application/vnd.afpc.cmoca-cmresource","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.cmoca-cmresource"]},"registered":true},{"content-type":"application/vnd.afpc.foca-charset","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.foca-charset"]},"registered":true},{"content-type":"application/vnd.afpc.foca-codedfont","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.foca-codedfont"]},"registered":true},{"content-type":"application/vnd.afpc.foca-codepage","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.foca-codepage"]},"registered":true},{"content-type":"application/vnd.afpc.modca","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca"]},"registered":true},{"content-type":"application/vnd.afpc.modca-cmtable","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-cmtable"]},"registered":true},{"content-type":"application/vnd.afpc.modca-formdef","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-formdef"]},"registered":true},{"content-type":"application/vnd.afpc.modca-mediummap","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-mediummap"]},"registered":true},{"content-type":"application/vnd.afpc.modca-objectcontainer","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-objectcontainer"]},"registered":true},{"content-type":"application/vnd.afpc.modca-overlay","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-overlay"]},"registered":true},{"content-type":"application/vnd.afpc.modca-pagesegment","encoding":"base64","xrefs":{"person":["Jörg_Palmer"],"template":["application/vnd.afpc.modca-pagesegment"]},"registered":true},{"content-type":"application/vnd.age","encoding":"base64","xrefs":{"person":["Filippo_Valsorda"],"template":["application/vnd.age"]},"registered":true},{"content-type":"application/vnd.ah-barcode","encoding":"base64","xrefs":{"person":["Katsuhiko_Ichinose"],"template":["application/vnd.ah-barcode"]},"registered":true},{"content-type":"application/vnd.ahead.space","friendly":{"en":"Ahead AIR Application"},"encoding":"base64","extensions":["ahead"],"xrefs":{"person":["Tor_Kristensen"],"template":["application/vnd.ahead.space"]},"registered":true},{"content-type":"application/vnd.airzip.filesecure.azf","friendly":{"en":"AirZip FileSECURE"},"encoding":"base64","extensions":["azf"],"xrefs":{"person":["Daniel_Mould","Gary_Clueit"],"template":["application/vnd.airzip.filesecure.azf"]},"registered":true},{"content-type":"application/vnd.airzip.filesecure.azs","friendly":{"en":"AirZip FileSECURE"},"encoding":"base64","extensions":["azs"],"xrefs":{"person":["Daniel_Mould","Gary_Clueit"],"template":["application/vnd.airzip.filesecure.azs"]},"registered":true},{"content-type":"application/vnd.amadeus+json","encoding":"base64","xrefs":{"person":["Patrick_Brosse"],"template":["application/vnd.amadeus+json"]},"registered":true},{"content-type":"application/vnd.amazon.ebook","friendly":{"en":"Amazon Kindle eBook format"},"encoding":"base64","extensions":["azw"],"registered":false},{"content-type":"application/vnd.amazon.mobi8-ebook","encoding":"base64","xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.amazon.mobi8-ebook"]},"registered":true},{"content-type":"application/vnd.americandynamics.acc","friendly":{"en":"Active Content Compression"},"encoding":"base64","extensions":["acc"],"xrefs":{"person":["Gary_Sands"],"template":["application/vnd.americandynamics.acc"]},"registered":true},{"content-type":"application/vnd.amiga.ami","friendly":{"en":"AmigaDE"},"encoding":"base64","extensions":["ami"],"xrefs":{"person":["Kevin_Blumberg"],"template":["application/vnd.amiga.ami"]},"registered":true},{"content-type":"application/vnd.amundsen.maze+xml","encoding":"base64","xrefs":{"person":["Mike_Amundsen"],"template":["application/vnd.amundsen.maze+xml"]},"registered":true},{"content-type":"application/vnd.android.ota","encoding":"base64","xrefs":{"person":["Greg_Kaiser"],"template":["application/vnd.android.ota"]},"registered":true},{"content-type":"application/vnd.android.package-archive","friendly":{"en":"Android Package Archive"},"encoding":"base64","extensions":["apk"],"registered":false},{"content-type":"application/vnd.anki","encoding":"base64","xrefs":{"person":["Kerrick_Staley"],"template":["application/vnd.anki"]},"registered":true},{"content-type":"application/vnd.anser-web-certificate-issue-initiation","friendly":{"en":"ANSER-WEB Terminal Client - Certificate Issue"},"encoding":"base64","extensions":["cii"],"xrefs":{"person":["Hiroyoshi_Mori"],"template":["application/vnd.anser-web-certificate-issue-initiation"]},"registered":true},{"content-type":"application/vnd.anser-web-funds-transfer-initiation","friendly":{"en":"ANSER-WEB Terminal Client - Web Funds Transfer"},"encoding":"base64","extensions":["fti"],"registered":false},{"content-type":"application/vnd.antix.game-component","friendly":{"en":"Antix Game Player"},"encoding":"base64","extensions":["atx"],"xrefs":{"person":["Daniel_Shelton"],"template":["application/vnd.antix.game-component"]},"registered":true},{"content-type":"application/vnd.apache.arrow.file","encoding":"base64","xrefs":{"person":["Apache_Arrow_Project"],"template":["application/vnd.apache.arrow.file"]},"registered":true},{"content-type":"application/vnd.apache.arrow.stream","encoding":"base64","xrefs":{"person":["Apache_Arrow_Project"],"template":["application/vnd.apache.arrow.stream"]},"registered":true},{"content-type":"application/vnd.apache.thrift.binary","encoding":"base64","xrefs":{"person":["Roger_Meier"],"template":["application/vnd.apache.thrift.binary"]},"registered":true},{"content-type":"application/vnd.apache.thrift.compact","encoding":"base64","xrefs":{"person":["Roger_Meier"],"template":["application/vnd.apache.thrift.compact"]},"registered":true},{"content-type":"application/vnd.apache.thrift.json","encoding":"base64","xrefs":{"person":["Roger_Meier"],"template":["application/vnd.apache.thrift.json"]},"registered":true},{"content-type":"application/vnd.api+json","encoding":"base64","xrefs":{"person":["Steve_Klabnik"],"template":["application/vnd.api+json"]},"registered":true},{"content-type":"application/vnd.aplextor.warrp+json","encoding":"base64","xrefs":{"person":["Oleg_Uryutin"],"template":["application/vnd.aplextor.warrp+json"]},"registered":true},{"content-type":"application/vnd.apothekende.reservation+json","encoding":"base64","xrefs":{"person":["Adrian_Föder"],"template":["application/vnd.apothekende.reservation+json"]},"registered":true},{"content-type":"application/vnd.apple.installer+xml","friendly":{"en":"Apple Installer Package"},"encoding":"base64","extensions":["mpkg"],"xrefs":{"person":["Peter_Bierman"],"template":["application/vnd.apple.installer+xml"]},"registered":true},{"content-type":"application/vnd.apple.keynote","encoding":"base64","xrefs":{"person":["Manichandra_Sajjanapu"],"template":["application/vnd.apple.keynote"]},"registered":true},{"content-type":"application/vnd.apple.mpegurl","friendly":{"en":"Multimedia Playlist Unicode"},"encoding":"base64","extensions":["m3u8"],"xrefs":{"rfc":["rfc8216"],"template":["application/vnd.apple.mpegurl"]},"registered":true},{"content-type":"application/vnd.apple.numbers","encoding":"base64","xrefs":{"person":["Manichandra_Sajjanapu"],"template":["application/vnd.apple.numbers"]},"registered":true},{"content-type":"application/vnd.apple.pages","encoding":"base64","xrefs":{"person":["Manichandra_Sajjanapu"],"template":["application/vnd.apple.pages"]},"registered":true},{"content-type":"application/vnd.apple.pkpass","encoding":"base64","extensions":["pkpass"],"registered":false},{"content-type":"application/vnd.arastra.swi","encoding":"base64","obsolete":true,"use-instead":"application/vnd.aristanetworks.swi","xrefs":{"person":["Bill_Fenner"],"template":["application/vnd.arastra.swi"],"notes":["(OBSOLETED in favor of application/vnd.aristanetworks.swi)"]},"registered":true},{"content-type":"application/vnd.aristanetworks.swi","friendly":{"en":"Arista Networks Software Image"},"encoding":"base64","extensions":["swi"],"xrefs":{"person":["Bill_Fenner"],"template":["application/vnd.aristanetworks.swi"]},"registered":true},{"content-type":"application/vnd.artisan+json","encoding":"base64","xrefs":{"person":["Brad_Turner"],"template":["application/vnd.artisan+json"]},"registered":true},{"content-type":"application/vnd.artsquare","encoding":"base64","xrefs":{"person":["Christopher_Smith"],"template":["application/vnd.artsquare"]},"registered":true},{"content-type":"application/vnd.astraea-software.iota","encoding":"base64","extensions":["iota"],"xrefs":{"person":["Christopher_Snazell"],"template":["application/vnd.astraea-software.iota"]},"registered":true},{"content-type":"application/vnd.audiograph","friendly":{"en":"Audiograph"},"encoding":"base64","extensions":["aep"],"xrefs":{"person":["Horia_Cristian_Slusanschi"],"template":["application/vnd.audiograph"]},"registered":true},{"content-type":"application/vnd.autopackage","encoding":"base64","xrefs":{"person":["Mike_Hearn"],"template":["application/vnd.autopackage"]},"registered":true},{"content-type":"application/vnd.avalon+json","encoding":"base64","xrefs":{"person":["Ben_Hinman"],"template":["application/vnd.avalon+json"]},"registered":true},{"content-type":"application/vnd.avistar+xml","encoding":"base64","xrefs":{"person":["Vladimir_Vysotsky"],"template":["application/vnd.avistar+xml"]},"registered":true},{"content-type":"application/vnd.balsamiq.bmml+xml","encoding":"base64","xrefs":{"person":["Giacomo_Guilizzoni"],"template":["application/vnd.balsamiq.bmml+xml"]},"registered":true},{"content-type":"application/vnd.balsamiq.bmpr","encoding":"base64","xrefs":{"person":["Giacomo_Guilizzoni"],"template":["application/vnd.balsamiq.bmpr"]},"registered":true},{"content-type":"application/vnd.banana-accounting","encoding":"base64","xrefs":{"person":["José_Del_Romano"],"template":["application/vnd.banana-accounting"]},"registered":true},{"content-type":"application/vnd.bbf.usp.error","encoding":"base64","xrefs":{"person":["Broadband_Forum"],"template":["application/vnd.bbf.usp.error"]},"registered":true},{"content-type":"application/vnd.bbf.usp.msg","encoding":"base64","xrefs":{"person":["Broadband_Forum"],"template":["application/vnd.bbf.usp.msg"]},"registered":true},{"content-type":"application/vnd.bbf.usp.msg+json","encoding":"base64","xrefs":{"person":["Broadband_Forum"],"template":["application/vnd.bbf.usp.msg+json"]},"registered":true},{"content-type":"application/vnd.bekitzur-stech+json","encoding":"base64","xrefs":{"person":["Jegulsky"],"template":["application/vnd.bekitzur-stech+json"]},"registered":true},{"content-type":"application/vnd.bint.med-content","encoding":"base64","xrefs":{"person":["Heinz-Peter_Schütz"],"template":["application/vnd.bint.med-content"]},"registered":true},{"content-type":"application/vnd.biopax.rdf+xml","encoding":"base64","xrefs":{"person":["Pathway_Commons"],"template":["application/vnd.biopax.rdf+xml"]},"registered":true},{"content-type":"application/vnd.blink-idb-value-wrapper","encoding":"base64","xrefs":{"person":["Victor_Costan"],"template":["application/vnd.blink-idb-value-wrapper"]},"registered":true},{"content-type":"application/vnd.blueice.multipass","friendly":{"en":"Blueice Research Multipass"},"encoding":"base64","extensions":["mpm"],"xrefs":{"person":["Thomas_Holmstrom"],"template":["application/vnd.blueice.multipass"]},"registered":true},{"content-type":"application/vnd.bluetooth.ep.oob","encoding":"base64","xrefs":{"person":["Mike_Foley"],"template":["application/vnd.bluetooth.ep.oob"]},"registered":true},{"content-type":"application/vnd.bluetooth.le.oob","encoding":"base64","xrefs":{"person":["Mark_Powell"],"template":["application/vnd.bluetooth.le.oob"]},"registered":true},{"content-type":"application/vnd.bmi","friendly":{"en":"BMI Drawing Data Interchange"},"encoding":"base64","extensions":["bmi"],"xrefs":{"person":["Tadashi_Gotoh"],"template":["application/vnd.bmi"]},"registered":true},{"content-type":"application/vnd.bpf","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/vnd.bpf"]},"registered":true},{"content-type":"application/vnd.bpf3","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/vnd.bpf3"]},"registered":true},{"content-type":"application/vnd.businessobjects","friendly":{"en":"BusinessObjects"},"encoding":"base64","extensions":["rep"],"xrefs":{"person":["Philippe_Imoucha"],"template":["application/vnd.businessobjects"]},"registered":true},{"content-type":"application/vnd.byu.uapi+json","encoding":"base64","xrefs":{"person":["Brent_Moore"],"template":["application/vnd.byu.uapi+json"]},"registered":true},{"content-type":"application/vnd.cab-jscript","encoding":"base64","xrefs":{"person":["Joerg_Falkenberg"],"template":["application/vnd.cab-jscript"]},"registered":true},{"content-type":"application/vnd.canon-cpdl","encoding":"base64","xrefs":{"person":["Shin_Muto"],"template":["application/vnd.canon-cpdl"]},"registered":true},{"content-type":"application/vnd.canon-lips","encoding":"base64","xrefs":{"person":["Shin_Muto"],"template":["application/vnd.canon-lips"]},"registered":true},{"content-type":"application/vnd.capasystems-pg+json","encoding":"base64","xrefs":{"person":["Yüksel_Aydemir"],"template":["application/vnd.capasystems-pg+json"]},"registered":true},{"content-type":"application/vnd.cendio.thinlinc.clientconf","encoding":"base64","xrefs":{"person":["Peter_Astrand"],"template":["application/vnd.cendio.thinlinc.clientconf"]},"registered":true},{"content-type":"application/vnd.century-systems.tcp_stream","encoding":"base64","xrefs":{"person":["Shuji_Fujii"],"template":["application/vnd.century-systems.tcp_stream"]},"registered":true},{"content-type":"application/vnd.chemdraw+xml","friendly":{"en":"CambridgeSoft Chem Draw"},"encoding":"base64","extensions":["cdxml"],"xrefs":{"person":["Glenn_Howes"],"template":["application/vnd.chemdraw+xml"]},"registered":true},{"content-type":"application/vnd.chess-pgn","encoding":"base64","xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.chess-pgn"]},"registered":true},{"content-type":"application/vnd.chipnuts.karaoke-mmd","friendly":{"en":"Karaoke on Chipnuts Chipsets"},"encoding":"base64","extensions":["mmd"],"xrefs":{"person":["Chunyun_Xiong"],"template":["application/vnd.chipnuts.karaoke-mmd"]},"registered":true},{"content-type":"application/vnd.ciedi","encoding":"base64","xrefs":{"person":["Hidekazu_Enjo"],"template":["application/vnd.ciedi"]},"registered":true},{"content-type":"application/vnd.cinderella","friendly":{"en":"Interactive Geometry Software Cinderella"},"encoding":"base64","extensions":["cdy"],"xrefs":{"person":["Ulrich_Kortenkamp"],"template":["application/vnd.cinderella"]},"registered":true},{"content-type":"application/vnd.cirpack.isdn-ext","encoding":"base64","xrefs":{"person":["Pascal_Mayeux"],"template":["application/vnd.cirpack.isdn-ext"]},"registered":true},{"content-type":"application/vnd.citationstyles.style+xml","encoding":"base64","xrefs":{"person":["Rintze_M._Zelle"],"template":["application/vnd.citationstyles.style+xml"]},"registered":true},{"content-type":"application/vnd.claymore","friendly":{"en":"Claymore Data Files"},"encoding":"base64","extensions":["cla"],"xrefs":{"person":["Ray_Simpson"],"template":["application/vnd.claymore"]},"registered":true},{"content-type":"application/vnd.cloanto.rp9","friendly":{"en":"RetroPlatform Player"},"encoding":"base64","extensions":["rp9"],"xrefs":{"person":["Mike_Labatt"],"template":["application/vnd.cloanto.rp9"]},"registered":true},{"content-type":"application/vnd.clonk.c4group","friendly":{"en":"Clonk Game"},"encoding":"base64","extensions":["c4d","c4f","c4g","c4p","c4u"],"xrefs":{"person":["Guenther_Brammer"],"template":["application/vnd.clonk.c4group"]},"registered":true},{"content-type":"application/vnd.cluetrust.cartomobile-config","friendly":{"en":"ClueTrust CartoMobile - Config"},"encoding":"base64","extensions":["c11amc"],"xrefs":{"person":["Gaige_Paulsen"],"template":["application/vnd.cluetrust.cartomobile-config"]},"registered":true},{"content-type":"application/vnd.cluetrust.cartomobile-config-pkg","friendly":{"en":"ClueTrust CartoMobile - Config Package"},"encoding":"base64","extensions":["c11amz"],"xrefs":{"person":["Gaige_Paulsen"],"template":["application/vnd.cluetrust.cartomobile-config-pkg"]},"registered":true},{"content-type":"application/vnd.coffeescript","encoding":"base64","xrefs":{"person":["Devyn_Collier_Johnson"],"template":["application/vnd.coffeescript"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.document","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.document"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.document-template","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.document-template"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.presentation","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.presentation"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.presentation-template","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.presentation-template"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.spreadsheet","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.spreadsheet"]},"registered":true},{"content-type":"application/vnd.collabio.xodocuments.spreadsheet-template","encoding":"base64","xrefs":{"person":["Alexey_Meandrov"],"template":["application/vnd.collabio.xodocuments.spreadsheet-template"]},"registered":true},{"content-type":"application/vnd.collection+json","encoding":"base64","xrefs":{"person":["Mike_Amundsen"],"template":["application/vnd.collection+json"]},"registered":true},{"content-type":"application/vnd.collection.doc+json","encoding":"base64","xrefs":{"person":["Irakli_Nadareishvili"],"template":["application/vnd.collection.doc+json"]},"registered":true},{"content-type":"application/vnd.collection.next+json","encoding":"base64","xrefs":{"person":["Ioseb_Dzmanashvili"],"template":["application/vnd.collection.next+json"]},"registered":true},{"content-type":"application/vnd.comicbook+zip","encoding":"base64","xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.comicbook+zip"]},"registered":true},{"content-type":"application/vnd.comicbook-rar","encoding":"base64","xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.comicbook-rar"]},"registered":true},{"content-type":"application/vnd.commerce-battelle","encoding":"base64","xrefs":{"person":["David_Applebaum"],"template":["application/vnd.commerce-battelle"]},"registered":true},{"content-type":"application/vnd.commonspace","friendly":{"en":"Sixth Floor Media - CommonSpace"},"encoding":"base64","extensions":["csp"],"xrefs":{"person":["Ravinder_Chandhok"],"template":["application/vnd.commonspace"]},"registered":true},{"content-type":"application/vnd.contact.cmsg","friendly":{"en":"CIM Database"},"encoding":"base64","extensions":["cdbcmsg"],"xrefs":{"person":["Frank_Patz"],"template":["application/vnd.contact.cmsg"]},"registered":true},{"content-type":"application/vnd.coreos.ignition+json","encoding":"base64","xrefs":{"person":["Alex_Crawford"],"template":["application/vnd.coreos.ignition+json"]},"registered":true},{"content-type":"application/vnd.cosmocaller","friendly":{"en":"CosmoCaller"},"encoding":"base64","extensions":["cmc"],"xrefs":{"person":["Steve_Dellutri"],"template":["application/vnd.cosmocaller"]},"registered":true},{"content-type":"application/vnd.crick.clicker","friendly":{"en":"CrickSoftware - Clicker"},"encoding":"base64","extensions":["clkx"],"xrefs":{"person":["Andrew_Burt"],"template":["application/vnd.crick.clicker"]},"registered":true},{"content-type":"application/vnd.crick.clicker.keyboard","friendly":{"en":"CrickSoftware - Clicker - Keyboard"},"encoding":"base64","extensions":["clkk"],"xrefs":{"person":["Andrew_Burt"],"template":["application/vnd.crick.clicker.keyboard"]},"registered":true},{"content-type":"application/vnd.crick.clicker.palette","friendly":{"en":"CrickSoftware - Clicker - Palette"},"encoding":"base64","extensions":["clkp"],"xrefs":{"person":["Andrew_Burt"],"template":["application/vnd.crick.clicker.palette"]},"registered":true},{"content-type":"application/vnd.crick.clicker.template","friendly":{"en":"CrickSoftware - Clicker - Template"},"encoding":"base64","extensions":["clkt"],"xrefs":{"person":["Andrew_Burt"],"template":["application/vnd.crick.clicker.template"]},"registered":true},{"content-type":"application/vnd.crick.clicker.wordbank","friendly":{"en":"CrickSoftware - Clicker - Wordbank"},"encoding":"base64","extensions":["clkw"],"xrefs":{"person":["Andrew_Burt"],"template":["application/vnd.crick.clicker.wordbank"]},"registered":true},{"content-type":"application/vnd.criticaltools.wbs+xml","friendly":{"en":"Critical Tools - PERT Chart EXPERT"},"encoding":"base64","extensions":["wbs"],"xrefs":{"person":["Jim_Spiller"],"template":["application/vnd.criticaltools.wbs+xml"]},"registered":true},{"content-type":"application/vnd.cryptii.pipe+json","encoding":"base64","xrefs":{"person":["Fränz_Friederes"],"template":["application/vnd.cryptii.pipe+json"]},"registered":true},{"content-type":"application/vnd.crypto-shade-file","encoding":"base64","xrefs":{"person":["Connor_Horman"],"template":["application/vnd.crypto-shade-file"]},"registered":true},{"content-type":"application/vnd.cryptomator.encrypted","encoding":"base64","xrefs":{"person":["Sebastian_Stenzel"],"template":["application/vnd.cryptomator.encrypted"]},"registered":true},{"content-type":"application/vnd.cryptomator.vault","encoding":"base64","xrefs":{"person":["Sebastian_Stenzel"],"template":["application/vnd.cryptomator.vault"]},"registered":true},{"content-type":"application/vnd.ctc-posml","friendly":{"en":"PosML"},"encoding":"base64","extensions":["pml"],"xrefs":{"person":["Bayard_Kohlhepp"],"template":["application/vnd.ctc-posml"]},"registered":true},{"content-type":"application/vnd.ctct.ws+xml","encoding":"base64","xrefs":{"person":["Jim_Ancona"],"template":["application/vnd.ctct.ws+xml"]},"registered":true},{"content-type":"application/vnd.cups-pdf","encoding":"base64","xrefs":{"person":["Michael_Sweet"],"template":["application/vnd.cups-pdf"]},"registered":true},{"content-type":"application/vnd.cups-postscript","encoding":"base64","xrefs":{"person":["Michael_Sweet"],"template":["application/vnd.cups-postscript"]},"registered":true},{"content-type":"application/vnd.cups-ppd","friendly":{"en":"Adobe PostScript Printer Description File Format"},"encoding":"base64","extensions":["ppd"],"xrefs":{"person":["Michael_Sweet"],"template":["application/vnd.cups-ppd"]},"registered":true},{"content-type":"application/vnd.cups-raster","encoding":"base64","xrefs":{"person":["Michael_Sweet"],"template":["application/vnd.cups-raster"]},"registered":true},{"content-type":"application/vnd.cups-raw","encoding":"base64","xrefs":{"person":["Michael_Sweet"],"template":["application/vnd.cups-raw"]},"registered":true},{"content-type":"application/vnd.curl","encoding":"base64","extensions":["curl"],"xrefs":{"person":["Robert_Byrnes"],"template":["application/vnd.curl"]},"registered":true},{"content-type":"application/vnd.curl.car","friendly":{"en":"CURL Applet"},"encoding":"base64","extensions":["car"],"registered":false},{"content-type":"application/vnd.curl.pcurl","friendly":{"en":"CURL Applet"},"encoding":"base64","extensions":["pcurl"],"registered":false},{"content-type":"application/vnd.cyan.dean.root+xml","encoding":"base64","xrefs":{"person":["Matt_Kern"],"template":["application/vnd.cyan.dean.root+xml"]},"registered":true},{"content-type":"application/vnd.cybank","encoding":"base64","xrefs":{"person":["Nor_Helmee"],"template":["application/vnd.cybank"]},"registered":true},{"content-type":"application/vnd.cyclonedx+json","encoding":"base64","xrefs":{"person":["Patrick_Dwyer"],"template":["application/vnd.cyclonedx+json"]},"registered":true},{"content-type":"application/vnd.cyclonedx+xml","encoding":"base64","xrefs":{"person":["Patrick_Dwyer"],"template":["application/vnd.cyclonedx+xml"]},"registered":true},{"content-type":"application/vnd.d2l.coursepackage1p0+zip","encoding":"base64","xrefs":{"person":["Viktor_Haag"],"template":["application/vnd.d2l.coursepackage1p0+zip"]},"registered":true},{"content-type":"application/vnd.d3m-dataset","encoding":"base64","xrefs":{"person":["Mi_Tar"],"template":["application/vnd.d3m-dataset"]},"registered":true},{"content-type":"application/vnd.d3m-problem","encoding":"base64","xrefs":{"person":["Mi_Tar"],"template":["application/vnd.d3m-problem"]},"registered":true},{"content-type":"application/vnd.dart","encoding":"base64","extensions":["dart"],"xrefs":{"person":["Anders_Sandholm"],"template":["application/vnd.dart"]},"registered":true},{"content-type":"application/vnd.data-vision.rdz","friendly":{"en":"RemoteDocs R-Viewer"},"encoding":"base64","extensions":["rdz"],"xrefs":{"person":["James_Fields"],"template":["application/vnd.data-vision.rdz"]},"registered":true},{"content-type":"application/vnd.datapackage+json","encoding":"base64","xrefs":{"person":["Paul_Walsh"],"template":["application/vnd.datapackage+json"]},"registered":true},{"content-type":"application/vnd.dataresource+json","encoding":"base64","xrefs":{"person":["Paul_Walsh"],"template":["application/vnd.dataresource+json"]},"registered":true},{"content-type":"application/vnd.dbf","encoding":"base64","xrefs":{"person":["Mi_Tar"],"template":["application/vnd.dbf"]},"registered":true},{"content-type":"application/vnd.debian.binary-package","encoding":"base64","xrefs":{"person":["Charles_Plessy"],"template":["application/vnd.debian.binary-package"]},"registered":true},{"content-type":"application/vnd.dece.data","encoding":"base64","extensions":["uvd","uvf","uvvd","uvvf"],"xrefs":{"person":["Michael_A_Dolan"],"template":["application/vnd.dece.data"]},"registered":true},{"content-type":"application/vnd.dece.ttml+xml","encoding":"base64","extensions":["uvt","uvvt"],"xrefs":{"person":["Michael_A_Dolan"],"template":["application/vnd.dece.ttml+xml"]},"registered":true},{"content-type":"application/vnd.dece.unspecified","encoding":"base64","extensions":["uvvx","uvx"],"xrefs":{"person":["Michael_A_Dolan"],"template":["application/vnd.dece.unspecified"]},"registered":true},{"content-type":"application/vnd.dece.zip","encoding":"base64","extensions":["uvvz","uvz"],"xrefs":{"person":["Michael_A_Dolan"],"template":["application/vnd.dece.zip"]},"registered":true},{"content-type":"application/vnd.denovo.fcselayout-link","friendly":{"en":"FCS Express Layout Link"},"encoding":"base64","extensions":["fe_launch"],"xrefs":{"person":["Michael_Dixon"],"template":["application/vnd.denovo.fcselayout-link"]},"registered":true},{"content-type":"application/vnd.desmume.movie","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.desmume.movie"]},"registered":true},{"content-type":"application/vnd.dir-bi.plate-dl-nosuffix","encoding":"base64","xrefs":{"person":["Yamanaka"],"template":["application/vnd.dir-bi.plate-dl-nosuffix"]},"registered":true},{"content-type":"application/vnd.dm.delegation+xml","encoding":"base64","xrefs":{"person":["Axel_Ferrazzini"],"template":["application/vnd.dm.delegation+xml"]},"registered":true},{"content-type":"application/vnd.dna","friendly":{"en":"New Moon Liftoff/DNA"},"encoding":"base64","extensions":["dna"],"xrefs":{"person":["Meredith_Searcy"],"template":["application/vnd.dna"]},"registered":true},{"content-type":"application/vnd.document+json","encoding":"base64","xrefs":{"person":["Tom_Christie"],"template":["application/vnd.document+json"]},"registered":true},{"content-type":"application/vnd.dolby.mlp","friendly":{"en":"Dolby Meridian Lossless Packing"},"encoding":"base64","extensions":["mlp"],"registered":false},{"content-type":"application/vnd.dolby.mobile.1","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["application/vnd.dolby.mobile.1"]},"registered":true},{"content-type":"application/vnd.dolby.mobile.2","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["application/vnd.dolby.mobile.2"]},"registered":true},{"content-type":"application/vnd.doremir.scorecloud-binary-document","encoding":"base64","xrefs":{"person":["Erik_Ronström"],"template":["application/vnd.doremir.scorecloud-binary-document"]},"registered":true},{"content-type":"application/vnd.dpgraph","friendly":{"en":"DPGraph"},"encoding":"base64","extensions":["dpg"],"xrefs":{"person":["David_Parker"],"template":["application/vnd.dpgraph"]},"registered":true},{"content-type":"application/vnd.dreamfactory","friendly":{"en":"DreamFactory"},"encoding":"base64","extensions":["dfac"],"xrefs":{"person":["William_C._Appleton"],"template":["application/vnd.dreamfactory"]},"registered":true},{"content-type":"application/vnd.drive+json","encoding":"base64","xrefs":{"person":["Keith_Kester"],"template":["application/vnd.drive+json"]},"registered":true},{"content-type":"application/vnd.ds-keypoint","encoding":"base64","extensions":["kpxx"],"registered":false},{"content-type":"application/vnd.dtg.local","encoding":"base64","xrefs":{"person":["Ali_Teffahi"],"template":["application/vnd.dtg.local"]},"registered":true},{"content-type":"application/vnd.dtg.local.flash","encoding":"base64","xrefs":{"person":["Ali_Teffahi"],"template":["application/vnd.dtg.local.flash"]},"registered":true},{"content-type":"application/vnd.dtg.local.html","encoding":"base64","xrefs":{"person":["Ali_Teffahi"],"template":["application/vnd.dtg.local.html"]},"registered":true},{"content-type":"application/vnd.dvb.ait","friendly":{"en":"Digital Video Broadcasting"},"encoding":"base64","extensions":["ait"],"xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["application/vnd.dvb.ait"]},"registered":true},{"content-type":"application/vnd.dvb.dvbisl+xml","encoding":"base64","xrefs":{"person":["Emily_DUBS"],"template":["application/vnd.dvb.dvbisl+xml"]},"registered":true},{"content-type":"application/vnd.dvb.dvbj","encoding":"base64","xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["application/vnd.dvb.dvbj"]},"registered":true},{"content-type":"application/vnd.dvb.esgcontainer","encoding":"base64","xrefs":{"person":["Joerg_Heuer"],"template":["application/vnd.dvb.esgcontainer"]},"registered":true},{"content-type":"application/vnd.dvb.ipdcdftnotifaccess","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.ipdcdftnotifaccess"]},"registered":true},{"content-type":"application/vnd.dvb.ipdcesgaccess","encoding":"base64","xrefs":{"person":["Joerg_Heuer"],"template":["application/vnd.dvb.ipdcesgaccess"]},"registered":true},{"content-type":"application/vnd.dvb.ipdcesgaccess2","encoding":"base64","xrefs":{"person":["Jerome_Marcon"],"template":["application/vnd.dvb.ipdcesgaccess2"]},"registered":true},{"content-type":"application/vnd.dvb.ipdcesgpdd","encoding":"base64","xrefs":{"person":["Jerome_Marcon"],"template":["application/vnd.dvb.ipdcesgpdd"]},"registered":true},{"content-type":"application/vnd.dvb.ipdcroaming","encoding":"base64","xrefs":{"person":["Yiling_Xu"],"template":["application/vnd.dvb.ipdcroaming"]},"registered":true},{"content-type":"application/vnd.dvb.iptv.alfec-base","encoding":"base64","xrefs":{"person":["Jean-Baptiste_Henry"],"template":["application/vnd.dvb.iptv.alfec-base"]},"registered":true},{"content-type":"application/vnd.dvb.iptv.alfec-enhancement","encoding":"base64","xrefs":{"person":["Jean-Baptiste_Henry"],"template":["application/vnd.dvb.iptv.alfec-enhancement"]},"registered":true},{"content-type":"application/vnd.dvb.notif-aggregate-root+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-aggregate-root+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-container+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-container+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-generic+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-generic+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-ia-msglist+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-ia-msglist+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-ia-registration-request+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-ia-registration-request+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-ia-registration-response+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-ia-registration-response+xml"]},"registered":true},{"content-type":"application/vnd.dvb.notif-init+xml","encoding":"base64","xrefs":{"person":["Roy_Yue"],"template":["application/vnd.dvb.notif-init+xml"]},"registered":true},{"content-type":"application/vnd.dvb.pfr","encoding":"base64","xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["application/vnd.dvb.pfr"]},"registered":true},{"content-type":"application/vnd.dvb.service","friendly":{"en":"Digital Video Broadcasting"},"encoding":"base64","extensions":["svc"],"xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["application/vnd.dvb.service"]},"registered":true},{"content-type":"application/vnd.dxr","encoding":"base64","xrefs":{"person":["Michael_Duffy"],"template":["application/vnd.dxr"]},"registered":true},{"content-type":"application/vnd.dynageo","friendly":{"en":"DynaGeo"},"encoding":"base64","extensions":["geo"],"xrefs":{"person":["Roland_Mechling"],"template":["application/vnd.dynageo"]},"registered":true},{"content-type":"application/vnd.dzr","encoding":"base64","xrefs":{"person":["Carl_Anderson"],"template":["application/vnd.dzr"]},"registered":true},{"content-type":"application/vnd.easykaraoke.cdgdownload","encoding":"base64","xrefs":{"person":["Iain_Downs"],"template":["application/vnd.easykaraoke.cdgdownload"]},"registered":true},{"content-type":"application/vnd.ecdis-update","encoding":"base64","xrefs":{"person":["Gert_Buettgenbach"],"template":["application/vnd.ecdis-update"]},"registered":true},{"content-type":"application/vnd.ecip.rlp","encoding":"base64","xrefs":{"person":["Wei_Tang"],"template":["application/vnd.ecip.rlp"]},"registered":true},{"content-type":"application/vnd.ecowin.chart","friendly":{"en":"EcoWin Chart"},"encoding":"base64","extensions":["mag"],"xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.chart"]},"registered":true},{"content-type":"application/vnd.ecowin.filerequest","encoding":"base64","xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.filerequest"]},"registered":true},{"content-type":"application/vnd.ecowin.fileupdate","encoding":"base64","xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.fileupdate"]},"registered":true},{"content-type":"application/vnd.ecowin.series","encoding":"base64","xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.series"]},"registered":true},{"content-type":"application/vnd.ecowin.seriesrequest","encoding":"base64","xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.seriesrequest"]},"registered":true},{"content-type":"application/vnd.ecowin.seriesupdate","encoding":"base64","xrefs":{"person":["Thomas_Olsson"],"template":["application/vnd.ecowin.seriesupdate"]},"registered":true},{"content-type":"application/vnd.efi.img","encoding":"base64","xrefs":{"person":["Fu_Siyuan","UEFI_Forum"],"template":["application/vnd.efi.img"]},"registered":true},{"content-type":"application/vnd.efi.iso","encoding":"base64","xrefs":{"person":["Fu_Siyuan","UEFI_Forum"],"template":["application/vnd.efi.iso"]},"registered":true},{"content-type":"application/vnd.emclient.accessrequest+xml","encoding":"base64","xrefs":{"person":["Filip_Navara"],"template":["application/vnd.emclient.accessrequest+xml"]},"registered":true},{"content-type":"application/vnd.enliven","friendly":{"en":"Enliven Viewer"},"encoding":"base64","extensions":["nml"],"xrefs":{"person":["Paul_Santinelli_Jr."],"template":["application/vnd.enliven"]},"registered":true},{"content-type":"application/vnd.enphase.envoy","encoding":"base64","xrefs":{"person":["Chris_Eich"],"template":["application/vnd.enphase.envoy"]},"registered":true},{"content-type":"application/vnd.eprints.data+xml","encoding":"base64","xrefs":{"person":["Tim_Brody"],"template":["application/vnd.eprints.data+xml"]},"registered":true},{"content-type":"application/vnd.epson.esf","friendly":{"en":"QUASS Stream Player"},"encoding":"base64","extensions":["esf"],"xrefs":{"person":["Shoji_Hoshina"],"template":["application/vnd.epson.esf"]},"registered":true},{"content-type":"application/vnd.epson.msf","friendly":{"en":"QUASS Stream Player"},"encoding":"base64","extensions":["msf"],"xrefs":{"person":["Shoji_Hoshina"],"template":["application/vnd.epson.msf"]},"registered":true},{"content-type":"application/vnd.epson.quickanime","friendly":{"en":"QuickAnime Player"},"encoding":"base64","extensions":["qam"],"xrefs":{"person":["Yu_Gu"],"template":["application/vnd.epson.quickanime"]},"registered":true},{"content-type":"application/vnd.epson.salt","friendly":{"en":"SimpleAnimeLite Player"},"encoding":"base64","extensions":["slt"],"xrefs":{"person":["Yasuhito_Nagatomo"],"template":["application/vnd.epson.salt"]},"registered":true},{"content-type":"application/vnd.epson.ssf","friendly":{"en":"QUASS Stream Player"},"encoding":"base64","extensions":["ssf"],"xrefs":{"person":["Shoji_Hoshina"],"template":["application/vnd.epson.ssf"]},"registered":true},{"content-type":"application/vnd.ericsson.quickcall","encoding":"base64","xrefs":{"person":["Paul_Tidwell"],"template":["application/vnd.ericsson.quickcall"]},"registered":true},{"content-type":"application/vnd.espass-espass+zip","encoding":"base64","xrefs":{"person":["Marcus_Ligi_Büschleb"],"template":["application/vnd.espass-espass+zip"]},"registered":true},{"content-type":"application/vnd.eszigno3+xml","friendly":{"en":"MICROSEC e-Szign¢"},"encoding":"base64","extensions":["es3","et3"],"xrefs":{"person":["Szilveszter_Tóth"],"template":["application/vnd.eszigno3+xml"]},"registered":true},{"content-type":"application/vnd.etsi.aoc+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.aoc+xml"]},"registered":true},{"content-type":"application/vnd.etsi.asic-e+zip","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.asic-e+zip"]},"registered":true},{"content-type":"application/vnd.etsi.asic-s+zip","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.asic-s+zip"]},"registered":true},{"content-type":"application/vnd.etsi.cug+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.cug+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvcommand+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvcommand+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvdiscovery+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvdiscovery+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvprofile+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvprofile+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvsad-bc+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvsad-bc+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvsad-cod+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvsad-cod+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvsad-npvr+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvsad-npvr+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvservice+xml","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.iptvservice+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvsync+xml","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.iptvsync+xml"]},"registered":true},{"content-type":"application/vnd.etsi.iptvueprofile+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.iptvueprofile+xml"]},"registered":true},{"content-type":"application/vnd.etsi.mcid+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.mcid+xml"]},"registered":true},{"content-type":"application/vnd.etsi.mheg5","encoding":"base64","xrefs":{"person":["Ian_Medland","Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.mheg5"]},"registered":true},{"content-type":"application/vnd.etsi.overload-control-policy-dataset+xml","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.overload-control-policy-dataset+xml"]},"registered":true},{"content-type":"application/vnd.etsi.pstn+xml","encoding":"base64","xrefs":{"person":["Jiwan_Han","Thomas_Belling"],"template":["application/vnd.etsi.pstn+xml"]},"registered":true},{"content-type":"application/vnd.etsi.sci+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.sci+xml"]},"registered":true},{"content-type":"application/vnd.etsi.simservs+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.simservs+xml"]},"registered":true},{"content-type":"application/vnd.etsi.timestamp-token","encoding":"base64","xrefs":{"person":["Miguel_Angel_Reina_Ortega"],"template":["application/vnd.etsi.timestamp-token"]},"registered":true},{"content-type":"application/vnd.etsi.tsl+xml","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.tsl+xml"]},"registered":true},{"content-type":"application/vnd.etsi.tsl.der","encoding":"base64","xrefs":{"person":["Shicheng_Hu"],"template":["application/vnd.etsi.tsl.der"]},"registered":true},{"content-type":"application/vnd.eu.kasparian.car+json","encoding":"base64","xrefs":{"person":["Hervé_Kasparian"],"template":["application/vnd.eu.kasparian.car+json"]},"registered":true},{"content-type":"application/vnd.eudora.data","encoding":"base64","xrefs":{"person":["Pete_Resnick"],"template":["application/vnd.eudora.data"]},"registered":true},{"content-type":"application/vnd.evolv.ecig.profile","encoding":"base64","xrefs":{"person":["James_Bellinger"],"template":["application/vnd.evolv.ecig.profile"]},"registered":true},{"content-type":"application/vnd.evolv.ecig.settings","encoding":"base64","xrefs":{"person":["James_Bellinger"],"template":["application/vnd.evolv.ecig.settings"]},"registered":true},{"content-type":"application/vnd.evolv.ecig.theme","encoding":"base64","xrefs":{"person":["James_Bellinger"],"template":["application/vnd.evolv.ecig.theme"]},"registered":true},{"content-type":"application/vnd.exstream-empower+zip","encoding":"base64","xrefs":{"person":["Bill_Kidwell"],"template":["application/vnd.exstream-empower+zip"]},"registered":true},{"content-type":"application/vnd.exstream-package","encoding":"base64","xrefs":{"person":["Bill_Kidwell"],"template":["application/vnd.exstream-package"]},"registered":true},{"content-type":"application/vnd.ezpix-album","friendly":{"en":"EZPix Secure Photo Album"},"encoding":"base64","extensions":["ez2"],"xrefs":{"person":["ElectronicZombieCorp"],"template":["application/vnd.ezpix-album"]},"registered":true},{"content-type":"application/vnd.ezpix-package","friendly":{"en":"EZPix Secure Photo Album"},"encoding":"base64","extensions":["ez3"],"xrefs":{"person":["ElectronicZombieCorp"],"template":["application/vnd.ezpix-package"]},"registered":true},{"content-type":"application/vnd.f-secure.mobile","encoding":"base64","xrefs":{"person":["Samu_Sarivaara"],"template":["application/vnd.f-secure.mobile"]},"registered":true},{"content-type":"application/vnd.familysearch.gedcom+zip","encoding":"base64","xrefs":{"person":["Gordon_Clarke"],"template":["application/vnd.familysearch.gedcom+zip"]},"registered":true},{"content-type":"application/vnd.fastcopy-disk-image","encoding":"base64","xrefs":{"person":["Thomas_Huth"],"template":["application/vnd.fastcopy-disk-image"]},"registered":true},{"content-type":"application/vnd.fdf","friendly":{"en":"Forms Data Format"},"encoding":"base64","extensions":["fdf"],"xrefs":{"person":["Steve_Zilles"],"template":["application/vnd.fdf"]},"registered":true},{"content-type":"application/vnd.fdsn.mseed","encoding":"base64","extensions":["mseed"],"xrefs":{"person":["Chad_Trabant"],"template":["application/vnd.fdsn.mseed"]},"registered":true},{"content-type":"application/vnd.fdsn.seed","friendly":{"en":"Digital Siesmograph Networks - SEED Datafiles"},"encoding":"base64","extensions":["dataless","seed"],"xrefs":{"person":["Chad_Trabant"],"template":["application/vnd.fdsn.seed"]},"registered":true},{"content-type":"application/vnd.ffsns","encoding":"base64","xrefs":{"person":["Holstage"],"template":["application/vnd.ffsns"]},"registered":true},{"content-type":"application/vnd.ficlab.flb+zip","encoding":"base64","xrefs":{"person":["Steve_Gilberd"],"template":["application/vnd.ficlab.flb+zip"]},"registered":true},{"content-type":"application/vnd.filmit.zfc","encoding":"base64","xrefs":{"person":["Harms_Moeller"],"template":["application/vnd.filmit.zfc"]},"registered":true},{"content-type":"application/vnd.fints","encoding":"base64","xrefs":{"person":["Ingo_Hammann"],"template":["application/vnd.fints"]},"registered":true},{"content-type":"application/vnd.firemonkeys.cloudcell","encoding":"base64","xrefs":{"person":["Alex_Dubov"],"template":["application/vnd.firemonkeys.cloudcell"]},"registered":true},{"content-type":"application/vnd.FloGraphIt","friendly":{"en":"NpGraphIt"},"encoding":"base64","extensions":["gph"],"xrefs":{"person":["Dick_Floersch"],"template":["application/vnd.FloGraphIt"]},"registered":true},{"content-type":"application/vnd.fluxtime.clip","friendly":{"en":"FluxTime Clip"},"encoding":"base64","extensions":["ftc"],"xrefs":{"person":["Marc_Winter"],"template":["application/vnd.fluxtime.clip"]},"registered":true},{"content-type":"application/vnd.font-fontforge-sfd","encoding":"base64","xrefs":{"person":["George_Williams"],"template":["application/vnd.font-fontforge-sfd"]},"registered":true},{"content-type":"application/vnd.framemaker","friendly":{"en":"FrameMaker Normal Format"},"encoding":"base64","extensions":["frm","maker","frame","fm","fb","book","fbdoc"],"xrefs":{"person":["Mike_Wexler"],"template":["application/vnd.framemaker"]},"registered":true},{"content-type":"application/vnd.frogans.fnc","friendly":{"en":"Frogans Player"},"encoding":"base64","extensions":["fnc"],"obsolete":true,"xrefs":{"person":["Alexis_Tamas","OP3FT"],"template":["application/vnd.frogans.fnc"],"notes":["(OBSOLETE)"]},"registered":true},{"content-type":"application/vnd.frogans.ltf","friendly":{"en":"Frogans Player"},"encoding":"base64","extensions":["ltf"],"obsolete":true,"xrefs":{"person":["Alexis_Tamas","OP3FT"],"template":["application/vnd.frogans.ltf"],"notes":["(OBSOLETE)"]},"registered":true},{"content-type":"application/vnd.fsc.weblaunch","friendly":{"en":"Friendly Software Corporation"},"encoding":"7bit","extensions":["fsc"],"xrefs":{"person":["Derek_Smith"],"template":["application/vnd.fsc.weblaunch"]},"registered":true},{"content-type":"application/vnd.fujifilm.fb.docuworks","encoding":"base64","xrefs":{"person":["Kazuya_Iimura"],"template":["application/vnd.fujifilm.fb.docuworks"]},"registered":true},{"content-type":"application/vnd.fujifilm.fb.docuworks.binder","encoding":"base64","xrefs":{"person":["Kazuya_Iimura"],"template":["application/vnd.fujifilm.fb.docuworks.binder"]},"registered":true},{"content-type":"application/vnd.fujifilm.fb.docuworks.container","encoding":"base64","xrefs":{"person":["Kazuya_Iimura"],"template":["application/vnd.fujifilm.fb.docuworks.container"]},"registered":true},{"content-type":"application/vnd.fujifilm.fb.jfi+xml","encoding":"base64","xrefs":{"person":["Keitaro_Ishida"],"template":["application/vnd.fujifilm.fb.jfi+xml"]},"registered":true},{"content-type":"application/vnd.fujitsu.oasys","friendly":{"en":"Fujitsu Oasys"},"encoding":"base64","extensions":["oas"],"xrefs":{"person":["Nobukazu_Togashi"],"template":["application/vnd.fujitsu.oasys"]},"registered":true},{"content-type":"application/vnd.fujitsu.oasys2","friendly":{"en":"Fujitsu Oasys"},"encoding":"base64","extensions":["oa2"],"xrefs":{"person":["Nobukazu_Togashi"],"template":["application/vnd.fujitsu.oasys2"]},"registered":true},{"content-type":"application/vnd.fujitsu.oasys3","friendly":{"en":"Fujitsu Oasys"},"encoding":"base64","extensions":["oa3"],"xrefs":{"person":["Seiji_Okudaira"],"template":["application/vnd.fujitsu.oasys3"]},"registered":true},{"content-type":"application/vnd.fujitsu.oasysgp","friendly":{"en":"Fujitsu Oasys"},"encoding":"base64","extensions":["fg5"],"xrefs":{"person":["Masahiko_Sugimoto"],"template":["application/vnd.fujitsu.oasysgp"]},"registered":true},{"content-type":"application/vnd.fujitsu.oasysprs","friendly":{"en":"Fujitsu Oasys"},"encoding":"base64","extensions":["bh2"],"xrefs":{"person":["Masumi_Ogita"],"template":["application/vnd.fujitsu.oasysprs"]},"registered":true},{"content-type":"application/vnd.fujixerox.ART-EX","encoding":"base64","xrefs":{"person":["Fumio_Tanabe"],"template":["application/vnd.fujixerox.ART-EX"]},"registered":true},{"content-type":"application/vnd.fujixerox.ART4","encoding":"base64","xrefs":{"person":["Fumio_Tanabe"],"template":["application/vnd.fujixerox.ART4"]},"registered":true},{"content-type":"application/vnd.fujixerox.ddd","friendly":{"en":"Fujitsu - Xerox 2D CAD Data"},"encoding":"base64","extensions":["ddd"],"xrefs":{"person":["Masanori_Onda"],"template":["application/vnd.fujixerox.ddd"]},"registered":true},{"content-type":"application/vnd.fujixerox.docuworks","friendly":{"en":"Fujitsu - Xerox DocuWorks"},"encoding":"base64","extensions":["xdw"],"xrefs":{"person":["Takatomo_Wakibayashi"],"template":["application/vnd.fujixerox.docuworks"]},"registered":true},{"content-type":"application/vnd.fujixerox.docuworks.binder","friendly":{"en":"Fujitsu - Xerox DocuWorks Binder"},"encoding":"base64","extensions":["xbd"],"xrefs":{"person":["Takashi_Matsumoto"],"template":["application/vnd.fujixerox.docuworks.binder"]},"registered":true},{"content-type":"application/vnd.fujixerox.docuworks.container","encoding":"base64","xrefs":{"person":["Kiyoshi_Tashiro"],"template":["application/vnd.fujixerox.docuworks.container"]},"registered":true},{"content-type":"application/vnd.fujixerox.HBPL","encoding":"base64","xrefs":{"person":["Fumio_Tanabe"],"template":["application/vnd.fujixerox.HBPL"]},"registered":true},{"content-type":"application/vnd.fut-misnet","encoding":"base64","xrefs":{"person":["Jann_Pruulman"],"template":["application/vnd.fut-misnet"]},"registered":true},{"content-type":"application/vnd.futoin+cbor","encoding":"base64","xrefs":{"person":["Andrey_Galkin"],"template":["application/vnd.futoin+cbor"]},"registered":true},{"content-type":"application/vnd.futoin+json","encoding":"base64","xrefs":{"person":["Andrey_Galkin"],"template":["application/vnd.futoin+json"]},"registered":true},{"content-type":"application/vnd.fuzzysheet","friendly":{"en":"FuzzySheet"},"encoding":"base64","extensions":["fzs"],"xrefs":{"person":["Simon_Birtwistle"],"template":["application/vnd.fuzzysheet"]},"registered":true},{"content-type":"application/vnd.genomatix.tuxedo","friendly":{"en":"Genomatix Tuxedo Framework"},"encoding":"base64","extensions":["txd"],"xrefs":{"person":["Torben_Frey"],"template":["application/vnd.genomatix.tuxedo"]},"registered":true},{"content-type":"application/vnd.gentics.grd+json","encoding":"base64","xrefs":{"person":["Philipp_Gortan"],"template":["application/vnd.gentics.grd+json"]},"registered":true},{"content-type":"application/vnd.geo+json","encoding":"base64","obsolete":true,"use-instead":"application/geo+json","xrefs":{"rfc":["rfc7946"],"person":["Sean_Gillies"],"template":["application/vnd.geo+json"],"notes":["(OBSOLETED by in favor of application/geo+json)"]},"registered":true},{"content-type":"application/vnd.geocube+xml","encoding":"8bit","obsolete":true,"xrefs":{"person":["Francois_Pirsch"],"template":["application/vnd.geocube+xml"],"notes":["(OBSOLETED by request)"]},"registered":true},{"content-type":"application/vnd.geogebra.file","friendly":{"en":"GeoGebra"},"encoding":"base64","extensions":["ggb"],"xrefs":{"person":["GeoGebra","Yves_Kreis"],"template":["application/vnd.geogebra.file"]},"registered":true},{"content-type":"application/vnd.geogebra.slides","encoding":"base64","xrefs":{"person":["GeoGebra","Markus_Hohenwarter","Michael_Borcherds"],"template":["application/vnd.geogebra.slides"]},"registered":true},{"content-type":"application/vnd.geogebra.tool","friendly":{"en":"GeoGebra"},"encoding":"base64","extensions":["ggt"],"xrefs":{"person":["GeoGebra","Yves_Kreis"],"template":["application/vnd.geogebra.tool"]},"registered":true},{"content-type":"application/vnd.geometry-explorer","friendly":{"en":"GeoMetry Explorer"},"encoding":"base64","extensions":["gex","gre"],"xrefs":{"person":["Michael_Hvidsten"],"template":["application/vnd.geometry-explorer"]},"registered":true},{"content-type":"application/vnd.geonext","friendly":{"en":"GEONExT and JSXGraph"},"encoding":"base64","extensions":["gxt"],"xrefs":{"person":["Matthias_Ehmann"],"template":["application/vnd.geonext"]},"registered":true},{"content-type":"application/vnd.geoplan","friendly":{"en":"GeoplanW"},"encoding":"base64","extensions":["g2w"],"xrefs":{"person":["Christian_Mercat"],"template":["application/vnd.geoplan"]},"registered":true},{"content-type":"application/vnd.geospace","friendly":{"en":"GeospacW"},"encoding":"base64","extensions":["g3w"],"xrefs":{"person":["Christian_Mercat"],"template":["application/vnd.geospace"]},"registered":true},{"content-type":"application/vnd.gerber","encoding":"base64","xrefs":{"person":["Thomas_Weyn"],"template":["application/vnd.gerber"]},"registered":true},{"content-type":"application/vnd.globalplatform.card-content-mgt","encoding":"base64","xrefs":{"person":["Gil_Bernabeu"],"template":["application/vnd.globalplatform.card-content-mgt"]},"registered":true},{"content-type":"application/vnd.globalplatform.card-content-mgt-response","encoding":"base64","xrefs":{"person":["Gil_Bernabeu"],"template":["application/vnd.globalplatform.card-content-mgt-response"]},"registered":true},{"content-type":"application/vnd.gmx","friendly":{"en":"GameMaker ActiveX"},"encoding":"base64","extensions":["gmx"],"obsolete":true,"xrefs":{"person":["Christian_V._Sciberras"],"template":["application/vnd.gmx"],"notes":["- DEPRECATED"]},"registered":true},{"content-type":"application/vnd.google-earth.kml+xml","friendly":{"en":"Google Earth - KML"},"encoding":"8bit","extensions":["kml"],"xrefs":{"person":["Michael_Ashbridge"],"template":["application/vnd.google-earth.kml+xml"]},"registered":true},{"content-type":"application/vnd.google-earth.kmz","friendly":{"en":"Google Earth - Zipped KML"},"encoding":"8bit","extensions":["kmz"],"xrefs":{"person":["Michael_Ashbridge"],"template":["application/vnd.google-earth.kmz"]},"registered":true},{"content-type":"application/vnd.gov.sk.e-form+xml","encoding":"base64","xrefs":{"person":["Peter_Biro","Stefan_Szilva"],"template":["application/vnd.gov.sk.e-form+xml"]},"registered":true},{"content-type":"application/vnd.gov.sk.e-form+zip","encoding":"base64","xrefs":{"person":["Peter_Biro","Stefan_Szilva"],"template":["application/vnd.gov.sk.e-form+zip"]},"registered":true},{"content-type":"application/vnd.gov.sk.xmldatacontainer+xml","encoding":"base64","xrefs":{"person":["Peter_Biro","Stefan_Szilva"],"template":["application/vnd.gov.sk.xmldatacontainer+xml"]},"registered":true},{"content-type":"application/vnd.grafeq","friendly":{"en":"GrafEq"},"encoding":"base64","extensions":["gqf","gqs"],"xrefs":{"person":["Jeff_Tupper"],"template":["application/vnd.grafeq"]},"registered":true},{"content-type":"application/vnd.gridmp","encoding":"base64","xrefs":{"person":["Jeff_Lawson"],"template":["application/vnd.gridmp"]},"registered":true},{"content-type":"application/vnd.groove-account","friendly":{"en":"Groove - Account"},"encoding":"base64","extensions":["gac"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-account"]},"registered":true},{"content-type":"application/vnd.groove-help","friendly":{"en":"Groove - Help"},"encoding":"base64","extensions":["ghf"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-help"]},"registered":true},{"content-type":"application/vnd.groove-identity-message","friendly":{"en":"Groove - Identity Message"},"encoding":"base64","extensions":["gim"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-identity-message"]},"registered":true},{"content-type":"application/vnd.groove-injector","friendly":{"en":"Groove - Injector"},"encoding":"base64","extensions":["grv"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-injector"]},"registered":true},{"content-type":"application/vnd.groove-tool-message","friendly":{"en":"Groove - Tool Message"},"encoding":"base64","extensions":["gtm"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-tool-message"]},"registered":true},{"content-type":"application/vnd.groove-tool-template","friendly":{"en":"Groove - Tool Template"},"encoding":"base64","extensions":["tpl"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-tool-template"]},"registered":true},{"content-type":"application/vnd.groove-vcard","friendly":{"en":"Groove - Vcard"},"encoding":"base64","extensions":["vcg"],"xrefs":{"person":["Todd_Joseph"],"template":["application/vnd.groove-vcard"]},"registered":true},{"content-type":"application/vnd.hal+json","encoding":"base64","xrefs":{"person":["Mike_Kelly"],"template":["application/vnd.hal+json"]},"registered":true},{"content-type":"application/vnd.hal+xml","friendly":{"en":"Hypertext Application Language"},"encoding":"base64","extensions":["hal"],"xrefs":{"person":["Mike_Kelly"],"template":["application/vnd.hal+xml"]},"registered":true},{"content-type":"application/vnd.HandHeld-Entertainment+xml","friendly":{"en":"ZVUE Media Manager"},"encoding":"base64","extensions":["zmm"],"xrefs":{"person":["Eric_Hamilton"],"template":["application/vnd.HandHeld-Entertainment+xml"]},"registered":true},{"content-type":"application/vnd.hbci","friendly":{"en":"Homebanking Computer Interface (HBCI)"},"encoding":"base64","extensions":["hbci","hbc","kom","upa","pkd","bpd"],"xrefs":{"person":["Ingo_Hammann"],"template":["application/vnd.hbci"]},"registered":true},{"content-type":"application/vnd.hc+json","encoding":"base64","xrefs":{"person":["Jan_Schütze"],"template":["application/vnd.hc+json"]},"registered":true},{"content-type":"application/vnd.hcl-bireports","encoding":"base64","xrefs":{"person":["Doug_R._Serres"],"template":["application/vnd.hcl-bireports"]},"registered":true},{"content-type":"application/vnd.hdt","encoding":"base64","xrefs":{"person":["Javier_D._Fernández"],"template":["application/vnd.hdt"]},"registered":true},{"content-type":"application/vnd.heroku+json","encoding":"base64","xrefs":{"person":["Wesley_Beary"],"template":["application/vnd.heroku+json"]},"registered":true},{"content-type":"application/vnd.hhe.lesson-player","friendly":{"en":"Archipelago Lesson Player"},"encoding":"base64","extensions":["les"],"xrefs":{"person":["Randy_Jones"],"template":["application/vnd.hhe.lesson-player"]},"registered":true},{"content-type":"application/vnd.hl7cda+xml","encoding":"base64","xrefs":{"person":["Marc_Duteau"],"template":["application/vnd.hl7cda+xml"]},"registered":true},{"content-type":"application/vnd.hl7v2+xml","encoding":"base64","xrefs":{"person":["Marc_Duteau"],"template":["application/vnd.hl7v2+xml"]},"registered":true},{"content-type":"application/vnd.hp-HPGL","friendly":{"en":"HP-GL/2 and HP RTL"},"encoding":"base64","extensions":["plt","hpgl"],"xrefs":{"person":["Bob_Pentecost"],"template":["application/vnd.hp-HPGL"]},"registered":true},{"content-type":"application/vnd.hp-hpid","friendly":{"en":"Hewlett Packard Instant Delivery"},"encoding":"base64","extensions":["hpid"],"xrefs":{"person":["Aloke_Gupta"],"template":["application/vnd.hp-hpid"]},"registered":true},{"content-type":"application/vnd.hp-hps","friendly":{"en":"Hewlett-Packard's WebPrintSmart"},"encoding":"base64","extensions":["hps"],"xrefs":{"person":["Steve_Aubrey"],"template":["application/vnd.hp-hps"]},"registered":true},{"content-type":"application/vnd.hp-jlyt","friendly":{"en":"HP Indigo Digital Press - Job Layout Languate"},"encoding":"base64","extensions":["jlt"],"xrefs":{"person":["Amir_Gaash"],"template":["application/vnd.hp-jlyt"]},"registered":true},{"content-type":"application/vnd.hp-PCL","friendly":{"en":"HP Printer Command Language"},"encoding":"base64","extensions":["pcl"],"xrefs":{"person":["Bob_Pentecost"],"template":["application/vnd.hp-PCL"]},"registered":true},{"content-type":"application/vnd.hp-PCLXL","friendly":{"en":"PCL 6 Enhanced (Formely PCL XL)"},"encoding":"base64","extensions":["pclxl"],"xrefs":{"person":["Bob_Pentecost"],"template":["application/vnd.hp-PCLXL"]},"registered":true},{"content-type":"application/vnd.httphone","encoding":"base64","xrefs":{"person":["Franck_Lefevre"],"template":["application/vnd.httphone"]},"registered":true},{"content-type":"application/vnd.hydrostatix.sof-data","friendly":{"en":"Hydrostatix Master Suite"},"encoding":"base64","extensions":["sfd-hdstx"],"xrefs":{"person":["Allen_Gillam"],"template":["application/vnd.hydrostatix.sof-data"]},"registered":true},{"content-type":"application/vnd.hyper+json","encoding":"base64","xrefs":{"person":["Irakli_Nadareishvili"],"template":["application/vnd.hyper+json"]},"registered":true},{"content-type":"application/vnd.hyper-item+json","encoding":"base64","xrefs":{"person":["Mario_Demuth"],"template":["application/vnd.hyper-item+json"]},"registered":true},{"content-type":"application/vnd.hyperdrive+json","encoding":"base64","xrefs":{"person":["Daniel_Sims"],"template":["application/vnd.hyperdrive+json"]},"registered":true},{"content-type":"application/vnd.hzn-3d-crossword","friendly":{"en":"3D Crossword Plugin"},"encoding":"base64","xrefs":{"person":["James_Minnis"],"template":["application/vnd.hzn-3d-crossword"]},"registered":true},{"content-type":"application/vnd.ibm.afplinedata","encoding":"base64","obsolete":true,"use-instead":"vnd.afpc.afplinedata","xrefs":{"person":["Roger_Buis"],"template":["application/vnd.ibm.afplinedata"],"notes":["(OBSOLETED in favor of vnd.afpc.afplinedata)"]},"registered":true},{"content-type":"application/vnd.ibm.electronic-media","encoding":"base64","extensions":["emm"],"xrefs":{"person":["Bruce_Tantlinger"],"template":["application/vnd.ibm.electronic-media"]},"registered":true},{"content-type":"application/vnd.ibm.MiniPay","friendly":{"en":"MiniPay"},"encoding":"base64","extensions":["mpy"],"xrefs":{"person":["Amir_Herzberg"],"template":["application/vnd.ibm.MiniPay"]},"registered":true},{"content-type":"application/vnd.ibm.modcap","friendly":{"en":"MO:DCA-P"},"encoding":"base64","extensions":["afp","list3820","listafp"],"obsolete":true,"use-instead":"application/vnd.afpc.modca","xrefs":{"person":["Reinhard_Hohensee"],"template":["application/vnd.ibm.modcap"],"notes":["(OBSOLETED in favor of application/vnd.afpc.modca)"]},"registered":true},{"content-type":"application/vnd.ibm.rights-management","friendly":{"en":"IBM DB2 Rights Manager"},"encoding":"base64","extensions":["irm"],"xrefs":{"person":["Bruce_Tantlinger"],"template":["application/vnd.ibm.rights-management"]},"registered":true},{"content-type":"application/vnd.ibm.secure-container","friendly":{"en":"IBM Electronic Media Management System - Secure Container"},"encoding":"base64","extensions":["sc"],"xrefs":{"person":["Bruce_Tantlinger"],"template":["application/vnd.ibm.secure-container"]},"registered":true},{"content-type":"application/vnd.iccprofile","friendly":{"en":"ICC profile"},"encoding":"base64","extensions":["icc","icm"],"xrefs":{"person":["Phil_Green"],"template":["application/vnd.iccprofile"]},"registered":true},{"content-type":"application/vnd.ieee.1905","encoding":"base64","xrefs":{"person":["Purva_R_Rajkotia"],"template":["application/vnd.ieee.1905"]},"registered":true},{"content-type":"application/vnd.igloader","friendly":{"en":"igLoader"},"encoding":"base64","extensions":["igl"],"xrefs":{"person":["Tim_Fisher"],"template":["application/vnd.igloader"]},"registered":true},{"content-type":"application/vnd.imagemeter.folder+zip","encoding":"base64","xrefs":{"person":["Dirk_Farin"],"template":["application/vnd.imagemeter.folder+zip"]},"registered":true},{"content-type":"application/vnd.imagemeter.image+zip","encoding":"base64","xrefs":{"person":["Dirk_Farin"],"template":["application/vnd.imagemeter.image+zip"]},"registered":true},{"content-type":"application/vnd.immervision-ivp","friendly":{"en":"ImmerVision PURE Players"},"encoding":"base64","extensions":["ivp"],"xrefs":{"person":["Mathieu_Villegas"],"template":["application/vnd.immervision-ivp"]},"registered":true},{"content-type":"application/vnd.immervision-ivu","friendly":{"en":"ImmerVision PURE Players"},"encoding":"base64","extensions":["ivu"],"xrefs":{"person":["Mathieu_Villegas"],"template":["application/vnd.immervision-ivu"]},"registered":true},{"content-type":"application/vnd.ims.imsccv1p1","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.imsccv1p1"]},"registered":true},{"content-type":"application/vnd.ims.imsccv1p2","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.imsccv1p2"]},"registered":true},{"content-type":"application/vnd.ims.imsccv1p3","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.imsccv1p3"]},"registered":true},{"content-type":"application/vnd.ims.lis.v2.result+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lis.v2.result+json"]},"registered":true},{"content-type":"application/vnd.ims.lti.v2.toolconsumerprofile+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lti.v2.toolconsumerprofile+json"]},"registered":true},{"content-type":"application/vnd.ims.lti.v2.toolproxy+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lti.v2.toolproxy+json"]},"registered":true},{"content-type":"application/vnd.ims.lti.v2.toolproxy.id+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lti.v2.toolproxy.id+json"]},"registered":true},{"content-type":"application/vnd.ims.lti.v2.toolsettings+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lti.v2.toolsettings+json"]},"registered":true},{"content-type":"application/vnd.ims.lti.v2.toolsettings.simple+json","encoding":"base64","xrefs":{"person":["Lisa_Mattson"],"template":["application/vnd.ims.lti.v2.toolsettings.simple+json"]},"registered":true},{"content-type":"application/vnd.informedcontrol.rms+xml","encoding":"base64","xrefs":{"person":["Mark_Wahl"],"template":["application/vnd.informedcontrol.rms+xml"]},"registered":true},{"content-type":"application/vnd.informix-visionary","encoding":"base64","obsolete":true,"use-instead":"application/vnd.visionary","xrefs":{"person":["Christopher_Gales"],"template":["application/vnd.informix-visionary"],"notes":["(OBSOLETED in favor of application/vnd.visionary)"]},"registered":true},{"content-type":"application/vnd.infotech.project","encoding":"base64","xrefs":{"person":["Charles_Engelke"],"template":["application/vnd.infotech.project"]},"registered":true},{"content-type":"application/vnd.infotech.project+xml","encoding":"base64","xrefs":{"person":["Charles_Engelke"],"template":["application/vnd.infotech.project+xml"]},"registered":true},{"content-type":"application/vnd.innopath.wamp.notification","encoding":"base64","xrefs":{"person":["Takanori_Sudo"],"template":["application/vnd.innopath.wamp.notification"]},"registered":true},{"content-type":"application/vnd.insors.igm","friendly":{"en":"IOCOM Visimeet"},"encoding":"base64","extensions":["igm"],"xrefs":{"person":["Jon_Swanson"],"template":["application/vnd.insors.igm"]},"registered":true},{"content-type":"application/vnd.intercon.formnet","friendly":{"en":"Intercon FormNet"},"encoding":"base64","extensions":["xpw","xpx"],"xrefs":{"person":["Tom_Gurak"],"template":["application/vnd.intercon.formnet"]},"registered":true},{"content-type":"application/vnd.intergeo","friendly":{"en":"Interactive Geometry Software"},"encoding":"base64","extensions":["i2g"],"xrefs":{"person":["Yves_Kreis_2"],"template":["application/vnd.intergeo"]},"registered":true},{"content-type":"application/vnd.intertrust.digibox","encoding":"base64","xrefs":{"person":["Luke_Tomasello"],"template":["application/vnd.intertrust.digibox"]},"registered":true},{"content-type":"application/vnd.intertrust.nncp","encoding":"base64","xrefs":{"person":["Luke_Tomasello"],"template":["application/vnd.intertrust.nncp"]},"registered":true},{"content-type":"application/vnd.intu.qbo","friendly":{"en":"Open Financial Exchange"},"encoding":"base64","extensions":["qbo"],"xrefs":{"person":["Greg_Scratchley"],"template":["application/vnd.intu.qbo"]},"registered":true},{"content-type":"application/vnd.intu.qfx","friendly":{"en":"Quicken"},"encoding":"base64","extensions":["qfx"],"xrefs":{"person":["Greg_Scratchley"],"template":["application/vnd.intu.qfx"]},"registered":true},{"content-type":"application/vnd.iptc.g2.catalogitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.catalogitem+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.conceptitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.conceptitem+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.knowledgeitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.knowledgeitem+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.newsitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.newsitem+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.newsmessage+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.newsmessage+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.packageitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.packageitem+xml"]},"registered":true},{"content-type":"application/vnd.iptc.g2.planningitem+xml","encoding":"base64","xrefs":{"person":["Michael_Steidl"],"template":["application/vnd.iptc.g2.planningitem+xml"]},"registered":true},{"content-type":"application/vnd.ipunplugged.rcprofile","friendly":{"en":"IP Unplugged Roaming Client"},"encoding":"base64","extensions":["rcprofile"],"xrefs":{"person":["Per_Ersson"],"template":["application/vnd.ipunplugged.rcprofile"]},"registered":true},{"content-type":"application/vnd.irepository.package+xml","friendly":{"en":"iRepository / Lucidoc Editor"},"encoding":"base64","extensions":["irp"],"xrefs":{"person":["Martin_Knowles"],"template":["application/vnd.irepository.package+xml"]},"registered":true},{"content-type":"application/vnd.is-xpr","friendly":{"en":"Express by Infoseek"},"encoding":"base64","extensions":["xpr"],"xrefs":{"person":["Satish_Navarajan"],"template":["application/vnd.is-xpr"]},"registered":true},{"content-type":"application/vnd.isac.fcs","friendly":{"en":"International Society for Advancement of Cytometry"},"encoding":"base64","extensions":["fcs"],"xrefs":{"person":["Ryan_Brinkman"],"template":["application/vnd.isac.fcs"]},"registered":true},{"content-type":"application/vnd.iso11783-10+zip","encoding":"base64","xrefs":{"person":["Frank_Wiebeler"],"template":["application/vnd.iso11783-10+zip"]},"registered":true},{"content-type":"application/vnd.jam","friendly":{"en":"Lightspeed Audio Lab"},"encoding":"base64","extensions":["jam"],"xrefs":{"person":["Brijesh_Kumar"],"template":["application/vnd.jam"]},"registered":true},{"content-type":"application/vnd.japannet-directory-service","encoding":"base64","xrefs":{"person":["Kiyofusa_Fujii"],"template":["application/vnd.japannet-directory-service"]},"registered":true},{"content-type":"application/vnd.japannet-jpnstore-wakeup","encoding":"base64","xrefs":{"person":["Jun_Yoshitake"],"template":["application/vnd.japannet-jpnstore-wakeup"]},"registered":true},{"content-type":"application/vnd.japannet-payment-wakeup","encoding":"base64","xrefs":{"person":["Kiyofusa_Fujii"],"template":["application/vnd.japannet-payment-wakeup"]},"registered":true},{"content-type":"application/vnd.japannet-registration","encoding":"base64","xrefs":{"person":["Jun_Yoshitake"],"template":["application/vnd.japannet-registration"]},"registered":true},{"content-type":"application/vnd.japannet-registration-wakeup","encoding":"base64","xrefs":{"person":["Kiyofusa_Fujii"],"template":["application/vnd.japannet-registration-wakeup"]},"registered":true},{"content-type":"application/vnd.japannet-setstore-wakeup","encoding":"base64","xrefs":{"person":["Jun_Yoshitake"],"template":["application/vnd.japannet-setstore-wakeup"]},"registered":true},{"content-type":"application/vnd.japannet-verification","encoding":"base64","xrefs":{"person":["Jun_Yoshitake"],"template":["application/vnd.japannet-verification"]},"registered":true},{"content-type":"application/vnd.japannet-verification-wakeup","encoding":"base64","xrefs":{"person":["Kiyofusa_Fujii"],"template":["application/vnd.japannet-verification-wakeup"]},"registered":true},{"content-type":"application/vnd.jcp.javame.midlet-rms","friendly":{"en":"Mobile Information Device Profile"},"encoding":"base64","extensions":["rms"],"xrefs":{"person":["Mikhail_Gorshenev"],"template":["application/vnd.jcp.javame.midlet-rms"]},"registered":true},{"content-type":"application/vnd.jisp","friendly":{"en":"RhymBox"},"encoding":"base64","extensions":["jisp"],"xrefs":{"person":["Sebastiaan_Deckers"],"template":["application/vnd.jisp"]},"registered":true},{"content-type":"application/vnd.joost.joda-archive","friendly":{"en":"Joda Archive"},"encoding":"base64","extensions":["joda"],"xrefs":{"person":["Joost"],"template":["application/vnd.joost.joda-archive"]},"registered":true},{"content-type":"application/vnd.jsk.isdn-ngn","encoding":"base64","xrefs":{"person":["Yokoyama_Kiyonobu"],"template":["application/vnd.jsk.isdn-ngn"]},"registered":true},{"content-type":"application/vnd.kahootz","friendly":{"en":"Kahootz"},"encoding":"base64","extensions":["ktr","ktz"],"xrefs":{"person":["Tim_Macdonald"],"template":["application/vnd.kahootz"]},"registered":true},{"content-type":"application/vnd.kde.karbon","friendly":{"en":"KDE KOffice Office Suite - Karbon"},"encoding":"base64","extensions":["karbon"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.karbon"]},"registered":true},{"content-type":"application/vnd.kde.kchart","friendly":{"en":"KDE KOffice Office Suite - KChart"},"encoding":"base64","extensions":["chrt"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kchart"]},"registered":true},{"content-type":"application/vnd.kde.kformula","friendly":{"en":"KDE KOffice Office Suite - Kformula"},"encoding":"base64","extensions":["kfo"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kformula"]},"registered":true},{"content-type":"application/vnd.kde.kivio","friendly":{"en":"KDE KOffice Office Suite - Kivio"},"encoding":"base64","extensions":["flw"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kivio"]},"registered":true},{"content-type":"application/vnd.kde.kontour","friendly":{"en":"KDE KOffice Office Suite - Kontour"},"encoding":"base64","extensions":["kon"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kontour"]},"registered":true},{"content-type":"application/vnd.kde.kpresenter","friendly":{"en":"KDE KOffice Office Suite - Kpresenter"},"encoding":"base64","extensions":["kpr","kpt"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kpresenter"]},"registered":true},{"content-type":"application/vnd.kde.kspread","friendly":{"en":"KDE KOffice Office Suite - Kspread"},"encoding":"base64","extensions":["ksp"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kspread"]},"registered":true},{"content-type":"application/vnd.kde.kword","friendly":{"en":"KDE KOffice Office Suite - Kword"},"encoding":"base64","extensions":["kwd","kwt"],"xrefs":{"person":["David_Faure"],"template":["application/vnd.kde.kword"]},"registered":true},{"content-type":"application/vnd.kenameaapp","friendly":{"en":"Kenamea App"},"encoding":"base64","extensions":["htke"],"xrefs":{"person":["Dirk_DiGiorgio-Haag"],"template":["application/vnd.kenameaapp"]},"registered":true},{"content-type":"application/vnd.kidspiration","friendly":{"en":"Kidspiration"},"encoding":"base64","extensions":["kia"],"xrefs":{"person":["Jack_Bennett"],"template":["application/vnd.kidspiration"]},"registered":true},{"content-type":"application/vnd.Kinar","friendly":{"en":"Kinar Applications"},"encoding":"base64","extensions":["kne","knp","sdf"],"xrefs":{"person":["Hemant_Thakkar"],"template":["application/vnd.Kinar"]},"registered":true},{"content-type":"application/vnd.koan","friendly":{"en":"SSEYO Koan Play File"},"encoding":"base64","extensions":["skd","skm","skp","skt"],"xrefs":{"person":["Pete_Cole"],"template":["application/vnd.koan"]},"registered":true},{"content-type":"application/vnd.kodak-descriptor","friendly":{"en":"Kodak Storyshare"},"encoding":"base64","extensions":["sse"],"xrefs":{"person":["Michael_J._Donahue"],"template":["application/vnd.kodak-descriptor"]},"registered":true},{"content-type":"application/vnd.las","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/vnd.las"]},"registered":true},{"content-type":"application/vnd.las.las+json","encoding":"base64","xrefs":{"person":["Rob_Bailey"],"template":["application/vnd.las.las+json"]},"registered":true},{"content-type":"application/vnd.las.las+xml","friendly":{"en":"Laser App Enterprise"},"encoding":"base64","extensions":["lasxml"],"xrefs":{"person":["Rob_Bailey"],"template":["application/vnd.las.las+xml"]},"registered":true},{"content-type":"application/vnd.laszip","encoding":"base64","xrefs":{"person":["Bryan_Blank","NCGIS"],"template":["application/vnd.laszip"]},"registered":true},{"content-type":"application/vnd.leap+json","encoding":"base64","xrefs":{"person":["Mark_C_Fralick"],"template":["application/vnd.leap+json"]},"registered":true},{"content-type":"application/vnd.liberty-request+xml","encoding":"base64","xrefs":{"person":["Brett_McDowell"],"template":["application/vnd.liberty-request+xml"]},"registered":true},{"content-type":"application/vnd.llamagraphics.life-balance.desktop","friendly":{"en":"Life Balance - Desktop Edition"},"encoding":"base64","extensions":["lbd"],"xrefs":{"person":["Catherine_E._White"],"template":["application/vnd.llamagraphics.life-balance.desktop"]},"registered":true},{"content-type":"application/vnd.llamagraphics.life-balance.exchange+xml","friendly":{"en":"Life Balance - Exchange Format"},"encoding":"base64","extensions":["lbe"],"xrefs":{"person":["Catherine_E._White"],"template":["application/vnd.llamagraphics.life-balance.exchange+xml"]},"registered":true},{"content-type":"application/vnd.logipipe.circuit+zip","encoding":"base64","xrefs":{"person":["Victor_Kuchynsky"],"template":["application/vnd.logipipe.circuit+zip"]},"registered":true},{"content-type":"application/vnd.loom","encoding":"base64","xrefs":{"person":["Sten_Linnarsson"],"template":["application/vnd.loom"]},"registered":true},{"content-type":"application/vnd.lotus-1-2-3","friendly":{"en":"Lotus 1-2-3"},"encoding":"base64","extensions":["wks","123"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-1-2-3"]},"registered":true},{"content-type":"application/vnd.lotus-approach","friendly":{"en":"Lotus Approach"},"encoding":"base64","extensions":["apr"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-approach"]},"registered":true},{"content-type":"application/vnd.lotus-freelance","friendly":{"en":"Lotus Freelance"},"encoding":"base64","extensions":["pre"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-freelance"]},"registered":true},{"content-type":"application/vnd.lotus-notes","friendly":{"en":"Lotus Notes"},"encoding":"base64","extensions":["nsf"],"xrefs":{"person":["Michael_Laramie"],"template":["application/vnd.lotus-notes"]},"registered":true},{"content-type":"application/vnd.lotus-organizer","friendly":{"en":"Lotus Organizer"},"encoding":"base64","extensions":["org"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-organizer"]},"registered":true},{"content-type":"application/vnd.lotus-screencam","friendly":{"en":"Lotus Screencam"},"encoding":"base64","extensions":["scm"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-screencam"]},"registered":true},{"content-type":"application/vnd.lotus-wordpro","friendly":{"en":"Lotus Wordpro"},"encoding":"base64","extensions":["lwp"],"xrefs":{"person":["Paul_Wattenberger"],"template":["application/vnd.lotus-wordpro"]},"registered":true},{"content-type":"application/vnd.macports.portpkg","friendly":{"en":"MacPorts Port System"},"encoding":"base64","extensions":["portpkg"],"xrefs":{"person":["James_Berry"],"template":["application/vnd.macports.portpkg"]},"registered":true},{"content-type":"application/vnd.mapbox-vector-tile","encoding":"base64","xrefs":{"person":["Blake_Thompson"],"template":["application/vnd.mapbox-vector-tile"]},"registered":true},{"content-type":"application/vnd.marlin.drm.actiontoken+xml","encoding":"base64","xrefs":{"person":["Gary_Ellison"],"template":["application/vnd.marlin.drm.actiontoken+xml"]},"registered":true},{"content-type":"application/vnd.marlin.drm.conftoken+xml","encoding":"base64","xrefs":{"person":["Gary_Ellison"],"template":["application/vnd.marlin.drm.conftoken+xml"]},"registered":true},{"content-type":"application/vnd.marlin.drm.license+xml","encoding":"base64","xrefs":{"person":["Gary_Ellison"],"template":["application/vnd.marlin.drm.license+xml"]},"registered":true},{"content-type":"application/vnd.marlin.drm.mdcf","encoding":"base64","xrefs":{"person":["Gary_Ellison"],"template":["application/vnd.marlin.drm.mdcf"]},"registered":true},{"content-type":"application/vnd.mason+json","encoding":"base64","xrefs":{"person":["Jorn_Wildt"],"template":["application/vnd.mason+json"]},"registered":true},{"content-type":"application/vnd.maxmind.maxmind-db","encoding":"base64","xrefs":{"person":["William_Stevenson"],"template":["application/vnd.maxmind.maxmind-db"]},"registered":true},{"content-type":"application/vnd.mcd","friendly":{"en":"Micro CADAM Helix D&D"},"encoding":"base64","extensions":["mcd"],"xrefs":{"person":["Tadashi_Gotoh"],"template":["application/vnd.mcd"]},"registered":true},{"content-type":"application/vnd.medcalcdata","friendly":{"en":"MedCalc"},"encoding":"base64","extensions":["mc1"],"xrefs":{"person":["Frank_Schoonjans"],"template":["application/vnd.medcalcdata"]},"registered":true},{"content-type":"application/vnd.mediastation.cdkey","friendly":{"en":"MediaRemote"},"encoding":"base64","extensions":["cdkey"],"xrefs":{"person":["Henry_Flurry"],"template":["application/vnd.mediastation.cdkey"]},"registered":true},{"content-type":"application/vnd.meridian-slingshot","encoding":"base64","xrefs":{"person":["Eric_Wedel"],"template":["application/vnd.meridian-slingshot"]},"registered":true},{"content-type":"application/vnd.MFER","friendly":{"en":"Medical Waveform Encoding Format"},"encoding":"base64","extensions":["mwf"],"xrefs":{"person":["Masaaki_Hirai"],"template":["application/vnd.MFER"]},"registered":true},{"content-type":"application/vnd.mfmp","friendly":{"en":"Melody Format for Mobile Platform"},"encoding":"base64","extensions":["mfm"],"xrefs":{"person":["Yukari_Ikeda"],"template":["application/vnd.mfmp"]},"registered":true},{"content-type":"application/vnd.micro+json","encoding":"base64","xrefs":{"person":["Dali_Zheng"],"template":["application/vnd.micro+json"]},"registered":true},{"content-type":"application/vnd.micrografx.flo","friendly":{"en":"Micrografx"},"encoding":"base64","extensions":["flo"],"xrefs":{"person":["Joe_Prevo"],"template":["application/vnd.micrografx.flo"]},"registered":true},{"content-type":"application/vnd.micrografx.igx","friendly":{"en":"Micrografx iGrafx Professional"},"encoding":"base64","extensions":["igx"],"xrefs":{"person":["Joe_Prevo"],"template":["application/vnd.micrografx.igx"]},"registered":true},{"content-type":"application/vnd.microsoft.portable-executable","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.microsoft.portable-executable"]},"registered":true},{"content-type":"application/vnd.microsoft.windows.thumbnail-cache","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.microsoft.windows.thumbnail-cache"]},"registered":true},{"content-type":"application/vnd.miele+json","encoding":"base64","xrefs":{"person":["Nils_Langhammer"],"template":["application/vnd.miele+json"]},"registered":true},{"content-type":"application/vnd.mif","friendly":{"en":"FrameMaker Interchange Format"},"encoding":"base64","extensions":["mif"],"xrefs":{"person":["Mike_Wexler"],"template":["application/vnd.mif"]},"registered":true},{"content-type":"application/vnd.minisoft-hp3000-save","encoding":"base64","xrefs":{"person":["Chris_Bartram"],"template":["application/vnd.minisoft-hp3000-save"]},"registered":true},{"content-type":"application/vnd.mitsubishi.misty-guard.trustweb","encoding":"base64","xrefs":{"person":["Tanaka"],"template":["application/vnd.mitsubishi.misty-guard.trustweb"]},"registered":true},{"content-type":"application/vnd.Mobius.DAF","friendly":{"en":"Mobius Management Systems - UniversalArchive"},"encoding":"base64","extensions":["daf"],"xrefs":{"person":["Allen_K._Kabayama"],"template":["application/vnd.Mobius.DAF"]},"registered":true},{"content-type":"application/vnd.Mobius.DIS","friendly":{"en":"Mobius Management Systems - Distribution Database"},"encoding":"base64","extensions":["dis"],"xrefs":{"person":["Allen_K._Kabayama"],"template":["application/vnd.Mobius.DIS"]},"registered":true},{"content-type":"application/vnd.Mobius.MBK","friendly":{"en":"Mobius Management Systems - Basket file"},"encoding":"base64","extensions":["mbk"],"xrefs":{"person":["Alex_Devasia"],"template":["application/vnd.Mobius.MBK"]},"registered":true},{"content-type":"application/vnd.Mobius.MQY","friendly":{"en":"Mobius Management Systems - Query File"},"encoding":"base64","extensions":["mqy"],"xrefs":{"person":["Alex_Devasia"],"template":["application/vnd.Mobius.MQY"]},"registered":true},{"content-type":"application/vnd.Mobius.MSL","friendly":{"en":"Mobius Management Systems - Script Language"},"encoding":"base64","extensions":["msl"],"xrefs":{"person":["Allen_K._Kabayama"],"template":["application/vnd.Mobius.MSL"]},"registered":true},{"content-type":"application/vnd.Mobius.PLC","friendly":{"en":"Mobius Management Systems - Policy Definition Language File"},"encoding":"base64","extensions":["plc"],"xrefs":{"person":["Allen_K._Kabayama"],"template":["application/vnd.Mobius.PLC"]},"registered":true},{"content-type":"application/vnd.Mobius.TXF","friendly":{"en":"Mobius Management Systems - Topic Index File"},"encoding":"base64","extensions":["txf"],"xrefs":{"person":["Allen_K._Kabayama"],"template":["application/vnd.Mobius.TXF"]},"registered":true},{"content-type":"application/vnd.mophun.application","friendly":{"en":"Mophun VM"},"encoding":"base64","extensions":["mpn"],"xrefs":{"person":["Bjorn_Wennerstrom"],"template":["application/vnd.mophun.application"]},"registered":true},{"content-type":"application/vnd.mophun.certificate","friendly":{"en":"Mophun Certificate"},"encoding":"base64","extensions":["mpc"],"xrefs":{"person":["Bjorn_Wennerstrom"],"template":["application/vnd.mophun.certificate"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.adsi","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.adsi"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.fis","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.fis"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.gotap","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.gotap"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.kmr","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.kmr"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.ttc","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.ttc"]},"registered":true},{"content-type":"application/vnd.motorola.flexsuite.wem","encoding":"base64","xrefs":{"person":["Mark_Patton"],"template":["application/vnd.motorola.flexsuite.wem"]},"registered":true},{"content-type":"application/vnd.motorola.iprm","encoding":"base64","xrefs":{"person":["Rafie_Shamsaasef"],"template":["application/vnd.motorola.iprm"]},"registered":true},{"content-type":"application/vnd.mozilla.xul+xml","friendly":{"en":"XUL - XML User Interface Language"},"encoding":"base64","extensions":["xul"],"xrefs":{"person":["Braden_N_McDaniel"],"template":["application/vnd.mozilla.xul+xml"]},"registered":true},{"content-type":"application/vnd.ms-3mfdocument","encoding":"base64","xrefs":{"person":["Shawn_Maloney"],"template":["application/vnd.ms-3mfdocument"]},"registered":true},{"content-type":"application/vnd.ms-artgalry","friendly":{"en":"Microsoft Artgalry"},"encoding":"base64","extensions":["cil"],"xrefs":{"person":["Dean_Slawson"],"template":["application/vnd.ms-artgalry"]},"registered":true},{"content-type":"application/vnd.ms-asf","encoding":"base64","extensions":["asf"],"xrefs":{"person":["Eric_Fleischman"],"template":["application/vnd.ms-asf"]},"registered":true},{"content-type":"application/vnd.ms-cab-compressed","friendly":{"en":"Microsoft Cabinet File"},"encoding":"base64","extensions":["cab"],"xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.ms-cab-compressed"]},"registered":true},{"content-type":"application/vnd.ms-excel","friendly":{"en":"Microsoft Excel"},"encoding":"base64","extensions":["xls","xlt","xla","xlc","xlm","xlw"],"xrefs":{"person":["Sukvinder_S._Gill"],"template":["application/vnd.ms-excel"]},"registered":true},{"content-type":"application/vnd.ms-excel.addin.macroEnabled.12","friendly":{"en":"Microsoft Excel - Add-In File"},"encoding":"base64","extensions":["xlam"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-excel.addin.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-excel.sheet.binary.macroEnabled.12","friendly":{"en":"Microsoft Excel - Binary Workbook"},"encoding":"base64","extensions":["xlsb"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-excel.sheet.binary.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-excel.sheet.macroEnabled.12","friendly":{"en":"Microsoft Excel - Macro-Enabled Workbook"},"encoding":"base64","extensions":["xlsm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-excel.sheet.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-excel.template.macroEnabled.12","friendly":{"en":"Microsoft Excel - Macro-Enabled Template File"},"encoding":"base64","extensions":["xltm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-excel.template.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-fontobject","friendly":{"en":"Microsoft Embedded OpenType"},"encoding":"base64","extensions":["eot"],"xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.ms-fontobject"]},"registered":true},{"content-type":"application/vnd.ms-htmlhelp","friendly":{"en":"Microsoft Html Help File"},"encoding":"base64","extensions":["chm"],"xrefs":{"person":["Anatoly_Techtonik"],"template":["application/vnd.ms-htmlhelp"]},"registered":true},{"content-type":"application/vnd.ms-ims","friendly":{"en":"Microsoft Class Server"},"encoding":"base64","extensions":["ims"],"xrefs":{"person":["Eric_Ledoux"],"template":["application/vnd.ms-ims"]},"registered":true},{"content-type":"application/vnd.ms-lrm","friendly":{"en":"Microsoft Learning Resource Module"},"encoding":"base64","extensions":["lrm"],"xrefs":{"person":["Eric_Ledoux"],"template":["application/vnd.ms-lrm"]},"registered":true},{"content-type":"application/vnd.ms-office.activeX+xml","encoding":"base64","xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-office.activeX+xml"]},"registered":true},{"content-type":"application/vnd.ms-officetheme","friendly":{"en":"Microsoft Office System Release Theme"},"encoding":"base64","extensions":["thmx"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-officetheme"]},"registered":true},{"content-type":"application/vnd.ms-outlook","encoding":"base64","extensions":["msg"],"registered":false},{"content-type":"application/vnd.ms-pki.seccat","friendly":{"en":"Microsoft Trust UI Provider - Security Catalog"},"encoding":"base64","extensions":["cat"],"registered":false},{"content-type":"application/vnd.ms-pki.stl","friendly":{"en":"Microsoft Trust UI Provider - Certificate Trust Link"},"encoding":"base64","extensions":["stl"],"registered":false},{"content-type":"application/vnd.ms-playready.initiator+xml","encoding":"base64","xrefs":{"person":["Daniel_Schneider"],"template":["application/vnd.ms-playready.initiator+xml"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint","friendly":{"en":"Microsoft PowerPoint"},"encoding":"base64","extensions":["ppt","pps","pot"],"xrefs":{"person":["Sukvinder_S._Gill"],"template":["application/vnd.ms-powerpoint"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint.addin.macroEnabled.12","friendly":{"en":"Microsoft PowerPoint - Add-in file"},"encoding":"base64","extensions":["ppam"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-powerpoint.addin.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint.presentation.macroEnabled.12","friendly":{"en":"Microsoft PowerPoint - Macro-Enabled Presentation File"},"encoding":"base64","extensions":["pptm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-powerpoint.presentation.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint.slide.macroEnabled.12","friendly":{"en":"Microsoft PowerPoint - Macro-Enabled Open XML Slide"},"encoding":"base64","extensions":["sldm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-powerpoint.slide.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint.slideshow.macroEnabled.12","friendly":{"en":"Microsoft PowerPoint - Macro-Enabled Slide Show File"},"encoding":"base64","extensions":["ppsm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-powerpoint.template.macroEnabled.12","friendly":{"en":"Micosoft PowerPoint - Macro-Enabled Template File"},"encoding":"base64","extensions":["potm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-powerpoint.template.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-PrintDeviceCapabilities+xml","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-PrintDeviceCapabilities+xml"]},"registered":true},{"content-type":"application/vnd.ms-PrintSchemaTicket+xml","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-PrintSchemaTicket+xml"]},"registered":true},{"content-type":"application/vnd.ms-project","friendly":{"en":"Microsoft Project"},"encoding":"base64","extensions":["mpp","mpt"],"xrefs":{"person":["Sukvinder_S._Gill"],"template":["application/vnd.ms-project"]},"registered":true},{"content-type":"application/vnd.ms-tnef","encoding":"base64","xrefs":{"person":["Sukvinder_S._Gill"],"template":["application/vnd.ms-tnef"]},"registered":true},{"content-type":"application/vnd.ms-windows.devicepairing","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-windows.devicepairing"]},"registered":true},{"content-type":"application/vnd.ms-windows.nwprinting.oob","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-windows.nwprinting.oob"]},"registered":true},{"content-type":"application/vnd.ms-windows.printerpairing","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-windows.printerpairing"]},"registered":true},{"content-type":"application/vnd.ms-windows.wsd.oob","encoding":"base64","xrefs":{"person":["Justin_Hutchings"],"template":["application/vnd.ms-windows.wsd.oob"]},"registered":true},{"content-type":"application/vnd.ms-wmdrm.lic-chlg-req","encoding":"base64","xrefs":{"person":["Kevin_Lau"],"template":["application/vnd.ms-wmdrm.lic-chlg-req"]},"registered":true},{"content-type":"application/vnd.ms-wmdrm.lic-resp","encoding":"base64","xrefs":{"person":["Kevin_Lau"],"template":["application/vnd.ms-wmdrm.lic-resp"]},"registered":true},{"content-type":"application/vnd.ms-wmdrm.meter-chlg-req","encoding":"base64","xrefs":{"person":["Kevin_Lau"],"template":["application/vnd.ms-wmdrm.meter-chlg-req"]},"registered":true},{"content-type":"application/vnd.ms-wmdrm.meter-resp","encoding":"base64","xrefs":{"person":["Kevin_Lau"],"template":["application/vnd.ms-wmdrm.meter-resp"]},"registered":true},{"content-type":"application/vnd.ms-word.document.macroEnabled.12","friendly":{"en":"Micosoft Word - Macro-Enabled Document"},"encoding":"base64","extensions":["docm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-word.document.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-word.template.macroEnabled.12","friendly":{"en":"Micosoft Word - Macro-Enabled Template"},"encoding":"base64","extensions":["dotm"],"xrefs":{"person":["Chris_Rae"],"template":["application/vnd.ms-word.template.macroEnabled.12"]},"registered":true},{"content-type":"application/vnd.ms-works","friendly":{"en":"Microsoft Works"},"encoding":"base64","extensions":["wcm","wdb","wks","wps"],"xrefs":{"person":["Sukvinder_S._Gill"],"template":["application/vnd.ms-works"]},"registered":true},{"content-type":"application/vnd.ms-wpl","friendly":{"en":"Microsoft Windows Media Player Playlist"},"encoding":"base64","extensions":["wpl"],"xrefs":{"person":["Dan_Plastina"],"template":["application/vnd.ms-wpl"]},"registered":true},{"content-type":"application/vnd.ms-xpsdocument","friendly":{"en":"Microsoft XML Paper Specification"},"encoding":"8bit","extensions":["xps"],"xrefs":{"person":["Jesse_McGatha"],"template":["application/vnd.ms-xpsdocument"]},"registered":true},{"content-type":"application/vnd.msa-disk-image","encoding":"base64","xrefs":{"person":["Thomas_Huth"],"template":["application/vnd.msa-disk-image"]},"registered":true},{"content-type":"application/vnd.mseq","friendly":{"en":"3GPP MSEQ File"},"encoding":"base64","extensions":["mseq"],"xrefs":{"person":["Gwenael_Le_Bodic"],"template":["application/vnd.mseq"]},"registered":true},{"content-type":"application/vnd.msign","encoding":"base64","xrefs":{"person":["Malte_Borcherding"],"template":["application/vnd.msign"]},"registered":true},{"content-type":"application/vnd.multiad.creator","encoding":"base64","xrefs":{"person":["Steve_Mills"],"template":["application/vnd.multiad.creator"]},"registered":true},{"content-type":"application/vnd.multiad.creator.cif","encoding":"base64","xrefs":{"person":["Steve_Mills"],"template":["application/vnd.multiad.creator.cif"]},"registered":true},{"content-type":"application/vnd.music-niff","encoding":"base64","xrefs":{"person":["Tim_Butler"],"template":["application/vnd.music-niff"]},"registered":true},{"content-type":"application/vnd.musician","friendly":{"en":"MUsical Score Interpreted Code Invented for the ASCII designation of Notation"},"encoding":"base64","extensions":["mus"],"xrefs":{"person":["Greg_Adams"],"template":["application/vnd.musician"]},"registered":true},{"content-type":"application/vnd.muvee.style","friendly":{"en":"Muvee Automatic Video Editing"},"encoding":"base64","extensions":["msty"],"xrefs":{"person":["Chandrashekhara_Anantharamu"],"template":["application/vnd.muvee.style"]},"registered":true},{"content-type":"application/vnd.mynfc","encoding":"base64","extensions":["taglet"],"xrefs":{"person":["Franck_Lefevre"],"template":["application/vnd.mynfc"]},"registered":true},{"content-type":"application/vnd.nacamar.ybrid+json","encoding":"base64","xrefs":{"person":["Sebastian_A._Weiss"],"template":["application/vnd.nacamar.ybrid+json"]},"registered":true},{"content-type":"application/vnd.ncd.control","encoding":"base64","xrefs":{"person":["Lauri_Tarkkala"],"template":["application/vnd.ncd.control"]},"registered":true},{"content-type":"application/vnd.ncd.reference","encoding":"base64","xrefs":{"person":["Lauri_Tarkkala"],"template":["application/vnd.ncd.reference"]},"registered":true},{"content-type":"application/vnd.nearst.inv+json","encoding":"base64","xrefs":{"person":["Thomas_Schoffelen"],"template":["application/vnd.nearst.inv+json"]},"registered":true},{"content-type":"application/vnd.nebumind.line","encoding":"base64","xrefs":{"person":["Andreas_Molzer"],"template":["application/vnd.nebumind.line"]},"registered":true},{"content-type":"application/vnd.nervana","encoding":"base64","extensions":["ent","entity","req","request","bkm","kcm"],"xrefs":{"person":["Steve_Judkins"],"template":["application/vnd.nervana"]},"registered":true},{"content-type":"application/vnd.netfpx","encoding":"base64","xrefs":{"person":["Andy_Mutz"],"template":["application/vnd.netfpx"]},"registered":true},{"content-type":"application/vnd.neurolanguage.nlu","friendly":{"en":"neuroLanguage"},"encoding":"base64","extensions":["nlu"],"xrefs":{"person":["Dan_DuFeu"],"template":["application/vnd.neurolanguage.nlu"]},"registered":true},{"content-type":"application/vnd.nimn","encoding":"base64","xrefs":{"person":["Amit_Kumar_Gupta"],"template":["application/vnd.nimn"]},"registered":true},{"content-type":"application/vnd.nintendo.nitro.rom","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.nintendo.nitro.rom"]},"registered":true},{"content-type":"application/vnd.nintendo.snes.rom","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.nintendo.snes.rom"]},"registered":true},{"content-type":"application/vnd.nitf","encoding":"base64","extensions":["nitf","ntf"],"xrefs":{"person":["Steve_Rogan"],"template":["application/vnd.nitf"]},"registered":true},{"content-type":"application/vnd.noblenet-directory","friendly":{"en":"NobleNet Directory"},"encoding":"base64","extensions":["nnd"],"xrefs":{"person":["Monty_Solomon"],"template":["application/vnd.noblenet-directory"]},"registered":true},{"content-type":"application/vnd.noblenet-sealer","friendly":{"en":"NobleNet Sealer"},"encoding":"base64","extensions":["nns"],"xrefs":{"person":["Monty_Solomon"],"template":["application/vnd.noblenet-sealer"]},"registered":true},{"content-type":"application/vnd.noblenet-web","friendly":{"en":"NobleNet Web"},"encoding":"base64","extensions":["nnw"],"xrefs":{"person":["Monty_Solomon"],"template":["application/vnd.noblenet-web"]},"registered":true},{"content-type":"application/vnd.nokia.catalogs","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.catalogs"]},"registered":true},{"content-type":"application/vnd.nokia.conml+wbxml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.conml+wbxml"]},"registered":true},{"content-type":"application/vnd.nokia.conml+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.conml+xml"]},"registered":true},{"content-type":"application/vnd.nokia.iptv.config+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.iptv.config+xml"]},"registered":true},{"content-type":"application/vnd.nokia.iSDS-radio-presets","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.iSDS-radio-presets"]},"registered":true},{"content-type":"application/vnd.nokia.landmark+wbxml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.landmark+wbxml"]},"registered":true},{"content-type":"application/vnd.nokia.landmark+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.landmark+xml"]},"registered":true},{"content-type":"application/vnd.nokia.landmarkcollection+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.landmarkcollection+xml"]},"registered":true},{"content-type":"application/vnd.nokia.n-gage.ac+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.n-gage.ac+xml"]},"registered":true},{"content-type":"application/vnd.nokia.n-gage.data","friendly":{"en":"N-Gage Game Data"},"encoding":"base64","extensions":["ngdat"],"xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.n-gage.data"]},"registered":true},{"content-type":"application/vnd.nokia.n-gage.symbian.install","friendly":{"en":"N-Gage Game Installer"},"encoding":"base64","extensions":["n-gage"],"obsolete":true,"xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.n-gage.symbian.install"],"notes":["(OBSOLETE; no replacement given)"]},"registered":true},{"content-type":"application/vnd.nokia.ncd","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.ncd"]},"registered":true},{"content-type":"application/vnd.nokia.ncd+xml","encoding":"base64","obsolete":true,"use-instead":"application/vnd.nokia.ncd","registered":true},{"content-type":"application/vnd.nokia.pcd+wbxml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.pcd+wbxml"]},"registered":true},{"content-type":"application/vnd.nokia.pcd+xml","encoding":"base64","xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.pcd+xml"]},"registered":true},{"content-type":"application/vnd.nokia.radio-preset","friendly":{"en":"Nokia Radio Application - Preset"},"encoding":"base64","extensions":["rpst"],"xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.radio-preset"]},"registered":true},{"content-type":"application/vnd.nokia.radio-presets","friendly":{"en":"Nokia Radio Application - Preset"},"encoding":"base64","extensions":["rpss"],"xrefs":{"person":["Nokia"],"template":["application/vnd.nokia.radio-presets"]},"registered":true},{"content-type":"application/vnd.novadigm.EDM","friendly":{"en":"Novadigm's RADIA and EDM products"},"encoding":"base64","extensions":["edm"],"xrefs":{"person":["Janine_Swenson"],"template":["application/vnd.novadigm.EDM"]},"registered":true},{"content-type":"application/vnd.novadigm.EDX","friendly":{"en":"Novadigm's RADIA and EDM products"},"encoding":"base64","extensions":["edx"],"xrefs":{"person":["Janine_Swenson"],"template":["application/vnd.novadigm.EDX"]},"registered":true},{"content-type":"application/vnd.novadigm.EXT","friendly":{"en":"Novadigm's RADIA and EDM products"},"encoding":"base64","extensions":["ext"],"xrefs":{"person":["Janine_Swenson"],"template":["application/vnd.novadigm.EXT"]},"registered":true},{"content-type":"application/vnd.ntt-local.content-share","encoding":"base64","xrefs":{"person":["Akinori_Taya"],"template":["application/vnd.ntt-local.content-share"]},"registered":true},{"content-type":"application/vnd.ntt-local.file-transfer","encoding":"base64","xrefs":{"person":["NTT-local"],"template":["application/vnd.ntt-local.file-transfer"]},"registered":true},{"content-type":"application/vnd.ntt-local.ogw_remote-access","encoding":"base64","xrefs":{"person":["NTT-local"],"template":["application/vnd.ntt-local.ogw_remote-access"]},"registered":true},{"content-type":"application/vnd.ntt-local.sip-ta_remote","encoding":"base64","xrefs":{"person":["NTT-local"],"template":["application/vnd.ntt-local.sip-ta_remote"]},"registered":true},{"content-type":"application/vnd.ntt-local.sip-ta_tcp_stream","encoding":"base64","xrefs":{"person":["NTT-local"],"template":["application/vnd.ntt-local.sip-ta_tcp_stream"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.chart","friendly":{"en":"OpenDocument Chart"},"encoding":"base64","extensions":["odc"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.chart"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.chart-template","friendly":{"en":"OpenDocument Chart Template"},"encoding":"base64","extensions":["odc","otc"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.chart-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.database","friendly":{"en":"OpenDocument Database"},"encoding":"base64","extensions":["odb"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.database"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.formula","friendly":{"en":"OpenDocument Formula"},"encoding":"base64","extensions":["odf"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.formula"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.formula-template","friendly":{"en":"OpenDocument Formula Template"},"encoding":"base64","extensions":["odf","odft"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.formula-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.graphics","friendly":{"en":"OpenDocument Graphics"},"encoding":"base64","extensions":["odg"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.graphics"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.graphics-template","friendly":{"en":"OpenDocument Graphics Template"},"encoding":"base64","extensions":["otg"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.graphics-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.image","friendly":{"en":"OpenDocument Image"},"encoding":"base64","extensions":["odi"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.image"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.image-template","friendly":{"en":"OpenDocument Image Template"},"encoding":"base64","extensions":["odi","oti"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.image-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.presentation","friendly":{"en":"OpenDocument Presentation"},"encoding":"base64","extensions":["odp"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.presentation"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.presentation-template","friendly":{"en":"OpenDocument Presentation Template"},"encoding":"base64","extensions":["otp"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.presentation-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.spreadsheet","friendly":{"en":"OpenDocument Spreadsheet"},"encoding":"base64","extensions":["ods"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.spreadsheet"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.spreadsheet-template","friendly":{"en":"OpenDocument Spreadsheet Template"},"encoding":"base64","extensions":["ots"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.spreadsheet-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.text","friendly":{"en":"OpenDocument Text"},"encoding":"base64","extensions":["odt"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.text"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.text-master","friendly":{"en":"OpenDocument Text Master"},"encoding":"base64","extensions":["odm"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.text-master"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.text-template","friendly":{"en":"OpenDocument Text Template"},"encoding":"base64","extensions":["ott"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.text-template"]},"registered":true},{"content-type":"application/vnd.oasis.opendocument.text-web","friendly":{"en":"Open Document Text Web"},"encoding":"base64","extensions":["oth"],"xrefs":{"person":["OASIS","Svante_Schubert"],"template":["application/vnd.oasis.opendocument.text-web"]},"registered":true},{"content-type":"application/vnd.obn","encoding":"base64","xrefs":{"person":["Matthias_Hessling"],"template":["application/vnd.obn"]},"registered":true},{"content-type":"application/vnd.ocf+cbor","encoding":"base64","xrefs":{"person":["Michael_Koster"],"template":["application/vnd.ocf+cbor"]},"registered":true},{"content-type":"application/vnd.oci.image.manifest.v1+json","encoding":"base64","xrefs":{"person":["Steven_Lasker"],"template":["application/vnd.oci.image.manifest.v1+json"]},"registered":true},{"content-type":"application/vnd.oftn.l10n+json","encoding":"base64","xrefs":{"person":["Eli_Grey"],"template":["application/vnd.oftn.l10n+json"]},"registered":true},{"content-type":"application/vnd.oipf.contentaccessdownload+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.contentaccessdownload+xml"]},"registered":true},{"content-type":"application/vnd.oipf.contentaccessstreaming+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.contentaccessstreaming+xml"]},"registered":true},{"content-type":"application/vnd.oipf.cspg-hexbinary","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.cspg-hexbinary"]},"registered":true},{"content-type":"application/vnd.oipf.dae.svg+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.dae.svg+xml"]},"registered":true},{"content-type":"application/vnd.oipf.dae.xhtml+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.dae.xhtml+xml"]},"registered":true},{"content-type":"application/vnd.oipf.mippvcontrolmessage+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.mippvcontrolmessage+xml"]},"registered":true},{"content-type":"application/vnd.oipf.pae.gem","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.pae.gem"]},"registered":true},{"content-type":"application/vnd.oipf.spdiscovery+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.spdiscovery+xml"]},"registered":true},{"content-type":"application/vnd.oipf.spdlist+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.spdlist+xml"]},"registered":true},{"content-type":"application/vnd.oipf.ueprofile+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.ueprofile+xml"]},"registered":true},{"content-type":"application/vnd.oipf.userprofile+xml","encoding":"base64","xrefs":{"person":["Claire_DEsclercs"],"template":["application/vnd.oipf.userprofile+xml"]},"registered":true},{"content-type":"application/vnd.olpc-sugar","friendly":{"en":"Sugar Linux Application Bundle"},"encoding":"base64","extensions":["xo"],"xrefs":{"person":["John_Palmieri"],"template":["application/vnd.olpc-sugar"]},"registered":true},{"content-type":"application/vnd.oma-scws-config","encoding":"base64","xrefs":{"person":["Ilan_Mahalal"],"template":["application/vnd.oma-scws-config"]},"registered":true},{"content-type":"application/vnd.oma-scws-http-request","encoding":"base64","xrefs":{"person":["Ilan_Mahalal"],"template":["application/vnd.oma-scws-http-request"]},"registered":true},{"content-type":"application/vnd.oma-scws-http-response","encoding":"base64","xrefs":{"person":["Ilan_Mahalal"],"template":["application/vnd.oma-scws-http-response"]},"registered":true},{"content-type":"application/vnd.oma.bcast.associated-procedure-parameter+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.associated-procedure-parameter+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.drm-trigger+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.drm-trigger+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.imd+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.imd+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.ltkm","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.ltkm"]},"registered":true},{"content-type":"application/vnd.oma.bcast.notification+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.notification+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.provisioningtrigger","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.provisioningtrigger"]},"registered":true},{"content-type":"application/vnd.oma.bcast.sgboot","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.sgboot"]},"registered":true},{"content-type":"application/vnd.oma.bcast.sgdd+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.sgdd+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.sgdu","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.sgdu"]},"registered":true},{"content-type":"application/vnd.oma.bcast.simple-symbol-container","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.simple-symbol-container"]},"registered":true},{"content-type":"application/vnd.oma.bcast.smartcard-trigger+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.smartcard-trigger+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.sprov+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.sprov+xml"]},"registered":true},{"content-type":"application/vnd.oma.bcast.stkm","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.bcast.stkm"]},"registered":true},{"content-type":"application/vnd.oma.cab-address-book+xml","encoding":"base64","xrefs":{"person":["Hao_Wang","OMA"],"template":["application/vnd.oma.cab-address-book+xml"]},"registered":true},{"content-type":"application/vnd.oma.cab-feature-handler+xml","encoding":"base64","xrefs":{"person":["Hao_Wang","OMA"],"template":["application/vnd.oma.cab-feature-handler+xml"]},"registered":true},{"content-type":"application/vnd.oma.cab-pcc+xml","encoding":"base64","xrefs":{"person":["Hao_Wang","OMA"],"template":["application/vnd.oma.cab-pcc+xml"]},"registered":true},{"content-type":"application/vnd.oma.cab-subs-invite+xml","encoding":"base64","xrefs":{"person":["Hao_Wang","OMA"],"template":["application/vnd.oma.cab-subs-invite+xml"]},"registered":true},{"content-type":"application/vnd.oma.cab-user-prefs+xml","encoding":"base64","xrefs":{"person":["Hao_Wang","OMA"],"template":["application/vnd.oma.cab-user-prefs+xml"]},"registered":true},{"content-type":"application/vnd.oma.dcd","encoding":"base64","xrefs":{"person":["Avi_Primo","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.dcd"]},"registered":true},{"content-type":"application/vnd.oma.dcdc","encoding":"base64","xrefs":{"person":["Avi_Primo","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.dcdc"]},"registered":true},{"content-type":"application/vnd.oma.dd2+xml","friendly":{"en":"OMA Download Agents"},"encoding":"base64","extensions":["dd2"],"xrefs":{"person":["Jun_Sato","Open_Mobile_Alliance_BAC_DLDRM_Working_Group"],"template":["application/vnd.oma.dd2+xml"]},"registered":true},{"content-type":"application/vnd.oma.drm.risd+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Uwe_Rauschenbach"],"template":["application/vnd.oma.drm.risd+xml"]},"registered":true},{"content-type":"application/vnd.oma.group-usage-list+xml","encoding":"base64","xrefs":{"person":["OMA_Presence_and_Availability_PAG_Working_Group","Sean_Kelley"],"template":["application/vnd.oma.group-usage-list+xml"]},"registered":true},{"content-type":"application/vnd.oma.lwm2m+cbor","encoding":"base64","xrefs":{"person":["John_Mudge","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.lwm2m+cbor"]},"registered":true},{"content-type":"application/vnd.oma.lwm2m+json","encoding":"base64","xrefs":{"person":["John_Mudge","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.lwm2m+json"]},"registered":true},{"content-type":"application/vnd.oma.lwm2m+tlv","encoding":"base64","xrefs":{"person":["John_Mudge","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.lwm2m+tlv"]},"registered":true},{"content-type":"application/vnd.oma.pal+xml","encoding":"base64","xrefs":{"person":["Brian_McColgan","Open_Mobile_Naming_Authority"],"template":["application/vnd.oma.pal+xml"]},"registered":true},{"content-type":"application/vnd.oma.poc.detailed-progress-report+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group"],"template":["application/vnd.oma.poc.detailed-progress-report+xml"]},"registered":true},{"content-type":"application/vnd.oma.poc.final-report+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group"],"template":["application/vnd.oma.poc.final-report+xml"]},"registered":true},{"content-type":"application/vnd.oma.poc.groups+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group","Sean_Kelley"],"template":["application/vnd.oma.poc.groups+xml"]},"registered":true},{"content-type":"application/vnd.oma.poc.invocation-descriptor+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group"],"template":["application/vnd.oma.poc.invocation-descriptor+xml"]},"registered":true},{"content-type":"application/vnd.oma.poc.optimized-progress-report+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group"],"template":["application/vnd.oma.poc.optimized-progress-report+xml"]},"registered":true},{"content-type":"application/vnd.oma.push","encoding":"base64","xrefs":{"person":["Bryan_Sullivan","OMA"],"template":["application/vnd.oma.push"]},"registered":true},{"content-type":"application/vnd.oma.scidm.messages+xml","encoding":"base64","xrefs":{"person":["Open_Mobile_Naming_Authority","Wenjun_Zeng"],"template":["application/vnd.oma.scidm.messages+xml"]},"registered":true},{"content-type":"application/vnd.oma.xcap-directory+xml","encoding":"base64","xrefs":{"person":["OMA_Presence_and_Availability_PAG_Working_Group","Sean_Kelley"],"template":["application/vnd.oma.xcap-directory+xml"]},"registered":true},{"content-type":"application/vnd.omads-email+xml","encoding":"base64","xrefs":{"person":["OMA_Data_Synchronization_Working_Group"],"template":["application/vnd.omads-email+xml"]},"registered":true},{"content-type":"application/vnd.omads-file+xml","encoding":"base64","xrefs":{"person":["OMA_Data_Synchronization_Working_Group"],"template":["application/vnd.omads-file+xml"]},"registered":true},{"content-type":"application/vnd.omads-folder+xml","encoding":"base64","xrefs":{"person":["OMA_Data_Synchronization_Working_Group"],"template":["application/vnd.omads-folder+xml"]},"registered":true},{"content-type":"application/vnd.omaloc-supl-init","encoding":"base64","xrefs":{"person":["Julien_Grange"],"template":["application/vnd.omaloc-supl-init"]},"registered":true},{"content-type":"application/vnd.onepager","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepager"]},"registered":true},{"content-type":"application/vnd.onepagertamp","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepagertamp"]},"registered":true},{"content-type":"application/vnd.onepagertamx","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepagertamx"]},"registered":true},{"content-type":"application/vnd.onepagertat","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepagertat"]},"registered":true},{"content-type":"application/vnd.onepagertatp","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepagertatp"]},"registered":true},{"content-type":"application/vnd.onepagertatx","encoding":"base64","xrefs":{"person":["Nathan_Black"],"template":["application/vnd.onepagertatx"]},"registered":true},{"content-type":"application/vnd.openblox.game+xml","encoding":"base64","xrefs":{"person":["Mark_Otaris"],"template":["application/vnd.openblox.game+xml"]},"registered":true},{"content-type":"application/vnd.openblox.game-binary","encoding":"base64","xrefs":{"person":["Mark_Otaris"],"template":["application/vnd.openblox.game-binary"]},"registered":true},{"content-type":"application/vnd.openeye.oeb","encoding":"base64","xrefs":{"person":["Craig_Bruce"],"template":["application/vnd.openeye.oeb"]},"registered":true},{"content-type":"application/vnd.openofficeorg.extension","friendly":{"en":"Open Office Extension"},"encoding":"base64","extensions":["oxt"],"registered":true},{"content-type":"application/vnd.openstreetmap.data+xml","encoding":"base64","xrefs":{"person":["Paul_Norman"],"template":["application/vnd.openstreetmap.data+xml"]},"registered":true},{"content-type":"application/vnd.opentimestamps.ots","encoding":"base64","xrefs":{"person":["Peter_Todd"],"template":["application/vnd.opentimestamps.ots"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.custom-properties+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.custom-properties+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.customXmlProperties+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.customXmlProperties+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawing+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawing+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.chart+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.chart+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.extended-properties+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.extended-properties+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.comments+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.comments+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.presentation","friendly":{"en":"Microsoft Office - OOXML - Presentation"},"encoding":"base64","extensions":["pptx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.presentation"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slide","friendly":{"en":"Microsoft Office - OOXML - Presentation (Slide)"},"encoding":"base64","extensions":["sldx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slide"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slide+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slide+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slideshow","friendly":{"en":"Microsoft Office - OOXML - Presentation (Slideshow)"},"encoding":"base64","extensions":["ppsx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slideshow"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.tags+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.tags+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.template","friendly":{"en":"Microsoft Office - OOXML - Presentation Template"},"encoding":"base64","extensions":["potx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.template"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.template.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","friendly":{"en":"Microsoft Office - OOXML - Spreadsheet"},"encoding":"base64","extensions":["xlsx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.template","friendly":{"en":"Microsoft Office - OOXML - Spreadsheet Teplate"},"encoding":"base64","extensions":["xltx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.template"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.theme+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.theme+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.themeOverride+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.themeOverride+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.vmlDrawing","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.vmlDrawing"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","friendly":{"en":"Microsoft Office - OOXML - Word Document"},"encoding":"base64","extensions":["docx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.template","friendly":{"en":"Microsoft Office - OOXML - Word Document Template"},"encoding":"base64","extensions":["dotx"],"xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.template"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-package.core-properties+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-package.core-properties+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml"]},"registered":true},{"content-type":"application/vnd.openxmlformats-package.relationships+xml","encoding":"base64","xrefs":{"person":["Makoto_Murata"],"template":["application/vnd.openxmlformats-package.relationships+xml"]},"registered":true},{"content-type":"application/vnd.oracle.resource+json","encoding":"base64","xrefs":{"person":["Ning_Dong"],"template":["application/vnd.oracle.resource+json"]},"registered":true},{"content-type":"application/vnd.orange.indata","encoding":"base64","xrefs":{"person":["CHATRAS_Bruno"],"template":["application/vnd.orange.indata"]},"registered":true},{"content-type":"application/vnd.osa.netdeploy","encoding":"base64","xrefs":{"person":["Steven_Klos"],"template":["application/vnd.osa.netdeploy"]},"registered":true},{"content-type":"application/vnd.osgeo.mapguide.package","friendly":{"en":"MapGuide DBXML"},"encoding":"base64","extensions":["mgp"],"xrefs":{"person":["Jason_Birch"],"template":["application/vnd.osgeo.mapguide.package"]},"registered":true},{"content-type":"application/vnd.osgi.bundle","encoding":"base64","xrefs":{"person":["Peter_Kriens"],"template":["application/vnd.osgi.bundle"]},"registered":true},{"content-type":"application/vnd.osgi.dp","friendly":{"en":"OSGi Deployment Package"},"encoding":"base64","extensions":["dp"],"xrefs":{"person":["Peter_Kriens"],"template":["application/vnd.osgi.dp"]},"registered":true},{"content-type":"application/vnd.osgi.subsystem","encoding":"base64","extensions":["esa"],"xrefs":{"person":["Peter_Kriens"],"template":["application/vnd.osgi.subsystem"]},"registered":true},{"content-type":"application/vnd.otps.ct-kip+xml","encoding":"base64","xrefs":{"person":["Magnus_Nystrom"],"template":["application/vnd.otps.ct-kip+xml"]},"registered":true},{"content-type":"application/vnd.oxli.countgraph","encoding":"base64","xrefs":{"person":["C._Titus_Brown"],"template":["application/vnd.oxli.countgraph"]},"registered":true},{"content-type":"application/vnd.pagerduty+json","encoding":"base64","xrefs":{"person":["Steve_Rice"],"template":["application/vnd.pagerduty+json"]},"registered":true},{"content-type":"application/vnd.palm","friendly":{"en":"PalmOS Data"},"encoding":"base64","extensions":["prc","pdb","pqa","oprc"],"xrefs":{"person":["Gavin_Peacock"],"template":["application/vnd.palm"]},"registered":true},{"content-type":"application/vnd.panoply","encoding":"base64","xrefs":{"person":["Natarajan_Balasundara"],"template":["application/vnd.panoply"]},"registered":true},{"content-type":"application/vnd.paos.xml","encoding":"base64","xrefs":{"person":["John_Kemp"],"template":["application/vnd.paos.xml"]},"registered":true},{"content-type":"application/vnd.patentdive","encoding":"base64","xrefs":{"person":["Christian_Trosclair"],"template":["application/vnd.patentdive"]},"registered":true},{"content-type":"application/vnd.patientecommsdoc","encoding":"base64","xrefs":{"person":["Andrew_David_Kendall"],"template":["application/vnd.patientecommsdoc"]},"registered":true},{"content-type":"application/vnd.pawaafile","friendly":{"en":"PawaaFILE"},"encoding":"base64","extensions":["paw"],"xrefs":{"person":["Prakash_Baskaran"],"template":["application/vnd.pawaafile"]},"registered":true},{"content-type":"application/vnd.pcos","encoding":"base64","xrefs":{"person":["Slawomir_Lisznianski"],"template":["application/vnd.pcos"]},"registered":true},{"content-type":"application/vnd.pg.format","friendly":{"en":"Proprietary P&G Standard Reporting System"},"encoding":"base64","extensions":["str"],"xrefs":{"person":["April_Gandert"],"template":["application/vnd.pg.format"]},"registered":true},{"content-type":"application/vnd.pg.osasli","friendly":{"en":"Proprietary P&G Standard Reporting System"},"encoding":"base64","extensions":["ei6"],"xrefs":{"person":["April_Gandert"],"template":["application/vnd.pg.osasli"]},"registered":true},{"content-type":"application/vnd.piaccess.application-licence","encoding":"base64","xrefs":{"person":["Lucas_Maneos"],"template":["application/vnd.piaccess.application-licence"]},"registered":true},{"content-type":"application/vnd.picsel","friendly":{"en":"Pcsel eFIF File"},"encoding":"base64","extensions":["efif"],"xrefs":{"person":["Giuseppe_Naccarato"],"template":["application/vnd.picsel"]},"registered":true},{"content-type":"application/vnd.pmi.widget","friendly":{"en":"Qualcomm's Plaza Mobile Internet"},"encoding":"base64","extensions":["wg"],"xrefs":{"person":["Rhys_Lewis"],"template":["application/vnd.pmi.widget"]},"registered":true},{"content-type":"application/vnd.poc.group-advertisement+xml","encoding":"base64","xrefs":{"person":["OMA_Push_to_Talk_over_Cellular_POC_Working_Group","Sean_Kelley"],"template":["application/vnd.poc.group-advertisement+xml"]},"registered":true},{"content-type":"application/vnd.pocketlearn","friendly":{"en":"PocketLearn Viewers"},"encoding":"base64","extensions":["plf"],"xrefs":{"person":["Jorge_Pando"],"template":["application/vnd.pocketlearn"]},"registered":true},{"content-type":"application/vnd.powerbuilder6","friendly":{"en":"PowerBuilder"},"encoding":"base64","extensions":["pbd"],"xrefs":{"person":["David_Guy"],"template":["application/vnd.powerbuilder6"]},"registered":true},{"content-type":"application/vnd.powerbuilder6-s","encoding":"base64","xrefs":{"person":["David_Guy"],"template":["application/vnd.powerbuilder6-s"]},"registered":true},{"content-type":"application/vnd.powerbuilder7","encoding":"base64","xrefs":{"person":["Reed_Shilts"],"template":["application/vnd.powerbuilder7"]},"registered":true},{"content-type":"application/vnd.powerbuilder7-s","encoding":"base64","xrefs":{"person":["Reed_Shilts"],"template":["application/vnd.powerbuilder7-s"]},"registered":true},{"content-type":"application/vnd.powerbuilder75","encoding":"base64","xrefs":{"person":["Reed_Shilts"],"template":["application/vnd.powerbuilder75"]},"registered":true},{"content-type":"application/vnd.powerbuilder75-s","encoding":"base64","xrefs":{"person":["Reed_Shilts"],"template":["application/vnd.powerbuilder75-s"]},"registered":true},{"content-type":"application/vnd.preminet","encoding":"base64","xrefs":{"person":["Juoko_Tenhunen"],"template":["application/vnd.preminet"]},"registered":true},{"content-type":"application/vnd.previewsystems.box","friendly":{"en":"Preview Systems ZipLock/VBox"},"encoding":"base64","extensions":["box"],"xrefs":{"person":["Roman_Smolgovsky"],"template":["application/vnd.previewsystems.box"]},"registered":true},{"content-type":"application/vnd.proteus.magazine","friendly":{"en":"EFI Proteus"},"encoding":"base64","extensions":["mgz"],"xrefs":{"person":["Pete_Hoch"],"template":["application/vnd.proteus.magazine"]},"registered":true},{"content-type":"application/vnd.psfs","encoding":"base64","xrefs":{"person":["Kristopher_Durski"],"template":["application/vnd.psfs"]},"registered":true},{"content-type":"application/vnd.publishare-delta-tree","friendly":{"en":"PubliShare Objects"},"encoding":"base64","extensions":["qps"],"xrefs":{"person":["Oren_Ben-Kiki"],"template":["application/vnd.publishare-delta-tree"]},"registered":true},{"content-type":"application/vnd.pvi.ptid1","friendly":{"en":"Princeton Video Image"},"encoding":"base64","extensions":["pti","ptid"],"xrefs":{"person":["Charles_P._Lamb"],"template":["application/vnd.pvi.ptid1"]},"registered":true},{"content-type":"application/vnd.pwg-multiplexed","encoding":"base64","xrefs":{"rfc":["rfc3391"],"template":["application/vnd.pwg-multiplexed"]},"registered":true},{"content-type":"application/vnd.pwg-xhtml-print+xml","encoding":"base64","xrefs":{"person":["Don_Wright"],"template":["application/vnd.pwg-xhtml-print+xml"]},"registered":true},{"content-type":"application/vnd.qualcomm.brew-app-res","encoding":"base64","xrefs":{"person":["Glenn_Forrester"],"template":["application/vnd.qualcomm.brew-app-res"]},"registered":true},{"content-type":"application/vnd.quarantainenet","encoding":"base64","xrefs":{"person":["Casper_Joost_Eyckelhof"],"template":["application/vnd.quarantainenet"]},"registered":true},{"content-type":"application/vnd.Quark.QuarkXPress","friendly":{"en":"QuarkXPress"},"encoding":"8bit","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"],"xrefs":{"person":["Hannes_Scheidler"],"template":["application/vnd.Quark.QuarkXPress"]},"registered":true},{"content-type":"application/vnd.quobject-quoxdocument","encoding":"base64","xrefs":{"person":["Matthias_Ludwig"],"template":["application/vnd.quobject-quoxdocument"]},"registered":true},{"content-type":"application/vnd.radisys.moml+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.moml+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-audit+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-audit+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-audit-conf+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-audit-conf+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-audit-conn+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-audit-conn+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-audit-dialog+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-audit-dialog+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-audit-stream+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-audit-stream+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-conf+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-conf+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-base+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-base+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-fax-detect+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-fax-detect+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-fax-sendrecv+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-fax-sendrecv+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-group+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-group+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-speech+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-speech+xml"]},"registered":true},{"content-type":"application/vnd.radisys.msml-dialog-transform+xml","encoding":"base64","xrefs":{"rfc":["rfc5707"],"template":["application/vnd.radisys.msml-dialog-transform+xml"]},"registered":true},{"content-type":"application/vnd.rainstor.data","encoding":"base64","xrefs":{"person":["Kevin_Crook"],"template":["application/vnd.rainstor.data"]},"registered":true},{"content-type":"application/vnd.rapid","encoding":"base64","xrefs":{"person":["Etay_Szekely"],"template":["application/vnd.rapid"]},"registered":true},{"content-type":"application/vnd.rar","encoding":"base64","xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.rar"]},"registered":true},{"content-type":"application/vnd.realvnc.bed","friendly":{"en":"RealVNC"},"encoding":"base64","extensions":["bed"],"xrefs":{"person":["Nick_Reeves"],"template":["application/vnd.realvnc.bed"]},"registered":true},{"content-type":"application/vnd.recordare.musicxml","friendly":{"en":"Recordare Applications"},"encoding":"base64","extensions":["mxl"],"xrefs":{"person":["W3C_Music_Notation_Community_Group"],"template":["application/vnd.recordare.musicxml"]},"registered":true},{"content-type":"application/vnd.recordare.musicxml+xml","friendly":{"en":"Recordare Applications"},"encoding":"base64","extensions":["musicxml"],"xrefs":{"person":["W3C_Music_Notation_Community_Group"],"template":["application/vnd.recordare.musicxml+xml"]},"registered":true},{"content-type":"application/vnd.RenLearn.rlprint","encoding":"base64","xrefs":{"person":["James_Wick"],"template":["application/vnd.RenLearn.rlprint"]},"registered":true},{"content-type":"application/vnd.resilient.logic","encoding":"base64","xrefs":{"person":["Benedikt_Muessig"],"template":["application/vnd.resilient.logic"]},"registered":true},{"content-type":"application/vnd.restful+json","encoding":"base64","xrefs":{"person":["Stephen_Mizell"],"template":["application/vnd.restful+json"]},"registered":true},{"content-type":"application/vnd.rig.cryptonote","friendly":{"en":"CryptoNote"},"encoding":"base64","extensions":["cryptonote"],"xrefs":{"person":["Ken_Jibiki"],"template":["application/vnd.rig.cryptonote"]},"registered":true},{"content-type":"application/vnd.rim.cod","friendly":{"en":"Blackberry COD File"},"encoding":"base64","extensions":["cod"],"registered":false},{"content-type":"application/vnd.rn-realmedia","friendly":{"en":"RealMedia"},"encoding":"base64","extensions":["rm"],"registered":false},{"content-type":"application/vnd.rn-realmedia-vbr","encoding":"base64","extensions":["rmvb"],"registered":false},{"content-type":"application/vnd.route66.link66+xml","friendly":{"en":"ROUTE 66 Location Based Services"},"encoding":"base64","extensions":["link66"],"xrefs":{"person":["Sybren_Kikstra"],"template":["application/vnd.route66.link66+xml"]},"registered":true},{"content-type":"application/vnd.rs-274x","encoding":"base64","xrefs":{"person":["Lee_Harding"],"template":["application/vnd.rs-274x"]},"registered":true},{"content-type":"application/vnd.ruckus.download","encoding":"base64","xrefs":{"person":["Jerry_Harris"],"template":["application/vnd.ruckus.download"]},"registered":true},{"content-type":"application/vnd.s3sms","encoding":"base64","xrefs":{"person":["Lauri_Tarkkala"],"template":["application/vnd.s3sms"]},"registered":true},{"content-type":"application/vnd.sailingtracker.track","friendly":{"en":"SailingTracker"},"encoding":"base64","extensions":["st"],"xrefs":{"person":["Heikki_Vesalainen"],"template":["application/vnd.sailingtracker.track"]},"registered":true},{"content-type":"application/vnd.sar","encoding":"base64","xrefs":{"person":["Markus_Strehle"],"template":["application/vnd.sar"]},"registered":true},{"content-type":"application/vnd.sbm.cid","encoding":"base64","xrefs":{"person":["Shinji_Kusakari"],"template":["application/vnd.sbm.cid"]},"registered":true},{"content-type":"application/vnd.sbm.mid2","encoding":"base64","xrefs":{"person":["Masanori_Murai"],"template":["application/vnd.sbm.mid2"]},"registered":true},{"content-type":"application/vnd.scribus","encoding":"base64","xrefs":{"person":["Craig_Bradney"],"template":["application/vnd.scribus"]},"registered":true},{"content-type":"application/vnd.sealed.3df","encoding":"base64","xrefs":{"person":["John_Kwan"],"template":["application/vnd.sealed.3df"]},"registered":true},{"content-type":"application/vnd.sealed.csf","encoding":"base64","xrefs":{"person":["John_Kwan"],"template":["application/vnd.sealed.csf"]},"registered":true},{"content-type":"application/vnd.sealed.doc","encoding":"base64","extensions":["sdoc","sdo","s1w"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealed.doc"]},"registered":true},{"content-type":"application/vnd.sealed.eml","encoding":"base64","extensions":["seml","sem"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealed.eml"]},"registered":true},{"content-type":"application/vnd.sealed.mht","encoding":"base64","extensions":["smht","smh"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealed.mht"]},"registered":true},{"content-type":"application/vnd.sealed.net","encoding":"base64","xrefs":{"person":["Martin_Lambert"],"template":["application/vnd.sealed.net"]},"registered":true},{"content-type":"application/vnd.sealed.ppt","encoding":"base64","extensions":["sppt","spp","s1p"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealed.ppt"]},"registered":true},{"content-type":"application/vnd.sealed.tiff","encoding":"base64","xrefs":{"person":["John_Kwan","Martin_Lambert"],"template":["application/vnd.sealed.tiff"]},"registered":true},{"content-type":"application/vnd.sealed.xls","encoding":"base64","extensions":["sxls","sxl","s1e"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealed.xls"]},"registered":true},{"content-type":"application/vnd.sealedmedia.softseal.html","encoding":"base64","extensions":["stml","stm","s1h"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealedmedia.softseal.html"]},"registered":true},{"content-type":"application/vnd.sealedmedia.softseal.pdf","encoding":"base64","extensions":["spdf","spd","s1a"],"xrefs":{"person":["David_Petersen"],"template":["application/vnd.sealedmedia.softseal.pdf"]},"registered":true},{"content-type":"application/vnd.seemail","friendly":{"en":"SeeMail"},"encoding":"base64","extensions":["see"],"xrefs":{"person":["Steve_Webb"],"template":["application/vnd.seemail"]},"registered":true},{"content-type":"application/vnd.seis+json","encoding":"base64","xrefs":{"person":["ICT_Manager"],"template":["application/vnd.seis+json"]},"registered":true},{"content-type":"application/vnd.sema","friendly":{"en":"Secured eMail"},"encoding":"base64","extensions":["sema"],"xrefs":{"person":["Anders_Hansson"],"template":["application/vnd.sema"]},"registered":true},{"content-type":"application/vnd.semd","friendly":{"en":"Secured eMail"},"encoding":"base64","extensions":["semd"],"xrefs":{"person":["Anders_Hansson"],"template":["application/vnd.semd"]},"registered":true},{"content-type":"application/vnd.semf","friendly":{"en":"Secured eMail"},"encoding":"base64","extensions":["semf"],"xrefs":{"person":["Anders_Hansson"],"template":["application/vnd.semf"]},"registered":true},{"content-type":"application/vnd.shade-save-file","encoding":"base64","xrefs":{"person":["Connor_Horman"],"template":["application/vnd.shade-save-file"]},"registered":true},{"content-type":"application/vnd.shana.informed.formdata","friendly":{"en":"Shana Informed Filler"},"encoding":"base64","extensions":["ifm"],"xrefs":{"person":["Guy_Selzler"],"template":["application/vnd.shana.informed.formdata"]},"registered":true},{"content-type":"application/vnd.shana.informed.formtemplate","friendly":{"en":"Shana Informed Filler"},"encoding":"base64","extensions":["itp"],"xrefs":{"person":["Guy_Selzler"],"template":["application/vnd.shana.informed.formtemplate"]},"registered":true},{"content-type":"application/vnd.shana.informed.interchange","friendly":{"en":"Shana Informed Filler"},"encoding":"base64","extensions":["iif"],"xrefs":{"person":["Guy_Selzler"],"template":["application/vnd.shana.informed.interchange"]},"registered":true},{"content-type":"application/vnd.shana.informed.package","friendly":{"en":"Shana Informed Filler"},"encoding":"base64","extensions":["ipk"],"xrefs":{"person":["Guy_Selzler"],"template":["application/vnd.shana.informed.package"]},"registered":true},{"content-type":"application/vnd.shootproof+json","encoding":"base64","xrefs":{"person":["Ben_Ramsey"],"template":["application/vnd.shootproof+json"]},"registered":true},{"content-type":"application/vnd.shopkick+json","encoding":"base64","xrefs":{"person":["Ronald_Jacobs"],"template":["application/vnd.shopkick+json"]},"registered":true},{"content-type":"application/vnd.shp","encoding":"base64","xrefs":{"person":["Mi_Tar"],"template":["application/vnd.shp"]},"registered":true},{"content-type":"application/vnd.shx","encoding":"base64","xrefs":{"person":["Mi_Tar"],"template":["application/vnd.shx"]},"registered":true},{"content-type":"application/vnd.sigrok.session","encoding":"base64","xrefs":{"person":["Uwe_Hermann"],"template":["application/vnd.sigrok.session"]},"registered":true},{"content-type":"application/vnd.SimTech-MindMapper","friendly":{"en":"SimTech MindMapper"},"encoding":"base64","extensions":["twd","twds"],"xrefs":{"person":["Patrick_Koh"],"template":["application/vnd.SimTech-MindMapper"]},"registered":true},{"content-type":"application/vnd.siren+json","encoding":"base64","xrefs":{"person":["Kevin_Swiber"],"template":["application/vnd.siren+json"]},"registered":true},{"content-type":"application/vnd.smaf","friendly":{"en":"SMAF File"},"encoding":"base64","extensions":["mmf"],"xrefs":{"person":["Hiroaki_Takahashi"],"template":["application/vnd.smaf"]},"registered":true},{"content-type":"application/vnd.smart.notebook","encoding":"base64","xrefs":{"person":["Jonathan_Neitz"],"template":["application/vnd.smart.notebook"]},"registered":true},{"content-type":"application/vnd.smart.teacher","friendly":{"en":"SMART Technologies Apps"},"encoding":"base64","extensions":["teacher"],"xrefs":{"person":["Michael_Boyle"],"template":["application/vnd.smart.teacher"]},"registered":true},{"content-type":"application/vnd.snesdev-page-table","encoding":"base64","xrefs":{"person":["Connor_Horman"],"template":["application/vnd.snesdev-page-table"]},"registered":true},{"content-type":"application/vnd.software602.filler.form+xml","encoding":"base64","xrefs":{"person":["Jakub_Hytka","Martin_Vondrous"],"template":["application/vnd.software602.filler.form+xml"]},"registered":true},{"content-type":"application/vnd.software602.filler.form-xml-zip","encoding":"base64","xrefs":{"person":["Jakub_Hytka","Martin_Vondrous"],"template":["application/vnd.software602.filler.form-xml-zip"]},"registered":true},{"content-type":"application/vnd.solent.sdkm+xml","friendly":{"en":"SudokuMagic"},"encoding":"base64","extensions":["sdkd","sdkm"],"xrefs":{"person":["Cliff_Gauntlett"],"template":["application/vnd.solent.sdkm+xml"]},"registered":true},{"content-type":"application/vnd.spotfire.dxp","friendly":{"en":"TIBCO Spotfire"},"encoding":"base64","extensions":["dxp"],"xrefs":{"person":["Stefan_Jernberg"],"template":["application/vnd.spotfire.dxp"]},"registered":true},{"content-type":"application/vnd.spotfire.sfs","friendly":{"en":"TIBCO Spotfire"},"encoding":"base64","extensions":["sfs"],"xrefs":{"person":["Stefan_Jernberg"],"template":["application/vnd.spotfire.sfs"]},"registered":true},{"content-type":"application/vnd.sqlite3","encoding":"base64","xrefs":{"person":["Clemens_Ladisch"],"template":["application/vnd.sqlite3"]},"registered":true},{"content-type":"application/vnd.sss-cod","encoding":"base64","xrefs":{"person":["Asang_Dani"],"template":["application/vnd.sss-cod"]},"registered":true},{"content-type":"application/vnd.sss-dtf","encoding":"base64","xrefs":{"person":["Eric_Bruno"],"template":["application/vnd.sss-dtf"]},"registered":true},{"content-type":"application/vnd.sss-ntf","encoding":"base64","xrefs":{"person":["Eric_Bruno"],"template":["application/vnd.sss-ntf"]},"registered":true},{"content-type":"application/vnd.stardivision.calc","friendly":{"en":"StarOffice - Calc"},"encoding":"base64","extensions":["sdc"],"registered":false},{"content-type":"application/vnd.stardivision.chart","encoding":"base64","extensions":["sds"],"registered":false},{"content-type":"application/vnd.stardivision.draw","friendly":{"en":"StarOffice - Draw"},"encoding":"base64","extensions":["sda"],"registered":false},{"content-type":"application/vnd.stardivision.impress","friendly":{"en":"StarOffice - Impress"},"encoding":"base64","extensions":["sdd"],"registered":false},{"content-type":"application/vnd.stardivision.math","friendly":{"en":"StarOffice - Math"},"encoding":"base64","extensions":["sdf","smf"],"registered":false},{"content-type":"application/vnd.stardivision.writer","friendly":{"en":"StarOffice - Writer"},"encoding":"base64","extensions":["sdw","vor"],"registered":false},{"content-type":"application/vnd.stardivision.writer-global","friendly":{"en":"StarOffice - Writer (Global)"},"encoding":"base64","extensions":["sgl"],"registered":false},{"content-type":"application/vnd.stepmania.package","encoding":"base64","extensions":["smzip"],"xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.stepmania.package"]},"registered":true},{"content-type":"application/vnd.stepmania.stepchart","friendly":{"en":"StepMania"},"encoding":"base64","extensions":["sm"],"xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.stepmania.stepchart"]},"registered":true},{"content-type":"application/vnd.street-stream","encoding":"base64","xrefs":{"person":["Glenn_Levitt"],"template":["application/vnd.street-stream"]},"registered":true},{"content-type":"application/vnd.sun.wadl+xml","encoding":"base64","xrefs":{"person":["Marc_Hadley"],"template":["application/vnd.sun.wadl+xml"]},"registered":true},{"content-type":"application/vnd.sun.xml.calc","friendly":{"en":"OpenOffice - Calc (Spreadsheet)"},"encoding":"base64","extensions":["sxc"],"registered":false},{"content-type":"application/vnd.sun.xml.calc.template","friendly":{"en":"OpenOffice - Calc Template (Spreadsheet)"},"encoding":"base64","extensions":["stc"],"registered":false},{"content-type":"application/vnd.sun.xml.draw","friendly":{"en":"OpenOffice - Draw (Graphics)"},"encoding":"base64","extensions":["sxd"],"registered":false},{"content-type":"application/vnd.sun.xml.draw.template","friendly":{"en":"OpenOffice - Draw Template (Graphics)"},"encoding":"base64","extensions":["std"],"registered":false},{"content-type":"application/vnd.sun.xml.impress","friendly":{"en":"OpenOffice - Impress (Presentation)"},"encoding":"base64","extensions":["sxi"],"registered":false},{"content-type":"application/vnd.sun.xml.impress.template","friendly":{"en":"OpenOffice - Impress Template (Presentation)"},"encoding":"base64","extensions":["sti"],"registered":false},{"content-type":"application/vnd.sun.xml.math","friendly":{"en":"OpenOffice - Math (Formula)"},"encoding":"base64","extensions":["sxm"],"registered":false},{"content-type":"application/vnd.sun.xml.writer","friendly":{"en":"OpenOffice - Writer (Text - HTML)"},"encoding":"base64","extensions":["sxw"],"registered":false},{"content-type":"application/vnd.sun.xml.writer.global","friendly":{"en":"OpenOffice - Writer (Text - HTML)"},"encoding":"base64","extensions":["sxg"],"registered":false},{"content-type":"application/vnd.sun.xml.writer.template","friendly":{"en":"OpenOffice - Writer Template (Text - HTML)"},"encoding":"base64","extensions":["stw"],"registered":false},{"content-type":"application/vnd.sus-calendar","friendly":{"en":"ScheduleUs"},"encoding":"base64","extensions":["sus","susp"],"xrefs":{"person":["Jonathan_Niedfeldt"],"template":["application/vnd.sus-calendar"]},"registered":true},{"content-type":"application/vnd.svd","friendly":{"en":"SourceView Document"},"encoding":"base64","extensions":["svd"],"xrefs":{"person":["Scott_Becker"],"template":["application/vnd.svd"]},"registered":true},{"content-type":"application/vnd.swiftview-ics","encoding":"base64","xrefs":{"person":["Glenn_Widener"],"template":["application/vnd.swiftview-ics"]},"registered":true},{"content-type":"application/vnd.sycle+xml","encoding":"base64","xrefs":{"person":["Johann_Terblanche"],"template":["application/vnd.sycle+xml"]},"registered":true},{"content-type":"application/vnd.syft+json","encoding":"base64","xrefs":{"person":["Dan_Luhring"],"template":["application/vnd.syft+json"]},"registered":true},{"content-type":"application/vnd.symbian.install","friendly":{"en":"Symbian Install Package"},"encoding":"base64","extensions":["sis","sisx"],"registered":false},{"content-type":"application/vnd.syncml+xml","friendly":{"en":"SyncML"},"encoding":"base64","extensions":["xsm"],"xrefs":{"person":["OMA_Data_Synchronization_Working_Group"],"template":["application/vnd.syncml+xml"]},"registered":true},{"content-type":"application/vnd.syncml.dm+wbxml","friendly":{"en":"SyncML - Device Management"},"encoding":"base64","extensions":["bdm"],"xrefs":{"person":["OMA-DM_Work_Group"],"template":["application/vnd.syncml.dm+wbxml"]},"registered":true},{"content-type":"application/vnd.syncml.dm+xml","friendly":{"en":"SyncML - Device Management"},"encoding":"base64","extensions":["xdm"],"xrefs":{"person":["Bindu_Rama_Rao","OMA-DM_Work_Group"],"template":["application/vnd.syncml.dm+xml"]},"registered":true},{"content-type":"application/vnd.syncml.dm.notification","encoding":"base64","xrefs":{"person":["OMA-DM_Work_Group","Peter_Thompson"],"template":["application/vnd.syncml.dm.notification"]},"registered":true},{"content-type":"application/vnd.syncml.dmddf+wbxml","encoding":"base64","xrefs":{"person":["OMA-DM_Work_Group"],"template":["application/vnd.syncml.dmddf+wbxml"]},"registered":true},{"content-type":"application/vnd.syncml.dmddf+xml","encoding":"base64","xrefs":{"person":["OMA-DM_Work_Group"],"template":["application/vnd.syncml.dmddf+xml"]},"registered":true},{"content-type":"application/vnd.syncml.dmtnds+wbxml","encoding":"base64","xrefs":{"person":["OMA-DM_Work_Group"],"template":["application/vnd.syncml.dmtnds+wbxml"]},"registered":true},{"content-type":"application/vnd.syncml.dmtnds+xml","encoding":"base64","xrefs":{"person":["OMA-DM_Work_Group"],"template":["application/vnd.syncml.dmtnds+xml"]},"registered":true},{"content-type":"application/vnd.syncml.ds.notification","encoding":"base64","xrefs":{"person":["OMA_Data_Synchronization_Working_Group"],"template":["application/vnd.syncml.ds.notification"]},"registered":true},{"content-type":"application/vnd.tableschema+json","encoding":"base64","xrefs":{"person":["Paul_Walsh"],"template":["application/vnd.tableschema+json"]},"registered":true},{"content-type":"application/vnd.tao.intent-module-archive","friendly":{"en":"Tao Intent"},"encoding":"base64","extensions":["tao"],"xrefs":{"person":["Daniel_Shelton"],"template":["application/vnd.tao.intent-module-archive"]},"registered":true},{"content-type":"application/vnd.tcpdump.pcap","encoding":"base64","extensions":["cap","dmp","pcap"],"xrefs":{"person":["Glen_Turner","Guy_Harris"],"template":["application/vnd.tcpdump.pcap"]},"registered":true},{"content-type":"application/vnd.think-cell.ppttc+json","encoding":"base64","xrefs":{"person":["Arno_Schoedl"],"template":["application/vnd.think-cell.ppttc+json"]},"registered":true},{"content-type":"application/vnd.tmd.mediaflex.api+xml","encoding":"base64","xrefs":{"person":["Alex_Sibilev"],"template":["application/vnd.tmd.mediaflex.api+xml"]},"registered":true},{"content-type":"application/vnd.tml","encoding":"base64","xrefs":{"person":["Joey_Smith"],"template":["application/vnd.tml"]},"registered":true},{"content-type":"application/vnd.tmobile-livetv","friendly":{"en":"MobileTV"},"encoding":"base64","extensions":["tmo"],"xrefs":{"person":["Nicolas_Helin"],"template":["application/vnd.tmobile-livetv"]},"registered":true},{"content-type":"application/vnd.tri.onesource","encoding":"base64","xrefs":{"person":["Rick_Rupp"],"template":["application/vnd.tri.onesource"]},"registered":true},{"content-type":"application/vnd.trid.tpt","friendly":{"en":"TRI Systems Config"},"encoding":"base64","extensions":["tpt"],"xrefs":{"person":["Frank_Cusack"],"template":["application/vnd.trid.tpt"]},"registered":true},{"content-type":"application/vnd.triscape.mxs","friendly":{"en":"Triscape Map Explorer"},"encoding":"base64","extensions":["mxs"],"xrefs":{"person":["Steven_Simonoff"],"template":["application/vnd.triscape.mxs"]},"registered":true},{"content-type":"application/vnd.trueapp","friendly":{"en":"True BASIC"},"encoding":"base64","extensions":["tra"],"xrefs":{"person":["J._Scott_Hepler"],"template":["application/vnd.trueapp"]},"registered":true},{"content-type":"application/vnd.truedoc","encoding":"base64","xrefs":{"person":["Brad_Chase"],"template":["application/vnd.truedoc"]},"registered":true},{"content-type":"application/vnd.ubisoft.webplayer","encoding":"base64","xrefs":{"person":["Martin_Talbot"],"template":["application/vnd.ubisoft.webplayer"]},"registered":true},{"content-type":"application/vnd.ufdl","friendly":{"en":"Universal Forms Description Language"},"encoding":"base64","extensions":["ufd","ufdl"],"xrefs":{"person":["Dave_Manning"],"template":["application/vnd.ufdl"]},"registered":true},{"content-type":"application/vnd.uiq.theme","friendly":{"en":"User Interface Quartz - Theme (Symbian)"},"encoding":"base64","extensions":["utz"],"xrefs":{"person":["Tim_Ocock"],"template":["application/vnd.uiq.theme"]},"registered":true},{"content-type":"application/vnd.umajin","friendly":{"en":"UMAJIN"},"encoding":"base64","extensions":["umj"],"xrefs":{"person":["Jamie_Riden"],"template":["application/vnd.umajin"]},"registered":true},{"content-type":"application/vnd.unity","friendly":{"en":"Unity 3d"},"encoding":"base64","extensions":["unityweb"],"xrefs":{"person":["Unity3d"],"template":["application/vnd.unity"]},"registered":true},{"content-type":"application/vnd.uoml+xml","friendly":{"en":"Unique Object Markup Language"},"encoding":"base64","extensions":["uoml"],"xrefs":{"person":["Arne_Gerdes"],"template":["application/vnd.uoml+xml"]},"registered":true},{"content-type":"application/vnd.uplanet.alert","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.alert"]},"registered":true},{"content-type":"application/vnd.uplanet.alert-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.alert-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.bearer-choice","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.bearer-choice"]},"registered":true},{"content-type":"application/vnd.uplanet.bearer-choice-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.bearer-choice-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.cacheop","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.cacheop"]},"registered":true},{"content-type":"application/vnd.uplanet.cacheop-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.cacheop-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.channel","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.channel"]},"registered":true},{"content-type":"application/vnd.uplanet.channel-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.channel-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.list","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.list"]},"registered":true},{"content-type":"application/vnd.uplanet.list-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.list-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.listcmd","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.listcmd"]},"registered":true},{"content-type":"application/vnd.uplanet.listcmd-wbxml","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.listcmd-wbxml"]},"registered":true},{"content-type":"application/vnd.uplanet.signal","encoding":"base64","xrefs":{"person":["Bruce_Martin"],"template":["application/vnd.uplanet.signal"]},"registered":true},{"content-type":"application/vnd.uri-map","encoding":"base64","xrefs":{"person":["Sebastian_Baer"],"template":["application/vnd.uri-map"]},"registered":true},{"content-type":"application/vnd.valve.source.material","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["application/vnd.valve.source.material"]},"registered":true},{"content-type":"application/vnd.vcx","friendly":{"en":"VirtualCatalog"},"encoding":"base64","extensions":["vcx"],"xrefs":{"person":["Taisuke_Sugimoto"],"template":["application/vnd.vcx"]},"registered":true},{"content-type":"application/vnd.vd-study","encoding":"base64","xrefs":{"person":["Luc_Rogge"],"template":["application/vnd.vd-study"]},"registered":true},{"content-type":"application/vnd.vectorworks","encoding":"base64","xrefs":{"person":["Biplab_Sarkar","Lyndsey_Ferguson"],"template":["application/vnd.vectorworks"]},"registered":true},{"content-type":"application/vnd.vel+json","encoding":"base64","xrefs":{"person":["James_Wigger"],"template":["application/vnd.vel+json"]},"registered":true},{"content-type":"application/vnd.verimatrix.vcas","encoding":"base64","xrefs":{"person":["Petr_Peterka"],"template":["application/vnd.verimatrix.vcas"]},"registered":true},{"content-type":"application/vnd.veritone.aion+json","encoding":"base64","xrefs":{"person":["Al_Brown"],"template":["application/vnd.veritone.aion+json"]},"registered":true},{"content-type":"application/vnd.veryant.thin","encoding":"base64","xrefs":{"person":["Massimo_Bertoli"],"template":["application/vnd.veryant.thin"]},"registered":true},{"content-type":"application/vnd.ves.encrypted","encoding":"base64","xrefs":{"person":["Jim_Zubov"],"template":["application/vnd.ves.encrypted"]},"registered":true},{"content-type":"application/vnd.vidsoft.vidconference","encoding":"8bit","extensions":["vsc"],"xrefs":{"person":["Robert_Hess"],"template":["application/vnd.vidsoft.vidconference"]},"registered":true},{"content-type":"application/vnd.visio","friendly":{"en":"Microsoft Visio"},"encoding":"base64","extensions":["vsd","vst","vsw","vss"],"xrefs":{"person":["Troy_Sandal"],"template":["application/vnd.visio"]},"registered":true},{"content-type":"application/vnd.visionary","friendly":{"en":"Visionary"},"encoding":"base64","extensions":["vis"],"xrefs":{"person":["Gayatri_Aravindakumar"],"template":["application/vnd.visionary"]},"registered":true},{"content-type":"application/vnd.vividence.scriptfile","encoding":"base64","xrefs":{"person":["Mark_Risher"],"template":["application/vnd.vividence.scriptfile"]},"registered":true},{"content-type":"application/vnd.vsf","friendly":{"en":"Viewport+"},"encoding":"base64","extensions":["vsf"],"xrefs":{"person":["Delton_Rowe"],"template":["application/vnd.vsf"]},"registered":true},{"content-type":"application/vnd.wap.sic","encoding":"base64","extensions":["sic"],"xrefs":{"person":["WAP-Forum"],"template":["application/vnd.wap.sic"]},"registered":true},{"content-type":"application/vnd.wap.slc","encoding":"base64","extensions":["slc"],"xrefs":{"person":["WAP-Forum"],"template":["application/vnd.wap.slc"]},"registered":true},{"content-type":"application/vnd.wap.wbxml","friendly":{"en":"WAP Binary XML (WBXML)"},"encoding":"base64","extensions":["wbxml"],"xrefs":{"person":["Peter_Stark"],"template":["application/vnd.wap.wbxml"]},"registered":true},{"content-type":"application/vnd.wap.wmlc","friendly":{"en":"Compiled Wireless Markup Language (WMLC)"},"encoding":"base64","extensions":["wmlc"],"xrefs":{"person":["Peter_Stark"],"template":["application/vnd.wap.wmlc"]},"registered":true},{"content-type":"application/vnd.wap.wmlscriptc","friendly":{"en":"WMLScript"},"encoding":"base64","extensions":["wmlsc"],"xrefs":{"person":["Peter_Stark"],"template":["application/vnd.wap.wmlscriptc"]},"registered":true},{"content-type":"application/vnd.webturbo","friendly":{"en":"WebTurbo"},"encoding":"base64","extensions":["wtb"],"xrefs":{"person":["Yaser_Rehem"],"template":["application/vnd.webturbo"]},"registered":true},{"content-type":"application/vnd.wfa.dpp","encoding":"base64","xrefs":{"person":["Dr._Jun_Tian","Wi-Fi_Alliance"],"template":["application/vnd.wfa.dpp"]},"registered":true},{"content-type":"application/vnd.wfa.p2p","encoding":"base64","xrefs":{"person":["Mick_Conley"],"template":["application/vnd.wfa.p2p"]},"registered":true},{"content-type":"application/vnd.wfa.wsc","encoding":"base64","xrefs":{"person":["Wi-Fi_Alliance"],"template":["application/vnd.wfa.wsc"]},"registered":true},{"content-type":"application/vnd.windows.devicepairing","encoding":"base64","xrefs":{"person":["Priya_Dandawate"],"template":["application/vnd.windows.devicepairing"]},"registered":true},{"content-type":"application/vnd.wmc","encoding":"base64","xrefs":{"person":["Thomas_Kjornes"],"template":["application/vnd.wmc"]},"registered":true},{"content-type":"application/vnd.wmf.bootstrap","encoding":"base64","xrefs":{"person":["Prakash_Iyer","Thinh_Nguyenphu"],"template":["application/vnd.wmf.bootstrap"]},"registered":true},{"content-type":"application/vnd.wolfram.mathematica","encoding":"base64","xrefs":{"person":["Wolfram"],"template":["application/vnd.wolfram.mathematica"]},"registered":true},{"content-type":"application/vnd.wolfram.mathematica.package","encoding":"base64","xrefs":{"person":["Wolfram"],"template":["application/vnd.wolfram.mathematica.package"]},"registered":true},{"content-type":"application/vnd.wolfram.player","friendly":{"en":"Mathematica Notebook Player"},"encoding":"base64","extensions":["nbp"],"xrefs":{"person":["Wolfram"],"template":["application/vnd.wolfram.player"]},"registered":true},{"content-type":"application/vnd.wordperfect","friendly":{"en":"Wordperfect"},"encoding":"base64","extensions":["wpd"],"xrefs":{"person":["Kim_Scarborough"],"template":["application/vnd.wordperfect"]},"registered":true},{"content-type":"application/vnd.wqd","friendly":{"en":"SundaHus WQ"},"encoding":"base64","extensions":["wqd"],"xrefs":{"person":["Jan_Bostrom"],"template":["application/vnd.wqd"]},"registered":true},{"content-type":"application/vnd.wrq-hp3000-labelled","encoding":"base64","xrefs":{"person":["Chris_Bartram"],"template":["application/vnd.wrq-hp3000-labelled"]},"registered":true},{"content-type":"application/vnd.wt.stf","friendly":{"en":"Worldtalk"},"encoding":"base64","extensions":["stf"],"xrefs":{"person":["Bill_Wohler"],"template":["application/vnd.wt.stf"]},"registered":true},{"content-type":"application/vnd.wv.csp+wbxml","encoding":"base64","extensions":["wv"],"xrefs":{"person":["Matti_Salmi"],"template":["application/vnd.wv.csp+wbxml"]},"registered":true},{"content-type":"application/vnd.wv.csp+xml","encoding":"8bit","xrefs":{"person":["John_Ingi_Ingimundarson"],"template":["application/vnd.wv.csp+xml"]},"registered":true},{"content-type":"application/vnd.wv.ssp+xml","encoding":"8bit","xrefs":{"person":["John_Ingi_Ingimundarson"],"template":["application/vnd.wv.ssp+xml"]},"registered":true},{"content-type":"application/vnd.xacml+json","encoding":"base64","xrefs":{"person":["David_Brossard"],"template":["application/vnd.xacml+json"]},"registered":true},{"content-type":"application/vnd.xara","friendly":{"en":"CorelXARA"},"encoding":"base64","extensions":["xar"],"xrefs":{"person":["David_Matthewman"],"template":["application/vnd.xara"]},"registered":true},{"content-type":"application/vnd.xfdl","friendly":{"en":"Extensible Forms Description Language"},"encoding":"base64","extensions":["xfdl"],"xrefs":{"person":["Dave_Manning"],"template":["application/vnd.xfdl"]},"registered":true},{"content-type":"application/vnd.xfdl.webform","encoding":"base64","xrefs":{"person":["Michael_Mansell"],"template":["application/vnd.xfdl.webform"]},"registered":true},{"content-type":"application/vnd.xmi+xml","encoding":"base64","xrefs":{"person":["Fred_Waskiewicz"],"template":["application/vnd.xmi+xml"]},"registered":true},{"content-type":"application/vnd.xmpie.cpkg","encoding":"base64","xrefs":{"person":["Reuven_Sherwin"],"template":["application/vnd.xmpie.cpkg"]},"registered":true},{"content-type":"application/vnd.xmpie.dpkg","encoding":"base64","xrefs":{"person":["Reuven_Sherwin"],"template":["application/vnd.xmpie.dpkg"]},"registered":true},{"content-type":"application/vnd.xmpie.plan","encoding":"base64","xrefs":{"person":["Reuven_Sherwin"],"template":["application/vnd.xmpie.plan"]},"registered":true},{"content-type":"application/vnd.xmpie.ppkg","encoding":"base64","xrefs":{"person":["Reuven_Sherwin"],"template":["application/vnd.xmpie.ppkg"]},"registered":true},{"content-type":"application/vnd.xmpie.xlim","encoding":"base64","xrefs":{"person":["Reuven_Sherwin"],"template":["application/vnd.xmpie.xlim"]},"registered":true},{"content-type":"application/vnd.yamaha.hv-dic","friendly":{"en":"HV Voice Dictionary"},"encoding":"base64","extensions":["hvd"],"xrefs":{"person":["Tomohiro_Yamamoto"],"template":["application/vnd.yamaha.hv-dic"]},"registered":true},{"content-type":"application/vnd.yamaha.hv-script","friendly":{"en":"HV Script"},"encoding":"base64","extensions":["hvs"],"xrefs":{"person":["Tomohiro_Yamamoto"],"template":["application/vnd.yamaha.hv-script"]},"registered":true},{"content-type":"application/vnd.yamaha.hv-voice","friendly":{"en":"HV Voice Parameter"},"encoding":"base64","extensions":["hvp"],"xrefs":{"person":["Tomohiro_Yamamoto"],"template":["application/vnd.yamaha.hv-voice"]},"registered":true},{"content-type":"application/vnd.yamaha.openscoreformat","friendly":{"en":"Open Score Format"},"encoding":"base64","extensions":["osf"],"xrefs":{"person":["Mark_Olleson"],"template":["application/vnd.yamaha.openscoreformat"]},"registered":true},{"content-type":"application/vnd.yamaha.openscoreformat.osfpvg+xml","friendly":{"en":"OSFPVG"},"encoding":"base64","extensions":["osfpvg"],"xrefs":{"person":["Mark_Olleson"],"template":["application/vnd.yamaha.openscoreformat.osfpvg+xml"]},"registered":true},{"content-type":"application/vnd.yamaha.remote-setup","encoding":"base64","xrefs":{"person":["Takehiro_Sukizaki"],"template":["application/vnd.yamaha.remote-setup"]},"registered":true},{"content-type":"application/vnd.yamaha.smaf-audio","friendly":{"en":"SMAF Audio"},"encoding":"base64","extensions":["saf"],"xrefs":{"person":["Keiichi_Shinoda"],"template":["application/vnd.yamaha.smaf-audio"]},"registered":true},{"content-type":"application/vnd.yamaha.smaf-phrase","friendly":{"en":"SMAF Phrase"},"encoding":"base64","extensions":["spf"],"xrefs":{"person":["Keiichi_Shinoda"],"template":["application/vnd.yamaha.smaf-phrase"]},"registered":true},{"content-type":"application/vnd.yamaha.through-ngn","encoding":"base64","xrefs":{"person":["Takehiro_Sukizaki"],"template":["application/vnd.yamaha.through-ngn"]},"registered":true},{"content-type":"application/vnd.yamaha.tunnel-udpencap","encoding":"base64","xrefs":{"person":["Takehiro_Sukizaki"],"template":["application/vnd.yamaha.tunnel-udpencap"]},"registered":true},{"content-type":"application/vnd.yaoweme","encoding":"base64","xrefs":{"person":["Jens_Jorgensen"],"template":["application/vnd.yaoweme"]},"registered":true},{"content-type":"application/vnd.yellowriver-custom-menu","friendly":{"en":"CustomMenu"},"encoding":"base64","extensions":["cmp"],"xrefs":{"person":["Mr._Yellow"],"template":["application/vnd.yellowriver-custom-menu"]},"registered":true},{"content-type":"application/vnd.youtube.yt","encoding":"base64","obsolete":true,"use-instead":"video/vnd.youtube.yt","xrefs":{"person":["Laura_Wood"],"template":["application/vnd.youtube.yt"],"notes":["(OBSOLETED in favor of video/vnd.youtube.yt)"]},"registered":true},{"content-type":"application/vnd.zul","friendly":{"en":"Z.U.L. Geometry"},"encoding":"base64","extensions":["zir","zirz"],"xrefs":{"person":["Rene_Grothmann"],"template":["application/vnd.zul"]},"registered":true},{"content-type":"application/vnd.zzazz.deck+xml","friendly":{"en":"Zzazz Deck"},"encoding":"base64","extensions":["zaz"],"xrefs":{"person":["Micheal_Hewett"],"template":["application/vnd.zzazz.deck+xml"]},"registered":true},{"content-type":"application/voicexml+xml","friendly":{"en":"VoiceXML"},"encoding":"base64","extensions":["vxml"],"xrefs":{"rfc":["rfc4267"],"template":["application/voicexml+xml"]},"registered":true},{"content-type":"application/voucher-cms+json","encoding":"base64","xrefs":{"rfc":["rfc8366"],"template":["application/voucher-cms+json"]},"registered":true},{"content-type":"application/vq-rtcpxr","encoding":"base64","xrefs":{"rfc":["rfc6035"],"template":["application/vq-rtcpxr"]},"registered":true},{"content-type":"application/wasm","friendly":{"en":"WebAssembly"},"encoding":"8bit","extensions":["wasm"],"xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["application/wasm"]},"registered":true},{"content-type":"application/watcherinfo+xml","encoding":"base64","extensions":["wif"],"xrefs":{"rfc":["rfc3858"],"template":["application/watcherinfo+xml"]},"registered":true},{"content-type":"application/webbundle","encoding":"base64","xrefs":{"draft":["draft-yasskin-wpack-bundled-exchanges"]},"registered":true,"provisional":true},{"content-type":"application/webpush-options+json","encoding":"base64","xrefs":{"rfc":["rfc8292"],"template":["application/webpush-options+json"]},"registered":true},{"content-type":"application/whoispp-query","encoding":"base64","xrefs":{"rfc":["rfc2957"],"template":["application/whoispp-query"]},"registered":true},{"content-type":"application/whoispp-response","encoding":"base64","xrefs":{"rfc":["rfc2958"],"template":["application/whoispp-response"]},"registered":true},{"content-type":"application/widget","friendly":{"en":"Widget Packaging and XML Configuration"},"encoding":"base64","extensions":["wgt"],"xrefs":{"person":["Steven_Pemberton","W3C"],"uri":["http://www.w3.org/TR/widgets/#media-type-registration-for-application/widget"],"template":["application/widget"]},"registered":true},{"content-type":"application/winhlp","friendly":{"en":"WinHelp"},"encoding":"base64","extensions":["hlp"],"registered":false},{"content-type":"application/wita","encoding":"base64","xrefs":{"person":["Larry_Campbell"],"template":["application/wita"]},"registered":true},{"content-type":"application/won","encoding":"base64","xrefs":{"person":["Roy_T._Fielding"]},"registered":true,"provisional":true},{"content-type":"application/word","encoding":"base64","extensions":["doc","dot"],"registered":false},{"content-type":"application/wordperfect","encoding":"base64","extensions":["wp"],"obsolete":true,"use-instead":"application/vnd.wordperfect","registered":false},{"content-type":"application/wordperfect5.1","encoding":"base64","extensions":["wp5","wp"],"xrefs":{"person":["Paul_Lindner"],"template":["application/wordperfect5.1"]},"registered":true},{"content-type":"application/wordperfect6.1","encoding":"base64","extensions":["wp6"],"obsolete":true,"use-instead":"application/x-wordperfect6.1","registered":false},{"content-type":"application/wordperfectd","encoding":"base64","extensions":["wpd"],"obsolete":true,"use-instead":"application/vnd.wordperfect","registered":false},{"content-type":"application/wsdl+xml","friendly":{"en":"WSDL - Web Services Description Language"},"encoding":"base64","extensions":["wsdl"],"xrefs":{"person":["W3C"],"template":["application/wsdl+xml"]},"registered":true},{"content-type":"application/wspolicy+xml","friendly":{"en":"Web Services Policy"},"encoding":"base64","extensions":["wspolicy"],"xrefs":{"person":["W3C"],"template":["application/wspolicy+xml"]},"registered":true},{"content-type":"application/x-123","encoding":"base64","extensions":["wk"],"obsolete":true,"use-instead":"application/vnd.lotus-1-2-3","registered":false},{"content-type":"application/x-7z-compressed","friendly":{"en":"7-Zip"},"encoding":"base64","extensions":["7z"],"registered":false},{"content-type":"application/x-abiword","friendly":{"en":"AbiWord"},"encoding":"base64","extensions":["abw"],"registered":false},{"content-type":"application/x-access","encoding":"base64","extensions":["mdf","mda","mdb","mde"],"obsolete":true,"use-instead":"application/x-msaccess","registered":false},{"content-type":"application/x-ace-compressed","friendly":{"en":"Ace Archive"},"encoding":"base64","extensions":["ace"],"registered":false},{"content-type":"application/x-apple-diskimage","encoding":"base64","extensions":["dmg"],"registered":false},{"content-type":"application/x-authorware-bin","friendly":{"en":"Adobe (Macropedia) Authorware - Binary File"},"encoding":"base64","extensions":["aab","u32","vox","x32"],"registered":false},{"content-type":"application/x-authorware-map","friendly":{"en":"Adobe (Macropedia) Authorware - Map"},"encoding":"base64","extensions":["aam"],"registered":false},{"content-type":"application/x-authorware-seg","friendly":{"en":"Adobe (Macropedia) Authorware - Segment File"},"encoding":"base64","extensions":["aas"],"registered":false},{"content-type":"application/x-bcpio","friendly":{"en":"Binary CPIO Archive"},"encoding":"base64","extensions":["bcpio"],"registered":false},{"content-type":"application/x-bittorrent","friendly":{"en":"BitTorrent"},"encoding":"base64","extensions":["torrent"],"registered":false},{"content-type":"application/x-bleeper","encoding":"base64","extensions":["bleep"],"registered":false},{"content-type":"application/x-blorb","encoding":"base64","extensions":["blb","blorb"],"registered":false},{"content-type":"application/x-bzip","friendly":{"en":"Bzip Archive"},"encoding":"base64","extensions":["bz"],"registered":false},{"content-type":"application/x-bzip2","friendly":{"en":"Bzip2 Archive"},"encoding":"base64","extensions":["boz","bz2"],"registered":false},{"content-type":"application/x-cbr","encoding":"base64","extensions":["cb7","cba","cbr","cbt","cbz"],"registered":false},{"content-type":"application/x-cdlink","friendly":{"en":"Video CD"},"encoding":"base64","extensions":["vcd"],"registered":false},{"content-type":"application/x-cfs-compressed","encoding":"base64","extensions":["cfs"],"registered":false},{"content-type":"application/x-chat","friendly":{"en":"pIRCh"},"encoding":"base64","extensions":["chat"],"registered":false},{"content-type":"application/x-chess-pgn","friendly":{"en":"Portable Game Notation (Chess Games)"},"encoding":"base64","extensions":["pgn"],"registered":false},{"content-type":"application/x-chrome-extension","encoding":"base64","extensions":["crx"],"registered":false},{"content-type":"application/x-clariscad","encoding":"base64","registered":false},{"content-type":"application/x-compress","encoding":"base64","extensions":["z","Z"],"obsolete":true,"use-instead":"application/x-compressed","registered":false},{"content-type":"application/x-compressed","encoding":"base64","extensions":["z","Z"],"registered":false},{"content-type":"application/x-conference","encoding":"base64","extensions":["nsc"],"registered":false},{"content-type":"application/x-cpio","friendly":{"en":"CPIO Archive"},"encoding":"base64","extensions":["cpio"],"registered":false},{"content-type":"application/x-csh","friendly":{"en":"C Shell Script"},"encoding":"8bit","extensions":["csh"],"registered":false},{"content-type":"application/x-cu-seeme","encoding":"base64","extensions":["csm","cu"],"registered":false},{"content-type":"application/x-debian-package","friendly":{"en":"Debian Package"},"encoding":"base64","extensions":["deb","udeb"],"registered":false},{"content-type":"application/x-dgc-compressed","encoding":"base64","extensions":["dgc"],"registered":false},{"content-type":"application/x-director","friendly":{"en":"Adobe Shockwave Player"},"encoding":"base64","extensions":["dcr","@dir","@dxr","cct","cst","cxt","dir","dxr","fgd","swa","w3d"],"registered":false},{"content-type":"application/x-doom","friendly":{"en":"Doom Video Game"},"encoding":"base64","extensions":["wad"],"registered":false},{"content-type":"application/x-drafting","encoding":"base64","registered":false},{"content-type":"application/x-dtbncx+xml","friendly":{"en":"Navigation Control file for XML (for ePub)"},"encoding":"base64","extensions":["ncx"],"registered":false},{"content-type":"application/x-dtbook+xml","friendly":{"en":"Digital Talking Book"},"encoding":"base64","extensions":["dtb"],"registered":false},{"content-type":"application/x-dtbresource+xml","friendly":{"en":"Digital Talking Book - Resource File"},"encoding":"base64","extensions":["res"],"registered":false},{"content-type":"application/x-dvi","friendly":{"en":"Device Independent File Format (DVI)"},"encoding":"base64","extensions":["dvi"],"registered":false},{"content-type":"application/x-dxf","encoding":"base64","registered":false},{"content-type":"application/x-envoy","encoding":"base64","extensions":["evy"],"registered":false},{"content-type":"application/x-eva","encoding":"base64","extensions":["eva"],"registered":false},{"content-type":"application/x-excel","encoding":"base64","obsolete":true,"use-instead":"application/vnd.ms-excel","registered":false},{"content-type":"application/x-font-bdf","friendly":{"en":"Glyph Bitmap Distribution Format"},"encoding":"base64","extensions":["bdf"],"registered":false},{"content-type":"application/x-font-ghostscript","friendly":{"en":"Ghostscript Font"},"encoding":"base64","extensions":["gsf"],"registered":false},{"content-type":"application/x-font-linux-psf","friendly":{"en":"PSF Fonts"},"encoding":"base64","extensions":["psf"],"registered":false},{"content-type":"application/x-font-opentype","encoding":"base64","extensions":["otf"],"registered":false},{"content-type":"application/x-font-otf","friendly":{"en":"OpenType Font File"},"encoding":"base64","extensions":["otf"],"registered":false},{"content-type":"application/x-font-pcf","friendly":{"en":"Portable Compiled Format"},"encoding":"base64","extensions":["pcf"],"registered":false},{"content-type":"application/x-font-snf","friendly":{"en":"Server Normal Format"},"encoding":"base64","extensions":["snf"],"registered":false},{"content-type":"application/x-font-truetype","encoding":"base64","extensions":["ttf"],"registered":false},{"content-type":"application/x-font-ttf","friendly":{"en":"TrueType Font"},"encoding":"base64","extensions":["ttc","ttf"],"registered":false},{"content-type":"application/x-font-type1","friendly":{"en":"PostScript Fonts"},"encoding":"base64","extensions":["afm","pfa","pfb","pfm"],"registered":false},{"content-type":"application/x-fractals","encoding":"base64","registered":false},{"content-type":"application/x-freearc","encoding":"base64","extensions":["arc"],"registered":false},{"content-type":"application/x-futuresplash","friendly":{"en":"FutureSplash Animator"},"encoding":"base64","extensions":["spl"],"registered":false},{"content-type":"application/x-gca-compressed","encoding":"base64","extensions":["gca"],"registered":false},{"content-type":"application/x-ghostview","encoding":"base64","registered":false},{"content-type":"application/x-glulx","encoding":"base64","extensions":["ulx"],"registered":false},{"content-type":"application/x-gnumeric","friendly":{"en":"Gnumeric"},"encoding":"base64","extensions":["gnumeric"],"registered":false},{"content-type":"application/x-gramps-xml","encoding":"base64","extensions":["gramps"],"registered":false},{"content-type":"application/x-gtar","friendly":{"en":"GNU Tar Files"},"encoding":"base64","extensions":["gtar","tgz","tbz2","tbz"],"registered":false},{"content-type":"application/x-gzip","encoding":"base64","extensions":["gz"],"obsolete":true,"use-instead":"application/gzip","registered":false},{"content-type":"application/x-hdf","friendly":{"en":"Hierarchical Data Format"},"encoding":"base64","extensions":["hdf"],"registered":false},{"content-type":"application/x-hep","encoding":"base64","extensions":["hep"],"registered":false},{"content-type":"application/x-html+ruby","encoding":"8bit","extensions":["rhtml"],"registered":false},{"content-type":"application/x-httpd-php","encoding":"8bit","extensions":["phtml","pht","php"],"registered":false},{"content-type":"application/x-ibooks+zip","encoding":"base64","extensions":["ibooks"],"registered":false},{"content-type":"application/x-ica","encoding":"base64","extensions":["ica"],"registered":false},{"content-type":"application/x-ideas","encoding":"base64","registered":false},{"content-type":"application/x-imagemap","encoding":"8bit","extensions":["imagemap","imap"],"registered":false},{"content-type":"application/x-install-instructions","encoding":"base64","extensions":["install"],"registered":false},{"content-type":"application/x-iso9660-image","encoding":"base64","extensions":["iso"],"registered":false},{"content-type":"application/x-iwork-keynote-sffkey","encoding":"base64","extensions":["key"],"registered":false},{"content-type":"application/x-iwork-numbers-sffnumbers","encoding":"base64","extensions":["numbers"],"registered":false},{"content-type":"application/x-iwork-pages-sffpages","encoding":"base64","extensions":["pages"],"registered":false},{"content-type":"application/x-java-archive","encoding":"base64","extensions":["jar"],"registered":false},{"content-type":"application/x-java-jnlp-file","friendly":{"en":"Java Network Launching Protocol"},"encoding":"base64","extensions":["jnlp"],"registered":false},{"content-type":"application/x-java-serialized-object","encoding":"base64","extensions":["ser"],"registered":false},{"content-type":"application/x-java-vm","encoding":"base64","extensions":["class"],"registered":false},{"content-type":"application/x-javascript","encoding":"8bit","extensions":["js","mjs"],"obsolete":true,"use-instead":"application/javascript","registered":false},{"content-type":"application/x-koan","encoding":"base64","extensions":["skp","skd","skt","skm"],"registered":false},{"content-type":"application/x-latex","friendly":{"en":"LaTeX"},"encoding":"8bit","extensions":["ltx","latex"],"registered":false},{"content-type":"application/x-lotus-123","encoding":"base64","extensions":["wks"],"obsolete":true,"use-instead":"application/vnd.lotus-1-2-3","registered":false},{"content-type":"application/x-lzh-compressed","encoding":"base64","extensions":["lha","lzh"],"registered":false},{"content-type":"application/x-mac","encoding":"base64","extensions":["bin"],"registered":false},{"content-type":"application/x-mac-compactpro","encoding":"base64","extensions":["cpt"],"registered":false},{"content-type":"application/x-macbase64","encoding":"base64","extensions":["bin"],"registered":false},{"content-type":"application/x-macbinary","encoding":"base64","registered":false},{"content-type":"application/x-maker","encoding":"base64","extensions":["frm","maker","frame","fm","fb","book","fbdoc"],"obsolete":true,"use-instead":"application/vnd.framemaker","registered":false},{"content-type":"application/x-mathcad","encoding":"base64","extensions":["mcd"],"obsolete":true,"use-instead":"application/vnd.mcd","registered":false},{"content-type":"application/x-mathematica-old","encoding":"base64","registered":false},{"content-type":"application/x-mie","encoding":"base64","extensions":["mie"],"registered":false},{"content-type":"application/x-mif","encoding":"base64","extensions":["mif"],"registered":false},{"content-type":"application/x-mobipocket-ebook","friendly":{"en":"Mobipocket"},"encoding":"base64","extensions":["mobi","prc"],"registered":false},{"content-type":"application/x-ms-application","friendly":{"en":"Microsoft ClickOnce"},"encoding":"base64","extensions":["application"],"registered":false},{"content-type":"application/x-ms-dos-executable","encoding":"base64","extensions":["exe"],"registered":false},{"content-type":"application/x-ms-shortcut","encoding":"base64","extensions":["lnk"],"registered":false},{"content-type":"application/x-ms-wmd","friendly":{"en":"Microsoft Windows Media Player Download Package"},"encoding":"base64","extensions":["wmd"],"registered":false},{"content-type":"application/x-ms-wmz","friendly":{"en":"Microsoft Windows Media Player Skin Package"},"encoding":"base64","extensions":["wmz"],"registered":false},{"content-type":"application/x-ms-xbap","friendly":{"en":"Microsoft XAML Browser Application"},"encoding":"base64","extensions":["xbap"],"registered":false},{"content-type":"application/x-msaccess","friendly":{"en":"Microsoft Access"},"encoding":"base64","extensions":["mda","mdb","mde","mdf"],"registered":false},{"content-type":"application/x-msbinder","friendly":{"en":"Microsoft Office Binder"},"encoding":"base64","extensions":["obd"],"registered":false},{"content-type":"application/x-mscardfile","friendly":{"en":"Microsoft Information Card"},"encoding":"base64","extensions":["crd"],"registered":false},{"content-type":"application/x-msclip","friendly":{"en":"Microsoft Clipboard Clip"},"encoding":"base64","extensions":["clp"],"registered":false},{"content-type":"application/x-msdos-program","encoding":"base64","extensions":["cmd","bat","com","exe","reg","ps1","vbs"],"registered":false},{"content-type":"application/x-msdownload","friendly":{"en":"Microsoft Application"},"encoding":"base64","extensions":["exe","com","cmd","bat","dll","msi","reg","ps1","vbs"],"registered":false},{"content-type":"application/x-msmediaview","friendly":{"en":"Microsoft MediaView"},"encoding":"base64","extensions":["m13","m14","mvb"],"registered":false},{"content-type":"application/x-msmetafile","friendly":{"en":"Microsoft Windows Metafile"},"encoding":"base64","extensions":["emf","emz","wmf","wmz"],"registered":false},{"content-type":"application/x-msmoney","friendly":{"en":"Microsoft Money"},"encoding":"base64","extensions":["mny"],"registered":false},{"content-type":"application/x-mspublisher","friendly":{"en":"Microsoft Publisher"},"encoding":"base64","extensions":["pub"],"registered":false},{"content-type":"application/x-msschedule","friendly":{"en":"Microsoft Schedule+"},"encoding":"base64","extensions":["scd"],"registered":false},{"content-type":"application/x-msterminal","friendly":{"en":"Microsoft Windows Terminal Services"},"encoding":"base64","extensions":["trm"],"registered":false},{"content-type":"application/x-msword","encoding":"base64","extensions":["doc","dot","wrd"],"obsolete":true,"use-instead":"application/msword","registered":false},{"content-type":"application/x-mswrite","friendly":{"en":"Microsoft Wordpad"},"encoding":"base64","extensions":["wri"],"registered":false},{"content-type":"application/x-netcdf","friendly":{"en":"Network Common Data Form (NetCDF)"},"encoding":"base64","extensions":["nc","cdf"],"registered":false},{"content-type":"application/x-ns-proxy-autoconfig","encoding":"base64","extensions":["pac"],"registered":false},{"content-type":"application/x-nzb","encoding":"base64","extensions":["nzb"],"registered":false},{"content-type":"application/x-opera-extension","encoding":"base64","extensions":["oex"],"registered":false},{"content-type":"application/x-pagemaker","encoding":"base64","extensions":["pm","pm5","pt5"],"registered":false},{"content-type":"application/x-perl","encoding":"8bit","extensions":["pl","pm"],"registered":false},{"content-type":"application/x-pgp","encoding":"base64","registered":false,"signature":true},{"content-type":"application/x-pkcs12","friendly":{"en":"PKCS #12 - Personal Information Exchange Syntax Standard"},"encoding":"base64","extensions":["p12","pfx"],"registered":false},{"content-type":"application/x-pkcs7-certificates","friendly":{"en":"PKCS #7 - Cryptographic Message Syntax Standard (Certificates)"},"encoding":"base64","extensions":["p7b","spc"],"registered":false},{"content-type":"application/x-pkcs7-certreqresp","friendly":{"en":"PKCS #7 - Cryptographic Message Syntax Standard (Certificate Request Response)"},"encoding":"base64","extensions":["p7r"],"registered":false},{"content-type":"application/x-pki-message","encoding":"base64","xrefs":{"rfc":["rfc8894"],"template":["application/x-pki-message"]},"registered":true},{"content-type":"application/x-python","encoding":"8bit","extensions":["py"],"registered":false},{"content-type":"application/x-quicktimeplayer","encoding":"base64","extensions":["qtl"],"registered":false},{"content-type":"application/x-rar-compressed","friendly":{"en":"RAR Archive"},"encoding":"base64","extensions":["rar"],"registered":false},{"content-type":"application/x-remote_printing","encoding":"base64","registered":false},{"content-type":"application/x-research-info-systems","encoding":"base64","extensions":["ris"],"registered":false},{"content-type":"application/x-rtf","encoding":"base64","extensions":["rtf"],"obsolete":true,"use-instead":"application/rtf","registered":false},{"content-type":"application/x-ruby","encoding":"8bit","extensions":["rb","rbw"],"registered":false},{"content-type":"application/x-set","encoding":"base64","registered":false},{"content-type":"application/x-sh","friendly":{"en":"Bourne Shell Script"},"encoding":"8bit","extensions":["sh"],"registered":false},{"content-type":"application/x-shar","friendly":{"en":"Shell Archive"},"encoding":"8bit","extensions":["shar"],"registered":false},{"content-type":"application/x-shockwave-flash","friendly":{"en":"Adobe Flash"},"encoding":"base64","extensions":["swf"],"registered":false},{"content-type":"application/x-silverlight-app","friendly":{"en":"Microsoft Silverlight"},"encoding":"base64","extensions":["xap"],"registered":false},{"content-type":"application/x-SLA","encoding":"base64","registered":false},{"content-type":"application/x-smarttech-notebook","encoding":"base64","extensions":["notebook"],"registered":false},{"content-type":"application/x-solids","encoding":"base64","registered":false},{"content-type":"application/x-spss","encoding":"base64","extensions":["sav","sbs","sps","spo","spp"],"registered":false},{"content-type":"application/x-sql","encoding":"base64","extensions":["sql"],"registered":false},{"content-type":"application/x-STEP","encoding":"base64","registered":false},{"content-type":"application/x-stuffit","friendly":{"en":"Stuffit Archive"},"encoding":"base64","extensions":["sit"],"registered":false},{"content-type":"application/x-stuffitx","friendly":{"en":"Stuffit Archive"},"encoding":"base64","extensions":["sitx"],"registered":false},{"content-type":"application/x-subrip","encoding":"base64","extensions":["srt"],"registered":false},{"content-type":"application/x-sv4cpio","friendly":{"en":"System V Release 4 CPIO Archive"},"encoding":"base64","extensions":["sv4cpio"],"registered":false},{"content-type":"application/x-sv4crc","friendly":{"en":"System V Release 4 CPIO Checksum Data"},"encoding":"base64","extensions":["sv4crc"],"registered":false},{"content-type":"application/x-t3vm-image","encoding":"base64","extensions":["t3"],"registered":false},{"content-type":"application/x-tads","encoding":"base64","extensions":["gam"],"registered":false},{"content-type":"application/x-tar","friendly":{"en":"Tar File (Tape Archive)"},"encoding":"base64","extensions":["tar"],"registered":false},{"content-type":"application/x-tcl","friendly":{"en":"Tcl Script"},"encoding":"8bit","extensions":["tcl"],"registered":false},{"content-type":"application/x-tex","friendly":{"en":"TeX"},"encoding":"8bit","extensions":["tex"],"registered":false},{"content-type":"application/x-tex-tfm","friendly":{"en":"TeX Font Metric"},"encoding":"base64","extensions":["tfm"],"registered":false},{"content-type":"application/x-texinfo","friendly":{"en":"GNU Texinfo Document"},"encoding":"8bit","extensions":["texinfo","texi"],"registered":false},{"content-type":"application/x-tgif","encoding":"base64","extensions":["obj"],"registered":false},{"content-type":"application/x-toolbook","encoding":"base64","extensions":["tbk"],"registered":false},{"content-type":"application/x-troff","encoding":"base64","extensions":["t","tr","roff"],"obsolete":true,"use-instead":"text/troff","registered":false},{"content-type":"application/x-troff-man","encoding":"8bit","extensions":["man"],"registered":false},{"content-type":"application/x-troff-me","encoding":"base64","extensions":["me"],"registered":false},{"content-type":"application/x-troff-ms","encoding":"base64","extensions":["ms"],"registered":false},{"content-type":"application/x-u-star","encoding":"base64","obsolete":true,"use-instead":"application/x-ustar","registered":false},{"content-type":"application/x-ustar","friendly":{"en":"Ustar (Uniform Standard Tape Archive)"},"encoding":"base64","extensions":["ustar"],"registered":false},{"content-type":"application/x-VMSBACKUP","encoding":"base64","extensions":["bck"],"registered":false},{"content-type":"application/x-wais-source","friendly":{"en":"WAIS Source"},"encoding":"base64","extensions":["src"],"registered":false},{"content-type":"application/x-web-app-manifest+json","encoding":"base64","extensions":["webapp"],"registered":false},{"content-type":"application/x-Wingz","encoding":"base64","extensions":["wz","wkz"],"registered":false},{"content-type":"application/x-word","encoding":"base64","extensions":["doc","dot"],"obsolete":true,"use-instead":"application/msword","registered":false},{"content-type":"application/x-wordperfect","encoding":"base64","extensions":["wp"],"obsolete":true,"use-instead":"application/vnd.wordperfect","registered":false},{"content-type":"application/x-wordperfect6.1","encoding":"base64","extensions":["wp6"],"registered":false},{"content-type":"application/x-wordperfectd","encoding":"base64","extensions":["wpd"],"obsolete":true,"use-instead":"application/vnd.wordperfect","registered":false},{"content-type":"application/x-www-form-urlencoded","encoding":"7bit","xrefs":{"person":["Anne_van_Kesteren","WHATWG"],"template":["application/x-www-form-urlencoded"]},"registered":true},{"content-type":"application/x-x509-ca-cert","friendly":{"en":"X.509 Certificate"},"encoding":"base64","extensions":["crt","der"],"xrefs":{"rfc":["rfc8894"],"template":["application/x-x509-ca-cert"]},"registered":true},{"content-type":"application/x-x509-ca-ra-cert","encoding":"base64","xrefs":{"rfc":["rfc8894"],"template":["application/x-x509-ca-ra-cert"]},"registered":true},{"content-type":"application/x-x509-next-ca-cert","encoding":"base64","xrefs":{"rfc":["rfc8894"],"template":["application/x-x509-next-ca-cert"]},"registered":true},{"content-type":"application/x-xfig","friendly":{"en":"Xfig"},"encoding":"base64","extensions":["fig"],"registered":false},{"content-type":"application/x-xliff+xml","encoding":"base64","extensions":["xlf"],"registered":false},{"content-type":"application/x-xpinstall","friendly":{"en":"XPInstall - Mozilla"},"encoding":"base64","extensions":["xpi"],"registered":false},{"content-type":"application/x-xz","encoding":"base64","extensions":["xz"],"registered":false},{"content-type":"application/x-zip-compressed","friendly":{"en":"Zip Archive"},"encoding":"base64","extensions":["zip"],"registered":false},{"content-type":"application/x-zmachine","encoding":"base64","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"],"registered":false},{"content-type":"application/x400-bp","encoding":"base64","xrefs":{"rfc":["rfc1494"],"template":["application/x400-bp"]},"registered":true},{"content-type":"application/x400.bp","encoding":"base64","obsolete":true,"use-instead":"application/x400-bp","registered":false},{"content-type":"application/xacml+xml","encoding":"base64","xrefs":{"rfc":["rfc7061"],"template":["application/xacml+xml"]},"registered":true},{"content-type":"application/xaml+xml","encoding":"base64","extensions":["xaml"],"registered":false},{"content-type":"application/xcap-att+xml","encoding":"base64","xrefs":{"rfc":["rfc4825"],"template":["application/xcap-att+xml"]},"registered":true},{"content-type":"application/xcap-caps+xml","encoding":"base64","xrefs":{"rfc":["rfc4825"],"template":["application/xcap-caps+xml"]},"registered":true},{"content-type":"application/xcap-diff+xml","friendly":{"en":"XML Configuration Access Protocol - XCAP Diff"},"encoding":"base64","extensions":["xdf"],"xrefs":{"rfc":["rfc5874"],"template":["application/xcap-diff+xml"]},"registered":true},{"content-type":"application/xcap-el+xml","encoding":"base64","xrefs":{"rfc":["rfc4825"],"template":["application/xcap-el+xml"]},"registered":true},{"content-type":"application/xcap-error+xml","encoding":"base64","xrefs":{"rfc":["rfc4825"],"template":["application/xcap-error+xml"]},"registered":true},{"content-type":"application/xcap-ns+xml","encoding":"base64","xrefs":{"rfc":["rfc4825"],"template":["application/xcap-ns+xml"]},"registered":true},{"content-type":"application/xcon-conference-info+xml","encoding":"base64","xrefs":{"rfc":["rfc6502"],"template":["application/xcon-conference-info+xml"]},"registered":true},{"content-type":"application/xcon-conference-info-diff+xml","encoding":"base64","xrefs":{"rfc":["rfc6502"],"template":["application/xcon-conference-info-diff+xml"]},"registered":true},{"content-type":"application/xenc+xml","friendly":{"en":"XML Encryption Syntax and Processing"},"encoding":"base64","extensions":["xenc"],"xrefs":{"person":["Joseph_Reagle","XENC_Working_Group"],"template":["application/xenc+xml"]},"registered":true},{"content-type":"application/xhtml+xml","friendly":{"en":"XHTML - The Extensible HyperText Markup Language"},"encoding":"8bit","extensions":["xht","xhtml"],"xrefs":{"person":["Robin_Berjon","W3C"],"template":["application/xhtml+xml"]},"registered":true},{"content-type":"application/xhtml-voice+xml","encoding":"base64","obsolete":true,"xrefs":{"draft":["draft-mccobb-xplusv-media-type"],"template":["application/xhtml-voice+xml"],"notes":["- OBSOLETE; no replacement given"]},"registered":true},{"content-type":"application/xliff+xml","encoding":"base64","xrefs":{"person":["Chet_Ensign","OASIS"],"template":["application/xliff+xml"]},"registered":true},{"content-type":"application/xml","friendly":{"en":"XML - Extensible Markup Language"},"encoding":"8bit","extensions":["xml","xsl"],"xrefs":{"rfc":["rfc7303"],"template":["application/xml"]},"registered":true},{"content-type":"application/xml-dtd","friendly":{"en":"Document Type Definition"},"encoding":"8bit","extensions":["dtd"],"xrefs":{"rfc":["rfc7303"],"template":["application/xml-dtd"]},"registered":true},{"content-type":"application/xml-external-parsed-entity","encoding":"base64","xrefs":{"rfc":["rfc7303"],"template":["application/xml-external-parsed-entity"]},"registered":true},{"content-type":"application/xml-patch+xml","encoding":"base64","xrefs":{"rfc":["rfc7351"],"template":["application/xml-patch+xml"]},"registered":true},{"content-type":"application/xmpp+xml","encoding":"base64","xrefs":{"rfc":["rfc3923"],"template":["application/xmpp+xml"]},"registered":true},{"content-type":"application/xop+xml","friendly":{"en":"XML-Binary Optimized Packaging"},"encoding":"base64","extensions":["xop"],"xrefs":{"person":["Mark_Nottingham"],"template":["application/xop+xml"]},"registered":true},{"content-type":"application/xproc+xml","encoding":"base64","extensions":["xpl"],"registered":false},{"content-type":"application/xslt+xml","friendly":{"en":"XML Transformations"},"encoding":"base64","extensions":["xslt"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/2007/REC-xslt20-20070123/#media-type-registration"],"template":["application/xslt+xml"]},"registered":true},{"content-type":"application/xspf+xml","friendly":{"en":"XSPF - XML Shareable Playlist Format"},"encoding":"base64","extensions":["xspf"],"registered":false},{"content-type":"application/xv+xml","friendly":{"en":"MXML"},"encoding":"base64","extensions":["mxml","xhvml","xvm","xvml"],"xrefs":{"rfc":["rfc4374"],"template":["application/xv+xml"]},"registered":true},{"content-type":"application/yang","friendly":{"en":"YANG Data Modeling Language"},"encoding":"base64","extensions":["yang"],"xrefs":{"rfc":["rfc6020"],"template":["application/yang"]},"registered":true},{"content-type":"application/yang-data+json","encoding":"base64","xrefs":{"rfc":["rfc8040"],"template":["application/yang-data+json"]},"registered":true},{"content-type":"application/yang-data+xml","encoding":"base64","xrefs":{"rfc":["rfc8040"],"template":["application/yang-data+xml"]},"registered":true},{"content-type":"application/yang-patch+json","encoding":"base64","xrefs":{"rfc":["rfc8072"],"template":["application/yang-patch+json"]},"registered":true},{"content-type":"application/yang-patch+xml","encoding":"base64","xrefs":{"rfc":["rfc8072"],"template":["application/yang-patch+xml"]},"registered":true},{"content-type":"application/yin+xml","friendly":{"en":"YIN (YANG - XML)"},"encoding":"base64","extensions":["yin"],"xrefs":{"rfc":["rfc6020"],"template":["application/yin+xml"]},"registered":true},{"content-type":"application/zip","friendly":{"en":"Zip Archive"},"encoding":"base64","extensions":["zip"],"xrefs":{"person":["Paul_Lindner"],"template":["application/zip"]},"registered":true},{"content-type":"application/zlib","encoding":"base64","xrefs":{"rfc":["rfc6713"],"template":["application/zlib"]},"registered":true},{"content-type":"application/zstd","encoding":"base64","xrefs":{"rfc":["rfc8878"],"template":["application/zstd"]},"registered":true},{"content-type":"audio/1d-interleaved-parityfec","encoding":"base64","xrefs":{"rfc":["rfc6015"],"template":["audio/1d-interleaved-parityfec"]},"registered":true},{"content-type":"audio/32kadpcm","encoding":"base64","xrefs":{"rfc":["rfc2421","rfc3802"],"template":["audio/32kadpcm"]},"registered":true},{"content-type":"audio/3gpp","encoding":"base64","xrefs":{"rfc":["rfc3839","rfc6381"],"template":["audio/3gpp"]},"registered":true},{"content-type":"audio/3gpp2","encoding":"base64","xrefs":{"rfc":["rfc4393","rfc6381"],"template":["audio/3gpp2"]},"registered":true},{"content-type":"audio/aac","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","Max_Neuendorf"],"template":["audio/aac"]},"registered":true},{"content-type":"audio/ac3","encoding":"base64","xrefs":{"rfc":["rfc4184"],"template":["audio/ac3"]},"registered":true},{"content-type":"audio/adpcm","friendly":{"en":"Adaptive differential pulse-code modulation"},"encoding":"base64","extensions":["adp"],"registered":false},{"content-type":"audio/AMR","encoding":"base64","extensions":["amr"],"xrefs":{"rfc":["rfc4867"],"template":["audio/AMR"]},"registered":true},{"content-type":"audio/AMR-WB","encoding":"base64","extensions":["awb"],"xrefs":{"rfc":["rfc4867"],"template":["audio/AMR-WB"]},"registered":true},{"content-type":"audio/amr-wb+","encoding":"base64","xrefs":{"rfc":["rfc4352"],"template":["audio/amr-wb+"]},"registered":true},{"content-type":"audio/aptx","encoding":"base64","xrefs":{"rfc":["rfc7310"],"template":["audio/aptx"]},"registered":true},{"content-type":"audio/asc","encoding":"base64","xrefs":{"rfc":["rfc6295"],"template":["audio/asc"]},"registered":true},{"content-type":"audio/ATRAC-ADVANCED-LOSSLESS","encoding":"base64","xrefs":{"rfc":["rfc5584"],"template":["audio/ATRAC-ADVANCED-LOSSLESS"]},"registered":true},{"content-type":"audio/ATRAC-X","encoding":"base64","xrefs":{"rfc":["rfc5584"],"template":["audio/ATRAC-X"]},"registered":true},{"content-type":"audio/ATRAC3","encoding":"base64","xrefs":{"rfc":["rfc5584"],"template":["audio/ATRAC3"]},"registered":true},{"content-type":"audio/basic","friendly":{"en":"Sun Audio - Au file format"},"encoding":"base64","extensions":["au","snd"],"xrefs":{"rfc":["rfc2045","rfc2046"],"template":["audio/basic"]},"registered":true},{"content-type":"audio/BV16","encoding":"base64","xrefs":{"rfc":["rfc4298"],"template":["audio/BV16"]},"registered":true},{"content-type":"audio/BV32","encoding":"base64","xrefs":{"rfc":["rfc4298"],"template":["audio/BV32"]},"registered":true},{"content-type":"audio/clearmode","encoding":"base64","xrefs":{"rfc":["rfc4040"],"template":["audio/clearmode"]},"registered":true},{"content-type":"audio/CN","encoding":"base64","xrefs":{"rfc":["rfc3389"],"template":["audio/CN"]},"registered":true},{"content-type":"audio/DAT12","encoding":"base64","xrefs":{"rfc":["rfc3190"],"template":["audio/DAT12"]},"registered":true},{"content-type":"audio/dls","encoding":"base64","xrefs":{"rfc":["rfc4613"],"template":["audio/dls"]},"registered":true},{"content-type":"audio/dsr-es201108","encoding":"base64","xrefs":{"rfc":["rfc3557"],"template":["audio/dsr-es201108"]},"registered":true},{"content-type":"audio/dsr-es202050","encoding":"base64","xrefs":{"rfc":["rfc4060"],"template":["audio/dsr-es202050"]},"registered":true},{"content-type":"audio/dsr-es202211","encoding":"base64","xrefs":{"rfc":["rfc4060"],"template":["audio/dsr-es202211"]},"registered":true},{"content-type":"audio/dsr-es202212","encoding":"base64","xrefs":{"rfc":["rfc4060"],"template":["audio/dsr-es202212"]},"registered":true},{"content-type":"audio/DV","encoding":"base64","xrefs":{"rfc":["rfc6469"],"template":["audio/DV"]},"registered":true},{"content-type":"audio/DVI4","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/DVI4"]},"registered":true},{"content-type":"audio/eac3","encoding":"base64","xrefs":{"rfc":["rfc4598"],"template":["audio/eac3"]},"registered":true},{"content-type":"audio/encaprtp","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["audio/encaprtp"]},"registered":true},{"content-type":"audio/EVRC","encoding":"base64","extensions":["evc"],"xrefs":{"rfc":["rfc4788"],"template":["audio/EVRC"]},"registered":true},{"content-type":"audio/EVRC-QCP","encoding":"base64","xrefs":{"rfc":["rfc3625"],"template":["audio/EVRC-QCP"]},"registered":true},{"content-type":"audio/EVRC0","encoding":"base64","xrefs":{"rfc":["rfc4788"],"template":["audio/EVRC0"]},"registered":true},{"content-type":"audio/EVRC1","encoding":"base64","xrefs":{"rfc":["rfc4788"],"template":["audio/EVRC1"]},"registered":true},{"content-type":"audio/EVRCB","encoding":"base64","xrefs":{"rfc":["rfc5188"],"template":["audio/EVRCB"]},"registered":true},{"content-type":"audio/EVRCB0","encoding":"base64","xrefs":{"rfc":["rfc5188"],"template":["audio/EVRCB0"]},"registered":true},{"content-type":"audio/EVRCB1","encoding":"base64","xrefs":{"rfc":["rfc4788"],"template":["audio/EVRCB1"]},"registered":true},{"content-type":"audio/EVRCNW","encoding":"base64","xrefs":{"rfc":["rfc6884"],"template":["audio/EVRCNW"]},"registered":true},{"content-type":"audio/EVRCNW0","encoding":"base64","xrefs":{"rfc":["rfc6884"],"template":["audio/EVRCNW0"]},"registered":true},{"content-type":"audio/EVRCNW1","encoding":"base64","xrefs":{"rfc":["rfc6884"],"template":["audio/EVRCNW1"]},"registered":true},{"content-type":"audio/EVRCWB","encoding":"base64","xrefs":{"rfc":["rfc5188"],"template":["audio/EVRCWB"]},"registered":true},{"content-type":"audio/EVRCWB0","encoding":"base64","xrefs":{"rfc":["rfc5188"],"template":["audio/EVRCWB0"]},"registered":true},{"content-type":"audio/EVRCWB1","encoding":"base64","xrefs":{"rfc":["rfc5188"],"template":["audio/EVRCWB1"]},"registered":true},{"content-type":"audio/EVS","encoding":"base64","xrefs":{"person":["Kyunghun_Jung","_3GPP"],"template":["audio/EVS"]},"registered":true},{"content-type":"audio/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["audio/example"]},"registered":true},{"content-type":"audio/flexfec","encoding":"base64","xrefs":{"rfc":["rfc8627"],"template":["audio/flexfec"]},"registered":true},{"content-type":"audio/fwdred","encoding":"base64","xrefs":{"rfc":["rfc6354"],"template":["audio/fwdred"]},"registered":true},{"content-type":"audio/G711-0","encoding":"base64","xrefs":{"rfc":["rfc7655"],"template":["audio/G711-0"]},"registered":true},{"content-type":"audio/G719","encoding":"base64","xrefs":{"rfc":["rfc5404"],"rfc-errata":["3245"],"template":["audio/G719"]},"registered":true},{"content-type":"audio/G722","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G722"]},"registered":true},{"content-type":"audio/G7221","encoding":"base64","xrefs":{"rfc":["rfc5577"],"template":["audio/G7221"]},"registered":true},{"content-type":"audio/G723","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G723"]},"registered":true},{"content-type":"audio/G726-16","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G726-16"]},"registered":true},{"content-type":"audio/G726-24","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G726-24"]},"registered":true},{"content-type":"audio/G726-32","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G726-32"]},"registered":true},{"content-type":"audio/G726-40","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G726-40"]},"registered":true},{"content-type":"audio/G728","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G728"]},"registered":true},{"content-type":"audio/G729","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G729"]},"registered":true},{"content-type":"audio/G7291","encoding":"base64","xrefs":{"rfc":["rfc4749","rfc5459"],"template":["audio/G7291"]},"registered":true},{"content-type":"audio/G729D","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G729D"]},"registered":true},{"content-type":"audio/G729E","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/G729E"]},"registered":true},{"content-type":"audio/GSM","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/GSM"]},"registered":true},{"content-type":"audio/GSM-EFR","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/GSM-EFR"]},"registered":true},{"content-type":"audio/GSM-HR-08","encoding":"base64","xrefs":{"rfc":["rfc5993"],"template":["audio/GSM-HR-08"]},"registered":true},{"content-type":"audio/iLBC","encoding":"base64","xrefs":{"rfc":["rfc3952"],"template":["audio/iLBC"]},"registered":true},{"content-type":"audio/ip-mr_v2.5","encoding":"base64","xrefs":{"rfc":["rfc6262"],"template":["audio/ip-mr_v2.5"]},"registered":true},{"content-type":"audio/L16","encoding":"base64","extensions":["l16"],"xrefs":{"rfc":["rfc4856"],"template":["audio/L16"]},"registered":true},{"content-type":"audio/L20","encoding":"base64","xrefs":{"rfc":["rfc3190"],"template":["audio/L20"]},"registered":true},{"content-type":"audio/L24","encoding":"base64","xrefs":{"rfc":["rfc3190"],"template":["audio/L24"]},"registered":true},{"content-type":"audio/L8","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/L8"]},"registered":true},{"content-type":"audio/LPC","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/LPC"]},"registered":true},{"content-type":"audio/MELP","encoding":"base64","xrefs":{"rfc":["rfc8130"],"template":["audio/MELP"]},"registered":true},{"content-type":"audio/MELP1200","encoding":"base64","xrefs":{"rfc":["rfc8130"],"template":["audio/MELP1200"]},"registered":true},{"content-type":"audio/MELP2400","encoding":"base64","xrefs":{"rfc":["rfc8130"],"template":["audio/MELP2400"]},"registered":true},{"content-type":"audio/MELP600","encoding":"base64","xrefs":{"rfc":["rfc8130"],"template":["audio/MELP600"]},"registered":true},{"content-type":"audio/mhas","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","Ingo_Hofmann","Nils_Peters"],"template":["audio/mhas"]},"registered":true},{"content-type":"audio/midi","friendly":{"en":"MIDI - Musical Instrument Digital Interface"},"encoding":"base64","extensions":["kar","mid","midi","rmi"],"registered":false},{"content-type":"audio/mobile-xmf","encoding":"base64","xrefs":{"rfc":["rfc4723"],"template":["audio/mobile-xmf"]},"registered":true},{"content-type":"audio/mp4","friendly":{"en":"MPEG-4 Audio"},"encoding":"base64","extensions":["mp4","mpg4","f4a","f4b","mp4a","m4a"],"xrefs":{"rfc":["rfc4337","rfc6381"],"template":["audio/mp4"]},"registered":true},{"content-type":"audio/MP4A-LATM","encoding":"base64","extensions":["m4a"],"xrefs":{"rfc":["rfc6416"],"template":["audio/MP4A-LATM"]},"registered":true},{"content-type":"audio/MPA","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["audio/MPA"]},"registered":true},{"content-type":"audio/mpa-robust","encoding":"base64","xrefs":{"rfc":["rfc5219"],"template":["audio/mpa-robust"]},"registered":true},{"content-type":"audio/mpeg","friendly":{"en":"MPEG Audio"},"encoding":"base64","extensions":["mpga","mp2","mp3","m2a","m3a","mp2a"],"xrefs":{"rfc":["rfc3003"],"template":["audio/mpeg"]},"registered":true},{"content-type":"audio/mpeg4-generic","encoding":"base64","xrefs":{"rfc":["rfc3640","rfc5691","rfc6295"],"template":["audio/mpeg4-generic"]},"registered":true},{"content-type":"audio/ogg","friendly":{"en":"Ogg Audio"},"encoding":"base64","extensions":["oga","ogg","spx","opus"],"xrefs":{"rfc":["rfc5334","rfc7845"],"template":["audio/ogg"]},"registered":true},{"content-type":"audio/opus","encoding":"base64","xrefs":{"rfc":["rfc7587"],"template":["audio/opus"]},"registered":true},{"content-type":"audio/parityfec","encoding":"base64","xrefs":{"rfc":["rfc3009"],"template":["audio/parityfec"]},"registered":true},{"content-type":"audio/PCMA","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/PCMA"]},"registered":true},{"content-type":"audio/PCMA-WB","encoding":"base64","xrefs":{"rfc":["rfc5391"],"template":["audio/PCMA-WB"]},"registered":true},{"content-type":"audio/PCMU","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/PCMU"]},"registered":true},{"content-type":"audio/PCMU-WB","encoding":"base64","xrefs":{"rfc":["rfc5391"],"template":["audio/PCMU-WB"]},"registered":true},{"content-type":"audio/prs.sid","encoding":"base64","xrefs":{"person":["Linus_Walleij"],"template":["audio/prs.sid"]},"registered":true},{"content-type":"audio/QCELP","encoding":"base64","xrefs":{"rfc":["rfc3555","rfc3625"],"template":["audio/QCELP"]},"registered":true},{"content-type":"audio/raptorfec","encoding":"base64","xrefs":{"rfc":["rfc6682"],"template":["audio/raptorfec"]},"registered":true},{"content-type":"audio/RED","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["audio/RED"]},"registered":true},{"content-type":"audio/rtp-enc-aescm128","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["audio/rtp-enc-aescm128"]},"registered":true},{"content-type":"audio/rtp-midi","encoding":"base64","xrefs":{"rfc":["rfc6295"],"template":["audio/rtp-midi"]},"registered":true},{"content-type":"audio/rtploopback","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["audio/rtploopback"]},"registered":true},{"content-type":"audio/rtx","encoding":"base64","xrefs":{"rfc":["rfc4588"],"template":["audio/rtx"]},"registered":true},{"content-type":"audio/s3m","encoding":"base64","extensions":["s3m"],"registered":false},{"content-type":"audio/scip","encoding":"base64","xrefs":{"person":["Daniel_Hanson","Michael_Faller","SCIP"],"template":["audio/scip"]},"registered":true},{"content-type":"audio/silk","encoding":"base64","extensions":["sil"],"registered":false},{"content-type":"audio/SMV","encoding":"base64","extensions":["smv"],"xrefs":{"rfc":["rfc3558"],"template":["audio/SMV"]},"registered":true},{"content-type":"audio/SMV-QCP","encoding":"base64","xrefs":{"rfc":["rfc3625"],"template":["audio/SMV-QCP"]},"registered":true},{"content-type":"audio/SMV0","encoding":"base64","xrefs":{"rfc":["rfc3558"],"template":["audio/SMV0"]},"registered":true},{"content-type":"audio/sofa","encoding":"base64","xrefs":{"person":["AES","Piotr_Majdak"],"template":["audio/sofa"]},"registered":true},{"content-type":"audio/sp-midi","encoding":"base64","xrefs":{"person":["Timo_Kosonen","Tom_White"],"template":["audio/sp-midi"]},"registered":true},{"content-type":"audio/speex","encoding":"base64","xrefs":{"rfc":["rfc5574"],"template":["audio/speex"]},"registered":true},{"content-type":"audio/t140c","encoding":"base64","xrefs":{"rfc":["rfc4351"],"template":["audio/t140c"]},"registered":true},{"content-type":"audio/t38","encoding":"base64","xrefs":{"rfc":["rfc4612"],"template":["audio/t38"]},"registered":true},{"content-type":"audio/telephone-event","encoding":"base64","xrefs":{"rfc":["rfc4733"],"template":["audio/telephone-event"]},"registered":true},{"content-type":"audio/TETRA_ACELP","encoding":"base64","xrefs":{"person":["ETSI","Miguel_Angel_Reina_Ortega"],"template":["audio/TETRA_ACELP"]},"registered":true},{"content-type":"audio/TETRA_ACELP_BB","encoding":"base64","xrefs":{"person":["ETSI","Miguel_Angel_Reina_Ortega"],"template":["audio/TETRA_ACELP_BB"]},"registered":true},{"content-type":"audio/tone","encoding":"base64","xrefs":{"rfc":["rfc4733"],"template":["audio/tone"]},"registered":true},{"content-type":"audio/TSVCIS","encoding":"base64","xrefs":{"rfc":["rfc8817"],"template":["audio/TSVCIS"]},"registered":true},{"content-type":"audio/UEMCLIP","encoding":"base64","xrefs":{"rfc":["rfc5686"],"template":["audio/UEMCLIP"]},"registered":true},{"content-type":"audio/ulpfec","encoding":"base64","xrefs":{"rfc":["rfc5109"],"template":["audio/ulpfec"]},"registered":true},{"content-type":"audio/usac","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","Max_Neuendorf"],"template":["audio/usac"]},"registered":true},{"content-type":"audio/VDVI","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["audio/VDVI"]},"registered":true},{"content-type":"audio/VMR-WB","encoding":"base64","xrefs":{"rfc":["rfc4348","rfc4424"],"template":["audio/VMR-WB"]},"registered":true},{"content-type":"audio/vnd.3gpp.iufp","encoding":"base64","xrefs":{"person":["Thomas_Belling"],"template":["audio/vnd.3gpp.iufp"]},"registered":true},{"content-type":"audio/vnd.4SB","encoding":"base64","xrefs":{"person":["Serge_De_Jaham"],"template":["audio/vnd.4SB"]},"registered":true},{"content-type":"audio/vnd.audiokoz","encoding":"base64","xrefs":{"person":["Vicki_DeBarros"],"template":["audio/vnd.audiokoz"]},"registered":true},{"content-type":"audio/vnd.CELP","encoding":"base64","xrefs":{"person":["Serge_De_Jaham"],"template":["audio/vnd.CELP"]},"registered":true},{"content-type":"audio/vnd.cisco.nse","encoding":"base64","xrefs":{"person":["Rajesh_Kumar"],"template":["audio/vnd.cisco.nse"]},"registered":true},{"content-type":"audio/vnd.cmles.radio-events","encoding":"base64","xrefs":{"person":["Jean-Philippe_Goulet"],"template":["audio/vnd.cmles.radio-events"]},"registered":true},{"content-type":"audio/vnd.cns.anp1","encoding":"base64","xrefs":{"person":["Ann_McLaughlin"],"template":["audio/vnd.cns.anp1"]},"registered":true},{"content-type":"audio/vnd.cns.inf1","encoding":"base64","xrefs":{"person":["Ann_McLaughlin"],"template":["audio/vnd.cns.inf1"]},"registered":true},{"content-type":"audio/vnd.dece.audio","friendly":{"en":"DECE Audio"},"encoding":"base64","extensions":["uva","uvva"],"xrefs":{"person":["Michael_A_Dolan"],"template":["audio/vnd.dece.audio"]},"registered":true},{"content-type":"audio/vnd.digital-winds","friendly":{"en":"Digital Winds Music"},"encoding":"7bit","extensions":["eol"],"xrefs":{"person":["Armands_Strazds"],"template":["audio/vnd.digital-winds"]},"registered":true},{"content-type":"audio/vnd.dlna.adts","encoding":"base64","xrefs":{"person":["Edwin_Heredia"],"template":["audio/vnd.dlna.adts"]},"registered":true},{"content-type":"audio/vnd.dolby.heaac.1","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.heaac.1"]},"registered":true},{"content-type":"audio/vnd.dolby.heaac.2","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.heaac.2"]},"registered":true},{"content-type":"audio/vnd.dolby.mlp","encoding":"base64","xrefs":{"person":["Mike_Ward"],"template":["audio/vnd.dolby.mlp"]},"registered":true},{"content-type":"audio/vnd.dolby.mps","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.mps"]},"registered":true},{"content-type":"audio/vnd.dolby.pl2","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.pl2"]},"registered":true},{"content-type":"audio/vnd.dolby.pl2x","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.pl2x"]},"registered":true},{"content-type":"audio/vnd.dolby.pl2z","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.pl2z"]},"registered":true},{"content-type":"audio/vnd.dolby.pulse.1","encoding":"base64","xrefs":{"person":["Steve_Hattersley"],"template":["audio/vnd.dolby.pulse.1"]},"registered":true},{"content-type":"audio/vnd.dra","friendly":{"en":"DRA Audio"},"encoding":"base64","extensions":["dra"],"xrefs":{"person":["Jiang_Tian"],"template":["audio/vnd.dra"]},"registered":true},{"content-type":"audio/vnd.dts","friendly":{"en":"DTS Audio"},"encoding":"base64","extensions":["dts"],"xrefs":{"person":["William_Zou"],"template":["audio/vnd.dts"]},"registered":true},{"content-type":"audio/vnd.dts.hd","friendly":{"en":"DTS High Definition Audio"},"encoding":"base64","extensions":["dtshd"],"xrefs":{"person":["William_Zou"],"template":["audio/vnd.dts.hd"]},"registered":true},{"content-type":"audio/vnd.dts.uhd","encoding":"base64","xrefs":{"person":["Phillip_Maness"],"template":["audio/vnd.dts.uhd"]},"registered":true},{"content-type":"audio/vnd.dvb.file","encoding":"base64","xrefs":{"person":["Peter_Siebert"],"template":["audio/vnd.dvb.file"]},"registered":true},{"content-type":"audio/vnd.everad.plj","encoding":"base64","extensions":["plj"],"xrefs":{"person":["Shay_Cicelsky"],"template":["audio/vnd.everad.plj"]},"registered":true},{"content-type":"audio/vnd.hns.audio","encoding":"base64","xrefs":{"person":["Swaminathan"],"template":["audio/vnd.hns.audio"]},"registered":true},{"content-type":"audio/vnd.lucent.voice","friendly":{"en":"Lucent Voice"},"encoding":"base64","extensions":["lvp"],"xrefs":{"person":["Greg_Vaudreuil"],"template":["audio/vnd.lucent.voice"]},"registered":true},{"content-type":"audio/vnd.ms-playready.media.pya","friendly":{"en":"Microsoft PlayReady Ecosystem"},"encoding":"base64","extensions":["pya"],"xrefs":{"person":["Steve_DiAcetis"],"template":["audio/vnd.ms-playready.media.pya"]},"registered":true},{"content-type":"audio/vnd.nokia.mobile-xmf","encoding":"base64","extensions":["mxmf"],"xrefs":{"person":["Nokia"],"template":["audio/vnd.nokia.mobile-xmf"]},"registered":true},{"content-type":"audio/vnd.nortel.vbk","encoding":"base64","extensions":["vbk"],"xrefs":{"person":["Glenn_Parsons"],"template":["audio/vnd.nortel.vbk"]},"registered":true},{"content-type":"audio/vnd.nuera.ecelp4800","friendly":{"en":"Nuera ECELP 4800"},"encoding":"base64","extensions":["ecelp4800"],"xrefs":{"person":["Michael_Fox"],"template":["audio/vnd.nuera.ecelp4800"]},"registered":true},{"content-type":"audio/vnd.nuera.ecelp7470","friendly":{"en":"Nuera ECELP 7470"},"encoding":"base64","extensions":["ecelp7470"],"xrefs":{"person":["Michael_Fox"],"template":["audio/vnd.nuera.ecelp7470"]},"registered":true},{"content-type":"audio/vnd.nuera.ecelp9600","friendly":{"en":"Nuera ECELP 9600"},"encoding":"base64","extensions":["ecelp9600"],"xrefs":{"person":["Michael_Fox"],"template":["audio/vnd.nuera.ecelp9600"]},"registered":true},{"content-type":"audio/vnd.octel.sbc","encoding":"base64","xrefs":{"person":["Greg_Vaudreuil"],"template":["audio/vnd.octel.sbc"]},"registered":true},{"content-type":"audio/vnd.presonus.multitrack","encoding":"base64","xrefs":{"person":["Matthias_Juwan"],"template":["audio/vnd.presonus.multitrack"]},"registered":true},{"content-type":"audio/vnd.qcelp","encoding":"base64","extensions":["qcp"],"obsolete":true,"use-instead":"audio/qcelp","xrefs":{"rfc":["rfc3625"],"template":["audio/vnd.qcelp"],"notes":["- DEPRECATED in favor of audio/qcelp"]},"registered":true},{"content-type":"audio/vnd.rhetorex.32kadpcm","encoding":"base64","xrefs":{"person":["Greg_Vaudreuil"],"template":["audio/vnd.rhetorex.32kadpcm"]},"registered":true},{"content-type":"audio/vnd.rip","friendly":{"en":"Hit'n'Mix"},"encoding":"base64","extensions":["rip"],"xrefs":{"person":["Martin_Dawe"],"template":["audio/vnd.rip"]},"registered":true},{"content-type":"audio/vnd.sealedmedia.softseal.mpeg","encoding":"base64","extensions":["smp3","smp","s1m"],"xrefs":{"person":["David_Petersen"],"template":["audio/vnd.sealedmedia.softseal.mpeg"]},"registered":true},{"content-type":"audio/vnd.vmx.cvsd","encoding":"base64","xrefs":{"person":["Greg_Vaudreuil"],"template":["audio/vnd.vmx.cvsd"]},"registered":true},{"content-type":"audio/vorbis","encoding":"base64","xrefs":{"rfc":["rfc5215"],"template":["audio/vorbis"]},"registered":true},{"content-type":"audio/vorbis-config","encoding":"base64","xrefs":{"rfc":["rfc5215"],"template":["audio/vorbis-config"]},"registered":true},{"content-type":"audio/wav","friendly":{"en":"Waveform Audio File Format (WAV)"},"encoding":"base64","extensions":["wav"],"registered":false},{"content-type":"audio/webm","friendly":{"en":"Open Web Media Project - Audio"},"encoding":"base64","extensions":["weba","webm"],"registered":false},{"content-type":"audio/x-aac","friendly":{"en":"Advanced Audio Coding (AAC)"},"encoding":"base64","extensions":["aac"],"registered":false},{"content-type":"audio/x-aiff","friendly":{"en":"Audio Interchange File Format"},"encoding":"base64","extensions":["aif","aifc","aiff"],"registered":false},{"content-type":"audio/x-caf","encoding":"base64","extensions":["caf"],"registered":false},{"content-type":"audio/x-flac","encoding":"base64","extensions":["flac"],"registered":false},{"content-type":"audio/x-m4a","encoding":"base64","extensions":["m4a"],"registered":false},{"content-type":"audio/x-matroska","encoding":"base64","extensions":["mka"],"registered":false},{"content-type":"audio/x-midi","encoding":"base64","extensions":["mid","midi","kar"],"registered":false},{"content-type":"audio/x-mpegurl","friendly":{"en":"M3U (Multimedia Playlist)"},"encoding":"base64","extensions":["m3u"],"registered":false},{"content-type":"audio/x-ms-wax","friendly":{"en":"Microsoft Windows Media Audio Redirector"},"encoding":"base64","extensions":["wax"],"registered":false},{"content-type":"audio/x-ms-wma","friendly":{"en":"Microsoft Windows Media Audio"},"encoding":"base64","extensions":["wma"],"registered":false},{"content-type":"audio/x-ms-wmv","encoding":"base64","extensions":["wmv"],"registered":false},{"content-type":"audio/x-pn-realaudio","friendly":{"en":"Real Audio Sound"},"encoding":"base64","extensions":["ra","ram"],"registered":false},{"content-type":"audio/x-pn-realaudio-plugin","friendly":{"en":"Real Audio Sound"},"encoding":"base64","extensions":["rmp","rpm"],"registered":false},{"content-type":"audio/x-realaudio","encoding":"base64","extensions":["ra"],"registered":false},{"content-type":"audio/x-wav","friendly":{"en":"Waveform Audio File Format (WAV)"},"encoding":"base64","extensions":["wav"],"registered":false},{"content-type":"audio/xm","encoding":"base64","extensions":["xm"],"registered":false},{"content-type":"chemical/x-cdx","friendly":{"en":"ChemDraw eXchange file"},"encoding":"base64","extensions":["cdx"],"registered":false},{"content-type":"chemical/x-cif","friendly":{"en":"Crystallographic Interchange Format"},"encoding":"base64","extensions":["cif"],"registered":false},{"content-type":"chemical/x-cmdf","friendly":{"en":"CrystalMaker Data Format"},"encoding":"base64","extensions":["cmdf"],"registered":false},{"content-type":"chemical/x-cml","friendly":{"en":"Chemical Markup Language"},"encoding":"base64","extensions":["cml"],"registered":false},{"content-type":"chemical/x-csml","friendly":{"en":"Chemical Style Markup Language"},"encoding":"base64","extensions":["csml"],"registered":false},{"content-type":"chemical/x-pdb","encoding":"base64","extensions":["pdb"],"obsolete":true,"use-instead":"x-chemical/x-pdb","registered":false},{"content-type":"chemical/x-xyz","friendly":{"en":"XYZ File Format"},"encoding":"base64","extensions":["xyz"],"obsolete":true,"use-instead":"x-chemical/x-xyz","registered":false},{"content-type":"drawing/dwf","encoding":"base64","extensions":["dwf"],"obsolete":true,"use-instead":"x-drawing/dwf","registered":false},{"content-type":"font/collection","encoding":"base64","extensions":["ttc"],"xrefs":{"rfc":["rfc8081"],"template":["font/collection"]},"registered":true},{"content-type":"font/otf","encoding":"base64","extensions":["otf"],"xrefs":{"rfc":["rfc8081"],"template":["font/otf"]},"registered":true},{"content-type":"font/sfnt","encoding":"base64","xrefs":{"rfc":["rfc8081"],"template":["font/sfnt"]},"registered":true},{"content-type":"font/ttf","encoding":"base64","extensions":["ttf"],"xrefs":{"rfc":["rfc8081"],"template":["font/ttf"]},"registered":true},{"content-type":"font/woff","encoding":"base64","extensions":["woff"],"xrefs":{"rfc":["rfc8081"],"template":["font/woff"]},"registered":true},{"content-type":"font/woff2","encoding":"base64","extensions":["woff2"],"xrefs":{"rfc":["rfc8081"],"template":["font/woff2"]},"registered":true},{"content-type":"image/aces","encoding":"base64","xrefs":{"person":["Howard_Lukk","SMPTE"],"template":["image/aces"]},"registered":true},{"content-type":"image/avci","encoding":"base64","xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/avci"]},"registered":true},{"content-type":"image/avcs","encoding":"base64","xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/avcs"]},"registered":true},{"content-type":"image/avif","encoding":"base64","extensions":["avif"],"xrefs":{"person":["Alliance_for_Open_Media","Cyril_Concolato"],"template":["image/avif"]},"registered":true},{"content-type":"image/bmp","friendly":{"en":"Bitmap Image File"},"encoding":"base64","extensions":["bmp"],"xrefs":{"rfc":["rfc7903"],"template":["image/bmp"]},"registered":true},{"content-type":"image/cgm","friendly":{"en":"Computer Graphics Metafile"},"encoding":"base64","extensions":["cgm"],"xrefs":{"person":["Alan_Francis"],"template":["image/cgm"]},"registered":true},{"content-type":"image/cmu-raster","encoding":"base64","obsolete":true,"use-instead":"image/x-cmu-raster","registered":false},{"content-type":"image/dicom-rle","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","David_Clunie"],"template":["image/dicom-rle"]},"registered":true},{"content-type":"image/dpx","encoding":"base64","xrefs":{"person":["Director_of_Standards"]},"registered":true,"provisional":true},{"content-type":"image/emf","encoding":"base64","xrefs":{"rfc":["rfc7903"],"template":["image/emf"]},"registered":true},{"content-type":"image/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["image/example"]},"registered":true},{"content-type":"image/fits","encoding":"base64","xrefs":{"rfc":["rfc4047"],"template":["image/fits"]},"registered":true},{"content-type":"image/g3fax","friendly":{"en":"G3 Fax Image"},"encoding":"base64","extensions":["g3"],"xrefs":{"rfc":["rfc1494"],"template":["image/g3fax"]},"registered":true},{"content-type":"image/gif","friendly":{"en":"Graphics Interchange Format"},"encoding":"base64","extensions":["gif"],"xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"image/heic","encoding":"base64","extensions":["heic","hif"],"xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/heic"]},"registered":true},{"content-type":"image/heic-sequence","encoding":"base64","extensions":["heics","hif"],"xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/heic-sequence"]},"registered":true},{"content-type":"image/heif","encoding":"base64","extensions":["heif","hif"],"xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/heif"]},"registered":true},{"content-type":"image/heif-sequence","encoding":"base64","extensions":["heifs","hif"],"xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["image/heif-sequence"]},"registered":true},{"content-type":"image/hej2k","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/hej2k"]},"registered":true},{"content-type":"image/hsj2","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/hsj2"]},"registered":true},{"content-type":"image/ief","friendly":{"en":"Image Exchange Format"},"encoding":"base64","extensions":["ief"],"xrefs":{"rfc":["rfc1314"]},"registered":true},{"content-type":"image/j2is","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC_1-SC_29-WG_1_Convenor"]},"registered":true,"provisional":true},{"content-type":"image/jls","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","David_Clunie"],"template":["image/jls"]},"registered":true},{"content-type":"image/jp2","encoding":"base64","extensions":["jp2","jpg2"],"xrefs":{"rfc":["rfc3745"],"template":["image/jp2"]},"registered":true},{"content-type":"image/jpeg","friendly":{"en":"JPEG Image"},"encoding":"base64","extensions":["jpeg","jpg","jpe"],"xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"image/jph","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/jph"]},"registered":true},{"content-type":"image/jphc","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/jphc"]},"registered":true},{"content-type":"image/jpm","encoding":"base64","extensions":["jpm","jpgm"],"xrefs":{"rfc":["rfc3745"],"template":["image/jpm"]},"registered":true},{"content-type":"image/jpx","encoding":"base64","extensions":["jpx","jpf"],"xrefs":{"rfc":["rfc3745"],"template":["image/jpx"]},"registered":true},{"content-type":"image/jxl","encoding":"base64","xrefs":{"person":["Touradj_Ebrahimi"]},"registered":true,"provisional":true},{"content-type":"image/jxr","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/jxr"]},"registered":true},{"content-type":"image/jxrA","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/jxrA"]},"registered":true},{"content-type":"image/jxrS","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1","ITU-T"],"template":["image/jxrS"]},"registered":true},{"content-type":"image/jxs","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1"],"template":["image/jxs"]},"registered":true},{"content-type":"image/jxsc","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1"],"template":["image/jxsc"]},"registered":true},{"content-type":"image/jxsi","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1"],"template":["image/jxsi"]},"registered":true},{"content-type":"image/jxss","encoding":"base64","xrefs":{"person":["ISO-IEC_JTC1"],"template":["image/jxss"]},"registered":true},{"content-type":"image/ktx","friendly":{"en":"OpenGL Textures (KTX)"},"encoding":"base64","extensions":["ktx"],"xrefs":{"person":["Khronos","Mark_Callow"],"template":["image/ktx"]},"registered":true},{"content-type":"image/ktx2","encoding":"base64","xrefs":{"person":["Khronos","Mark_Callow"],"template":["image/ktx2"]},"registered":true},{"content-type":"image/naplps","encoding":"base64","xrefs":{"person":["Ilya_Ferber"],"template":["image/naplps"]},"registered":true},{"content-type":"image/pjpeg","docs":"Fixes a bug with IE6 and progressive JPEGs","encoding":"base64","registered":false},{"content-type":"image/png","friendly":{"en":"Portable Network Graphics (PNG)"},"encoding":"base64","extensions":["png"],"xrefs":{"person":["PNG_Working_Group","W3C"],"template":["image/png"]},"registered":true},{"content-type":"image/prs.btif","friendly":{"en":"BTIF"},"encoding":"base64","extensions":["btif"],"xrefs":{"person":["Ben_Simon"],"template":["image/prs.btif"]},"registered":true},{"content-type":"image/prs.pti","encoding":"base64","xrefs":{"person":["Juern_Laun"],"template":["image/prs.pti"]},"registered":true},{"content-type":"image/pwg-raster","encoding":"base64","xrefs":{"person":["Michael_Sweet"],"template":["image/pwg-raster"]},"registered":true},{"content-type":"image/sgi","encoding":"base64","extensions":["sgi"],"registered":false},{"content-type":"image/svg+xml","friendly":{"en":"Scalable Vector Graphics (SVG)"},"encoding":"8bit","extensions":["svg","svgz"],"xrefs":{"person":["W3C"],"uri":["http://www.w3.org/TR/SVG/mimereg.html"],"template":["image/svg+xml"]},"registered":true},{"content-type":"image/t38","encoding":"base64","xrefs":{"rfc":["rfc3362"],"template":["image/t38"]},"registered":true},{"content-type":"image/targa","encoding":"base64","extensions":["tga"],"obsolete":true,"use-instead":"image/x-targa","registered":false},{"content-type":"image/tiff","friendly":{"en":"Tagged Image File Format"},"encoding":"base64","extensions":["tiff","tif"],"xrefs":{"rfc":["rfc3302"],"template":["image/tiff"]},"registered":true},{"content-type":"image/tiff-fx","encoding":"base64","xrefs":{"rfc":["rfc3950"],"template":["image/tiff-fx"]},"registered":true},{"content-type":"image/vnd.adobe.photoshop","friendly":{"en":"Photoshop Document"},"encoding":"base64","extensions":["psd"],"xrefs":{"person":["Kim_Scarborough"],"template":["image/vnd.adobe.photoshop"]},"registered":true},{"content-type":"image/vnd.airzip.accelerator.azv","encoding":"base64","xrefs":{"person":["Gary_Clueit"],"template":["image/vnd.airzip.accelerator.azv"]},"registered":true},{"content-type":"image/vnd.cns.inf2","encoding":"base64","xrefs":{"person":["Ann_McLaughlin"],"template":["image/vnd.cns.inf2"]},"registered":true},{"content-type":"image/vnd.dece.graphic","friendly":{"en":"DECE Graphic"},"encoding":"base64","extensions":["uvg","uvi","uvvg","uvvi"],"xrefs":{"person":["Michael_A_Dolan"],"template":["image/vnd.dece.graphic"]},"registered":true},{"content-type":"image/vnd.dgn","encoding":"base64","extensions":["dgn"],"obsolete":true,"use-instead":"image/x-vnd.dgn","registered":false},{"content-type":"image/vnd.djvu","friendly":{"en":"DjVu"},"encoding":"base64","extensions":["djvu","djv"],"xrefs":{"person":["Leon_Bottou"],"template":["image/vnd.djvu"]},"registered":true},{"content-type":"image/vnd.dvb.subtitle","friendly":{"en":"Close Captioning - Subtitle"},"encoding":"base64","extensions":["sub"],"xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["image/vnd.dvb.subtitle"]},"registered":true},{"content-type":"image/vnd.dwg","friendly":{"en":"DWG Drawing"},"encoding":"base64","extensions":["dwg"],"xrefs":{"person":["Jodi_Moline"],"template":["image/vnd.dwg"]},"registered":true},{"content-type":"image/vnd.dxf","friendly":{"en":"AutoCAD DXF"},"encoding":"base64","extensions":["dxf"],"xrefs":{"person":["Jodi_Moline"],"template":["image/vnd.dxf"]},"registered":true},{"content-type":"image/vnd.fastbidsheet","friendly":{"en":"FastBid Sheet"},"encoding":"base64","extensions":["fbs"],"xrefs":{"person":["Scott_Becker"],"template":["image/vnd.fastbidsheet"]},"registered":true},{"content-type":"image/vnd.fpx","friendly":{"en":"FlashPix"},"encoding":"base64","extensions":["fpx"],"xrefs":{"person":["Marc_Douglas_Spencer"],"template":["image/vnd.fpx"]},"registered":true},{"content-type":"image/vnd.fst","friendly":{"en":"FAST Search & Transfer ASA"},"encoding":"base64","extensions":["fst"],"xrefs":{"person":["Arild_Fuldseth"],"template":["image/vnd.fst"]},"registered":true},{"content-type":"image/vnd.fujixerox.edmics-mmr","friendly":{"en":"EDMICS 2000"},"encoding":"base64","extensions":["mmr"],"xrefs":{"person":["Masanori_Onda"],"template":["image/vnd.fujixerox.edmics-mmr"]},"registered":true},{"content-type":"image/vnd.fujixerox.edmics-rlc","friendly":{"en":"EDMICS 2000"},"encoding":"base64","extensions":["rlc"],"xrefs":{"person":["Masanori_Onda"],"template":["image/vnd.fujixerox.edmics-rlc"]},"registered":true},{"content-type":"image/vnd.globalgraphics.pgb","encoding":"base64","extensions":["pgb"],"xrefs":{"person":["Martin_Bailey"],"template":["image/vnd.globalgraphics.pgb"]},"registered":true},{"content-type":"image/vnd.microsoft.icon","encoding":"base64","extensions":["ico"],"xrefs":{"person":["Simon_Butcher"],"template":["image/vnd.microsoft.icon"]},"registered":true},{"content-type":"image/vnd.mix","encoding":"base64","xrefs":{"person":["Saveen_Reddy"],"template":["image/vnd.mix"]},"registered":true},{"content-type":"image/vnd.mozilla.apng","encoding":"base64","xrefs":{"person":["Stuart_Parmenter"],"template":["image/vnd.mozilla.apng"]},"registered":true},{"content-type":"image/vnd.ms-modi","friendly":{"en":"Microsoft Document Imaging Format"},"encoding":"base64","extensions":["mdi"],"xrefs":{"person":["Gregory_Vaughan"],"template":["image/vnd.ms-modi"]},"registered":true},{"content-type":"image/vnd.ms-photo","encoding":"base64","extensions":["wdp"],"registered":false},{"content-type":"image/vnd.net-fpx","friendly":{"en":"FlashPix"},"encoding":"base64","extensions":["npx"],"xrefs":{"person":["Marc_Douglas_Spencer"],"template":["image/vnd.net-fpx"]},"registered":true},{"content-type":"image/vnd.net.fpx","encoding":"base64","obsolete":true,"use-instead":"image/vnd.net-fpx","registered":false},{"content-type":"image/vnd.pco.b16","encoding":"base64","xrefs":{"person":["Jan_Zeman","PCO_AG"],"template":["image/vnd.pco.b16"]},"registered":true},{"content-type":"image/vnd.radiance","encoding":"base64","xrefs":{"person":["Greg_Ward","Randolph_Fritz"],"template":["image/vnd.radiance"]},"registered":true},{"content-type":"image/vnd.sealed.png","encoding":"base64","xrefs":{"person":["David_Petersen"],"template":["image/vnd.sealed.png"]},"registered":true},{"content-type":"image/vnd.sealedmedia.softseal.gif","encoding":"base64","xrefs":{"person":["David_Petersen"],"template":["image/vnd.sealedmedia.softseal.gif"]},"registered":true},{"content-type":"image/vnd.sealedmedia.softseal.jpg","encoding":"base64","xrefs":{"person":["David_Petersen"],"template":["image/vnd.sealedmedia.softseal.jpg"]},"registered":true},{"content-type":"image/vnd.svf","encoding":"base64","xrefs":{"person":["Jodi_Moline"],"template":["image/vnd.svf"]},"registered":true},{"content-type":"image/vnd.tencent.tap","encoding":"base64","xrefs":{"person":["Ni_Hui"],"template":["image/vnd.tencent.tap"]},"registered":true},{"content-type":"image/vnd.valve.source.texture","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["image/vnd.valve.source.texture"]},"registered":true},{"content-type":"image/vnd.wap.wbmp","friendly":{"en":"WAP Bitamp (WBMP)"},"encoding":"base64","extensions":["wbmp"],"xrefs":{"person":["Peter_Stark"],"template":["image/vnd.wap.wbmp"]},"registered":true},{"content-type":"image/vnd.xiff","friendly":{"en":"eXtended Image File Format (XIFF)"},"encoding":"base64","extensions":["xif"],"xrefs":{"person":["Steven_Martin"],"template":["image/vnd.xiff"]},"registered":true},{"content-type":"image/vnd.zbrush.pcx","encoding":"base64","xrefs":{"person":["Chris_Charabaruk"],"template":["image/vnd.zbrush.pcx"]},"registered":true},{"content-type":"image/webp","friendly":{"en":"WebP Image"},"encoding":"base64","extensions":["webp"],"registered":false},{"content-type":"image/wmf","encoding":"base64","xrefs":{"rfc":["rfc7903"],"template":["image/wmf"]},"registered":true},{"content-type":"image/x-3ds","encoding":"base64","extensions":["3ds"],"registered":false},{"content-type":"image/x-adobe-dng","friendly":{"en":"Adobe Digital Negative"},"encoding":"base64","extensions":["dng"],"registered":false},{"content-type":"image/x-bmp","encoding":"base64","extensions":["bmp"],"obsolete":true,"use-instead":"image/bmp","registered":false},{"content-type":"image/x-canon-cr2","friendly":{"en":"Canon Raw Image"},"encoding":"base64","extensions":["cr2"],"registered":false},{"content-type":"image/x-canon-crw","friendly":{"en":"Canon Raw Image"},"encoding":"base64","extensions":["crw"],"registered":false},{"content-type":"image/x-cmu-raster","friendly":{"en":"CMU Image"},"encoding":"base64","extensions":["ras"],"registered":false},{"content-type":"image/x-cmx","friendly":{"en":"Corel Metafile Exchange (CMX)"},"encoding":"base64","extensions":["cmx"],"registered":false},{"content-type":"image/x-compressed-xcf","docs":"see-also:image/x-xcf","encoding":"base64","extensions":["xcfbz2","xcfgz"],"registered":false},{"content-type":"image/x-emf","encoding":"base64","obsolete":true,"use-instead":"image/emf","xrefs":{"rfc":["rfc7903"],"template":["image/emf"],"notes":["- DEPRECATED in favor of image/emf"]},"registered":true},{"content-type":"image/x-epson-erf","friendly":{"en":"Epson Raw Image"},"encoding":"base64","extensions":["erf"],"registered":false},{"content-type":"image/x-freehand","friendly":{"en":"FreeHand MX"},"encoding":"base64","extensions":["fh","fh4","fh5","fh7","fhc"],"registered":false},{"content-type":"image/x-fuji-raf","friendly":{"en":"Fuji Raw Image"},"encoding":"base64","extensions":["raf"],"registered":false},{"content-type":"image/x-hasselblad-3fr","encoding":"base64","extensions":["3fr"],"registered":false},{"content-type":"image/x-icon","friendly":{"en":"Icon Image"},"encoding":"base64","extensions":["ico"],"registered":false},{"content-type":"image/x-kodak-dcr","friendly":{"en":"Kodak Raw Image"},"encoding":"base64","extensions":["dcr"],"registered":false},{"content-type":"image/x-kodak-k25","friendly":{"en":"Kodak Raw Image"},"encoding":"base64","extensions":["k25"],"registered":false},{"content-type":"image/x-kodak-kdc","friendly":{"en":"Kodak Raw Image"},"encoding":"base64","extensions":["kdc"],"registered":false},{"content-type":"image/x-minolta-mrw","friendly":{"en":"Minolta Raw Image"},"encoding":"base64","extensions":["mrw"],"registered":false},{"content-type":"image/x-mrsid-image","encoding":"base64","extensions":["sid"],"registered":false},{"content-type":"image/x-ms-bmp","friendly":{"en":"Bitmap Image File"},"encoding":"base64","extensions":["bmp"],"obsolete":true,"registered":false},{"content-type":"image/x-nikon-nef","friendly":{"en":"Nikon Raw Image"},"encoding":"base64","extensions":["nef"],"registered":false},{"content-type":"image/x-olympus-orf","friendly":{"en":"Olympus Raw Image"},"encoding":"base64","extensions":["orf"],"registered":false},{"content-type":"image/x-paintshoppro","encoding":"base64","extensions":["psp","pspimage"],"registered":false},{"content-type":"image/x-panasonic-raw","friendly":{"en":"Panasonic Raw Image"},"encoding":"base64","extensions":["raw"],"registered":false},{"content-type":"image/x-pcx","friendly":{"en":"PCX Image"},"encoding":"base64","extensions":["pcx"],"registered":false},{"content-type":"image/x-pentax-pef","friendly":{"en":"Pentax Raw Image"},"encoding":"base64","extensions":["pef"],"registered":false},{"content-type":"image/x-pict","friendly":{"en":"PICT Image"},"encoding":"base64","extensions":["pct","pic"],"registered":false},{"content-type":"image/x-portable-anymap","friendly":{"en":"Portable Anymap Image"},"encoding":"base64","extensions":["pnm"],"registered":false},{"content-type":"image/x-portable-bitmap","friendly":{"en":"Portable Bitmap Format"},"encoding":"base64","extensions":["pbm"],"registered":false},{"content-type":"image/x-portable-graymap","friendly":{"en":"Portable Graymap Format"},"encoding":"base64","extensions":["pgm"],"registered":false},{"content-type":"image/x-portable-pixmap","friendly":{"en":"Portable Pixmap Format"},"encoding":"base64","extensions":["ppm"],"registered":false},{"content-type":"image/x-rgb","friendly":{"en":"Silicon Graphics RGB Bitmap"},"encoding":"base64","extensions":["rgb"],"registered":false},{"content-type":"image/x-sigma-x3f","friendly":{"en":"Sigma Raw Image"},"encoding":"base64","extensions":["x3f"],"registered":false},{"content-type":"image/x-sony-arw","friendly":{"en":"Sony Raw Image"},"encoding":"base64","extensions":["arw"],"registered":false},{"content-type":"image/x-sony-sr2","friendly":{"en":"Sony Raw Image"},"encoding":"base64","extensions":["sr2"],"registered":false},{"content-type":"image/x-sony-srf","friendly":{"en":"Sony Raw Image"},"encoding":"base64","extensions":["srf"],"registered":false},{"content-type":"image/x-targa","encoding":"base64","extensions":["tga"],"registered":false},{"content-type":"image/x-tga","encoding":"base64","extensions":["tga"],"registered":false},{"content-type":"image/x-vnd.dgn","encoding":"base64","extensions":["dgn"],"registered":false},{"content-type":"image/x-win-bmp","encoding":"base64","registered":false},{"content-type":"image/x-wmf","encoding":"base64","obsolete":true,"use-instead":"image/wmf","xrefs":{"rfc":["rfc7903"],"template":["image/wmf"],"notes":["- DEPRECATED in favor of image/wmf"]},"registered":true},{"content-type":"image/x-xbitmap","friendly":{"en":"X BitMap"},"encoding":"7bit","extensions":["xbm"],"registered":false},{"content-type":"image/x-xbm","encoding":"7bit","extensions":["xbm"],"registered":false},{"content-type":"image/x-xcf","encoding":"base64","extensions":["xcf"],"registered":false},{"content-type":"image/x-xpixmap","friendly":{"en":"X PixMap"},"encoding":"8bit","extensions":["xpm"],"registered":false},{"content-type":"image/x-xwindowdump","friendly":{"en":"X Window Dump"},"encoding":"base64","extensions":["xwd"],"registered":false},{"content-type":"message/CPIM","encoding":"base64","xrefs":{"rfc":["rfc3862"],"template":["message/CPIM"]},"registered":true},{"content-type":"message/delivery-status","encoding":"base64","xrefs":{"rfc":["rfc1894"],"template":["message/delivery-status"]},"registered":true},{"content-type":"message/disposition-notification","encoding":"base64","xrefs":{"rfc":["rfc8098"],"template":["message/disposition-notification"]},"registered":true},{"content-type":"message/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["message/example"]},"registered":true},{"content-type":"message/external-body","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"message/feedback-report","encoding":"base64","xrefs":{"rfc":["rfc5965"],"template":["message/feedback-report"]},"registered":true},{"content-type":"message/global","encoding":"base64","xrefs":{"rfc":["rfc6532"],"template":["message/global"]},"registered":true},{"content-type":"message/global-delivery-status","encoding":"base64","xrefs":{"rfc":["rfc6533"],"template":["message/global-delivery-status"]},"registered":true},{"content-type":"message/global-disposition-notification","encoding":"base64","xrefs":{"rfc":["rfc6533"],"template":["message/global-disposition-notification"]},"registered":true},{"content-type":"message/global-headers","encoding":"base64","xrefs":{"rfc":["rfc6533"],"template":["message/global-headers"]},"registered":true},{"content-type":"message/http","encoding":"base64","xrefs":{"draft":["RFC-ietf-httpbis-messaging-19"],"template":["message/http"]},"registered":true},{"content-type":"message/imdn+xml","encoding":"base64","xrefs":{"rfc":["rfc5438"],"template":["message/imdn+xml"]},"registered":true},{"content-type":"message/news","encoding":"8bit","obsolete":true,"xrefs":{"rfc":["rfc5537"],"person":["Henry_Spencer"],"template":["message/news"],"notes":["(OBSOLETED by )"]},"registered":true},{"content-type":"message/partial","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"message/rfc822","friendly":{"en":"Email Message"},"encoding":"8bit","extensions":["eml","mime"],"xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"message/s-http","encoding":"base64","obsolete":true,"xrefs":{"rfc":["rfc2660"],"uri":["https://datatracker.ietf.org/doc/status-change-http-experiments-to-historic"],"template":["message/s-http"],"notes":["(OBSOLETE)"]},"registered":true},{"content-type":"message/sip","encoding":"base64","xrefs":{"rfc":["rfc3261"],"template":["message/sip"]},"registered":true},{"content-type":"message/sipfrag","encoding":"base64","xrefs":{"rfc":["rfc3420"],"template":["message/sipfrag"]},"registered":true},{"content-type":"message/tracking-status","encoding":"base64","xrefs":{"rfc":["rfc3886"],"template":["message/tracking-status"]},"registered":true},{"content-type":"message/vnd.si.simp","encoding":"base64","obsolete":true,"xrefs":{"person":["Nicholas_Parks_Young"],"template":["message/vnd.si.simp"],"notes":["(OBSOLETED by request)"]},"registered":true},{"content-type":"message/vnd.wfa.wsc","encoding":"base64","xrefs":{"person":["Mick_Conley"],"template":["message/vnd.wfa.wsc"]},"registered":true},{"content-type":"model/3mf","encoding":"base64","xrefs":{"uri":["http://www.3mf.io/specification"],"person":["Michael_Sweet","_3MF"],"template":["model/3mf"]},"registered":true},{"content-type":"model/e57","encoding":"base64","xrefs":{"person":["ASTM"],"template":["model/e57"]},"registered":true},{"content-type":"model/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["model/example"]},"registered":true},{"content-type":"model/gltf+json","encoding":"base64","xrefs":{"person":["Khronos","Uli_Klumpp"],"template":["model/gltf+json"]},"registered":true},{"content-type":"model/gltf-binary","encoding":"base64","xrefs":{"person":["Khronos","Saurabh_Bhatia"],"template":["model/gltf-binary"]},"registered":true},{"content-type":"model/iges","friendly":{"en":"Initial Graphics Exchange Specification (IGES)"},"encoding":"base64","extensions":["igs","iges"],"xrefs":{"person":["Curtis_Parks"],"template":["model/iges"]},"registered":true},{"content-type":"model/mesh","friendly":{"en":"Mesh Data Type"},"encoding":"base64","extensions":["msh","mesh","silo"],"xrefs":{"rfc":["rfc2077"]},"registered":true},{"content-type":"model/mtl","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","Luiza_Kowalczyk"],"template":["model/mtl"]},"registered":true},{"content-type":"model/obj","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","Luiza_Kowalczyk"],"template":["model/obj"]},"registered":true},{"content-type":"model/step","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["model/step"]},"registered":true},{"content-type":"model/step+xml","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["model/step+xml"]},"registered":true},{"content-type":"model/step+zip","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["model/step+zip"]},"registered":true},{"content-type":"model/step-xml+zip","encoding":"base64","xrefs":{"person":["Dana_Tripp","ISO-TC_184-SC_4"],"template":["model/step-xml+zip"]},"registered":true},{"content-type":"model/stl","encoding":"base64","xrefs":{"person":["DICOM_Standards_Committee","Lisa_Spellman"],"template":["model/stl"]},"registered":true},{"content-type":"model/vnd.collada+xml","friendly":{"en":"COLLADA"},"encoding":"base64","extensions":["dae"],"xrefs":{"person":["James_Riordon"],"template":["model/vnd.collada+xml"]},"registered":true},{"content-type":"model/vnd.dwf","friendly":{"en":"Autodesk Design Web Format (DWF)"},"encoding":"base64","extensions":["dwf"],"xrefs":{"person":["Jason_Pratt"],"template":["model/vnd.dwf"]},"registered":true},{"content-type":"model/vnd.flatland.3dml","encoding":"base64","xrefs":{"person":["Michael_Powers"],"template":["model/vnd.flatland.3dml"]},"registered":true},{"content-type":"model/vnd.gdl","friendly":{"en":"Geometric Description Language (GDL)"},"encoding":"base64","extensions":["gdl"],"xrefs":{"person":["Attila_Babits"],"template":["model/vnd.gdl"]},"registered":true},{"content-type":"model/vnd.gs-gdl","encoding":"base64","xrefs":{"person":["Attila_Babits"],"template":["model/vnd.gs-gdl"]},"registered":true},{"content-type":"model/vnd.gtw","friendly":{"en":"Gen-Trix Studio"},"encoding":"base64","extensions":["gtw"],"xrefs":{"person":["Yutaka_Ozaki"],"template":["model/vnd.gtw"]},"registered":true},{"content-type":"model/vnd.moml+xml","encoding":"base64","xrefs":{"person":["Christopher_Brooks"],"template":["model/vnd.moml+xml"]},"registered":true},{"content-type":"model/vnd.mts","friendly":{"en":"Virtue MTS"},"encoding":"base64","extensions":["mts"],"xrefs":{"person":["Boris_Rabinovitch"],"template":["model/vnd.mts"]},"registered":true},{"content-type":"model/vnd.opengex","encoding":"base64","xrefs":{"person":["Eric_Lengyel"],"template":["model/vnd.opengex"]},"registered":true},{"content-type":"model/vnd.parasolid.transmit.binary","encoding":"base64","extensions":["x_b","xmt_bin"],"xrefs":{"person":["Parasolid"],"template":["model/vnd.parasolid.transmit.binary"]},"registered":true},{"content-type":"model/vnd.parasolid.transmit.text","encoding":"quoted-printable","extensions":["x_t","xmt_txt"],"xrefs":{"person":["Parasolid"],"template":["model/vnd.parasolid.transmit.text"]},"registered":true},{"content-type":"model/vnd.pytha.pyox","encoding":"base64","xrefs":{"person":["Daniel_Flassig"],"template":["model/vnd.pytha.pyox"]},"registered":true},{"content-type":"model/vnd.rosette.annotated-data-model","encoding":"base64","xrefs":{"person":["Benson_Margulies"],"template":["model/vnd.rosette.annotated-data-model"]},"registered":true},{"content-type":"model/vnd.sap.vds","encoding":"base64","xrefs":{"person":["Igor_Afanasyev","SAP_SE"],"template":["model/vnd.sap.vds"]},"registered":true},{"content-type":"model/vnd.usdz+zip","encoding":"base64","xrefs":{"person":["Sebastian_Grassia"],"template":["model/vnd.usdz+zip"]},"registered":true},{"content-type":"model/vnd.valve.source.compiled-map","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["model/vnd.valve.source.compiled-map"]},"registered":true},{"content-type":"model/vnd.vtu","friendly":{"en":"Virtue VTU"},"encoding":"base64","extensions":["vtu"],"xrefs":{"person":["Boris_Rabinovitch"],"template":["model/vnd.vtu"]},"registered":true},{"content-type":"model/vrml","friendly":{"en":"Virtual Reality Modeling Language"},"encoding":"base64","extensions":["wrl","vrml"],"xrefs":{"rfc":["rfc2077"]},"registered":true},{"content-type":"model/x3d+binary","encoding":"base64","extensions":["x3db","x3dbz"],"registered":false},{"content-type":"model/x3d+fastinfoset","encoding":"base64","xrefs":{"person":["Web3D_X3D"],"template":["model/x3d+fastinfoset"]},"registered":true},{"content-type":"model/x3d+vrml","encoding":"base64","extensions":["x3dv","x3dvz"],"registered":false},{"content-type":"model/x3d+xml","encoding":"base64","extensions":["x3d","x3dz"],"xrefs":{"person":["Web3D","Web3D_X3D"],"template":["model/x3d+xml"]},"registered":true},{"content-type":"model/x3d-vrml","encoding":"base64","xrefs":{"person":["Web3D","Web3D_X3D"],"template":["model/x3d-vrml"]},"registered":true},{"content-type":"multipart/alternative","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"multipart/appledouble","encoding":"8bit","xrefs":{"person":["Patrik_Faltstrom"],"template":["multipart/appledouble"]},"registered":true},{"content-type":"multipart/byteranges","encoding":"base64","xrefs":{"draft":["RFC-ietf-httpbis-semantics-19"],"template":["multipart/byteranges"]},"registered":true},{"content-type":"multipart/digest","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"multipart/encrypted","encoding":"base64","xrefs":{"rfc":["rfc1847"],"template":["multipart/encrypted"]},"registered":true},{"content-type":"multipart/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["multipart/example"]},"registered":true},{"content-type":"multipart/form-data","encoding":"base64","xrefs":{"rfc":["rfc7578"],"template":["multipart/form-data"]},"registered":true},{"content-type":"multipart/header-set","encoding":"base64","xrefs":{"person":["Dave_Crocker"],"template":["multipart/header-set"]},"registered":true},{"content-type":"multipart/mixed","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"multipart/multilingual","encoding":"base64","xrefs":{"rfc":["rfc8255"],"template":["multipart/multilingual"]},"registered":true},{"content-type":"multipart/parallel","encoding":"8bit","xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"multipart/related","encoding":"base64","xrefs":{"rfc":["rfc2387"],"template":["multipart/related"]},"registered":true},{"content-type":"multipart/report","encoding":"base64","xrefs":{"rfc":["rfc6522"],"template":["multipart/report"]},"registered":true},{"content-type":"multipart/signed","encoding":"base64","xrefs":{"rfc":["rfc1847"],"template":["multipart/signed"]},"registered":true},{"content-type":"multipart/vnd.bint.med-plus","encoding":"base64","xrefs":{"person":["Heinz-Peter_Schütz"],"template":["multipart/vnd.bint.med-plus"]},"registered":true},{"content-type":"multipart/voice-message","encoding":"base64","xrefs":{"rfc":["rfc3801"],"template":["multipart/voice-message"]},"registered":true},{"content-type":"multipart/x-gzip","encoding":"base64","registered":false},{"content-type":"multipart/x-mixed-replace","encoding":"base64","xrefs":{"person":["Robin_Berjon","W3C"],"template":["multipart/x-mixed-replace"]},"registered":true},{"content-type":"multipart/x-parallel","encoding":"base64","obsolete":true,"use-instead":"multipart/parallel","registered":false},{"content-type":"multipart/x-tar","encoding":"base64","registered":false},{"content-type":"multipart/x-ustar","encoding":"base64","registered":false},{"content-type":"multipart/x-www-form-urlencoded","encoding":"base64","obsolete":true,"use-instead":"application/x-www-form-urlencoded","registered":false},{"content-type":"multipart/x-zip","encoding":"base64","registered":false},{"content-type":"text/1d-interleaved-parityfec","encoding":"quoted-printable","xrefs":{"rfc":["rfc6015"],"template":["text/1d-interleaved-parityfec"]},"registered":true},{"content-type":"text/cache-manifest","encoding":"quoted-printable","extensions":["appcache","manifest"],"xrefs":{"person":["Robin_Berjon","W3C"],"template":["text/cache-manifest"]},"registered":true},{"content-type":"text/calendar","friendly":{"en":"iCalendar"},"encoding":"quoted-printable","extensions":["ics","ifb"],"xrefs":{"rfc":["rfc5545"],"template":["text/calendar"]},"registered":true},{"content-type":"text/comma-separated-values","encoding":"8bit","extensions":["csv"],"obsolete":true,"use-instead":"text/csv","registered":false},{"content-type":"text/cql","encoding":"quoted-printable","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["text/cql"]},"registered":true},{"content-type":"text/cql-expression","encoding":"quoted-printable","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["text/cql-expression"]},"registered":true},{"content-type":"text/cql-identifier","encoding":"quoted-printable","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["text/cql-identifier"]},"registered":true},{"content-type":"text/css","friendly":{"en":"Cascading Style Sheets (CSS)"},"encoding":"8bit","extensions":["css"],"xrefs":{"rfc":["rfc2318"],"template":["text/css"]},"registered":true},{"content-type":"text/csv","friendly":{"en":"Comma-Separated Values"},"encoding":"8bit","extensions":["csv"],"xrefs":{"rfc":["rfc4180","rfc7111"],"template":["text/csv"]},"registered":true},{"content-type":"text/csv-schema","encoding":"quoted-printable","xrefs":{"person":["David_Underdown","National_Archives_UK"],"template":["text/csv-schema"]},"registered":true},{"content-type":"text/directory","encoding":"quoted-printable","obsolete":true,"xrefs":{"rfc":["rfc2425","rfc6350"],"template":["text/directory"],"notes":["- DEPRECATED by RFC6350"]},"registered":true},{"content-type":"text/dns","encoding":"quoted-printable","xrefs":{"rfc":["rfc4027"],"template":["text/dns"]},"registered":true},{"content-type":"text/ecmascript","encoding":"quoted-printable","extensions":["es","ecma"],"obsolete":true,"use-instead":"application/ecmascript","xrefs":{"rfc":["rfc4329"],"template":["text/ecmascript"],"notes":["(OBSOLETED in favor of application/ecmascript)"]},"registered":true},{"content-type":"text/encaprtp","encoding":"quoted-printable","xrefs":{"rfc":["rfc6849"],"template":["text/encaprtp"]},"registered":true},{"content-type":"text/enriched","encoding":"quoted-printable","xrefs":{"rfc":["rfc1896"]},"registered":true},{"content-type":"text/example","encoding":"quoted-printable","xrefs":{"rfc":["rfc4735"],"template":["text/example"]},"registered":true},{"content-type":"text/fhirpath","encoding":"quoted-printable","xrefs":{"person":["Bryn_Rhodes","HL7"],"template":["text/fhirpath"]},"registered":true},{"content-type":"text/flexfec","encoding":"quoted-printable","xrefs":{"rfc":["rfc8627"],"template":["text/flexfec"]},"registered":true},{"content-type":"text/fwdred","encoding":"quoted-printable","xrefs":{"rfc":["rfc6354"],"template":["text/fwdred"]},"registered":true},{"content-type":"text/gff3","encoding":"quoted-printable","xrefs":{"person":["Sequence_Ontology"],"template":["text/gff3"]},"registered":true},{"content-type":"text/grammar-ref-list","encoding":"quoted-printable","xrefs":{"rfc":["rfc6787"],"template":["text/grammar-ref-list"]},"registered":true},{"content-type":"text/html","friendly":{"en":"HyperText Markup Language (HTML)"},"encoding":"8bit","extensions":["html","htm","htmlx","shtml","htx"],"xrefs":{"person":["Robin_Berjon","W3C"],"template":["text/html"]},"registered":true},{"content-type":"text/javascript","encoding":"quoted-printable","extensions":["js","mjs"],"obsolete":true,"use-instead":"application/javascript","xrefs":{"rfc":["rfc4329"],"template":["text/javascript"],"notes":["(OBSOLETED in favor of application/javascript)"]},"registered":true},{"content-type":"text/jcr-cnd","encoding":"quoted-printable","xrefs":{"person":["Peeter_Piegaze"],"template":["text/jcr-cnd"]},"registered":true},{"content-type":"text/markdown","encoding":"quoted-printable","extensions":["markdown","md","mkd"],"xrefs":{"rfc":["rfc7763"],"template":["text/markdown"]},"registered":true},{"content-type":"text/mizar","encoding":"quoted-printable","xrefs":{"person":["Jesse_Alama"],"template":["text/mizar"]},"registered":true},{"content-type":"text/n3","friendly":{"en":"Notation3"},"encoding":"quoted-printable","extensions":["n3"],"xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["text/n3"]},"registered":true},{"content-type":"text/nfo","encoding":"quoted-printable","xrefs":{"person":["Sean_Leonard"]},"registered":true,"provisional":true},{"content-type":"text/parameters","encoding":"quoted-printable","xrefs":{"rfc":["rfc7826"],"template":["text/parameters"]},"registered":true},{"content-type":"text/parityfec","encoding":"quoted-printable","xrefs":{"rfc":["rfc3009"],"template":["text/parityfec"]},"registered":true},{"content-type":"text/plain","friendly":{"en":"Text File"},"encoding":"quoted-printable","extensions":["txt","asc","c","cc","h","hh","cpp","hpp","dat","hlp","conf","def","doc","in","list","log","rst","text","textile"],"xrefs":{"rfc":["rfc2046","rfc3676","rfc5147"]},"registered":true},{"content-type":"text/provenance-notation","encoding":"quoted-printable","xrefs":{"person":["Ivan_Herman","W3C"],"template":["text/provenance-notation"]},"registered":true},{"content-type":"text/prs.fallenstein.rst","encoding":"quoted-printable","extensions":["rst"],"xrefs":{"person":["Benja_Fallenstein"],"template":["text/prs.fallenstein.rst"]},"registered":true},{"content-type":"text/prs.lines.tag","friendly":{"en":"PRS Lines Tag"},"encoding":"quoted-printable","extensions":["dsc"],"xrefs":{"person":["John_Lines"],"template":["text/prs.lines.tag"]},"registered":true},{"content-type":"text/prs.prop.logic","encoding":"quoted-printable","xrefs":{"person":["Hans-Dieter_A._Hiep"],"template":["text/prs.prop.logic"]},"registered":true},{"content-type":"text/raptorfec","encoding":"quoted-printable","xrefs":{"rfc":["rfc6682"],"template":["text/raptorfec"]},"registered":true},{"content-type":"text/RED","encoding":"quoted-printable","xrefs":{"rfc":["rfc4102"],"template":["text/RED"]},"registered":true},{"content-type":"text/rfc822-headers","encoding":"quoted-printable","xrefs":{"rfc":["rfc6522"],"template":["text/rfc822-headers"]},"registered":true},{"content-type":"text/richtext","friendly":{"en":"Rich Text Format (RTF)"},"encoding":"8bit","extensions":["rtx"],"xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"text/rtf","encoding":"8bit","extensions":["rtf"],"xrefs":{"person":["Paul_Lindner"],"template":["text/rtf"]},"registered":true},{"content-type":"text/rtp-enc-aescm128","encoding":"quoted-printable","xrefs":{"person":["_3GPP"],"template":["text/rtp-enc-aescm128"]},"registered":true},{"content-type":"text/rtploopback","encoding":"quoted-printable","xrefs":{"rfc":["rfc6849"],"template":["text/rtploopback"]},"registered":true},{"content-type":"text/rtx","encoding":"quoted-printable","xrefs":{"rfc":["rfc4588"],"template":["text/rtx"]},"registered":true},{"content-type":"text/sgml","friendly":{"en":"Standard Generalized Markup Language (SGML)"},"encoding":"quoted-printable","extensions":["sgml","sgm"],"xrefs":{"rfc":["rfc1874"],"template":["text/SGML"]},"registered":true},{"content-type":"text/shaclc","encoding":"quoted-printable","xrefs":{"person":["Vladimir_Alexiev","W3C_SHACL_Community_Group"],"template":["text/shaclc"]},"registered":true},{"content-type":"text/shex","encoding":"quoted-printable","xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["text/shex"]},"registered":true},{"content-type":"text/spdx","encoding":"quoted-printable","xrefs":{"person":["Linux_Foundation","Rose_Judge"],"template":["text/spdx"]},"registered":true},{"content-type":"text/strings","encoding":"quoted-printable","xrefs":{"person":["IEEE-ISTO-PWG-PPP"],"template":["text/strings"]},"registered":true},{"content-type":"text/t140","encoding":"quoted-printable","xrefs":{"rfc":["rfc4103"],"template":["text/t140"]},"registered":true},{"content-type":"text/tab-separated-values","friendly":{"en":"Tab Separated Values"},"encoding":"quoted-printable","extensions":["tsv"],"xrefs":{"person":["Paul_Lindner"],"template":["text/tab-separated-values"]},"registered":true},{"content-type":"text/troff","friendly":{"en":"troff"},"encoding":"8bit","extensions":["t","tr","roff","troff","man","me","ms"],"xrefs":{"rfc":["rfc4263"],"template":["text/troff"]},"registered":true},{"content-type":"text/turtle","friendly":{"en":"Turtle (Terse RDF Triple Language)"},"encoding":"quoted-printable","extensions":["ttl"],"xrefs":{"person":["Eric_Prudhommeaux","W3C"],"template":["text/turtle"]},"registered":true},{"content-type":"text/ulpfec","encoding":"quoted-printable","xrefs":{"rfc":["rfc5109"],"template":["text/ulpfec"]},"registered":true},{"content-type":"text/uri-list","friendly":{"en":"URI Resolution Services"},"encoding":"quoted-printable","extensions":["uri","uris","urls"],"xrefs":{"rfc":["rfc2483"],"template":["text/uri-list"]},"registered":true},{"content-type":"text/vcard","encoding":"quoted-printable","extensions":["vcard"],"xrefs":{"rfc":["rfc6350"],"template":["text/vcard"]},"registered":true,"signature":true},{"content-type":"text/vnd.a","encoding":"quoted-printable","xrefs":{"person":["Regis_Dehoux"],"template":["text/vnd.a"]},"registered":true},{"content-type":"text/vnd.abc","encoding":"quoted-printable","xrefs":{"person":["Steve_Allen"],"template":["text/vnd.abc"]},"registered":true},{"content-type":"text/vnd.ascii-art","encoding":"quoted-printable","xrefs":{"person":["Kim_Scarborough"],"template":["text/vnd.ascii-art"]},"registered":true},{"content-type":"text/vnd.curl","friendly":{"en":"Curl - Applet"},"encoding":"quoted-printable","extensions":["curl"],"xrefs":{"person":["Robert_Byrnes"],"template":["text/vnd.curl"]},"registered":true},{"content-type":"text/vnd.curl.dcurl","friendly":{"en":"Curl - Detached Applet"},"encoding":"quoted-printable","extensions":["dcurl"],"registered":false},{"content-type":"text/vnd.curl.mcurl","friendly":{"en":"Curl - Manifest File"},"encoding":"quoted-printable","extensions":["mcurl"],"registered":false},{"content-type":"text/vnd.curl.scurl","friendly":{"en":"Curl - Source Code"},"encoding":"quoted-printable","extensions":["scurl"],"registered":false},{"content-type":"text/vnd.debian.copyright","encoding":"quoted-printable","xrefs":{"person":["Charles_Plessy"],"template":["text/vnd.debian.copyright"]},"registered":true},{"content-type":"text/vnd.DMClientScript","encoding":"quoted-printable","xrefs":{"person":["Dan_Bradley"],"template":["text/vnd.DMClientScript"]},"registered":true},{"content-type":"text/vnd.dvb.subtitle","encoding":"quoted-printable","extensions":["sub"],"xrefs":{"person":["Michael_Lagally","Peter_Siebert"],"template":["text/vnd.dvb.subtitle"]},"registered":true},{"content-type":"text/vnd.esmertec.theme-descriptor","encoding":"quoted-printable","xrefs":{"person":["Stefan_Eilemann"],"template":["text/vnd.esmertec.theme-descriptor"]},"registered":true},{"content-type":"text/vnd.familysearch.gedcom","encoding":"quoted-printable","xrefs":{"person":["Gordon_Clarke"],"template":["text/vnd.familysearch.gedcom"]},"registered":true},{"content-type":"text/vnd.ficlab.flt","encoding":"quoted-printable","xrefs":{"person":["Steve_Gilberd"],"template":["text/vnd.ficlab.flt"]},"registered":true},{"content-type":"text/vnd.flatland.3dml","encoding":"quoted-printable","obsolete":true,"use-instead":"model/vnd.flatland.3dml","registered":false},{"content-type":"text/vnd.fly","friendly":{"en":"mod_fly / fly.cgi"},"encoding":"quoted-printable","extensions":["fly"],"xrefs":{"person":["John-Mark_Gurney"],"template":["text/vnd.fly"]},"registered":true},{"content-type":"text/vnd.fmi.flexstor","friendly":{"en":"FLEXSTOR"},"encoding":"quoted-printable","extensions":["flx"],"xrefs":{"person":["Kari_E._Hurtta"],"template":["text/vnd.fmi.flexstor"]},"registered":true},{"content-type":"text/vnd.gml","encoding":"quoted-printable","xrefs":{"person":["Mi_Tar"],"template":["text/vnd.gml"]},"registered":true},{"content-type":"text/vnd.graphviz","friendly":{"en":"Graphviz"},"encoding":"quoted-printable","extensions":["gv"],"xrefs":{"person":["John_Ellson"],"template":["text/vnd.graphviz"]},"registered":true},{"content-type":"text/vnd.hans","encoding":"quoted-printable","xrefs":{"person":["Hill_Hanxv"],"template":["text/vnd.hans"]},"registered":true},{"content-type":"text/vnd.hgl","encoding":"quoted-printable","xrefs":{"person":["Heungsub_Lee"],"template":["text/vnd.hgl"]},"registered":true},{"content-type":"text/vnd.in3d.3dml","friendly":{"en":"In3D - 3DML"},"encoding":"quoted-printable","extensions":["3dml"],"xrefs":{"person":["Michael_Powers"],"template":["text/vnd.in3d.3dml"]},"registered":true},{"content-type":"text/vnd.in3d.spot","friendly":{"en":"In3D - 3DML"},"encoding":"quoted-printable","extensions":["spot"],"xrefs":{"person":["Michael_Powers"],"template":["text/vnd.in3d.spot"]},"registered":true},{"content-type":"text/vnd.IPTC.NewsML","encoding":"quoted-printable","xrefs":{"person":["IPTC"],"template":["text/vnd.IPTC.NewsML"]},"registered":true},{"content-type":"text/vnd.IPTC.NITF","encoding":"quoted-printable","xrefs":{"person":["IPTC"],"template":["text/vnd.IPTC.NITF"]},"registered":true},{"content-type":"text/vnd.latex-z","encoding":"quoted-printable","xrefs":{"person":["Mikusiak_Lubos"],"template":["text/vnd.latex-z"]},"registered":true},{"content-type":"text/vnd.motorola.reflex","encoding":"quoted-printable","xrefs":{"person":["Mark_Patton"],"template":["text/vnd.motorola.reflex"]},"registered":true},{"content-type":"text/vnd.ms-mediapackage","encoding":"quoted-printable","xrefs":{"person":["Jan_Nelson"],"template":["text/vnd.ms-mediapackage"]},"registered":true},{"content-type":"text/vnd.net2phone.commcenter.command","encoding":"quoted-printable","extensions":["ccc"],"xrefs":{"person":["Feiyu_Xie"],"template":["text/vnd.net2phone.commcenter.command"]},"registered":true},{"content-type":"text/vnd.radisys.msml-basic-layout","encoding":"quoted-printable","xrefs":{"rfc":["rfc5707"],"template":["text/vnd.radisys.msml-basic-layout"]},"registered":true},{"content-type":"text/vnd.senx.warpscript","encoding":"quoted-printable","xrefs":{"person":["Pierre_Papin"],"template":["text/vnd.senx.warpscript"]},"registered":true},{"content-type":"text/vnd.si.uricatalogue","encoding":"quoted-printable","obsolete":true,"xrefs":{"person":["Nicholas_Parks_Young"],"template":["text/vnd.si.uricatalogue"],"notes":["(OBSOLETED by request)"]},"registered":true},{"content-type":"text/vnd.sosi","encoding":"quoted-printable","xrefs":{"person":["Petter_Reinholdtsen"],"template":["text/vnd.sosi"]},"registered":true},{"content-type":"text/vnd.sun.j2me.app-descriptor","friendly":{"en":"J2ME App Descriptor"},"encoding":"8bit","extensions":["jad"],"xrefs":{"person":["Gary_Adams"],"template":["text/vnd.sun.j2me.app-descriptor"]},"registered":true},{"content-type":"text/vnd.trolltech.linguist","encoding":"quoted-printable","xrefs":{"person":["David_Lee_Lambert"],"template":["text/vnd.trolltech.linguist"]},"registered":true},{"content-type":"text/vnd.wap.si","encoding":"quoted-printable","extensions":["si"],"xrefs":{"person":["WAP-Forum"],"template":["text/vnd.wap.si"]},"registered":true},{"content-type":"text/vnd.wap.sl","encoding":"quoted-printable","extensions":["sl"],"xrefs":{"person":["WAP-Forum"],"template":["text/vnd.wap.sl"]},"registered":true},{"content-type":"text/vnd.wap.wml","friendly":{"en":"Wireless Markup Language (WML)"},"encoding":"quoted-printable","extensions":["wml"],"xrefs":{"person":["Peter_Stark"],"template":["text/vnd.wap.wml"]},"registered":true},{"content-type":"text/vnd.wap.wmlscript","friendly":{"en":"Wireless Markup Language Script (WMLScript)"},"encoding":"quoted-printable","extensions":["wmls"],"xrefs":{"person":["Peter_Stark"],"template":["text/vnd.wap.wmlscript"]},"registered":true},{"content-type":"text/vtt","encoding":"quoted-printable","extensions":["vtt"],"xrefs":{"person":["Silvia_Pfeiffer","W3C"],"template":["text/vtt"]},"registered":true},{"content-type":"text/x-asm","friendly":{"en":"Assembler Source File"},"encoding":"quoted-printable","extensions":["asm","s"],"registered":false},{"content-type":"text/x-c","friendly":{"en":"C Source File"},"encoding":"quoted-printable","extensions":["c","cc","cpp","cxx","dic","h","hh"],"registered":false},{"content-type":"text/x-coffescript","encoding":"8bit","extensions":["coffee"],"registered":false},{"content-type":"text/x-component","encoding":"8bit","extensions":["htc"],"registered":false},{"content-type":"text/x-fortran","friendly":{"en":"Fortran Source File"},"encoding":"quoted-printable","extensions":["f","f77","f90","for"],"registered":false},{"content-type":"text/x-java-source","friendly":{"en":"Java Source File"},"encoding":"quoted-printable","extensions":["java"],"registered":false},{"content-type":"text/x-nfo","encoding":"quoted-printable","extensions":["nfo"],"registered":false},{"content-type":"text/x-opml","encoding":"quoted-printable","extensions":["opml"],"registered":false},{"content-type":"text/x-pascal","friendly":{"en":"Pascal Source File"},"encoding":"quoted-printable","extensions":["p","pas"],"registered":false},{"content-type":"text/x-rtf","encoding":"8bit","extensions":["rtf"],"obsolete":true,"use-instead":"text/rtf","registered":false},{"content-type":"text/x-setext","friendly":{"en":"Setext"},"encoding":"quoted-printable","extensions":["etx"],"registered":false},{"content-type":"text/x-sfv","encoding":"quoted-printable","extensions":["sfv"],"registered":false},{"content-type":"text/x-uuencode","friendly":{"en":"UUEncode"},"encoding":"quoted-printable","extensions":["uu"],"registered":false},{"content-type":"text/x-vcalendar","friendly":{"en":"vCalendar"},"encoding":"8bit","extensions":["vcs"],"registered":false},{"content-type":"text/x-vcard","friendly":{"en":"vCard"},"encoding":"8bit","extensions":["vcf"],"registered":false,"signature":true},{"content-type":"text/x-vnd.flatland.3dml","encoding":"quoted-printable","obsolete":true,"use-instead":"model/vnd.flatland.3dml","registered":false},{"content-type":"text/x-yaml","encoding":"8bit","extensions":["yaml","yml"],"registered":false},{"content-type":"text/xml","encoding":"8bit","extensions":["xml","dtd","xsd"],"xrefs":{"rfc":["rfc7303"],"template":["text/xml"]},"registered":true},{"content-type":"text/xml-external-parsed-entity","encoding":"quoted-printable","xrefs":{"rfc":["rfc7303"],"template":["text/xml-external-parsed-entity"]},"registered":true},{"content-type":"video/1d-interleaved-parityfec","encoding":"base64","xrefs":{"rfc":["rfc6015"],"template":["video/1d-interleaved-parityfec"]},"registered":true},{"content-type":"video/3gpp","friendly":{"en":"3GP"},"encoding":"base64","extensions":["3gp","3gpp"],"xrefs":{"rfc":["rfc3839","rfc6381"],"template":["video/3gpp"]},"registered":true},{"content-type":"video/3gpp-tt","encoding":"base64","xrefs":{"rfc":["rfc4396"],"template":["video/3gpp-tt"]},"registered":true},{"content-type":"video/3gpp2","friendly":{"en":"3GP2"},"encoding":"base64","extensions":["3g2","3gpp2"],"xrefs":{"rfc":["rfc4393","rfc6381"],"template":["video/3gpp2"]},"registered":true},{"content-type":"video/AV1","encoding":"base64","xrefs":{"person":["Alliance_for_Open_Media"],"template":["video/AV1"]},"registered":true},{"content-type":"video/BMPEG","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/BMPEG"]},"registered":true},{"content-type":"video/BT656","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/BT656"]},"registered":true},{"content-type":"video/CelB","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/CelB"]},"registered":true},{"content-type":"video/dl","encoding":"base64","extensions":["dl"],"obsolete":true,"use-instead":"video/x-dl","registered":false},{"content-type":"video/DV","encoding":"base64","extensions":["dv"],"xrefs":{"rfc":["rfc6469"],"template":["video/DV"]},"registered":true},{"content-type":"video/encaprtp","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["video/encaprtp"]},"registered":true},{"content-type":"video/example","encoding":"base64","xrefs":{"rfc":["rfc4735"],"template":["video/example"]},"registered":true},{"content-type":"video/FFV1","encoding":"base64","xrefs":{"rfc":["rfc9043"],"template":["video/FFV1"]},"registered":true},{"content-type":"video/flexfec","encoding":"base64","xrefs":{"rfc":["rfc8627"],"template":["video/flexfec"]},"registered":true},{"content-type":"video/gl","encoding":"base64","extensions":["gl"],"obsolete":true,"use-instead":"video/x-gl","registered":false},{"content-type":"video/H261","friendly":{"en":"H.261"},"encoding":"base64","extensions":["h261"],"xrefs":{"rfc":["rfc4587"],"template":["video/H261"]},"registered":true},{"content-type":"video/H263","friendly":{"en":"H.263"},"encoding":"base64","extensions":["h263"],"xrefs":{"rfc":["rfc3555"],"template":["video/H263"]},"registered":true},{"content-type":"video/H263-1998","encoding":"base64","xrefs":{"rfc":["rfc4629"],"template":["video/H263-1998"]},"registered":true},{"content-type":"video/H263-2000","encoding":"base64","xrefs":{"rfc":["rfc4629"],"template":["video/H263-2000"]},"registered":true},{"content-type":"video/H264","friendly":{"en":"H.264"},"encoding":"base64","extensions":["h264"],"xrefs":{"rfc":["rfc6184"],"template":["video/H264"]},"registered":true},{"content-type":"video/H264-RCDO","encoding":"base64","xrefs":{"rfc":["rfc6185"],"template":["video/H264-RCDO"]},"registered":true},{"content-type":"video/H264-SVC","encoding":"base64","xrefs":{"rfc":["rfc6190"],"template":["video/H264-SVC"]},"registered":true},{"content-type":"video/H265","encoding":"base64","xrefs":{"rfc":["rfc7798"],"template":["video/H265"]},"registered":true},{"content-type":"video/iso.segment","encoding":"base64","xrefs":{"person":["David_Singer","ISO-IEC_JTC1"],"template":["video/iso.segment"]},"registered":true},{"content-type":"video/JPEG","friendly":{"en":"JPGVideo"},"encoding":"base64","extensions":["jpgv"],"xrefs":{"rfc":["rfc3555"],"template":["video/JPEG"]},"registered":true},{"content-type":"video/jpeg2000","encoding":"base64","xrefs":{"rfc":["rfc5371","rfc5372"],"template":["video/jpeg2000"]},"registered":true},{"content-type":"video/jpm","friendly":{"en":"JPEG 2000 Compound Image File Format"},"encoding":"base64","extensions":["jpgm","jpm"],"registered":false},{"content-type":"video/jxsv","encoding":"base64","xrefs":{"rfc":["rfc9134"],"template":["video/jxsv"]},"registered":true},{"content-type":"video/MJ2","friendly":{"en":"Motion JPEG 2000"},"encoding":"base64","extensions":["mj2","mjp2"],"xrefs":{"rfc":["rfc3745"],"template":["video/mj2"]},"registered":true},{"content-type":"video/MP1S","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/MP1S"]},"registered":true},{"content-type":"video/MP2P","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/MP2P"]},"registered":true},{"content-type":"video/MP2T","encoding":"base64","extensions":["ts","mts","m2ts","cpi","clpi","mpl","mpls","bdm"],"xrefs":{"rfc":["rfc3555"],"template":["video/MP2T"]},"registered":true},{"content-type":"video/mp4","friendly":{"en":"MPEG-4 Video"},"encoding":"base64","extensions":["mp4","mpg4","f4v","f4p","mp4v"],"xrefs":{"rfc":["rfc4337","rfc6381"],"template":["video/mp4"]},"registered":true},{"content-type":"video/MP4V-ES","encoding":"base64","xrefs":{"rfc":["rfc6416"],"template":["video/MP4V-ES"]},"registered":true},{"content-type":"video/mpeg","friendly":{"en":"MPEG Video"},"encoding":"base64","extensions":["mp2","mp3g","mpe","mpeg","mpg","m1v","m2v"],"xrefs":{"rfc":["rfc2045","rfc2046"]},"registered":true},{"content-type":"video/mpeg4-generic","encoding":"base64","xrefs":{"rfc":["rfc3640"],"template":["video/mpeg4-generic"]},"registered":true},{"content-type":"video/MPV","encoding":"base64","xrefs":{"rfc":["rfc3555"],"template":["video/MPV"]},"registered":true},{"content-type":"video/nv","encoding":"base64","xrefs":{"rfc":["rfc4856"],"template":["video/nv"]},"registered":true},{"content-type":"video/ogg","friendly":{"en":"Ogg Video"},"encoding":"base64","extensions":["ogg","ogv"],"xrefs":{"rfc":["rfc5334","rfc7845"],"template":["video/ogg"]},"registered":true},{"content-type":"video/parityfec","encoding":"base64","xrefs":{"rfc":["rfc3009"],"template":["video/parityfec"]},"registered":true},{"content-type":"video/pointer","encoding":"base64","xrefs":{"rfc":["rfc2862"],"template":["video/pointer"]},"registered":true},{"content-type":"video/quicktime","friendly":{"en":"Quicktime Video"},"encoding":"base64","extensions":["qt","mov"],"xrefs":{"rfc":["rfc6381"],"person":["Paul_Lindner"],"template":["video/quicktime"]},"registered":true},{"content-type":"video/raptorfec","encoding":"base64","xrefs":{"rfc":["rfc6682"],"template":["video/raptorfec"]},"registered":true},{"content-type":"video/raw","encoding":"base64","xrefs":{"rfc":["rfc4175"],"template":["video/raw"]},"registered":true},{"content-type":"video/rtp-enc-aescm128","encoding":"base64","xrefs":{"person":["_3GPP"],"template":["video/rtp-enc-aescm128"]},"registered":true},{"content-type":"video/rtploopback","encoding":"base64","xrefs":{"rfc":["rfc6849"],"template":["video/rtploopback"]},"registered":true},{"content-type":"video/rtx","encoding":"base64","xrefs":{"rfc":["rfc4588"],"template":["video/rtx"]},"registered":true},{"content-type":"video/scip","encoding":"base64","xrefs":{"person":["Daniel_Hanson","Michael_Faller","SCIP"],"template":["video/scip"]},"registered":true},{"content-type":"video/smpte291","encoding":"base64","xrefs":{"rfc":["rfc8331"],"template":["video/smpte291"]},"registered":true},{"content-type":"video/SMPTE292M","encoding":"base64","xrefs":{"rfc":["rfc3497"],"template":["video/SMPTE292M"]},"registered":true},{"content-type":"video/ulpfec","encoding":"base64","xrefs":{"rfc":["rfc5109"],"template":["video/ulpfec"]},"registered":true},{"content-type":"video/vc1","encoding":"base64","xrefs":{"rfc":["rfc4425"],"template":["video/vc1"]},"registered":true},{"content-type":"video/vc2","encoding":"base64","xrefs":{"rfc":["rfc8450"],"template":["video/vc2"]},"registered":true},{"content-type":"video/vnd.CCTV","encoding":"base64","xrefs":{"person":["Frank_Rottmann"],"template":["video/vnd.CCTV"]},"registered":true},{"content-type":"video/vnd.dece.hd","friendly":{"en":"DECE High Definition Video"},"encoding":"base64","extensions":["uvh","uvvh"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.hd"]},"registered":true},{"content-type":"video/vnd.dece.mobile","friendly":{"en":"DECE Mobile Video"},"encoding":"base64","extensions":["uvm","uvvm"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.mobile"]},"registered":true},{"content-type":"video/vnd.dece.mp4","encoding":"base64","xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.mp4"]},"registered":true},{"content-type":"video/vnd.dece.pd","friendly":{"en":"DECE PD Video"},"encoding":"base64","extensions":["uvp","uvvp"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.pd"]},"registered":true},{"content-type":"video/vnd.dece.sd","friendly":{"en":"DECE SD Video"},"encoding":"base64","extensions":["uvs","uvvs"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.sd"]},"registered":true},{"content-type":"video/vnd.dece.video","friendly":{"en":"DECE Video"},"encoding":"base64","extensions":["uvv","uvvv"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.dece.video"]},"registered":true},{"content-type":"video/vnd.directv.mpeg","encoding":"base64","xrefs":{"person":["Nathan_Zerbe"],"template":["video/vnd.directv.mpeg"]},"registered":true},{"content-type":"video/vnd.directv.mpeg-tts","encoding":"base64","xrefs":{"person":["Nathan_Zerbe"],"template":["video/vnd.directv.mpeg-tts"]},"registered":true},{"content-type":"video/vnd.dlna.mpeg-tts","encoding":"base64","xrefs":{"person":["Edwin_Heredia"],"template":["video/vnd.dlna.mpeg-tts"]},"registered":true},{"content-type":"video/vnd.dvb.file","encoding":"base64","extensions":["dvb"],"xrefs":{"person":["Kevin_Murray","Peter_Siebert"],"template":["video/vnd.dvb.file"]},"registered":true},{"content-type":"video/vnd.fvt","friendly":{"en":"FAST Search & Transfer ASA"},"encoding":"base64","extensions":["fvt"],"xrefs":{"person":["Arild_Fuldseth"],"template":["video/vnd.fvt"]},"registered":true},{"content-type":"video/vnd.hns.video","encoding":"base64","xrefs":{"person":["Swaminathan"],"template":["video/vnd.hns.video"]},"registered":true},{"content-type":"video/vnd.iptvforum.1dparityfec-1010","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.1dparityfec-1010"]},"registered":true},{"content-type":"video/vnd.iptvforum.1dparityfec-2005","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.1dparityfec-2005"]},"registered":true},{"content-type":"video/vnd.iptvforum.2dparityfec-1010","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.2dparityfec-1010"]},"registered":true},{"content-type":"video/vnd.iptvforum.2dparityfec-2005","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.2dparityfec-2005"]},"registered":true},{"content-type":"video/vnd.iptvforum.ttsavc","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.ttsavc"]},"registered":true},{"content-type":"video/vnd.iptvforum.ttsmpeg2","encoding":"base64","xrefs":{"person":["Shuji_Nakamura"],"template":["video/vnd.iptvforum.ttsmpeg2"]},"registered":true},{"content-type":"video/vnd.motorola.video","encoding":"base64","xrefs":{"person":["Tom_McGinty"],"template":["video/vnd.motorola.video"]},"registered":true},{"content-type":"video/vnd.motorola.videop","encoding":"base64","xrefs":{"person":["Tom_McGinty"],"template":["video/vnd.motorola.videop"]},"registered":true},{"content-type":"video/vnd.mpegurl","friendly":{"en":"MPEG Url"},"encoding":"8bit","extensions":["mxu","m4u"],"xrefs":{"person":["Heiko_Recktenwald"],"template":["video/vnd.mpegurl"]},"registered":true},{"content-type":"video/vnd.ms-playready.media.pyv","friendly":{"en":"Microsoft PlayReady Ecosystem Video"},"encoding":"base64","extensions":["pyv"],"xrefs":{"person":["Steve_DiAcetis"],"template":["video/vnd.ms-playready.media.pyv"]},"registered":true},{"content-type":"video/vnd.nokia.interleaved-multimedia","encoding":"base64","extensions":["nim"],"xrefs":{"person":["Petteri_Kangaslampi"],"template":["video/vnd.nokia.interleaved-multimedia"]},"registered":true},{"content-type":"video/vnd.nokia.mp4vr","encoding":"base64","xrefs":{"person":["Miska_M._Hannuksela"],"template":["video/vnd.nokia.mp4vr"]},"registered":true},{"content-type":"video/vnd.nokia.videovoip","encoding":"base64","xrefs":{"person":["Nokia"],"template":["video/vnd.nokia.videovoip"]},"registered":true},{"content-type":"video/vnd.objectvideo","encoding":"base64","extensions":["mp4","m4v"],"xrefs":{"person":["John_Clark"],"template":["video/vnd.objectvideo"]},"registered":true},{"content-type":"video/vnd.radgamettools.bink","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["video/vnd.radgamettools.bink"]},"registered":true},{"content-type":"video/vnd.radgamettools.smacker","encoding":"base64","xrefs":{"person":["Henrik_Andersson"],"template":["video/vnd.radgamettools.smacker"]},"registered":true},{"content-type":"video/vnd.sealed.mpeg1","encoding":"base64","extensions":["s11"],"xrefs":{"person":["David_Petersen"],"template":["video/vnd.sealed.mpeg1"]},"registered":true},{"content-type":"video/vnd.sealed.mpeg4","encoding":"base64","extensions":["smpg","s14"],"xrefs":{"person":["David_Petersen"],"template":["video/vnd.sealed.mpeg4"]},"registered":true},{"content-type":"video/vnd.sealed.swf","encoding":"base64","extensions":["sswf","ssw"],"xrefs":{"person":["David_Petersen"],"template":["video/vnd.sealed.swf"]},"registered":true},{"content-type":"video/vnd.sealedmedia.softseal.mov","encoding":"base64","extensions":["smov","smo","s1q"],"xrefs":{"person":["David_Petersen"],"template":["video/vnd.sealedmedia.softseal.mov"]},"registered":true},{"content-type":"video/vnd.uvvu.mp4","friendly":{"en":"DECE MP4"},"encoding":"base64","extensions":["uvu","uvvu"],"xrefs":{"person":["Michael_A_Dolan"],"template":["video/vnd.uvvu.mp4"]},"registered":true},{"content-type":"video/vnd.vivo","friendly":{"en":"Vivo"},"encoding":"base64","extensions":["viv","vivo"],"xrefs":{"person":["John_Wolfe"],"template":["video/vnd.vivo"]},"registered":true},{"content-type":"video/vnd.youtube.yt","encoding":"base64","xrefs":{"person":["Google"],"template":["video/vnd.youtube.yt"]},"registered":true},{"content-type":"video/VP8","encoding":"base64","xrefs":{"rfc":["rfc7741"],"template":["video/VP8"]},"registered":true},{"content-type":"video/VP9","encoding":"base64","xrefs":{"draft":["RFC-ietf-payload-vp9-16"],"template":["video/VP9"]},"registered":true},{"content-type":"video/webm","friendly":{"en":"Open Web Media Project - Video"},"encoding":"base64","extensions":["webm"],"registered":false},{"content-type":"video/x-dl","encoding":"base64","extensions":["dl"],"registered":false},{"content-type":"video/x-dv","encoding":"base64","extensions":["dv"],"obsolete":true,"use-instead":"video/DV","registered":false},{"content-type":"video/x-f4v","friendly":{"en":"Flash Video"},"encoding":"base64","extensions":["f4v"],"registered":false},{"content-type":"video/x-fli","friendly":{"en":"FLI/FLC Animation Format"},"encoding":"base64","extensions":["fli"],"registered":false},{"content-type":"video/x-flv","friendly":{"en":"Flash Video"},"encoding":"base64","extensions":["flv"],"registered":false},{"content-type":"video/x-gl","encoding":"base64","extensions":["gl"],"registered":false},{"content-type":"video/x-ivf","encoding":"base64","extensions":["ivf"],"registered":false},{"content-type":"video/x-m4v","friendly":{"en":"M4v"},"encoding":"base64","extensions":["m4v"],"registered":false},{"content-type":"video/x-matroska","encoding":"base64","extensions":["mk3d","mks","mkv"],"registered":false},{"content-type":"video/x-mng","encoding":"base64","extensions":["mng"],"registered":false},{"content-type":"video/x-motion-jpeg","encoding":"base64","extensions":["mjpg","mjpeg"],"registered":false},{"content-type":"video/x-ms-asf","friendly":{"en":"Microsoft Advanced Systems Format (ASF)"},"encoding":"base64","extensions":["asf","asx"],"registered":false},{"content-type":"video/x-ms-vob","encoding":"base64","extensions":["vob"],"registered":false},{"content-type":"video/x-ms-wm","friendly":{"en":"Microsoft Windows Media"},"encoding":"base64","extensions":["wm"],"registered":false},{"content-type":"video/x-ms-wmv","friendly":{"en":"Microsoft Windows Media Video"},"encoding":"base64","extensions":["wmv"],"registered":false},{"content-type":"video/x-ms-wmx","friendly":{"en":"Microsoft Windows Media Audio/Video Playlist"},"encoding":"base64","extensions":["wmx"],"registered":false},{"content-type":"video/x-ms-wvx","friendly":{"en":"Microsoft Windows Media Video Playlist"},"encoding":"base64","extensions":["wvx"],"registered":false},{"content-type":"video/x-msvideo","friendly":{"en":"Audio Video Interleave (AVI)"},"encoding":"base64","extensions":["avi"],"registered":false},{"content-type":"video/x-sgi-movie","friendly":{"en":"SGI Movie"},"encoding":"base64","extensions":["movie"],"registered":false},{"content-type":"video/x-smv","encoding":"base64","extensions":["smv"],"registered":false},{"content-type":"x-chemical/x-pdb","encoding":"base64","extensions":["pdb"],"registered":false},{"content-type":"x-chemical/x-xyz","encoding":"base64","extensions":["xyz"],"registered":false},{"content-type":"x-conference/x-cooltalk","friendly":{"en":"CoolTalk"},"encoding":"base64","extensions":["ice"],"registered":false},{"content-type":"x-drawing/dwf","encoding":"base64","extensions":["dwf"],"registered":false},{"content-type":"x-world/x-vrml","encoding":"base64","extensions":["wrl","vrml"],"registered":false}] diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.content_type.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.content_type.column new file mode 100644 index 0000000..f43b5d3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.content_type.column @@ -0,0 +1,2383 @@ +application/1d-interleaved-parityfec +application/3gpdash-qoe-report+xml +application/3gpp-ims+xml +application/3gppHal+json +application/3gppHalForms+json +application/A2L +application/acad +application/access mdf mda mdb mde +application/ace+cbor +application/activemessage +application/activity+json +application/akn+xml +application/alto-costmap+json +application/alto-costmapfilter+json +application/alto-directory+json +application/alto-endpointcost+json +application/alto-endpointcostparams+json +application/alto-endpointprop+json +application/alto-endpointpropparams+json +application/alto-error+json +application/alto-networkmap+json +application/alto-networkmapfilter+json +application/alto-updatestreamcontrol+json +application/alto-updatestreamparams+json +application/AML +application/andrew-inset ez +application/appledouble +application/applefile +application/applixware aw +application/at+jwt +application/ATF +application/ATFX +application/atom+xml atom +application/atomcat+xml atomcat +application/atomdeleted+xml +application/atomicmail +application/atomsvc+xml atomsvc +application/atsc-dwd+xml +application/atsc-dynamic-event-message +application/atsc-held+xml +application/atsc-rdt+json +application/atsc-rsat+xml +application/ATXML +application/auth-policy+xml +application/bacnet-xdd+zip +application/batch-SMTP +application/beep+xml +application/bleeper bleep +application/calendar+json +application/calendar+xml +application/call-completion +application/cals-1840 +application/cals1840 +application/cap+xml +application/captive+json +application/cbor +application/cbor-seq +application/cccex +application/ccmp+xml +application/ccxml+xml ccxml +application/CDFX+XML +application/cdmi-capability cdmia +application/cdmi-container cdmic +application/cdmi-domain cdmid +application/cdmi-object cdmio +application/cdmi-queue cdmiq +application/cdni +application/CEA +application/cea-2018+xml +application/cellml+xml +application/cert-chain+cbor +application/cfw +application/city+json +application/clariscad +application/clr +application/clue+xml +application/clue_info+xml +application/cms +application/cnrp+xml +application/coap-group+json +application/coap-payload +application/commonground +application/conference-info+xml +application/cose +application/cose-key +application/cose-key-set +application/cpl+xml +application/csrattrs +application/csta+xml +application/CSTAdata+xml +application/csvm+json +application/cu-seeme cu +application/cwt +application/cybercash +application/dash+xml +application/dash-patch+xml +application/dashdelta +application/davmount+xml davmount +application/dca-rft +application/DCD +application/dec-dx +application/dialog-info+xml +application/dicom dcm +application/dicom+json +application/dicom+xml +application/DII +application/DIT +application/dns +application/dns+json +application/dns-message +application/docbook+xml dbk +application/dots+cbor +application/drafting +application/dskpp+xml +application/dssc+der dssc +application/dssc+xml xdssc +application/dvcs +application/dxf +application/ecmascript ecma es +application/EDI-consent +application/EDI-X12 +application/EDIFACT +application/efi +application/elm+json +application/elm+xml +application/EmergencyCallData.cap+xml +application/EmergencyCallData.Comment+xml +application/EmergencyCallData.Control+xml +application/EmergencyCallData.DeviceInfo+xml +application/EmergencyCallData.eCall.MSD +application/EmergencyCallData.ProviderInfo+xml +application/EmergencyCallData.ServiceInfo+xml +application/EmergencyCallData.SubscriberInfo+xml +application/EmergencyCallData.VEDS+xml +application/emma+xml emma +application/emotionml+xml +application/encaprtp +application/epp+xml +application/epub+zip epub +application/eshop +application/example +application/excel xls xlt +application/exi exi +application/expect-ct-report+json +application/express +application/fastinfoset +application/fastsoap +application/fdt+xml +application/fhir+json +application/fhir+xml +application/fits +application/flexfec +application/font-sfnt otf ttf +application/font-tdpfr pfr +application/font-woff woff woff2 +application/fractals +application/framework-attributes+xml +application/futuresplash spl +application/geo+json +application/geo+json-seq +application/geopackage+sqlite3 +application/geoxacml+xml +application/ghostview +application/gltf-buffer +application/gml+xml gml +application/gpx+xml gpx +application/gxf gxf +application/gzip gz +application/H224 +application/held+xml +application/hep hep +application/http +application/hyperstudio stk +application/i-deas +application/ibe-key-request+xml +application/ibe-pkg-reply+xml +application/ibe-pp-data +application/iges +application/im-iscomposing+xml +application/imagemap imagemap imap +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/inkml+xml ink inkml +application/ion +application/iotp +application/ipfix ipfix +application/ipp +application/isup +application/its+xml +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js mjs sj +application/jf2feed+json +application/jose +application/jose+json +application/jrd+json +application/jscalendar+json +application/json json +application/json-nd +application/json-patch+json +application/json-seq +application/jsonml+json jsonml +application/jwk+json +application/jwk-set+json +application/jwt +application/kpml-request+xml +application/kpml-response+xml +application/ld+json +application/lgr+xml +application/link-format +application/load-control+xml +application/lost+xml lostxml +application/lostsync+xml +application/lotus-123 wks +application/lpf+zip +application/LXF +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macbinary +application/macwriteii +application/mads+xml mads +application/manifest+json webmanifest +application/marc mrc +application/marcxml+xml mrcx +application/mathcad mcd +application/mathematica ma mb nb +application/mathematica-old +application/mathml+xml mathml +application/mathml-content+xml +application/mathml-presentation+xml +application/mbms-associated-procedure-description+xml +application/mbms-deregister+xml +application/mbms-envelope+xml +application/mbms-msk+xml +application/mbms-msk-response+xml +application/mbms-protection-description+xml +application/mbms-reception-report+xml +application/mbms-register+xml +application/mbms-register-response+xml +application/mbms-schedule+xml +application/mbms-user-service-description+xml +application/mbox mbox +application/media-policy-dataset+xml +application/media_control+xml +application/mediaservercontrol+xml mscml +application/merge-patch+json +application/metalink+xml metalink +application/metalink4+xml meta4 +application/mets+xml mets +application/MF4 +application/mikey +application/mipc +application/missing-blocks+cbor-seq +application/mmt-aei+xml +application/mmt-usd+xml +application/mods+xml mods +application/moss-keys +application/moss-signature +application/mosskey-data +application/mosskey-request +application/mp21 m21 mp21 +application/mp4 mp4 mpg4 mp4s +application/mpeg4-generic +application/mpeg4-iod +application/mpeg4-iod-xmt +application/mrb-consumer+xml +application/mrb-publish+xml +application/msc-ivr+xml +application/msc-mixer+xml +application/msword doc dot wrd +application/mud+json +application/multipart-core +application/mxf mxf +application/n-quads +application/n-triples +application/nasdata +application/netcdf +application/netcdf nc cdf +application/news-checkgroups +application/news-groupinfo +application/news-message-id +application/news-transmission +application/nlsml+xml +application/node +application/nss +application/oauth-authz-req+jwt +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh class ani pgp gpg so dll dylib bpk deploy dist distz dump elc lrf mar pkg ipa +application/oda oda +application/odm+json +application/odm+xml +application/ODX +application/oebps-package+xml opf +application/ogg ogx +application/omdoc+xml omdoc +application/onenote onepkg onetmp onetoc onetoc2 +application/opc-nodeset+xml +application/oscore +application/oxps oxps +application/p21 +application/p21+zip +application/p2p-overlay+xml +application/parityfec +application/passport +application/patch-ops-error+xml xer +application/pdf pdf ai +application/PDX +application/pem-certificate-chain +application/pgp-encrypted pgp gpg +application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +application/pidf+xml +application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs12 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkcs8 p8 +application/pkcs8-encrypted +application/pkix-attr-cert ac +application/pkix-cert cer +application/pkix-crl crl +application/pkix-keyinfo +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +application/poc-settings+xml +application/postscript eps ps ai +application/powerpoint ppt pps pot +application/ppsp-tracker+json +application/pro_eng +application/problem+json +application/problem+xml +application/provenance+xml +application/prs.alvestrand.titrax-sheet +application/prs.cww cw cww +application/prs.cyn +application/prs.hpub+zip +application/prs.nprend rnd rct +application/prs.plucker +application/prs.rdf-xml-crypt +application/prs.xsf+xml +application/pskc+xml pskcxml +application/pvd+json +application/qsig +application/quicktimeplayer qtl +application/raptorfec +application/rdap+json +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +application/remote-printing +application/remote_printing +application/reports+json +application/reputon+json +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +application/rfc+xml +application/rif+xml +application/riscos +application/rlmi+xml +application/rls-services+xml rs +application/route-apd+xml +application/route-s-tsid+xml +application/route-usd+xml +application/rpki-checklist +application/rpki-ghostbusters gbr +application/rpki-manifest mft +application/rpki-publication +application/rpki-roa roa +application/rpki-updown +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +application/rtploopback +application/rtx +application/samlassertion+xml +application/samlmetadata+xml +application/sarif+json +application/sarif-external-properties+json +application/sbe +application/sbml+xml sbml +application/scaip+xml +application/scim+json +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +application/secevent+jwt +application/senml+cbor +application/senml+json +application/senml+xml +application/senml-etch+cbor +application/senml-etch+json +application/senml-exi +application/sensml+cbor +application/sensml+json +application/sensml+xml +application/sensml-exi +application/sep+xml +application/sep-exi +application/session-info +application/set +application/set-payment +application/set-payment-initiation setpay +application/set-registration +application/set-registration-initiation setreg +application/sgml sgml +application/sgml-open-catalog soc +application/shf+xml shf +application/sieve siv +application/signed-exchange +application/simple-filter+xml +application/simple-message-summary +application/simpleSymbolContainer +application/sipc +application/SLA +application/slate +application/smil smi smil +application/smil+xml smi smil +application/smpte336m +application/soap+fastinfoset +application/soap+xml +application/solids +application/sparql-query rq +application/sparql-results+xml srx +application/spdx+json +application/spirits-event+xml +application/sql +application/srgs gram +application/srgs+xml grxml +application/sru+xml sru +application/ssdl+xml ssdl +application/ssml+xml ssml +application/STEP +application/stix+json +application/swid+xml +application/tamp-apex-update +application/tamp-apex-update-confirm +application/tamp-community-update +application/tamp-community-update-confirm +application/tamp-error +application/tamp-sequence-adjust +application/tamp-sequence-adjust-confirm +application/tamp-status-query +application/tamp-status-response +application/tamp-update +application/tamp-update-confirm +application/taxii+json +application/td+json +application/tei+xml tei teicorpus +application/TETRA_ISI +application/thraud+xml tfi +application/timestamp-query +application/timestamp-reply +application/timestamped-data tsd +application/tlsrpt+gzip +application/tlsrpt+json +application/tnauthlist +application/token-introspection+jwt +application/toolbook tbk +application/trickle-ice-sdpfrag +application/trig +application/ttml+xml +application/tve-trigger +application/tzif +application/tzif-leap +application/ulpfec +application/urc-grpsheet+xml +application/urc-ressheet+xml +application/urc-targetdesc+xml +application/urc-uisocketdesc+xml +application/vcard+json +application/vcard+xml +application/vda +application/vemmi +application/VMSBACKUP bck +application/vnd.1000minds.decision-model+xml +application/vnd.3gpp-prose+xml +application/vnd.3gpp-prose-pc3ch+xml +application/vnd.3gpp-v2x-local-service-information +application/vnd.3gpp.5gnas +application/vnd.3gpp.access-transfer-events+xml +application/vnd.3gpp.bsf+xml +application/vnd.3gpp.GMOP+xml +application/vnd.3gpp.gtpc +application/vnd.3gpp.interworking-data +application/vnd.3gpp.lpp +application/vnd.3gpp.mc-signalling-ear +application/vnd.3gpp.mcdata-affiliation-command+xml +application/vnd.3gpp.mcdata-info+xml +application/vnd.3gpp.mcdata-payload +application/vnd.3gpp.mcdata-service-config+xml +application/vnd.3gpp.mcdata-signalling +application/vnd.3gpp.mcdata-ue-config+xml +application/vnd.3gpp.mcdata-user-profile+xml +application/vnd.3gpp.mcptt-affiliation-command+xml +application/vnd.3gpp.mcptt-floor-request+xml +application/vnd.3gpp.mcptt-info+xml +application/vnd.3gpp.mcptt-location-info+xml +application/vnd.3gpp.mcptt-mbms-usage-info+xml +application/vnd.3gpp.mcptt-service-config+xml +application/vnd.3gpp.mcptt-signed+xml +application/vnd.3gpp.mcptt-ue-config+xml +application/vnd.3gpp.mcptt-ue-init-config+xml +application/vnd.3gpp.mcptt-user-profile+xml +application/vnd.3gpp.mcvideo-affiliation-command+xml +application/vnd.3gpp.mcvideo-affiliation-info+xml +application/vnd.3gpp.mcvideo-info+xml +application/vnd.3gpp.mcvideo-location-info+xml +application/vnd.3gpp.mcvideo-mbms-usage-info+xml +application/vnd.3gpp.mcvideo-service-config+xml +application/vnd.3gpp.mcvideo-transmission-request+xml +application/vnd.3gpp.mcvideo-ue-config+xml +application/vnd.3gpp.mcvideo-user-profile+xml +application/vnd.3gpp.mid-call+xml +application/vnd.3gpp.ngap +application/vnd.3gpp.pfcp +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +application/vnd.3gpp.s1ap +application/vnd.3gpp.sms sms +application/vnd.3gpp.sms+xml +application/vnd.3gpp.srvcc-ext+xml +application/vnd.3gpp.SRVCC-info+xml +application/vnd.3gpp.state-and-event-info+xml +application/vnd.3gpp.ussd+xml +application/vnd.3gpp2.bcmcsinfo+xml +application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3lightssoftware.imagescal +application/vnd.3M.Post-it-Notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.air-application-installer-package+zip air +application/vnd.adobe.flash.movie +application/vnd.adobe.formscentral.fcdt fcdt +application/vnd.adobe.fxp fxp fxpl +application/vnd.adobe.partial-upload +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +application/vnd.aether.imp +application/vnd.afpc.afplinedata +application/vnd.afpc.afplinedata-pagedef +application/vnd.afpc.cmoca-cmresource +application/vnd.afpc.foca-charset +application/vnd.afpc.foca-codedfont +application/vnd.afpc.foca-codepage +application/vnd.afpc.modca +application/vnd.afpc.modca-cmtable +application/vnd.afpc.modca-formdef +application/vnd.afpc.modca-mediummap +application/vnd.afpc.modca-objectcontainer +application/vnd.afpc.modca-overlay +application/vnd.afpc.modca-pagesegment +application/vnd.age +application/vnd.ah-barcode +application/vnd.ahead.space ahead +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amadeus+json +application/vnd.amazon.ebook azw +application/vnd.amazon.mobi8-ebook +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +application/vnd.amundsen.maze+xml +application/vnd.android.ota +application/vnd.android.package-archive apk +application/vnd.anki +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apache.arrow.file +application/vnd.apache.arrow.stream +application/vnd.apache.thrift.binary +application/vnd.apache.thrift.compact +application/vnd.apache.thrift.json +application/vnd.api+json +application/vnd.aplextor.warrp+json +application/vnd.apothekende.reservation+json +application/vnd.apple.installer+xml mpkg +application/vnd.apple.keynote +application/vnd.apple.mpegurl m3u8 +application/vnd.apple.numbers +application/vnd.apple.pages +application/vnd.apple.pkpass pkpass +application/vnd.arastra.swi +application/vnd.aristanetworks.swi swi +application/vnd.artisan+json +application/vnd.artsquare +application/vnd.astraea-software.iota iota +application/vnd.audiograph aep +application/vnd.autopackage +application/vnd.avalon+json +application/vnd.avistar+xml +application/vnd.balsamiq.bmml+xml +application/vnd.balsamiq.bmpr +application/vnd.banana-accounting +application/vnd.bbf.usp.error +application/vnd.bbf.usp.msg +application/vnd.bbf.usp.msg+json +application/vnd.bekitzur-stech+json +application/vnd.bint.med-content +application/vnd.biopax.rdf+xml +application/vnd.blink-idb-value-wrapper +application/vnd.blueice.multipass mpm +application/vnd.bluetooth.ep.oob +application/vnd.bluetooth.le.oob +application/vnd.bmi bmi +application/vnd.bpf +application/vnd.bpf3 +application/vnd.businessobjects rep +application/vnd.byu.uapi+json +application/vnd.cab-jscript +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.capasystems-pg+json +application/vnd.cendio.thinlinc.clientconf +application/vnd.century-systems.tcp_stream +application/vnd.chemdraw+xml cdxml +application/vnd.chess-pgn +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.ciedi +application/vnd.cinderella cdy +application/vnd.cirpack.isdn-ext +application/vnd.citationstyles.style+xml +application/vnd.claymore cla +application/vnd.cloanto.rp9 rp9 +application/vnd.clonk.c4group c4d c4f c4g c4p c4u +application/vnd.cluetrust.cartomobile-config c11amc +application/vnd.cluetrust.cartomobile-config-pkg c11amz +application/vnd.coffeescript +application/vnd.collabio.xodocuments.document +application/vnd.collabio.xodocuments.document-template +application/vnd.collabio.xodocuments.presentation +application/vnd.collabio.xodocuments.presentation-template +application/vnd.collabio.xodocuments.spreadsheet +application/vnd.collabio.xodocuments.spreadsheet-template +application/vnd.collection+json +application/vnd.collection.doc+json +application/vnd.collection.next+json +application/vnd.comicbook+zip +application/vnd.comicbook-rar +application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +application/vnd.coreos.ignition+json +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.cryptii.pipe+json +application/vnd.crypto-shade-file +application/vnd.cryptomator.encrypted +application/vnd.cryptomator.vault +application/vnd.ctc-posml pml +application/vnd.ctct.ws+xml +application/vnd.cups-pdf +application/vnd.cups-postscript +application/vnd.cups-ppd ppd +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl curl +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +application/vnd.cyan.dean.root+xml +application/vnd.cybank +application/vnd.cyclonedx+json +application/vnd.cyclonedx+xml +application/vnd.d2l.coursepackage1p0+zip +application/vnd.d3m-dataset +application/vnd.d3m-problem +application/vnd.dart dart +application/vnd.data-vision.rdz rdz +application/vnd.datapackage+json +application/vnd.dataresource+json +application/vnd.dbf +application/vnd.debian.binary-package +application/vnd.dece.data uvd uvf uvvd uvvf +application/vnd.dece.ttml+xml uvt uvvt +application/vnd.dece.unspecified uvvx uvx +application/vnd.dece.zip uvvz uvz +application/vnd.denovo.fcselayout-link fe_launch +application/vnd.desmume.movie +application/vnd.dir-bi.plate-dl-nosuffix +application/vnd.dm.delegation+xml +application/vnd.dna dna +application/vnd.document+json +application/vnd.dolby.mlp mlp +application/vnd.dolby.mobile.1 +application/vnd.dolby.mobile.2 +application/vnd.doremir.scorecloud-binary-document +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.drive+json +application/vnd.ds-keypoint kpxx +application/vnd.dtg.local +application/vnd.dtg.local.flash +application/vnd.dtg.local.html +application/vnd.dvb.ait ait +application/vnd.dvb.dvbisl+xml +application/vnd.dvb.dvbj +application/vnd.dvb.esgcontainer +application/vnd.dvb.ipdcdftnotifaccess +application/vnd.dvb.ipdcesgaccess +application/vnd.dvb.ipdcesgaccess2 +application/vnd.dvb.ipdcesgpdd +application/vnd.dvb.ipdcroaming +application/vnd.dvb.iptv.alfec-base +application/vnd.dvb.iptv.alfec-enhancement +application/vnd.dvb.notif-aggregate-root+xml +application/vnd.dvb.notif-container+xml +application/vnd.dvb.notif-generic+xml +application/vnd.dvb.notif-ia-msglist+xml +application/vnd.dvb.notif-ia-registration-request+xml +application/vnd.dvb.notif-ia-registration-response+xml +application/vnd.dvb.notif-init+xml +application/vnd.dvb.pfr +application/vnd.dvb.service svc +application/vnd.dxr +application/vnd.dynageo geo +application/vnd.dzr +application/vnd.easykaraoke.cdgdownload +application/vnd.ecdis-update +application/vnd.ecip.rlp +application/vnd.ecowin.chart mag +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.efi.img +application/vnd.efi.iso +application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +application/vnd.enphase.envoy +application/vnd.eprints.data+xml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +application/vnd.ericsson.quickcall +application/vnd.espass-espass+zip +application/vnd.eszigno3+xml es3 et3 +application/vnd.etsi.aoc+xml +application/vnd.etsi.asic-e+zip +application/vnd.etsi.asic-s+zip +application/vnd.etsi.cug+xml +application/vnd.etsi.iptvcommand+xml +application/vnd.etsi.iptvdiscovery+xml +application/vnd.etsi.iptvprofile+xml +application/vnd.etsi.iptvsad-bc+xml +application/vnd.etsi.iptvsad-cod+xml +application/vnd.etsi.iptvsad-npvr+xml +application/vnd.etsi.iptvservice+xml +application/vnd.etsi.iptvsync+xml +application/vnd.etsi.iptvueprofile+xml +application/vnd.etsi.mcid+xml +application/vnd.etsi.mheg5 +application/vnd.etsi.overload-control-policy-dataset+xml +application/vnd.etsi.pstn+xml +application/vnd.etsi.sci+xml +application/vnd.etsi.simservs+xml +application/vnd.etsi.timestamp-token +application/vnd.etsi.tsl+xml +application/vnd.etsi.tsl.der +application/vnd.eu.kasparian.car+json +application/vnd.eudora.data +application/vnd.evolv.ecig.profile +application/vnd.evolv.ecig.settings +application/vnd.evolv.ecig.theme +application/vnd.exstream-empower+zip +application/vnd.exstream-package +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +application/vnd.f-secure.mobile +application/vnd.familysearch.gedcom+zip +application/vnd.fastcopy-disk-image +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed dataless seed +application/vnd.ffsns +application/vnd.ficlab.flb+zip +application/vnd.filmit.zfc +application/vnd.fints +application/vnd.firemonkeys.cloudcell +application/vnd.FloGraphIt gph +application/vnd.fluxtime.clip ftc +application/vnd.font-fontforge-sfd +application/vnd.framemaker frm maker frame fm fb book fbdoc +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujifilm.fb.docuworks +application/vnd.fujifilm.fb.docuworks.binder +application/vnd.fujifilm.fb.docuworks.container +application/vnd.fujifilm.fb.jfi+xml +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +application/vnd.fujixerox.ART-EX +application/vnd.fujixerox.ART4 +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +application/vnd.fujixerox.docuworks.container +application/vnd.fujixerox.HBPL +application/vnd.fut-misnet +application/vnd.futoin+cbor +application/vnd.futoin+json +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +application/vnd.gentics.grd+json +application/vnd.geo+json +application/vnd.geocube+xml +application/vnd.geogebra.file ggb +application/vnd.geogebra.slides +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.geonext gxt +application/vnd.geoplan g2w +application/vnd.geospace g3w +application/vnd.gerber +application/vnd.globalplatform.card-content-mgt +application/vnd.globalplatform.card-content-mgt-response +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.gov.sk.e-form+xml +application/vnd.gov.sk.e-form+zip +application/vnd.gov.sk.xmldatacontainer+xml +application/vnd.grafeq gqf gqs +application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +application/vnd.hal+json +application/vnd.hal+xml hal +application/vnd.HandHeld-Entertainment+xml zmm +application/vnd.hbci hbci hbc kom upa pkd bpd +application/vnd.hc+json +application/vnd.hcl-bireports +application/vnd.hdt +application/vnd.heroku+json +application/vnd.hhe.lesson-player les +application/vnd.hl7cda+xml +application/vnd.hl7v2+xml +application/vnd.hp-HPGL plt hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-PCL pcl +application/vnd.hp-PCLXL pclxl +application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +application/vnd.hyper+json +application/vnd.hyper-item+json +application/vnd.hyperdrive+json +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media emm +application/vnd.ibm.MiniPay mpy +application/vnd.ibm.modcap afp list3820 listafp +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.ieee.1905 +application/vnd.igloader igl +application/vnd.imagemeter.folder+zip +application/vnd.imagemeter.image+zip +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +application/vnd.ims.imsccv1p1 +application/vnd.ims.imsccv1p2 +application/vnd.ims.imsccv1p3 +application/vnd.ims.lis.v2.result+json +application/vnd.ims.lti.v2.toolconsumerprofile+json +application/vnd.ims.lti.v2.toolproxy+json +application/vnd.ims.lti.v2.toolproxy.id+json +application/vnd.ims.lti.v2.toolsettings+json +application/vnd.ims.lti.v2.toolsettings.simple+json +application/vnd.informedcontrol.rms+xml +application/vnd.informix-visionary +application/vnd.infotech.project +application/vnd.infotech.project+xml +application/vnd.innopath.wamp.notification +application/vnd.insors.igm igm +application/vnd.intercon.formnet xpw xpx +application/vnd.intergeo i2g +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +application/vnd.iptc.g2.catalogitem+xml +application/vnd.iptc.g2.conceptitem+xml +application/vnd.iptc.g2.knowledgeitem+xml +application/vnd.iptc.g2.newsitem+xml +application/vnd.iptc.g2.newsmessage+xml +application/vnd.iptc.g2.packageitem+xml +application/vnd.iptc.g2.planningitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.isac.fcs fcs +application/vnd.iso11783-10+zip +application/vnd.jam jam +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.jsk.isdn-ngn +application/vnd.kahootz ktr ktz +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.Kinar kne knp sdf +application/vnd.koan skd skm skp skt +application/vnd.kodak-descriptor sse +application/vnd.las +application/vnd.las.las+json +application/vnd.las.las+xml lasxml +application/vnd.laszip +application/vnd.leap+json +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.logipipe.circuit+zip +application/vnd.loom +application/vnd.lotus-1-2-3 wks 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +application/vnd.mapbox-vector-tile +application/vnd.marlin.drm.actiontoken+xml +application/vnd.marlin.drm.conftoken+xml +application/vnd.marlin.drm.license+xml +application/vnd.marlin.drm.mdcf +application/vnd.mason+json +application/vnd.maxmind.maxmind-db +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +application/vnd.meridian-slingshot +application/vnd.MFER mwf +application/vnd.mfmp mfm +application/vnd.micro+json +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.microsoft.portable-executable +application/vnd.microsoft.windows.thumbnail-cache +application/vnd.miele+json +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.Mobius.DAF daf +application/vnd.Mobius.DIS dis +application/vnd.Mobius.MBK mbk +application/vnd.Mobius.MQY mqy +application/vnd.Mobius.MSL msl +application/vnd.Mobius.PLC plc +application/vnd.Mobius.TXF txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-3mfdocument +application/vnd.ms-artgalry cil +application/vnd.ms-asf asf +application/vnd.ms-cab-compressed cab +application/vnd.ms-excel xls xlt xla xlc xlm xlw +application/vnd.ms-excel.addin.macroEnabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb +application/vnd.ms-excel.sheet.macroEnabled.12 xlsm +application/vnd.ms-excel.template.macroEnabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +application/vnd.ms-office.activeX+xml +application/vnd.ms-officetheme thmx +application/vnd.ms-outlook msg +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm +application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm +application/vnd.ms-powerpoint.template.macroEnabled.12 potm +application/vnd.ms-PrintDeviceCapabilities+xml +application/vnd.ms-PrintSchemaTicket+xml +application/vnd.ms-project mpp mpt +application/vnd.ms-tnef +application/vnd.ms-windows.devicepairing +application/vnd.ms-windows.nwprinting.oob +application/vnd.ms-windows.printerpairing +application/vnd.ms-windows.wsd.oob +application/vnd.ms-wmdrm.lic-chlg-req +application/vnd.ms-wmdrm.lic-resp +application/vnd.ms-wmdrm.meter-chlg-req +application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroEnabled.12 docm +application/vnd.ms-word.template.macroEnabled.12 dotm +application/vnd.ms-works wcm wdb wks wps +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.msa-disk-image +application/vnd.mseq mseq +application/vnd.msign +application/vnd.multiad.creator +application/vnd.multiad.creator.cif +application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.mynfc taglet +application/vnd.nacamar.ybrid+json +application/vnd.ncd.control +application/vnd.ncd.reference +application/vnd.nearst.inv+json +application/vnd.nebumind.line +application/vnd.nervana ent entity req request bkm kcm +application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.nimn +application/vnd.nintendo.nitro.rom +application/vnd.nintendo.snes.rom +application/vnd.nitf nitf ntf +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +application/vnd.nokia.catalogs +application/vnd.nokia.conml+wbxml +application/vnd.nokia.conml+xml +application/vnd.nokia.iptv.config+xml +application/vnd.nokia.iSDS-radio-presets +application/vnd.nokia.landmark+wbxml +application/vnd.nokia.landmark+xml +application/vnd.nokia.landmarkcollection+xml +application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +application/vnd.nokia.ncd +application/vnd.nokia.ncd+xml +application/vnd.nokia.pcd+wbxml +application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.EDM edm +application/vnd.novadigm.EDX edx +application/vnd.novadigm.EXT ext +application/vnd.ntt-local.content-share +application/vnd.ntt-local.file-transfer +application/vnd.ntt-local.ogw_remote-access +application/vnd.ntt-local.sip-ta_remote +application/vnd.ntt-local.sip-ta_tcp_stream +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template odc otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odf odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template odi oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.obn +application/vnd.ocf+cbor +application/vnd.oci.image.manifest.v1+json +application/vnd.oftn.l10n+json +application/vnd.oipf.contentaccessdownload+xml +application/vnd.oipf.contentaccessstreaming+xml +application/vnd.oipf.cspg-hexbinary +application/vnd.oipf.dae.svg+xml +application/vnd.oipf.dae.xhtml+xml +application/vnd.oipf.mippvcontrolmessage+xml +application/vnd.oipf.pae.gem +application/vnd.oipf.spdiscovery+xml +application/vnd.oipf.spdlist+xml +application/vnd.oipf.ueprofile+xml +application/vnd.oipf.userprofile+xml +application/vnd.olpc-sugar xo +application/vnd.oma-scws-config +application/vnd.oma-scws-http-request +application/vnd.oma-scws-http-response +application/vnd.oma.bcast.associated-procedure-parameter+xml +application/vnd.oma.bcast.drm-trigger+xml +application/vnd.oma.bcast.imd+xml +application/vnd.oma.bcast.ltkm +application/vnd.oma.bcast.notification+xml +application/vnd.oma.bcast.provisioningtrigger +application/vnd.oma.bcast.sgboot +application/vnd.oma.bcast.sgdd+xml +application/vnd.oma.bcast.sgdu +application/vnd.oma.bcast.simple-symbol-container +application/vnd.oma.bcast.smartcard-trigger+xml +application/vnd.oma.bcast.sprov+xml +application/vnd.oma.bcast.stkm +application/vnd.oma.cab-address-book+xml +application/vnd.oma.cab-feature-handler+xml +application/vnd.oma.cab-pcc+xml +application/vnd.oma.cab-subs-invite+xml +application/vnd.oma.cab-user-prefs+xml +application/vnd.oma.dcd +application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +application/vnd.oma.drm.risd+xml +application/vnd.oma.group-usage-list+xml +application/vnd.oma.lwm2m+cbor +application/vnd.oma.lwm2m+json +application/vnd.oma.lwm2m+tlv +application/vnd.oma.pal+xml +application/vnd.oma.poc.detailed-progress-report+xml +application/vnd.oma.poc.final-report+xml +application/vnd.oma.poc.groups+xml +application/vnd.oma.poc.invocation-descriptor+xml +application/vnd.oma.poc.optimized-progress-report+xml +application/vnd.oma.push +application/vnd.oma.scidm.messages+xml +application/vnd.oma.xcap-directory+xml +application/vnd.omads-email+xml +application/vnd.omads-file+xml +application/vnd.omads-folder+xml +application/vnd.omaloc-supl-init +application/vnd.onepager +application/vnd.onepagertamp +application/vnd.onepagertamx +application/vnd.onepagertat +application/vnd.onepagertatp +application/vnd.onepagertatx +application/vnd.openblox.game+xml +application/vnd.openblox.game-binary +application/vnd.openeye.oeb +application/vnd.openofficeorg.extension oxt +application/vnd.openstreetmap.data+xml +application/vnd.opentimestamps.ots +application/vnd.openxmlformats-officedocument.custom-properties+xml +application/vnd.openxmlformats-officedocument.customXmlProperties+xml +application/vnd.openxmlformats-officedocument.drawing+xml +application/vnd.openxmlformats-officedocument.drawingml.chart+xml +application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml +application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml +application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml +application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml +application/vnd.openxmlformats-officedocument.extended-properties+xml +application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml +application/vnd.openxmlformats-officedocument.presentationml.comments+xml +application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml +application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml +application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +application/vnd.openxmlformats-officedocument.presentationml.presProps+xml +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +application/vnd.openxmlformats-officedocument.presentationml.slide+xml +application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml +application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml +application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml +application/vnd.openxmlformats-officedocument.presentationml.tags+xml +application/vnd.openxmlformats-officedocument.presentationml.template potx +application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +application/vnd.openxmlformats-officedocument.theme+xml +application/vnd.openxmlformats-officedocument.themeOverride+xml +application/vnd.openxmlformats-officedocument.vmlDrawing +application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml +application/vnd.openxmlformats-package.core-properties+xml +application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +application/vnd.openxmlformats-package.relationships+xml +application/vnd.oracle.resource+json +application/vnd.orange.indata +application/vnd.osa.netdeploy +application/vnd.osgeo.mapguide.package mgp +application/vnd.osgi.bundle +application/vnd.osgi.dp dp +application/vnd.osgi.subsystem esa +application/vnd.otps.ct-kip+xml +application/vnd.oxli.countgraph +application/vnd.pagerduty+json +application/vnd.palm prc pdb pqa oprc +application/vnd.panoply +application/vnd.paos.xml +application/vnd.patentdive +application/vnd.patientecommsdoc +application/vnd.pawaafile paw +application/vnd.pcos +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.pmi.widget wg +application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.psfs +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 pti ptid +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.qualcomm.brew-app-res +application/vnd.quarantainenet +application/vnd.Quark.QuarkXPress qxd qxt qwd qwt qxl qxb +application/vnd.quobject-quoxdocument +application/vnd.radisys.moml+xml +application/vnd.radisys.msml+xml +application/vnd.radisys.msml-audit+xml +application/vnd.radisys.msml-audit-conf+xml +application/vnd.radisys.msml-audit-conn+xml +application/vnd.radisys.msml-audit-dialog+xml +application/vnd.radisys.msml-audit-stream+xml +application/vnd.radisys.msml-conf+xml +application/vnd.radisys.msml-dialog+xml +application/vnd.radisys.msml-dialog-base+xml +application/vnd.radisys.msml-dialog-fax-detect+xml +application/vnd.radisys.msml-dialog-fax-sendrecv+xml +application/vnd.radisys.msml-dialog-group+xml +application/vnd.radisys.msml-dialog-speech+xml +application/vnd.radisys.msml-dialog-transform+xml +application/vnd.rainstor.data +application/vnd.rapid +application/vnd.rar +application/vnd.realvnc.bed bed +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +application/vnd.RenLearn.rlprint +application/vnd.resilient.logic +application/vnd.restful+json +application/vnd.rig.cryptonote cryptonote +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.rn-realmedia-vbr rmvb +application/vnd.route66.link66+xml link66 +application/vnd.rs-274x +application/vnd.ruckus.download +application/vnd.s3sms +application/vnd.sailingtracker.track st +application/vnd.sar +application/vnd.sbm.cid +application/vnd.sbm.mid2 +application/vnd.scribus +application/vnd.sealed.3df +application/vnd.sealed.csf +application/vnd.sealed.doc sdoc sdo s1w +application/vnd.sealed.eml seml sem +application/vnd.sealed.mht smht smh +application/vnd.sealed.net +application/vnd.sealed.ppt sppt spp s1p +application/vnd.sealed.tiff +application/vnd.sealed.xls sxls sxl s1e +application/vnd.sealedmedia.softseal.html stml stm s1h +application/vnd.sealedmedia.softseal.pdf spdf spd s1a +application/vnd.seemail see +application/vnd.seis+json +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shade-save-file +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.shootproof+json +application/vnd.shopkick+json +application/vnd.shp +application/vnd.shx +application/vnd.sigrok.session +application/vnd.SimTech-MindMapper twd twds +application/vnd.siren+json +application/vnd.smaf mmf +application/vnd.smart.notebook +application/vnd.smart.teacher teacher +application/vnd.snesdev-page-table +application/vnd.software602.filler.form+xml +application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkd sdkm +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +application/vnd.sqlite3 +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.chart sds +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math sdf smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.stepmania.package smzip +application/vnd.stepmania.stepchart sm +application/vnd.street-stream +application/vnd.sun.wadl+xml +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +application/vnd.sus-calendar sus susp +application/vnd.svd svd +application/vnd.swiftview-ics +application/vnd.sycle+xml +application/vnd.syft+json +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +application/vnd.syncml.dm.notification +application/vnd.syncml.dmddf+wbxml +application/vnd.syncml.dmddf+xml +application/vnd.syncml.dmtnds+wbxml +application/vnd.syncml.dmtnds+xml +application/vnd.syncml.ds.notification +application/vnd.tableschema+json +application/vnd.tao.intent-module-archive tao +application/vnd.tcpdump.pcap cap dmp pcap +application/vnd.think-cell.ppttc+json +application/vnd.tmd.mediaflex.api+xml +application/vnd.tml +application/vnd.tmobile-livetv tmo +application/vnd.tri.onesource +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +application/vnd.truedoc +application/vnd.ubisoft.webplayer +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.uri-map +application/vnd.valve.source.material +application/vnd.vcx vcx +application/vnd.vd-study +application/vnd.vectorworks +application/vnd.vel+json +application/vnd.verimatrix.vcas +application/vnd.veritone.aion+json +application/vnd.veryant.thin +application/vnd.ves.encrypted +application/vnd.vidsoft.vidconference vsc +application/vnd.visio vsd vst vsw vss +application/vnd.visionary vis +application/vnd.vividence.scriptfile +application/vnd.vsf vsf +application/vnd.wap.sic sic +application/vnd.wap.slc slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +application/vnd.wfa.dpp +application/vnd.wfa.p2p +application/vnd.wfa.wsc +application/vnd.windows.devicepairing +application/vnd.wmc +application/vnd.wmf.bootstrap +application/vnd.wolfram.mathematica +application/vnd.wolfram.mathematica.package +application/vnd.wolfram.player nbp +application/vnd.wordperfect wpd +application/vnd.wqd wqd +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +application/vnd.wv.csp+wbxml wv +application/vnd.wv.csp+xml +application/vnd.wv.ssp+xml +application/vnd.xacml+json +application/vnd.xara xar +application/vnd.xfdl xfdl +application/vnd.xfdl.webform +application/vnd.xmi+xml +application/vnd.xmpie.cpkg +application/vnd.xmpie.dpkg +application/vnd.xmpie.plan +application/vnd.xmpie.ppkg +application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +application/vnd.yamaha.remote-setup +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +application/vnd.yamaha.through-ngn +application/vnd.yamaha.tunnel-udpencap +application/vnd.yaoweme +application/vnd.yellowriver-custom-menu cmp +application/vnd.youtube.yt +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +application/voucher-cms+json +application/vq-rtcpxr +application/wasm wasm +application/watcherinfo+xml wif +application/webbundle +application/webpush-options+json +application/whoispp-query +application/whoispp-response +application/widget wgt +application/winhlp hlp +application/wita +application/won +application/word doc dot +application/wordperfect wp +application/wordperfect5.1 wp5 wp +application/wordperfect6.1 wp6 +application/wordperfectd wpd +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-123 wk +application/x-7z-compressed 7z +application/x-abiword abw +application/x-access mdf mda mdb mde +application/x-ace-compressed ace +application/x-apple-diskimage dmg +application/x-authorware-bin aab u32 vox x32 +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-bleeper bleep +application/x-blorb blb blorb +application/x-bzip bz +application/x-bzip2 boz bz2 +application/x-cbr cb7 cba cbr cbt cbz +application/x-cdlink vcd +application/x-cfs-compressed cfs +application/x-chat chat +application/x-chess-pgn pgn +application/x-chrome-extension crx +application/x-clariscad +application/x-compress z Z +application/x-compressed z Z +application/x-conference nsc +application/x-cpio cpio +application/x-csh csh +application/x-cu-seeme csm cu +application/x-debian-package deb udeb +application/x-dgc-compressed dgc +application/x-director dcr @dir @dxr cct cst cxt dir dxr fgd swa w3d +application/x-doom wad +application/x-drafting +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-dxf +application/x-envoy evy +application/x-eva eva +application/x-excel +application/x-font-bdf bdf +application/x-font-ghostscript gsf +application/x-font-linux-psf psf +application/x-font-opentype otf +application/x-font-otf otf +application/x-font-pcf pcf +application/x-font-snf snf +application/x-font-truetype ttf +application/x-font-ttf ttc ttf +application/x-font-type1 afm pfa pfb pfm +application/x-fractals +application/x-freearc arc +application/x-futuresplash spl +application/x-gca-compressed gca +application/x-ghostview +application/x-glulx ulx +application/x-gnumeric gnumeric +application/x-gramps-xml gramps +application/x-gtar gtar tgz tbz2 tbz +application/x-gzip gz +application/x-hdf hdf +application/x-hep hep +application/x-html+ruby rhtml +application/x-httpd-php phtml pht php +application/x-ibooks+zip ibooks +application/x-ica ica +application/x-ideas +application/x-imagemap imagemap imap +application/x-install-instructions install +application/x-iso9660-image iso +application/x-iwork-keynote-sffkey key +application/x-iwork-numbers-sffnumbers numbers +application/x-iwork-pages-sffpages pages +application/x-java-archive jar +application/x-java-jnlp-file jnlp +application/x-java-serialized-object ser +application/x-java-vm class +application/x-javascript js mjs +application/x-koan skp skd skt skm +application/x-latex ltx latex +application/x-lotus-123 wks +application/x-lzh-compressed lha lzh +application/x-mac bin +application/x-mac-compactpro cpt +application/x-macbase64 bin +application/x-macbinary +application/x-maker frm maker frame fm fb book fbdoc +application/x-mathcad mcd +application/x-mathematica-old +application/x-mie mie +application/x-mif mif +application/x-mobipocket-ebook mobi prc +application/x-ms-application application +application/x-ms-dos-executable exe +application/x-ms-shortcut lnk +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mda mdb mde mdf +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdos-program cmd bat com exe reg ps1 vbs +application/x-msdownload exe com cmd bat dll msi reg ps1 vbs +application/x-msmediaview m13 m14 mvb +application/x-msmetafile emf emz wmf wmz +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-msword doc dot wrd +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-ns-proxy-autoconfig pac +application/x-nzb nzb +application/x-opera-extension oex +application/x-pagemaker pm pm5 pt5 +application/x-perl pl pm +application/x-pgp +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-pki-message +application/x-python py +application/x-quicktimeplayer qtl +application/x-rar-compressed rar +application/x-remote_printing +application/x-research-info-systems ris +application/x-rtf rtf +application/x-ruby rb rbw +application/x-set +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-silverlight-app xap +application/x-SLA +application/x-smarttech-notebook notebook +application/x-solids +application/x-spss sav sbs sps spo spp +application/x-sql sql +application/x-STEP +application/x-stuffit sit +application/x-stuffitx sitx +application/x-subrip srt +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-t3vm-image t3 +application/x-tads gam +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-tfm tfm +application/x-texinfo texinfo texi +application/x-tgif obj +application/x-toolbook tbk +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-u-star +application/x-ustar ustar +application/x-VMSBACKUP bck +application/x-wais-source src +application/x-web-app-manifest+json webapp +application/x-Wingz wz wkz +application/x-word doc dot +application/x-wordperfect wp +application/x-wordperfect6.1 wp6 +application/x-wordperfectd wpd +application/x-www-form-urlencoded +application/x-x509-ca-cert crt der +application/x-x509-ca-ra-cert +application/x-x509-next-ca-cert +application/x-xfig fig +application/x-xliff+xml xlf +application/x-xpinstall xpi +application/x-xz xz +application/x-zip-compressed zip +application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 +application/x400-bp +application/x400.bp +application/xacml+xml +application/xaml+xml xaml +application/xcap-att+xml +application/xcap-caps+xml +application/xcap-diff+xml xdf +application/xcap-el+xml +application/xcap-error+xml +application/xcap-ns+xml +application/xcon-conference-info+xml +application/xcon-conference-info-diff+xml +application/xenc+xml xenc +application/xhtml+xml xht xhtml +application/xhtml-voice+xml +application/xliff+xml +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/xml-patch+xml +application/xmpp+xml +application/xop+xml xop +application/xproc+xml xpl +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvm xvml +application/yang yang +application/yang-data+json +application/yang-data+xml +application/yang-patch+json +application/yang-patch+xml +application/yin+xml yin +application/zip zip +application/zlib +application/zstd +audio/1d-interleaved-parityfec +audio/32kadpcm +audio/3gpp +audio/3gpp2 +audio/aac +audio/ac3 +audio/adpcm adp +audio/AMR amr +audio/AMR-WB awb +audio/amr-wb+ +audio/aptx +audio/asc +audio/ATRAC-ADVANCED-LOSSLESS +audio/ATRAC-X +audio/ATRAC3 +audio/basic au snd +audio/BV16 +audio/BV32 +audio/clearmode +audio/CN +audio/DAT12 +audio/dls +audio/dsr-es201108 +audio/dsr-es202050 +audio/dsr-es202211 +audio/dsr-es202212 +audio/DV +audio/DVI4 +audio/eac3 +audio/encaprtp +audio/EVRC evc +audio/EVRC-QCP +audio/EVRC0 +audio/EVRC1 +audio/EVRCB +audio/EVRCB0 +audio/EVRCB1 +audio/EVRCNW +audio/EVRCNW0 +audio/EVRCNW1 +audio/EVRCWB +audio/EVRCWB0 +audio/EVRCWB1 +audio/EVS +audio/example +audio/flexfec +audio/fwdred +audio/G711-0 +audio/G719 +audio/G722 +audio/G7221 +audio/G723 +audio/G726-16 +audio/G726-24 +audio/G726-32 +audio/G726-40 +audio/G728 +audio/G729 +audio/G7291 +audio/G729D +audio/G729E +audio/GSM +audio/GSM-EFR +audio/GSM-HR-08 +audio/iLBC +audio/ip-mr_v2.5 +audio/L16 l16 +audio/L20 +audio/L24 +audio/L8 +audio/LPC +audio/MELP +audio/MELP1200 +audio/MELP2400 +audio/MELP600 +audio/mhas +audio/midi kar mid midi rmi +audio/mobile-xmf +audio/mp4 mp4 mpg4 f4a f4b mp4a m4a +audio/MP4A-LATM m4a +audio/MPA +audio/mpa-robust +audio/mpeg mpga mp2 mp3 m2a m3a mp2a +audio/mpeg4-generic +audio/ogg oga ogg spx opus +audio/opus +audio/parityfec +audio/PCMA +audio/PCMA-WB +audio/PCMU +audio/PCMU-WB +audio/prs.sid +audio/QCELP +audio/raptorfec +audio/RED +audio/rtp-enc-aescm128 +audio/rtp-midi +audio/rtploopback +audio/rtx +audio/s3m s3m +audio/scip +audio/silk sil +audio/SMV smv +audio/SMV-QCP +audio/SMV0 +audio/sofa +audio/sp-midi +audio/speex +audio/t140c +audio/t38 +audio/telephone-event +audio/TETRA_ACELP +audio/TETRA_ACELP_BB +audio/tone +audio/TSVCIS +audio/UEMCLIP +audio/ulpfec +audio/usac +audio/VDVI +audio/VMR-WB +audio/vnd.3gpp.iufp +audio/vnd.4SB +audio/vnd.audiokoz +audio/vnd.CELP +audio/vnd.cisco.nse +audio/vnd.cmles.radio-events +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.dece.audio uva uvva +audio/vnd.digital-winds eol +audio/vnd.dlna.adts +audio/vnd.dolby.heaac.1 +audio/vnd.dolby.heaac.2 +audio/vnd.dolby.mlp +audio/vnd.dolby.mps +audio/vnd.dolby.pl2 +audio/vnd.dolby.pl2x +audio/vnd.dolby.pl2z +audio/vnd.dolby.pulse.1 +audio/vnd.dra dra +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +audio/vnd.dts.uhd +audio/vnd.dvb.file +audio/vnd.everad.plj plj +audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +audio/vnd.nokia.mobile-xmf mxmf +audio/vnd.nortel.vbk vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +audio/vnd.octel.sbc +audio/vnd.presonus.multitrack +audio/vnd.qcelp qcp +audio/vnd.rhetorex.32kadpcm +audio/vnd.rip rip +audio/vnd.sealedmedia.softseal.mpeg smp3 smp s1m +audio/vnd.vmx.cvsd +audio/vorbis +audio/vorbis-config +audio/wav wav +audio/webm weba webm +audio/x-aac aac +audio/x-aiff aif aifc aiff +audio/x-caf caf +audio/x-flac flac +audio/x-m4a m4a +audio/x-matroska mka +audio/x-midi mid midi kar +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-ms-wmv wmv +audio/x-pn-realaudio ra ram +audio/x-pn-realaudio-plugin rmp rpm +audio/x-realaudio ra +audio/x-wav wav +audio/xm xm +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +chemical/x-pdb pdb +chemical/x-xyz xyz +drawing/dwf dwf +font/collection ttc +font/otf otf +font/sfnt +font/ttf ttf +font/woff woff +font/woff2 woff2 +image/aces +image/avci +image/avcs +image/avif avif +image/bmp bmp +image/cgm cgm +image/cmu-raster +image/dicom-rle +image/dpx +image/emf +image/example +image/fits +image/g3fax g3 +image/gif gif +image/heic heic hif +image/heic-sequence heics hif +image/heif heif hif +image/heif-sequence heifs hif +image/hej2k +image/hsj2 +image/ief ief +image/j2is +image/jls +image/jp2 jp2 jpg2 +image/jpeg jpeg jpg jpe +image/jph +image/jphc +image/jpm jpm jpgm +image/jpx jpx jpf +image/jxl +image/jxr +image/jxrA +image/jxrS +image/jxs +image/jxsc +image/jxsi +image/jxss +image/ktx ktx +image/ktx2 +image/naplps +image/pjpeg +image/png png +image/prs.btif btif +image/prs.pti +image/pwg-raster +image/sgi sgi +image/svg+xml svg svgz +image/t38 +image/targa tga +image/tiff tiff tif +image/tiff-fx +image/vnd.adobe.photoshop psd +image/vnd.airzip.accelerator.azv +image/vnd.cns.inf2 +image/vnd.dece.graphic uvg uvi uvvg uvvi +image/vnd.dgn dgn +image/vnd.djvu djvu djv +image/vnd.dvb.subtitle sub +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +image/vnd.globalgraphics.pgb pgb +image/vnd.microsoft.icon ico +image/vnd.mix +image/vnd.mozilla.apng +image/vnd.ms-modi mdi +image/vnd.ms-photo wdp +image/vnd.net-fpx npx +image/vnd.net.fpx +image/vnd.pco.b16 +image/vnd.radiance +image/vnd.sealed.png +image/vnd.sealedmedia.softseal.gif +image/vnd.sealedmedia.softseal.jpg +image/vnd.svf +image/vnd.tencent.tap +image/vnd.valve.source.texture +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/vnd.zbrush.pcx +image/webp webp +image/wmf +image/x-3ds 3ds +image/x-adobe-dng dng +image/x-bmp bmp +image/x-canon-cr2 cr2 +image/x-canon-crw crw +image/x-cmu-raster ras +image/x-cmx cmx +image/x-compressed-xcf xcfbz2 xcfgz +image/x-emf +image/x-epson-erf erf +image/x-freehand fh fh4 fh5 fh7 fhc +image/x-fuji-raf raf +image/x-hasselblad-3fr 3fr +image/x-icon ico +image/x-kodak-dcr dcr +image/x-kodak-k25 k25 +image/x-kodak-kdc kdc +image/x-minolta-mrw mrw +image/x-mrsid-image sid +image/x-ms-bmp bmp +image/x-nikon-nef nef +image/x-olympus-orf orf +image/x-paintshoppro psp pspimage +image/x-panasonic-raw raw +image/x-pcx pcx +image/x-pentax-pef pef +image/x-pict pct pic +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-sigma-x3f x3f +image/x-sony-arw arw +image/x-sony-sr2 sr2 +image/x-sony-srf srf +image/x-targa tga +image/x-tga tga +image/x-vnd.dgn dgn +image/x-win-bmp +image/x-wmf +image/x-xbitmap xbm +image/x-xbm xbm +image/x-xcf xcf +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/CPIM +message/delivery-status +message/disposition-notification +message/example +message/external-body +message/feedback-report +message/global +message/global-delivery-status +message/global-disposition-notification +message/global-headers +message/http +message/imdn+xml +message/news +message/partial +message/rfc822 eml mime +message/s-http +message/sip +message/sipfrag +message/tracking-status +message/vnd.si.simp +message/vnd.wfa.wsc +model/3mf +model/e57 +model/example +model/gltf+json +model/gltf-binary +model/iges igs iges +model/mesh msh mesh silo +model/mtl +model/obj +model/step +model/step+xml +model/step+zip +model/step-xml+zip +model/stl +model/vnd.collada+xml dae +model/vnd.dwf dwf +model/vnd.flatland.3dml +model/vnd.gdl gdl +model/vnd.gs-gdl +model/vnd.gtw gtw +model/vnd.moml+xml +model/vnd.mts mts +model/vnd.opengex +model/vnd.parasolid.transmit.binary x_b xmt_bin +model/vnd.parasolid.transmit.text x_t xmt_txt +model/vnd.pytha.pyox +model/vnd.rosette.annotated-data-model +model/vnd.sap.vds +model/vnd.usdz+zip +model/vnd.valve.source.compiled-map +model/vnd.vtu vtu +model/vrml wrl vrml +model/x3d+binary x3db x3dbz +model/x3d+fastinfoset +model/x3d+vrml x3dv x3dvz +model/x3d+xml x3d x3dz +model/x3d-vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/example +multipart/form-data +multipart/header-set +multipart/mixed +multipart/multilingual +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/vnd.bint.med-plus +multipart/voice-message +multipart/x-gzip +multipart/x-mixed-replace +multipart/x-parallel +multipart/x-tar +multipart/x-ustar +multipart/x-www-form-urlencoded +multipart/x-zip +text/1d-interleaved-parityfec +text/cache-manifest appcache manifest +text/calendar ics ifb +text/comma-separated-values csv +text/cql +text/cql-expression +text/cql-identifier +text/css css +text/csv csv +text/csv-schema +text/directory +text/dns +text/ecmascript es ecma +text/encaprtp +text/enriched +text/example +text/fhirpath +text/flexfec +text/fwdred +text/gff3 +text/grammar-ref-list +text/html html htm htmlx shtml htx +text/javascript js mjs +text/jcr-cnd +text/markdown markdown md mkd +text/mizar +text/n3 n3 +text/nfo +text/parameters +text/parityfec +text/plain txt asc c cc h hh cpp hpp dat hlp conf def doc in list log rst text textile +text/provenance-notation +text/prs.fallenstein.rst rst +text/prs.lines.tag dsc +text/prs.prop.logic +text/raptorfec +text/RED +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/rtp-enc-aescm128 +text/rtploopback +text/rtx +text/sgml sgml sgm +text/shaclc +text/shex +text/spdx +text/strings +text/t140 +text/tab-separated-values tsv +text/troff t tr roff troff man me ms +text/turtle ttl +text/ulpfec +text/uri-list uri uris urls +text/vcard vcard +text/vnd.a +text/vnd.abc +text/vnd.ascii-art +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.mcurl mcurl +text/vnd.curl.scurl scurl +text/vnd.debian.copyright +text/vnd.DMClientScript +text/vnd.dvb.subtitle sub +text/vnd.esmertec.theme-descriptor +text/vnd.familysearch.gedcom +text/vnd.ficlab.flt +text/vnd.flatland.3dml +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.gml +text/vnd.graphviz gv +text/vnd.hans +text/vnd.hgl +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +text/vnd.IPTC.NewsML +text/vnd.IPTC.NITF +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command ccc +text/vnd.radisys.msml-basic-layout +text/vnd.senx.warpscript +text/vnd.si.uricatalogue +text/vnd.sosi +text/vnd.sun.j2me.app-descriptor jad +text/vnd.trolltech.linguist +text/vnd.wap.si si +text/vnd.wap.sl sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/vtt vtt +text/x-asm asm s +text/x-c c cc cpp cxx dic h hh +text/x-coffescript coffee +text/x-component htc +text/x-fortran f f77 f90 for +text/x-java-source java +text/x-nfo nfo +text/x-opml opml +text/x-pascal p pas +text/x-rtf rtf +text/x-setext etx +text/x-sfv sfv +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +text/x-vnd.flatland.3dml +text/x-yaml yaml yml +text/xml xml dtd xsd +text/xml-external-parsed-entity +video/1d-interleaved-parityfec +video/3gpp 3gp 3gpp +video/3gpp-tt +video/3gpp2 3g2 3gpp2 +video/AV1 +video/BMPEG +video/BT656 +video/CelB +video/dl dl +video/DV dv +video/encaprtp +video/example +video/FFV1 +video/flexfec +video/gl gl +video/H261 h261 +video/H263 h263 +video/H263-1998 +video/H263-2000 +video/H264 h264 +video/H264-RCDO +video/H264-SVC +video/H265 +video/iso.segment +video/JPEG jpgv +video/jpeg2000 +video/jpm jpgm jpm +video/jxsv +video/MJ2 mj2 mjp2 +video/MP1S +video/MP2P +video/MP2T ts mts m2ts cpi clpi mpl mpls bdm +video/mp4 mp4 mpg4 f4v f4p mp4v +video/MP4V-ES +video/mpeg mp2 mp3g mpe mpeg mpg m1v m2v +video/mpeg4-generic +video/MPV +video/nv +video/ogg ogg ogv +video/parityfec +video/pointer +video/quicktime qt mov +video/raptorfec +video/raw +video/rtp-enc-aescm128 +video/rtploopback +video/rtx +video/scip +video/smpte291 +video/SMPTE292M +video/ulpfec +video/vc1 +video/vc2 +video/vnd.CCTV +video/vnd.dece.hd uvh uvvh +video/vnd.dece.mobile uvm uvvm +video/vnd.dece.mp4 +video/vnd.dece.pd uvp uvvp +video/vnd.dece.sd uvs uvvs +video/vnd.dece.video uvv uvvv +video/vnd.directv.mpeg +video/vnd.directv.mpeg-tts +video/vnd.dlna.mpeg-tts +video/vnd.dvb.file dvb +video/vnd.fvt fvt +video/vnd.hns.video +video/vnd.iptvforum.1dparityfec-1010 +video/vnd.iptvforum.1dparityfec-2005 +video/vnd.iptvforum.2dparityfec-1010 +video/vnd.iptvforum.2dparityfec-2005 +video/vnd.iptvforum.ttsavc +video/vnd.iptvforum.ttsmpeg2 +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +video/vnd.nokia.interleaved-multimedia nim +video/vnd.nokia.mp4vr +video/vnd.nokia.videovoip +video/vnd.objectvideo mp4 m4v +video/vnd.radgamettools.bink +video/vnd.radgamettools.smacker +video/vnd.sealed.mpeg1 s11 +video/vnd.sealed.mpeg4 smpg s14 +video/vnd.sealed.swf sswf ssw +video/vnd.sealedmedia.softseal.mov smov smo s1q +video/vnd.uvvu.mp4 uvu uvvu +video/vnd.vivo viv vivo +video/vnd.youtube.yt +video/VP8 +video/VP9 +video/webm webm +video/x-dl dl +video/x-dv dv +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-gl gl +video/x-ivf ivf +video/x-m4v m4v +video/x-matroska mk3d mks mkv +video/x-mng mng +video/x-motion-jpeg mjpg mjpeg +video/x-ms-asf asf asx +video/x-ms-vob vob +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-smv smv +x-chemical/x-pdb pdb +x-chemical/x-xyz xyz +x-conference/x-cooltalk ice +x-drawing/dwf dwf +x-world/x-vrml wrl vrml diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.docs.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.docs.column new file mode 100644 index 0000000..e05a011 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.docs.column @@ -0,0 +1,2383 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +Fixes a bug with IE6 and progressive JPEGs +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +see-also:image/x-xcf +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.encoding.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.encoding.column new file mode 100644 index 0000000..3b073bd --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.encoding.column @@ -0,0 +1,2383 @@ +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +8bit +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +7bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +8bit +base64 +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +8bit +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +7bit +7bit +base64 +8bit +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +quoted-printable +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +8bit +base64 +8bit +base64 +base64 +base64 +base64 +8bit +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +quoted-printable +quoted-printable +quoted-printable +8bit +quoted-printable +quoted-printable +quoted-printable +8bit +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +8bit +quoted-printable +quoted-printable +quoted-printable +quoted-printable +quoted-printable +8bit +quoted-printable +quoted-printable +quoted-printable +8bit +8bit +quoted-printable +8bit +8bit +quoted-printable +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +8bit +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 +base64 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.flags.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.flags.column new file mode 100644 index 0000000..a479e4b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.flags.column @@ -0,0 +1,2383 @@ +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 1 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +1 1 0 0 +0 0 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 0 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 1 0 +0 1 1 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 1 0 +0 1 0 0 +0 1 1 0 +0 1 1 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 1 +0 0 0 0 +1 0 0 0 +0 1 0 0 +1 0 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 1 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +1 0 0 0 +0 0 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +1 0 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 1 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 1 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 1 0 +1 0 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +1 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 1 0 0 +0 0 0 0 +0 0 0 0 +1 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 +0 0 0 0 diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.friendly.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.friendly.column new file mode 100644 index 0000000..aed1998 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.friendly.column @@ -0,0 +1,2383 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Andrew Toolkit +- +- +en^Applixware +- +- +- +en^Atom Syndication Format +en^Atom Publishing Protocol +- +- +en^Atom Publishing Protocol Service Document +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Voice Browser Call Control +- +en^Cloud Data Management Interface (CDMI) - Capability +en^Cloud Data Management Interface (CDMI) - Contaimer +en^Cloud Data Management Interface (CDMI) - Domain +en^Cloud Data Management Interface (CDMI) - Object +en^Cloud Data Management Interface (CDMI) - Queue +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^CU-SeeMe +- +- +- +- +- +en^Web Distributed Authoring and Versioning +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Data Structure for the Security Suitability of Cryptographic Algorithms +en^Data Structure for the Security Suitability of Cryptographic Algorithms +- +- +en^ECMAScript +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Extensible MultiModal Annotation +- +- +- +en^Electronic Publication +- +- +- +en^Efficient XML Interchange +- +- +- +- +- +- +- +- +- +- +en^Portable Font Resource +en^Web Open Font Format +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Hyperstudio +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Internet Protocol Flow Information Export +- +- +- +en^Java Archive +en^Java Serialized Object +en^Java Bytecode File +en^JavaScript +- +- +- +- +- +en^JavaScript Object Notation (JSON) +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Macintosh BinHex 4.0 +en^Compact Pro +- +- +en^Metadata Authority Description Schema +- +en^MARC Formats +en^MARC21 XML Schema +- +en^Mathematica Notebooks +- +en^Mathematical Markup Language +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Mbox database files +- +- +en^Media Server Control Markup Language +- +- +en^Metalink +en^Metadata Encoding and Transmission Standard +- +- +- +- +- +- +en^Metadata Object Description Schema +- +- +- +- +en^MPEG-21 +en^MPEG4 +- +- +- +- +- +- +- +en^Microsoft Word +- +- +en^Material Exchange Format +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Binary Data +en^Office Document Architecture +- +- +- +en^Open eBook Publication Structure +en^Ogg +- +en^Microsoft OneNote +- +- +- +- +- +- +- +- +en^XML Patch Framework +en^Adobe Portable Document Format +- +- +en^Pretty Good Privacy +- +en^Pretty Good Privacy - Signature +en^PICSRules +- +- +en^PKCS #10 - Certification Request Standard +- +en^PKCS #7 - Cryptographic Message Syntax Standard +en^PKCS #7 - Cryptographic Message Syntax Standard +en^PKCS #8 - Private-Key Information Syntax Standard +- +en^Attribute Certificate +en^Internet Public Key Infrastructure - Certificate +en^Internet Public Key Infrastructure - Certificate Revocation Lists +- +en^Internet Public Key Infrastructure - Certification Path +en^Internet Public Key Infrastructure - Certificate Management Protocole +en^Pronunciation Lexicon Specification +- +en^PostScript +- +- +- +- +- +- +- +en^CU-Writer +- +- +- +- +- +- +en^Portable Symmetric Key Container +- +- +- +- +- +en^Resource Description Framework +en^IMS Networks +en^Relax NG Compact Syntax +- +- +- +- +en^XML Resource Lists +en^XML Resource Lists Diff +- +- +- +- +en^XML Resource Lists +- +- +- +- +- +- +- +- +- +en^Really Simple Discovery +en^RSS - Really Simple Syndication +en^Rich Text Format +- +- +- +- +- +- +- +en^Systems Biology Markup Language +- +- +en^Server-Based Certificate Validation Protocol - Validation Request +en^Server-Based Certificate Validation Protocol - Validation Response +en^Server-Based Certificate Validation Protocol - Validation Policies - Request +en^Server-Based Certificate Validation Protocol - Validation Policies - Response +en^Session Description Protocol +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Secure Electronic Transaction - Payment +- +en^Secure Electronic Transaction - Registration +- +- +en^S Hexdump Format +- +- +- +- +- +- +- +- +- +en^Synchronized Multimedia Integration Language +- +- +- +- +en^SPARQL - Query +en^SPARQL - Results +- +- +- +en^Speech Recognition Grammar Specification +en^Speech Recognition Grammar Specification - XML +en^Search/Retrieve via URL Response Format +- +en^Speech Synthesis Markup Language +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Text Encoding and Interchange +- +en^Sharing Transaction Fraud Data +- +- +en^Time Stamped Data Envelope +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^3rd Generation Partnership Project - Pic Large +en^3rd Generation Partnership Project - Pic Small +en^3rd Generation Partnership Project - Pic Var +- +- +- +- +- +- +- +- +- +en^3rd Generation Partnership Project - Transaction Capabilities Application Part +- +en^3M Post It Notes +en^Simply Accounting +en^Simply Accounting - Data Import +en^ACU Cobol +en^ACU Cobol +en^Adobe AIR Application +- +- +en^Adobe Flex Project +- +en^Adobe XML Data Package +en^Adobe XML Forms Data Format +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Ahead AIR Application +en^AirZip FileSECURE +en^AirZip FileSECURE +- +en^Amazon Kindle eBook format +- +en^Active Content Compression +en^AmigaDE +- +- +en^Android Package Archive +- +en^ANSER-WEB Terminal Client - Certificate Issue +en^ANSER-WEB Terminal Client - Web Funds Transfer +en^Antix Game Player +- +- +- +- +- +- +- +- +en^Apple Installer Package +- +en^Multimedia Playlist Unicode +- +- +- +- +en^Arista Networks Software Image +- +- +- +en^Audiograph +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Blueice Research Multipass +- +- +en^BMI Drawing Data Interchange +- +- +en^BusinessObjects +- +- +- +- +- +- +- +en^CambridgeSoft Chem Draw +- +en^Karaoke on Chipnuts Chipsets +- +en^Interactive Geometry Software Cinderella +- +- +en^Claymore Data Files +en^RetroPlatform Player +en^Clonk Game +en^ClueTrust CartoMobile - Config +en^ClueTrust CartoMobile - Config Package +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Sixth Floor Media - CommonSpace +en^CIM Database +- +en^CosmoCaller +en^CrickSoftware - Clicker +en^CrickSoftware - Clicker - Keyboard +en^CrickSoftware - Clicker - Palette +en^CrickSoftware - Clicker - Template +en^CrickSoftware - Clicker - Wordbank +en^Critical Tools - PERT Chart EXPERT +- +- +- +- +en^PosML +- +- +- +en^Adobe PostScript Printer Description File Format +- +- +- +en^CURL Applet +en^CURL Applet +- +- +- +- +- +- +- +- +en^RemoteDocs R-Viewer +- +- +- +- +- +- +- +- +en^FCS Express Layout Link +- +- +- +en^New Moon Liftoff/DNA +- +en^Dolby Meridian Lossless Packing +- +- +- +en^DPGraph +en^DreamFactory +- +- +- +- +- +en^Digital Video Broadcasting +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Digital Video Broadcasting +- +en^DynaGeo +- +- +- +- +en^EcoWin Chart +- +- +- +- +- +- +- +- +en^Enliven Viewer +- +- +en^QUASS Stream Player +en^QUASS Stream Player +en^QuickAnime Player +en^SimpleAnimeLite Player +en^QUASS Stream Player +- +- +en^MICROSEC e-Szign¢ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^EZPix Secure Photo Album +en^EZPix Secure Photo Album +- +- +- +en^Forms Data Format +- +en^Digital Siesmograph Networks - SEED Datafiles +- +- +- +- +- +en^NpGraphIt +en^FluxTime Clip +- +en^FrameMaker Normal Format +en^Frogans Player +en^Frogans Player +en^Friendly Software Corporation +- +- +- +- +en^Fujitsu Oasys +en^Fujitsu Oasys +en^Fujitsu Oasys +en^Fujitsu Oasys +en^Fujitsu Oasys +- +- +en^Fujitsu - Xerox 2D CAD Data +en^Fujitsu - Xerox DocuWorks +en^Fujitsu - Xerox DocuWorks Binder +- +- +- +- +- +en^FuzzySheet +en^Genomatix Tuxedo Framework +- +- +- +en^GeoGebra +- +en^GeoGebra +en^GeoMetry Explorer +en^GEONExT and JSXGraph +en^GeoplanW +en^GeospacW +- +- +- +en^GameMaker ActiveX +en^Google Earth - KML +en^Google Earth - Zipped KML +- +- +- +en^GrafEq +- +en^Groove - Account +en^Groove - Help +en^Groove - Identity Message +en^Groove - Injector +en^Groove - Tool Message +en^Groove - Tool Template +en^Groove - Vcard +- +en^Hypertext Application Language +en^ZVUE Media Manager +en^Homebanking Computer Interface (HBCI) +- +- +- +- +en^Archipelago Lesson Player +- +- +en^HP-GL/2 and HP RTL +en^Hewlett Packard Instant Delivery +en^Hewlett-Packard's WebPrintSmart +en^HP Indigo Digital Press - Job Layout Languate +en^HP Printer Command Language +en^PCL 6 Enhanced (Formely PCL XL) +- +en^Hydrostatix Master Suite +- +- +- +en^3D Crossword Plugin +- +- +en^MiniPay +en^MO:DCA-P +en^IBM DB2 Rights Manager +en^IBM Electronic Media Management System - Secure Container +en^ICC profile +- +en^igLoader +- +- +en^ImmerVision PURE Players +en^ImmerVision PURE Players +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^IOCOM Visimeet +en^Intercon FormNet +en^Interactive Geometry Software +- +- +en^Open Financial Exchange +en^Quicken +- +- +- +- +- +- +- +en^IP Unplugged Roaming Client +en^iRepository / Lucidoc Editor +en^Express by Infoseek +en^International Society for Advancement of Cytometry +- +en^Lightspeed Audio Lab +- +- +- +- +- +- +- +- +en^Mobile Information Device Profile +en^RhymBox +en^Joda Archive +- +en^Kahootz +en^KDE KOffice Office Suite - Karbon +en^KDE KOffice Office Suite - KChart +en^KDE KOffice Office Suite - Kformula +en^KDE KOffice Office Suite - Kivio +en^KDE KOffice Office Suite - Kontour +en^KDE KOffice Office Suite - Kpresenter +en^KDE KOffice Office Suite - Kspread +en^KDE KOffice Office Suite - Kword +en^Kenamea App +en^Kidspiration +en^Kinar Applications +en^SSEYO Koan Play File +en^Kodak Storyshare +- +- +en^Laser App Enterprise +- +- +- +en^Life Balance - Desktop Edition +en^Life Balance - Exchange Format +- +- +en^Lotus 1-2-3 +en^Lotus Approach +en^Lotus Freelance +en^Lotus Notes +en^Lotus Organizer +en^Lotus Screencam +en^Lotus Wordpro +en^MacPorts Port System +- +- +- +- +- +- +- +en^Micro CADAM Helix D&D +en^MedCalc +en^MediaRemote +- +en^Medical Waveform Encoding Format +en^Melody Format for Mobile Platform +- +en^Micrografx +en^Micrografx iGrafx Professional +- +- +- +en^FrameMaker Interchange Format +- +- +en^Mobius Management Systems - UniversalArchive +en^Mobius Management Systems - Distribution Database +en^Mobius Management Systems - Basket file +en^Mobius Management Systems - Query File +en^Mobius Management Systems - Script Language +en^Mobius Management Systems - Policy Definition Language File +en^Mobius Management Systems - Topic Index File +en^Mophun VM +en^Mophun Certificate +- +- +- +- +- +- +- +- +en^XUL - XML User Interface Language +- +en^Microsoft Artgalry +- +en^Microsoft Cabinet File +en^Microsoft Excel +en^Microsoft Excel - Add-In File +en^Microsoft Excel - Binary Workbook +en^Microsoft Excel - Macro-Enabled Workbook +en^Microsoft Excel - Macro-Enabled Template File +en^Microsoft Embedded OpenType +en^Microsoft Html Help File +en^Microsoft Class Server +en^Microsoft Learning Resource Module +- +en^Microsoft Office System Release Theme +- +en^Microsoft Trust UI Provider - Security Catalog +en^Microsoft Trust UI Provider - Certificate Trust Link +- +en^Microsoft PowerPoint +en^Microsoft PowerPoint - Add-in file +en^Microsoft PowerPoint - Macro-Enabled Presentation File +en^Microsoft PowerPoint - Macro-Enabled Open XML Slide +en^Microsoft PowerPoint - Macro-Enabled Slide Show File +en^Micosoft PowerPoint - Macro-Enabled Template File +- +- +en^Microsoft Project +- +- +- +- +- +- +- +- +- +en^Micosoft Word - Macro-Enabled Document +en^Micosoft Word - Macro-Enabled Template +en^Microsoft Works +en^Microsoft Windows Media Player Playlist +en^Microsoft XML Paper Specification +- +en^3GPP MSEQ File +- +- +- +- +en^MUsical Score Interpreted Code Invented for the ASCII designation of Notation +en^Muvee Automatic Video Editing +- +- +- +- +- +- +- +- +en^neuroLanguage +- +- +- +- +en^NobleNet Directory +en^NobleNet Sealer +en^NobleNet Web +- +- +- +- +- +- +- +- +- +en^N-Gage Game Data +en^N-Gage Game Installer +- +- +- +- +en^Nokia Radio Application - Preset +en^Nokia Radio Application - Preset +en^Novadigm's RADIA and EDM products +en^Novadigm's RADIA and EDM products +en^Novadigm's RADIA and EDM products +- +- +- +- +- +en^OpenDocument Chart +en^OpenDocument Chart Template +en^OpenDocument Database +en^OpenDocument Formula +en^OpenDocument Formula Template +en^OpenDocument Graphics +en^OpenDocument Graphics Template +en^OpenDocument Image +en^OpenDocument Image Template +en^OpenDocument Presentation +en^OpenDocument Presentation Template +en^OpenDocument Spreadsheet +en^OpenDocument Spreadsheet Template +en^OpenDocument Text +en^OpenDocument Text Master +en^OpenDocument Text Template +en^Open Document Text Web +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Sugar Linux Application Bundle +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^OMA Download Agents +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Open Office Extension +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Microsoft Office - OOXML - Presentation +- +- +en^Microsoft Office - OOXML - Presentation (Slide) +- +- +- +en^Microsoft Office - OOXML - Presentation (Slideshow) +- +- +- +- +en^Microsoft Office - OOXML - Presentation Template +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Microsoft Office - OOXML - Spreadsheet +- +- +- +- +- +en^Microsoft Office - OOXML - Spreadsheet Teplate +- +- +- +- +- +- +- +- +en^Microsoft Office - OOXML - Word Document +- +- +- +- +- +- +- +- +- +en^Microsoft Office - OOXML - Word Document Template +- +- +- +- +- +- +- +- +en^MapGuide DBXML +- +en^OSGi Deployment Package +- +- +- +- +en^PalmOS Data +- +- +- +- +en^PawaaFILE +- +en^Proprietary P&G Standard Reporting System +en^Proprietary P&G Standard Reporting System +- +en^Pcsel eFIF File +en^Qualcomm's Plaza Mobile Internet +- +en^PocketLearn Viewers +en^PowerBuilder +- +- +- +- +- +- +en^Preview Systems ZipLock/VBox +en^EFI Proteus +- +en^PubliShare Objects +en^Princeton Video Image +- +- +- +- +en^QuarkXPress +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^RealVNC +en^Recordare Applications +en^Recordare Applications +- +- +- +en^CryptoNote +en^Blackberry COD File +en^RealMedia +- +en^ROUTE 66 Location Based Services +- +- +- +en^SailingTracker +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^SeeMail +- +en^Secured eMail +en^Secured eMail +en^Secured eMail +- +en^Shana Informed Filler +en^Shana Informed Filler +en^Shana Informed Filler +en^Shana Informed Filler +- +- +- +- +- +en^SimTech MindMapper +- +en^SMAF File +- +en^SMART Technologies Apps +- +- +- +en^SudokuMagic +en^TIBCO Spotfire +en^TIBCO Spotfire +- +- +- +- +en^StarOffice - Calc +- +en^StarOffice - Draw +en^StarOffice - Impress +en^StarOffice - Math +en^StarOffice - Writer +en^StarOffice - Writer (Global) +- +en^StepMania +- +- +en^OpenOffice - Calc (Spreadsheet) +en^OpenOffice - Calc Template (Spreadsheet) +en^OpenOffice - Draw (Graphics) +en^OpenOffice - Draw Template (Graphics) +en^OpenOffice - Impress (Presentation) +en^OpenOffice - Impress Template (Presentation) +en^OpenOffice - Math (Formula) +en^OpenOffice - Writer (Text - HTML) +en^OpenOffice - Writer (Text - HTML) +en^OpenOffice - Writer Template (Text - HTML) +en^ScheduleUs +en^SourceView Document +- +- +- +en^Symbian Install Package +en^SyncML +en^SyncML - Device Management +en^SyncML - Device Management +- +- +- +- +- +- +- +en^Tao Intent +- +- +- +- +en^MobileTV +- +en^TRI Systems Config +en^Triscape Map Explorer +en^True BASIC +- +- +en^Universal Forms Description Language +en^User Interface Quartz - Theme (Symbian) +en^UMAJIN +en^Unity 3d +en^Unique Object Markup Language +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^VirtualCatalog +- +- +- +- +- +- +- +- +en^Microsoft Visio +en^Visionary +- +en^Viewport+ +- +- +en^WAP Binary XML (WBXML) +en^Compiled Wireless Markup Language (WMLC) +en^WMLScript +en^WebTurbo +- +- +- +- +- +- +- +- +en^Mathematica Notebook Player +en^Wordperfect +en^SundaHus WQ +- +en^Worldtalk +- +- +- +- +en^CorelXARA +en^Extensible Forms Description Language +- +- +- +- +- +- +- +en^HV Voice Dictionary +en^HV Script +en^HV Voice Parameter +en^Open Score Format +en^OSFPVG +- +en^SMAF Audio +en^SMAF Phrase +- +- +- +en^CustomMenu +- +en^Z.U.L. Geometry +en^Zzazz Deck +en^VoiceXML +- +- +en^WebAssembly +- +- +- +- +- +en^Widget Packaging and XML Configuration +en^WinHelp +- +- +- +- +- +- +- +en^WSDL - Web Services Description Language +en^Web Services Policy +- +en^7-Zip +en^AbiWord +- +en^Ace Archive +- +en^Adobe (Macropedia) Authorware - Binary File +en^Adobe (Macropedia) Authorware - Map +en^Adobe (Macropedia) Authorware - Segment File +en^Binary CPIO Archive +en^BitTorrent +- +- +en^Bzip Archive +en^Bzip2 Archive +- +en^Video CD +- +en^pIRCh +en^Portable Game Notation (Chess Games) +- +- +- +- +- +en^CPIO Archive +en^C Shell Script +- +en^Debian Package +- +en^Adobe Shockwave Player +en^Doom Video Game +- +en^Navigation Control file for XML (for ePub) +en^Digital Talking Book +en^Digital Talking Book - Resource File +en^Device Independent File Format (DVI) +- +- +- +- +en^Glyph Bitmap Distribution Format +en^Ghostscript Font +en^PSF Fonts +- +en^OpenType Font File +en^Portable Compiled Format +en^Server Normal Format +- +en^TrueType Font +en^PostScript Fonts +- +- +en^FutureSplash Animator +- +- +- +en^Gnumeric +- +en^GNU Tar Files +- +en^Hierarchical Data Format +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Java Network Launching Protocol +- +- +- +- +en^LaTeX +- +- +- +- +- +- +- +- +- +- +- +en^Mobipocket +en^Microsoft ClickOnce +- +- +en^Microsoft Windows Media Player Download Package +en^Microsoft Windows Media Player Skin Package +en^Microsoft XAML Browser Application +en^Microsoft Access +en^Microsoft Office Binder +en^Microsoft Information Card +en^Microsoft Clipboard Clip +- +en^Microsoft Application +en^Microsoft MediaView +en^Microsoft Windows Metafile +en^Microsoft Money +en^Microsoft Publisher +en^Microsoft Schedule+ +en^Microsoft Windows Terminal Services +- +en^Microsoft Wordpad +en^Network Common Data Form (NetCDF) +- +- +- +- +- +- +en^PKCS #12 - Personal Information Exchange Syntax Standard +en^PKCS #7 - Cryptographic Message Syntax Standard (Certificates) +en^PKCS #7 - Cryptographic Message Syntax Standard (Certificate Request Response) +- +- +- +en^RAR Archive +- +- +- +- +- +en^Bourne Shell Script +en^Shell Archive +en^Adobe Flash +en^Microsoft Silverlight +- +- +- +- +- +- +en^Stuffit Archive +en^Stuffit Archive +- +en^System V Release 4 CPIO Archive +en^System V Release 4 CPIO Checksum Data +- +- +en^Tar File (Tape Archive) +en^Tcl Script +en^TeX +en^TeX Font Metric +en^GNU Texinfo Document +- +- +- +- +- +- +- +en^Ustar (Uniform Standard Tape Archive) +- +en^WAIS Source +- +- +- +- +- +- +- +en^X.509 Certificate +- +- +en^Xfig +- +en^XPInstall - Mozilla +- +en^Zip Archive +- +- +- +- +- +- +- +en^XML Configuration Access Protocol - XCAP Diff +- +- +- +- +- +en^XML Encryption Syntax and Processing +en^XHTML - The Extensible HyperText Markup Language +- +- +en^XML - Extensible Markup Language +en^Document Type Definition +- +- +- +en^XML-Binary Optimized Packaging +- +en^XML Transformations +en^XSPF - XML Shareable Playlist Format +en^MXML +en^YANG Data Modeling Language +- +- +- +- +en^YIN (YANG - XML) +en^Zip Archive +- +- +- +- +- +- +- +- +en^Adaptive differential pulse-code modulation +- +- +- +- +- +- +- +- +en^Sun Audio - Au file format +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^MIDI - Musical Instrument Digital Interface +- +en^MPEG-4 Audio +- +- +- +en^MPEG Audio +- +en^Ogg Audio +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^DECE Audio +en^Digital Winds Music +- +- +- +- +- +- +- +- +- +en^DRA Audio +en^DTS Audio +en^DTS High Definition Audio +- +- +- +- +en^Lucent Voice +en^Microsoft PlayReady Ecosystem +- +- +en^Nuera ECELP 4800 +en^Nuera ECELP 7470 +en^Nuera ECELP 9600 +- +- +- +- +en^Hit'n'Mix +- +- +- +- +en^Waveform Audio File Format (WAV) +en^Open Web Media Project - Audio +en^Advanced Audio Coding (AAC) +en^Audio Interchange File Format +- +- +- +- +- +en^M3U (Multimedia Playlist) +en^Microsoft Windows Media Audio Redirector +en^Microsoft Windows Media Audio +- +en^Real Audio Sound +en^Real Audio Sound +- +en^Waveform Audio File Format (WAV) +- +en^ChemDraw eXchange file +en^Crystallographic Interchange Format +en^CrystalMaker Data Format +en^Chemical Markup Language +en^Chemical Style Markup Language +- +en^XYZ File Format +- +- +- +- +- +- +- +- +- +- +- +en^Bitmap Image File +en^Computer Graphics Metafile +- +- +- +- +- +- +en^G3 Fax Image +en^Graphics Interchange Format +- +- +- +- +- +- +en^Image Exchange Format +- +- +- +en^JPEG Image +- +- +- +- +- +- +- +- +- +- +- +- +en^OpenGL Textures (KTX) +- +- +- +en^Portable Network Graphics (PNG) +en^BTIF +- +- +- +en^Scalable Vector Graphics (SVG) +- +- +en^Tagged Image File Format +- +en^Photoshop Document +- +- +en^DECE Graphic +- +en^DjVu +en^Close Captioning - Subtitle +en^DWG Drawing +en^AutoCAD DXF +en^FastBid Sheet +en^FlashPix +en^FAST Search & Transfer ASA +en^EDMICS 2000 +en^EDMICS 2000 +- +- +- +- +en^Microsoft Document Imaging Format +- +en^FlashPix +- +- +- +- +- +- +- +- +- +en^WAP Bitamp (WBMP) +en^eXtended Image File Format (XIFF) +- +en^WebP Image +- +- +en^Adobe Digital Negative +- +en^Canon Raw Image +en^Canon Raw Image +en^CMU Image +en^Corel Metafile Exchange (CMX) +- +- +en^Epson Raw Image +en^FreeHand MX +en^Fuji Raw Image +- +en^Icon Image +en^Kodak Raw Image +en^Kodak Raw Image +en^Kodak Raw Image +en^Minolta Raw Image +- +en^Bitmap Image File +en^Nikon Raw Image +en^Olympus Raw Image +- +en^Panasonic Raw Image +en^PCX Image +en^Pentax Raw Image +en^PICT Image +en^Portable Anymap Image +en^Portable Bitmap Format +en^Portable Graymap Format +en^Portable Pixmap Format +en^Silicon Graphics RGB Bitmap +en^Sigma Raw Image +en^Sony Raw Image +en^Sony Raw Image +en^Sony Raw Image +- +- +- +- +- +en^X BitMap +- +- +en^X PixMap +en^X Window Dump +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^Email Message +- +- +- +- +- +- +- +- +- +- +- +en^Initial Graphics Exchange Specification (IGES) +en^Mesh Data Type +- +- +- +- +- +- +- +en^COLLADA +en^Autodesk Design Web Format (DWF) +- +en^Geometric Description Language (GDL) +- +en^Gen-Trix Studio +- +en^Virtue MTS +- +- +- +- +- +- +- +- +en^Virtue VTU +en^Virtual Reality Modeling Language +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +en^iCalendar +- +- +- +- +en^Cascading Style Sheets (CSS) +en^Comma-Separated Values +- +- +- +- +- +- +- +- +- +- +- +- +en^HyperText Markup Language (HTML) +- +- +- +- +en^Notation3 +- +- +- +en^Text File +- +- +en^PRS Lines Tag +- +- +- +- +en^Rich Text Format (RTF) +- +- +- +- +en^Standard Generalized Markup Language (SGML) +- +- +- +- +- +en^Tab Separated Values +en^troff +en^Turtle (Terse RDF Triple Language) +- +en^URI Resolution Services +- +- +- +- +en^Curl - Applet +en^Curl - Detached Applet +en^Curl - Manifest File +en^Curl - Source Code +- +- +- +- +- +- +- +en^mod_fly / fly.cgi +en^FLEXSTOR +- +en^Graphviz +- +- +en^In3D - 3DML +en^In3D - 3DML +- +- +- +- +- +- +- +- +- +- +en^J2ME App Descriptor +- +- +- +en^Wireless Markup Language (WML) +en^Wireless Markup Language Script (WMLScript) +- +en^Assembler Source File +en^C Source File +- +- +en^Fortran Source File +en^Java Source File +- +- +en^Pascal Source File +- +en^Setext +- +en^UUEncode +en^vCalendar +en^vCard +- +- +- +- +- +en^3GP +- +en^3GP2 +- +- +- +- +- +- +- +- +- +- +- +en^H.261 +en^H.263 +- +- +en^H.264 +- +- +- +- +en^JPGVideo +- +en^JPEG 2000 Compound Image File Format +- +en^Motion JPEG 2000 +- +- +- +en^MPEG-4 Video +- +en^MPEG Video +- +- +- +en^Ogg Video +- +- +en^Quicktime Video +- +- +- +- +- +- +- +- +- +- +- +- +en^DECE High Definition Video +en^DECE Mobile Video +- +en^DECE PD Video +en^DECE SD Video +en^DECE Video +- +- +- +- +en^FAST Search & Transfer ASA +- +- +- +- +- +- +- +- +- +en^MPEG Url +en^Microsoft PlayReady Ecosystem Video +- +- +- +- +- +- +- +- +- +- +en^DECE MP4 +en^Vivo +- +- +- +en^Open Web Media Project - Video +- +- +en^Flash Video +en^FLI/FLC Animation Format +en^Flash Video +- +- +en^M4v +- +- +- +en^Microsoft Advanced Systems Format (ASF) +- +en^Microsoft Windows Media +en^Microsoft Windows Media Video +en^Microsoft Windows Media Audio/Video Playlist +en^Microsoft Windows Media Video Playlist +en^Audio Video Interleave (AVI) +en^SGI Movie +- +- +- +en^CoolTalk +- +- diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.pext.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.pext.column new file mode 100644 index 0000000..b7f5b83 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.pext.column @@ -0,0 +1,2383 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.use_instead.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.use_instead.column new file mode 100644 index 0000000..db6d1da --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.use_instead.column @@ -0,0 +1,2383 @@ +- +- +- +- +- +- +- +application/x-msaccess +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/x-bleeper +- +- +- +- +application/cals-1840 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.ms-excel +- +- +- +- +- +- +- +- +- +- +font/sfnt +- +font/woff +- +- +application/x-futuresplash +- +- +- +- +application/x-ghostview +- +- +- +- +- +- +- +application/x-hep +- +- +- +- +- +- +- +- +application/x-imagemap +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.lotus-1-2-3 +- +- +- +application/x-mac-compactpro +- +- +- +- +- +- +application/vnd.mcd +- +application/x-mathematica-old +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/x-quicktimeplayer +- +- +- +- +- +- +application/remote-printing +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/smil+xml +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/x-toolbook +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/x-VMSBACKUP +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.3gpp.mcvideo-info+xml +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.aristanetworks.swi +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/geo+json +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +vnd.afpc.afplinedata +- +- +application/vnd.afpc.modca +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.visionary +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.nokia.ncd +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +video/vnd.youtube.yt +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.wordperfect +- +application/x-wordperfect6.1 +application/vnd.wordperfect +- +- +application/vnd.lotus-1-2-3 +- +- +application/x-msaccess +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/x-compressed +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/vnd.ms-excel +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/gzip +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/javascript +- +- +application/vnd.lotus-1-2-3 +- +- +- +- +- +application/vnd.framemaker +application/vnd.mcd +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/msword +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +application/rtf +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +text/troff +- +- +- +application/x-ustar +- +- +- +- +- +application/msword +application/vnd.wordperfect +- +application/vnd.wordperfect +- +- +- +- +- +- +- +- +- +- +- +application/x400-bp +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +audio/qcelp +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +x-chemical/x-pdb +x-chemical/x-xyz +x-drawing/dwf +- +- +- +- +- +- +- +- +- +- +- +- +image/x-cmu-raster +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +image/x-targa +- +- +- +- +- +- +image/x-vnd.dgn +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +image/vnd.net-fpx +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +image/bmp +- +- +- +- +- +image/emf +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +image/wmf +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +multipart/parallel +- +- +application/x-www-form-urlencoded +- +- +- +- +text/csv +- +- +- +- +- +- +- +- +application/ecmascript +- +- +- +- +- +- +- +- +- +application/javascript +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +model/vnd.flatland.3dml +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +text/rtf +- +- +- +- +- +model/vnd.flatland.3dml +- +- +- +- +- +- +- +- +- +- +- +video/x-dl +- +- +- +- +- +video/x-gl +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +video/DV +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.xrefs.column b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.xrefs.column new file mode 100644 index 0000000..12ab701 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/data/mime.xrefs.column @@ -0,0 +1,2383 @@ +rfc^rfc6015|template^application/1d-interleaved-parityfec +person^Ozgur_Oyman^_3GPP|template^application/3gpdash-qoe-report+xml +person^John_M_Meredith^_3GPP|template^application/3gpp-ims+xml +person^Ulrich_Wiehe^_3GPP|template^application/3gppHal+json +person^Ulrich_Wiehe^_3GPP|template^application/3gppHalForms+json +person^ASAM^Thomas_Thomsen|template^application/A2L +- +- +draft^RFC-ietf-ace-oauth-authz-46|template^application/ace+cbor +person^Ehud_Shapiro|template^application/activemessage +person^Benjamin_Goering^W3C|template^application/activity+json +person^Chet_Ensign +rfc^rfc7285|template^application/alto-costmap+json +rfc^rfc7285|template^application/alto-costmapfilter+json +rfc^rfc7285|template^application/alto-directory+json +rfc^rfc7285|template^application/alto-endpointcost+json +rfc^rfc7285|template^application/alto-endpointcostparams+json +rfc^rfc7285|template^application/alto-endpointprop+json +rfc^rfc7285|template^application/alto-endpointpropparams+json +rfc^rfc7285|template^application/alto-error+json +rfc^rfc7285|template^application/alto-networkmap+json +rfc^rfc7285|template^application/alto-networkmapfilter+json +rfc^rfc8895|template^application/alto-updatestreamcontrol+json +rfc^rfc8895|template^application/alto-updatestreamparams+json +person^ASAM^Thomas_Thomsen|template^application/AML +person^Nathaniel_Borenstein|template^application/andrew-inset +- +person^Patrik_Faltstrom|template^application/applefile +- +rfc^rfc9068|template^application/at+jwt +person^ASAM^Thomas_Thomsen|template^application/ATF +person^ASAM^Thomas_Thomsen|template^application/ATFX +rfc^rfc4287^rfc5023|template^application/atom+xml +rfc^rfc5023|template^application/atomcat+xml +rfc^rfc6721|template^application/atomdeleted+xml +person^Nathaniel_Borenstein|template^application/atomicmail +rfc^rfc5023|template^application/atomsvc+xml +person^ATSC|template^application/atsc-dwd+xml +person^ATSC|template^application/atsc-dynamic-event-message +person^ATSC|template^application/atsc-held+xml +person^ATSC|template^application/atsc-rdt+json +person^ATSC|template^application/atsc-rsat+xml +person^ASAM^Thomas_Thomsen|template^application/ATXML +rfc^rfc4745|template^application/auth-policy+xml +person^ASHRAE^Dave_Robin|template^application/bacnet-xdd+zip +rfc^rfc2442|template^application/batch-SMTP +rfc^rfc3080|template^application/beep+xml +- +rfc^rfc7265|template^application/calendar+json +rfc^rfc6321|template^application/calendar+xml +rfc^rfc6910|template^application/call-completion +rfc^rfc1895|template^application/CALS-1840 +- +draft^RFC-ietf-ecrit-data-only-ea-22|template^application/cap+xml +rfc^rfc8908|template^application/captive+json +rfc^rfc8949|template^application/cbor +rfc^rfc8742|template^application/cbor-seq +person^_3GPP|template^application/cccex +rfc^rfc6503|template^application/ccmp+xml +rfc^rfc4267|template^application/ccxml+xml +person^ASAM^Thomas_Thomsen|template^application/CDFX+XML +rfc^rfc6208|template^application/cdmi-capability +rfc^rfc6208|template^application/cdmi-container +rfc^rfc6208|template^application/cdmi-domain +rfc^rfc6208|template^application/cdmi-object +rfc^rfc6208|template^application/cdmi-queue +rfc^rfc7736|template^application/cdni +person^ASAM^Thomas_Thomsen|template^application/CEA +person^Gottfried_Zimmermann|template^application/cea-2018+xml +rfc^rfc4708|template^application/cellml+xml +draft^draft-yasskin-http-origin-signed-responses +rfc^rfc6230|template^application/cfw +person^Hugo_Ledoux +- +person^Andy_Miller^IMS_Global|template^application/clr +rfc^rfc8847|template^application/clue+xml +rfc^rfc8846|template^application/clue_info+xml +rfc^rfc7193|template^application/cms +rfc^rfc3367|template^application/cnrp+xml +rfc^rfc7390|template^application/coap-group+json +rfc^rfc8075|template^application/coap-payload +person^David_Glazer|template^application/commonground +rfc^rfc4575|template^application/conference-info+xml +draft^RFC-ietf-cose-rfc8152bis-struct-15|template^application/cose +draft^RFC-ietf-cose-rfc8152bis-struct-15|template^application/cose-key +draft^RFC-ietf-cose-rfc8152bis-struct-15|template^application/cose-key-set +rfc^rfc3880|template^application/cpl+xml +rfc^rfc7030|template^application/csrattrs +person^Ecma_International_Helpdesk|template^application/csta+xml +person^Ecma_International_Helpdesk|template^application/CSTAdata+xml +person^Ivan_Herman^W3C|template^application/csvm+json +- +rfc^rfc8392|template^application/cwt +person^Donald_E._Eastlake_3rd|template^application/cybercash +person^ISO-IEC_JTC1^Thomas_Stockhammer|template^application/dash+xml +person^ISO-IEC_JTC1|template^application/dash-patch+xml +person^David_Furbeck|template^application/dashdelta +rfc^rfc4709|template^application/davmount+xml +person^Larry_Campbell|template^application/dca-rft +person^ASAM^Thomas_Thomsen|template^application/DCD +person^Larry_Campbell|template^application/dec-dx +rfc^rfc4235|template^application/dialog-info+xml +rfc^rfc3240|template^application/dicom +person^DICOM_Standards_Committee^David_Clunie|template^application/dicom+json +person^DICOM_Standards_Committee^David_Clunie|template^application/dicom+xml +person^ASAM^Thomas_Thomsen|template^application/DII +person^ASAM^Thomas_Thomsen|template^application/DIT +rfc^rfc4027|template^application/dns +rfc^rfc8427|template^application/dns+json +rfc^rfc8484|template^application/dns-message +- +rfc^rfc9132|template^application/dots+cbor +- +rfc^rfc6063|template^application/dskpp+xml +rfc^rfc5698|template^application/dssc+der +rfc^rfc5698|template^application/dssc+xml +rfc^rfc3029|template^application/dvcs +- +rfc^rfc4329|template^application/ecmascript +rfc^rfc1767|template^application/EDI-consent +rfc^rfc1767|template^application/EDI-X12 +rfc^rfc1767|template^application/EDIFACT +person^Samer_El-Haj-Mahmoud^UEFI_Forum|template^application/efi +person^Bryn_Rhodes^HL7|template^application/elm+json +person^Bryn_Rhodes^HL7|template^application/elm+xml +rfc^rfc8876|template^application/EmergencyCallData.cap+xml +rfc^rfc7852|template^application/EmergencyCallData.Comment+xml +rfc^rfc8147|template^application/EmergencyCallData.Control+xml +rfc^rfc7852|template^application/EmergencyCallData.DeviceInfo+xml +rfc^rfc8147|template^application/EmergencyCallData.eCall.MSD +rfc^rfc7852|template^application/EmergencyCallData.ProviderInfo+xml +rfc^rfc7852|template^application/EmergencyCallData.ServiceInfo+xml +rfc^rfc7852|template^application/EmergencyCallData.SubscriberInfo+xml +rfc^rfc8148|template^application/EmergencyCallData.VEDS+xml +person^ISO-IEC_JTC1^W3C|template^application/emma+xml|uri^http://www.w3.org/TR/2007/CR-emma-20071211/#media-type-registration +person^Kazuyuki_Ashimura^W3C|template^application/emotionml+xml +rfc^rfc6849|template^application/encaprtp +rfc^rfc5730|template^application/epp+xml +person^International_Digital_Publishing_Forum^William_McCoy|template^application/epub+zip +person^Steve_Katz|template^application/eshop +rfc^rfc4735|template^application/example +- +person^W3C|template^application/exi|uri^http://www.w3.org/TR/2009/CR-exi-20091208/#mediaTypeRegistration +draft^RFC-ietf-httpbis-expect-ct-08|template^application/expect-ct-report+json +person^Dana_Tripp^ISO-TC_184-SC_4|template^application/express +person^ISO-IEC_JTC1_SC6_ASN.1_Rapporteur^ITU-T_ASN.1_Rapporteur|template^application/fastinfoset +person^ISO-IEC_JTC1_SC6_ASN.1_Rapporteur^ITU-T_ASN.1_Rapporteur|template^application/fastsoap +rfc^rfc6726|template^application/fdt+xml +person^Grahame_Grieve^HL7|template^application/fhir+json +person^Grahame_Grieve^HL7|template^application/fhir+xml +rfc^rfc4047|template^application/fits +rfc^rfc8627|template^application/flexfec +notes^- DEPRECATED in favor of font/sfnt|person^ISO-IEC_JTC1^Levantovsky|rfc^rfc8081|template^application/font-sfnt +rfc^rfc3073|template^application/font-tdpfr +notes^- DEPRECATED in favor of font/woff|person^W3C|rfc^rfc8081|template^application/font-woff +- +rfc^rfc6230|template^application/framework-attributes+xml +- +rfc^rfc7946|template^application/geo+json +rfc^rfc8142|template^application/geo+json-seq +person^OGC^Scott_Simmons|template^application/geopackage+sqlite3 +person^OGC^Scott_Simmons|template^application/geoxacml+xml +- +person^Khronos^Saurabh_Bhatia|template^application/gltf-buffer +person^Clemens_Portele^OGC|template^application/gml+xml +- +- +rfc^rfc6713|template^application/gzip +rfc^rfc4573|template^application/H224 +rfc^rfc5985|template^application/held+xml +- +draft^RFC-ietf-httpbis-messaging-19|template^application/http +person^Michael_Domino|template^application/hyperstudio +- +rfc^rfc5408|template^application/ibe-key-request+xml +rfc^rfc5408|template^application/ibe-pkg-reply+xml +rfc^rfc5408|template^application/ibe-pp-data +person^Curtis_Parks|template^application/iges +rfc^rfc3994|template^application/im-iscomposing+xml +- +rfc^rfc2652|template^application/index +rfc^rfc2652|template^application/index.cmd +rfc^rfc2652|template^application/index.obj +rfc^rfc2652|template^application/index.response +rfc^rfc2652|template^application/index.vnd +person^Kazuyuki_Ashimura|template^application/inkml+xml +person^Jonathan_Hohle +rfc^rfc2935|template^application/IOTP +rfc^rfc5655|template^application/ipfix +rfc^rfc8010|template^application/ipp +rfc^rfc3204|template^application/ISUP +person^ITS-IG-W3C^W3C|template^application/its+xml +- +- +- +rfc^rfc4329|template^application/javascript +person^Ivan_Herman^W3C|template^application/jf2feed+json +rfc^rfc7515|template^application/jose +rfc^rfc7515|template^application/jose+json +rfc^rfc7033|template^application/jrd+json +rfc^rfc8984|template^application/jscalendar+json +rfc^rfc8259|template^application/json +person^Glen_Kleidon +rfc^rfc6902|template^application/json-patch+json +rfc^rfc7464|template^application/json-seq +- +rfc^rfc7517|template^application/jwk+json +rfc^rfc7517|template^application/jwk-set+json +rfc^rfc7519|template^application/jwt +rfc^rfc4730|template^application/kpml-request+xml +rfc^rfc4730|template^application/kpml-response+xml +person^Ivan_Herman^W3C|template^application/ld+json +rfc^rfc7940|template^application/lgr+xml +rfc^rfc6690|template^application/link-format +rfc^rfc7200|template^application/load-control+xml +rfc^rfc5222|template^application/lost+xml +rfc^rfc6739|template^application/lostsync+xml +- +person^Ivan_Herman^W3C|template^application/lpf+zip +person^ASAM^Thomas_Thomsen|template^application/LXF +person^Patrik_Faltstrom|template^application/mac-binhex40 +- +- +person^Paul_Lindner|template^application/macwriteii +rfc^rfc6207|template^application/mads+xml +person^Marcos_Caceres^W3C|template^application/manifest+json +rfc^rfc2220|template^application/marc +rfc^rfc6207|template^application/marcxml+xml +- +person^Wolfram|template^application/mathematica +- +person^W3C|template^application/mathml+xml|uri^http://www.w3.org/TR/MathML3/appendixb.html +person^W3C|template^application/mathml-content+xml|uri^http://www.w3.org/TR/MathML3/appendixb.html +person^W3C|template^application/mathml-presentation+xml|uri^http://www.w3.org/TR/MathML3/appendixb.html +person^_3GPP|template^application/mbms-associated-procedure-description+xml +person^_3GPP|template^application/mbms-deregister+xml +person^_3GPP|template^application/mbms-envelope+xml +person^_3GPP|template^application/mbms-msk+xml +person^_3GPP|template^application/mbms-msk-response+xml +person^_3GPP|template^application/mbms-protection-description+xml +person^_3GPP|template^application/mbms-reception-report+xml +person^_3GPP|template^application/mbms-register+xml +person^_3GPP|template^application/mbms-register-response+xml +person^Eric_Turcotte^_3GPP|template^application/mbms-schedule+xml +person^_3GPP|template^application/mbms-user-service-description+xml +rfc^rfc4155|template^application/mbox +rfc^rfc6796|template^application/media-policy-dataset+xml +rfc^rfc5168|template^application/media_control+xml +rfc^rfc5022|template^application/mediaservercontrol+xml +rfc^rfc7396|template^application/merge-patch+json +- +rfc^rfc5854|template^application/metalink4+xml +rfc^rfc6207|template^application/mets+xml +person^ASAM^Thomas_Thomsen|template^application/MF4 +rfc^rfc3830|template^application/mikey +person^Bryan_Blank^NCGIS|template^application/mipc +draft^RFC-ietf-core-new-block-14|template^application/missing-blocks+cbor-seq +person^ATSC|template^application/mmt-aei+xml +person^ATSC|template^application/mmt-usd+xml +rfc^rfc6207|template^application/mods+xml +rfc^rfc1848|template^application/moss-keys +rfc^rfc1848|template^application/moss-signature +rfc^rfc1848|template^application/mosskey-data +rfc^rfc1848|template^application/mosskey-request +person^David_Singer|rfc^rfc6381|template^application/mp21 +rfc^rfc4337^rfc6381|template^application/mp4 +rfc^rfc3640|template^application/mpeg4-generic +rfc^rfc4337|template^application/mpeg4-iod +rfc^rfc4337|template^application/mpeg4-iod-xmt +rfc^rfc6917|template^application/mrb-consumer+xml +rfc^rfc6917|template^application/mrb-publish+xml +rfc^rfc6231|template^application/msc-ivr+xml +rfc^rfc6505|template^application/msc-mixer+xml +person^Paul_Lindner|template^application/msword +rfc^rfc8520|template^application/mud+json +rfc^rfc8710|template^application/multipart-core +rfc^rfc4539|template^application/mxf +person^Eric_Prudhommeaux^W3C|template^application/n-quads +person^Eric_Prudhommeaux^W3C|template^application/n-triples +rfc^rfc4707|template^application/nasdata +person^Ethan_Davis +- +rfc^rfc5537|template^application/news-checkgroups +rfc^rfc5537|template^application/news-groupinfo +- +rfc^rfc5537|template^application/news-transmission +rfc^rfc6787|template^application/nlsml+xml +person^Node.js_TSC|template^application/node +person^Michael_Hammer|template^application/nss +rfc^rfc9101|template^application/oauth-authz-req+jwt +rfc^rfc6960|template^application/ocsp-request +rfc^rfc6960|template^application/ocsp-response +rfc^rfc2045^rfc2046|template^application/octet-stream +rfc^rfc1494|template^application/ODA +person^Sam_Hume +person^CDISC^Sam_Hume|template^application/odm+xml +person^ASAM^Thomas_Thomsen|template^application/ODX +rfc^rfc4839|template^application/oebps-package+xml +rfc^rfc5334^rfc7845|template^application/ogg +- +- +person^OPC_Foundation|template^application/opc-nodeset+xml +rfc^rfc8613|template^application/oscore +person^Ecma_International_Helpdesk|template^application/oxps +person^Dana_Tripp^ISO-TC_184-SC_4|template^application/p21 +person^Dana_Tripp^ISO-TC_184-SC_4|template^application/p21+zip +rfc^rfc6940|template^application/p2p-overlay+xml +rfc^rfc3009|template^application/parityfec +rfc^rfc8225|template^application/passport +rfc^rfc5261|template^application/patch-ops-error+xml +rfc^rfc8118|template^application/pdf +person^ASAM^Thomas_Thomsen|template^application/PDX +rfc^rfc8555|template^application/pem-certificate-chain +rfc^rfc3156|template^application/pgp-encrypted +rfc^rfc3156|template^application/pgp-keys +rfc^rfc3156|template^application/pgp-signature +- +rfc^rfc3863|template^application/pidf+xml +rfc^rfc5262|template^application/pidf-diff+xml +rfc^rfc5967|template^application/pkcs10 +person^IETF|template^application/pkcs12 +rfc^rfc7114^rfc8551|template^application/pkcs7-mime +rfc^rfc8551|template^application/pkcs7-signature +rfc^rfc5958|template^application/pkcs8 +rfc^rfc8351|template^application/pkcs8-encrypted +rfc^rfc5877|template^application/pkix-attr-cert +rfc^rfc2585|template^application/pkix-cert +rfc^rfc2585|template^application/pkix-crl +draft^draft-hallambaker-mesh-udf +rfc^rfc6066|template^application/pkix-pkipath +rfc^rfc2510|template^application/pkixcmp +rfc^rfc4267|template^application/pls+xml +rfc^rfc4354|template^application/poc-settings+xml +rfc^rfc2045^rfc2046|template^application/postscript +- +rfc^rfc7846|template^application/ppsp-tracker+json +- +rfc^rfc7807|template^application/problem+json +rfc^rfc7807|template^application/problem+xml +person^Ivan_Herman^W3C|template^application/provenance+xml +person^Harald_T._Alvestrand|template^application/prs.alvestrand.titrax-sheet +person^Khemchart_Rungchavalnont|template^application/prs.cww +person^Cynthia_Revström|template^application/prs.cyn +person^Giulio_Zambon|template^application/prs.hpub+zip +person^Jay_Doggett|template^application/prs.nprend +person^Bill_Janssen|template^application/prs.plucker +person^Toby_Inkster|template^application/prs.rdf-xml-crypt +person^Maik_Stührenberg|template^application/prs.xsf+xml +rfc^rfc6030|template^application/pskc+xml +rfc^rfc8801|template^application/pvd+json +rfc^rfc3204|template^application/QSIG +- +rfc^rfc6682|template^application/raptorfec +rfc^rfc9083|template^application/rdap+json +rfc^rfc3870|template^application/rdf+xml +rfc^rfc3680|template^application/reginfo+xml +template^application/relax-ng-compact-syntax|uri^http://www.jtc1sc34.org/repository/0661.pdf +person^Marshall_Rose|rfc^rfc1486|template^application/remote-printing +- +person^Douglas_Creager +rfc^rfc7071|template^application/reputon+json +rfc^rfc4826|template^application/resource-lists+xml +rfc^rfc5362|template^application/resource-lists-diff+xml +rfc^rfc7991|template^application/rfc+xml +person^Sandro_Hawke +person^Nick_Smith|template^application/riscos +rfc^rfc4662|template^application/rlmi+xml +rfc^rfc4826|template^application/rls-services+xml +person^ATSC|template^application/route-apd+xml +person^ATSC|template^application/route-s-tsid+xml +person^ATSC|template^application/route-usd+xml +draft^draft-ietf-sidrops-rpki-rsc-02 +rfc^rfc6493|template^application/rpki-ghostbusters +rfc^rfc6481|template^application/rpki-manifest +rfc^rfc8181|template^application/rpki-publication +rfc^rfc6481|template^application/rpki-roa +rfc^rfc6492|template^application/rpki-updown +- +- +person^Paul_Lindner|template^application/rtf +rfc^rfc6849|template^application/rtploopback +rfc^rfc4588|template^application/rtx +person^OASIS_Security_Services_Technical_Committee_SSTC|template^application/samlassertion+xml +person^OASIS_Security_Services_Technical_Committee_SSTC|template^application/samlmetadata+xml +person^Laurence_J._Golding^Michael_C._Fanning^OASIS|template^application/sarif+json +person^David_Keaton^Michael_C._Fanning^OASIS|template^application/sarif-external-properties+json +person^Donald_L._Mendelson^FIX_Trading_Community|template^application/sbe +rfc^rfc3823|template^application/sbml+xml +person^Oskar_Jonsson^SIS|template^application/scaip+xml +rfc^rfc7644|template^application/scim+json +rfc^rfc5055|template^application/scvp-cv-request +rfc^rfc5055|template^application/scvp-cv-response +rfc^rfc5055|template^application/scvp-vp-request +rfc^rfc5055|template^application/scvp-vp-response +rfc^rfc8866|template^application/sdp +rfc^rfc8417|template^application/secevent+jwt +rfc^rfc8428|template^application/senml+cbor +rfc^rfc8428|template^application/senml+json +rfc^rfc8428|template^application/senml+xml +rfc^rfc8790|template^application/senml-etch+cbor +rfc^rfc8790|template^application/senml-etch+json +rfc^rfc8428|template^application/senml-exi +rfc^rfc8428|template^application/sensml+cbor +rfc^rfc8428|template^application/sensml+json +rfc^rfc8428|template^application/sensml+xml +rfc^rfc8428|template^application/sensml-exi +person^Robby_Simpson^ZigBee|template^application/sep+xml +person^Robby_Simpson^ZigBee|template^application/sep-exi +person^Frederic_Firmin^_3GPP|template^application/session-info +- +person^Brian_Korver|template^application/set-payment +person^Brian_Korver|template^application/set-payment-initiation +person^Brian_Korver|template^application/set-registration +person^Brian_Korver|template^application/set-registration-initiation +rfc^rfc1874|template^application/SGML +person^Paul_Grosso|template^application/sgml-open-catalog +rfc^rfc4194|template^application/shf+xml +rfc^rfc5228|template^application/sieve +draft^draft-yasskin-http-origin-signed-responses +rfc^rfc4661|template^application/simple-filter+xml +rfc^rfc3842|template^application/simple-message-summary +person^_3GPP|template^application/simpleSymbolContainer +person^Bryan_Blank^NCGIS|template^application/sipc +- +person^Terry_Crowley|template^application/slate +notes^(OBSOLETED in favor of application/smil+xml)|rfc^rfc4536|template^application/smil +rfc^rfc4536|template^application/smil+xml +rfc^rfc6597|template^application/smpte336m +person^ISO-IEC_JTC1_SC6_ASN.1_Rapporteur^ITU-T_ASN.1_Rapporteur|template^application/soap+fastinfoset +rfc^rfc3902|template^application/soap+xml +- +person^W3C|template^application/sparql-query|uri^http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/#mediaType +person^W3C|template^application/sparql-results+xml|uri^http://www.w3.org/TR/2007/CR-rdf-sparql-XMLres-20070925/#mime +person^Linux_Foundation^Rose_Judge|template^application/spdx+json +rfc^rfc3910|template^application/spirits-event+xml +rfc^rfc6922|template^application/sql +rfc^rfc4267|template^application/srgs +rfc^rfc4267|template^application/srgs+xml +rfc^rfc6207|template^application/sru+xml +- +rfc^rfc4267|template^application/ssml+xml +- +person^Chet_Ensign^OASIS|template^application/stix+json +person^David_Waltermire^ISO-IEC_JTC1^Ron_Brill|template^application/swid+xml +rfc^rfc5934|template^application/tamp-apex-update +rfc^rfc5934|template^application/tamp-apex-update-confirm +rfc^rfc5934|template^application/tamp-community-update +rfc^rfc5934|template^application/tamp-community-update-confirm +rfc^rfc5934|template^application/tamp-error +rfc^rfc5934|template^application/tamp-sequence-adjust +rfc^rfc5934|template^application/tamp-sequence-adjust-confirm +rfc^rfc5934|template^application/tamp-status-query +rfc^rfc5934|template^application/tamp-status-response +rfc^rfc5934|template^application/tamp-update +rfc^rfc5934|template^application/tamp-update-confirm +person^Chet_Ensign^OASIS|template^application/taxii+json +person^Matthias_Kovatsch^W3C|template^application/td+json +rfc^rfc6129|template^application/tei+xml +person^ETSI^Miguel_Angel_Reina_Ortega|template^application/TETRA_ISI +rfc^rfc5941|template^application/thraud+xml +rfc^rfc3161|template^application/timestamp-query +rfc^rfc3161|template^application/timestamp-reply +rfc^rfc5955|template^application/timestamped-data +rfc^rfc8460|template^application/tlsrpt+gzip +rfc^rfc8460|template^application/tlsrpt+json +rfc^rfc8226|template^application/tnauthlist +draft^RFC-oauth-jwt-introspection-response-12|template^application/token-introspection+jwt +- +rfc^rfc8840|template^application/trickle-ice-sdpfrag +person^W3C^W3C_RDF_Working_Group|template^application/trig +person^W3C^W3C_Timed_Text_Working_Group|template^application/ttml+xml +person^Linda_Welsh|template^application/tve-trigger +rfc^rfc8536|template^application/tzif +rfc^rfc8536|template^application/tzif-leap +rfc^rfc5109|template^application/ulpfec +person^Gottfried_Zimmermann^ISO-IEC_JTC1|template^application/urc-grpsheet+xml +person^Gottfried_Zimmermann^ISO-IEC_JTC1|template^application/urc-ressheet+xml +person^Gottfried_Zimmermann^ISO-IEC_JTC1|template^application/urc-targetdesc+xml +person^Gottfried_Zimmermann|template^application/urc-uisocketdesc+xml +rfc^rfc7095|template^application/vcard+json +rfc^rfc6351|template^application/vcard+xml +- +rfc^rfc2122|template^application/vemmi +- +person^Franz_Ombler|template^application/vnd.1000minds.decision-model+xml +person^Frederic_Firmin|template^application/vnd.3gpp-prose+xml +person^Frederic_Firmin|template^application/vnd.3gpp-prose-pc3ch+xml +person^Frederic_Firmin|template^application/vnd.3gpp-v2x-local-service-information +person^Jones_Lu_Yunjie^_3GPP|template^application/vnd.3gpp.5gnas +person^Frederic_Firmin|template^application/vnd.3gpp.access-transfer-events+xml +person^John_M_Meredith|template^application/vnd.3gpp.bsf+xml +person^Frederic_Firmin|template^application/vnd.3gpp.GMOP+xml +person^Yang_Yong^_3GPP|template^application/vnd.3gpp.gtpc +person^Frederic_Firmin|template^application/vnd.3gpp.interworking-data +person^Jones_Lu_Yunjie^_3GPP|template^application/vnd.3gpp.lpp +person^Tim_Woodward|template^application/vnd.3gpp.mc-signalling-ear +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-affiliation-command+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-payload +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-service-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-signalling +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-ue-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcdata-user-profile+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-affiliation-command+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-floor-request+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-location-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-mbms-usage-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-service-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-signed+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-ue-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-ue-init-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcptt-user-profile+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-affiliation-command+xml +notes^(OBSOLETED in favor of application/vnd.3gpp.mcvideo-info+xml)|person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-affiliation-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-location-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-mbms-usage-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-service-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-transmission-request+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-ue-config+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mcvideo-user-profile+xml +person^Frederic_Firmin|template^application/vnd.3gpp.mid-call+xml +person^Yang_Yong^_3GPP|template^application/vnd.3gpp.ngap +person^Bruno_Landais^_3GPP|template^application/vnd.3gpp.pfcp +person^John_M_Meredith|template^application/vnd.3gpp.pic-bw-large +person^John_M_Meredith|template^application/vnd.3gpp.pic-bw-small +person^John_M_Meredith|template^application/vnd.3gpp.pic-bw-var +person^Yang_Yong^_3GPP|template^application/vnd.3gpp.s1ap +person^John_M_Meredith|template^application/vnd.3gpp.sms +person^Frederic_Firmin|template^application/vnd.3gpp.sms+xml +person^Frederic_Firmin|template^application/vnd.3gpp.srvcc-ext+xml +person^Frederic_Firmin|template^application/vnd.3gpp.SRVCC-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.state-and-event-info+xml +person^Frederic_Firmin|template^application/vnd.3gpp.ussd+xml +person^AC_Mahendran|template^application/vnd.3gpp2.bcmcsinfo+xml +person^AC_Mahendran|template^application/vnd.3gpp2.sms +person^AC_Mahendran|template^application/vnd.3gpp2.tcap +person^Gus_Asadi|template^application/vnd.3lightssoftware.imagescal +person^Michael_OBrien|template^application/vnd.3M.Post-it-Notes +person^Steve_Leow|template^application/vnd.accpac.simply.aso +person^Steve_Leow|template^application/vnd.accpac.simply.imp +person^Dovid_Lubin|template^application/vnd.acucobol +person^Dovid_Lubin|template^application/vnd.acucorp +- +person^Henrik_Andersson|template^application/vnd.adobe.flash.movie +person^Chris_Solc|template^application/vnd.adobe.formscentral.fcdt +person^Steven_Heintz|template^application/vnd.adobe.fxp +person^Tapani_Otala|template^application/vnd.adobe.partial-upload +person^John_Brinkman|template^application/vnd.adobe.xdp+xml +person^Roberto_Perelman|template^application/vnd.adobe.xfdf +person^Jay_Moskowitz|template^application/vnd.aether.imp +person^Jörg_Palmer|template^application/vnd.afpc.afplinedata +person^Jörg_Palmer|template^application/vnd.afpc.afplinedata-pagedef +person^Jörg_Palmer|template^application/vnd.afpc.cmoca-cmresource +person^Jörg_Palmer|template^application/vnd.afpc.foca-charset +person^Jörg_Palmer|template^application/vnd.afpc.foca-codedfont +person^Jörg_Palmer|template^application/vnd.afpc.foca-codepage +person^Jörg_Palmer|template^application/vnd.afpc.modca +person^Jörg_Palmer|template^application/vnd.afpc.modca-cmtable +person^Jörg_Palmer|template^application/vnd.afpc.modca-formdef +person^Jörg_Palmer|template^application/vnd.afpc.modca-mediummap +person^Jörg_Palmer|template^application/vnd.afpc.modca-objectcontainer +person^Jörg_Palmer|template^application/vnd.afpc.modca-overlay +person^Jörg_Palmer|template^application/vnd.afpc.modca-pagesegment +person^Filippo_Valsorda|template^application/vnd.age +person^Katsuhiko_Ichinose|template^application/vnd.ah-barcode +person^Tor_Kristensen|template^application/vnd.ahead.space +person^Daniel_Mould^Gary_Clueit|template^application/vnd.airzip.filesecure.azf +person^Daniel_Mould^Gary_Clueit|template^application/vnd.airzip.filesecure.azs +person^Patrick_Brosse|template^application/vnd.amadeus+json +- +person^Kim_Scarborough|template^application/vnd.amazon.mobi8-ebook +person^Gary_Sands|template^application/vnd.americandynamics.acc +person^Kevin_Blumberg|template^application/vnd.amiga.ami +person^Mike_Amundsen|template^application/vnd.amundsen.maze+xml +person^Greg_Kaiser|template^application/vnd.android.ota +- +person^Kerrick_Staley|template^application/vnd.anki +person^Hiroyoshi_Mori|template^application/vnd.anser-web-certificate-issue-initiation +- +person^Daniel_Shelton|template^application/vnd.antix.game-component +person^Apache_Arrow_Project|template^application/vnd.apache.arrow.file +person^Apache_Arrow_Project|template^application/vnd.apache.arrow.stream +person^Roger_Meier|template^application/vnd.apache.thrift.binary +person^Roger_Meier|template^application/vnd.apache.thrift.compact +person^Roger_Meier|template^application/vnd.apache.thrift.json +person^Steve_Klabnik|template^application/vnd.api+json +person^Oleg_Uryutin|template^application/vnd.aplextor.warrp+json +person^Adrian_Föder|template^application/vnd.apothekende.reservation+json +person^Peter_Bierman|template^application/vnd.apple.installer+xml +person^Manichandra_Sajjanapu|template^application/vnd.apple.keynote +rfc^rfc8216|template^application/vnd.apple.mpegurl +person^Manichandra_Sajjanapu|template^application/vnd.apple.numbers +person^Manichandra_Sajjanapu|template^application/vnd.apple.pages +- +notes^(OBSOLETED in favor of application/vnd.aristanetworks.swi)|person^Bill_Fenner|template^application/vnd.arastra.swi +person^Bill_Fenner|template^application/vnd.aristanetworks.swi +person^Brad_Turner|template^application/vnd.artisan+json +person^Christopher_Smith|template^application/vnd.artsquare +person^Christopher_Snazell|template^application/vnd.astraea-software.iota +person^Horia_Cristian_Slusanschi|template^application/vnd.audiograph +person^Mike_Hearn|template^application/vnd.autopackage +person^Ben_Hinman|template^application/vnd.avalon+json +person^Vladimir_Vysotsky|template^application/vnd.avistar+xml +person^Giacomo_Guilizzoni|template^application/vnd.balsamiq.bmml+xml +person^Giacomo_Guilizzoni|template^application/vnd.balsamiq.bmpr +person^José_Del_Romano|template^application/vnd.banana-accounting +person^Broadband_Forum|template^application/vnd.bbf.usp.error +person^Broadband_Forum|template^application/vnd.bbf.usp.msg +person^Broadband_Forum|template^application/vnd.bbf.usp.msg+json +person^Jegulsky|template^application/vnd.bekitzur-stech+json +person^Heinz-Peter_Schütz|template^application/vnd.bint.med-content +person^Pathway_Commons|template^application/vnd.biopax.rdf+xml +person^Victor_Costan|template^application/vnd.blink-idb-value-wrapper +person^Thomas_Holmstrom|template^application/vnd.blueice.multipass +person^Mike_Foley|template^application/vnd.bluetooth.ep.oob +person^Mark_Powell|template^application/vnd.bluetooth.le.oob +person^Tadashi_Gotoh|template^application/vnd.bmi +person^Bryan_Blank^NCGIS|template^application/vnd.bpf +person^Bryan_Blank^NCGIS|template^application/vnd.bpf3 +person^Philippe_Imoucha|template^application/vnd.businessobjects +person^Brent_Moore|template^application/vnd.byu.uapi+json +person^Joerg_Falkenberg|template^application/vnd.cab-jscript +person^Shin_Muto|template^application/vnd.canon-cpdl +person^Shin_Muto|template^application/vnd.canon-lips +person^Yüksel_Aydemir|template^application/vnd.capasystems-pg+json +person^Peter_Astrand|template^application/vnd.cendio.thinlinc.clientconf +person^Shuji_Fujii|template^application/vnd.century-systems.tcp_stream +person^Glenn_Howes|template^application/vnd.chemdraw+xml +person^Kim_Scarborough|template^application/vnd.chess-pgn +person^Chunyun_Xiong|template^application/vnd.chipnuts.karaoke-mmd +person^Hidekazu_Enjo|template^application/vnd.ciedi +person^Ulrich_Kortenkamp|template^application/vnd.cinderella +person^Pascal_Mayeux|template^application/vnd.cirpack.isdn-ext +person^Rintze_M._Zelle|template^application/vnd.citationstyles.style+xml +person^Ray_Simpson|template^application/vnd.claymore +person^Mike_Labatt|template^application/vnd.cloanto.rp9 +person^Guenther_Brammer|template^application/vnd.clonk.c4group +person^Gaige_Paulsen|template^application/vnd.cluetrust.cartomobile-config +person^Gaige_Paulsen|template^application/vnd.cluetrust.cartomobile-config-pkg +person^Devyn_Collier_Johnson|template^application/vnd.coffeescript +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.document +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.document-template +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.presentation +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.presentation-template +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.spreadsheet +person^Alexey_Meandrov|template^application/vnd.collabio.xodocuments.spreadsheet-template +person^Mike_Amundsen|template^application/vnd.collection+json +person^Irakli_Nadareishvili|template^application/vnd.collection.doc+json +person^Ioseb_Dzmanashvili|template^application/vnd.collection.next+json +person^Kim_Scarborough|template^application/vnd.comicbook+zip +person^Kim_Scarborough|template^application/vnd.comicbook-rar +person^David_Applebaum|template^application/vnd.commerce-battelle +person^Ravinder_Chandhok|template^application/vnd.commonspace +person^Frank_Patz|template^application/vnd.contact.cmsg +person^Alex_Crawford|template^application/vnd.coreos.ignition+json +person^Steve_Dellutri|template^application/vnd.cosmocaller +person^Andrew_Burt|template^application/vnd.crick.clicker +person^Andrew_Burt|template^application/vnd.crick.clicker.keyboard +person^Andrew_Burt|template^application/vnd.crick.clicker.palette +person^Andrew_Burt|template^application/vnd.crick.clicker.template +person^Andrew_Burt|template^application/vnd.crick.clicker.wordbank +person^Jim_Spiller|template^application/vnd.criticaltools.wbs+xml +person^Fränz_Friederes|template^application/vnd.cryptii.pipe+json +person^Connor_Horman|template^application/vnd.crypto-shade-file +person^Sebastian_Stenzel|template^application/vnd.cryptomator.encrypted +person^Sebastian_Stenzel|template^application/vnd.cryptomator.vault +person^Bayard_Kohlhepp|template^application/vnd.ctc-posml +person^Jim_Ancona|template^application/vnd.ctct.ws+xml +person^Michael_Sweet|template^application/vnd.cups-pdf +person^Michael_Sweet|template^application/vnd.cups-postscript +person^Michael_Sweet|template^application/vnd.cups-ppd +person^Michael_Sweet|template^application/vnd.cups-raster +person^Michael_Sweet|template^application/vnd.cups-raw +person^Robert_Byrnes|template^application/vnd.curl +- +- +person^Matt_Kern|template^application/vnd.cyan.dean.root+xml +person^Nor_Helmee|template^application/vnd.cybank +person^Patrick_Dwyer|template^application/vnd.cyclonedx+json +person^Patrick_Dwyer|template^application/vnd.cyclonedx+xml +person^Viktor_Haag|template^application/vnd.d2l.coursepackage1p0+zip +person^Mi_Tar|template^application/vnd.d3m-dataset +person^Mi_Tar|template^application/vnd.d3m-problem +person^Anders_Sandholm|template^application/vnd.dart +person^James_Fields|template^application/vnd.data-vision.rdz +person^Paul_Walsh|template^application/vnd.datapackage+json +person^Paul_Walsh|template^application/vnd.dataresource+json +person^Mi_Tar|template^application/vnd.dbf +person^Charles_Plessy|template^application/vnd.debian.binary-package +person^Michael_A_Dolan|template^application/vnd.dece.data +person^Michael_A_Dolan|template^application/vnd.dece.ttml+xml +person^Michael_A_Dolan|template^application/vnd.dece.unspecified +person^Michael_A_Dolan|template^application/vnd.dece.zip +person^Michael_Dixon|template^application/vnd.denovo.fcselayout-link +person^Henrik_Andersson|template^application/vnd.desmume.movie +person^Yamanaka|template^application/vnd.dir-bi.plate-dl-nosuffix +person^Axel_Ferrazzini|template^application/vnd.dm.delegation+xml +person^Meredith_Searcy|template^application/vnd.dna +person^Tom_Christie|template^application/vnd.document+json +- +person^Steve_Hattersley|template^application/vnd.dolby.mobile.1 +person^Steve_Hattersley|template^application/vnd.dolby.mobile.2 +person^Erik_Ronström|template^application/vnd.doremir.scorecloud-binary-document +person^David_Parker|template^application/vnd.dpgraph +person^William_C._Appleton|template^application/vnd.dreamfactory +person^Keith_Kester|template^application/vnd.drive+json +- +person^Ali_Teffahi|template^application/vnd.dtg.local +person^Ali_Teffahi|template^application/vnd.dtg.local.flash +person^Ali_Teffahi|template^application/vnd.dtg.local.html +person^Michael_Lagally^Peter_Siebert|template^application/vnd.dvb.ait +person^Emily_DUBS|template^application/vnd.dvb.dvbisl+xml +person^Michael_Lagally^Peter_Siebert|template^application/vnd.dvb.dvbj +person^Joerg_Heuer|template^application/vnd.dvb.esgcontainer +person^Roy_Yue|template^application/vnd.dvb.ipdcdftnotifaccess +person^Joerg_Heuer|template^application/vnd.dvb.ipdcesgaccess +person^Jerome_Marcon|template^application/vnd.dvb.ipdcesgaccess2 +person^Jerome_Marcon|template^application/vnd.dvb.ipdcesgpdd +person^Yiling_Xu|template^application/vnd.dvb.ipdcroaming +person^Jean-Baptiste_Henry|template^application/vnd.dvb.iptv.alfec-base +person^Jean-Baptiste_Henry|template^application/vnd.dvb.iptv.alfec-enhancement +person^Roy_Yue|template^application/vnd.dvb.notif-aggregate-root+xml +person^Roy_Yue|template^application/vnd.dvb.notif-container+xml +person^Roy_Yue|template^application/vnd.dvb.notif-generic+xml +person^Roy_Yue|template^application/vnd.dvb.notif-ia-msglist+xml +person^Roy_Yue|template^application/vnd.dvb.notif-ia-registration-request+xml +person^Roy_Yue|template^application/vnd.dvb.notif-ia-registration-response+xml +person^Roy_Yue|template^application/vnd.dvb.notif-init+xml +person^Michael_Lagally^Peter_Siebert|template^application/vnd.dvb.pfr +person^Michael_Lagally^Peter_Siebert|template^application/vnd.dvb.service +person^Michael_Duffy|template^application/vnd.dxr +person^Roland_Mechling|template^application/vnd.dynageo +person^Carl_Anderson|template^application/vnd.dzr +person^Iain_Downs|template^application/vnd.easykaraoke.cdgdownload +person^Gert_Buettgenbach|template^application/vnd.ecdis-update +person^Wei_Tang|template^application/vnd.ecip.rlp +person^Thomas_Olsson|template^application/vnd.ecowin.chart +person^Thomas_Olsson|template^application/vnd.ecowin.filerequest +person^Thomas_Olsson|template^application/vnd.ecowin.fileupdate +person^Thomas_Olsson|template^application/vnd.ecowin.series +person^Thomas_Olsson|template^application/vnd.ecowin.seriesrequest +person^Thomas_Olsson|template^application/vnd.ecowin.seriesupdate +person^Fu_Siyuan^UEFI_Forum|template^application/vnd.efi.img +person^Fu_Siyuan^UEFI_Forum|template^application/vnd.efi.iso +person^Filip_Navara|template^application/vnd.emclient.accessrequest+xml +person^Paul_Santinelli_Jr.|template^application/vnd.enliven +person^Chris_Eich|template^application/vnd.enphase.envoy +person^Tim_Brody|template^application/vnd.eprints.data+xml +person^Shoji_Hoshina|template^application/vnd.epson.esf +person^Shoji_Hoshina|template^application/vnd.epson.msf +person^Yu_Gu|template^application/vnd.epson.quickanime +person^Yasuhito_Nagatomo|template^application/vnd.epson.salt +person^Shoji_Hoshina|template^application/vnd.epson.ssf +person^Paul_Tidwell|template^application/vnd.ericsson.quickcall +person^Marcus_Ligi_Büschleb|template^application/vnd.espass-espass+zip +person^Szilveszter_Tóth|template^application/vnd.eszigno3+xml +person^Shicheng_Hu|template^application/vnd.etsi.aoc+xml +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.asic-e+zip +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.asic-s+zip +person^Shicheng_Hu|template^application/vnd.etsi.cug+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvcommand+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvdiscovery+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvprofile+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvsad-bc+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvsad-cod+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvsad-npvr+xml +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.iptvservice+xml +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.iptvsync+xml +person^Shicheng_Hu|template^application/vnd.etsi.iptvueprofile+xml +person^Shicheng_Hu|template^application/vnd.etsi.mcid+xml +person^Ian_Medland^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.mheg5 +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.overload-control-policy-dataset+xml +person^Jiwan_Han^Thomas_Belling|template^application/vnd.etsi.pstn+xml +person^Shicheng_Hu|template^application/vnd.etsi.sci+xml +person^Shicheng_Hu|template^application/vnd.etsi.simservs+xml +person^Miguel_Angel_Reina_Ortega|template^application/vnd.etsi.timestamp-token +person^Shicheng_Hu|template^application/vnd.etsi.tsl+xml +person^Shicheng_Hu|template^application/vnd.etsi.tsl.der +person^Hervé_Kasparian|template^application/vnd.eu.kasparian.car+json +person^Pete_Resnick|template^application/vnd.eudora.data +person^James_Bellinger|template^application/vnd.evolv.ecig.profile +person^James_Bellinger|template^application/vnd.evolv.ecig.settings +person^James_Bellinger|template^application/vnd.evolv.ecig.theme +person^Bill_Kidwell|template^application/vnd.exstream-empower+zip +person^Bill_Kidwell|template^application/vnd.exstream-package +person^ElectronicZombieCorp|template^application/vnd.ezpix-album +person^ElectronicZombieCorp|template^application/vnd.ezpix-package +person^Samu_Sarivaara|template^application/vnd.f-secure.mobile +person^Gordon_Clarke|template^application/vnd.familysearch.gedcom+zip +person^Thomas_Huth|template^application/vnd.fastcopy-disk-image +person^Steve_Zilles|template^application/vnd.fdf +person^Chad_Trabant|template^application/vnd.fdsn.mseed +person^Chad_Trabant|template^application/vnd.fdsn.seed +person^Holstage|template^application/vnd.ffsns +person^Steve_Gilberd|template^application/vnd.ficlab.flb+zip +person^Harms_Moeller|template^application/vnd.filmit.zfc +person^Ingo_Hammann|template^application/vnd.fints +person^Alex_Dubov|template^application/vnd.firemonkeys.cloudcell +person^Dick_Floersch|template^application/vnd.FloGraphIt +person^Marc_Winter|template^application/vnd.fluxtime.clip +person^George_Williams|template^application/vnd.font-fontforge-sfd +person^Mike_Wexler|template^application/vnd.framemaker +notes^(OBSOLETE)|person^Alexis_Tamas^OP3FT|template^application/vnd.frogans.fnc +notes^(OBSOLETE)|person^Alexis_Tamas^OP3FT|template^application/vnd.frogans.ltf +person^Derek_Smith|template^application/vnd.fsc.weblaunch +person^Kazuya_Iimura|template^application/vnd.fujifilm.fb.docuworks +person^Kazuya_Iimura|template^application/vnd.fujifilm.fb.docuworks.binder +person^Kazuya_Iimura|template^application/vnd.fujifilm.fb.docuworks.container +person^Keitaro_Ishida|template^application/vnd.fujifilm.fb.jfi+xml +person^Nobukazu_Togashi|template^application/vnd.fujitsu.oasys +person^Nobukazu_Togashi|template^application/vnd.fujitsu.oasys2 +person^Seiji_Okudaira|template^application/vnd.fujitsu.oasys3 +person^Masahiko_Sugimoto|template^application/vnd.fujitsu.oasysgp +person^Masumi_Ogita|template^application/vnd.fujitsu.oasysprs +person^Fumio_Tanabe|template^application/vnd.fujixerox.ART-EX +person^Fumio_Tanabe|template^application/vnd.fujixerox.ART4 +person^Masanori_Onda|template^application/vnd.fujixerox.ddd +person^Takatomo_Wakibayashi|template^application/vnd.fujixerox.docuworks +person^Takashi_Matsumoto|template^application/vnd.fujixerox.docuworks.binder +person^Kiyoshi_Tashiro|template^application/vnd.fujixerox.docuworks.container +person^Fumio_Tanabe|template^application/vnd.fujixerox.HBPL +person^Jann_Pruulman|template^application/vnd.fut-misnet +person^Andrey_Galkin|template^application/vnd.futoin+cbor +person^Andrey_Galkin|template^application/vnd.futoin+json +person^Simon_Birtwistle|template^application/vnd.fuzzysheet +person^Torben_Frey|template^application/vnd.genomatix.tuxedo +person^Philipp_Gortan|template^application/vnd.gentics.grd+json +notes^(OBSOLETED by in favor of application/geo+json)|person^Sean_Gillies|rfc^rfc7946|template^application/vnd.geo+json +notes^(OBSOLETED by request)|person^Francois_Pirsch|template^application/vnd.geocube+xml +person^GeoGebra^Yves_Kreis|template^application/vnd.geogebra.file +person^GeoGebra^Markus_Hohenwarter^Michael_Borcherds|template^application/vnd.geogebra.slides +person^GeoGebra^Yves_Kreis|template^application/vnd.geogebra.tool +person^Michael_Hvidsten|template^application/vnd.geometry-explorer +person^Matthias_Ehmann|template^application/vnd.geonext +person^Christian_Mercat|template^application/vnd.geoplan +person^Christian_Mercat|template^application/vnd.geospace +person^Thomas_Weyn|template^application/vnd.gerber +person^Gil_Bernabeu|template^application/vnd.globalplatform.card-content-mgt +person^Gil_Bernabeu|template^application/vnd.globalplatform.card-content-mgt-response +notes^- DEPRECATED|person^Christian_V._Sciberras|template^application/vnd.gmx +person^Michael_Ashbridge|template^application/vnd.google-earth.kml+xml +person^Michael_Ashbridge|template^application/vnd.google-earth.kmz +person^Peter_Biro^Stefan_Szilva|template^application/vnd.gov.sk.e-form+xml +person^Peter_Biro^Stefan_Szilva|template^application/vnd.gov.sk.e-form+zip +person^Peter_Biro^Stefan_Szilva|template^application/vnd.gov.sk.xmldatacontainer+xml +person^Jeff_Tupper|template^application/vnd.grafeq +person^Jeff_Lawson|template^application/vnd.gridmp +person^Todd_Joseph|template^application/vnd.groove-account +person^Todd_Joseph|template^application/vnd.groove-help +person^Todd_Joseph|template^application/vnd.groove-identity-message +person^Todd_Joseph|template^application/vnd.groove-injector +person^Todd_Joseph|template^application/vnd.groove-tool-message +person^Todd_Joseph|template^application/vnd.groove-tool-template +person^Todd_Joseph|template^application/vnd.groove-vcard +person^Mike_Kelly|template^application/vnd.hal+json +person^Mike_Kelly|template^application/vnd.hal+xml +person^Eric_Hamilton|template^application/vnd.HandHeld-Entertainment+xml +person^Ingo_Hammann|template^application/vnd.hbci +person^Jan_Schütze|template^application/vnd.hc+json +person^Doug_R._Serres|template^application/vnd.hcl-bireports +person^Javier_D._Fernández|template^application/vnd.hdt +person^Wesley_Beary|template^application/vnd.heroku+json +person^Randy_Jones|template^application/vnd.hhe.lesson-player +person^Marc_Duteau|template^application/vnd.hl7cda+xml +person^Marc_Duteau|template^application/vnd.hl7v2+xml +person^Bob_Pentecost|template^application/vnd.hp-HPGL +person^Aloke_Gupta|template^application/vnd.hp-hpid +person^Steve_Aubrey|template^application/vnd.hp-hps +person^Amir_Gaash|template^application/vnd.hp-jlyt +person^Bob_Pentecost|template^application/vnd.hp-PCL +person^Bob_Pentecost|template^application/vnd.hp-PCLXL +person^Franck_Lefevre|template^application/vnd.httphone +person^Allen_Gillam|template^application/vnd.hydrostatix.sof-data +person^Irakli_Nadareishvili|template^application/vnd.hyper+json +person^Mario_Demuth|template^application/vnd.hyper-item+json +person^Daniel_Sims|template^application/vnd.hyperdrive+json +person^James_Minnis|template^application/vnd.hzn-3d-crossword +notes^(OBSOLETED in favor of vnd.afpc.afplinedata)|person^Roger_Buis|template^application/vnd.ibm.afplinedata +person^Bruce_Tantlinger|template^application/vnd.ibm.electronic-media +person^Amir_Herzberg|template^application/vnd.ibm.MiniPay +notes^(OBSOLETED in favor of application/vnd.afpc.modca)|person^Reinhard_Hohensee|template^application/vnd.ibm.modcap +person^Bruce_Tantlinger|template^application/vnd.ibm.rights-management +person^Bruce_Tantlinger|template^application/vnd.ibm.secure-container +person^Phil_Green|template^application/vnd.iccprofile +person^Purva_R_Rajkotia|template^application/vnd.ieee.1905 +person^Tim_Fisher|template^application/vnd.igloader +person^Dirk_Farin|template^application/vnd.imagemeter.folder+zip +person^Dirk_Farin|template^application/vnd.imagemeter.image+zip +person^Mathieu_Villegas|template^application/vnd.immervision-ivp +person^Mathieu_Villegas|template^application/vnd.immervision-ivu +person^Lisa_Mattson|template^application/vnd.ims.imsccv1p1 +person^Lisa_Mattson|template^application/vnd.ims.imsccv1p2 +person^Lisa_Mattson|template^application/vnd.ims.imsccv1p3 +person^Lisa_Mattson|template^application/vnd.ims.lis.v2.result+json +person^Lisa_Mattson|template^application/vnd.ims.lti.v2.toolconsumerprofile+json +person^Lisa_Mattson|template^application/vnd.ims.lti.v2.toolproxy+json +person^Lisa_Mattson|template^application/vnd.ims.lti.v2.toolproxy.id+json +person^Lisa_Mattson|template^application/vnd.ims.lti.v2.toolsettings+json +person^Lisa_Mattson|template^application/vnd.ims.lti.v2.toolsettings.simple+json +person^Mark_Wahl|template^application/vnd.informedcontrol.rms+xml +notes^(OBSOLETED in favor of application/vnd.visionary)|person^Christopher_Gales|template^application/vnd.informix-visionary +person^Charles_Engelke|template^application/vnd.infotech.project +person^Charles_Engelke|template^application/vnd.infotech.project+xml +person^Takanori_Sudo|template^application/vnd.innopath.wamp.notification +person^Jon_Swanson|template^application/vnd.insors.igm +person^Tom_Gurak|template^application/vnd.intercon.formnet +person^Yves_Kreis_2|template^application/vnd.intergeo +person^Luke_Tomasello|template^application/vnd.intertrust.digibox +person^Luke_Tomasello|template^application/vnd.intertrust.nncp +person^Greg_Scratchley|template^application/vnd.intu.qbo +person^Greg_Scratchley|template^application/vnd.intu.qfx +person^Michael_Steidl|template^application/vnd.iptc.g2.catalogitem+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.conceptitem+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.knowledgeitem+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.newsitem+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.newsmessage+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.packageitem+xml +person^Michael_Steidl|template^application/vnd.iptc.g2.planningitem+xml +person^Per_Ersson|template^application/vnd.ipunplugged.rcprofile +person^Martin_Knowles|template^application/vnd.irepository.package+xml +person^Satish_Navarajan|template^application/vnd.is-xpr +person^Ryan_Brinkman|template^application/vnd.isac.fcs +person^Frank_Wiebeler|template^application/vnd.iso11783-10+zip +person^Brijesh_Kumar|template^application/vnd.jam +person^Kiyofusa_Fujii|template^application/vnd.japannet-directory-service +person^Jun_Yoshitake|template^application/vnd.japannet-jpnstore-wakeup +person^Kiyofusa_Fujii|template^application/vnd.japannet-payment-wakeup +person^Jun_Yoshitake|template^application/vnd.japannet-registration +person^Kiyofusa_Fujii|template^application/vnd.japannet-registration-wakeup +person^Jun_Yoshitake|template^application/vnd.japannet-setstore-wakeup +person^Jun_Yoshitake|template^application/vnd.japannet-verification +person^Kiyofusa_Fujii|template^application/vnd.japannet-verification-wakeup +person^Mikhail_Gorshenev|template^application/vnd.jcp.javame.midlet-rms +person^Sebastiaan_Deckers|template^application/vnd.jisp +person^Joost|template^application/vnd.joost.joda-archive +person^Yokoyama_Kiyonobu|template^application/vnd.jsk.isdn-ngn +person^Tim_Macdonald|template^application/vnd.kahootz +person^David_Faure|template^application/vnd.kde.karbon +person^David_Faure|template^application/vnd.kde.kchart +person^David_Faure|template^application/vnd.kde.kformula +person^David_Faure|template^application/vnd.kde.kivio +person^David_Faure|template^application/vnd.kde.kontour +person^David_Faure|template^application/vnd.kde.kpresenter +person^David_Faure|template^application/vnd.kde.kspread +person^David_Faure|template^application/vnd.kde.kword +person^Dirk_DiGiorgio-Haag|template^application/vnd.kenameaapp +person^Jack_Bennett|template^application/vnd.kidspiration +person^Hemant_Thakkar|template^application/vnd.Kinar +person^Pete_Cole|template^application/vnd.koan +person^Michael_J._Donahue|template^application/vnd.kodak-descriptor +person^Bryan_Blank^NCGIS|template^application/vnd.las +person^Rob_Bailey|template^application/vnd.las.las+json +person^Rob_Bailey|template^application/vnd.las.las+xml +person^Bryan_Blank^NCGIS|template^application/vnd.laszip +person^Mark_C_Fralick|template^application/vnd.leap+json +person^Brett_McDowell|template^application/vnd.liberty-request+xml +person^Catherine_E._White|template^application/vnd.llamagraphics.life-balance.desktop +person^Catherine_E._White|template^application/vnd.llamagraphics.life-balance.exchange+xml +person^Victor_Kuchynsky|template^application/vnd.logipipe.circuit+zip +person^Sten_Linnarsson|template^application/vnd.loom +person^Paul_Wattenberger|template^application/vnd.lotus-1-2-3 +person^Paul_Wattenberger|template^application/vnd.lotus-approach +person^Paul_Wattenberger|template^application/vnd.lotus-freelance +person^Michael_Laramie|template^application/vnd.lotus-notes +person^Paul_Wattenberger|template^application/vnd.lotus-organizer +person^Paul_Wattenberger|template^application/vnd.lotus-screencam +person^Paul_Wattenberger|template^application/vnd.lotus-wordpro +person^James_Berry|template^application/vnd.macports.portpkg +person^Blake_Thompson|template^application/vnd.mapbox-vector-tile +person^Gary_Ellison|template^application/vnd.marlin.drm.actiontoken+xml +person^Gary_Ellison|template^application/vnd.marlin.drm.conftoken+xml +person^Gary_Ellison|template^application/vnd.marlin.drm.license+xml +person^Gary_Ellison|template^application/vnd.marlin.drm.mdcf +person^Jorn_Wildt|template^application/vnd.mason+json +person^William_Stevenson|template^application/vnd.maxmind.maxmind-db +person^Tadashi_Gotoh|template^application/vnd.mcd +person^Frank_Schoonjans|template^application/vnd.medcalcdata +person^Henry_Flurry|template^application/vnd.mediastation.cdkey +person^Eric_Wedel|template^application/vnd.meridian-slingshot +person^Masaaki_Hirai|template^application/vnd.MFER +person^Yukari_Ikeda|template^application/vnd.mfmp +person^Dali_Zheng|template^application/vnd.micro+json +person^Joe_Prevo|template^application/vnd.micrografx.flo +person^Joe_Prevo|template^application/vnd.micrografx.igx +person^Henrik_Andersson|template^application/vnd.microsoft.portable-executable +person^Henrik_Andersson|template^application/vnd.microsoft.windows.thumbnail-cache +person^Nils_Langhammer|template^application/vnd.miele+json +person^Mike_Wexler|template^application/vnd.mif +person^Chris_Bartram|template^application/vnd.minisoft-hp3000-save +person^Tanaka|template^application/vnd.mitsubishi.misty-guard.trustweb +person^Allen_K._Kabayama|template^application/vnd.Mobius.DAF +person^Allen_K._Kabayama|template^application/vnd.Mobius.DIS +person^Alex_Devasia|template^application/vnd.Mobius.MBK +person^Alex_Devasia|template^application/vnd.Mobius.MQY +person^Allen_K._Kabayama|template^application/vnd.Mobius.MSL +person^Allen_K._Kabayama|template^application/vnd.Mobius.PLC +person^Allen_K._Kabayama|template^application/vnd.Mobius.TXF +person^Bjorn_Wennerstrom|template^application/vnd.mophun.application +person^Bjorn_Wennerstrom|template^application/vnd.mophun.certificate +person^Mark_Patton|template^application/vnd.motorola.flexsuite +person^Mark_Patton|template^application/vnd.motorola.flexsuite.adsi +person^Mark_Patton|template^application/vnd.motorola.flexsuite.fis +person^Mark_Patton|template^application/vnd.motorola.flexsuite.gotap +person^Mark_Patton|template^application/vnd.motorola.flexsuite.kmr +person^Mark_Patton|template^application/vnd.motorola.flexsuite.ttc +person^Mark_Patton|template^application/vnd.motorola.flexsuite.wem +person^Rafie_Shamsaasef|template^application/vnd.motorola.iprm +person^Braden_N_McDaniel|template^application/vnd.mozilla.xul+xml +person^Shawn_Maloney|template^application/vnd.ms-3mfdocument +person^Dean_Slawson|template^application/vnd.ms-artgalry +person^Eric_Fleischman|template^application/vnd.ms-asf +person^Kim_Scarborough|template^application/vnd.ms-cab-compressed +person^Sukvinder_S._Gill|template^application/vnd.ms-excel +person^Chris_Rae|template^application/vnd.ms-excel.addin.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-excel.sheet.binary.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-excel.sheet.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-excel.template.macroEnabled.12 +person^Kim_Scarborough|template^application/vnd.ms-fontobject +person^Anatoly_Techtonik|template^application/vnd.ms-htmlhelp +person^Eric_Ledoux|template^application/vnd.ms-ims +person^Eric_Ledoux|template^application/vnd.ms-lrm +person^Chris_Rae|template^application/vnd.ms-office.activeX+xml +person^Chris_Rae|template^application/vnd.ms-officetheme +- +- +- +person^Daniel_Schneider|template^application/vnd.ms-playready.initiator+xml +person^Sukvinder_S._Gill|template^application/vnd.ms-powerpoint +person^Chris_Rae|template^application/vnd.ms-powerpoint.addin.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-powerpoint.presentation.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-powerpoint.slide.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-powerpoint.slideshow.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-powerpoint.template.macroEnabled.12 +person^Justin_Hutchings|template^application/vnd.ms-PrintDeviceCapabilities+xml +person^Justin_Hutchings|template^application/vnd.ms-PrintSchemaTicket+xml +person^Sukvinder_S._Gill|template^application/vnd.ms-project +person^Sukvinder_S._Gill|template^application/vnd.ms-tnef +person^Justin_Hutchings|template^application/vnd.ms-windows.devicepairing +person^Justin_Hutchings|template^application/vnd.ms-windows.nwprinting.oob +person^Justin_Hutchings|template^application/vnd.ms-windows.printerpairing +person^Justin_Hutchings|template^application/vnd.ms-windows.wsd.oob +person^Kevin_Lau|template^application/vnd.ms-wmdrm.lic-chlg-req +person^Kevin_Lau|template^application/vnd.ms-wmdrm.lic-resp +person^Kevin_Lau|template^application/vnd.ms-wmdrm.meter-chlg-req +person^Kevin_Lau|template^application/vnd.ms-wmdrm.meter-resp +person^Chris_Rae|template^application/vnd.ms-word.document.macroEnabled.12 +person^Chris_Rae|template^application/vnd.ms-word.template.macroEnabled.12 +person^Sukvinder_S._Gill|template^application/vnd.ms-works +person^Dan_Plastina|template^application/vnd.ms-wpl +person^Jesse_McGatha|template^application/vnd.ms-xpsdocument +person^Thomas_Huth|template^application/vnd.msa-disk-image +person^Gwenael_Le_Bodic|template^application/vnd.mseq +person^Malte_Borcherding|template^application/vnd.msign +person^Steve_Mills|template^application/vnd.multiad.creator +person^Steve_Mills|template^application/vnd.multiad.creator.cif +person^Tim_Butler|template^application/vnd.music-niff +person^Greg_Adams|template^application/vnd.musician +person^Chandrashekhara_Anantharamu|template^application/vnd.muvee.style +person^Franck_Lefevre|template^application/vnd.mynfc +person^Sebastian_A._Weiss|template^application/vnd.nacamar.ybrid+json +person^Lauri_Tarkkala|template^application/vnd.ncd.control +person^Lauri_Tarkkala|template^application/vnd.ncd.reference +person^Thomas_Schoffelen|template^application/vnd.nearst.inv+json +person^Andreas_Molzer|template^application/vnd.nebumind.line +person^Steve_Judkins|template^application/vnd.nervana +person^Andy_Mutz|template^application/vnd.netfpx +person^Dan_DuFeu|template^application/vnd.neurolanguage.nlu +person^Amit_Kumar_Gupta|template^application/vnd.nimn +person^Henrik_Andersson|template^application/vnd.nintendo.nitro.rom +person^Henrik_Andersson|template^application/vnd.nintendo.snes.rom +person^Steve_Rogan|template^application/vnd.nitf +person^Monty_Solomon|template^application/vnd.noblenet-directory +person^Monty_Solomon|template^application/vnd.noblenet-sealer +person^Monty_Solomon|template^application/vnd.noblenet-web +person^Nokia|template^application/vnd.nokia.catalogs +person^Nokia|template^application/vnd.nokia.conml+wbxml +person^Nokia|template^application/vnd.nokia.conml+xml +person^Nokia|template^application/vnd.nokia.iptv.config+xml +person^Nokia|template^application/vnd.nokia.iSDS-radio-presets +person^Nokia|template^application/vnd.nokia.landmark+wbxml +person^Nokia|template^application/vnd.nokia.landmark+xml +person^Nokia|template^application/vnd.nokia.landmarkcollection+xml +person^Nokia|template^application/vnd.nokia.n-gage.ac+xml +person^Nokia|template^application/vnd.nokia.n-gage.data +notes^(OBSOLETE; no replacement given)|person^Nokia|template^application/vnd.nokia.n-gage.symbian.install +person^Nokia|template^application/vnd.nokia.ncd +- +person^Nokia|template^application/vnd.nokia.pcd+wbxml +person^Nokia|template^application/vnd.nokia.pcd+xml +person^Nokia|template^application/vnd.nokia.radio-preset +person^Nokia|template^application/vnd.nokia.radio-presets +person^Janine_Swenson|template^application/vnd.novadigm.EDM +person^Janine_Swenson|template^application/vnd.novadigm.EDX +person^Janine_Swenson|template^application/vnd.novadigm.EXT +person^Akinori_Taya|template^application/vnd.ntt-local.content-share +person^NTT-local|template^application/vnd.ntt-local.file-transfer +person^NTT-local|template^application/vnd.ntt-local.ogw_remote-access +person^NTT-local|template^application/vnd.ntt-local.sip-ta_remote +person^NTT-local|template^application/vnd.ntt-local.sip-ta_tcp_stream +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.chart +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.chart-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.database +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.formula +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.formula-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.graphics +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.graphics-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.image +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.image-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.presentation +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.presentation-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.spreadsheet +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.spreadsheet-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.text +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.text-master +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.text-template +person^OASIS^Svante_Schubert|template^application/vnd.oasis.opendocument.text-web +person^Matthias_Hessling|template^application/vnd.obn +person^Michael_Koster|template^application/vnd.ocf+cbor +person^Steven_Lasker|template^application/vnd.oci.image.manifest.v1+json +person^Eli_Grey|template^application/vnd.oftn.l10n+json +person^Claire_DEsclercs|template^application/vnd.oipf.contentaccessdownload+xml +person^Claire_DEsclercs|template^application/vnd.oipf.contentaccessstreaming+xml +person^Claire_DEsclercs|template^application/vnd.oipf.cspg-hexbinary +person^Claire_DEsclercs|template^application/vnd.oipf.dae.svg+xml +person^Claire_DEsclercs|template^application/vnd.oipf.dae.xhtml+xml +person^Claire_DEsclercs|template^application/vnd.oipf.mippvcontrolmessage+xml +person^Claire_DEsclercs|template^application/vnd.oipf.pae.gem +person^Claire_DEsclercs|template^application/vnd.oipf.spdiscovery+xml +person^Claire_DEsclercs|template^application/vnd.oipf.spdlist+xml +person^Claire_DEsclercs|template^application/vnd.oipf.ueprofile+xml +person^Claire_DEsclercs|template^application/vnd.oipf.userprofile+xml +person^John_Palmieri|template^application/vnd.olpc-sugar +person^Ilan_Mahalal|template^application/vnd.oma-scws-config +person^Ilan_Mahalal|template^application/vnd.oma-scws-http-request +person^Ilan_Mahalal|template^application/vnd.oma-scws-http-response +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.associated-procedure-parameter+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.drm-trigger+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.imd+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.ltkm +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.notification+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.provisioningtrigger +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.sgboot +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.sgdd+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.sgdu +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.simple-symbol-container +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.smartcard-trigger+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.sprov+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.bcast.stkm +person^Hao_Wang^OMA|template^application/vnd.oma.cab-address-book+xml +person^Hao_Wang^OMA|template^application/vnd.oma.cab-feature-handler+xml +person^Hao_Wang^OMA|template^application/vnd.oma.cab-pcc+xml +person^Hao_Wang^OMA|template^application/vnd.oma.cab-subs-invite+xml +person^Hao_Wang^OMA|template^application/vnd.oma.cab-user-prefs+xml +person^Avi_Primo^Open_Mobile_Naming_Authority|template^application/vnd.oma.dcd +person^Avi_Primo^Open_Mobile_Naming_Authority|template^application/vnd.oma.dcdc +person^Jun_Sato^Open_Mobile_Alliance_BAC_DLDRM_Working_Group|template^application/vnd.oma.dd2+xml +person^Open_Mobile_Naming_Authority^Uwe_Rauschenbach|template^application/vnd.oma.drm.risd+xml +person^OMA_Presence_and_Availability_PAG_Working_Group^Sean_Kelley|template^application/vnd.oma.group-usage-list+xml +person^John_Mudge^Open_Mobile_Naming_Authority|template^application/vnd.oma.lwm2m+cbor +person^John_Mudge^Open_Mobile_Naming_Authority|template^application/vnd.oma.lwm2m+json +person^John_Mudge^Open_Mobile_Naming_Authority|template^application/vnd.oma.lwm2m+tlv +person^Brian_McColgan^Open_Mobile_Naming_Authority|template^application/vnd.oma.pal+xml +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group|template^application/vnd.oma.poc.detailed-progress-report+xml +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group|template^application/vnd.oma.poc.final-report+xml +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group^Sean_Kelley|template^application/vnd.oma.poc.groups+xml +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group|template^application/vnd.oma.poc.invocation-descriptor+xml +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group|template^application/vnd.oma.poc.optimized-progress-report+xml +person^Bryan_Sullivan^OMA|template^application/vnd.oma.push +person^Open_Mobile_Naming_Authority^Wenjun_Zeng|template^application/vnd.oma.scidm.messages+xml +person^OMA_Presence_and_Availability_PAG_Working_Group^Sean_Kelley|template^application/vnd.oma.xcap-directory+xml +person^OMA_Data_Synchronization_Working_Group|template^application/vnd.omads-email+xml +person^OMA_Data_Synchronization_Working_Group|template^application/vnd.omads-file+xml +person^OMA_Data_Synchronization_Working_Group|template^application/vnd.omads-folder+xml +person^Julien_Grange|template^application/vnd.omaloc-supl-init +person^Nathan_Black|template^application/vnd.onepager +person^Nathan_Black|template^application/vnd.onepagertamp +person^Nathan_Black|template^application/vnd.onepagertamx +person^Nathan_Black|template^application/vnd.onepagertat +person^Nathan_Black|template^application/vnd.onepagertatp +person^Nathan_Black|template^application/vnd.onepagertatx +person^Mark_Otaris|template^application/vnd.openblox.game+xml +person^Mark_Otaris|template^application/vnd.openblox.game-binary +person^Craig_Bruce|template^application/vnd.openeye.oeb +- +person^Paul_Norman|template^application/vnd.openstreetmap.data+xml +person^Peter_Todd|template^application/vnd.opentimestamps.ots +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.custom-properties+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.customXmlProperties+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawing+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.chart+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.extended-properties+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.comments+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.presentation +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.presProps+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slide +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slide+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slideshow +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.tags+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.template +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.sheet +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.template +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.theme+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.themeOverride+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.vmlDrawing +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.document +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.template +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-package.core-properties+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +person^Makoto_Murata|template^application/vnd.openxmlformats-package.relationships+xml +person^Ning_Dong|template^application/vnd.oracle.resource+json +person^CHATRAS_Bruno|template^application/vnd.orange.indata +person^Steven_Klos|template^application/vnd.osa.netdeploy +person^Jason_Birch|template^application/vnd.osgeo.mapguide.package +person^Peter_Kriens|template^application/vnd.osgi.bundle +person^Peter_Kriens|template^application/vnd.osgi.dp +person^Peter_Kriens|template^application/vnd.osgi.subsystem +person^Magnus_Nystrom|template^application/vnd.otps.ct-kip+xml +person^C._Titus_Brown|template^application/vnd.oxli.countgraph +person^Steve_Rice|template^application/vnd.pagerduty+json +person^Gavin_Peacock|template^application/vnd.palm +person^Natarajan_Balasundara|template^application/vnd.panoply +person^John_Kemp|template^application/vnd.paos.xml +person^Christian_Trosclair|template^application/vnd.patentdive +person^Andrew_David_Kendall|template^application/vnd.patientecommsdoc +person^Prakash_Baskaran|template^application/vnd.pawaafile +person^Slawomir_Lisznianski|template^application/vnd.pcos +person^April_Gandert|template^application/vnd.pg.format +person^April_Gandert|template^application/vnd.pg.osasli +person^Lucas_Maneos|template^application/vnd.piaccess.application-licence +person^Giuseppe_Naccarato|template^application/vnd.picsel +person^Rhys_Lewis|template^application/vnd.pmi.widget +person^OMA_Push_to_Talk_over_Cellular_POC_Working_Group^Sean_Kelley|template^application/vnd.poc.group-advertisement+xml +person^Jorge_Pando|template^application/vnd.pocketlearn +person^David_Guy|template^application/vnd.powerbuilder6 +person^David_Guy|template^application/vnd.powerbuilder6-s +person^Reed_Shilts|template^application/vnd.powerbuilder7 +person^Reed_Shilts|template^application/vnd.powerbuilder7-s +person^Reed_Shilts|template^application/vnd.powerbuilder75 +person^Reed_Shilts|template^application/vnd.powerbuilder75-s +person^Juoko_Tenhunen|template^application/vnd.preminet +person^Roman_Smolgovsky|template^application/vnd.previewsystems.box +person^Pete_Hoch|template^application/vnd.proteus.magazine +person^Kristopher_Durski|template^application/vnd.psfs +person^Oren_Ben-Kiki|template^application/vnd.publishare-delta-tree +person^Charles_P._Lamb|template^application/vnd.pvi.ptid1 +rfc^rfc3391|template^application/vnd.pwg-multiplexed +person^Don_Wright|template^application/vnd.pwg-xhtml-print+xml +person^Glenn_Forrester|template^application/vnd.qualcomm.brew-app-res +person^Casper_Joost_Eyckelhof|template^application/vnd.quarantainenet +person^Hannes_Scheidler|template^application/vnd.Quark.QuarkXPress +person^Matthias_Ludwig|template^application/vnd.quobject-quoxdocument +rfc^rfc5707|template^application/vnd.radisys.moml+xml +rfc^rfc5707|template^application/vnd.radisys.msml+xml +rfc^rfc5707|template^application/vnd.radisys.msml-audit+xml +rfc^rfc5707|template^application/vnd.radisys.msml-audit-conf+xml +rfc^rfc5707|template^application/vnd.radisys.msml-audit-conn+xml +rfc^rfc5707|template^application/vnd.radisys.msml-audit-dialog+xml +rfc^rfc5707|template^application/vnd.radisys.msml-audit-stream+xml +rfc^rfc5707|template^application/vnd.radisys.msml-conf+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-base+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-fax-detect+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-fax-sendrecv+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-group+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-speech+xml +rfc^rfc5707|template^application/vnd.radisys.msml-dialog-transform+xml +person^Kevin_Crook|template^application/vnd.rainstor.data +person^Etay_Szekely|template^application/vnd.rapid +person^Kim_Scarborough|template^application/vnd.rar +person^Nick_Reeves|template^application/vnd.realvnc.bed +person^W3C_Music_Notation_Community_Group|template^application/vnd.recordare.musicxml +person^W3C_Music_Notation_Community_Group|template^application/vnd.recordare.musicxml+xml +person^James_Wick|template^application/vnd.RenLearn.rlprint +person^Benedikt_Muessig|template^application/vnd.resilient.logic +person^Stephen_Mizell|template^application/vnd.restful+json +person^Ken_Jibiki|template^application/vnd.rig.cryptonote +- +- +- +person^Sybren_Kikstra|template^application/vnd.route66.link66+xml +person^Lee_Harding|template^application/vnd.rs-274x +person^Jerry_Harris|template^application/vnd.ruckus.download +person^Lauri_Tarkkala|template^application/vnd.s3sms +person^Heikki_Vesalainen|template^application/vnd.sailingtracker.track +person^Markus_Strehle|template^application/vnd.sar +person^Shinji_Kusakari|template^application/vnd.sbm.cid +person^Masanori_Murai|template^application/vnd.sbm.mid2 +person^Craig_Bradney|template^application/vnd.scribus +person^John_Kwan|template^application/vnd.sealed.3df +person^John_Kwan|template^application/vnd.sealed.csf +person^David_Petersen|template^application/vnd.sealed.doc +person^David_Petersen|template^application/vnd.sealed.eml +person^David_Petersen|template^application/vnd.sealed.mht +person^Martin_Lambert|template^application/vnd.sealed.net +person^David_Petersen|template^application/vnd.sealed.ppt +person^John_Kwan^Martin_Lambert|template^application/vnd.sealed.tiff +person^David_Petersen|template^application/vnd.sealed.xls +person^David_Petersen|template^application/vnd.sealedmedia.softseal.html +person^David_Petersen|template^application/vnd.sealedmedia.softseal.pdf +person^Steve_Webb|template^application/vnd.seemail +person^ICT_Manager|template^application/vnd.seis+json +person^Anders_Hansson|template^application/vnd.sema +person^Anders_Hansson|template^application/vnd.semd +person^Anders_Hansson|template^application/vnd.semf +person^Connor_Horman|template^application/vnd.shade-save-file +person^Guy_Selzler|template^application/vnd.shana.informed.formdata +person^Guy_Selzler|template^application/vnd.shana.informed.formtemplate +person^Guy_Selzler|template^application/vnd.shana.informed.interchange +person^Guy_Selzler|template^application/vnd.shana.informed.package +person^Ben_Ramsey|template^application/vnd.shootproof+json +person^Ronald_Jacobs|template^application/vnd.shopkick+json +person^Mi_Tar|template^application/vnd.shp +person^Mi_Tar|template^application/vnd.shx +person^Uwe_Hermann|template^application/vnd.sigrok.session +person^Patrick_Koh|template^application/vnd.SimTech-MindMapper +person^Kevin_Swiber|template^application/vnd.siren+json +person^Hiroaki_Takahashi|template^application/vnd.smaf +person^Jonathan_Neitz|template^application/vnd.smart.notebook +person^Michael_Boyle|template^application/vnd.smart.teacher +person^Connor_Horman|template^application/vnd.snesdev-page-table +person^Jakub_Hytka^Martin_Vondrous|template^application/vnd.software602.filler.form+xml +person^Jakub_Hytka^Martin_Vondrous|template^application/vnd.software602.filler.form-xml-zip +person^Cliff_Gauntlett|template^application/vnd.solent.sdkm+xml +person^Stefan_Jernberg|template^application/vnd.spotfire.dxp +person^Stefan_Jernberg|template^application/vnd.spotfire.sfs +person^Clemens_Ladisch|template^application/vnd.sqlite3 +person^Asang_Dani|template^application/vnd.sss-cod +person^Eric_Bruno|template^application/vnd.sss-dtf +person^Eric_Bruno|template^application/vnd.sss-ntf +- +- +- +- +- +- +- +person^Henrik_Andersson|template^application/vnd.stepmania.package +person^Henrik_Andersson|template^application/vnd.stepmania.stepchart +person^Glenn_Levitt|template^application/vnd.street-stream +person^Marc_Hadley|template^application/vnd.sun.wadl+xml +- +- +- +- +- +- +- +- +- +- +person^Jonathan_Niedfeldt|template^application/vnd.sus-calendar +person^Scott_Becker|template^application/vnd.svd +person^Glenn_Widener|template^application/vnd.swiftview-ics +person^Johann_Terblanche|template^application/vnd.sycle+xml +person^Dan_Luhring|template^application/vnd.syft+json +- +person^OMA_Data_Synchronization_Working_Group|template^application/vnd.syncml+xml +person^OMA-DM_Work_Group|template^application/vnd.syncml.dm+wbxml +person^Bindu_Rama_Rao^OMA-DM_Work_Group|template^application/vnd.syncml.dm+xml +person^OMA-DM_Work_Group^Peter_Thompson|template^application/vnd.syncml.dm.notification +person^OMA-DM_Work_Group|template^application/vnd.syncml.dmddf+wbxml +person^OMA-DM_Work_Group|template^application/vnd.syncml.dmddf+xml +person^OMA-DM_Work_Group|template^application/vnd.syncml.dmtnds+wbxml +person^OMA-DM_Work_Group|template^application/vnd.syncml.dmtnds+xml +person^OMA_Data_Synchronization_Working_Group|template^application/vnd.syncml.ds.notification +person^Paul_Walsh|template^application/vnd.tableschema+json +person^Daniel_Shelton|template^application/vnd.tao.intent-module-archive +person^Glen_Turner^Guy_Harris|template^application/vnd.tcpdump.pcap +person^Arno_Schoedl|template^application/vnd.think-cell.ppttc+json +person^Alex_Sibilev|template^application/vnd.tmd.mediaflex.api+xml +person^Joey_Smith|template^application/vnd.tml +person^Nicolas_Helin|template^application/vnd.tmobile-livetv +person^Rick_Rupp|template^application/vnd.tri.onesource +person^Frank_Cusack|template^application/vnd.trid.tpt +person^Steven_Simonoff|template^application/vnd.triscape.mxs +person^J._Scott_Hepler|template^application/vnd.trueapp +person^Brad_Chase|template^application/vnd.truedoc +person^Martin_Talbot|template^application/vnd.ubisoft.webplayer +person^Dave_Manning|template^application/vnd.ufdl +person^Tim_Ocock|template^application/vnd.uiq.theme +person^Jamie_Riden|template^application/vnd.umajin +person^Unity3d|template^application/vnd.unity +person^Arne_Gerdes|template^application/vnd.uoml+xml +person^Bruce_Martin|template^application/vnd.uplanet.alert +person^Bruce_Martin|template^application/vnd.uplanet.alert-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.bearer-choice +person^Bruce_Martin|template^application/vnd.uplanet.bearer-choice-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.cacheop +person^Bruce_Martin|template^application/vnd.uplanet.cacheop-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.channel +person^Bruce_Martin|template^application/vnd.uplanet.channel-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.list +person^Bruce_Martin|template^application/vnd.uplanet.list-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.listcmd +person^Bruce_Martin|template^application/vnd.uplanet.listcmd-wbxml +person^Bruce_Martin|template^application/vnd.uplanet.signal +person^Sebastian_Baer|template^application/vnd.uri-map +person^Henrik_Andersson|template^application/vnd.valve.source.material +person^Taisuke_Sugimoto|template^application/vnd.vcx +person^Luc_Rogge|template^application/vnd.vd-study +person^Biplab_Sarkar^Lyndsey_Ferguson|template^application/vnd.vectorworks +person^James_Wigger|template^application/vnd.vel+json +person^Petr_Peterka|template^application/vnd.verimatrix.vcas +person^Al_Brown|template^application/vnd.veritone.aion+json +person^Massimo_Bertoli|template^application/vnd.veryant.thin +person^Jim_Zubov|template^application/vnd.ves.encrypted +person^Robert_Hess|template^application/vnd.vidsoft.vidconference +person^Troy_Sandal|template^application/vnd.visio +person^Gayatri_Aravindakumar|template^application/vnd.visionary +person^Mark_Risher|template^application/vnd.vividence.scriptfile +person^Delton_Rowe|template^application/vnd.vsf +person^WAP-Forum|template^application/vnd.wap.sic +person^WAP-Forum|template^application/vnd.wap.slc +person^Peter_Stark|template^application/vnd.wap.wbxml +person^Peter_Stark|template^application/vnd.wap.wmlc +person^Peter_Stark|template^application/vnd.wap.wmlscriptc +person^Yaser_Rehem|template^application/vnd.webturbo +person^Dr._Jun_Tian^Wi-Fi_Alliance|template^application/vnd.wfa.dpp +person^Mick_Conley|template^application/vnd.wfa.p2p +person^Wi-Fi_Alliance|template^application/vnd.wfa.wsc +person^Priya_Dandawate|template^application/vnd.windows.devicepairing +person^Thomas_Kjornes|template^application/vnd.wmc +person^Prakash_Iyer^Thinh_Nguyenphu|template^application/vnd.wmf.bootstrap +person^Wolfram|template^application/vnd.wolfram.mathematica +person^Wolfram|template^application/vnd.wolfram.mathematica.package +person^Wolfram|template^application/vnd.wolfram.player +person^Kim_Scarborough|template^application/vnd.wordperfect +person^Jan_Bostrom|template^application/vnd.wqd +person^Chris_Bartram|template^application/vnd.wrq-hp3000-labelled +person^Bill_Wohler|template^application/vnd.wt.stf +person^Matti_Salmi|template^application/vnd.wv.csp+wbxml +person^John_Ingi_Ingimundarson|template^application/vnd.wv.csp+xml +person^John_Ingi_Ingimundarson|template^application/vnd.wv.ssp+xml +person^David_Brossard|template^application/vnd.xacml+json +person^David_Matthewman|template^application/vnd.xara +person^Dave_Manning|template^application/vnd.xfdl +person^Michael_Mansell|template^application/vnd.xfdl.webform +person^Fred_Waskiewicz|template^application/vnd.xmi+xml +person^Reuven_Sherwin|template^application/vnd.xmpie.cpkg +person^Reuven_Sherwin|template^application/vnd.xmpie.dpkg +person^Reuven_Sherwin|template^application/vnd.xmpie.plan +person^Reuven_Sherwin|template^application/vnd.xmpie.ppkg +person^Reuven_Sherwin|template^application/vnd.xmpie.xlim +person^Tomohiro_Yamamoto|template^application/vnd.yamaha.hv-dic +person^Tomohiro_Yamamoto|template^application/vnd.yamaha.hv-script +person^Tomohiro_Yamamoto|template^application/vnd.yamaha.hv-voice +person^Mark_Olleson|template^application/vnd.yamaha.openscoreformat +person^Mark_Olleson|template^application/vnd.yamaha.openscoreformat.osfpvg+xml +person^Takehiro_Sukizaki|template^application/vnd.yamaha.remote-setup +person^Keiichi_Shinoda|template^application/vnd.yamaha.smaf-audio +person^Keiichi_Shinoda|template^application/vnd.yamaha.smaf-phrase +person^Takehiro_Sukizaki|template^application/vnd.yamaha.through-ngn +person^Takehiro_Sukizaki|template^application/vnd.yamaha.tunnel-udpencap +person^Jens_Jorgensen|template^application/vnd.yaoweme +person^Mr._Yellow|template^application/vnd.yellowriver-custom-menu +notes^(OBSOLETED in favor of video/vnd.youtube.yt)|person^Laura_Wood|template^application/vnd.youtube.yt +person^Rene_Grothmann|template^application/vnd.zul +person^Micheal_Hewett|template^application/vnd.zzazz.deck+xml +rfc^rfc4267|template^application/voicexml+xml +rfc^rfc8366|template^application/voucher-cms+json +rfc^rfc6035|template^application/vq-rtcpxr +person^Eric_Prudhommeaux^W3C|template^application/wasm +rfc^rfc3858|template^application/watcherinfo+xml +draft^draft-yasskin-wpack-bundled-exchanges +rfc^rfc8292|template^application/webpush-options+json +rfc^rfc2957|template^application/whoispp-query +rfc^rfc2958|template^application/whoispp-response +person^Steven_Pemberton^W3C|template^application/widget|uri^http://www.w3.org/TR/widgets/#media-type-registration-for-application/widget +- +person^Larry_Campbell|template^application/wita +person^Roy_T._Fielding +- +- +person^Paul_Lindner|template^application/wordperfect5.1 +- +- +person^W3C|template^application/wsdl+xml +person^W3C|template^application/wspolicy+xml +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +rfc^rfc8894|template^application/x-pki-message +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +person^Anne_van_Kesteren^WHATWG|template^application/x-www-form-urlencoded +rfc^rfc8894|template^application/x-x509-ca-cert +rfc^rfc8894|template^application/x-x509-ca-ra-cert +rfc^rfc8894|template^application/x-x509-next-ca-cert +- +- +- +- +- +- +rfc^rfc1494|template^application/x400-bp +- +rfc^rfc7061|template^application/xacml+xml +- +rfc^rfc4825|template^application/xcap-att+xml +rfc^rfc4825|template^application/xcap-caps+xml +rfc^rfc5874|template^application/xcap-diff+xml +rfc^rfc4825|template^application/xcap-el+xml +rfc^rfc4825|template^application/xcap-error+xml +rfc^rfc4825|template^application/xcap-ns+xml +rfc^rfc6502|template^application/xcon-conference-info+xml +rfc^rfc6502|template^application/xcon-conference-info-diff+xml +person^Joseph_Reagle^XENC_Working_Group|template^application/xenc+xml +person^Robin_Berjon^W3C|template^application/xhtml+xml +draft^draft-mccobb-xplusv-media-type|notes^- OBSOLETE; no replacement given|template^application/xhtml-voice+xml +person^Chet_Ensign^OASIS|template^application/xliff+xml +rfc^rfc7303|template^application/xml +rfc^rfc7303|template^application/xml-dtd +rfc^rfc7303|template^application/xml-external-parsed-entity +rfc^rfc7351|template^application/xml-patch+xml +rfc^rfc3923|template^application/xmpp+xml +person^Mark_Nottingham|template^application/xop+xml +- +person^W3C|template^application/xslt+xml|uri^http://www.w3.org/TR/2007/REC-xslt20-20070123/#media-type-registration +- +rfc^rfc4374|template^application/xv+xml +rfc^rfc6020|template^application/yang +rfc^rfc8040|template^application/yang-data+json +rfc^rfc8040|template^application/yang-data+xml +rfc^rfc8072|template^application/yang-patch+json +rfc^rfc8072|template^application/yang-patch+xml +rfc^rfc6020|template^application/yin+xml +person^Paul_Lindner|template^application/zip +rfc^rfc6713|template^application/zlib +rfc^rfc8878|template^application/zstd +rfc^rfc6015|template^audio/1d-interleaved-parityfec +rfc^rfc2421^rfc3802|template^audio/32kadpcm +rfc^rfc3839^rfc6381|template^audio/3gpp +rfc^rfc4393^rfc6381|template^audio/3gpp2 +person^ISO-IEC_JTC1^Max_Neuendorf|template^audio/aac +rfc^rfc4184|template^audio/ac3 +- +rfc^rfc4867|template^audio/AMR +rfc^rfc4867|template^audio/AMR-WB +rfc^rfc4352|template^audio/amr-wb+ +rfc^rfc7310|template^audio/aptx +rfc^rfc6295|template^audio/asc +rfc^rfc5584|template^audio/ATRAC-ADVANCED-LOSSLESS +rfc^rfc5584|template^audio/ATRAC-X +rfc^rfc5584|template^audio/ATRAC3 +rfc^rfc2045^rfc2046|template^audio/basic +rfc^rfc4298|template^audio/BV16 +rfc^rfc4298|template^audio/BV32 +rfc^rfc4040|template^audio/clearmode +rfc^rfc3389|template^audio/CN +rfc^rfc3190|template^audio/DAT12 +rfc^rfc4613|template^audio/dls +rfc^rfc3557|template^audio/dsr-es201108 +rfc^rfc4060|template^audio/dsr-es202050 +rfc^rfc4060|template^audio/dsr-es202211 +rfc^rfc4060|template^audio/dsr-es202212 +rfc^rfc6469|template^audio/DV +rfc^rfc4856|template^audio/DVI4 +rfc^rfc4598|template^audio/eac3 +rfc^rfc6849|template^audio/encaprtp +rfc^rfc4788|template^audio/EVRC +rfc^rfc3625|template^audio/EVRC-QCP +rfc^rfc4788|template^audio/EVRC0 +rfc^rfc4788|template^audio/EVRC1 +rfc^rfc5188|template^audio/EVRCB +rfc^rfc5188|template^audio/EVRCB0 +rfc^rfc4788|template^audio/EVRCB1 +rfc^rfc6884|template^audio/EVRCNW +rfc^rfc6884|template^audio/EVRCNW0 +rfc^rfc6884|template^audio/EVRCNW1 +rfc^rfc5188|template^audio/EVRCWB +rfc^rfc5188|template^audio/EVRCWB0 +rfc^rfc5188|template^audio/EVRCWB1 +person^Kyunghun_Jung^_3GPP|template^audio/EVS +rfc^rfc4735|template^audio/example +rfc^rfc8627|template^audio/flexfec +rfc^rfc6354|template^audio/fwdred +rfc^rfc7655|template^audio/G711-0 +rfc^rfc5404|rfc-errata^3245|template^audio/G719 +rfc^rfc4856|template^audio/G722 +rfc^rfc5577|template^audio/G7221 +rfc^rfc4856|template^audio/G723 +rfc^rfc4856|template^audio/G726-16 +rfc^rfc4856|template^audio/G726-24 +rfc^rfc4856|template^audio/G726-32 +rfc^rfc4856|template^audio/G726-40 +rfc^rfc4856|template^audio/G728 +rfc^rfc4856|template^audio/G729 +rfc^rfc4749^rfc5459|template^audio/G7291 +rfc^rfc4856|template^audio/G729D +rfc^rfc4856|template^audio/G729E +rfc^rfc4856|template^audio/GSM +rfc^rfc4856|template^audio/GSM-EFR +rfc^rfc5993|template^audio/GSM-HR-08 +rfc^rfc3952|template^audio/iLBC +rfc^rfc6262|template^audio/ip-mr_v2.5 +rfc^rfc4856|template^audio/L16 +rfc^rfc3190|template^audio/L20 +rfc^rfc3190|template^audio/L24 +rfc^rfc4856|template^audio/L8 +rfc^rfc4856|template^audio/LPC +rfc^rfc8130|template^audio/MELP +rfc^rfc8130|template^audio/MELP1200 +rfc^rfc8130|template^audio/MELP2400 +rfc^rfc8130|template^audio/MELP600 +person^ISO-IEC_JTC1^Ingo_Hofmann^Nils_Peters|template^audio/mhas +- +rfc^rfc4723|template^audio/mobile-xmf +rfc^rfc4337^rfc6381|template^audio/mp4 +rfc^rfc6416|template^audio/MP4A-LATM +rfc^rfc3555|template^audio/MPA +rfc^rfc5219|template^audio/mpa-robust +rfc^rfc3003|template^audio/mpeg +rfc^rfc3640^rfc5691^rfc6295|template^audio/mpeg4-generic +rfc^rfc5334^rfc7845|template^audio/ogg +rfc^rfc7587|template^audio/opus +rfc^rfc3009|template^audio/parityfec +rfc^rfc4856|template^audio/PCMA +rfc^rfc5391|template^audio/PCMA-WB +rfc^rfc4856|template^audio/PCMU +rfc^rfc5391|template^audio/PCMU-WB +person^Linus_Walleij|template^audio/prs.sid +rfc^rfc3555^rfc3625|template^audio/QCELP +rfc^rfc6682|template^audio/raptorfec +rfc^rfc3555|template^audio/RED +person^_3GPP|template^audio/rtp-enc-aescm128 +rfc^rfc6295|template^audio/rtp-midi +rfc^rfc6849|template^audio/rtploopback +rfc^rfc4588|template^audio/rtx +- +person^Daniel_Hanson^Michael_Faller^SCIP|template^audio/scip +- +rfc^rfc3558|template^audio/SMV +rfc^rfc3625|template^audio/SMV-QCP +rfc^rfc3558|template^audio/SMV0 +person^AES^Piotr_Majdak|template^audio/sofa +person^Timo_Kosonen^Tom_White|template^audio/sp-midi +rfc^rfc5574|template^audio/speex +rfc^rfc4351|template^audio/t140c +rfc^rfc4612|template^audio/t38 +rfc^rfc4733|template^audio/telephone-event +person^ETSI^Miguel_Angel_Reina_Ortega|template^audio/TETRA_ACELP +person^ETSI^Miguel_Angel_Reina_Ortega|template^audio/TETRA_ACELP_BB +rfc^rfc4733|template^audio/tone +rfc^rfc8817|template^audio/TSVCIS +rfc^rfc5686|template^audio/UEMCLIP +rfc^rfc5109|template^audio/ulpfec +person^ISO-IEC_JTC1^Max_Neuendorf|template^audio/usac +rfc^rfc4856|template^audio/VDVI +rfc^rfc4348^rfc4424|template^audio/VMR-WB +person^Thomas_Belling|template^audio/vnd.3gpp.iufp +person^Serge_De_Jaham|template^audio/vnd.4SB +person^Vicki_DeBarros|template^audio/vnd.audiokoz +person^Serge_De_Jaham|template^audio/vnd.CELP +person^Rajesh_Kumar|template^audio/vnd.cisco.nse +person^Jean-Philippe_Goulet|template^audio/vnd.cmles.radio-events +person^Ann_McLaughlin|template^audio/vnd.cns.anp1 +person^Ann_McLaughlin|template^audio/vnd.cns.inf1 +person^Michael_A_Dolan|template^audio/vnd.dece.audio +person^Armands_Strazds|template^audio/vnd.digital-winds +person^Edwin_Heredia|template^audio/vnd.dlna.adts +person^Steve_Hattersley|template^audio/vnd.dolby.heaac.1 +person^Steve_Hattersley|template^audio/vnd.dolby.heaac.2 +person^Mike_Ward|template^audio/vnd.dolby.mlp +person^Steve_Hattersley|template^audio/vnd.dolby.mps +person^Steve_Hattersley|template^audio/vnd.dolby.pl2 +person^Steve_Hattersley|template^audio/vnd.dolby.pl2x +person^Steve_Hattersley|template^audio/vnd.dolby.pl2z +person^Steve_Hattersley|template^audio/vnd.dolby.pulse.1 +person^Jiang_Tian|template^audio/vnd.dra +person^William_Zou|template^audio/vnd.dts +person^William_Zou|template^audio/vnd.dts.hd +person^Phillip_Maness|template^audio/vnd.dts.uhd +person^Peter_Siebert|template^audio/vnd.dvb.file +person^Shay_Cicelsky|template^audio/vnd.everad.plj +person^Swaminathan|template^audio/vnd.hns.audio +person^Greg_Vaudreuil|template^audio/vnd.lucent.voice +person^Steve_DiAcetis|template^audio/vnd.ms-playready.media.pya +person^Nokia|template^audio/vnd.nokia.mobile-xmf +person^Glenn_Parsons|template^audio/vnd.nortel.vbk +person^Michael_Fox|template^audio/vnd.nuera.ecelp4800 +person^Michael_Fox|template^audio/vnd.nuera.ecelp7470 +person^Michael_Fox|template^audio/vnd.nuera.ecelp9600 +person^Greg_Vaudreuil|template^audio/vnd.octel.sbc +person^Matthias_Juwan|template^audio/vnd.presonus.multitrack +notes^- DEPRECATED in favor of audio/qcelp|rfc^rfc3625|template^audio/vnd.qcelp +person^Greg_Vaudreuil|template^audio/vnd.rhetorex.32kadpcm +person^Martin_Dawe|template^audio/vnd.rip +person^David_Petersen|template^audio/vnd.sealedmedia.softseal.mpeg +person^Greg_Vaudreuil|template^audio/vnd.vmx.cvsd +rfc^rfc5215|template^audio/vorbis +rfc^rfc5215|template^audio/vorbis-config +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +rfc^rfc8081|template^font/collection +rfc^rfc8081|template^font/otf +rfc^rfc8081|template^font/sfnt +rfc^rfc8081|template^font/ttf +rfc^rfc8081|template^font/woff +rfc^rfc8081|template^font/woff2 +person^Howard_Lukk^SMPTE|template^image/aces +person^David_Singer^ISO-IEC_JTC1|template^image/avci +person^David_Singer^ISO-IEC_JTC1|template^image/avcs +person^Alliance_for_Open_Media^Cyril_Concolato|template^image/avif +rfc^rfc7903|template^image/bmp +person^Alan_Francis|template^image/cgm +- +person^DICOM_Standards_Committee^David_Clunie|template^image/dicom-rle +person^Director_of_Standards +rfc^rfc7903|template^image/emf +rfc^rfc4735|template^image/example +rfc^rfc4047|template^image/fits +rfc^rfc1494|template^image/g3fax +rfc^rfc2045^rfc2046 +person^David_Singer^ISO-IEC_JTC1|template^image/heic +person^David_Singer^ISO-IEC_JTC1|template^image/heic-sequence +person^David_Singer^ISO-IEC_JTC1|template^image/heif +person^David_Singer^ISO-IEC_JTC1|template^image/heif-sequence +person^ISO-IEC_JTC1^ITU-T|template^image/hej2k +person^ISO-IEC_JTC1^ITU-T|template^image/hsj2 +rfc^rfc1314 +person^ISO-IEC_JTC_1-SC_29-WG_1_Convenor +person^DICOM_Standards_Committee^David_Clunie|template^image/jls +rfc^rfc3745|template^image/jp2 +rfc^rfc2045^rfc2046 +person^ISO-IEC_JTC1^ITU-T|template^image/jph +person^ISO-IEC_JTC1^ITU-T|template^image/jphc +rfc^rfc3745|template^image/jpm +rfc^rfc3745|template^image/jpx +person^Touradj_Ebrahimi +person^ISO-IEC_JTC1^ITU-T|template^image/jxr +person^ISO-IEC_JTC1^ITU-T|template^image/jxrA +person^ISO-IEC_JTC1^ITU-T|template^image/jxrS +person^ISO-IEC_JTC1|template^image/jxs +person^ISO-IEC_JTC1|template^image/jxsc +person^ISO-IEC_JTC1|template^image/jxsi +person^ISO-IEC_JTC1|template^image/jxss +person^Khronos^Mark_Callow|template^image/ktx +person^Khronos^Mark_Callow|template^image/ktx2 +person^Ilya_Ferber|template^image/naplps +- +person^PNG_Working_Group^W3C|template^image/png +person^Ben_Simon|template^image/prs.btif +person^Juern_Laun|template^image/prs.pti +person^Michael_Sweet|template^image/pwg-raster +- +person^W3C|template^image/svg+xml|uri^http://www.w3.org/TR/SVG/mimereg.html +rfc^rfc3362|template^image/t38 +- +rfc^rfc3302|template^image/tiff +rfc^rfc3950|template^image/tiff-fx +person^Kim_Scarborough|template^image/vnd.adobe.photoshop +person^Gary_Clueit|template^image/vnd.airzip.accelerator.azv +person^Ann_McLaughlin|template^image/vnd.cns.inf2 +person^Michael_A_Dolan|template^image/vnd.dece.graphic +- +person^Leon_Bottou|template^image/vnd.djvu +person^Michael_Lagally^Peter_Siebert|template^image/vnd.dvb.subtitle +person^Jodi_Moline|template^image/vnd.dwg +person^Jodi_Moline|template^image/vnd.dxf +person^Scott_Becker|template^image/vnd.fastbidsheet +person^Marc_Douglas_Spencer|template^image/vnd.fpx +person^Arild_Fuldseth|template^image/vnd.fst +person^Masanori_Onda|template^image/vnd.fujixerox.edmics-mmr +person^Masanori_Onda|template^image/vnd.fujixerox.edmics-rlc +person^Martin_Bailey|template^image/vnd.globalgraphics.pgb +person^Simon_Butcher|template^image/vnd.microsoft.icon +person^Saveen_Reddy|template^image/vnd.mix +person^Stuart_Parmenter|template^image/vnd.mozilla.apng +person^Gregory_Vaughan|template^image/vnd.ms-modi +- +person^Marc_Douglas_Spencer|template^image/vnd.net-fpx +- +person^Jan_Zeman^PCO_AG|template^image/vnd.pco.b16 +person^Greg_Ward^Randolph_Fritz|template^image/vnd.radiance +person^David_Petersen|template^image/vnd.sealed.png +person^David_Petersen|template^image/vnd.sealedmedia.softseal.gif +person^David_Petersen|template^image/vnd.sealedmedia.softseal.jpg +person^Jodi_Moline|template^image/vnd.svf +person^Ni_Hui|template^image/vnd.tencent.tap +person^Henrik_Andersson|template^image/vnd.valve.source.texture +person^Peter_Stark|template^image/vnd.wap.wbmp +person^Steven_Martin|template^image/vnd.xiff +person^Chris_Charabaruk|template^image/vnd.zbrush.pcx +- +rfc^rfc7903|template^image/wmf +- +- +- +- +- +- +- +- +notes^- DEPRECATED in favor of image/emf|rfc^rfc7903|template^image/emf +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +notes^- DEPRECATED in favor of image/wmf|rfc^rfc7903|template^image/wmf +- +- +- +- +- +rfc^rfc3862|template^message/CPIM +rfc^rfc1894|template^message/delivery-status +rfc^rfc8098|template^message/disposition-notification +rfc^rfc4735|template^message/example +rfc^rfc2045^rfc2046 +rfc^rfc5965|template^message/feedback-report +rfc^rfc6532|template^message/global +rfc^rfc6533|template^message/global-delivery-status +rfc^rfc6533|template^message/global-disposition-notification +rfc^rfc6533|template^message/global-headers +draft^RFC-ietf-httpbis-messaging-19|template^message/http +rfc^rfc5438|template^message/imdn+xml +notes^(OBSOLETED by )|person^Henry_Spencer|rfc^rfc5537|template^message/news +rfc^rfc2045^rfc2046 +rfc^rfc2045^rfc2046 +notes^(OBSOLETE)|rfc^rfc2660|template^message/s-http|uri^https://datatracker.ietf.org/doc/status-change-http-experiments-to-historic +rfc^rfc3261|template^message/sip +rfc^rfc3420|template^message/sipfrag +rfc^rfc3886|template^message/tracking-status +notes^(OBSOLETED by request)|person^Nicholas_Parks_Young|template^message/vnd.si.simp +person^Mick_Conley|template^message/vnd.wfa.wsc +person^Michael_Sweet^_3MF|template^model/3mf|uri^http://www.3mf.io/specification +person^ASTM|template^model/e57 +rfc^rfc4735|template^model/example +person^Khronos^Uli_Klumpp|template^model/gltf+json +person^Khronos^Saurabh_Bhatia|template^model/gltf-binary +person^Curtis_Parks|template^model/iges +rfc^rfc2077 +person^DICOM_Standards_Committee^Luiza_Kowalczyk|template^model/mtl +person^DICOM_Standards_Committee^Luiza_Kowalczyk|template^model/obj +person^Dana_Tripp^ISO-TC_184-SC_4|template^model/step +person^Dana_Tripp^ISO-TC_184-SC_4|template^model/step+xml +person^Dana_Tripp^ISO-TC_184-SC_4|template^model/step+zip +person^Dana_Tripp^ISO-TC_184-SC_4|template^model/step-xml+zip +person^DICOM_Standards_Committee^Lisa_Spellman|template^model/stl +person^James_Riordon|template^model/vnd.collada+xml +person^Jason_Pratt|template^model/vnd.dwf +person^Michael_Powers|template^model/vnd.flatland.3dml +person^Attila_Babits|template^model/vnd.gdl +person^Attila_Babits|template^model/vnd.gs-gdl +person^Yutaka_Ozaki|template^model/vnd.gtw +person^Christopher_Brooks|template^model/vnd.moml+xml +person^Boris_Rabinovitch|template^model/vnd.mts +person^Eric_Lengyel|template^model/vnd.opengex +person^Parasolid|template^model/vnd.parasolid.transmit.binary +person^Parasolid|template^model/vnd.parasolid.transmit.text +person^Daniel_Flassig|template^model/vnd.pytha.pyox +person^Benson_Margulies|template^model/vnd.rosette.annotated-data-model +person^Igor_Afanasyev^SAP_SE|template^model/vnd.sap.vds +person^Sebastian_Grassia|template^model/vnd.usdz+zip +person^Henrik_Andersson|template^model/vnd.valve.source.compiled-map +person^Boris_Rabinovitch|template^model/vnd.vtu +rfc^rfc2077 +- +person^Web3D_X3D|template^model/x3d+fastinfoset +- +person^Web3D^Web3D_X3D|template^model/x3d+xml +person^Web3D^Web3D_X3D|template^model/x3d-vrml +rfc^rfc2045^rfc2046 +person^Patrik_Faltstrom|template^multipart/appledouble +draft^RFC-ietf-httpbis-semantics-19|template^multipart/byteranges +rfc^rfc2045^rfc2046 +rfc^rfc1847|template^multipart/encrypted +rfc^rfc4735|template^multipart/example +rfc^rfc7578|template^multipart/form-data +person^Dave_Crocker|template^multipart/header-set +rfc^rfc2045^rfc2046 +rfc^rfc8255|template^multipart/multilingual +rfc^rfc2045^rfc2046 +rfc^rfc2387|template^multipart/related +rfc^rfc6522|template^multipart/report +rfc^rfc1847|template^multipart/signed +person^Heinz-Peter_Schütz|template^multipart/vnd.bint.med-plus +rfc^rfc3801|template^multipart/voice-message +- +person^Robin_Berjon^W3C|template^multipart/x-mixed-replace +- +- +- +- +- +rfc^rfc6015|template^text/1d-interleaved-parityfec +person^Robin_Berjon^W3C|template^text/cache-manifest +rfc^rfc5545|template^text/calendar +- +person^Bryn_Rhodes^HL7|template^text/cql +person^Bryn_Rhodes^HL7|template^text/cql-expression +person^Bryn_Rhodes^HL7|template^text/cql-identifier +rfc^rfc2318|template^text/css +rfc^rfc4180^rfc7111|template^text/csv +person^David_Underdown^National_Archives_UK|template^text/csv-schema +notes^- DEPRECATED by RFC6350|rfc^rfc2425^rfc6350|template^text/directory +rfc^rfc4027|template^text/dns +notes^(OBSOLETED in favor of application/ecmascript)|rfc^rfc4329|template^text/ecmascript +rfc^rfc6849|template^text/encaprtp +rfc^rfc1896 +rfc^rfc4735|template^text/example +person^Bryn_Rhodes^HL7|template^text/fhirpath +rfc^rfc8627|template^text/flexfec +rfc^rfc6354|template^text/fwdred +person^Sequence_Ontology|template^text/gff3 +rfc^rfc6787|template^text/grammar-ref-list +person^Robin_Berjon^W3C|template^text/html +notes^(OBSOLETED in favor of application/javascript)|rfc^rfc4329|template^text/javascript +person^Peeter_Piegaze|template^text/jcr-cnd +rfc^rfc7763|template^text/markdown +person^Jesse_Alama|template^text/mizar +person^Eric_Prudhommeaux^W3C|template^text/n3 +person^Sean_Leonard +rfc^rfc7826|template^text/parameters +rfc^rfc3009|template^text/parityfec +rfc^rfc2046^rfc3676^rfc5147 +person^Ivan_Herman^W3C|template^text/provenance-notation +person^Benja_Fallenstein|template^text/prs.fallenstein.rst +person^John_Lines|template^text/prs.lines.tag +person^Hans-Dieter_A._Hiep|template^text/prs.prop.logic +rfc^rfc6682|template^text/raptorfec +rfc^rfc4102|template^text/RED +rfc^rfc6522|template^text/rfc822-headers +rfc^rfc2045^rfc2046 +person^Paul_Lindner|template^text/rtf +person^_3GPP|template^text/rtp-enc-aescm128 +rfc^rfc6849|template^text/rtploopback +rfc^rfc4588|template^text/rtx +rfc^rfc1874|template^text/SGML +person^Vladimir_Alexiev^W3C_SHACL_Community_Group|template^text/shaclc +person^Eric_Prudhommeaux^W3C|template^text/shex +person^Linux_Foundation^Rose_Judge|template^text/spdx +person^IEEE-ISTO-PWG-PPP|template^text/strings +rfc^rfc4103|template^text/t140 +person^Paul_Lindner|template^text/tab-separated-values +rfc^rfc4263|template^text/troff +person^Eric_Prudhommeaux^W3C|template^text/turtle +rfc^rfc5109|template^text/ulpfec +rfc^rfc2483|template^text/uri-list +rfc^rfc6350|template^text/vcard +person^Regis_Dehoux|template^text/vnd.a +person^Steve_Allen|template^text/vnd.abc +person^Kim_Scarborough|template^text/vnd.ascii-art +person^Robert_Byrnes|template^text/vnd.curl +- +- +- +person^Charles_Plessy|template^text/vnd.debian.copyright +person^Dan_Bradley|template^text/vnd.DMClientScript +person^Michael_Lagally^Peter_Siebert|template^text/vnd.dvb.subtitle +person^Stefan_Eilemann|template^text/vnd.esmertec.theme-descriptor +person^Gordon_Clarke|template^text/vnd.familysearch.gedcom +person^Steve_Gilberd|template^text/vnd.ficlab.flt +- +person^John-Mark_Gurney|template^text/vnd.fly +person^Kari_E._Hurtta|template^text/vnd.fmi.flexstor +person^Mi_Tar|template^text/vnd.gml +person^John_Ellson|template^text/vnd.graphviz +person^Hill_Hanxv|template^text/vnd.hans +person^Heungsub_Lee|template^text/vnd.hgl +person^Michael_Powers|template^text/vnd.in3d.3dml +person^Michael_Powers|template^text/vnd.in3d.spot +person^IPTC|template^text/vnd.IPTC.NewsML +person^IPTC|template^text/vnd.IPTC.NITF +person^Mikusiak_Lubos|template^text/vnd.latex-z +person^Mark_Patton|template^text/vnd.motorola.reflex +person^Jan_Nelson|template^text/vnd.ms-mediapackage +person^Feiyu_Xie|template^text/vnd.net2phone.commcenter.command +rfc^rfc5707|template^text/vnd.radisys.msml-basic-layout +person^Pierre_Papin|template^text/vnd.senx.warpscript +notes^(OBSOLETED by request)|person^Nicholas_Parks_Young|template^text/vnd.si.uricatalogue +person^Petter_Reinholdtsen|template^text/vnd.sosi +person^Gary_Adams|template^text/vnd.sun.j2me.app-descriptor +person^David_Lee_Lambert|template^text/vnd.trolltech.linguist +person^WAP-Forum|template^text/vnd.wap.si +person^WAP-Forum|template^text/vnd.wap.sl +person^Peter_Stark|template^text/vnd.wap.wml +person^Peter_Stark|template^text/vnd.wap.wmlscript +person^Silvia_Pfeiffer^W3C|template^text/vtt +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +rfc^rfc7303|template^text/xml +rfc^rfc7303|template^text/xml-external-parsed-entity +rfc^rfc6015|template^video/1d-interleaved-parityfec +rfc^rfc3839^rfc6381|template^video/3gpp +rfc^rfc4396|template^video/3gpp-tt +rfc^rfc4393^rfc6381|template^video/3gpp2 +person^Alliance_for_Open_Media|template^video/AV1 +rfc^rfc3555|template^video/BMPEG +rfc^rfc3555|template^video/BT656 +rfc^rfc3555|template^video/CelB +- +rfc^rfc6469|template^video/DV +rfc^rfc6849|template^video/encaprtp +rfc^rfc4735|template^video/example +rfc^rfc9043|template^video/FFV1 +rfc^rfc8627|template^video/flexfec +- +rfc^rfc4587|template^video/H261 +rfc^rfc3555|template^video/H263 +rfc^rfc4629|template^video/H263-1998 +rfc^rfc4629|template^video/H263-2000 +rfc^rfc6184|template^video/H264 +rfc^rfc6185|template^video/H264-RCDO +rfc^rfc6190|template^video/H264-SVC +rfc^rfc7798|template^video/H265 +person^David_Singer^ISO-IEC_JTC1|template^video/iso.segment +rfc^rfc3555|template^video/JPEG +rfc^rfc5371^rfc5372|template^video/jpeg2000 +- +rfc^rfc9134|template^video/jxsv +rfc^rfc3745|template^video/mj2 +rfc^rfc3555|template^video/MP1S +rfc^rfc3555|template^video/MP2P +rfc^rfc3555|template^video/MP2T +rfc^rfc4337^rfc6381|template^video/mp4 +rfc^rfc6416|template^video/MP4V-ES +rfc^rfc2045^rfc2046 +rfc^rfc3640|template^video/mpeg4-generic +rfc^rfc3555|template^video/MPV +rfc^rfc4856|template^video/nv +rfc^rfc5334^rfc7845|template^video/ogg +rfc^rfc3009|template^video/parityfec +rfc^rfc2862|template^video/pointer +person^Paul_Lindner|rfc^rfc6381|template^video/quicktime +rfc^rfc6682|template^video/raptorfec +rfc^rfc4175|template^video/raw +person^_3GPP|template^video/rtp-enc-aescm128 +rfc^rfc6849|template^video/rtploopback +rfc^rfc4588|template^video/rtx +person^Daniel_Hanson^Michael_Faller^SCIP|template^video/scip +rfc^rfc8331|template^video/smpte291 +rfc^rfc3497|template^video/SMPTE292M +rfc^rfc5109|template^video/ulpfec +rfc^rfc4425|template^video/vc1 +rfc^rfc8450|template^video/vc2 +person^Frank_Rottmann|template^video/vnd.CCTV +person^Michael_A_Dolan|template^video/vnd.dece.hd +person^Michael_A_Dolan|template^video/vnd.dece.mobile +person^Michael_A_Dolan|template^video/vnd.dece.mp4 +person^Michael_A_Dolan|template^video/vnd.dece.pd +person^Michael_A_Dolan|template^video/vnd.dece.sd +person^Michael_A_Dolan|template^video/vnd.dece.video +person^Nathan_Zerbe|template^video/vnd.directv.mpeg +person^Nathan_Zerbe|template^video/vnd.directv.mpeg-tts +person^Edwin_Heredia|template^video/vnd.dlna.mpeg-tts +person^Kevin_Murray^Peter_Siebert|template^video/vnd.dvb.file +person^Arild_Fuldseth|template^video/vnd.fvt +person^Swaminathan|template^video/vnd.hns.video +person^Shuji_Nakamura|template^video/vnd.iptvforum.1dparityfec-1010 +person^Shuji_Nakamura|template^video/vnd.iptvforum.1dparityfec-2005 +person^Shuji_Nakamura|template^video/vnd.iptvforum.2dparityfec-1010 +person^Shuji_Nakamura|template^video/vnd.iptvforum.2dparityfec-2005 +person^Shuji_Nakamura|template^video/vnd.iptvforum.ttsavc +person^Shuji_Nakamura|template^video/vnd.iptvforum.ttsmpeg2 +person^Tom_McGinty|template^video/vnd.motorola.video +person^Tom_McGinty|template^video/vnd.motorola.videop +person^Heiko_Recktenwald|template^video/vnd.mpegurl +person^Steve_DiAcetis|template^video/vnd.ms-playready.media.pyv +person^Petteri_Kangaslampi|template^video/vnd.nokia.interleaved-multimedia +person^Miska_M._Hannuksela|template^video/vnd.nokia.mp4vr +person^Nokia|template^video/vnd.nokia.videovoip +person^John_Clark|template^video/vnd.objectvideo +person^Henrik_Andersson|template^video/vnd.radgamettools.bink +person^Henrik_Andersson|template^video/vnd.radgamettools.smacker +person^David_Petersen|template^video/vnd.sealed.mpeg1 +person^David_Petersen|template^video/vnd.sealed.mpeg4 +person^David_Petersen|template^video/vnd.sealed.swf +person^David_Petersen|template^video/vnd.sealedmedia.softseal.mov +person^Michael_A_Dolan|template^video/vnd.uvvu.mp4 +person^John_Wolfe|template^video/vnd.vivo +person^Google|template^video/vnd.youtube.yt +rfc^rfc7741|template^video/VP8 +draft^RFC-ietf-payload-vp9-16|template^video/VP9 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime-types-data.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime-types-data.rb new file mode 100644 index 0000000..c6c0db6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime-types-data.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "mime/types/data" diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime/types/data.rb b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime/types/data.rb new file mode 100644 index 0000000..e136c45 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/lib/mime/types/data.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module MIME + class Types + module Data + VERSION = "3.2022.0105" + + # The path that will be used for loading the MIME::Types data. The + # default location is __FILE__/../../../../data, which is where the data + # lives in the gem installation of the mime-types-data library. + # + # The MIME::Types::Loader will load all JSON or columnar files contained + # in this path. + # + # System maintainer note: this is the constant to change when packaging + # mime-types for your system. It is recommended that the path be + # something like /usr/share/ruby/mime-types/. + PATH = File.expand_path("../../../../data", __FILE__) + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/application.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/application.yaml new file mode 100644 index 0000000..cfd70e5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/application.yaml @@ -0,0 +1,17299 @@ +--- +- !ruby/object:MIME::Type + content-type: application/1d-interleaved-parityfec + encoding: base64 + xrefs: + rfc: + - rfc6015 + template: + - application/1d-interleaved-parityfec + registered: true +- !ruby/object:MIME::Type + content-type: application/3gpdash-qoe-report+xml + encoding: base64 + xrefs: + person: + - Ozgur_Oyman + - _3GPP + template: + - application/3gpdash-qoe-report+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/3gpp-ims+xml + encoding: base64 + xrefs: + person: + - John_M_Meredith + - _3GPP + template: + - application/3gpp-ims+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/3gppHal+json + encoding: base64 + xrefs: + person: + - Ulrich_Wiehe + - _3GPP + template: + - application/3gppHal+json + registered: true +- !ruby/object:MIME::Type + content-type: application/3gppHalForms+json + encoding: base64 + xrefs: + person: + - Ulrich_Wiehe + - _3GPP + template: + - application/3gppHalForms+json + registered: true +- !ruby/object:MIME::Type + content-type: application/A2L + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/A2L + registered: true +- !ruby/object:MIME::Type + content-type: application/acad + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/access + encoding: base64 + extensions: + - mdf + - mda + - mdb + - mde + obsolete: true + use-instead: application/x-msaccess + registered: false +- !ruby/object:MIME::Type + content-type: application/ace+cbor + encoding: base64 + xrefs: + draft: + - RFC-ietf-ace-oauth-authz-46 + template: + - application/ace+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/activemessage + encoding: base64 + xrefs: + person: + - Ehud_Shapiro + template: + - application/activemessage + registered: true +- !ruby/object:MIME::Type + content-type: application/activity+json + encoding: base64 + xrefs: + person: + - Benjamin_Goering + - W3C + template: + - application/activity+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-costmap+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-costmap+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-costmapfilter+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-costmapfilter+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-directory+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-directory+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-endpointcost+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-endpointcost+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-endpointcostparams+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-endpointcostparams+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-endpointprop+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-endpointprop+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-endpointpropparams+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-endpointpropparams+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-error+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-error+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-networkmap+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-networkmap+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-networkmapfilter+json + encoding: base64 + xrefs: + rfc: + - rfc7285 + template: + - application/alto-networkmapfilter+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-updatestreamcontrol+json + encoding: base64 + xrefs: + rfc: + - rfc8895 + template: + - application/alto-updatestreamcontrol+json + registered: true +- !ruby/object:MIME::Type + content-type: application/alto-updatestreamparams+json + encoding: base64 + xrefs: + rfc: + - rfc8895 + template: + - application/alto-updatestreamparams+json + registered: true +- !ruby/object:MIME::Type + content-type: application/AML + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/AML + registered: true +- !ruby/object:MIME::Type + content-type: application/andrew-inset + friendly: + en: Andrew Toolkit + encoding: base64 + extensions: + - ez + xrefs: + person: + - Nathaniel_Borenstein + template: + - application/andrew-inset + registered: true +- !ruby/object:MIME::Type + content-type: application/appledouble + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/applefile + encoding: base64 + xrefs: + person: + - Patrik_Faltstrom + template: + - application/applefile + registered: true +- !ruby/object:MIME::Type + content-type: application/applixware + friendly: + en: Applixware + encoding: base64 + extensions: + - aw + registered: false +- !ruby/object:MIME::Type + content-type: application/at+jwt + encoding: base64 + xrefs: + rfc: + - rfc9068 + template: + - application/at+jwt + registered: true +- !ruby/object:MIME::Type + content-type: application/ATF + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/ATF + registered: true +- !ruby/object:MIME::Type + content-type: application/ATFX + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/ATFX + registered: true +- !ruby/object:MIME::Type + content-type: application/atom+xml + friendly: + en: Atom Syndication Format + encoding: 8bit + extensions: + - atom + xrefs: + rfc: + - rfc4287 + - rfc5023 + template: + - application/atom+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atomcat+xml + friendly: + en: Atom Publishing Protocol + encoding: 8bit + extensions: + - atomcat + xrefs: + rfc: + - rfc5023 + template: + - application/atomcat+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atomdeleted+xml + encoding: 8bit + xrefs: + rfc: + - rfc6721 + template: + - application/atomdeleted+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atomicmail + encoding: base64 + xrefs: + person: + - Nathaniel_Borenstein + template: + - application/atomicmail + registered: true +- !ruby/object:MIME::Type + content-type: application/atomsvc+xml + friendly: + en: Atom Publishing Protocol Service Document + encoding: 8bit + extensions: + - atomsvc + xrefs: + rfc: + - rfc5023 + template: + - application/atomsvc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atsc-dwd+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/atsc-dwd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atsc-dynamic-event-message + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/atsc-dynamic-event-message + registered: true +- !ruby/object:MIME::Type + content-type: application/atsc-held+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/atsc-held+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/atsc-rdt+json + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/atsc-rdt+json + registered: true +- !ruby/object:MIME::Type + content-type: application/atsc-rsat+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/atsc-rsat+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ATXML + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/ATXML + registered: true +- !ruby/object:MIME::Type + content-type: application/auth-policy+xml + encoding: 8bit + xrefs: + rfc: + - rfc4745 + template: + - application/auth-policy+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/bacnet-xdd+zip + encoding: base64 + xrefs: + person: + - ASHRAE + - Dave_Robin + template: + - application/bacnet-xdd+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/batch-SMTP + encoding: base64 + xrefs: + rfc: + - rfc2442 + template: + - application/batch-SMTP + registered: true +- !ruby/object:MIME::Type + content-type: application/beep+xml + encoding: base64 + xrefs: + rfc: + - rfc3080 + template: + - application/beep+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/bleeper + encoding: base64 + extensions: + - bleep + obsolete: true + use-instead: application/x-bleeper + registered: false +- !ruby/object:MIME::Type + content-type: application/calendar+json + encoding: base64 + xrefs: + rfc: + - rfc7265 + template: + - application/calendar+json + registered: true +- !ruby/object:MIME::Type + content-type: application/calendar+xml + encoding: base64 + xrefs: + rfc: + - rfc6321 + template: + - application/calendar+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/call-completion + encoding: base64 + xrefs: + rfc: + - rfc6910 + template: + - application/call-completion + registered: true +- !ruby/object:MIME::Type + content-type: application/cals-1840 + encoding: base64 + xrefs: + rfc: + - rfc1895 + template: + - application/CALS-1840 + registered: true +- !ruby/object:MIME::Type + content-type: application/cals1840 + encoding: base64 + obsolete: true + use-instead: application/cals-1840 + registered: false +- !ruby/object:MIME::Type + content-type: application/cap+xml + encoding: base64 + xrefs: + draft: + - RFC-ietf-ecrit-data-only-ea-22 + template: + - application/cap+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/captive+json + encoding: base64 + xrefs: + rfc: + - rfc8908 + template: + - application/captive+json + registered: true +- !ruby/object:MIME::Type + content-type: application/cbor + encoding: base64 + xrefs: + rfc: + - rfc8949 + template: + - application/cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/cbor-seq + encoding: base64 + xrefs: + rfc: + - rfc8742 + template: + - application/cbor-seq + registered: true +- !ruby/object:MIME::Type + content-type: application/cccex + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/cccex + registered: true +- !ruby/object:MIME::Type + content-type: application/ccmp+xml + encoding: base64 + xrefs: + rfc: + - rfc6503 + template: + - application/ccmp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ccxml+xml + friendly: + en: Voice Browser Call Control + encoding: base64 + extensions: + - ccxml + xrefs: + rfc: + - rfc4267 + template: + - application/ccxml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/CDFX+XML + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/CDFX+XML + registered: true +- !ruby/object:MIME::Type + content-type: application/cdmi-capability + friendly: + en: Cloud Data Management Interface (CDMI) - Capability + encoding: base64 + extensions: + - cdmia + xrefs: + rfc: + - rfc6208 + template: + - application/cdmi-capability + registered: true +- !ruby/object:MIME::Type + content-type: application/cdmi-container + friendly: + en: Cloud Data Management Interface (CDMI) - Contaimer + encoding: base64 + extensions: + - cdmic + xrefs: + rfc: + - rfc6208 + template: + - application/cdmi-container + registered: true +- !ruby/object:MIME::Type + content-type: application/cdmi-domain + friendly: + en: Cloud Data Management Interface (CDMI) - Domain + encoding: base64 + extensions: + - cdmid + xrefs: + rfc: + - rfc6208 + template: + - application/cdmi-domain + registered: true +- !ruby/object:MIME::Type + content-type: application/cdmi-object + friendly: + en: Cloud Data Management Interface (CDMI) - Object + encoding: base64 + extensions: + - cdmio + xrefs: + rfc: + - rfc6208 + template: + - application/cdmi-object + registered: true +- !ruby/object:MIME::Type + content-type: application/cdmi-queue + friendly: + en: Cloud Data Management Interface (CDMI) - Queue + encoding: base64 + extensions: + - cdmiq + xrefs: + rfc: + - rfc6208 + template: + - application/cdmi-queue + registered: true +- !ruby/object:MIME::Type + content-type: application/cdni + encoding: base64 + xrefs: + rfc: + - rfc7736 + template: + - application/cdni + registered: true +- !ruby/object:MIME::Type + content-type: application/CEA + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/CEA + registered: true +- !ruby/object:MIME::Type + content-type: application/cea-2018+xml + encoding: base64 + xrefs: + person: + - Gottfried_Zimmermann + template: + - application/cea-2018+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/cellml+xml + encoding: base64 + xrefs: + rfc: + - rfc4708 + template: + - application/cellml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/cfw + encoding: base64 + xrefs: + rfc: + - rfc6230 + template: + - application/cfw + registered: true +- !ruby/object:MIME::Type + content-type: application/clariscad + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/clr + encoding: base64 + xrefs: + person: + - Andy_Miller + - IMS_Global + template: + - application/clr + registered: true +- !ruby/object:MIME::Type + content-type: application/clue+xml + encoding: base64 + xrefs: + rfc: + - rfc8847 + template: + - application/clue+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/clue_info+xml + encoding: base64 + xrefs: + rfc: + - rfc8846 + template: + - application/clue_info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/cms + encoding: base64 + xrefs: + rfc: + - rfc7193 + template: + - application/cms + registered: true +- !ruby/object:MIME::Type + content-type: application/cnrp+xml + encoding: base64 + xrefs: + rfc: + - rfc3367 + template: + - application/cnrp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/coap-group+json + encoding: base64 + xrefs: + rfc: + - rfc7390 + template: + - application/coap-group+json + registered: true +- !ruby/object:MIME::Type + content-type: application/coap-payload + encoding: base64 + xrefs: + rfc: + - rfc8075 + template: + - application/coap-payload + registered: true +- !ruby/object:MIME::Type + content-type: application/commonground + encoding: base64 + xrefs: + person: + - David_Glazer + template: + - application/commonground + registered: true +- !ruby/object:MIME::Type + content-type: application/conference-info+xml + encoding: base64 + xrefs: + rfc: + - rfc4575 + template: + - application/conference-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/cose + encoding: base64 + xrefs: + draft: + - RFC-ietf-cose-rfc8152bis-struct-15 + template: + - application/cose + registered: true +- !ruby/object:MIME::Type + content-type: application/cose-key + encoding: base64 + xrefs: + draft: + - RFC-ietf-cose-rfc8152bis-struct-15 + template: + - application/cose-key + registered: true +- !ruby/object:MIME::Type + content-type: application/cose-key-set + encoding: base64 + xrefs: + draft: + - RFC-ietf-cose-rfc8152bis-struct-15 + template: + - application/cose-key-set + registered: true +- !ruby/object:MIME::Type + content-type: application/cpl+xml + encoding: base64 + xrefs: + rfc: + - rfc3880 + template: + - application/cpl+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/csrattrs + encoding: base64 + xrefs: + rfc: + - rfc7030 + template: + - application/csrattrs + registered: true +- !ruby/object:MIME::Type + content-type: application/csta+xml + encoding: base64 + xrefs: + person: + - Ecma_International_Helpdesk + template: + - application/csta+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/CSTAdata+xml + encoding: base64 + xrefs: + person: + - Ecma_International_Helpdesk + template: + - application/CSTAdata+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/csvm+json + encoding: base64 + xrefs: + person: + - Ivan_Herman + - W3C + template: + - application/csvm+json + registered: true +- !ruby/object:MIME::Type + content-type: application/cu-seeme + friendly: + en: CU-SeeMe + encoding: base64 + extensions: + - cu + registered: false +- !ruby/object:MIME::Type + content-type: application/cwt + encoding: base64 + xrefs: + rfc: + - rfc8392 + template: + - application/cwt + registered: true +- !ruby/object:MIME::Type + content-type: application/cybercash + encoding: base64 + xrefs: + person: + - Donald_E._Eastlake_3rd + template: + - application/cybercash + registered: true +- !ruby/object:MIME::Type + content-type: application/dash+xml + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - Thomas_Stockhammer + template: + - application/dash+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dash-patch+xml + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + template: + - application/dash-patch+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dashdelta + encoding: base64 + xrefs: + person: + - David_Furbeck + template: + - application/dashdelta + registered: true +- !ruby/object:MIME::Type + content-type: application/davmount+xml + friendly: + en: Web Distributed Authoring and Versioning + encoding: base64 + extensions: + - davmount + xrefs: + rfc: + - rfc4709 + template: + - application/davmount+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dca-rft + encoding: base64 + xrefs: + person: + - Larry_Campbell + template: + - application/dca-rft + registered: true +- !ruby/object:MIME::Type + content-type: application/DCD + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/DCD + registered: true +- !ruby/object:MIME::Type + content-type: application/dec-dx + encoding: base64 + xrefs: + person: + - Larry_Campbell + template: + - application/dec-dx + registered: true +- !ruby/object:MIME::Type + content-type: application/dialog-info+xml + encoding: base64 + xrefs: + rfc: + - rfc4235 + template: + - application/dialog-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dicom + encoding: base64 + extensions: + - dcm + xrefs: + rfc: + - rfc3240 + template: + - application/dicom + registered: true +- !ruby/object:MIME::Type + content-type: application/dicom+json + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - David_Clunie + template: + - application/dicom+json + registered: true +- !ruby/object:MIME::Type + content-type: application/dicom+xml + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - David_Clunie + template: + - application/dicom+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/DII + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/DII + registered: true +- !ruby/object:MIME::Type + content-type: application/DIT + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/DIT + registered: true +- !ruby/object:MIME::Type + content-type: application/dns + encoding: base64 + xrefs: + rfc: + - rfc4027 + template: + - application/dns + registered: true +- !ruby/object:MIME::Type + content-type: application/dns+json + encoding: base64 + xrefs: + rfc: + - rfc8427 + template: + - application/dns+json + registered: true +- !ruby/object:MIME::Type + content-type: application/dns-message + encoding: base64 + xrefs: + rfc: + - rfc8484 + template: + - application/dns-message + registered: true +- !ruby/object:MIME::Type + content-type: application/docbook+xml + encoding: base64 + extensions: + - dbk + registered: false +- !ruby/object:MIME::Type + content-type: application/dots+cbor + encoding: base64 + xrefs: + rfc: + - rfc9132 + template: + - application/dots+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/drafting + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/dskpp+xml + encoding: base64 + xrefs: + rfc: + - rfc6063 + template: + - application/dskpp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dssc+der + friendly: + en: Data Structure for the Security Suitability of Cryptographic Algorithms + encoding: base64 + extensions: + - dssc + xrefs: + rfc: + - rfc5698 + template: + - application/dssc+der + registered: true +- !ruby/object:MIME::Type + content-type: application/dssc+xml + friendly: + en: Data Structure for the Security Suitability of Cryptographic Algorithms + encoding: base64 + extensions: + - xdssc + xrefs: + rfc: + - rfc5698 + template: + - application/dssc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/dvcs + encoding: base64 + xrefs: + rfc: + - rfc3029 + template: + - application/dvcs + registered: true +- !ruby/object:MIME::Type + content-type: application/dxf + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/ecmascript + friendly: + en: ECMAScript + encoding: base64 + extensions: + - ecma + - es + xrefs: + rfc: + - rfc4329 + template: + - application/ecmascript + registered: true +- !ruby/object:MIME::Type + content-type: application/EDI-consent + encoding: base64 + xrefs: + rfc: + - rfc1767 + template: + - application/EDI-consent + registered: true +- !ruby/object:MIME::Type + content-type: application/EDI-X12 + encoding: base64 + xrefs: + rfc: + - rfc1767 + template: + - application/EDI-X12 + registered: true +- !ruby/object:MIME::Type + content-type: application/EDIFACT + encoding: base64 + xrefs: + rfc: + - rfc1767 + template: + - application/EDIFACT + registered: true +- !ruby/object:MIME::Type + content-type: application/efi + encoding: base64 + xrefs: + person: + - Samer_El-Haj-Mahmoud + - UEFI_Forum + template: + - application/efi + registered: true +- !ruby/object:MIME::Type + content-type: application/elm+json + encoding: base64 + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - application/elm+json + registered: true +- !ruby/object:MIME::Type + content-type: application/elm+xml + encoding: base64 + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - application/elm+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.cap+xml + encoding: base64 + xrefs: + rfc: + - rfc8876 + template: + - application/EmergencyCallData.cap+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.Comment+xml + encoding: base64 + xrefs: + rfc: + - rfc7852 + template: + - application/EmergencyCallData.Comment+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.Control+xml + encoding: base64 + xrefs: + rfc: + - rfc8147 + template: + - application/EmergencyCallData.Control+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.DeviceInfo+xml + encoding: base64 + xrefs: + rfc: + - rfc7852 + template: + - application/EmergencyCallData.DeviceInfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.eCall.MSD + encoding: base64 + xrefs: + rfc: + - rfc8147 + template: + - application/EmergencyCallData.eCall.MSD + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.ProviderInfo+xml + encoding: base64 + xrefs: + rfc: + - rfc7852 + template: + - application/EmergencyCallData.ProviderInfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.ServiceInfo+xml + encoding: base64 + xrefs: + rfc: + - rfc7852 + template: + - application/EmergencyCallData.ServiceInfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.SubscriberInfo+xml + encoding: base64 + xrefs: + rfc: + - rfc7852 + template: + - application/EmergencyCallData.SubscriberInfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/EmergencyCallData.VEDS+xml + encoding: base64 + xrefs: + rfc: + - rfc8148 + template: + - application/EmergencyCallData.VEDS+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/emma+xml + friendly: + en: Extensible MultiModal Annotation + encoding: base64 + extensions: + - emma + xrefs: + person: + - ISO-IEC_JTC1 + - W3C + uri: + - http://www.w3.org/TR/2007/CR-emma-20071211/#media-type-registration + template: + - application/emma+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/emotionml+xml + encoding: base64 + xrefs: + person: + - Kazuyuki_Ashimura + - W3C + template: + - application/emotionml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/encaprtp + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - application/encaprtp + registered: true +- !ruby/object:MIME::Type + content-type: application/epp+xml + encoding: base64 + xrefs: + rfc: + - rfc5730 + template: + - application/epp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/epub+zip + friendly: + en: Electronic Publication + encoding: base64 + extensions: + - epub + xrefs: + person: + - International_Digital_Publishing_Forum + - William_McCoy + template: + - application/epub+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/eshop + encoding: base64 + xrefs: + person: + - Steve_Katz + template: + - application/eshop + registered: true +- !ruby/object:MIME::Type + content-type: application/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - application/example + registered: true +- !ruby/object:MIME::Type + content-type: application/excel + encoding: base64 + extensions: + - xls + - xlt + obsolete: true + use-instead: application/vnd.ms-excel + registered: false +- !ruby/object:MIME::Type + content-type: application/exi + friendly: + en: Efficient XML Interchange + encoding: base64 + extensions: + - exi + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/2009/CR-exi-20091208/#mediaTypeRegistration + template: + - application/exi + registered: true +- !ruby/object:MIME::Type + content-type: application/expect-ct-report+json + encoding: base64 + xrefs: + draft: + - RFC-ietf-httpbis-expect-ct-08 + template: + - application/expect-ct-report+json + registered: true +- !ruby/object:MIME::Type + content-type: application/express + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - application/express + registered: true +- !ruby/object:MIME::Type + content-type: application/fastinfoset + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1_SC6_ASN.1_Rapporteur + - ITU-T_ASN.1_Rapporteur + template: + - application/fastinfoset + registered: true +- !ruby/object:MIME::Type + content-type: application/fastsoap + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1_SC6_ASN.1_Rapporteur + - ITU-T_ASN.1_Rapporteur + template: + - application/fastsoap + registered: true +- !ruby/object:MIME::Type + content-type: application/fdt+xml + encoding: base64 + xrefs: + rfc: + - rfc6726 + template: + - application/fdt+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/fhir+json + encoding: base64 + xrefs: + person: + - Grahame_Grieve + - HL7 + template: + - application/fhir+json + registered: true +- !ruby/object:MIME::Type + content-type: application/fhir+xml + encoding: base64 + xrefs: + person: + - Grahame_Grieve + - HL7 + template: + - application/fhir+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/fits + encoding: base64 + xrefs: + rfc: + - rfc4047 + template: + - application/fits + registered: true +- !ruby/object:MIME::Type + content-type: application/flexfec + encoding: base64 + xrefs: + rfc: + - rfc8627 + template: + - application/flexfec + registered: true +- !ruby/object:MIME::Type + content-type: application/font-sfnt + encoding: base64 + extensions: + - otf + - ttf + obsolete: true + use-instead: font/sfnt + xrefs: + person: + - ISO-IEC_JTC1 + - Levantovsky + rfc: + - rfc8081 + template: + - application/font-sfnt + notes: + - "- DEPRECATED in favor of font/sfnt" + registered: true +- !ruby/object:MIME::Type + content-type: application/font-tdpfr + friendly: + en: Portable Font Resource + encoding: base64 + extensions: + - pfr + xrefs: + rfc: + - rfc3073 + template: + - application/font-tdpfr + registered: true +- !ruby/object:MIME::Type + content-type: application/font-woff + friendly: + en: Web Open Font Format + encoding: base64 + extensions: + - woff + - woff2 + obsolete: true + use-instead: font/woff + xrefs: + person: + - W3C + rfc: + - rfc8081 + template: + - application/font-woff + notes: + - "- DEPRECATED in favor of font/woff" + registered: true +- !ruby/object:MIME::Type + content-type: application/fractals + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/framework-attributes+xml + encoding: base64 + xrefs: + rfc: + - rfc6230 + template: + - application/framework-attributes+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/futuresplash + encoding: base64 + extensions: + - spl + obsolete: true + use-instead: application/x-futuresplash + registered: false +- !ruby/object:MIME::Type + content-type: application/geo+json + encoding: base64 + xrefs: + rfc: + - rfc7946 + template: + - application/geo+json + registered: true +- !ruby/object:MIME::Type + content-type: application/geo+json-seq + encoding: base64 + xrefs: + rfc: + - rfc8142 + template: + - application/geo+json-seq + registered: true +- !ruby/object:MIME::Type + content-type: application/geopackage+sqlite3 + encoding: base64 + xrefs: + person: + - OGC + - Scott_Simmons + template: + - application/geopackage+sqlite3 + registered: true +- !ruby/object:MIME::Type + content-type: application/geoxacml+xml + encoding: base64 + xrefs: + person: + - OGC + - Scott_Simmons + template: + - application/geoxacml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ghostview + encoding: base64 + obsolete: true + use-instead: application/x-ghostview + registered: false +- !ruby/object:MIME::Type + content-type: application/gltf-buffer + encoding: base64 + xrefs: + person: + - Khronos + - Saurabh_Bhatia + template: + - application/gltf-buffer + registered: true +- !ruby/object:MIME::Type + content-type: application/gml+xml + encoding: base64 + extensions: + - gml + xrefs: + person: + - Clemens_Portele + - OGC + template: + - application/gml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/gpx+xml + encoding: base64 + extensions: + - gpx + registered: false +- !ruby/object:MIME::Type + content-type: application/gxf + encoding: base64 + extensions: + - gxf + registered: false +- !ruby/object:MIME::Type + content-type: application/gzip + encoding: base64 + extensions: + - gz + xrefs: + rfc: + - rfc6713 + template: + - application/gzip + registered: true +- !ruby/object:MIME::Type + content-type: application/H224 + encoding: base64 + xrefs: + rfc: + - rfc4573 + template: + - application/H224 + registered: true +- !ruby/object:MIME::Type + content-type: application/held+xml + encoding: base64 + xrefs: + rfc: + - rfc5985 + template: + - application/held+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/hep + encoding: base64 + extensions: + - hep + obsolete: true + use-instead: application/x-hep + registered: false +- !ruby/object:MIME::Type + content-type: application/http + encoding: base64 + xrefs: + draft: + - RFC-ietf-httpbis-messaging-19 + template: + - application/http + registered: true +- !ruby/object:MIME::Type + content-type: application/hyperstudio + friendly: + en: Hyperstudio + encoding: base64 + extensions: + - stk + xrefs: + person: + - Michael_Domino + template: + - application/hyperstudio + registered: true +- !ruby/object:MIME::Type + content-type: application/i-deas + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/ibe-key-request+xml + encoding: base64 + xrefs: + rfc: + - rfc5408 + template: + - application/ibe-key-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ibe-pkg-reply+xml + encoding: base64 + xrefs: + rfc: + - rfc5408 + template: + - application/ibe-pkg-reply+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ibe-pp-data + encoding: base64 + xrefs: + rfc: + - rfc5408 + template: + - application/ibe-pp-data + registered: true +- !ruby/object:MIME::Type + content-type: application/iges + encoding: base64 + xrefs: + person: + - Curtis_Parks + template: + - application/iges + registered: true +- !ruby/object:MIME::Type + content-type: application/im-iscomposing+xml + encoding: base64 + xrefs: + rfc: + - rfc3994 + template: + - application/im-iscomposing+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/imagemap + encoding: 8bit + extensions: + - imagemap + - imap + obsolete: true + use-instead: application/x-imagemap + registered: false +- !ruby/object:MIME::Type + content-type: application/index + encoding: base64 + xrefs: + rfc: + - rfc2652 + template: + - application/index + registered: true +- !ruby/object:MIME::Type + content-type: application/index.cmd + encoding: base64 + xrefs: + rfc: + - rfc2652 + template: + - application/index.cmd + registered: true +- !ruby/object:MIME::Type + content-type: application/index.obj + encoding: base64 + xrefs: + rfc: + - rfc2652 + template: + - application/index.obj + registered: true +- !ruby/object:MIME::Type + content-type: application/index.response + encoding: base64 + xrefs: + rfc: + - rfc2652 + template: + - application/index.response + registered: true +- !ruby/object:MIME::Type + content-type: application/index.vnd + encoding: base64 + xrefs: + rfc: + - rfc2652 + template: + - application/index.vnd + registered: true +- !ruby/object:MIME::Type + content-type: application/inkml+xml + encoding: base64 + extensions: + - ink + - inkml + xrefs: + person: + - Kazuyuki_Ashimura + template: + - application/inkml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/iotp + encoding: base64 + xrefs: + rfc: + - rfc2935 + template: + - application/IOTP + registered: true +- !ruby/object:MIME::Type + content-type: application/ipfix + friendly: + en: Internet Protocol Flow Information Export + encoding: base64 + extensions: + - ipfix + xrefs: + rfc: + - rfc5655 + template: + - application/ipfix + registered: true +- !ruby/object:MIME::Type + content-type: application/ipp + encoding: base64 + xrefs: + rfc: + - rfc8010 + template: + - application/ipp + registered: true +- !ruby/object:MIME::Type + content-type: application/isup + encoding: base64 + xrefs: + rfc: + - rfc3204 + template: + - application/ISUP + registered: true +- !ruby/object:MIME::Type + content-type: application/its+xml + encoding: base64 + xrefs: + person: + - ITS-IG-W3C + - W3C + template: + - application/its+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/java-archive + friendly: + en: Java Archive + encoding: base64 + extensions: + - jar + registered: false +- !ruby/object:MIME::Type + content-type: application/java-serialized-object + friendly: + en: Java Serialized Object + encoding: base64 + extensions: + - ser + registered: false +- !ruby/object:MIME::Type + content-type: application/java-vm + friendly: + en: Java Bytecode File + encoding: base64 + extensions: + - class + registered: false +- !ruby/object:MIME::Type + content-type: application/javascript + friendly: + en: JavaScript + encoding: 8bit + extensions: + - js + - mjs + - sj + xrefs: + rfc: + - rfc4329 + template: + - application/javascript + registered: true +- !ruby/object:MIME::Type + content-type: application/jf2feed+json + encoding: base64 + xrefs: + person: + - Ivan_Herman + - W3C + template: + - application/jf2feed+json + registered: true +- !ruby/object:MIME::Type + content-type: application/jose + encoding: base64 + xrefs: + rfc: + - rfc7515 + template: + - application/jose + registered: true +- !ruby/object:MIME::Type + content-type: application/jose+json + encoding: base64 + xrefs: + rfc: + - rfc7515 + template: + - application/jose+json + registered: true +- !ruby/object:MIME::Type + content-type: application/jrd+json + encoding: base64 + xrefs: + rfc: + - rfc7033 + template: + - application/jrd+json + registered: true +- !ruby/object:MIME::Type + content-type: application/jscalendar+json + encoding: base64 + xrefs: + rfc: + - rfc8984 + template: + - application/jscalendar+json + registered: true +- !ruby/object:MIME::Type + content-type: application/json + friendly: + en: JavaScript Object Notation (JSON) + encoding: 8bit + extensions: + - json + xrefs: + rfc: + - rfc8259 + template: + - application/json + registered: true +- !ruby/object:MIME::Type + content-type: application/json-patch+json + encoding: base64 + xrefs: + rfc: + - rfc6902 + template: + - application/json-patch+json + registered: true +- !ruby/object:MIME::Type + content-type: application/json-seq + encoding: base64 + xrefs: + rfc: + - rfc7464 + template: + - application/json-seq + registered: true +- !ruby/object:MIME::Type + content-type: application/jsonml+json + encoding: base64 + extensions: + - jsonml + registered: false +- !ruby/object:MIME::Type + content-type: application/jwk+json + encoding: base64 + xrefs: + rfc: + - rfc7517 + template: + - application/jwk+json + registered: true +- !ruby/object:MIME::Type + content-type: application/jwk-set+json + encoding: base64 + xrefs: + rfc: + - rfc7517 + template: + - application/jwk-set+json + registered: true +- !ruby/object:MIME::Type + content-type: application/jwt + encoding: base64 + xrefs: + rfc: + - rfc7519 + template: + - application/jwt + registered: true +- !ruby/object:MIME::Type + content-type: application/kpml-request+xml + encoding: base64 + xrefs: + rfc: + - rfc4730 + template: + - application/kpml-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/kpml-response+xml + encoding: base64 + xrefs: + rfc: + - rfc4730 + template: + - application/kpml-response+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ld+json + encoding: base64 + xrefs: + person: + - Ivan_Herman + - W3C + template: + - application/ld+json + registered: true +- !ruby/object:MIME::Type + content-type: application/lgr+xml + encoding: base64 + xrefs: + rfc: + - rfc7940 + template: + - application/lgr+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/link-format + encoding: base64 + xrefs: + rfc: + - rfc6690 + template: + - application/link-format + registered: true +- !ruby/object:MIME::Type + content-type: application/load-control+xml + encoding: base64 + xrefs: + rfc: + - rfc7200 + template: + - application/load-control+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/lost+xml + encoding: base64 + extensions: + - lostxml + xrefs: + rfc: + - rfc5222 + template: + - application/lost+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/lostsync+xml + encoding: base64 + xrefs: + rfc: + - rfc6739 + template: + - application/lostsync+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/lotus-123 + encoding: base64 + extensions: + - wks + obsolete: true + use-instead: application/vnd.lotus-1-2-3 + registered: false +- !ruby/object:MIME::Type + content-type: application/lpf+zip + encoding: base64 + xrefs: + person: + - Ivan_Herman + - W3C + template: + - application/lpf+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/LXF + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/LXF + registered: true +- !ruby/object:MIME::Type + content-type: application/mac-binhex40 + friendly: + en: Macintosh BinHex 4.0 + encoding: 8bit + extensions: + - hqx + xrefs: + person: + - Patrik_Faltstrom + template: + - application/mac-binhex40 + registered: true +- !ruby/object:MIME::Type + content-type: application/mac-compactpro + friendly: + en: Compact Pro + encoding: base64 + extensions: + - cpt + obsolete: true + use-instead: application/x-mac-compactpro + registered: false +- !ruby/object:MIME::Type + content-type: application/macbinary + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/macwriteii + encoding: base64 + xrefs: + person: + - Paul_Lindner + template: + - application/macwriteii + registered: true +- !ruby/object:MIME::Type + content-type: application/mads+xml + friendly: + en: Metadata Authority Description Schema + encoding: base64 + extensions: + - mads + xrefs: + rfc: + - rfc6207 + template: + - application/mads+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/manifest+json + encoding: base64 + extensions: + - webmanifest + xrefs: + person: + - Marcos_Caceres + - W3C + template: + - application/manifest+json + registered: true +- !ruby/object:MIME::Type + content-type: application/marc + friendly: + en: MARC Formats + encoding: base64 + extensions: + - mrc + xrefs: + rfc: + - rfc2220 + template: + - application/marc + registered: true +- !ruby/object:MIME::Type + content-type: application/marcxml+xml + friendly: + en: MARC21 XML Schema + encoding: base64 + extensions: + - mrcx + xrefs: + rfc: + - rfc6207 + template: + - application/marcxml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mathcad + encoding: base64 + extensions: + - mcd + obsolete: true + use-instead: application/vnd.mcd + registered: false +- !ruby/object:MIME::Type + content-type: application/mathematica + friendly: + en: Mathematica Notebooks + encoding: base64 + extensions: + - ma + - mb + - nb + xrefs: + person: + - Wolfram + template: + - application/mathematica + registered: true +- !ruby/object:MIME::Type + content-type: application/mathematica-old + encoding: base64 + obsolete: true + use-instead: application/x-mathematica-old + registered: false +- !ruby/object:MIME::Type + content-type: application/mathml+xml + friendly: + en: Mathematical Markup Language + encoding: base64 + extensions: + - mathml + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/MathML3/appendixb.html + template: + - application/mathml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mathml-content+xml + encoding: base64 + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/MathML3/appendixb.html + template: + - application/mathml-content+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mathml-presentation+xml + encoding: base64 + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/MathML3/appendixb.html + template: + - application/mathml-presentation+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-associated-procedure-description+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-associated-procedure-description+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-deregister+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-deregister+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-envelope+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-envelope+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-msk+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-msk+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-msk-response+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-msk-response+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-protection-description+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-protection-description+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-reception-report+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-reception-report+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-register+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-register+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-register-response+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-register-response+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-schedule+xml + encoding: base64 + xrefs: + person: + - Eric_Turcotte + - _3GPP + template: + - application/mbms-schedule+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbms-user-service-description+xml + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/mbms-user-service-description+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mbox + friendly: + en: Mbox database files + encoding: base64 + extensions: + - mbox + xrefs: + rfc: + - rfc4155 + template: + - application/mbox + registered: true +- !ruby/object:MIME::Type + content-type: application/media-policy-dataset+xml + encoding: base64 + xrefs: + rfc: + - rfc6796 + template: + - application/media-policy-dataset+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/media_control+xml + encoding: base64 + xrefs: + rfc: + - rfc5168 + template: + - application/media_control+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mediaservercontrol+xml + friendly: + en: Media Server Control Markup Language + encoding: base64 + extensions: + - mscml + xrefs: + rfc: + - rfc5022 + template: + - application/mediaservercontrol+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/merge-patch+json + encoding: base64 + xrefs: + rfc: + - rfc7396 + template: + - application/merge-patch+json + registered: true +- !ruby/object:MIME::Type + content-type: application/metalink+xml + encoding: base64 + extensions: + - metalink + registered: false +- !ruby/object:MIME::Type + content-type: application/metalink4+xml + friendly: + en: Metalink + encoding: base64 + extensions: + - meta4 + xrefs: + rfc: + - rfc5854 + template: + - application/metalink4+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mets+xml + friendly: + en: Metadata Encoding and Transmission Standard + encoding: base64 + extensions: + - mets + xrefs: + rfc: + - rfc6207 + template: + - application/mets+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/MF4 + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/MF4 + registered: true +- !ruby/object:MIME::Type + content-type: application/mikey + encoding: base64 + xrefs: + rfc: + - rfc3830 + template: + - application/mikey + registered: true +- !ruby/object:MIME::Type + content-type: application/mipc + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/mipc + registered: true +- !ruby/object:MIME::Type + content-type: application/missing-blocks+cbor-seq + encoding: base64 + xrefs: + draft: + - RFC-ietf-core-new-block-14 + template: + - application/missing-blocks+cbor-seq + registered: true +- !ruby/object:MIME::Type + content-type: application/mmt-aei+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/mmt-aei+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mmt-usd+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/mmt-usd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mods+xml + friendly: + en: Metadata Object Description Schema + encoding: base64 + extensions: + - mods + xrefs: + rfc: + - rfc6207 + template: + - application/mods+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/moss-keys + encoding: base64 + xrefs: + rfc: + - rfc1848 + template: + - application/moss-keys + registered: true +- !ruby/object:MIME::Type + content-type: application/moss-signature + encoding: base64 + xrefs: + rfc: + - rfc1848 + template: + - application/moss-signature + registered: true +- !ruby/object:MIME::Type + content-type: application/mosskey-data + encoding: base64 + xrefs: + rfc: + - rfc1848 + template: + - application/mosskey-data + registered: true +- !ruby/object:MIME::Type + content-type: application/mosskey-request + encoding: base64 + xrefs: + rfc: + - rfc1848 + template: + - application/mosskey-request + registered: true +- !ruby/object:MIME::Type + content-type: application/mp21 + friendly: + en: MPEG-21 + encoding: base64 + extensions: + - m21 + - mp21 + xrefs: + rfc: + - rfc6381 + person: + - David_Singer + template: + - application/mp21 + registered: true +- !ruby/object:MIME::Type + content-type: application/mp4 + friendly: + en: MPEG4 + encoding: base64 + extensions: + - mp4 + - mpg4 + - mp4s + xrefs: + rfc: + - rfc4337 + - rfc6381 + template: + - application/mp4 + registered: true +- !ruby/object:MIME::Type + content-type: application/mpeg4-generic + encoding: base64 + xrefs: + rfc: + - rfc3640 + template: + - application/mpeg4-generic + registered: true +- !ruby/object:MIME::Type + content-type: application/mpeg4-iod + encoding: base64 + xrefs: + rfc: + - rfc4337 + template: + - application/mpeg4-iod + registered: true +- !ruby/object:MIME::Type + content-type: application/mpeg4-iod-xmt + encoding: base64 + xrefs: + rfc: + - rfc4337 + template: + - application/mpeg4-iod-xmt + registered: true +- !ruby/object:MIME::Type + content-type: application/mrb-consumer+xml + encoding: base64 + xrefs: + rfc: + - rfc6917 + template: + - application/mrb-consumer+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/mrb-publish+xml + encoding: base64 + xrefs: + rfc: + - rfc6917 + template: + - application/mrb-publish+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/msc-ivr+xml + encoding: base64 + xrefs: + rfc: + - rfc6231 + template: + - application/msc-ivr+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/msc-mixer+xml + encoding: base64 + xrefs: + rfc: + - rfc6505 + template: + - application/msc-mixer+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/msword + friendly: + en: Microsoft Word + encoding: base64 + extensions: + - doc + - dot + - wrd + xrefs: + person: + - Paul_Lindner + template: + - application/msword + registered: true +- !ruby/object:MIME::Type + content-type: application/mud+json + encoding: base64 + xrefs: + rfc: + - rfc8520 + template: + - application/mud+json + registered: true +- !ruby/object:MIME::Type + content-type: application/multipart-core + encoding: base64 + xrefs: + rfc: + - rfc8710 + template: + - application/multipart-core + registered: true +- !ruby/object:MIME::Type + content-type: application/mxf + friendly: + en: Material Exchange Format + encoding: base64 + extensions: + - mxf + xrefs: + rfc: + - rfc4539 + template: + - application/mxf + registered: true +- !ruby/object:MIME::Type + content-type: application/n-quads + encoding: base64 + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - application/n-quads + registered: true +- !ruby/object:MIME::Type + content-type: application/n-triples + encoding: base64 + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - application/n-triples + registered: true +- !ruby/object:MIME::Type + content-type: application/nasdata + encoding: base64 + xrefs: + rfc: + - rfc4707 + template: + - application/nasdata + registered: true +- !ruby/object:MIME::Type + content-type: application/netcdf + encoding: base64 + extensions: + - nc + - cdf + registered: false +- !ruby/object:MIME::Type + content-type: application/news-checkgroups + encoding: base64 + xrefs: + rfc: + - rfc5537 + template: + - application/news-checkgroups + registered: true +- !ruby/object:MIME::Type + content-type: application/news-groupinfo + encoding: base64 + xrefs: + rfc: + - rfc5537 + template: + - application/news-groupinfo + registered: true +- !ruby/object:MIME::Type + content-type: application/news-message-id + encoding: base64 + obsolete: true + registered: false +- !ruby/object:MIME::Type + content-type: application/news-transmission + encoding: base64 + xrefs: + rfc: + - rfc5537 + template: + - application/news-transmission + registered: true +- !ruby/object:MIME::Type + content-type: application/nlsml+xml + encoding: base64 + xrefs: + rfc: + - rfc6787 + template: + - application/nlsml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/node + encoding: base64 + xrefs: + person: + - Node.js_TSC + template: + - application/node + registered: true +- !ruby/object:MIME::Type + content-type: application/nss + encoding: base64 + xrefs: + person: + - Michael_Hammer + template: + - application/nss + registered: true +- !ruby/object:MIME::Type + content-type: application/oauth-authz-req+jwt + encoding: base64 + xrefs: + rfc: + - rfc9101 + template: + - application/oauth-authz-req+jwt + registered: true +- !ruby/object:MIME::Type + content-type: application/ocsp-request + encoding: base64 + xrefs: + rfc: + - rfc6960 + template: + - application/ocsp-request + registered: true +- !ruby/object:MIME::Type + content-type: application/ocsp-response + encoding: base64 + xrefs: + rfc: + - rfc6960 + template: + - application/ocsp-response + registered: true +- !ruby/object:MIME::Type + content-type: application/octet-stream + friendly: + en: Binary Data + encoding: base64 + extensions: + - bin + - dms + - lha + - lzh + - class + - ani + - pgp + - gpg + - so + - dll + - dylib + - bpk + - deploy + - dist + - distz + - dump + - elc + - lrf + - mar + - pkg + - ipa + xrefs: + rfc: + - rfc2045 + - rfc2046 + template: + - application/octet-stream + registered: true +- !ruby/object:MIME::Type + content-type: application/oda + friendly: + en: Office Document Architecture + encoding: base64 + extensions: + - oda + xrefs: + rfc: + - rfc1494 + template: + - application/ODA + registered: true +- !ruby/object:MIME::Type + content-type: application/odm+xml + encoding: base64 + xrefs: + person: + - CDISC + - Sam_Hume + template: + - application/odm+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ODX + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/ODX + registered: true +- !ruby/object:MIME::Type + content-type: application/oebps-package+xml + friendly: + en: Open eBook Publication Structure + encoding: base64 + extensions: + - opf + xrefs: + rfc: + - rfc4839 + template: + - application/oebps-package+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ogg + friendly: + en: Ogg + encoding: base64 + extensions: + - ogx + xrefs: + rfc: + - rfc5334 + - rfc7845 + template: + - application/ogg + registered: true +- !ruby/object:MIME::Type + content-type: application/omdoc+xml + encoding: base64 + extensions: + - omdoc + registered: false +- !ruby/object:MIME::Type + content-type: application/onenote + friendly: + en: Microsoft OneNote + encoding: base64 + extensions: + - onepkg + - onetmp + - onetoc + - onetoc2 + registered: false +- !ruby/object:MIME::Type + content-type: application/opc-nodeset+xml + encoding: base64 + xrefs: + person: + - OPC_Foundation + template: + - application/opc-nodeset+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/oscore + encoding: base64 + xrefs: + rfc: + - rfc8613 + template: + - application/oscore + registered: true +- !ruby/object:MIME::Type + content-type: application/oxps + encoding: base64 + extensions: + - oxps + xrefs: + person: + - Ecma_International_Helpdesk + template: + - application/oxps + registered: true +- !ruby/object:MIME::Type + content-type: application/p21 + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - application/p21 + registered: true +- !ruby/object:MIME::Type + content-type: application/p21+zip + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - application/p21+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/p2p-overlay+xml + encoding: base64 + xrefs: + rfc: + - rfc6940 + template: + - application/p2p-overlay+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/parityfec + encoding: base64 + xrefs: + rfc: + - rfc3009 + template: + - application/parityfec + registered: true +- !ruby/object:MIME::Type + content-type: application/passport + encoding: base64 + xrefs: + rfc: + - rfc8225 + template: + - application/passport + registered: true +- !ruby/object:MIME::Type + content-type: application/patch-ops-error+xml + friendly: + en: XML Patch Framework + encoding: base64 + extensions: + - xer + xrefs: + rfc: + - rfc5261 + template: + - application/patch-ops-error+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/pdf + friendly: + en: Adobe Portable Document Format + encoding: base64 + extensions: + - pdf + - ai + xrefs: + rfc: + - rfc8118 + template: + - application/pdf + registered: true +- !ruby/object:MIME::Type + content-type: application/PDX + encoding: base64 + xrefs: + person: + - ASAM + - Thomas_Thomsen + template: + - application/PDX + registered: true +- !ruby/object:MIME::Type + content-type: application/pem-certificate-chain + encoding: base64 + xrefs: + rfc: + - rfc8555 + template: + - application/pem-certificate-chain + registered: true +- !ruby/object:MIME::Type + content-type: application/pgp-encrypted + friendly: + en: Pretty Good Privacy + encoding: 7bit + extensions: + - pgp + - gpg + xrefs: + rfc: + - rfc3156 + template: + - application/pgp-encrypted + registered: true +- !ruby/object:MIME::Type + content-type: application/pgp-keys + encoding: 7bit + xrefs: + rfc: + - rfc3156 + template: + - application/pgp-keys + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: application/pgp-signature + friendly: + en: Pretty Good Privacy - Signature + encoding: base64 + extensions: + - asc + - sig + xrefs: + rfc: + - rfc3156 + template: + - application/pgp-signature + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: application/pics-rules + friendly: + en: PICSRules + encoding: base64 + extensions: + - prf + registered: false +- !ruby/object:MIME::Type + content-type: application/pidf+xml + encoding: base64 + xrefs: + rfc: + - rfc3863 + template: + - application/pidf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/pidf-diff+xml + encoding: base64 + xrefs: + rfc: + - rfc5262 + template: + - application/pidf-diff+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/pkcs10 + friendly: + en: 'PKCS #10 - Certification Request Standard' + encoding: base64 + extensions: + - p10 + xrefs: + rfc: + - rfc5967 + template: + - application/pkcs10 + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: application/pkcs12 + encoding: base64 + xrefs: + person: + - IETF + template: + - application/pkcs12 + registered: true +- !ruby/object:MIME::Type + content-type: application/pkcs7-mime + friendly: + en: 'PKCS #7 - Cryptographic Message Syntax Standard' + encoding: base64 + extensions: + - p7m + - p7c + xrefs: + rfc: + - rfc7114 + - rfc8551 + template: + - application/pkcs7-mime + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: application/pkcs7-signature + friendly: + en: 'PKCS #7 - Cryptographic Message Syntax Standard' + encoding: base64 + extensions: + - p7s + xrefs: + rfc: + - rfc8551 + template: + - application/pkcs7-signature + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: application/pkcs8 + friendly: + en: 'PKCS #8 - Private-Key Information Syntax Standard' + encoding: base64 + extensions: + - p8 + xrefs: + rfc: + - rfc5958 + template: + - application/pkcs8 + registered: true +- !ruby/object:MIME::Type + content-type: application/pkcs8-encrypted + encoding: base64 + xrefs: + rfc: + - rfc8351 + template: + - application/pkcs8-encrypted + registered: true +- !ruby/object:MIME::Type + content-type: application/pkix-attr-cert + friendly: + en: Attribute Certificate + encoding: base64 + extensions: + - ac + xrefs: + rfc: + - rfc5877 + template: + - application/pkix-attr-cert + registered: true +- !ruby/object:MIME::Type + content-type: application/pkix-cert + friendly: + en: Internet Public Key Infrastructure - Certificate + encoding: base64 + extensions: + - cer + xrefs: + rfc: + - rfc2585 + template: + - application/pkix-cert + registered: true +- !ruby/object:MIME::Type + content-type: application/pkix-crl + friendly: + en: Internet Public Key Infrastructure - Certificate Revocation Lists + encoding: base64 + extensions: + - crl + xrefs: + rfc: + - rfc2585 + template: + - application/pkix-crl + registered: true +- !ruby/object:MIME::Type + content-type: application/pkix-pkipath + friendly: + en: Internet Public Key Infrastructure - Certification Path + encoding: base64 + extensions: + - pkipath + xrefs: + rfc: + - rfc6066 + template: + - application/pkix-pkipath + registered: true +- !ruby/object:MIME::Type + content-type: application/pkixcmp + friendly: + en: Internet Public Key Infrastructure - Certificate Management Protocole + encoding: base64 + extensions: + - pki + xrefs: + rfc: + - rfc2510 + template: + - application/pkixcmp + registered: true +- !ruby/object:MIME::Type + content-type: application/pls+xml + friendly: + en: Pronunciation Lexicon Specification + encoding: base64 + extensions: + - pls + xrefs: + rfc: + - rfc4267 + template: + - application/pls+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/poc-settings+xml + encoding: base64 + xrefs: + rfc: + - rfc4354 + template: + - application/poc-settings+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/postscript + friendly: + en: PostScript + encoding: 8bit + extensions: + - eps + - ps + - ai + xrefs: + rfc: + - rfc2045 + - rfc2046 + template: + - application/postscript + registered: true +- !ruby/object:MIME::Type + content-type: application/powerpoint + encoding: base64 + extensions: + - ppt + - pps + - pot + registered: false +- !ruby/object:MIME::Type + content-type: application/ppsp-tracker+json + encoding: base64 + xrefs: + rfc: + - rfc7846 + template: + - application/ppsp-tracker+json + registered: true +- !ruby/object:MIME::Type + content-type: application/pro_eng + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/problem+json + encoding: base64 + xrefs: + rfc: + - rfc7807 + template: + - application/problem+json + registered: true +- !ruby/object:MIME::Type + content-type: application/problem+xml + encoding: base64 + xrefs: + rfc: + - rfc7807 + template: + - application/problem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/provenance+xml + encoding: base64 + xrefs: + person: + - Ivan_Herman + - W3C + template: + - application/provenance+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.alvestrand.titrax-sheet + encoding: base64 + xrefs: + person: + - Harald_T._Alvestrand + template: + - application/prs.alvestrand.titrax-sheet + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.cww + friendly: + en: CU-Writer + encoding: base64 + extensions: + - cw + - cww + xrefs: + person: + - Khemchart_Rungchavalnont + template: + - application/prs.cww + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.cyn + encoding: base64 + xrefs: + person: + - Cynthia_Revström + template: + - application/prs.cyn + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.hpub+zip + encoding: base64 + xrefs: + person: + - Giulio_Zambon + template: + - application/prs.hpub+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.nprend + encoding: base64 + extensions: + - rnd + - rct + xrefs: + person: + - Jay_Doggett + template: + - application/prs.nprend + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.plucker + encoding: base64 + xrefs: + person: + - Bill_Janssen + template: + - application/prs.plucker + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.rdf-xml-crypt + encoding: base64 + xrefs: + person: + - Toby_Inkster + template: + - application/prs.rdf-xml-crypt + registered: true +- !ruby/object:MIME::Type + content-type: application/prs.xsf+xml + encoding: base64 + xrefs: + person: + - Maik_Stührenberg + template: + - application/prs.xsf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/pskc+xml + friendly: + en: Portable Symmetric Key Container + encoding: base64 + extensions: + - pskcxml + xrefs: + rfc: + - rfc6030 + template: + - application/pskc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/pvd+json + encoding: base64 + xrefs: + rfc: + - rfc8801 + template: + - application/pvd+json + registered: true +- !ruby/object:MIME::Type + content-type: application/qsig + encoding: base64 + xrefs: + rfc: + - rfc3204 + template: + - application/QSIG + registered: true +- !ruby/object:MIME::Type + content-type: application/quicktimeplayer + encoding: base64 + extensions: + - qtl + obsolete: true + use-instead: application/x-quicktimeplayer + registered: false +- !ruby/object:MIME::Type + content-type: application/raptorfec + encoding: base64 + xrefs: + rfc: + - rfc6682 + template: + - application/raptorfec + registered: true +- !ruby/object:MIME::Type + content-type: application/rdap+json + encoding: base64 + xrefs: + rfc: + - rfc9083 + template: + - application/rdap+json + registered: true +- !ruby/object:MIME::Type + content-type: application/rdf+xml + friendly: + en: Resource Description Framework + encoding: 8bit + extensions: + - rdf + xrefs: + rfc: + - rfc3870 + template: + - application/rdf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/reginfo+xml + friendly: + en: IMS Networks + encoding: base64 + extensions: + - rif + xrefs: + rfc: + - rfc3680 + template: + - application/reginfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/relax-ng-compact-syntax + friendly: + en: Relax NG Compact Syntax + encoding: base64 + extensions: + - rnc + xrefs: + uri: + - http://www.jtc1sc34.org/repository/0661.pdf + template: + - application/relax-ng-compact-syntax + registered: true +- !ruby/object:MIME::Type + content-type: application/remote-printing + encoding: base64 + xrefs: + rfc: + - rfc1486 + person: + - Marshall_Rose + template: + - application/remote-printing + registered: true +- !ruby/object:MIME::Type + content-type: application/remote_printing + encoding: base64 + obsolete: true + use-instead: application/remote-printing + registered: false +- !ruby/object:MIME::Type + content-type: application/reputon+json + encoding: base64 + xrefs: + rfc: + - rfc7071 + template: + - application/reputon+json + registered: true +- !ruby/object:MIME::Type + content-type: application/resource-lists+xml + friendly: + en: XML Resource Lists + encoding: base64 + extensions: + - rl + xrefs: + rfc: + - rfc4826 + template: + - application/resource-lists+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/resource-lists-diff+xml + friendly: + en: XML Resource Lists Diff + encoding: base64 + extensions: + - rld + xrefs: + rfc: + - rfc5362 + template: + - application/resource-lists-diff+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/rfc+xml + encoding: base64 + xrefs: + rfc: + - rfc7991 + template: + - application/rfc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/riscos + encoding: base64 + xrefs: + person: + - Nick_Smith + template: + - application/riscos + registered: true +- !ruby/object:MIME::Type + content-type: application/rlmi+xml + encoding: base64 + xrefs: + rfc: + - rfc4662 + template: + - application/rlmi+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/rls-services+xml + friendly: + en: XML Resource Lists + encoding: base64 + extensions: + - rs + xrefs: + rfc: + - rfc4826 + template: + - application/rls-services+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/route-apd+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/route-apd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/route-s-tsid+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/route-s-tsid+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/route-usd+xml + encoding: base64 + xrefs: + person: + - ATSC + template: + - application/route-usd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/rpki-ghostbusters + encoding: base64 + extensions: + - gbr + xrefs: + rfc: + - rfc6493 + template: + - application/rpki-ghostbusters + registered: true +- !ruby/object:MIME::Type + content-type: application/rpki-manifest + encoding: base64 + extensions: + - mft + xrefs: + rfc: + - rfc6481 + template: + - application/rpki-manifest + registered: true +- !ruby/object:MIME::Type + content-type: application/rpki-publication + encoding: base64 + xrefs: + rfc: + - rfc8181 + template: + - application/rpki-publication + registered: true +- !ruby/object:MIME::Type + content-type: application/rpki-roa + encoding: base64 + extensions: + - roa + xrefs: + rfc: + - rfc6481 + template: + - application/rpki-roa + registered: true +- !ruby/object:MIME::Type + content-type: application/rpki-updown + encoding: base64 + xrefs: + rfc: + - rfc6492 + template: + - application/rpki-updown + registered: true +- !ruby/object:MIME::Type + content-type: application/rsd+xml + friendly: + en: Really Simple Discovery + encoding: base64 + extensions: + - rsd + registered: false +- !ruby/object:MIME::Type + content-type: application/rss+xml + friendly: + en: RSS - Really Simple Syndication + encoding: base64 + extensions: + - rss + registered: false +- !ruby/object:MIME::Type + content-type: application/rtf + friendly: + en: Rich Text Format + encoding: base64 + extensions: + - rtf + xrefs: + person: + - Paul_Lindner + template: + - application/rtf + registered: true +- !ruby/object:MIME::Type + content-type: application/rtploopback + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - application/rtploopback + registered: true +- !ruby/object:MIME::Type + content-type: application/rtx + encoding: base64 + xrefs: + rfc: + - rfc4588 + template: + - application/rtx + registered: true +- !ruby/object:MIME::Type + content-type: application/samlassertion+xml + encoding: base64 + xrefs: + person: + - OASIS_Security_Services_Technical_Committee_SSTC + template: + - application/samlassertion+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/samlmetadata+xml + encoding: base64 + xrefs: + person: + - OASIS_Security_Services_Technical_Committee_SSTC + template: + - application/samlmetadata+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sarif+json + encoding: base64 + xrefs: + person: + - Laurence_J._Golding + - Michael_C._Fanning + - OASIS + template: + - application/sarif+json + registered: true +- !ruby/object:MIME::Type + content-type: application/sarif-external-properties+json + encoding: base64 + xrefs: + person: + - David_Keaton + - Michael_C._Fanning + - OASIS + template: + - application/sarif-external-properties+json + registered: true +- !ruby/object:MIME::Type + content-type: application/sbe + encoding: base64 + xrefs: + person: + - Donald_L._Mendelson + - FIX_Trading_Community + template: + - application/sbe + registered: true +- !ruby/object:MIME::Type + content-type: application/sbml+xml + friendly: + en: Systems Biology Markup Language + encoding: base64 + extensions: + - sbml + xrefs: + rfc: + - rfc3823 + template: + - application/sbml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/scaip+xml + encoding: base64 + xrefs: + person: + - Oskar_Jonsson + - SIS + template: + - application/scaip+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/scim+json + encoding: base64 + xrefs: + rfc: + - rfc7644 + template: + - application/scim+json + registered: true +- !ruby/object:MIME::Type + content-type: application/scvp-cv-request + friendly: + en: Server-Based Certificate Validation Protocol - Validation Request + encoding: base64 + extensions: + - scq + xrefs: + rfc: + - rfc5055 + template: + - application/scvp-cv-request + registered: true +- !ruby/object:MIME::Type + content-type: application/scvp-cv-response + friendly: + en: Server-Based Certificate Validation Protocol - Validation Response + encoding: base64 + extensions: + - scs + xrefs: + rfc: + - rfc5055 + template: + - application/scvp-cv-response + registered: true +- !ruby/object:MIME::Type + content-type: application/scvp-vp-request + friendly: + en: Server-Based Certificate Validation Protocol - Validation Policies - Request + encoding: base64 + extensions: + - spq + xrefs: + rfc: + - rfc5055 + template: + - application/scvp-vp-request + registered: true +- !ruby/object:MIME::Type + content-type: application/scvp-vp-response + friendly: + en: Server-Based Certificate Validation Protocol - Validation Policies - Response + encoding: base64 + extensions: + - spp + xrefs: + rfc: + - rfc5055 + template: + - application/scvp-vp-response + registered: true +- !ruby/object:MIME::Type + content-type: application/sdp + friendly: + en: Session Description Protocol + encoding: base64 + extensions: + - sdp + xrefs: + rfc: + - rfc8866 + template: + - application/sdp + registered: true +- !ruby/object:MIME::Type + content-type: application/secevent+jwt + encoding: base64 + xrefs: + rfc: + - rfc8417 + template: + - application/secevent+jwt + registered: true +- !ruby/object:MIME::Type + content-type: application/senml+cbor + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/senml+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/senml+json + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/senml+json + registered: true +- !ruby/object:MIME::Type + content-type: application/senml+xml + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/senml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/senml-etch+cbor + encoding: base64 + xrefs: + rfc: + - rfc8790 + template: + - application/senml-etch+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/senml-etch+json + encoding: base64 + xrefs: + rfc: + - rfc8790 + template: + - application/senml-etch+json + registered: true +- !ruby/object:MIME::Type + content-type: application/senml-exi + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/senml-exi + registered: true +- !ruby/object:MIME::Type + content-type: application/sensml+cbor + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/sensml+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/sensml+json + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/sensml+json + registered: true +- !ruby/object:MIME::Type + content-type: application/sensml+xml + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/sensml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sensml-exi + encoding: base64 + xrefs: + rfc: + - rfc8428 + template: + - application/sensml-exi + registered: true +- !ruby/object:MIME::Type + content-type: application/sep+xml + encoding: base64 + xrefs: + person: + - Robby_Simpson + - ZigBee + template: + - application/sep+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sep-exi + encoding: base64 + xrefs: + person: + - Robby_Simpson + - ZigBee + template: + - application/sep-exi + registered: true +- !ruby/object:MIME::Type + content-type: application/session-info + encoding: base64 + xrefs: + person: + - Frederic_Firmin + - _3GPP + template: + - application/session-info + registered: true +- !ruby/object:MIME::Type + content-type: application/set + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/set-payment + encoding: base64 + xrefs: + person: + - Brian_Korver + template: + - application/set-payment + registered: true +- !ruby/object:MIME::Type + content-type: application/set-payment-initiation + friendly: + en: Secure Electronic Transaction - Payment + encoding: base64 + extensions: + - setpay + xrefs: + person: + - Brian_Korver + template: + - application/set-payment-initiation + registered: true +- !ruby/object:MIME::Type + content-type: application/set-registration + encoding: base64 + xrefs: + person: + - Brian_Korver + template: + - application/set-registration + registered: true +- !ruby/object:MIME::Type + content-type: application/set-registration-initiation + friendly: + en: Secure Electronic Transaction - Registration + encoding: base64 + extensions: + - setreg + xrefs: + person: + - Brian_Korver + template: + - application/set-registration-initiation + registered: true +- !ruby/object:MIME::Type + content-type: application/sgml + encoding: base64 + extensions: + - sgml + xrefs: + rfc: + - rfc1874 + template: + - application/SGML + registered: true +- !ruby/object:MIME::Type + content-type: application/sgml-open-catalog + encoding: base64 + extensions: + - soc + xrefs: + person: + - Paul_Grosso + template: + - application/sgml-open-catalog + registered: true +- !ruby/object:MIME::Type + content-type: application/shf+xml + friendly: + en: S Hexdump Format + encoding: base64 + extensions: + - shf + xrefs: + rfc: + - rfc4194 + template: + - application/shf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sieve + encoding: base64 + extensions: + - siv + xrefs: + rfc: + - rfc5228 + template: + - application/sieve + registered: true +- !ruby/object:MIME::Type + content-type: application/simple-filter+xml + encoding: base64 + xrefs: + rfc: + - rfc4661 + template: + - application/simple-filter+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/simple-message-summary + encoding: base64 + xrefs: + rfc: + - rfc3842 + template: + - application/simple-message-summary + registered: true +- !ruby/object:MIME::Type + content-type: application/simpleSymbolContainer + encoding: base64 + xrefs: + person: + - _3GPP + template: + - application/simpleSymbolContainer + registered: true +- !ruby/object:MIME::Type + content-type: application/sipc + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/sipc + registered: true +- !ruby/object:MIME::Type + content-type: application/SLA + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/slate + encoding: base64 + xrefs: + person: + - Terry_Crowley + template: + - application/slate + registered: true +- !ruby/object:MIME::Type + content-type: application/smil + encoding: 8bit + extensions: + - smi + - smil + obsolete: true + use-instead: application/smil+xml + xrefs: + rfc: + - rfc4536 + template: + - application/smil + notes: + - "(OBSOLETED in favor of application/smil+xml)" + registered: true +- !ruby/object:MIME::Type + content-type: application/smil+xml + friendly: + en: Synchronized Multimedia Integration Language + encoding: 8bit + extensions: + - smi + - smil + xrefs: + rfc: + - rfc4536 + template: + - application/smil+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/smpte336m + encoding: base64 + xrefs: + rfc: + - rfc6597 + template: + - application/smpte336m + registered: true +- !ruby/object:MIME::Type + content-type: application/soap+fastinfoset + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1_SC6_ASN.1_Rapporteur + - ITU-T_ASN.1_Rapporteur + template: + - application/soap+fastinfoset + registered: true +- !ruby/object:MIME::Type + content-type: application/soap+xml + encoding: base64 + xrefs: + rfc: + - rfc3902 + template: + - application/soap+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/solids + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/sparql-query + friendly: + en: SPARQL - Query + encoding: base64 + extensions: + - rq + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/#mediaType + template: + - application/sparql-query + registered: true +- !ruby/object:MIME::Type + content-type: application/sparql-results+xml + friendly: + en: SPARQL - Results + encoding: base64 + extensions: + - srx + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/2007/CR-rdf-sparql-XMLres-20070925/#mime + template: + - application/sparql-results+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/spdx+json + encoding: base64 + xrefs: + person: + - Linux_Foundation + - Rose_Judge + template: + - application/spdx+json + registered: true +- !ruby/object:MIME::Type + content-type: application/spirits-event+xml + encoding: base64 + xrefs: + rfc: + - rfc3910 + template: + - application/spirits-event+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sql + encoding: base64 + xrefs: + rfc: + - rfc6922 + template: + - application/sql + registered: true +- !ruby/object:MIME::Type + content-type: application/srgs + friendly: + en: Speech Recognition Grammar Specification + encoding: base64 + extensions: + - gram + xrefs: + rfc: + - rfc4267 + template: + - application/srgs + registered: true +- !ruby/object:MIME::Type + content-type: application/srgs+xml + friendly: + en: Speech Recognition Grammar Specification - XML + encoding: base64 + extensions: + - grxml + xrefs: + rfc: + - rfc4267 + template: + - application/srgs+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/sru+xml + friendly: + en: Search/Retrieve via URL Response Format + encoding: base64 + extensions: + - sru + xrefs: + rfc: + - rfc6207 + template: + - application/sru+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/ssdl+xml + encoding: base64 + extensions: + - ssdl + registered: false +- !ruby/object:MIME::Type + content-type: application/ssml+xml + friendly: + en: Speech Synthesis Markup Language + encoding: base64 + extensions: + - ssml + xrefs: + rfc: + - rfc4267 + template: + - application/ssml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/STEP + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/stix+json + encoding: base64 + xrefs: + person: + - Chet_Ensign + - OASIS + template: + - application/stix+json + registered: true +- !ruby/object:MIME::Type + content-type: application/swid+xml + encoding: base64 + xrefs: + person: + - David_Waltermire + - ISO-IEC_JTC1 + - Ron_Brill + template: + - application/swid+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-apex-update + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-apex-update + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-apex-update-confirm + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-apex-update-confirm + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-community-update + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-community-update + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-community-update-confirm + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-community-update-confirm + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-error + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-error + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-sequence-adjust + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-sequence-adjust + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-sequence-adjust-confirm + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-sequence-adjust-confirm + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-status-query + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-status-query + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-status-response + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-status-response + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-update + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-update + registered: true +- !ruby/object:MIME::Type + content-type: application/tamp-update-confirm + encoding: base64 + xrefs: + rfc: + - rfc5934 + template: + - application/tamp-update-confirm + registered: true +- !ruby/object:MIME::Type + content-type: application/taxii+json + encoding: base64 + xrefs: + person: + - Chet_Ensign + - OASIS + template: + - application/taxii+json + registered: true +- !ruby/object:MIME::Type + content-type: application/td+json + encoding: base64 + xrefs: + person: + - Matthias_Kovatsch + - W3C + template: + - application/td+json + registered: true +- !ruby/object:MIME::Type + content-type: application/tei+xml + friendly: + en: Text Encoding and Interchange + encoding: base64 + extensions: + - tei + - teicorpus + xrefs: + rfc: + - rfc6129 + template: + - application/tei+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/TETRA_ISI + encoding: base64 + xrefs: + person: + - ETSI + - Miguel_Angel_Reina_Ortega + template: + - application/TETRA_ISI + registered: true +- !ruby/object:MIME::Type + content-type: application/thraud+xml + friendly: + en: Sharing Transaction Fraud Data + encoding: base64 + extensions: + - tfi + xrefs: + rfc: + - rfc5941 + template: + - application/thraud+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/timestamp-query + encoding: base64 + xrefs: + rfc: + - rfc3161 + template: + - application/timestamp-query + registered: true +- !ruby/object:MIME::Type + content-type: application/timestamp-reply + encoding: base64 + xrefs: + rfc: + - rfc3161 + template: + - application/timestamp-reply + registered: true +- !ruby/object:MIME::Type + content-type: application/timestamped-data + friendly: + en: Time Stamped Data Envelope + encoding: base64 + extensions: + - tsd + xrefs: + rfc: + - rfc5955 + template: + - application/timestamped-data + registered: true +- !ruby/object:MIME::Type + content-type: application/tlsrpt+gzip + encoding: base64 + xrefs: + rfc: + - rfc8460 + template: + - application/tlsrpt+gzip + registered: true +- !ruby/object:MIME::Type + content-type: application/tlsrpt+json + encoding: base64 + xrefs: + rfc: + - rfc8460 + template: + - application/tlsrpt+json + registered: true +- !ruby/object:MIME::Type + content-type: application/tnauthlist + encoding: base64 + xrefs: + rfc: + - rfc8226 + template: + - application/tnauthlist + registered: true +- !ruby/object:MIME::Type + content-type: application/token-introspection+jwt + encoding: base64 + xrefs: + draft: + - RFC-oauth-jwt-introspection-response-12 + template: + - application/token-introspection+jwt + registered: true +- !ruby/object:MIME::Type + content-type: application/toolbook + encoding: base64 + extensions: + - tbk + obsolete: true + use-instead: application/x-toolbook + registered: false +- !ruby/object:MIME::Type + content-type: application/trickle-ice-sdpfrag + encoding: base64 + xrefs: + rfc: + - rfc8840 + template: + - application/trickle-ice-sdpfrag + registered: true +- !ruby/object:MIME::Type + content-type: application/trig + encoding: base64 + xrefs: + person: + - W3C + - W3C_RDF_Working_Group + template: + - application/trig + registered: true +- !ruby/object:MIME::Type + content-type: application/ttml+xml + encoding: base64 + xrefs: + person: + - W3C + - W3C_Timed_Text_Working_Group + template: + - application/ttml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/tve-trigger + encoding: base64 + xrefs: + person: + - Linda_Welsh + template: + - application/tve-trigger + registered: true +- !ruby/object:MIME::Type + content-type: application/tzif + encoding: base64 + xrefs: + rfc: + - rfc8536 + template: + - application/tzif + registered: true +- !ruby/object:MIME::Type + content-type: application/tzif-leap + encoding: base64 + xrefs: + rfc: + - rfc8536 + template: + - application/tzif-leap + registered: true +- !ruby/object:MIME::Type + content-type: application/ulpfec + encoding: base64 + xrefs: + rfc: + - rfc5109 + template: + - application/ulpfec + registered: true +- !ruby/object:MIME::Type + content-type: application/urc-grpsheet+xml + encoding: base64 + xrefs: + person: + - Gottfried_Zimmermann + - ISO-IEC_JTC1 + template: + - application/urc-grpsheet+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/urc-ressheet+xml + encoding: base64 + xrefs: + person: + - Gottfried_Zimmermann + - ISO-IEC_JTC1 + template: + - application/urc-ressheet+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/urc-targetdesc+xml + encoding: base64 + xrefs: + person: + - Gottfried_Zimmermann + - ISO-IEC_JTC1 + template: + - application/urc-targetdesc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/urc-uisocketdesc+xml + encoding: base64 + xrefs: + person: + - Gottfried_Zimmermann + template: + - application/urc-uisocketdesc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vcard+json + encoding: base64 + xrefs: + rfc: + - rfc7095 + template: + - application/vcard+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vcard+xml + encoding: base64 + xrefs: + rfc: + - rfc6351 + template: + - application/vcard+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vda + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/vemmi + encoding: base64 + xrefs: + rfc: + - rfc2122 + template: + - application/vemmi + registered: true +- !ruby/object:MIME::Type + content-type: application/VMSBACKUP + encoding: base64 + extensions: + - bck + obsolete: true + use-instead: application/x-VMSBACKUP + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.1000minds.decision-model+xml + encoding: base64 + xrefs: + person: + - Franz_Ombler + template: + - application/vnd.1000minds.decision-model+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp-prose+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp-prose+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp-prose-pc3ch+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp-prose-pc3ch+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp-v2x-local-service-information + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp-v2x-local-service-information + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.5gnas + encoding: base64 + xrefs: + person: + - Jones_Lu_Yunjie + - _3GPP + template: + - application/vnd.3gpp.5gnas + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.access-transfer-events+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.access-transfer-events+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.bsf+xml + encoding: base64 + xrefs: + person: + - John_M_Meredith + template: + - application/vnd.3gpp.bsf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.GMOP+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.GMOP+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.gtpc + encoding: base64 + xrefs: + person: + - Yang_Yong + - _3GPP + template: + - application/vnd.3gpp.gtpc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.interworking-data + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.interworking-data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.lpp + encoding: base64 + xrefs: + person: + - Jones_Lu_Yunjie + - _3GPP + template: + - application/vnd.3gpp.lpp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mc-signalling-ear + encoding: base64 + xrefs: + person: + - Tim_Woodward + template: + - application/vnd.3gpp.mc-signalling-ear + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-affiliation-command+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-affiliation-command+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-payload + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-payload + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-service-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-service-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-signalling + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-signalling + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-ue-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-ue-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcdata-user-profile+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcdata-user-profile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-affiliation-command+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-affiliation-command+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-floor-request+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-floor-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-location-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-location-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-mbms-usage-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-mbms-usage-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-service-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-service-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-signed+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-signed+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-ue-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-ue-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-ue-init-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-ue-init-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcptt-user-profile+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcptt-user-profile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-affiliation-command+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-affiliation-command+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-affiliation-info+xml + encoding: base64 + obsolete: true + use-instead: application/vnd.3gpp.mcvideo-info+xml + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-affiliation-info+xml + notes: + - "(OBSOLETED in favor of application/vnd.3gpp.mcvideo-info+xml)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-location-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-location-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-mbms-usage-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-mbms-usage-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-service-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-service-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-transmission-request+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-transmission-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-ue-config+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-ue-config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mcvideo-user-profile+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mcvideo-user-profile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.mid-call+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.mid-call+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.ngap + encoding: base64 + xrefs: + person: + - Yang_Yong + - _3GPP + template: + - application/vnd.3gpp.ngap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.pfcp + encoding: base64 + xrefs: + person: + - Bruno_Landais + - _3GPP + template: + - application/vnd.3gpp.pfcp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.pic-bw-large + friendly: + en: 3rd Generation Partnership Project - Pic Large + encoding: base64 + extensions: + - plb + xrefs: + person: + - John_M_Meredith + template: + - application/vnd.3gpp.pic-bw-large + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.pic-bw-small + friendly: + en: 3rd Generation Partnership Project - Pic Small + encoding: base64 + extensions: + - psb + xrefs: + person: + - John_M_Meredith + template: + - application/vnd.3gpp.pic-bw-small + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.pic-bw-var + friendly: + en: 3rd Generation Partnership Project - Pic Var + encoding: base64 + extensions: + - pvb + xrefs: + person: + - John_M_Meredith + template: + - application/vnd.3gpp.pic-bw-var + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.s1ap + encoding: base64 + xrefs: + person: + - Yang_Yong + - _3GPP + template: + - application/vnd.3gpp.s1ap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.sms + encoding: base64 + extensions: + - sms + xrefs: + person: + - John_M_Meredith + template: + - application/vnd.3gpp.sms + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.sms+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.sms+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.srvcc-ext+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.srvcc-ext+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.SRVCC-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.SRVCC-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.state-and-event-info+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.state-and-event-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp.ussd+xml + encoding: base64 + xrefs: + person: + - Frederic_Firmin + template: + - application/vnd.3gpp.ussd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp2.bcmcsinfo+xml + encoding: base64 + xrefs: + person: + - AC_Mahendran + template: + - application/vnd.3gpp2.bcmcsinfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp2.sms + encoding: base64 + xrefs: + person: + - AC_Mahendran + template: + - application/vnd.3gpp2.sms + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3gpp2.tcap + friendly: + en: 3rd Generation Partnership Project - Transaction Capabilities Application + Part + encoding: base64 + extensions: + - tcap + xrefs: + person: + - AC_Mahendran + template: + - application/vnd.3gpp2.tcap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3lightssoftware.imagescal + encoding: base64 + xrefs: + person: + - Gus_Asadi + template: + - application/vnd.3lightssoftware.imagescal + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.3M.Post-it-Notes + friendly: + en: 3M Post It Notes + encoding: base64 + extensions: + - pwn + xrefs: + person: + - Michael_OBrien + template: + - application/vnd.3M.Post-it-Notes + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.accpac.simply.aso + friendly: + en: Simply Accounting + encoding: base64 + extensions: + - aso + xrefs: + person: + - Steve_Leow + template: + - application/vnd.accpac.simply.aso + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.accpac.simply.imp + friendly: + en: Simply Accounting - Data Import + encoding: base64 + extensions: + - imp + xrefs: + person: + - Steve_Leow + template: + - application/vnd.accpac.simply.imp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.acucobol + friendly: + en: ACU Cobol + encoding: base64 + extensions: + - acu + xrefs: + person: + - Dovid_Lubin + template: + - application/vnd.acucobol + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.acucorp + friendly: + en: ACU Cobol + encoding: 7bit + extensions: + - atc + - acutc + xrefs: + person: + - Dovid_Lubin + template: + - application/vnd.acucorp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.air-application-installer-package+zip + friendly: + en: Adobe AIR Application + encoding: base64 + extensions: + - air + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.flash.movie + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.adobe.flash.movie + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.formscentral.fcdt + encoding: base64 + extensions: + - fcdt + xrefs: + person: + - Chris_Solc + template: + - application/vnd.adobe.formscentral.fcdt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.fxp + friendly: + en: Adobe Flex Project + encoding: base64 + extensions: + - fxp + - fxpl + xrefs: + person: + - Steven_Heintz + template: + - application/vnd.adobe.fxp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.partial-upload + encoding: base64 + xrefs: + person: + - Tapani_Otala + template: + - application/vnd.adobe.partial-upload + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.xdp+xml + friendly: + en: Adobe XML Data Package + encoding: base64 + extensions: + - xdp + xrefs: + person: + - John_Brinkman + template: + - application/vnd.adobe.xdp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.adobe.xfdf + friendly: + en: Adobe XML Forms Data Format + encoding: base64 + extensions: + - xfdf + xrefs: + person: + - Roberto_Perelman + template: + - application/vnd.adobe.xfdf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.aether.imp + encoding: base64 + xrefs: + person: + - Jay_Moskowitz + template: + - application/vnd.aether.imp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.afplinedata + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.afplinedata + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.afplinedata-pagedef + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.afplinedata-pagedef + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.cmoca-cmresource + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.cmoca-cmresource + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.foca-charset + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.foca-charset + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.foca-codedfont + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.foca-codedfont + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.foca-codepage + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.foca-codepage + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-cmtable + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-cmtable + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-formdef + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-formdef + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-mediummap + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-mediummap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-objectcontainer + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-objectcontainer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-overlay + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-overlay + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.afpc.modca-pagesegment + encoding: base64 + xrefs: + person: + - Jörg_Palmer + template: + - application/vnd.afpc.modca-pagesegment + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.age + encoding: base64 + xrefs: + person: + - Filippo_Valsorda + template: + - application/vnd.age + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ah-barcode + encoding: base64 + xrefs: + person: + - Katsuhiko_Ichinose + template: + - application/vnd.ah-barcode + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ahead.space + friendly: + en: Ahead AIR Application + encoding: base64 + extensions: + - ahead + xrefs: + person: + - Tor_Kristensen + template: + - application/vnd.ahead.space + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.airzip.filesecure.azf + friendly: + en: AirZip FileSECURE + encoding: base64 + extensions: + - azf + xrefs: + person: + - Daniel_Mould + - Gary_Clueit + template: + - application/vnd.airzip.filesecure.azf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.airzip.filesecure.azs + friendly: + en: AirZip FileSECURE + encoding: base64 + extensions: + - azs + xrefs: + person: + - Daniel_Mould + - Gary_Clueit + template: + - application/vnd.airzip.filesecure.azs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.amadeus+json + encoding: base64 + xrefs: + person: + - Patrick_Brosse + template: + - application/vnd.amadeus+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.amazon.ebook + friendly: + en: Amazon Kindle eBook format + encoding: base64 + extensions: + - azw + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.amazon.mobi8-ebook + encoding: base64 + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.amazon.mobi8-ebook + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.americandynamics.acc + friendly: + en: Active Content Compression + encoding: base64 + extensions: + - acc + xrefs: + person: + - Gary_Sands + template: + - application/vnd.americandynamics.acc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.amiga.ami + friendly: + en: AmigaDE + encoding: base64 + extensions: + - ami + xrefs: + person: + - Kevin_Blumberg + template: + - application/vnd.amiga.ami + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.amundsen.maze+xml + encoding: base64 + xrefs: + person: + - Mike_Amundsen + template: + - application/vnd.amundsen.maze+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.android.ota + encoding: base64 + xrefs: + person: + - Greg_Kaiser + template: + - application/vnd.android.ota + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.android.package-archive + friendly: + en: Android Package Archive + encoding: base64 + extensions: + - apk + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.anki + encoding: base64 + xrefs: + person: + - Kerrick_Staley + template: + - application/vnd.anki + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.anser-web-certificate-issue-initiation + friendly: + en: ANSER-WEB Terminal Client - Certificate Issue + encoding: base64 + extensions: + - cii + xrefs: + person: + - Hiroyoshi_Mori + template: + - application/vnd.anser-web-certificate-issue-initiation + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.anser-web-funds-transfer-initiation + friendly: + en: ANSER-WEB Terminal Client - Web Funds Transfer + encoding: base64 + extensions: + - fti + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.antix.game-component + friendly: + en: Antix Game Player + encoding: base64 + extensions: + - atx + xrefs: + person: + - Daniel_Shelton + template: + - application/vnd.antix.game-component + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apache.arrow.file + encoding: base64 + xrefs: + person: + - Apache_Arrow_Project + template: + - application/vnd.apache.arrow.file + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apache.arrow.stream + encoding: base64 + xrefs: + person: + - Apache_Arrow_Project + template: + - application/vnd.apache.arrow.stream + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apache.thrift.binary + encoding: base64 + xrefs: + person: + - Roger_Meier + template: + - application/vnd.apache.thrift.binary + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apache.thrift.compact + encoding: base64 + xrefs: + person: + - Roger_Meier + template: + - application/vnd.apache.thrift.compact + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apache.thrift.json + encoding: base64 + xrefs: + person: + - Roger_Meier + template: + - application/vnd.apache.thrift.json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.api+json + encoding: base64 + xrefs: + person: + - Steve_Klabnik + template: + - application/vnd.api+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.aplextor.warrp+json + encoding: base64 + xrefs: + person: + - Oleg_Uryutin + template: + - application/vnd.aplextor.warrp+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apothekende.reservation+json + encoding: base64 + xrefs: + person: + - Adrian_Föder + template: + - application/vnd.apothekende.reservation+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.installer+xml + friendly: + en: Apple Installer Package + encoding: base64 + extensions: + - mpkg + xrefs: + person: + - Peter_Bierman + template: + - application/vnd.apple.installer+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.keynote + encoding: base64 + xrefs: + person: + - Manichandra_Sajjanapu + template: + - application/vnd.apple.keynote + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.mpegurl + friendly: + en: Multimedia Playlist Unicode + encoding: base64 + extensions: + - m3u8 + xrefs: + rfc: + - rfc8216 + template: + - application/vnd.apple.mpegurl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.numbers + encoding: base64 + xrefs: + person: + - Manichandra_Sajjanapu + template: + - application/vnd.apple.numbers + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.pages + encoding: base64 + xrefs: + person: + - Manichandra_Sajjanapu + template: + - application/vnd.apple.pages + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.apple.pkpass + encoding: base64 + extensions: + - pkpass + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.arastra.swi + encoding: base64 + obsolete: true + use-instead: application/vnd.aristanetworks.swi + xrefs: + person: + - Bill_Fenner + template: + - application/vnd.arastra.swi + notes: + - "(OBSOLETED in favor of application/vnd.aristanetworks.swi)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.aristanetworks.swi + friendly: + en: Arista Networks Software Image + encoding: base64 + extensions: + - swi + xrefs: + person: + - Bill_Fenner + template: + - application/vnd.aristanetworks.swi + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.artisan+json + encoding: base64 + xrefs: + person: + - Brad_Turner + template: + - application/vnd.artisan+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.artsquare + encoding: base64 + xrefs: + person: + - Christopher_Smith + template: + - application/vnd.artsquare + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.astraea-software.iota + encoding: base64 + extensions: + - iota + xrefs: + person: + - Christopher_Snazell + template: + - application/vnd.astraea-software.iota + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.audiograph + friendly: + en: Audiograph + encoding: base64 + extensions: + - aep + xrefs: + person: + - Horia_Cristian_Slusanschi + template: + - application/vnd.audiograph + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.autopackage + encoding: base64 + xrefs: + person: + - Mike_Hearn + template: + - application/vnd.autopackage + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.avalon+json + encoding: base64 + xrefs: + person: + - Ben_Hinman + template: + - application/vnd.avalon+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.avistar+xml + encoding: base64 + xrefs: + person: + - Vladimir_Vysotsky + template: + - application/vnd.avistar+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.balsamiq.bmml+xml + encoding: base64 + xrefs: + person: + - Giacomo_Guilizzoni + template: + - application/vnd.balsamiq.bmml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.balsamiq.bmpr + encoding: base64 + xrefs: + person: + - Giacomo_Guilizzoni + template: + - application/vnd.balsamiq.bmpr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.banana-accounting + encoding: base64 + xrefs: + person: + - José_Del_Romano + template: + - application/vnd.banana-accounting + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bbf.usp.error + encoding: base64 + xrefs: + person: + - Broadband_Forum + template: + - application/vnd.bbf.usp.error + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bbf.usp.msg + encoding: base64 + xrefs: + person: + - Broadband_Forum + template: + - application/vnd.bbf.usp.msg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bbf.usp.msg+json + encoding: base64 + xrefs: + person: + - Broadband_Forum + template: + - application/vnd.bbf.usp.msg+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bekitzur-stech+json + encoding: base64 + xrefs: + person: + - Jegulsky + template: + - application/vnd.bekitzur-stech+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bint.med-content + encoding: base64 + xrefs: + person: + - Heinz-Peter_Schütz + template: + - application/vnd.bint.med-content + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.biopax.rdf+xml + encoding: base64 + xrefs: + person: + - Pathway_Commons + template: + - application/vnd.biopax.rdf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.blink-idb-value-wrapper + encoding: base64 + xrefs: + person: + - Victor_Costan + template: + - application/vnd.blink-idb-value-wrapper + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.blueice.multipass + friendly: + en: Blueice Research Multipass + encoding: base64 + extensions: + - mpm + xrefs: + person: + - Thomas_Holmstrom + template: + - application/vnd.blueice.multipass + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bluetooth.ep.oob + encoding: base64 + xrefs: + person: + - Mike_Foley + template: + - application/vnd.bluetooth.ep.oob + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bluetooth.le.oob + encoding: base64 + xrefs: + person: + - Mark_Powell + template: + - application/vnd.bluetooth.le.oob + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bmi + friendly: + en: BMI Drawing Data Interchange + encoding: base64 + extensions: + - bmi + xrefs: + person: + - Tadashi_Gotoh + template: + - application/vnd.bmi + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bpf + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/vnd.bpf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.bpf3 + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/vnd.bpf3 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.businessobjects + friendly: + en: BusinessObjects + encoding: base64 + extensions: + - rep + xrefs: + person: + - Philippe_Imoucha + template: + - application/vnd.businessobjects + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.byu.uapi+json + encoding: base64 + xrefs: + person: + - Brent_Moore + template: + - application/vnd.byu.uapi+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cab-jscript + encoding: base64 + xrefs: + person: + - Joerg_Falkenberg + template: + - application/vnd.cab-jscript + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.canon-cpdl + encoding: base64 + xrefs: + person: + - Shin_Muto + template: + - application/vnd.canon-cpdl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.canon-lips + encoding: base64 + xrefs: + person: + - Shin_Muto + template: + - application/vnd.canon-lips + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.capasystems-pg+json + encoding: base64 + xrefs: + person: + - Yüksel_Aydemir + template: + - application/vnd.capasystems-pg+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cendio.thinlinc.clientconf + encoding: base64 + xrefs: + person: + - Peter_Astrand + template: + - application/vnd.cendio.thinlinc.clientconf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.century-systems.tcp_stream + encoding: base64 + xrefs: + person: + - Shuji_Fujii + template: + - application/vnd.century-systems.tcp_stream + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.chemdraw+xml + friendly: + en: CambridgeSoft Chem Draw + encoding: base64 + extensions: + - cdxml + xrefs: + person: + - Glenn_Howes + template: + - application/vnd.chemdraw+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.chess-pgn + encoding: base64 + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.chess-pgn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.chipnuts.karaoke-mmd + friendly: + en: Karaoke on Chipnuts Chipsets + encoding: base64 + extensions: + - mmd + xrefs: + person: + - Chunyun_Xiong + template: + - application/vnd.chipnuts.karaoke-mmd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ciedi + encoding: base64 + xrefs: + person: + - Hidekazu_Enjo + template: + - application/vnd.ciedi + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cinderella + friendly: + en: Interactive Geometry Software Cinderella + encoding: base64 + extensions: + - cdy + xrefs: + person: + - Ulrich_Kortenkamp + template: + - application/vnd.cinderella + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cirpack.isdn-ext + encoding: base64 + xrefs: + person: + - Pascal_Mayeux + template: + - application/vnd.cirpack.isdn-ext + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.citationstyles.style+xml + encoding: base64 + xrefs: + person: + - Rintze_M._Zelle + template: + - application/vnd.citationstyles.style+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.claymore + friendly: + en: Claymore Data Files + encoding: base64 + extensions: + - cla + xrefs: + person: + - Ray_Simpson + template: + - application/vnd.claymore + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cloanto.rp9 + friendly: + en: RetroPlatform Player + encoding: base64 + extensions: + - rp9 + xrefs: + person: + - Mike_Labatt + template: + - application/vnd.cloanto.rp9 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.clonk.c4group + friendly: + en: Clonk Game + encoding: base64 + extensions: + - c4d + - c4f + - c4g + - c4p + - c4u + xrefs: + person: + - Guenther_Brammer + template: + - application/vnd.clonk.c4group + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cluetrust.cartomobile-config + friendly: + en: ClueTrust CartoMobile - Config + encoding: base64 + extensions: + - c11amc + xrefs: + person: + - Gaige_Paulsen + template: + - application/vnd.cluetrust.cartomobile-config + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cluetrust.cartomobile-config-pkg + friendly: + en: ClueTrust CartoMobile - Config Package + encoding: base64 + extensions: + - c11amz + xrefs: + person: + - Gaige_Paulsen + template: + - application/vnd.cluetrust.cartomobile-config-pkg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.coffeescript + encoding: base64 + xrefs: + person: + - Devyn_Collier_Johnson + template: + - application/vnd.coffeescript + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.document + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.document + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.document-template + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.document-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.presentation + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.presentation + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.presentation-template + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.presentation-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.spreadsheet + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.spreadsheet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collabio.xodocuments.spreadsheet-template + encoding: base64 + xrefs: + person: + - Alexey_Meandrov + template: + - application/vnd.collabio.xodocuments.spreadsheet-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collection+json + encoding: base64 + xrefs: + person: + - Mike_Amundsen + template: + - application/vnd.collection+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collection.doc+json + encoding: base64 + xrefs: + person: + - Irakli_Nadareishvili + template: + - application/vnd.collection.doc+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.collection.next+json + encoding: base64 + xrefs: + person: + - Ioseb_Dzmanashvili + template: + - application/vnd.collection.next+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.comicbook+zip + encoding: base64 + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.comicbook+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.comicbook-rar + encoding: base64 + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.comicbook-rar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.commerce-battelle + encoding: base64 + xrefs: + person: + - David_Applebaum + template: + - application/vnd.commerce-battelle + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.commonspace + friendly: + en: Sixth Floor Media - CommonSpace + encoding: base64 + extensions: + - csp + xrefs: + person: + - Ravinder_Chandhok + template: + - application/vnd.commonspace + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.contact.cmsg + friendly: + en: CIM Database + encoding: base64 + extensions: + - cdbcmsg + xrefs: + person: + - Frank_Patz + template: + - application/vnd.contact.cmsg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.coreos.ignition+json + encoding: base64 + xrefs: + person: + - Alex_Crawford + template: + - application/vnd.coreos.ignition+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cosmocaller + friendly: + en: CosmoCaller + encoding: base64 + extensions: + - cmc + xrefs: + person: + - Steve_Dellutri + template: + - application/vnd.cosmocaller + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crick.clicker + friendly: + en: CrickSoftware - Clicker + encoding: base64 + extensions: + - clkx + xrefs: + person: + - Andrew_Burt + template: + - application/vnd.crick.clicker + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crick.clicker.keyboard + friendly: + en: CrickSoftware - Clicker - Keyboard + encoding: base64 + extensions: + - clkk + xrefs: + person: + - Andrew_Burt + template: + - application/vnd.crick.clicker.keyboard + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crick.clicker.palette + friendly: + en: CrickSoftware - Clicker - Palette + encoding: base64 + extensions: + - clkp + xrefs: + person: + - Andrew_Burt + template: + - application/vnd.crick.clicker.palette + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crick.clicker.template + friendly: + en: CrickSoftware - Clicker - Template + encoding: base64 + extensions: + - clkt + xrefs: + person: + - Andrew_Burt + template: + - application/vnd.crick.clicker.template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crick.clicker.wordbank + friendly: + en: CrickSoftware - Clicker - Wordbank + encoding: base64 + extensions: + - clkw + xrefs: + person: + - Andrew_Burt + template: + - application/vnd.crick.clicker.wordbank + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.criticaltools.wbs+xml + friendly: + en: Critical Tools - PERT Chart EXPERT + encoding: base64 + extensions: + - wbs + xrefs: + person: + - Jim_Spiller + template: + - application/vnd.criticaltools.wbs+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cryptii.pipe+json + encoding: base64 + xrefs: + person: + - Fränz_Friederes + template: + - application/vnd.cryptii.pipe+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.crypto-shade-file + encoding: base64 + xrefs: + person: + - Connor_Horman + template: + - application/vnd.crypto-shade-file + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cryptomator.encrypted + encoding: base64 + xrefs: + person: + - Sebastian_Stenzel + template: + - application/vnd.cryptomator.encrypted + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cryptomator.vault + encoding: base64 + xrefs: + person: + - Sebastian_Stenzel + template: + - application/vnd.cryptomator.vault + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ctc-posml + friendly: + en: PosML + encoding: base64 + extensions: + - pml + xrefs: + person: + - Bayard_Kohlhepp + template: + - application/vnd.ctc-posml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ctct.ws+xml + encoding: base64 + xrefs: + person: + - Jim_Ancona + template: + - application/vnd.ctct.ws+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cups-pdf + encoding: base64 + xrefs: + person: + - Michael_Sweet + template: + - application/vnd.cups-pdf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cups-postscript + encoding: base64 + xrefs: + person: + - Michael_Sweet + template: + - application/vnd.cups-postscript + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cups-ppd + friendly: + en: Adobe PostScript Printer Description File Format + encoding: base64 + extensions: + - ppd + xrefs: + person: + - Michael_Sweet + template: + - application/vnd.cups-ppd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cups-raster + encoding: base64 + xrefs: + person: + - Michael_Sweet + template: + - application/vnd.cups-raster + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cups-raw + encoding: base64 + xrefs: + person: + - Michael_Sweet + template: + - application/vnd.cups-raw + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.curl + encoding: base64 + extensions: + - curl + xrefs: + person: + - Robert_Byrnes + template: + - application/vnd.curl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.curl.car + friendly: + en: CURL Applet + encoding: base64 + extensions: + - car + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.curl.pcurl + friendly: + en: CURL Applet + encoding: base64 + extensions: + - pcurl + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.cyan.dean.root+xml + encoding: base64 + xrefs: + person: + - Matt_Kern + template: + - application/vnd.cyan.dean.root+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cybank + encoding: base64 + xrefs: + person: + - Nor_Helmee + template: + - application/vnd.cybank + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cyclonedx+json + encoding: base64 + xrefs: + person: + - Patrick_Dwyer + template: + - application/vnd.cyclonedx+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.cyclonedx+xml + encoding: base64 + xrefs: + person: + - Patrick_Dwyer + template: + - application/vnd.cyclonedx+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.d2l.coursepackage1p0+zip + encoding: base64 + xrefs: + person: + - Viktor_Haag + template: + - application/vnd.d2l.coursepackage1p0+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.d3m-dataset + encoding: base64 + xrefs: + person: + - Mi_Tar + template: + - application/vnd.d3m-dataset + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.d3m-problem + encoding: base64 + xrefs: + person: + - Mi_Tar + template: + - application/vnd.d3m-problem + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dart + encoding: base64 + extensions: + - dart + xrefs: + person: + - Anders_Sandholm + template: + - application/vnd.dart + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.data-vision.rdz + friendly: + en: RemoteDocs R-Viewer + encoding: base64 + extensions: + - rdz + xrefs: + person: + - James_Fields + template: + - application/vnd.data-vision.rdz + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.datapackage+json + encoding: base64 + xrefs: + person: + - Paul_Walsh + template: + - application/vnd.datapackage+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dataresource+json + encoding: base64 + xrefs: + person: + - Paul_Walsh + template: + - application/vnd.dataresource+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dbf + encoding: base64 + xrefs: + person: + - Mi_Tar + template: + - application/vnd.dbf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.debian.binary-package + encoding: base64 + xrefs: + person: + - Charles_Plessy + template: + - application/vnd.debian.binary-package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dece.data + encoding: base64 + extensions: + - uvd + - uvf + - uvvd + - uvvf + xrefs: + person: + - Michael_A_Dolan + template: + - application/vnd.dece.data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dece.ttml+xml + encoding: base64 + extensions: + - uvt + - uvvt + xrefs: + person: + - Michael_A_Dolan + template: + - application/vnd.dece.ttml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dece.unspecified + encoding: base64 + extensions: + - uvvx + - uvx + xrefs: + person: + - Michael_A_Dolan + template: + - application/vnd.dece.unspecified + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dece.zip + encoding: base64 + extensions: + - uvvz + - uvz + xrefs: + person: + - Michael_A_Dolan + template: + - application/vnd.dece.zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.denovo.fcselayout-link + friendly: + en: FCS Express Layout Link + encoding: base64 + extensions: + - fe_launch + xrefs: + person: + - Michael_Dixon + template: + - application/vnd.denovo.fcselayout-link + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.desmume.movie + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.desmume.movie + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dir-bi.plate-dl-nosuffix + encoding: base64 + xrefs: + person: + - Yamanaka + template: + - application/vnd.dir-bi.plate-dl-nosuffix + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dm.delegation+xml + encoding: base64 + xrefs: + person: + - Axel_Ferrazzini + template: + - application/vnd.dm.delegation+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dna + friendly: + en: New Moon Liftoff/DNA + encoding: base64 + extensions: + - dna + xrefs: + person: + - Meredith_Searcy + template: + - application/vnd.dna + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.document+json + encoding: base64 + xrefs: + person: + - Tom_Christie + template: + - application/vnd.document+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dolby.mlp + friendly: + en: Dolby Meridian Lossless Packing + encoding: base64 + extensions: + - mlp + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.dolby.mobile.1 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - application/vnd.dolby.mobile.1 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dolby.mobile.2 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - application/vnd.dolby.mobile.2 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.doremir.scorecloud-binary-document + encoding: base64 + xrefs: + person: + - Erik_Ronström + template: + - application/vnd.doremir.scorecloud-binary-document + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dpgraph + friendly: + en: DPGraph + encoding: base64 + extensions: + - dpg + xrefs: + person: + - David_Parker + template: + - application/vnd.dpgraph + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dreamfactory + friendly: + en: DreamFactory + encoding: base64 + extensions: + - dfac + xrefs: + person: + - William_C._Appleton + template: + - application/vnd.dreamfactory + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.drive+json + encoding: base64 + xrefs: + person: + - Keith_Kester + template: + - application/vnd.drive+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ds-keypoint + encoding: base64 + extensions: + - kpxx + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.dtg.local + encoding: base64 + xrefs: + person: + - Ali_Teffahi + template: + - application/vnd.dtg.local + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dtg.local.flash + encoding: base64 + xrefs: + person: + - Ali_Teffahi + template: + - application/vnd.dtg.local.flash + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dtg.local.html + encoding: base64 + xrefs: + person: + - Ali_Teffahi + template: + - application/vnd.dtg.local.html + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ait + friendly: + en: Digital Video Broadcasting + encoding: base64 + extensions: + - ait + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - application/vnd.dvb.ait + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.dvbisl+xml + encoding: base64 + xrefs: + person: + - Emily_DUBS + template: + - application/vnd.dvb.dvbisl+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.dvbj + encoding: base64 + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - application/vnd.dvb.dvbj + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.esgcontainer + encoding: base64 + xrefs: + person: + - Joerg_Heuer + template: + - application/vnd.dvb.esgcontainer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ipdcdftnotifaccess + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.ipdcdftnotifaccess + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ipdcesgaccess + encoding: base64 + xrefs: + person: + - Joerg_Heuer + template: + - application/vnd.dvb.ipdcesgaccess + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ipdcesgaccess2 + encoding: base64 + xrefs: + person: + - Jerome_Marcon + template: + - application/vnd.dvb.ipdcesgaccess2 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ipdcesgpdd + encoding: base64 + xrefs: + person: + - Jerome_Marcon + template: + - application/vnd.dvb.ipdcesgpdd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.ipdcroaming + encoding: base64 + xrefs: + person: + - Yiling_Xu + template: + - application/vnd.dvb.ipdcroaming + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.iptv.alfec-base + encoding: base64 + xrefs: + person: + - Jean-Baptiste_Henry + template: + - application/vnd.dvb.iptv.alfec-base + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.iptv.alfec-enhancement + encoding: base64 + xrefs: + person: + - Jean-Baptiste_Henry + template: + - application/vnd.dvb.iptv.alfec-enhancement + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-aggregate-root+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-aggregate-root+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-container+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-container+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-generic+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-generic+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-ia-msglist+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-ia-msglist+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-ia-registration-request+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-ia-registration-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-ia-registration-response+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-ia-registration-response+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.notif-init+xml + encoding: base64 + xrefs: + person: + - Roy_Yue + template: + - application/vnd.dvb.notif-init+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.pfr + encoding: base64 + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - application/vnd.dvb.pfr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dvb.service + friendly: + en: Digital Video Broadcasting + encoding: base64 + extensions: + - svc + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - application/vnd.dvb.service + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dxr + encoding: base64 + xrefs: + person: + - Michael_Duffy + template: + - application/vnd.dxr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dynageo + friendly: + en: DynaGeo + encoding: base64 + extensions: + - geo + xrefs: + person: + - Roland_Mechling + template: + - application/vnd.dynageo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.dzr + encoding: base64 + xrefs: + person: + - Carl_Anderson + template: + - application/vnd.dzr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.easykaraoke.cdgdownload + encoding: base64 + xrefs: + person: + - Iain_Downs + template: + - application/vnd.easykaraoke.cdgdownload + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecdis-update + encoding: base64 + xrefs: + person: + - Gert_Buettgenbach + template: + - application/vnd.ecdis-update + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecip.rlp + encoding: base64 + xrefs: + person: + - Wei_Tang + template: + - application/vnd.ecip.rlp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.chart + friendly: + en: EcoWin Chart + encoding: base64 + extensions: + - mag + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.chart + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.filerequest + encoding: base64 + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.filerequest + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.fileupdate + encoding: base64 + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.fileupdate + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.series + encoding: base64 + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.series + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.seriesrequest + encoding: base64 + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.seriesrequest + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ecowin.seriesupdate + encoding: base64 + xrefs: + person: + - Thomas_Olsson + template: + - application/vnd.ecowin.seriesupdate + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.efi.img + encoding: base64 + xrefs: + person: + - Fu_Siyuan + - UEFI_Forum + template: + - application/vnd.efi.img + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.efi.iso + encoding: base64 + xrefs: + person: + - Fu_Siyuan + - UEFI_Forum + template: + - application/vnd.efi.iso + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.emclient.accessrequest+xml + encoding: base64 + xrefs: + person: + - Filip_Navara + template: + - application/vnd.emclient.accessrequest+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.enliven + friendly: + en: Enliven Viewer + encoding: base64 + extensions: + - nml + xrefs: + person: + - Paul_Santinelli_Jr. + template: + - application/vnd.enliven + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.enphase.envoy + encoding: base64 + xrefs: + person: + - Chris_Eich + template: + - application/vnd.enphase.envoy + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.eprints.data+xml + encoding: base64 + xrefs: + person: + - Tim_Brody + template: + - application/vnd.eprints.data+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.epson.esf + friendly: + en: QUASS Stream Player + encoding: base64 + extensions: + - esf + xrefs: + person: + - Shoji_Hoshina + template: + - application/vnd.epson.esf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.epson.msf + friendly: + en: QUASS Stream Player + encoding: base64 + extensions: + - msf + xrefs: + person: + - Shoji_Hoshina + template: + - application/vnd.epson.msf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.epson.quickanime + friendly: + en: QuickAnime Player + encoding: base64 + extensions: + - qam + xrefs: + person: + - Yu_Gu + template: + - application/vnd.epson.quickanime + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.epson.salt + friendly: + en: SimpleAnimeLite Player + encoding: base64 + extensions: + - slt + xrefs: + person: + - Yasuhito_Nagatomo + template: + - application/vnd.epson.salt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.epson.ssf + friendly: + en: QUASS Stream Player + encoding: base64 + extensions: + - ssf + xrefs: + person: + - Shoji_Hoshina + template: + - application/vnd.epson.ssf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ericsson.quickcall + encoding: base64 + xrefs: + person: + - Paul_Tidwell + template: + - application/vnd.ericsson.quickcall + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.espass-espass+zip + encoding: base64 + xrefs: + person: + - Marcus_Ligi_Büschleb + template: + - application/vnd.espass-espass+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.eszigno3+xml + friendly: + en: MICROSEC e-Szign¢ + encoding: base64 + extensions: + - es3 + - et3 + xrefs: + person: + - Szilveszter_Tóth + template: + - application/vnd.eszigno3+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.aoc+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.aoc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.asic-e+zip + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.asic-e+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.asic-s+zip + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.asic-s+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.cug+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.cug+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvcommand+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvcommand+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvdiscovery+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvdiscovery+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvprofile+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvprofile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvsad-bc+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvsad-bc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvsad-cod+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvsad-cod+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvsad-npvr+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvsad-npvr+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvservice+xml + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.iptvservice+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvsync+xml + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.iptvsync+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.iptvueprofile+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.iptvueprofile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.mcid+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.mcid+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.mheg5 + encoding: base64 + xrefs: + person: + - Ian_Medland + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.mheg5 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.overload-control-policy-dataset+xml + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.overload-control-policy-dataset+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.pstn+xml + encoding: base64 + xrefs: + person: + - Jiwan_Han + - Thomas_Belling + template: + - application/vnd.etsi.pstn+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.sci+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.sci+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.simservs+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.simservs+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.timestamp-token + encoding: base64 + xrefs: + person: + - Miguel_Angel_Reina_Ortega + template: + - application/vnd.etsi.timestamp-token + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.tsl+xml + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.tsl+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.etsi.tsl.der + encoding: base64 + xrefs: + person: + - Shicheng_Hu + template: + - application/vnd.etsi.tsl.der + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.eu.kasparian.car+json + encoding: base64 + xrefs: + person: + - Hervé_Kasparian + template: + - application/vnd.eu.kasparian.car+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.eudora.data + encoding: base64 + xrefs: + person: + - Pete_Resnick + template: + - application/vnd.eudora.data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.evolv.ecig.profile + encoding: base64 + xrefs: + person: + - James_Bellinger + template: + - application/vnd.evolv.ecig.profile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.evolv.ecig.settings + encoding: base64 + xrefs: + person: + - James_Bellinger + template: + - application/vnd.evolv.ecig.settings + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.evolv.ecig.theme + encoding: base64 + xrefs: + person: + - James_Bellinger + template: + - application/vnd.evolv.ecig.theme + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.exstream-empower+zip + encoding: base64 + xrefs: + person: + - Bill_Kidwell + template: + - application/vnd.exstream-empower+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.exstream-package + encoding: base64 + xrefs: + person: + - Bill_Kidwell + template: + - application/vnd.exstream-package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ezpix-album + friendly: + en: EZPix Secure Photo Album + encoding: base64 + extensions: + - ez2 + xrefs: + person: + - ElectronicZombieCorp + template: + - application/vnd.ezpix-album + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ezpix-package + friendly: + en: EZPix Secure Photo Album + encoding: base64 + extensions: + - ez3 + xrefs: + person: + - ElectronicZombieCorp + template: + - application/vnd.ezpix-package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.f-secure.mobile + encoding: base64 + xrefs: + person: + - Samu_Sarivaara + template: + - application/vnd.f-secure.mobile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.familysearch.gedcom+zip + encoding: base64 + xrefs: + person: + - Gordon_Clarke + template: + - application/vnd.familysearch.gedcom+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fastcopy-disk-image + encoding: base64 + xrefs: + person: + - Thomas_Huth + template: + - application/vnd.fastcopy-disk-image + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fdf + friendly: + en: Forms Data Format + encoding: base64 + extensions: + - fdf + xrefs: + person: + - Steve_Zilles + template: + - application/vnd.fdf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fdsn.mseed + encoding: base64 + extensions: + - mseed + xrefs: + person: + - Chad_Trabant + template: + - application/vnd.fdsn.mseed + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fdsn.seed + friendly: + en: Digital Siesmograph Networks - SEED Datafiles + encoding: base64 + extensions: + - dataless + - seed + xrefs: + person: + - Chad_Trabant + template: + - application/vnd.fdsn.seed + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ffsns + encoding: base64 + xrefs: + person: + - Holstage + template: + - application/vnd.ffsns + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ficlab.flb+zip + encoding: base64 + xrefs: + person: + - Steve_Gilberd + template: + - application/vnd.ficlab.flb+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.filmit.zfc + encoding: base64 + xrefs: + person: + - Harms_Moeller + template: + - application/vnd.filmit.zfc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fints + encoding: base64 + xrefs: + person: + - Ingo_Hammann + template: + - application/vnd.fints + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.firemonkeys.cloudcell + encoding: base64 + xrefs: + person: + - Alex_Dubov + template: + - application/vnd.firemonkeys.cloudcell + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.FloGraphIt + friendly: + en: NpGraphIt + encoding: base64 + extensions: + - gph + xrefs: + person: + - Dick_Floersch + template: + - application/vnd.FloGraphIt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fluxtime.clip + friendly: + en: FluxTime Clip + encoding: base64 + extensions: + - ftc + xrefs: + person: + - Marc_Winter + template: + - application/vnd.fluxtime.clip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.font-fontforge-sfd + encoding: base64 + xrefs: + person: + - George_Williams + template: + - application/vnd.font-fontforge-sfd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.framemaker + friendly: + en: FrameMaker Normal Format + encoding: base64 + extensions: + - frm + - maker + - frame + - fm + - fb + - book + - fbdoc + xrefs: + person: + - Mike_Wexler + template: + - application/vnd.framemaker + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.frogans.fnc + friendly: + en: Frogans Player + encoding: base64 + extensions: + - fnc + obsolete: true + xrefs: + person: + - Alexis_Tamas + - OP3FT + template: + - application/vnd.frogans.fnc + notes: + - "(OBSOLETE)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.frogans.ltf + friendly: + en: Frogans Player + encoding: base64 + extensions: + - ltf + obsolete: true + xrefs: + person: + - Alexis_Tamas + - OP3FT + template: + - application/vnd.frogans.ltf + notes: + - "(OBSOLETE)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fsc.weblaunch + friendly: + en: Friendly Software Corporation + encoding: 7bit + extensions: + - fsc + xrefs: + person: + - Derek_Smith + template: + - application/vnd.fsc.weblaunch + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujifilm.fb.docuworks + encoding: base64 + xrefs: + person: + - Kazuya_Iimura + template: + - application/vnd.fujifilm.fb.docuworks + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujifilm.fb.docuworks.binder + encoding: base64 + xrefs: + person: + - Kazuya_Iimura + template: + - application/vnd.fujifilm.fb.docuworks.binder + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujifilm.fb.docuworks.container + encoding: base64 + xrefs: + person: + - Kazuya_Iimura + template: + - application/vnd.fujifilm.fb.docuworks.container + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujifilm.fb.jfi+xml + encoding: base64 + xrefs: + person: + - Keitaro_Ishida + template: + - application/vnd.fujifilm.fb.jfi+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujitsu.oasys + friendly: + en: Fujitsu Oasys + encoding: base64 + extensions: + - oas + xrefs: + person: + - Nobukazu_Togashi + template: + - application/vnd.fujitsu.oasys + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujitsu.oasys2 + friendly: + en: Fujitsu Oasys + encoding: base64 + extensions: + - oa2 + xrefs: + person: + - Nobukazu_Togashi + template: + - application/vnd.fujitsu.oasys2 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujitsu.oasys3 + friendly: + en: Fujitsu Oasys + encoding: base64 + extensions: + - oa3 + xrefs: + person: + - Seiji_Okudaira + template: + - application/vnd.fujitsu.oasys3 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujitsu.oasysgp + friendly: + en: Fujitsu Oasys + encoding: base64 + extensions: + - fg5 + xrefs: + person: + - Masahiko_Sugimoto + template: + - application/vnd.fujitsu.oasysgp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujitsu.oasysprs + friendly: + en: Fujitsu Oasys + encoding: base64 + extensions: + - bh2 + xrefs: + person: + - Masumi_Ogita + template: + - application/vnd.fujitsu.oasysprs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.ART-EX + encoding: base64 + xrefs: + person: + - Fumio_Tanabe + template: + - application/vnd.fujixerox.ART-EX + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.ART4 + encoding: base64 + xrefs: + person: + - Fumio_Tanabe + template: + - application/vnd.fujixerox.ART4 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.ddd + friendly: + en: Fujitsu - Xerox 2D CAD Data + encoding: base64 + extensions: + - ddd + xrefs: + person: + - Masanori_Onda + template: + - application/vnd.fujixerox.ddd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.docuworks + friendly: + en: Fujitsu - Xerox DocuWorks + encoding: base64 + extensions: + - xdw + xrefs: + person: + - Takatomo_Wakibayashi + template: + - application/vnd.fujixerox.docuworks + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.docuworks.binder + friendly: + en: Fujitsu - Xerox DocuWorks Binder + encoding: base64 + extensions: + - xbd + xrefs: + person: + - Takashi_Matsumoto + template: + - application/vnd.fujixerox.docuworks.binder + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.docuworks.container + encoding: base64 + xrefs: + person: + - Kiyoshi_Tashiro + template: + - application/vnd.fujixerox.docuworks.container + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fujixerox.HBPL + encoding: base64 + xrefs: + person: + - Fumio_Tanabe + template: + - application/vnd.fujixerox.HBPL + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fut-misnet + encoding: base64 + xrefs: + person: + - Jann_Pruulman + template: + - application/vnd.fut-misnet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.futoin+cbor + encoding: base64 + xrefs: + person: + - Andrey_Galkin + template: + - application/vnd.futoin+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.futoin+json + encoding: base64 + xrefs: + person: + - Andrey_Galkin + template: + - application/vnd.futoin+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.fuzzysheet + friendly: + en: FuzzySheet + encoding: base64 + extensions: + - fzs + xrefs: + person: + - Simon_Birtwistle + template: + - application/vnd.fuzzysheet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.genomatix.tuxedo + friendly: + en: Genomatix Tuxedo Framework + encoding: base64 + extensions: + - txd + xrefs: + person: + - Torben_Frey + template: + - application/vnd.genomatix.tuxedo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gentics.grd+json + encoding: base64 + xrefs: + person: + - Philipp_Gortan + template: + - application/vnd.gentics.grd+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geo+json + encoding: base64 + obsolete: true + use-instead: application/geo+json + xrefs: + rfc: + - rfc7946 + person: + - Sean_Gillies + template: + - application/vnd.geo+json + notes: + - "(OBSOLETED by in favor of application/geo+json)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geocube+xml + encoding: 8bit + obsolete: true + xrefs: + person: + - Francois_Pirsch + template: + - application/vnd.geocube+xml + notes: + - "(OBSOLETED by request)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geogebra.file + friendly: + en: GeoGebra + encoding: base64 + extensions: + - ggb + xrefs: + person: + - GeoGebra + - Yves_Kreis + template: + - application/vnd.geogebra.file + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geogebra.slides + encoding: base64 + xrefs: + person: + - GeoGebra + - Markus_Hohenwarter + - Michael_Borcherds + template: + - application/vnd.geogebra.slides + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geogebra.tool + friendly: + en: GeoGebra + encoding: base64 + extensions: + - ggt + xrefs: + person: + - GeoGebra + - Yves_Kreis + template: + - application/vnd.geogebra.tool + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geometry-explorer + friendly: + en: GeoMetry Explorer + encoding: base64 + extensions: + - gex + - gre + xrefs: + person: + - Michael_Hvidsten + template: + - application/vnd.geometry-explorer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geonext + friendly: + en: GEONExT and JSXGraph + encoding: base64 + extensions: + - gxt + xrefs: + person: + - Matthias_Ehmann + template: + - application/vnd.geonext + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geoplan + friendly: + en: GeoplanW + encoding: base64 + extensions: + - g2w + xrefs: + person: + - Christian_Mercat + template: + - application/vnd.geoplan + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.geospace + friendly: + en: GeospacW + encoding: base64 + extensions: + - g3w + xrefs: + person: + - Christian_Mercat + template: + - application/vnd.geospace + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gerber + encoding: base64 + xrefs: + person: + - Thomas_Weyn + template: + - application/vnd.gerber + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.globalplatform.card-content-mgt + encoding: base64 + xrefs: + person: + - Gil_Bernabeu + template: + - application/vnd.globalplatform.card-content-mgt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.globalplatform.card-content-mgt-response + encoding: base64 + xrefs: + person: + - Gil_Bernabeu + template: + - application/vnd.globalplatform.card-content-mgt-response + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gmx + friendly: + en: GameMaker ActiveX + encoding: base64 + extensions: + - gmx + obsolete: true + xrefs: + person: + - Christian_V._Sciberras + template: + - application/vnd.gmx + notes: + - "- DEPRECATED" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.google-earth.kml+xml + friendly: + en: Google Earth - KML + encoding: 8bit + extensions: + - kml + xrefs: + person: + - Michael_Ashbridge + template: + - application/vnd.google-earth.kml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.google-earth.kmz + friendly: + en: Google Earth - Zipped KML + encoding: 8bit + extensions: + - kmz + xrefs: + person: + - Michael_Ashbridge + template: + - application/vnd.google-earth.kmz + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gov.sk.e-form+xml + encoding: base64 + xrefs: + person: + - Peter_Biro + - Stefan_Szilva + template: + - application/vnd.gov.sk.e-form+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gov.sk.e-form+zip + encoding: base64 + xrefs: + person: + - Peter_Biro + - Stefan_Szilva + template: + - application/vnd.gov.sk.e-form+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gov.sk.xmldatacontainer+xml + encoding: base64 + xrefs: + person: + - Peter_Biro + - Stefan_Szilva + template: + - application/vnd.gov.sk.xmldatacontainer+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.grafeq + friendly: + en: GrafEq + encoding: base64 + extensions: + - gqf + - gqs + xrefs: + person: + - Jeff_Tupper + template: + - application/vnd.grafeq + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.gridmp + encoding: base64 + xrefs: + person: + - Jeff_Lawson + template: + - application/vnd.gridmp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-account + friendly: + en: Groove - Account + encoding: base64 + extensions: + - gac + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-account + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-help + friendly: + en: Groove - Help + encoding: base64 + extensions: + - ghf + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-help + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-identity-message + friendly: + en: Groove - Identity Message + encoding: base64 + extensions: + - gim + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-identity-message + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-injector + friendly: + en: Groove - Injector + encoding: base64 + extensions: + - grv + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-injector + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-tool-message + friendly: + en: Groove - Tool Message + encoding: base64 + extensions: + - gtm + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-tool-message + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-tool-template + friendly: + en: Groove - Tool Template + encoding: base64 + extensions: + - tpl + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-tool-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.groove-vcard + friendly: + en: Groove - Vcard + encoding: base64 + extensions: + - vcg + xrefs: + person: + - Todd_Joseph + template: + - application/vnd.groove-vcard + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hal+json + encoding: base64 + xrefs: + person: + - Mike_Kelly + template: + - application/vnd.hal+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hal+xml + friendly: + en: Hypertext Application Language + encoding: base64 + extensions: + - hal + xrefs: + person: + - Mike_Kelly + template: + - application/vnd.hal+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.HandHeld-Entertainment+xml + friendly: + en: ZVUE Media Manager + encoding: base64 + extensions: + - zmm + xrefs: + person: + - Eric_Hamilton + template: + - application/vnd.HandHeld-Entertainment+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hbci + friendly: + en: Homebanking Computer Interface (HBCI) + encoding: base64 + extensions: + - hbci + - hbc + - kom + - upa + - pkd + - bpd + xrefs: + person: + - Ingo_Hammann + template: + - application/vnd.hbci + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hc+json + encoding: base64 + xrefs: + person: + - Jan_Schütze + template: + - application/vnd.hc+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hcl-bireports + encoding: base64 + xrefs: + person: + - Doug_R._Serres + template: + - application/vnd.hcl-bireports + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hdt + encoding: base64 + xrefs: + person: + - Javier_D._Fernández + template: + - application/vnd.hdt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.heroku+json + encoding: base64 + xrefs: + person: + - Wesley_Beary + template: + - application/vnd.heroku+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hhe.lesson-player + friendly: + en: Archipelago Lesson Player + encoding: base64 + extensions: + - les + xrefs: + person: + - Randy_Jones + template: + - application/vnd.hhe.lesson-player + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hl7cda+xml + encoding: base64 + xrefs: + person: + - Marc_Duteau + template: + - application/vnd.hl7cda+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hl7v2+xml + encoding: base64 + xrefs: + person: + - Marc_Duteau + template: + - application/vnd.hl7v2+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-HPGL + friendly: + en: HP-GL/2 and HP RTL + encoding: base64 + extensions: + - plt + - hpgl + xrefs: + person: + - Bob_Pentecost + template: + - application/vnd.hp-HPGL + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-hpid + friendly: + en: Hewlett Packard Instant Delivery + encoding: base64 + extensions: + - hpid + xrefs: + person: + - Aloke_Gupta + template: + - application/vnd.hp-hpid + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-hps + friendly: + en: Hewlett-Packard's WebPrintSmart + encoding: base64 + extensions: + - hps + xrefs: + person: + - Steve_Aubrey + template: + - application/vnd.hp-hps + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-jlyt + friendly: + en: HP Indigo Digital Press - Job Layout Languate + encoding: base64 + extensions: + - jlt + xrefs: + person: + - Amir_Gaash + template: + - application/vnd.hp-jlyt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-PCL + friendly: + en: HP Printer Command Language + encoding: base64 + extensions: + - pcl + xrefs: + person: + - Bob_Pentecost + template: + - application/vnd.hp-PCL + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hp-PCLXL + friendly: + en: PCL 6 Enhanced (Formely PCL XL) + encoding: base64 + extensions: + - pclxl + xrefs: + person: + - Bob_Pentecost + template: + - application/vnd.hp-PCLXL + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.httphone + encoding: base64 + xrefs: + person: + - Franck_Lefevre + template: + - application/vnd.httphone + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hydrostatix.sof-data + friendly: + en: Hydrostatix Master Suite + encoding: base64 + extensions: + - sfd-hdstx + xrefs: + person: + - Allen_Gillam + template: + - application/vnd.hydrostatix.sof-data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hyper+json + encoding: base64 + xrefs: + person: + - Irakli_Nadareishvili + template: + - application/vnd.hyper+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hyper-item+json + encoding: base64 + xrefs: + person: + - Mario_Demuth + template: + - application/vnd.hyper-item+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hyperdrive+json + encoding: base64 + xrefs: + person: + - Daniel_Sims + template: + - application/vnd.hyperdrive+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.hzn-3d-crossword + friendly: + en: 3D Crossword Plugin + encoding: base64 + xrefs: + person: + - James_Minnis + template: + - application/vnd.hzn-3d-crossword + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.afplinedata + encoding: base64 + obsolete: true + use-instead: vnd.afpc.afplinedata + xrefs: + person: + - Roger_Buis + template: + - application/vnd.ibm.afplinedata + notes: + - "(OBSOLETED in favor of vnd.afpc.afplinedata)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.electronic-media + encoding: base64 + extensions: + - emm + xrefs: + person: + - Bruce_Tantlinger + template: + - application/vnd.ibm.electronic-media + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.MiniPay + friendly: + en: MiniPay + encoding: base64 + extensions: + - mpy + xrefs: + person: + - Amir_Herzberg + template: + - application/vnd.ibm.MiniPay + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.modcap + friendly: + en: MO:DCA-P + encoding: base64 + extensions: + - afp + - list3820 + - listafp + obsolete: true + use-instead: application/vnd.afpc.modca + xrefs: + person: + - Reinhard_Hohensee + template: + - application/vnd.ibm.modcap + notes: + - "(OBSOLETED in favor of application/vnd.afpc.modca)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.rights-management + friendly: + en: IBM DB2 Rights Manager + encoding: base64 + extensions: + - irm + xrefs: + person: + - Bruce_Tantlinger + template: + - application/vnd.ibm.rights-management + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ibm.secure-container + friendly: + en: IBM Electronic Media Management System - Secure Container + encoding: base64 + extensions: + - sc + xrefs: + person: + - Bruce_Tantlinger + template: + - application/vnd.ibm.secure-container + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iccprofile + friendly: + en: ICC profile + encoding: base64 + extensions: + - icc + - icm + xrefs: + person: + - Phil_Green + template: + - application/vnd.iccprofile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ieee.1905 + encoding: base64 + xrefs: + person: + - Purva_R_Rajkotia + template: + - application/vnd.ieee.1905 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.igloader + friendly: + en: igLoader + encoding: base64 + extensions: + - igl + xrefs: + person: + - Tim_Fisher + template: + - application/vnd.igloader + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.imagemeter.folder+zip + encoding: base64 + xrefs: + person: + - Dirk_Farin + template: + - application/vnd.imagemeter.folder+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.imagemeter.image+zip + encoding: base64 + xrefs: + person: + - Dirk_Farin + template: + - application/vnd.imagemeter.image+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.immervision-ivp + friendly: + en: ImmerVision PURE Players + encoding: base64 + extensions: + - ivp + xrefs: + person: + - Mathieu_Villegas + template: + - application/vnd.immervision-ivp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.immervision-ivu + friendly: + en: ImmerVision PURE Players + encoding: base64 + extensions: + - ivu + xrefs: + person: + - Mathieu_Villegas + template: + - application/vnd.immervision-ivu + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.imsccv1p1 + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.imsccv1p1 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.imsccv1p2 + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.imsccv1p2 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.imsccv1p3 + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.imsccv1p3 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lis.v2.result+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lis.v2.result+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lti.v2.toolconsumerprofile+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lti.v2.toolconsumerprofile+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lti.v2.toolproxy+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lti.v2.toolproxy+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lti.v2.toolproxy.id+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lti.v2.toolproxy.id+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lti.v2.toolsettings+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lti.v2.toolsettings+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ims.lti.v2.toolsettings.simple+json + encoding: base64 + xrefs: + person: + - Lisa_Mattson + template: + - application/vnd.ims.lti.v2.toolsettings.simple+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.informedcontrol.rms+xml + encoding: base64 + xrefs: + person: + - Mark_Wahl + template: + - application/vnd.informedcontrol.rms+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.informix-visionary + encoding: base64 + obsolete: true + use-instead: application/vnd.visionary + xrefs: + person: + - Christopher_Gales + template: + - application/vnd.informix-visionary + notes: + - "(OBSOLETED in favor of application/vnd.visionary)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.infotech.project + encoding: base64 + xrefs: + person: + - Charles_Engelke + template: + - application/vnd.infotech.project + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.infotech.project+xml + encoding: base64 + xrefs: + person: + - Charles_Engelke + template: + - application/vnd.infotech.project+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.innopath.wamp.notification + encoding: base64 + xrefs: + person: + - Takanori_Sudo + template: + - application/vnd.innopath.wamp.notification + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.insors.igm + friendly: + en: IOCOM Visimeet + encoding: base64 + extensions: + - igm + xrefs: + person: + - Jon_Swanson + template: + - application/vnd.insors.igm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intercon.formnet + friendly: + en: Intercon FormNet + encoding: base64 + extensions: + - xpw + - xpx + xrefs: + person: + - Tom_Gurak + template: + - application/vnd.intercon.formnet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intergeo + friendly: + en: Interactive Geometry Software + encoding: base64 + extensions: + - i2g + xrefs: + person: + - Yves_Kreis_2 + template: + - application/vnd.intergeo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intertrust.digibox + encoding: base64 + xrefs: + person: + - Luke_Tomasello + template: + - application/vnd.intertrust.digibox + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intertrust.nncp + encoding: base64 + xrefs: + person: + - Luke_Tomasello + template: + - application/vnd.intertrust.nncp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intu.qbo + friendly: + en: Open Financial Exchange + encoding: base64 + extensions: + - qbo + xrefs: + person: + - Greg_Scratchley + template: + - application/vnd.intu.qbo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.intu.qfx + friendly: + en: Quicken + encoding: base64 + extensions: + - qfx + xrefs: + person: + - Greg_Scratchley + template: + - application/vnd.intu.qfx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.catalogitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.catalogitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.conceptitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.conceptitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.knowledgeitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.knowledgeitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.newsitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.newsitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.newsmessage+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.newsmessage+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.packageitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.packageitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iptc.g2.planningitem+xml + encoding: base64 + xrefs: + person: + - Michael_Steidl + template: + - application/vnd.iptc.g2.planningitem+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ipunplugged.rcprofile + friendly: + en: IP Unplugged Roaming Client + encoding: base64 + extensions: + - rcprofile + xrefs: + person: + - Per_Ersson + template: + - application/vnd.ipunplugged.rcprofile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.irepository.package+xml + friendly: + en: iRepository / Lucidoc Editor + encoding: base64 + extensions: + - irp + xrefs: + person: + - Martin_Knowles + template: + - application/vnd.irepository.package+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.is-xpr + friendly: + en: Express by Infoseek + encoding: base64 + extensions: + - xpr + xrefs: + person: + - Satish_Navarajan + template: + - application/vnd.is-xpr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.isac.fcs + friendly: + en: International Society for Advancement of Cytometry + encoding: base64 + extensions: + - fcs + xrefs: + person: + - Ryan_Brinkman + template: + - application/vnd.isac.fcs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.iso11783-10+zip + encoding: base64 + xrefs: + person: + - Frank_Wiebeler + template: + - application/vnd.iso11783-10+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.jam + friendly: + en: Lightspeed Audio Lab + encoding: base64 + extensions: + - jam + xrefs: + person: + - Brijesh_Kumar + template: + - application/vnd.jam + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-directory-service + encoding: base64 + xrefs: + person: + - Kiyofusa_Fujii + template: + - application/vnd.japannet-directory-service + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-jpnstore-wakeup + encoding: base64 + xrefs: + person: + - Jun_Yoshitake + template: + - application/vnd.japannet-jpnstore-wakeup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-payment-wakeup + encoding: base64 + xrefs: + person: + - Kiyofusa_Fujii + template: + - application/vnd.japannet-payment-wakeup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-registration + encoding: base64 + xrefs: + person: + - Jun_Yoshitake + template: + - application/vnd.japannet-registration + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-registration-wakeup + encoding: base64 + xrefs: + person: + - Kiyofusa_Fujii + template: + - application/vnd.japannet-registration-wakeup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-setstore-wakeup + encoding: base64 + xrefs: + person: + - Jun_Yoshitake + template: + - application/vnd.japannet-setstore-wakeup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-verification + encoding: base64 + xrefs: + person: + - Jun_Yoshitake + template: + - application/vnd.japannet-verification + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.japannet-verification-wakeup + encoding: base64 + xrefs: + person: + - Kiyofusa_Fujii + template: + - application/vnd.japannet-verification-wakeup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.jcp.javame.midlet-rms + friendly: + en: Mobile Information Device Profile + encoding: base64 + extensions: + - rms + xrefs: + person: + - Mikhail_Gorshenev + template: + - application/vnd.jcp.javame.midlet-rms + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.jisp + friendly: + en: RhymBox + encoding: base64 + extensions: + - jisp + xrefs: + person: + - Sebastiaan_Deckers + template: + - application/vnd.jisp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.joost.joda-archive + friendly: + en: Joda Archive + encoding: base64 + extensions: + - joda + xrefs: + person: + - Joost + template: + - application/vnd.joost.joda-archive + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.jsk.isdn-ngn + encoding: base64 + xrefs: + person: + - Yokoyama_Kiyonobu + template: + - application/vnd.jsk.isdn-ngn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kahootz + friendly: + en: Kahootz + encoding: base64 + extensions: + - ktr + - ktz + xrefs: + person: + - Tim_Macdonald + template: + - application/vnd.kahootz + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.karbon + friendly: + en: KDE KOffice Office Suite - Karbon + encoding: base64 + extensions: + - karbon + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.karbon + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kchart + friendly: + en: KDE KOffice Office Suite - KChart + encoding: base64 + extensions: + - chrt + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kchart + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kformula + friendly: + en: KDE KOffice Office Suite - Kformula + encoding: base64 + extensions: + - kfo + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kformula + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kivio + friendly: + en: KDE KOffice Office Suite - Kivio + encoding: base64 + extensions: + - flw + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kivio + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kontour + friendly: + en: KDE KOffice Office Suite - Kontour + encoding: base64 + extensions: + - kon + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kontour + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kpresenter + friendly: + en: KDE KOffice Office Suite - Kpresenter + encoding: base64 + extensions: + - kpr + - kpt + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kpresenter + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kspread + friendly: + en: KDE KOffice Office Suite - Kspread + encoding: base64 + extensions: + - ksp + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kspread + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kde.kword + friendly: + en: KDE KOffice Office Suite - Kword + encoding: base64 + extensions: + - kwd + - kwt + xrefs: + person: + - David_Faure + template: + - application/vnd.kde.kword + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kenameaapp + friendly: + en: Kenamea App + encoding: base64 + extensions: + - htke + xrefs: + person: + - Dirk_DiGiorgio-Haag + template: + - application/vnd.kenameaapp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kidspiration + friendly: + en: Kidspiration + encoding: base64 + extensions: + - kia + xrefs: + person: + - Jack_Bennett + template: + - application/vnd.kidspiration + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Kinar + friendly: + en: Kinar Applications + encoding: base64 + extensions: + - kne + - knp + - sdf + xrefs: + person: + - Hemant_Thakkar + template: + - application/vnd.Kinar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.koan + friendly: + en: SSEYO Koan Play File + encoding: base64 + extensions: + - skd + - skm + - skp + - skt + xrefs: + person: + - Pete_Cole + template: + - application/vnd.koan + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.kodak-descriptor + friendly: + en: Kodak Storyshare + encoding: base64 + extensions: + - sse + xrefs: + person: + - Michael_J._Donahue + template: + - application/vnd.kodak-descriptor + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.las + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/vnd.las + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.las.las+json + encoding: base64 + xrefs: + person: + - Rob_Bailey + template: + - application/vnd.las.las+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.las.las+xml + friendly: + en: Laser App Enterprise + encoding: base64 + extensions: + - lasxml + xrefs: + person: + - Rob_Bailey + template: + - application/vnd.las.las+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.laszip + encoding: base64 + xrefs: + person: + - Bryan_Blank + - NCGIS + template: + - application/vnd.laszip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.leap+json + encoding: base64 + xrefs: + person: + - Mark_C_Fralick + template: + - application/vnd.leap+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.liberty-request+xml + encoding: base64 + xrefs: + person: + - Brett_McDowell + template: + - application/vnd.liberty-request+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.llamagraphics.life-balance.desktop + friendly: + en: Life Balance - Desktop Edition + encoding: base64 + extensions: + - lbd + xrefs: + person: + - Catherine_E._White + template: + - application/vnd.llamagraphics.life-balance.desktop + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.llamagraphics.life-balance.exchange+xml + friendly: + en: Life Balance - Exchange Format + encoding: base64 + extensions: + - lbe + xrefs: + person: + - Catherine_E._White + template: + - application/vnd.llamagraphics.life-balance.exchange+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.logipipe.circuit+zip + encoding: base64 + xrefs: + person: + - Victor_Kuchynsky + template: + - application/vnd.logipipe.circuit+zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.loom + encoding: base64 + xrefs: + person: + - Sten_Linnarsson + template: + - application/vnd.loom + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-1-2-3 + friendly: + en: Lotus 1-2-3 + encoding: base64 + extensions: + - wks + - '123' + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-1-2-3 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-approach + friendly: + en: Lotus Approach + encoding: base64 + extensions: + - apr + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-approach + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-freelance + friendly: + en: Lotus Freelance + encoding: base64 + extensions: + - pre + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-freelance + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-notes + friendly: + en: Lotus Notes + encoding: base64 + extensions: + - nsf + xrefs: + person: + - Michael_Laramie + template: + - application/vnd.lotus-notes + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-organizer + friendly: + en: Lotus Organizer + encoding: base64 + extensions: + - org + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-organizer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-screencam + friendly: + en: Lotus Screencam + encoding: base64 + extensions: + - scm + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-screencam + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.lotus-wordpro + friendly: + en: Lotus Wordpro + encoding: base64 + extensions: + - lwp + xrefs: + person: + - Paul_Wattenberger + template: + - application/vnd.lotus-wordpro + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.macports.portpkg + friendly: + en: MacPorts Port System + encoding: base64 + extensions: + - portpkg + xrefs: + person: + - James_Berry + template: + - application/vnd.macports.portpkg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mapbox-vector-tile + encoding: base64 + xrefs: + person: + - Blake_Thompson + template: + - application/vnd.mapbox-vector-tile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.marlin.drm.actiontoken+xml + encoding: base64 + xrefs: + person: + - Gary_Ellison + template: + - application/vnd.marlin.drm.actiontoken+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.marlin.drm.conftoken+xml + encoding: base64 + xrefs: + person: + - Gary_Ellison + template: + - application/vnd.marlin.drm.conftoken+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.marlin.drm.license+xml + encoding: base64 + xrefs: + person: + - Gary_Ellison + template: + - application/vnd.marlin.drm.license+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.marlin.drm.mdcf + encoding: base64 + xrefs: + person: + - Gary_Ellison + template: + - application/vnd.marlin.drm.mdcf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mason+json + encoding: base64 + xrefs: + person: + - Jorn_Wildt + template: + - application/vnd.mason+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.maxmind.maxmind-db + encoding: base64 + xrefs: + person: + - William_Stevenson + template: + - application/vnd.maxmind.maxmind-db + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mcd + friendly: + en: Micro CADAM Helix D&D + encoding: base64 + extensions: + - mcd + xrefs: + person: + - Tadashi_Gotoh + template: + - application/vnd.mcd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.medcalcdata + friendly: + en: MedCalc + encoding: base64 + extensions: + - mc1 + xrefs: + person: + - Frank_Schoonjans + template: + - application/vnd.medcalcdata + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mediastation.cdkey + friendly: + en: MediaRemote + encoding: base64 + extensions: + - cdkey + xrefs: + person: + - Henry_Flurry + template: + - application/vnd.mediastation.cdkey + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.meridian-slingshot + encoding: base64 + xrefs: + person: + - Eric_Wedel + template: + - application/vnd.meridian-slingshot + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.MFER + friendly: + en: Medical Waveform Encoding Format + encoding: base64 + extensions: + - mwf + xrefs: + person: + - Masaaki_Hirai + template: + - application/vnd.MFER + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mfmp + friendly: + en: Melody Format for Mobile Platform + encoding: base64 + extensions: + - mfm + xrefs: + person: + - Yukari_Ikeda + template: + - application/vnd.mfmp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.micro+json + encoding: base64 + xrefs: + person: + - Dali_Zheng + template: + - application/vnd.micro+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.micrografx.flo + friendly: + en: Micrografx + encoding: base64 + extensions: + - flo + xrefs: + person: + - Joe_Prevo + template: + - application/vnd.micrografx.flo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.micrografx.igx + friendly: + en: Micrografx iGrafx Professional + encoding: base64 + extensions: + - igx + xrefs: + person: + - Joe_Prevo + template: + - application/vnd.micrografx.igx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.microsoft.portable-executable + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.microsoft.portable-executable + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.microsoft.windows.thumbnail-cache + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.microsoft.windows.thumbnail-cache + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.miele+json + encoding: base64 + xrefs: + person: + - Nils_Langhammer + template: + - application/vnd.miele+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mif + friendly: + en: FrameMaker Interchange Format + encoding: base64 + extensions: + - mif + xrefs: + person: + - Mike_Wexler + template: + - application/vnd.mif + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.minisoft-hp3000-save + encoding: base64 + xrefs: + person: + - Chris_Bartram + template: + - application/vnd.minisoft-hp3000-save + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mitsubishi.misty-guard.trustweb + encoding: base64 + xrefs: + person: + - Tanaka + template: + - application/vnd.mitsubishi.misty-guard.trustweb + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.DAF + friendly: + en: Mobius Management Systems - UniversalArchive + encoding: base64 + extensions: + - daf + xrefs: + person: + - Allen_K._Kabayama + template: + - application/vnd.Mobius.DAF + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.DIS + friendly: + en: Mobius Management Systems - Distribution Database + encoding: base64 + extensions: + - dis + xrefs: + person: + - Allen_K._Kabayama + template: + - application/vnd.Mobius.DIS + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.MBK + friendly: + en: Mobius Management Systems - Basket file + encoding: base64 + extensions: + - mbk + xrefs: + person: + - Alex_Devasia + template: + - application/vnd.Mobius.MBK + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.MQY + friendly: + en: Mobius Management Systems - Query File + encoding: base64 + extensions: + - mqy + xrefs: + person: + - Alex_Devasia + template: + - application/vnd.Mobius.MQY + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.MSL + friendly: + en: Mobius Management Systems - Script Language + encoding: base64 + extensions: + - msl + xrefs: + person: + - Allen_K._Kabayama + template: + - application/vnd.Mobius.MSL + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.PLC + friendly: + en: Mobius Management Systems - Policy Definition Language File + encoding: base64 + extensions: + - plc + xrefs: + person: + - Allen_K._Kabayama + template: + - application/vnd.Mobius.PLC + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Mobius.TXF + friendly: + en: Mobius Management Systems - Topic Index File + encoding: base64 + extensions: + - txf + xrefs: + person: + - Allen_K._Kabayama + template: + - application/vnd.Mobius.TXF + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mophun.application + friendly: + en: Mophun VM + encoding: base64 + extensions: + - mpn + xrefs: + person: + - Bjorn_Wennerstrom + template: + - application/vnd.mophun.application + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mophun.certificate + friendly: + en: Mophun Certificate + encoding: base64 + extensions: + - mpc + xrefs: + person: + - Bjorn_Wennerstrom + template: + - application/vnd.mophun.certificate + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.adsi + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.adsi + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.fis + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.fis + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.gotap + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.gotap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.kmr + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.kmr + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.ttc + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.ttc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.flexsuite.wem + encoding: base64 + xrefs: + person: + - Mark_Patton + template: + - application/vnd.motorola.flexsuite.wem + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.motorola.iprm + encoding: base64 + xrefs: + person: + - Rafie_Shamsaasef + template: + - application/vnd.motorola.iprm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mozilla.xul+xml + friendly: + en: XUL - XML User Interface Language + encoding: base64 + extensions: + - xul + xrefs: + person: + - Braden_N_McDaniel + template: + - application/vnd.mozilla.xul+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-3mfdocument + encoding: base64 + xrefs: + person: + - Shawn_Maloney + template: + - application/vnd.ms-3mfdocument + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-artgalry + friendly: + en: Microsoft Artgalry + encoding: base64 + extensions: + - cil + xrefs: + person: + - Dean_Slawson + template: + - application/vnd.ms-artgalry + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-asf + encoding: base64 + extensions: + - asf + xrefs: + person: + - Eric_Fleischman + template: + - application/vnd.ms-asf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-cab-compressed + friendly: + en: Microsoft Cabinet File + encoding: base64 + extensions: + - cab + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.ms-cab-compressed + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-excel + friendly: + en: Microsoft Excel + encoding: base64 + extensions: + - xls + - xlt + - xla + - xlc + - xlm + - xlw + xrefs: + person: + - Sukvinder_S._Gill + template: + - application/vnd.ms-excel + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-excel.addin.macroEnabled.12 + friendly: + en: Microsoft Excel - Add-In File + encoding: base64 + extensions: + - xlam + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-excel.addin.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-excel.sheet.binary.macroEnabled.12 + friendly: + en: Microsoft Excel - Binary Workbook + encoding: base64 + extensions: + - xlsb + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-excel.sheet.binary.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-excel.sheet.macroEnabled.12 + friendly: + en: Microsoft Excel - Macro-Enabled Workbook + encoding: base64 + extensions: + - xlsm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-excel.sheet.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-excel.template.macroEnabled.12 + friendly: + en: Microsoft Excel - Macro-Enabled Template File + encoding: base64 + extensions: + - xltm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-excel.template.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-fontobject + friendly: + en: Microsoft Embedded OpenType + encoding: base64 + extensions: + - eot + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.ms-fontobject + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-htmlhelp + friendly: + en: Microsoft Html Help File + encoding: base64 + extensions: + - chm + xrefs: + person: + - Anatoly_Techtonik + template: + - application/vnd.ms-htmlhelp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-ims + friendly: + en: Microsoft Class Server + encoding: base64 + extensions: + - ims + xrefs: + person: + - Eric_Ledoux + template: + - application/vnd.ms-ims + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-lrm + friendly: + en: Microsoft Learning Resource Module + encoding: base64 + extensions: + - lrm + xrefs: + person: + - Eric_Ledoux + template: + - application/vnd.ms-lrm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-office.activeX+xml + encoding: base64 + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-office.activeX+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-officetheme + friendly: + en: Microsoft Office System Release Theme + encoding: base64 + extensions: + - thmx + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-officetheme + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-outlook + encoding: base64 + extensions: + - msg + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.ms-pki.seccat + friendly: + en: Microsoft Trust UI Provider - Security Catalog + encoding: base64 + extensions: + - cat + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.ms-pki.stl + friendly: + en: Microsoft Trust UI Provider - Certificate Trust Link + encoding: base64 + extensions: + - stl + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.ms-playready.initiator+xml + encoding: base64 + xrefs: + person: + - Daniel_Schneider + template: + - application/vnd.ms-playready.initiator+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint + friendly: + en: Microsoft PowerPoint + encoding: base64 + extensions: + - ppt + - pps + - pot + xrefs: + person: + - Sukvinder_S._Gill + template: + - application/vnd.ms-powerpoint + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint.addin.macroEnabled.12 + friendly: + en: Microsoft PowerPoint - Add-in file + encoding: base64 + extensions: + - ppam + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-powerpoint.addin.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint.presentation.macroEnabled.12 + friendly: + en: Microsoft PowerPoint - Macro-Enabled Presentation File + encoding: base64 + extensions: + - pptm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-powerpoint.presentation.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint.slide.macroEnabled.12 + friendly: + en: Microsoft PowerPoint - Macro-Enabled Open XML Slide + encoding: base64 + extensions: + - sldm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-powerpoint.slide.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint.slideshow.macroEnabled.12 + friendly: + en: Microsoft PowerPoint - Macro-Enabled Slide Show File + encoding: base64 + extensions: + - ppsm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-powerpoint.slideshow.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-powerpoint.template.macroEnabled.12 + friendly: + en: Micosoft PowerPoint - Macro-Enabled Template File + encoding: base64 + extensions: + - potm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-powerpoint.template.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-PrintDeviceCapabilities+xml + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-PrintDeviceCapabilities+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-PrintSchemaTicket+xml + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-PrintSchemaTicket+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-project + friendly: + en: Microsoft Project + encoding: base64 + extensions: + - mpp + - mpt + xrefs: + person: + - Sukvinder_S._Gill + template: + - application/vnd.ms-project + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-tnef + encoding: base64 + xrefs: + person: + - Sukvinder_S._Gill + template: + - application/vnd.ms-tnef + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-windows.devicepairing + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-windows.devicepairing + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-windows.nwprinting.oob + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-windows.nwprinting.oob + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-windows.printerpairing + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-windows.printerpairing + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-windows.wsd.oob + encoding: base64 + xrefs: + person: + - Justin_Hutchings + template: + - application/vnd.ms-windows.wsd.oob + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-wmdrm.lic-chlg-req + encoding: base64 + xrefs: + person: + - Kevin_Lau + template: + - application/vnd.ms-wmdrm.lic-chlg-req + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-wmdrm.lic-resp + encoding: base64 + xrefs: + person: + - Kevin_Lau + template: + - application/vnd.ms-wmdrm.lic-resp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-wmdrm.meter-chlg-req + encoding: base64 + xrefs: + person: + - Kevin_Lau + template: + - application/vnd.ms-wmdrm.meter-chlg-req + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-wmdrm.meter-resp + encoding: base64 + xrefs: + person: + - Kevin_Lau + template: + - application/vnd.ms-wmdrm.meter-resp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-word.document.macroEnabled.12 + friendly: + en: Micosoft Word - Macro-Enabled Document + encoding: base64 + extensions: + - docm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-word.document.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-word.template.macroEnabled.12 + friendly: + en: Micosoft Word - Macro-Enabled Template + encoding: base64 + extensions: + - dotm + xrefs: + person: + - Chris_Rae + template: + - application/vnd.ms-word.template.macroEnabled.12 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-works + friendly: + en: Microsoft Works + encoding: base64 + extensions: + - wcm + - wdb + - wks + - wps + xrefs: + person: + - Sukvinder_S._Gill + template: + - application/vnd.ms-works + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-wpl + friendly: + en: Microsoft Windows Media Player Playlist + encoding: base64 + extensions: + - wpl + xrefs: + person: + - Dan_Plastina + template: + - application/vnd.ms-wpl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ms-xpsdocument + friendly: + en: Microsoft XML Paper Specification + encoding: 8bit + extensions: + - xps + xrefs: + person: + - Jesse_McGatha + template: + - application/vnd.ms-xpsdocument + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.msa-disk-image + encoding: base64 + xrefs: + person: + - Thomas_Huth + template: + - application/vnd.msa-disk-image + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mseq + friendly: + en: 3GPP MSEQ File + encoding: base64 + extensions: + - mseq + xrefs: + person: + - Gwenael_Le_Bodic + template: + - application/vnd.mseq + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.msign + encoding: base64 + xrefs: + person: + - Malte_Borcherding + template: + - application/vnd.msign + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.multiad.creator + encoding: base64 + xrefs: + person: + - Steve_Mills + template: + - application/vnd.multiad.creator + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.multiad.creator.cif + encoding: base64 + xrefs: + person: + - Steve_Mills + template: + - application/vnd.multiad.creator.cif + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.music-niff + encoding: base64 + xrefs: + person: + - Tim_Butler + template: + - application/vnd.music-niff + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.musician + friendly: + en: MUsical Score Interpreted Code Invented for the ASCII designation of Notation + encoding: base64 + extensions: + - mus + xrefs: + person: + - Greg_Adams + template: + - application/vnd.musician + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.muvee.style + friendly: + en: Muvee Automatic Video Editing + encoding: base64 + extensions: + - msty + xrefs: + person: + - Chandrashekhara_Anantharamu + template: + - application/vnd.muvee.style + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.mynfc + encoding: base64 + extensions: + - taglet + xrefs: + person: + - Franck_Lefevre + template: + - application/vnd.mynfc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nacamar.ybrid+json + encoding: base64 + xrefs: + person: + - Sebastian_A._Weiss + template: + - application/vnd.nacamar.ybrid+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ncd.control + encoding: base64 + xrefs: + person: + - Lauri_Tarkkala + template: + - application/vnd.ncd.control + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ncd.reference + encoding: base64 + xrefs: + person: + - Lauri_Tarkkala + template: + - application/vnd.ncd.reference + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nearst.inv+json + encoding: base64 + xrefs: + person: + - Thomas_Schoffelen + template: + - application/vnd.nearst.inv+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nebumind.line + encoding: base64 + xrefs: + person: + - Andreas_Molzer + template: + - application/vnd.nebumind.line + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nervana + encoding: base64 + extensions: + - ent + - entity + - req + - request + - bkm + - kcm + xrefs: + person: + - Steve_Judkins + template: + - application/vnd.nervana + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.netfpx + encoding: base64 + xrefs: + person: + - Andy_Mutz + template: + - application/vnd.netfpx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.neurolanguage.nlu + friendly: + en: neuroLanguage + encoding: base64 + extensions: + - nlu + xrefs: + person: + - Dan_DuFeu + template: + - application/vnd.neurolanguage.nlu + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nimn + encoding: base64 + xrefs: + person: + - Amit_Kumar_Gupta + template: + - application/vnd.nimn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nintendo.nitro.rom + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.nintendo.nitro.rom + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nintendo.snes.rom + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.nintendo.snes.rom + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nitf + encoding: base64 + extensions: + - nitf + - ntf + xrefs: + person: + - Steve_Rogan + template: + - application/vnd.nitf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.noblenet-directory + friendly: + en: NobleNet Directory + encoding: base64 + extensions: + - nnd + xrefs: + person: + - Monty_Solomon + template: + - application/vnd.noblenet-directory + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.noblenet-sealer + friendly: + en: NobleNet Sealer + encoding: base64 + extensions: + - nns + xrefs: + person: + - Monty_Solomon + template: + - application/vnd.noblenet-sealer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.noblenet-web + friendly: + en: NobleNet Web + encoding: base64 + extensions: + - nnw + xrefs: + person: + - Monty_Solomon + template: + - application/vnd.noblenet-web + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.catalogs + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.catalogs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.conml+wbxml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.conml+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.conml+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.conml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.iptv.config+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.iptv.config+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.iSDS-radio-presets + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.iSDS-radio-presets + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.landmark+wbxml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.landmark+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.landmark+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.landmark+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.landmarkcollection+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.landmarkcollection+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.n-gage.ac+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.n-gage.ac+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.n-gage.data + friendly: + en: N-Gage Game Data + encoding: base64 + extensions: + - ngdat + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.n-gage.data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.n-gage.symbian.install + friendly: + en: N-Gage Game Installer + encoding: base64 + extensions: + - n-gage + obsolete: true + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.n-gage.symbian.install + notes: + - "(OBSOLETE; no replacement given)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.ncd + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.ncd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.ncd+xml + encoding: base64 + obsolete: true + use-instead: application/vnd.nokia.ncd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.pcd+wbxml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.pcd+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.pcd+xml + encoding: base64 + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.pcd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.radio-preset + friendly: + en: Nokia Radio Application - Preset + encoding: base64 + extensions: + - rpst + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.radio-preset + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.nokia.radio-presets + friendly: + en: Nokia Radio Application - Preset + encoding: base64 + extensions: + - rpss + xrefs: + person: + - Nokia + template: + - application/vnd.nokia.radio-presets + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.novadigm.EDM + friendly: + en: Novadigm's RADIA and EDM products + encoding: base64 + extensions: + - edm + xrefs: + person: + - Janine_Swenson + template: + - application/vnd.novadigm.EDM + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.novadigm.EDX + friendly: + en: Novadigm's RADIA and EDM products + encoding: base64 + extensions: + - edx + xrefs: + person: + - Janine_Swenson + template: + - application/vnd.novadigm.EDX + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.novadigm.EXT + friendly: + en: Novadigm's RADIA and EDM products + encoding: base64 + extensions: + - ext + xrefs: + person: + - Janine_Swenson + template: + - application/vnd.novadigm.EXT + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ntt-local.content-share + encoding: base64 + xrefs: + person: + - Akinori_Taya + template: + - application/vnd.ntt-local.content-share + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ntt-local.file-transfer + encoding: base64 + xrefs: + person: + - NTT-local + template: + - application/vnd.ntt-local.file-transfer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ntt-local.ogw_remote-access + encoding: base64 + xrefs: + person: + - NTT-local + template: + - application/vnd.ntt-local.ogw_remote-access + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ntt-local.sip-ta_remote + encoding: base64 + xrefs: + person: + - NTT-local + template: + - application/vnd.ntt-local.sip-ta_remote + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ntt-local.sip-ta_tcp_stream + encoding: base64 + xrefs: + person: + - NTT-local + template: + - application/vnd.ntt-local.sip-ta_tcp_stream + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.chart + friendly: + en: OpenDocument Chart + encoding: base64 + extensions: + - odc + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.chart + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.chart-template + friendly: + en: OpenDocument Chart Template + encoding: base64 + extensions: + - odc + - otc + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.chart-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.database + friendly: + en: OpenDocument Database + encoding: base64 + extensions: + - odb + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.database + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.formula + friendly: + en: OpenDocument Formula + encoding: base64 + extensions: + - odf + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.formula + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.formula-template + friendly: + en: OpenDocument Formula Template + encoding: base64 + extensions: + - odf + - odft + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.formula-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.graphics + friendly: + en: OpenDocument Graphics + encoding: base64 + extensions: + - odg + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.graphics + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.graphics-template + friendly: + en: OpenDocument Graphics Template + encoding: base64 + extensions: + - otg + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.graphics-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.image + friendly: + en: OpenDocument Image + encoding: base64 + extensions: + - odi + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.image + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.image-template + friendly: + en: OpenDocument Image Template + encoding: base64 + extensions: + - odi + - oti + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.image-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.presentation + friendly: + en: OpenDocument Presentation + encoding: base64 + extensions: + - odp + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.presentation + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.presentation-template + friendly: + en: OpenDocument Presentation Template + encoding: base64 + extensions: + - otp + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.presentation-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.spreadsheet + friendly: + en: OpenDocument Spreadsheet + encoding: base64 + extensions: + - ods + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.spreadsheet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.spreadsheet-template + friendly: + en: OpenDocument Spreadsheet Template + encoding: base64 + extensions: + - ots + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.spreadsheet-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.text + friendly: + en: OpenDocument Text + encoding: base64 + extensions: + - odt + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.text + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.text-master + friendly: + en: OpenDocument Text Master + encoding: base64 + extensions: + - odm + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.text-master + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.text-template + friendly: + en: OpenDocument Text Template + encoding: base64 + extensions: + - ott + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.text-template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oasis.opendocument.text-web + friendly: + en: Open Document Text Web + encoding: base64 + extensions: + - oth + xrefs: + person: + - OASIS + - Svante_Schubert + template: + - application/vnd.oasis.opendocument.text-web + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.obn + encoding: base64 + xrefs: + person: + - Matthias_Hessling + template: + - application/vnd.obn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ocf+cbor + encoding: base64 + xrefs: + person: + - Michael_Koster + template: + - application/vnd.ocf+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oci.image.manifest.v1+json + encoding: base64 + xrefs: + person: + - Steven_Lasker + template: + - application/vnd.oci.image.manifest.v1+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oftn.l10n+json + encoding: base64 + xrefs: + person: + - Eli_Grey + template: + - application/vnd.oftn.l10n+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.contentaccessdownload+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.contentaccessdownload+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.contentaccessstreaming+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.contentaccessstreaming+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.cspg-hexbinary + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.cspg-hexbinary + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.dae.svg+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.dae.svg+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.dae.xhtml+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.dae.xhtml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.mippvcontrolmessage+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.mippvcontrolmessage+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.pae.gem + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.pae.gem + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.spdiscovery+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.spdiscovery+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.spdlist+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.spdlist+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.ueprofile+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.ueprofile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oipf.userprofile+xml + encoding: base64 + xrefs: + person: + - Claire_DEsclercs + template: + - application/vnd.oipf.userprofile+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.olpc-sugar + friendly: + en: Sugar Linux Application Bundle + encoding: base64 + extensions: + - xo + xrefs: + person: + - John_Palmieri + template: + - application/vnd.olpc-sugar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma-scws-config + encoding: base64 + xrefs: + person: + - Ilan_Mahalal + template: + - application/vnd.oma-scws-config + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma-scws-http-request + encoding: base64 + xrefs: + person: + - Ilan_Mahalal + template: + - application/vnd.oma-scws-http-request + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma-scws-http-response + encoding: base64 + xrefs: + person: + - Ilan_Mahalal + template: + - application/vnd.oma-scws-http-response + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.associated-procedure-parameter+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.associated-procedure-parameter+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.drm-trigger+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.drm-trigger+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.imd+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.imd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.ltkm + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.ltkm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.notification+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.notification+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.provisioningtrigger + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.provisioningtrigger + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.sgboot + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.sgboot + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.sgdd+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.sgdd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.sgdu + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.sgdu + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.simple-symbol-container + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.simple-symbol-container + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.smartcard-trigger+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.smartcard-trigger+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.sprov+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.sprov+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.bcast.stkm + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.bcast.stkm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.cab-address-book+xml + encoding: base64 + xrefs: + person: + - Hao_Wang + - OMA + template: + - application/vnd.oma.cab-address-book+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.cab-feature-handler+xml + encoding: base64 + xrefs: + person: + - Hao_Wang + - OMA + template: + - application/vnd.oma.cab-feature-handler+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.cab-pcc+xml + encoding: base64 + xrefs: + person: + - Hao_Wang + - OMA + template: + - application/vnd.oma.cab-pcc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.cab-subs-invite+xml + encoding: base64 + xrefs: + person: + - Hao_Wang + - OMA + template: + - application/vnd.oma.cab-subs-invite+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.cab-user-prefs+xml + encoding: base64 + xrefs: + person: + - Hao_Wang + - OMA + template: + - application/vnd.oma.cab-user-prefs+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.dcd + encoding: base64 + xrefs: + person: + - Avi_Primo + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.dcd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.dcdc + encoding: base64 + xrefs: + person: + - Avi_Primo + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.dcdc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.dd2+xml + friendly: + en: OMA Download Agents + encoding: base64 + extensions: + - dd2 + xrefs: + person: + - Jun_Sato + - Open_Mobile_Alliance_BAC_DLDRM_Working_Group + template: + - application/vnd.oma.dd2+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.drm.risd+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Uwe_Rauschenbach + template: + - application/vnd.oma.drm.risd+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.group-usage-list+xml + encoding: base64 + xrefs: + person: + - OMA_Presence_and_Availability_PAG_Working_Group + - Sean_Kelley + template: + - application/vnd.oma.group-usage-list+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.lwm2m+cbor + encoding: base64 + xrefs: + person: + - John_Mudge + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.lwm2m+cbor + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.lwm2m+json + encoding: base64 + xrefs: + person: + - John_Mudge + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.lwm2m+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.lwm2m+tlv + encoding: base64 + xrefs: + person: + - John_Mudge + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.lwm2m+tlv + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.pal+xml + encoding: base64 + xrefs: + person: + - Brian_McColgan + - Open_Mobile_Naming_Authority + template: + - application/vnd.oma.pal+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.poc.detailed-progress-report+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + template: + - application/vnd.oma.poc.detailed-progress-report+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.poc.final-report+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + template: + - application/vnd.oma.poc.final-report+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.poc.groups+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + - Sean_Kelley + template: + - application/vnd.oma.poc.groups+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.poc.invocation-descriptor+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + template: + - application/vnd.oma.poc.invocation-descriptor+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.poc.optimized-progress-report+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + template: + - application/vnd.oma.poc.optimized-progress-report+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.push + encoding: base64 + xrefs: + person: + - Bryan_Sullivan + - OMA + template: + - application/vnd.oma.push + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.scidm.messages+xml + encoding: base64 + xrefs: + person: + - Open_Mobile_Naming_Authority + - Wenjun_Zeng + template: + - application/vnd.oma.scidm.messages+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oma.xcap-directory+xml + encoding: base64 + xrefs: + person: + - OMA_Presence_and_Availability_PAG_Working_Group + - Sean_Kelley + template: + - application/vnd.oma.xcap-directory+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.omads-email+xml + encoding: base64 + xrefs: + person: + - OMA_Data_Synchronization_Working_Group + template: + - application/vnd.omads-email+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.omads-file+xml + encoding: base64 + xrefs: + person: + - OMA_Data_Synchronization_Working_Group + template: + - application/vnd.omads-file+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.omads-folder+xml + encoding: base64 + xrefs: + person: + - OMA_Data_Synchronization_Working_Group + template: + - application/vnd.omads-folder+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.omaloc-supl-init + encoding: base64 + xrefs: + person: + - Julien_Grange + template: + - application/vnd.omaloc-supl-init + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepager + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepager + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepagertamp + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepagertamp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepagertamx + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepagertamx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepagertat + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepagertat + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepagertatp + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepagertatp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.onepagertatx + encoding: base64 + xrefs: + person: + - Nathan_Black + template: + - application/vnd.onepagertatx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openblox.game+xml + encoding: base64 + xrefs: + person: + - Mark_Otaris + template: + - application/vnd.openblox.game+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openblox.game-binary + encoding: base64 + xrefs: + person: + - Mark_Otaris + template: + - application/vnd.openblox.game-binary + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openeye.oeb + encoding: base64 + xrefs: + person: + - Craig_Bruce + template: + - application/vnd.openeye.oeb + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openofficeorg.extension + friendly: + en: Open Office Extension + encoding: base64 + extensions: + - oxt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openstreetmap.data+xml + encoding: base64 + xrefs: + person: + - Paul_Norman + template: + - application/vnd.openstreetmap.data+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.opentimestamps.ots + encoding: base64 + xrefs: + person: + - Peter_Todd + template: + - application/vnd.opentimestamps.ots + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.custom-properties+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.custom-properties+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.customXmlProperties+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.customXmlProperties+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawing+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawing+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.chart+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.chart+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.extended-properties+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.extended-properties+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.comments+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.comments+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.presentation + friendly: + en: Microsoft Office - OOXML - Presentation + encoding: base64 + extensions: + - pptx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.presentation + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.presProps+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.presProps+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slide + friendly: + en: Microsoft Office - OOXML - Presentation (Slide) + encoding: base64 + extensions: + - sldx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slide + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slide+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slideshow + friendly: + en: Microsoft Office - OOXML - Presentation (Slideshow) + encoding: base64 + extensions: + - ppsx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slideshow + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.tags+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.tags+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.template + friendly: + en: Microsoft Office - OOXML - Presentation Template + encoding: base64 + extensions: + - potx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.template.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.template.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + friendly: + en: Microsoft Office - OOXML - Spreadsheet + encoding: base64 + extensions: + - xlsx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.template + friendly: + en: Microsoft Office - OOXML - Spreadsheet Teplate + encoding: base64 + extensions: + - xltx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.theme+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.theme+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.themeOverride+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.themeOverride+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.vmlDrawing + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.vmlDrawing + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document + friendly: + en: Microsoft Office - OOXML - Word Document + encoding: base64 + extensions: + - docx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.document + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.template + friendly: + en: Microsoft Office - OOXML - Word Document Template + encoding: base64 + extensions: + - dotx + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.template + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-package.core-properties+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-package.core-properties+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.openxmlformats-package.relationships+xml + encoding: base64 + xrefs: + person: + - Makoto_Murata + template: + - application/vnd.openxmlformats-package.relationships+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oracle.resource+json + encoding: base64 + xrefs: + person: + - Ning_Dong + template: + - application/vnd.oracle.resource+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.orange.indata + encoding: base64 + xrefs: + person: + - CHATRAS_Bruno + template: + - application/vnd.orange.indata + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.osa.netdeploy + encoding: base64 + xrefs: + person: + - Steven_Klos + template: + - application/vnd.osa.netdeploy + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.osgeo.mapguide.package + friendly: + en: MapGuide DBXML + encoding: base64 + extensions: + - mgp + xrefs: + person: + - Jason_Birch + template: + - application/vnd.osgeo.mapguide.package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.osgi.bundle + encoding: base64 + xrefs: + person: + - Peter_Kriens + template: + - application/vnd.osgi.bundle + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.osgi.dp + friendly: + en: OSGi Deployment Package + encoding: base64 + extensions: + - dp + xrefs: + person: + - Peter_Kriens + template: + - application/vnd.osgi.dp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.osgi.subsystem + encoding: base64 + extensions: + - esa + xrefs: + person: + - Peter_Kriens + template: + - application/vnd.osgi.subsystem + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.otps.ct-kip+xml + encoding: base64 + xrefs: + person: + - Magnus_Nystrom + template: + - application/vnd.otps.ct-kip+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.oxli.countgraph + encoding: base64 + xrefs: + person: + - C._Titus_Brown + template: + - application/vnd.oxli.countgraph + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pagerduty+json + encoding: base64 + xrefs: + person: + - Steve_Rice + template: + - application/vnd.pagerduty+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.palm + friendly: + en: PalmOS Data + encoding: base64 + extensions: + - prc + - pdb + - pqa + - oprc + xrefs: + person: + - Gavin_Peacock + template: + - application/vnd.palm + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.panoply + encoding: base64 + xrefs: + person: + - Natarajan_Balasundara + template: + - application/vnd.panoply + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.paos.xml + encoding: base64 + xrefs: + person: + - John_Kemp + template: + - application/vnd.paos.xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.patentdive + encoding: base64 + xrefs: + person: + - Christian_Trosclair + template: + - application/vnd.patentdive + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.patientecommsdoc + encoding: base64 + xrefs: + person: + - Andrew_David_Kendall + template: + - application/vnd.patientecommsdoc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pawaafile + friendly: + en: PawaaFILE + encoding: base64 + extensions: + - paw + xrefs: + person: + - Prakash_Baskaran + template: + - application/vnd.pawaafile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pcos + encoding: base64 + xrefs: + person: + - Slawomir_Lisznianski + template: + - application/vnd.pcos + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pg.format + friendly: + en: Proprietary P&G Standard Reporting System + encoding: base64 + extensions: + - str + xrefs: + person: + - April_Gandert + template: + - application/vnd.pg.format + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pg.osasli + friendly: + en: Proprietary P&G Standard Reporting System + encoding: base64 + extensions: + - ei6 + xrefs: + person: + - April_Gandert + template: + - application/vnd.pg.osasli + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.piaccess.application-licence + encoding: base64 + xrefs: + person: + - Lucas_Maneos + template: + - application/vnd.piaccess.application-licence + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.picsel + friendly: + en: Pcsel eFIF File + encoding: base64 + extensions: + - efif + xrefs: + person: + - Giuseppe_Naccarato + template: + - application/vnd.picsel + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pmi.widget + friendly: + en: Qualcomm's Plaza Mobile Internet + encoding: base64 + extensions: + - wg + xrefs: + person: + - Rhys_Lewis + template: + - application/vnd.pmi.widget + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.poc.group-advertisement+xml + encoding: base64 + xrefs: + person: + - OMA_Push_to_Talk_over_Cellular_POC_Working_Group + - Sean_Kelley + template: + - application/vnd.poc.group-advertisement+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pocketlearn + friendly: + en: PocketLearn Viewers + encoding: base64 + extensions: + - plf + xrefs: + person: + - Jorge_Pando + template: + - application/vnd.pocketlearn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder6 + friendly: + en: PowerBuilder + encoding: base64 + extensions: + - pbd + xrefs: + person: + - David_Guy + template: + - application/vnd.powerbuilder6 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder6-s + encoding: base64 + xrefs: + person: + - David_Guy + template: + - application/vnd.powerbuilder6-s + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder7 + encoding: base64 + xrefs: + person: + - Reed_Shilts + template: + - application/vnd.powerbuilder7 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder7-s + encoding: base64 + xrefs: + person: + - Reed_Shilts + template: + - application/vnd.powerbuilder7-s + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder75 + encoding: base64 + xrefs: + person: + - Reed_Shilts + template: + - application/vnd.powerbuilder75 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.powerbuilder75-s + encoding: base64 + xrefs: + person: + - Reed_Shilts + template: + - application/vnd.powerbuilder75-s + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.preminet + encoding: base64 + xrefs: + person: + - Juoko_Tenhunen + template: + - application/vnd.preminet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.previewsystems.box + friendly: + en: Preview Systems ZipLock/VBox + encoding: base64 + extensions: + - box + xrefs: + person: + - Roman_Smolgovsky + template: + - application/vnd.previewsystems.box + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.proteus.magazine + friendly: + en: EFI Proteus + encoding: base64 + extensions: + - mgz + xrefs: + person: + - Pete_Hoch + template: + - application/vnd.proteus.magazine + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.psfs + encoding: base64 + xrefs: + person: + - Kristopher_Durski + template: + - application/vnd.psfs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.publishare-delta-tree + friendly: + en: PubliShare Objects + encoding: base64 + extensions: + - qps + xrefs: + person: + - Oren_Ben-Kiki + template: + - application/vnd.publishare-delta-tree + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pvi.ptid1 + friendly: + en: Princeton Video Image + encoding: base64 + extensions: + - pti + - ptid + xrefs: + person: + - Charles_P._Lamb + template: + - application/vnd.pvi.ptid1 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pwg-multiplexed + encoding: base64 + xrefs: + rfc: + - rfc3391 + template: + - application/vnd.pwg-multiplexed + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.pwg-xhtml-print+xml + encoding: base64 + xrefs: + person: + - Don_Wright + template: + - application/vnd.pwg-xhtml-print+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.qualcomm.brew-app-res + encoding: base64 + xrefs: + person: + - Glenn_Forrester + template: + - application/vnd.qualcomm.brew-app-res + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.quarantainenet + encoding: base64 + xrefs: + person: + - Casper_Joost_Eyckelhof + template: + - application/vnd.quarantainenet + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.Quark.QuarkXPress + friendly: + en: QuarkXPress + encoding: 8bit + extensions: + - qxd + - qxt + - qwd + - qwt + - qxl + - qxb + xrefs: + person: + - Hannes_Scheidler + template: + - application/vnd.Quark.QuarkXPress + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.quobject-quoxdocument + encoding: base64 + xrefs: + person: + - Matthias_Ludwig + template: + - application/vnd.quobject-quoxdocument + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.moml+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.moml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-audit+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-audit+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-audit-conf+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-audit-conf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-audit-conn+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-audit-conn+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-audit-dialog+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-audit-dialog+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-audit-stream+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-audit-stream+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-conf+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-conf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-base+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-base+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-fax-detect+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-fax-detect+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-fax-sendrecv+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-fax-sendrecv+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-group+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-group+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-speech+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-speech+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.radisys.msml-dialog-transform+xml + encoding: base64 + xrefs: + rfc: + - rfc5707 + template: + - application/vnd.radisys.msml-dialog-transform+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rainstor.data + encoding: base64 + xrefs: + person: + - Kevin_Crook + template: + - application/vnd.rainstor.data + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rapid + encoding: base64 + xrefs: + person: + - Etay_Szekely + template: + - application/vnd.rapid + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rar + encoding: base64 + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.rar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.realvnc.bed + friendly: + en: RealVNC + encoding: base64 + extensions: + - bed + xrefs: + person: + - Nick_Reeves + template: + - application/vnd.realvnc.bed + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.recordare.musicxml + friendly: + en: Recordare Applications + encoding: base64 + extensions: + - mxl + xrefs: + person: + - W3C_Music_Notation_Community_Group + template: + - application/vnd.recordare.musicxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.recordare.musicxml+xml + friendly: + en: Recordare Applications + encoding: base64 + extensions: + - musicxml + xrefs: + person: + - W3C_Music_Notation_Community_Group + template: + - application/vnd.recordare.musicxml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.RenLearn.rlprint + encoding: base64 + xrefs: + person: + - James_Wick + template: + - application/vnd.RenLearn.rlprint + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.resilient.logic + encoding: base64 + xrefs: + person: + - Benedikt_Muessig + template: + - application/vnd.resilient.logic + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.restful+json + encoding: base64 + xrefs: + person: + - Stephen_Mizell + template: + - application/vnd.restful+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rig.cryptonote + friendly: + en: CryptoNote + encoding: base64 + extensions: + - cryptonote + xrefs: + person: + - Ken_Jibiki + template: + - application/vnd.rig.cryptonote + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rim.cod + friendly: + en: Blackberry COD File + encoding: base64 + extensions: + - cod + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.rn-realmedia + friendly: + en: RealMedia + encoding: base64 + extensions: + - rm + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.rn-realmedia-vbr + encoding: base64 + extensions: + - rmvb + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.route66.link66+xml + friendly: + en: ROUTE 66 Location Based Services + encoding: base64 + extensions: + - link66 + xrefs: + person: + - Sybren_Kikstra + template: + - application/vnd.route66.link66+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.rs-274x + encoding: base64 + xrefs: + person: + - Lee_Harding + template: + - application/vnd.rs-274x + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ruckus.download + encoding: base64 + xrefs: + person: + - Jerry_Harris + template: + - application/vnd.ruckus.download + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.s3sms + encoding: base64 + xrefs: + person: + - Lauri_Tarkkala + template: + - application/vnd.s3sms + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sailingtracker.track + friendly: + en: SailingTracker + encoding: base64 + extensions: + - st + xrefs: + person: + - Heikki_Vesalainen + template: + - application/vnd.sailingtracker.track + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sar + encoding: base64 + xrefs: + person: + - Markus_Strehle + template: + - application/vnd.sar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sbm.cid + encoding: base64 + xrefs: + person: + - Shinji_Kusakari + template: + - application/vnd.sbm.cid + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sbm.mid2 + encoding: base64 + xrefs: + person: + - Masanori_Murai + template: + - application/vnd.sbm.mid2 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.scribus + encoding: base64 + xrefs: + person: + - Craig_Bradney + template: + - application/vnd.scribus + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.3df + encoding: base64 + xrefs: + person: + - John_Kwan + template: + - application/vnd.sealed.3df + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.csf + encoding: base64 + xrefs: + person: + - John_Kwan + template: + - application/vnd.sealed.csf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.doc + encoding: base64 + extensions: + - sdoc + - sdo + - s1w + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealed.doc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.eml + encoding: base64 + extensions: + - seml + - sem + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealed.eml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.mht + encoding: base64 + extensions: + - smht + - smh + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealed.mht + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.net + encoding: base64 + xrefs: + person: + - Martin_Lambert + template: + - application/vnd.sealed.net + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.ppt + encoding: base64 + extensions: + - sppt + - spp + - s1p + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealed.ppt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.tiff + encoding: base64 + xrefs: + person: + - John_Kwan + - Martin_Lambert + template: + - application/vnd.sealed.tiff + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealed.xls + encoding: base64 + extensions: + - sxls + - sxl + - s1e + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealed.xls + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealedmedia.softseal.html + encoding: base64 + extensions: + - stml + - stm + - s1h + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealedmedia.softseal.html + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sealedmedia.softseal.pdf + encoding: base64 + extensions: + - spdf + - spd + - s1a + xrefs: + person: + - David_Petersen + template: + - application/vnd.sealedmedia.softseal.pdf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.seemail + friendly: + en: SeeMail + encoding: base64 + extensions: + - see + xrefs: + person: + - Steve_Webb + template: + - application/vnd.seemail + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.seis+json + encoding: base64 + xrefs: + person: + - ICT_Manager + template: + - application/vnd.seis+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sema + friendly: + en: Secured eMail + encoding: base64 + extensions: + - sema + xrefs: + person: + - Anders_Hansson + template: + - application/vnd.sema + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.semd + friendly: + en: Secured eMail + encoding: base64 + extensions: + - semd + xrefs: + person: + - Anders_Hansson + template: + - application/vnd.semd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.semf + friendly: + en: Secured eMail + encoding: base64 + extensions: + - semf + xrefs: + person: + - Anders_Hansson + template: + - application/vnd.semf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shade-save-file + encoding: base64 + xrefs: + person: + - Connor_Horman + template: + - application/vnd.shade-save-file + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shana.informed.formdata + friendly: + en: Shana Informed Filler + encoding: base64 + extensions: + - ifm + xrefs: + person: + - Guy_Selzler + template: + - application/vnd.shana.informed.formdata + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shana.informed.formtemplate + friendly: + en: Shana Informed Filler + encoding: base64 + extensions: + - itp + xrefs: + person: + - Guy_Selzler + template: + - application/vnd.shana.informed.formtemplate + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shana.informed.interchange + friendly: + en: Shana Informed Filler + encoding: base64 + extensions: + - iif + xrefs: + person: + - Guy_Selzler + template: + - application/vnd.shana.informed.interchange + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shana.informed.package + friendly: + en: Shana Informed Filler + encoding: base64 + extensions: + - ipk + xrefs: + person: + - Guy_Selzler + template: + - application/vnd.shana.informed.package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shootproof+json + encoding: base64 + xrefs: + person: + - Ben_Ramsey + template: + - application/vnd.shootproof+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shopkick+json + encoding: base64 + xrefs: + person: + - Ronald_Jacobs + template: + - application/vnd.shopkick+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shp + encoding: base64 + xrefs: + person: + - Mi_Tar + template: + - application/vnd.shp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.shx + encoding: base64 + xrefs: + person: + - Mi_Tar + template: + - application/vnd.shx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sigrok.session + encoding: base64 + xrefs: + person: + - Uwe_Hermann + template: + - application/vnd.sigrok.session + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.SimTech-MindMapper + friendly: + en: SimTech MindMapper + encoding: base64 + extensions: + - twd + - twds + xrefs: + person: + - Patrick_Koh + template: + - application/vnd.SimTech-MindMapper + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.siren+json + encoding: base64 + xrefs: + person: + - Kevin_Swiber + template: + - application/vnd.siren+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.smaf + friendly: + en: SMAF File + encoding: base64 + extensions: + - mmf + xrefs: + person: + - Hiroaki_Takahashi + template: + - application/vnd.smaf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.smart.notebook + encoding: base64 + xrefs: + person: + - Jonathan_Neitz + template: + - application/vnd.smart.notebook + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.smart.teacher + friendly: + en: SMART Technologies Apps + encoding: base64 + extensions: + - teacher + xrefs: + person: + - Michael_Boyle + template: + - application/vnd.smart.teacher + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.snesdev-page-table + encoding: base64 + xrefs: + person: + - Connor_Horman + template: + - application/vnd.snesdev-page-table + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.software602.filler.form+xml + encoding: base64 + xrefs: + person: + - Jakub_Hytka + - Martin_Vondrous + template: + - application/vnd.software602.filler.form+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.software602.filler.form-xml-zip + encoding: base64 + xrefs: + person: + - Jakub_Hytka + - Martin_Vondrous + template: + - application/vnd.software602.filler.form-xml-zip + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.solent.sdkm+xml + friendly: + en: SudokuMagic + encoding: base64 + extensions: + - sdkd + - sdkm + xrefs: + person: + - Cliff_Gauntlett + template: + - application/vnd.solent.sdkm+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.spotfire.dxp + friendly: + en: TIBCO Spotfire + encoding: base64 + extensions: + - dxp + xrefs: + person: + - Stefan_Jernberg + template: + - application/vnd.spotfire.dxp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.spotfire.sfs + friendly: + en: TIBCO Spotfire + encoding: base64 + extensions: + - sfs + xrefs: + person: + - Stefan_Jernberg + template: + - application/vnd.spotfire.sfs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sqlite3 + encoding: base64 + xrefs: + person: + - Clemens_Ladisch + template: + - application/vnd.sqlite3 + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sss-cod + encoding: base64 + xrefs: + person: + - Asang_Dani + template: + - application/vnd.sss-cod + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sss-dtf + encoding: base64 + xrefs: + person: + - Eric_Bruno + template: + - application/vnd.sss-dtf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sss-ntf + encoding: base64 + xrefs: + person: + - Eric_Bruno + template: + - application/vnd.sss-ntf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.calc + friendly: + en: StarOffice - Calc + encoding: base64 + extensions: + - sdc + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.chart + encoding: base64 + extensions: + - sds + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.draw + friendly: + en: StarOffice - Draw + encoding: base64 + extensions: + - sda + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.impress + friendly: + en: StarOffice - Impress + encoding: base64 + extensions: + - sdd + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.math + friendly: + en: StarOffice - Math + encoding: base64 + extensions: + - sdf + - smf + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.writer + friendly: + en: StarOffice - Writer + encoding: base64 + extensions: + - sdw + - vor + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stardivision.writer-global + friendly: + en: StarOffice - Writer (Global) + encoding: base64 + extensions: + - sgl + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.stepmania.package + encoding: base64 + extensions: + - smzip + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.stepmania.package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.stepmania.stepchart + friendly: + en: StepMania + encoding: base64 + extensions: + - sm + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.stepmania.stepchart + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.street-stream + encoding: base64 + xrefs: + person: + - Glenn_Levitt + template: + - application/vnd.street-stream + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sun.wadl+xml + encoding: base64 + xrefs: + person: + - Marc_Hadley + template: + - application/vnd.sun.wadl+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.calc + friendly: + en: OpenOffice - Calc (Spreadsheet) + encoding: base64 + extensions: + - sxc + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.calc.template + friendly: + en: OpenOffice - Calc Template (Spreadsheet) + encoding: base64 + extensions: + - stc + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.draw + friendly: + en: OpenOffice - Draw (Graphics) + encoding: base64 + extensions: + - sxd + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.draw.template + friendly: + en: OpenOffice - Draw Template (Graphics) + encoding: base64 + extensions: + - std + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.impress + friendly: + en: OpenOffice - Impress (Presentation) + encoding: base64 + extensions: + - sxi + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.impress.template + friendly: + en: OpenOffice - Impress Template (Presentation) + encoding: base64 + extensions: + - sti + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.math + friendly: + en: OpenOffice - Math (Formula) + encoding: base64 + extensions: + - sxm + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.writer + friendly: + en: OpenOffice - Writer (Text - HTML) + encoding: base64 + extensions: + - sxw + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.writer.global + friendly: + en: OpenOffice - Writer (Text - HTML) + encoding: base64 + extensions: + - sxg + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sun.xml.writer.template + friendly: + en: OpenOffice - Writer Template (Text - HTML) + encoding: base64 + extensions: + - stw + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.sus-calendar + friendly: + en: ScheduleUs + encoding: base64 + extensions: + - sus + - susp + xrefs: + person: + - Jonathan_Niedfeldt + template: + - application/vnd.sus-calendar + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.svd + friendly: + en: SourceView Document + encoding: base64 + extensions: + - svd + xrefs: + person: + - Scott_Becker + template: + - application/vnd.svd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.swiftview-ics + encoding: base64 + xrefs: + person: + - Glenn_Widener + template: + - application/vnd.swiftview-ics + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.sycle+xml + encoding: base64 + xrefs: + person: + - Johann_Terblanche + template: + - application/vnd.sycle+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syft+json + encoding: base64 + xrefs: + person: + - Dan_Luhring + template: + - application/vnd.syft+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.symbian.install + friendly: + en: Symbian Install Package + encoding: base64 + extensions: + - sis + - sisx + registered: false +- !ruby/object:MIME::Type + content-type: application/vnd.syncml+xml + friendly: + en: SyncML + encoding: base64 + extensions: + - xsm + xrefs: + person: + - OMA_Data_Synchronization_Working_Group + template: + - application/vnd.syncml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dm+wbxml + friendly: + en: SyncML - Device Management + encoding: base64 + extensions: + - bdm + xrefs: + person: + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dm+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dm+xml + friendly: + en: SyncML - Device Management + encoding: base64 + extensions: + - xdm + xrefs: + person: + - Bindu_Rama_Rao + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dm+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dm.notification + encoding: base64 + xrefs: + person: + - OMA-DM_Work_Group + - Peter_Thompson + template: + - application/vnd.syncml.dm.notification + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dmddf+wbxml + encoding: base64 + xrefs: + person: + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dmddf+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dmddf+xml + encoding: base64 + xrefs: + person: + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dmddf+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dmtnds+wbxml + encoding: base64 + xrefs: + person: + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dmtnds+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.dmtnds+xml + encoding: base64 + xrefs: + person: + - OMA-DM_Work_Group + template: + - application/vnd.syncml.dmtnds+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.syncml.ds.notification + encoding: base64 + xrefs: + person: + - OMA_Data_Synchronization_Working_Group + template: + - application/vnd.syncml.ds.notification + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tableschema+json + encoding: base64 + xrefs: + person: + - Paul_Walsh + template: + - application/vnd.tableschema+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tao.intent-module-archive + friendly: + en: Tao Intent + encoding: base64 + extensions: + - tao + xrefs: + person: + - Daniel_Shelton + template: + - application/vnd.tao.intent-module-archive + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tcpdump.pcap + encoding: base64 + extensions: + - cap + - dmp + - pcap + xrefs: + person: + - Glen_Turner + - Guy_Harris + template: + - application/vnd.tcpdump.pcap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.think-cell.ppttc+json + encoding: base64 + xrefs: + person: + - Arno_Schoedl + template: + - application/vnd.think-cell.ppttc+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tmd.mediaflex.api+xml + encoding: base64 + xrefs: + person: + - Alex_Sibilev + template: + - application/vnd.tmd.mediaflex.api+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tml + encoding: base64 + xrefs: + person: + - Joey_Smith + template: + - application/vnd.tml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tmobile-livetv + friendly: + en: MobileTV + encoding: base64 + extensions: + - tmo + xrefs: + person: + - Nicolas_Helin + template: + - application/vnd.tmobile-livetv + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.tri.onesource + encoding: base64 + xrefs: + person: + - Rick_Rupp + template: + - application/vnd.tri.onesource + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.trid.tpt + friendly: + en: TRI Systems Config + encoding: base64 + extensions: + - tpt + xrefs: + person: + - Frank_Cusack + template: + - application/vnd.trid.tpt + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.triscape.mxs + friendly: + en: Triscape Map Explorer + encoding: base64 + extensions: + - mxs + xrefs: + person: + - Steven_Simonoff + template: + - application/vnd.triscape.mxs + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.trueapp + friendly: + en: True BASIC + encoding: base64 + extensions: + - tra + xrefs: + person: + - J._Scott_Hepler + template: + - application/vnd.trueapp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.truedoc + encoding: base64 + xrefs: + person: + - Brad_Chase + template: + - application/vnd.truedoc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ubisoft.webplayer + encoding: base64 + xrefs: + person: + - Martin_Talbot + template: + - application/vnd.ubisoft.webplayer + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ufdl + friendly: + en: Universal Forms Description Language + encoding: base64 + extensions: + - ufd + - ufdl + xrefs: + person: + - Dave_Manning + template: + - application/vnd.ufdl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uiq.theme + friendly: + en: User Interface Quartz - Theme (Symbian) + encoding: base64 + extensions: + - utz + xrefs: + person: + - Tim_Ocock + template: + - application/vnd.uiq.theme + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.umajin + friendly: + en: UMAJIN + encoding: base64 + extensions: + - umj + xrefs: + person: + - Jamie_Riden + template: + - application/vnd.umajin + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.unity + friendly: + en: Unity 3d + encoding: base64 + extensions: + - unityweb + xrefs: + person: + - Unity3d + template: + - application/vnd.unity + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uoml+xml + friendly: + en: Unique Object Markup Language + encoding: base64 + extensions: + - uoml + xrefs: + person: + - Arne_Gerdes + template: + - application/vnd.uoml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.alert + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.alert + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.alert-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.alert-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.bearer-choice + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.bearer-choice + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.bearer-choice-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.bearer-choice-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.cacheop + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.cacheop + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.cacheop-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.cacheop-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.channel + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.channel + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.channel-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.channel-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.list + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.list + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.list-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.list-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.listcmd + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.listcmd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.listcmd-wbxml + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.listcmd-wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uplanet.signal + encoding: base64 + xrefs: + person: + - Bruce_Martin + template: + - application/vnd.uplanet.signal + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.uri-map + encoding: base64 + xrefs: + person: + - Sebastian_Baer + template: + - application/vnd.uri-map + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.valve.source.material + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - application/vnd.valve.source.material + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vcx + friendly: + en: VirtualCatalog + encoding: base64 + extensions: + - vcx + xrefs: + person: + - Taisuke_Sugimoto + template: + - application/vnd.vcx + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vd-study + encoding: base64 + xrefs: + person: + - Luc_Rogge + template: + - application/vnd.vd-study + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vectorworks + encoding: base64 + xrefs: + person: + - Biplab_Sarkar + - Lyndsey_Ferguson + template: + - application/vnd.vectorworks + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vel+json + encoding: base64 + xrefs: + person: + - James_Wigger + template: + - application/vnd.vel+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.verimatrix.vcas + encoding: base64 + xrefs: + person: + - Petr_Peterka + template: + - application/vnd.verimatrix.vcas + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.veritone.aion+json + encoding: base64 + xrefs: + person: + - Al_Brown + template: + - application/vnd.veritone.aion+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.veryant.thin + encoding: base64 + xrefs: + person: + - Massimo_Bertoli + template: + - application/vnd.veryant.thin + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.ves.encrypted + encoding: base64 + xrefs: + person: + - Jim_Zubov + template: + - application/vnd.ves.encrypted + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vidsoft.vidconference + encoding: 8bit + extensions: + - vsc + xrefs: + person: + - Robert_Hess + template: + - application/vnd.vidsoft.vidconference + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.visio + friendly: + en: Microsoft Visio + encoding: base64 + extensions: + - vsd + - vst + - vsw + - vss + xrefs: + person: + - Troy_Sandal + template: + - application/vnd.visio + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.visionary + friendly: + en: Visionary + encoding: base64 + extensions: + - vis + xrefs: + person: + - Gayatri_Aravindakumar + template: + - application/vnd.visionary + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vividence.scriptfile + encoding: base64 + xrefs: + person: + - Mark_Risher + template: + - application/vnd.vividence.scriptfile + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.vsf + friendly: + en: Viewport+ + encoding: base64 + extensions: + - vsf + xrefs: + person: + - Delton_Rowe + template: + - application/vnd.vsf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wap.sic + encoding: base64 + extensions: + - sic + xrefs: + person: + - WAP-Forum + template: + - application/vnd.wap.sic + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wap.slc + encoding: base64 + extensions: + - slc + xrefs: + person: + - WAP-Forum + template: + - application/vnd.wap.slc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wap.wbxml + friendly: + en: WAP Binary XML (WBXML) + encoding: base64 + extensions: + - wbxml + xrefs: + person: + - Peter_Stark + template: + - application/vnd.wap.wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wap.wmlc + friendly: + en: Compiled Wireless Markup Language (WMLC) + encoding: base64 + extensions: + - wmlc + xrefs: + person: + - Peter_Stark + template: + - application/vnd.wap.wmlc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wap.wmlscriptc + friendly: + en: WMLScript + encoding: base64 + extensions: + - wmlsc + xrefs: + person: + - Peter_Stark + template: + - application/vnd.wap.wmlscriptc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.webturbo + friendly: + en: WebTurbo + encoding: base64 + extensions: + - wtb + xrefs: + person: + - Yaser_Rehem + template: + - application/vnd.webturbo + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wfa.dpp + encoding: base64 + xrefs: + person: + - Dr._Jun_Tian + - Wi-Fi_Alliance + template: + - application/vnd.wfa.dpp + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wfa.p2p + encoding: base64 + xrefs: + person: + - Mick_Conley + template: + - application/vnd.wfa.p2p + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wfa.wsc + encoding: base64 + xrefs: + person: + - Wi-Fi_Alliance + template: + - application/vnd.wfa.wsc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.windows.devicepairing + encoding: base64 + xrefs: + person: + - Priya_Dandawate + template: + - application/vnd.windows.devicepairing + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wmc + encoding: base64 + xrefs: + person: + - Thomas_Kjornes + template: + - application/vnd.wmc + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wmf.bootstrap + encoding: base64 + xrefs: + person: + - Prakash_Iyer + - Thinh_Nguyenphu + template: + - application/vnd.wmf.bootstrap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wolfram.mathematica + encoding: base64 + xrefs: + person: + - Wolfram + template: + - application/vnd.wolfram.mathematica + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wolfram.mathematica.package + encoding: base64 + xrefs: + person: + - Wolfram + template: + - application/vnd.wolfram.mathematica.package + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wolfram.player + friendly: + en: Mathematica Notebook Player + encoding: base64 + extensions: + - nbp + xrefs: + person: + - Wolfram + template: + - application/vnd.wolfram.player + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wordperfect + friendly: + en: Wordperfect + encoding: base64 + extensions: + - wpd + xrefs: + person: + - Kim_Scarborough + template: + - application/vnd.wordperfect + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wqd + friendly: + en: SundaHus WQ + encoding: base64 + extensions: + - wqd + xrefs: + person: + - Jan_Bostrom + template: + - application/vnd.wqd + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wrq-hp3000-labelled + encoding: base64 + xrefs: + person: + - Chris_Bartram + template: + - application/vnd.wrq-hp3000-labelled + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wt.stf + friendly: + en: Worldtalk + encoding: base64 + extensions: + - stf + xrefs: + person: + - Bill_Wohler + template: + - application/vnd.wt.stf + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wv.csp+wbxml + encoding: base64 + extensions: + - wv + xrefs: + person: + - Matti_Salmi + template: + - application/vnd.wv.csp+wbxml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wv.csp+xml + encoding: 8bit + xrefs: + person: + - John_Ingi_Ingimundarson + template: + - application/vnd.wv.csp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.wv.ssp+xml + encoding: 8bit + xrefs: + person: + - John_Ingi_Ingimundarson + template: + - application/vnd.wv.ssp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xacml+json + encoding: base64 + xrefs: + person: + - David_Brossard + template: + - application/vnd.xacml+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xara + friendly: + en: CorelXARA + encoding: base64 + extensions: + - xar + xrefs: + person: + - David_Matthewman + template: + - application/vnd.xara + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xfdl + friendly: + en: Extensible Forms Description Language + encoding: base64 + extensions: + - xfdl + xrefs: + person: + - Dave_Manning + template: + - application/vnd.xfdl + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xfdl.webform + encoding: base64 + xrefs: + person: + - Michael_Mansell + template: + - application/vnd.xfdl.webform + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmi+xml + encoding: base64 + xrefs: + person: + - Fred_Waskiewicz + template: + - application/vnd.xmi+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmpie.cpkg + encoding: base64 + xrefs: + person: + - Reuven_Sherwin + template: + - application/vnd.xmpie.cpkg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmpie.dpkg + encoding: base64 + xrefs: + person: + - Reuven_Sherwin + template: + - application/vnd.xmpie.dpkg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmpie.plan + encoding: base64 + xrefs: + person: + - Reuven_Sherwin + template: + - application/vnd.xmpie.plan + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmpie.ppkg + encoding: base64 + xrefs: + person: + - Reuven_Sherwin + template: + - application/vnd.xmpie.ppkg + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.xmpie.xlim + encoding: base64 + xrefs: + person: + - Reuven_Sherwin + template: + - application/vnd.xmpie.xlim + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.hv-dic + friendly: + en: HV Voice Dictionary + encoding: base64 + extensions: + - hvd + xrefs: + person: + - Tomohiro_Yamamoto + template: + - application/vnd.yamaha.hv-dic + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.hv-script + friendly: + en: HV Script + encoding: base64 + extensions: + - hvs + xrefs: + person: + - Tomohiro_Yamamoto + template: + - application/vnd.yamaha.hv-script + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.hv-voice + friendly: + en: HV Voice Parameter + encoding: base64 + extensions: + - hvp + xrefs: + person: + - Tomohiro_Yamamoto + template: + - application/vnd.yamaha.hv-voice + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.openscoreformat + friendly: + en: Open Score Format + encoding: base64 + extensions: + - osf + xrefs: + person: + - Mark_Olleson + template: + - application/vnd.yamaha.openscoreformat + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.openscoreformat.osfpvg+xml + friendly: + en: OSFPVG + encoding: base64 + extensions: + - osfpvg + xrefs: + person: + - Mark_Olleson + template: + - application/vnd.yamaha.openscoreformat.osfpvg+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.remote-setup + encoding: base64 + xrefs: + person: + - Takehiro_Sukizaki + template: + - application/vnd.yamaha.remote-setup + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.smaf-audio + friendly: + en: SMAF Audio + encoding: base64 + extensions: + - saf + xrefs: + person: + - Keiichi_Shinoda + template: + - application/vnd.yamaha.smaf-audio + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.smaf-phrase + friendly: + en: SMAF Phrase + encoding: base64 + extensions: + - spf + xrefs: + person: + - Keiichi_Shinoda + template: + - application/vnd.yamaha.smaf-phrase + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.through-ngn + encoding: base64 + xrefs: + person: + - Takehiro_Sukizaki + template: + - application/vnd.yamaha.through-ngn + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yamaha.tunnel-udpencap + encoding: base64 + xrefs: + person: + - Takehiro_Sukizaki + template: + - application/vnd.yamaha.tunnel-udpencap + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yaoweme + encoding: base64 + xrefs: + person: + - Jens_Jorgensen + template: + - application/vnd.yaoweme + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.yellowriver-custom-menu + friendly: + en: CustomMenu + encoding: base64 + extensions: + - cmp + xrefs: + person: + - Mr._Yellow + template: + - application/vnd.yellowriver-custom-menu + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.youtube.yt + encoding: base64 + obsolete: true + use-instead: video/vnd.youtube.yt + xrefs: + person: + - Laura_Wood + template: + - application/vnd.youtube.yt + notes: + - "(OBSOLETED in favor of video/vnd.youtube.yt)" + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.zul + friendly: + en: Z.U.L. Geometry + encoding: base64 + extensions: + - zir + - zirz + xrefs: + person: + - Rene_Grothmann + template: + - application/vnd.zul + registered: true +- !ruby/object:MIME::Type + content-type: application/vnd.zzazz.deck+xml + friendly: + en: Zzazz Deck + encoding: base64 + extensions: + - zaz + xrefs: + person: + - Micheal_Hewett + template: + - application/vnd.zzazz.deck+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/voicexml+xml + friendly: + en: VoiceXML + encoding: base64 + extensions: + - vxml + xrefs: + rfc: + - rfc4267 + template: + - application/voicexml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/voucher-cms+json + encoding: base64 + xrefs: + rfc: + - rfc8366 + template: + - application/voucher-cms+json + registered: true +- !ruby/object:MIME::Type + content-type: application/vq-rtcpxr + encoding: base64 + xrefs: + rfc: + - rfc6035 + template: + - application/vq-rtcpxr + registered: true +- !ruby/object:MIME::Type + content-type: application/wasm + friendly: + en: WebAssembly + encoding: 8bit + extensions: + - wasm + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - application/wasm + registered: true +- !ruby/object:MIME::Type + content-type: application/watcherinfo+xml + encoding: base64 + extensions: + - wif + xrefs: + rfc: + - rfc3858 + template: + - application/watcherinfo+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/webpush-options+json + encoding: base64 + xrefs: + rfc: + - rfc8292 + template: + - application/webpush-options+json + registered: true +- !ruby/object:MIME::Type + content-type: application/whoispp-query + encoding: base64 + xrefs: + rfc: + - rfc2957 + template: + - application/whoispp-query + registered: true +- !ruby/object:MIME::Type + content-type: application/whoispp-response + encoding: base64 + xrefs: + rfc: + - rfc2958 + template: + - application/whoispp-response + registered: true +- !ruby/object:MIME::Type + content-type: application/widget + friendly: + en: Widget Packaging and XML Configuration + encoding: base64 + extensions: + - wgt + xrefs: + person: + - Steven_Pemberton + - W3C + uri: + - http://www.w3.org/TR/widgets/#media-type-registration-for-application/widget + template: + - application/widget + registered: true +- !ruby/object:MIME::Type + content-type: application/winhlp + friendly: + en: WinHelp + encoding: base64 + extensions: + - hlp + registered: false +- !ruby/object:MIME::Type + content-type: application/wita + encoding: base64 + xrefs: + person: + - Larry_Campbell + template: + - application/wita + registered: true +- !ruby/object:MIME::Type + content-type: application/word + encoding: base64 + extensions: + - doc + - dot + registered: false +- !ruby/object:MIME::Type + content-type: application/wordperfect + encoding: base64 + extensions: + - wp + obsolete: true + use-instead: application/vnd.wordperfect + registered: false +- !ruby/object:MIME::Type + content-type: application/wordperfect5.1 + encoding: base64 + extensions: + - wp5 + - wp + xrefs: + person: + - Paul_Lindner + template: + - application/wordperfect5.1 + registered: true +- !ruby/object:MIME::Type + content-type: application/wordperfect6.1 + encoding: base64 + extensions: + - wp6 + obsolete: true + use-instead: application/x-wordperfect6.1 + registered: false +- !ruby/object:MIME::Type + content-type: application/wordperfectd + encoding: base64 + extensions: + - wpd + obsolete: true + use-instead: application/vnd.wordperfect + registered: false +- !ruby/object:MIME::Type + content-type: application/wsdl+xml + friendly: + en: WSDL - Web Services Description Language + encoding: base64 + extensions: + - wsdl + xrefs: + person: + - W3C + template: + - application/wsdl+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/wspolicy+xml + friendly: + en: Web Services Policy + encoding: base64 + extensions: + - wspolicy + xrefs: + person: + - W3C + template: + - application/wspolicy+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/x-123 + encoding: base64 + extensions: + - wk + obsolete: true + use-instead: application/vnd.lotus-1-2-3 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-7z-compressed + friendly: + en: 7-Zip + encoding: base64 + extensions: + - 7z + registered: false +- !ruby/object:MIME::Type + content-type: application/x-abiword + friendly: + en: AbiWord + encoding: base64 + extensions: + - abw + registered: false +- !ruby/object:MIME::Type + content-type: application/x-access + encoding: base64 + extensions: + - mdf + - mda + - mdb + - mde + obsolete: true + use-instead: application/x-msaccess + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ace-compressed + friendly: + en: Ace Archive + encoding: base64 + extensions: + - ace + registered: false +- !ruby/object:MIME::Type + content-type: application/x-apple-diskimage + encoding: base64 + extensions: + - dmg + registered: false +- !ruby/object:MIME::Type + content-type: application/x-authorware-bin + friendly: + en: Adobe (Macropedia) Authorware - Binary File + encoding: base64 + extensions: + - aab + - u32 + - vox + - x32 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-authorware-map + friendly: + en: Adobe (Macropedia) Authorware - Map + encoding: base64 + extensions: + - aam + registered: false +- !ruby/object:MIME::Type + content-type: application/x-authorware-seg + friendly: + en: Adobe (Macropedia) Authorware - Segment File + encoding: base64 + extensions: + - aas + registered: false +- !ruby/object:MIME::Type + content-type: application/x-bcpio + friendly: + en: Binary CPIO Archive + encoding: base64 + extensions: + - bcpio + registered: false +- !ruby/object:MIME::Type + content-type: application/x-bittorrent + friendly: + en: BitTorrent + encoding: base64 + extensions: + - torrent + registered: false +- !ruby/object:MIME::Type + content-type: application/x-bleeper + encoding: base64 + extensions: + - bleep + registered: false +- !ruby/object:MIME::Type + content-type: application/x-blorb + encoding: base64 + extensions: + - blb + - blorb + registered: false +- !ruby/object:MIME::Type + content-type: application/x-bzip + friendly: + en: Bzip Archive + encoding: base64 + extensions: + - bz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-bzip2 + friendly: + en: Bzip2 Archive + encoding: base64 + extensions: + - boz + - bz2 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-cbr + encoding: base64 + extensions: + - cb7 + - cba + - cbr + - cbt + - cbz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-cdlink + friendly: + en: Video CD + encoding: base64 + extensions: + - vcd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-cfs-compressed + encoding: base64 + extensions: + - cfs + registered: false +- !ruby/object:MIME::Type + content-type: application/x-chat + friendly: + en: pIRCh + encoding: base64 + extensions: + - chat + registered: false +- !ruby/object:MIME::Type + content-type: application/x-chess-pgn + friendly: + en: Portable Game Notation (Chess Games) + encoding: base64 + extensions: + - pgn + registered: false +- !ruby/object:MIME::Type + content-type: application/x-chrome-extension + encoding: base64 + extensions: + - crx + registered: false +- !ruby/object:MIME::Type + content-type: application/x-clariscad + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-compress + encoding: base64 + extensions: + - z + - Z + obsolete: true + use-instead: application/x-compressed + registered: false +- !ruby/object:MIME::Type + content-type: application/x-compressed + encoding: base64 + extensions: + - z + - Z + registered: false +- !ruby/object:MIME::Type + content-type: application/x-conference + encoding: base64 + extensions: + - nsc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-cpio + friendly: + en: CPIO Archive + encoding: base64 + extensions: + - cpio + registered: false +- !ruby/object:MIME::Type + content-type: application/x-csh + friendly: + en: C Shell Script + encoding: 8bit + extensions: + - csh + registered: false +- !ruby/object:MIME::Type + content-type: application/x-cu-seeme + encoding: base64 + extensions: + - csm + - cu + registered: false +- !ruby/object:MIME::Type + content-type: application/x-debian-package + friendly: + en: Debian Package + encoding: base64 + extensions: + - deb + - udeb + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dgc-compressed + encoding: base64 + extensions: + - dgc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-director + friendly: + en: Adobe Shockwave Player + encoding: base64 + extensions: + - dcr + - "@dir" + - "@dxr" + - cct + - cst + - cxt + - dir + - dxr + - fgd + - swa + - w3d + registered: false +- !ruby/object:MIME::Type + content-type: application/x-doom + friendly: + en: Doom Video Game + encoding: base64 + extensions: + - wad + registered: false +- !ruby/object:MIME::Type + content-type: application/x-drafting + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dtbncx+xml + friendly: + en: Navigation Control file for XML (for ePub) + encoding: base64 + extensions: + - ncx + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dtbook+xml + friendly: + en: Digital Talking Book + encoding: base64 + extensions: + - dtb + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dtbresource+xml + friendly: + en: Digital Talking Book - Resource File + encoding: base64 + extensions: + - res + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dvi + friendly: + en: Device Independent File Format (DVI) + encoding: base64 + extensions: + - dvi + registered: false +- !ruby/object:MIME::Type + content-type: application/x-dxf + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-envoy + encoding: base64 + extensions: + - evy + registered: false +- !ruby/object:MIME::Type + content-type: application/x-eva + encoding: base64 + extensions: + - eva + registered: false +- !ruby/object:MIME::Type + content-type: application/x-excel + encoding: base64 + obsolete: true + use-instead: application/vnd.ms-excel + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-bdf + friendly: + en: Glyph Bitmap Distribution Format + encoding: base64 + extensions: + - bdf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-ghostscript + friendly: + en: Ghostscript Font + encoding: base64 + extensions: + - gsf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-linux-psf + friendly: + en: PSF Fonts + encoding: base64 + extensions: + - psf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-opentype + encoding: base64 + extensions: + - otf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-otf + friendly: + en: OpenType Font File + encoding: base64 + extensions: + - otf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-pcf + friendly: + en: Portable Compiled Format + encoding: base64 + extensions: + - pcf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-snf + friendly: + en: Server Normal Format + encoding: base64 + extensions: + - snf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-truetype + encoding: base64 + extensions: + - ttf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-ttf + friendly: + en: TrueType Font + encoding: base64 + extensions: + - ttc + - ttf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-font-type1 + friendly: + en: PostScript Fonts + encoding: base64 + extensions: + - afm + - pfa + - pfb + - pfm + registered: false +- !ruby/object:MIME::Type + content-type: application/x-fractals + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-freearc + encoding: base64 + extensions: + - arc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-futuresplash + friendly: + en: FutureSplash Animator + encoding: base64 + extensions: + - spl + registered: false +- !ruby/object:MIME::Type + content-type: application/x-gca-compressed + encoding: base64 + extensions: + - gca + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ghostview + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-glulx + encoding: base64 + extensions: + - ulx + registered: false +- !ruby/object:MIME::Type + content-type: application/x-gnumeric + friendly: + en: Gnumeric + encoding: base64 + extensions: + - gnumeric + registered: false +- !ruby/object:MIME::Type + content-type: application/x-gramps-xml + encoding: base64 + extensions: + - gramps + registered: false +- !ruby/object:MIME::Type + content-type: application/x-gtar + friendly: + en: GNU Tar Files + encoding: base64 + extensions: + - gtar + - tgz + - tbz2 + - tbz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-gzip + encoding: base64 + extensions: + - gz + obsolete: true + use-instead: application/gzip + registered: false +- !ruby/object:MIME::Type + content-type: application/x-hdf + friendly: + en: Hierarchical Data Format + encoding: base64 + extensions: + - hdf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-hep + encoding: base64 + extensions: + - hep + registered: false +- !ruby/object:MIME::Type + content-type: application/x-html+ruby + encoding: 8bit + extensions: + - rhtml + registered: false +- !ruby/object:MIME::Type + content-type: application/x-httpd-php + encoding: 8bit + extensions: + - phtml + - pht + - php + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ibooks+zip + encoding: base64 + extensions: + - ibooks + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ica + encoding: base64 + extensions: + - ica + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ideas + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-imagemap + encoding: 8bit + extensions: + - imagemap + - imap + registered: false +- !ruby/object:MIME::Type + content-type: application/x-install-instructions + encoding: base64 + extensions: + - install + registered: false +- !ruby/object:MIME::Type + content-type: application/x-iso9660-image + encoding: base64 + extensions: + - iso + registered: false +- !ruby/object:MIME::Type + content-type: application/x-iwork-keynote-sffkey + encoding: base64 + extensions: + - key + registered: false +- !ruby/object:MIME::Type + content-type: application/x-iwork-numbers-sffnumbers + encoding: base64 + extensions: + - numbers + registered: false +- !ruby/object:MIME::Type + content-type: application/x-iwork-pages-sffpages + encoding: base64 + extensions: + - pages + registered: false +- !ruby/object:MIME::Type + content-type: application/x-java-archive + encoding: base64 + extensions: + - jar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-java-jnlp-file + friendly: + en: Java Network Launching Protocol + encoding: base64 + extensions: + - jnlp + registered: false +- !ruby/object:MIME::Type + content-type: application/x-java-serialized-object + encoding: base64 + extensions: + - ser + registered: false +- !ruby/object:MIME::Type + content-type: application/x-java-vm + encoding: base64 + extensions: + - class + registered: false +- !ruby/object:MIME::Type + content-type: application/x-javascript + encoding: 8bit + extensions: + - js + - mjs + obsolete: true + use-instead: application/javascript + registered: false +- !ruby/object:MIME::Type + content-type: application/x-koan + encoding: base64 + extensions: + - skp + - skd + - skt + - skm + registered: false +- !ruby/object:MIME::Type + content-type: application/x-latex + friendly: + en: LaTeX + encoding: 8bit + extensions: + - ltx + - latex + registered: false +- !ruby/object:MIME::Type + content-type: application/x-lotus-123 + encoding: base64 + extensions: + - wks + obsolete: true + use-instead: application/vnd.lotus-1-2-3 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-lzh-compressed + encoding: base64 + extensions: + - lha + - lzh + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mac + encoding: base64 + extensions: + - bin + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mac-compactpro + encoding: base64 + extensions: + - cpt + registered: false +- !ruby/object:MIME::Type + content-type: application/x-macbase64 + encoding: base64 + extensions: + - bin + registered: false +- !ruby/object:MIME::Type + content-type: application/x-macbinary + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-maker + encoding: base64 + extensions: + - frm + - maker + - frame + - fm + - fb + - book + - fbdoc + obsolete: true + use-instead: application/vnd.framemaker + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mathcad + encoding: base64 + extensions: + - mcd + obsolete: true + use-instead: application/vnd.mcd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mathematica-old + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mie + encoding: base64 + extensions: + - mie + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mif + encoding: base64 + extensions: + - mif + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mobipocket-ebook + friendly: + en: Mobipocket + encoding: base64 + extensions: + - mobi + - prc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-application + friendly: + en: Microsoft ClickOnce + encoding: base64 + extensions: + - application + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-dos-executable + encoding: base64 + extensions: + - exe + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-shortcut + encoding: base64 + extensions: + - lnk + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-wmd + friendly: + en: Microsoft Windows Media Player Download Package + encoding: base64 + extensions: + - wmd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-wmz + friendly: + en: Microsoft Windows Media Player Skin Package + encoding: base64 + extensions: + - wmz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ms-xbap + friendly: + en: Microsoft XAML Browser Application + encoding: base64 + extensions: + - xbap + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msaccess + friendly: + en: Microsoft Access + encoding: base64 + extensions: + - mda + - mdb + - mde + - mdf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msbinder + friendly: + en: Microsoft Office Binder + encoding: base64 + extensions: + - obd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mscardfile + friendly: + en: Microsoft Information Card + encoding: base64 + extensions: + - crd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msclip + friendly: + en: Microsoft Clipboard Clip + encoding: base64 + extensions: + - clp + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msdos-program + encoding: base64 + extensions: + - cmd + - bat + - com + - exe + - reg + - ps1 + - vbs + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msdownload + friendly: + en: Microsoft Application + encoding: base64 + extensions: + - exe + - com + - cmd + - bat + - dll + - msi + - reg + - ps1 + - vbs + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msmediaview + friendly: + en: Microsoft MediaView + encoding: base64 + extensions: + - m13 + - m14 + - mvb + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msmetafile + friendly: + en: Microsoft Windows Metafile + encoding: base64 + extensions: + - emf + - emz + - wmf + - wmz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msmoney + friendly: + en: Microsoft Money + encoding: base64 + extensions: + - mny + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mspublisher + friendly: + en: Microsoft Publisher + encoding: base64 + extensions: + - pub + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msschedule + friendly: + en: Microsoft Schedule+ + encoding: base64 + extensions: + - scd + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msterminal + friendly: + en: Microsoft Windows Terminal Services + encoding: base64 + extensions: + - trm + registered: false +- !ruby/object:MIME::Type + content-type: application/x-msword + encoding: base64 + extensions: + - doc + - dot + - wrd + obsolete: true + use-instead: application/msword + registered: false +- !ruby/object:MIME::Type + content-type: application/x-mswrite + friendly: + en: Microsoft Wordpad + encoding: base64 + extensions: + - wri + registered: false +- !ruby/object:MIME::Type + content-type: application/x-netcdf + friendly: + en: Network Common Data Form (NetCDF) + encoding: base64 + extensions: + - nc + - cdf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ns-proxy-autoconfig + encoding: base64 + extensions: + - pac + registered: false +- !ruby/object:MIME::Type + content-type: application/x-nzb + encoding: base64 + extensions: + - nzb + registered: false +- !ruby/object:MIME::Type + content-type: application/x-opera-extension + encoding: base64 + extensions: + - oex + registered: false +- !ruby/object:MIME::Type + content-type: application/x-pagemaker + encoding: base64 + extensions: + - pm + - pm5 + - pt5 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-perl + encoding: 8bit + extensions: + - pl + - pm + registered: false +- !ruby/object:MIME::Type + content-type: application/x-pgp + encoding: base64 + registered: false + signature: true +- !ruby/object:MIME::Type + content-type: application/x-pkcs12 + friendly: + en: 'PKCS #12 - Personal Information Exchange Syntax Standard' + encoding: base64 + extensions: + - p12 + - pfx + registered: false +- !ruby/object:MIME::Type + content-type: application/x-pkcs7-certificates + friendly: + en: 'PKCS #7 - Cryptographic Message Syntax Standard (Certificates)' + encoding: base64 + extensions: + - p7b + - spc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-pkcs7-certreqresp + friendly: + en: 'PKCS #7 - Cryptographic Message Syntax Standard (Certificate Request Response)' + encoding: base64 + extensions: + - p7r + registered: false +- !ruby/object:MIME::Type + content-type: application/x-pki-message + encoding: base64 + xrefs: + rfc: + - rfc8894 + template: + - application/x-pki-message + registered: true +- !ruby/object:MIME::Type + content-type: application/x-python + encoding: 8bit + extensions: + - py + registered: false +- !ruby/object:MIME::Type + content-type: application/x-quicktimeplayer + encoding: base64 + extensions: + - qtl + registered: false +- !ruby/object:MIME::Type + content-type: application/x-rar-compressed + friendly: + en: RAR Archive + encoding: base64 + extensions: + - rar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-remote_printing + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-research-info-systems + encoding: base64 + extensions: + - ris + registered: false +- !ruby/object:MIME::Type + content-type: application/x-rtf + encoding: base64 + extensions: + - rtf + obsolete: true + use-instead: application/rtf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ruby + encoding: 8bit + extensions: + - rb + - rbw + registered: false +- !ruby/object:MIME::Type + content-type: application/x-set + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-sh + friendly: + en: Bourne Shell Script + encoding: 8bit + extensions: + - sh + registered: false +- !ruby/object:MIME::Type + content-type: application/x-shar + friendly: + en: Shell Archive + encoding: 8bit + extensions: + - shar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-shockwave-flash + friendly: + en: Adobe Flash + encoding: base64 + extensions: + - swf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-silverlight-app + friendly: + en: Microsoft Silverlight + encoding: base64 + extensions: + - xap + registered: false +- !ruby/object:MIME::Type + content-type: application/x-SLA + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-smarttech-notebook + encoding: base64 + extensions: + - notebook + registered: false +- !ruby/object:MIME::Type + content-type: application/x-solids + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-spss + encoding: base64 + extensions: + - sav + - sbs + - sps + - spo + - spp + registered: false +- !ruby/object:MIME::Type + content-type: application/x-sql + encoding: base64 + extensions: + - sql + registered: false +- !ruby/object:MIME::Type + content-type: application/x-STEP + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-stuffit + friendly: + en: Stuffit Archive + encoding: base64 + extensions: + - sit + registered: false +- !ruby/object:MIME::Type + content-type: application/x-stuffitx + friendly: + en: Stuffit Archive + encoding: base64 + extensions: + - sitx + registered: false +- !ruby/object:MIME::Type + content-type: application/x-subrip + encoding: base64 + extensions: + - srt + registered: false +- !ruby/object:MIME::Type + content-type: application/x-sv4cpio + friendly: + en: System V Release 4 CPIO Archive + encoding: base64 + extensions: + - sv4cpio + registered: false +- !ruby/object:MIME::Type + content-type: application/x-sv4crc + friendly: + en: System V Release 4 CPIO Checksum Data + encoding: base64 + extensions: + - sv4crc + registered: false +- !ruby/object:MIME::Type + content-type: application/x-t3vm-image + encoding: base64 + extensions: + - t3 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tads + encoding: base64 + extensions: + - gam + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tar + friendly: + en: Tar File (Tape Archive) + encoding: base64 + extensions: + - tar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tcl + friendly: + en: Tcl Script + encoding: 8bit + extensions: + - tcl + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tex + friendly: + en: TeX + encoding: 8bit + extensions: + - tex + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tex-tfm + friendly: + en: TeX Font Metric + encoding: base64 + extensions: + - tfm + registered: false +- !ruby/object:MIME::Type + content-type: application/x-texinfo + friendly: + en: GNU Texinfo Document + encoding: 8bit + extensions: + - texinfo + - texi + registered: false +- !ruby/object:MIME::Type + content-type: application/x-tgif + encoding: base64 + extensions: + - obj + registered: false +- !ruby/object:MIME::Type + content-type: application/x-toolbook + encoding: base64 + extensions: + - tbk + registered: false +- !ruby/object:MIME::Type + content-type: application/x-troff + encoding: base64 + extensions: + - t + - tr + - roff + obsolete: true + use-instead: text/troff + registered: false +- !ruby/object:MIME::Type + content-type: application/x-troff-man + encoding: 8bit + extensions: + - man + registered: false +- !ruby/object:MIME::Type + content-type: application/x-troff-me + encoding: base64 + extensions: + - me + registered: false +- !ruby/object:MIME::Type + content-type: application/x-troff-ms + encoding: base64 + extensions: + - ms + registered: false +- !ruby/object:MIME::Type + content-type: application/x-u-star + encoding: base64 + obsolete: true + use-instead: application/x-ustar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-ustar + friendly: + en: Ustar (Uniform Standard Tape Archive) + encoding: base64 + extensions: + - ustar + registered: false +- !ruby/object:MIME::Type + content-type: application/x-VMSBACKUP + encoding: base64 + extensions: + - bck + registered: false +- !ruby/object:MIME::Type + content-type: application/x-wais-source + friendly: + en: WAIS Source + encoding: base64 + extensions: + - src + registered: false +- !ruby/object:MIME::Type + content-type: application/x-web-app-manifest+json + encoding: base64 + extensions: + - webapp + registered: false +- !ruby/object:MIME::Type + content-type: application/x-Wingz + encoding: base64 + extensions: + - wz + - wkz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-word + encoding: base64 + extensions: + - doc + - dot + obsolete: true + use-instead: application/msword + registered: false +- !ruby/object:MIME::Type + content-type: application/x-wordperfect + encoding: base64 + extensions: + - wp + obsolete: true + use-instead: application/vnd.wordperfect + registered: false +- !ruby/object:MIME::Type + content-type: application/x-wordperfect6.1 + encoding: base64 + extensions: + - wp6 + registered: false +- !ruby/object:MIME::Type + content-type: application/x-wordperfectd + encoding: base64 + extensions: + - wpd + obsolete: true + use-instead: application/vnd.wordperfect + registered: false +- !ruby/object:MIME::Type + content-type: application/x-www-form-urlencoded + encoding: 7bit + xrefs: + person: + - Anne_van_Kesteren + - WHATWG + template: + - application/x-www-form-urlencoded + registered: true +- !ruby/object:MIME::Type + content-type: application/x-x509-ca-cert + friendly: + en: X.509 Certificate + encoding: base64 + extensions: + - crt + - der + xrefs: + rfc: + - rfc8894 + template: + - application/x-x509-ca-cert + registered: true +- !ruby/object:MIME::Type + content-type: application/x-x509-ca-ra-cert + encoding: base64 + xrefs: + rfc: + - rfc8894 + template: + - application/x-x509-ca-ra-cert + registered: true +- !ruby/object:MIME::Type + content-type: application/x-x509-next-ca-cert + encoding: base64 + xrefs: + rfc: + - rfc8894 + template: + - application/x-x509-next-ca-cert + registered: true +- !ruby/object:MIME::Type + content-type: application/x-xfig + friendly: + en: Xfig + encoding: base64 + extensions: + - fig + registered: false +- !ruby/object:MIME::Type + content-type: application/x-xliff+xml + encoding: base64 + extensions: + - xlf + registered: false +- !ruby/object:MIME::Type + content-type: application/x-xpinstall + friendly: + en: XPInstall - Mozilla + encoding: base64 + extensions: + - xpi + registered: false +- !ruby/object:MIME::Type + content-type: application/x-xz + encoding: base64 + extensions: + - xz + registered: false +- !ruby/object:MIME::Type + content-type: application/x-zip-compressed + friendly: + en: Zip Archive + encoding: base64 + extensions: + - zip + registered: false +- !ruby/object:MIME::Type + content-type: application/x-zmachine + encoding: base64 + extensions: + - z1 + - z2 + - z3 + - z4 + - z5 + - z6 + - z7 + - z8 + registered: false +- !ruby/object:MIME::Type + content-type: application/x400-bp + encoding: base64 + xrefs: + rfc: + - rfc1494 + template: + - application/x400-bp + registered: true +- !ruby/object:MIME::Type + content-type: application/x400.bp + encoding: base64 + obsolete: true + use-instead: application/x400-bp + registered: false +- !ruby/object:MIME::Type + content-type: application/xacml+xml + encoding: base64 + xrefs: + rfc: + - rfc7061 + template: + - application/xacml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xaml+xml + encoding: base64 + extensions: + - xaml + registered: false +- !ruby/object:MIME::Type + content-type: application/xcap-att+xml + encoding: base64 + xrefs: + rfc: + - rfc4825 + template: + - application/xcap-att+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcap-caps+xml + encoding: base64 + xrefs: + rfc: + - rfc4825 + template: + - application/xcap-caps+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcap-diff+xml + friendly: + en: XML Configuration Access Protocol - XCAP Diff + encoding: base64 + extensions: + - xdf + xrefs: + rfc: + - rfc5874 + template: + - application/xcap-diff+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcap-el+xml + encoding: base64 + xrefs: + rfc: + - rfc4825 + template: + - application/xcap-el+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcap-error+xml + encoding: base64 + xrefs: + rfc: + - rfc4825 + template: + - application/xcap-error+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcap-ns+xml + encoding: base64 + xrefs: + rfc: + - rfc4825 + template: + - application/xcap-ns+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcon-conference-info+xml + encoding: base64 + xrefs: + rfc: + - rfc6502 + template: + - application/xcon-conference-info+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xcon-conference-info-diff+xml + encoding: base64 + xrefs: + rfc: + - rfc6502 + template: + - application/xcon-conference-info-diff+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xenc+xml + friendly: + en: XML Encryption Syntax and Processing + encoding: base64 + extensions: + - xenc + xrefs: + person: + - Joseph_Reagle + - XENC_Working_Group + template: + - application/xenc+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xhtml+xml + friendly: + en: XHTML - The Extensible HyperText Markup Language + encoding: 8bit + extensions: + - xht + - xhtml + xrefs: + person: + - Robin_Berjon + - W3C + template: + - application/xhtml+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xhtml-voice+xml + encoding: base64 + obsolete: true + xrefs: + draft: + - draft-mccobb-xplusv-media-type + template: + - application/xhtml-voice+xml + notes: + - "- OBSOLETE; no replacement given" + registered: true +- !ruby/object:MIME::Type + content-type: application/xliff+xml + encoding: base64 + xrefs: + person: + - Chet_Ensign + - OASIS + template: + - application/xliff+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xml + friendly: + en: XML - Extensible Markup Language + encoding: 8bit + extensions: + - xml + - xsl + xrefs: + rfc: + - rfc7303 + template: + - application/xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xml-dtd + friendly: + en: Document Type Definition + encoding: 8bit + extensions: + - dtd + xrefs: + rfc: + - rfc7303 + template: + - application/xml-dtd + registered: true +- !ruby/object:MIME::Type + content-type: application/xml-external-parsed-entity + encoding: base64 + xrefs: + rfc: + - rfc7303 + template: + - application/xml-external-parsed-entity + registered: true +- !ruby/object:MIME::Type + content-type: application/xml-patch+xml + encoding: base64 + xrefs: + rfc: + - rfc7351 + template: + - application/xml-patch+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xmpp+xml + encoding: base64 + xrefs: + rfc: + - rfc3923 + template: + - application/xmpp+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xop+xml + friendly: + en: XML-Binary Optimized Packaging + encoding: base64 + extensions: + - xop + xrefs: + person: + - Mark_Nottingham + template: + - application/xop+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xproc+xml + encoding: base64 + extensions: + - xpl + registered: false +- !ruby/object:MIME::Type + content-type: application/xslt+xml + friendly: + en: XML Transformations + encoding: base64 + extensions: + - xslt + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/2007/REC-xslt20-20070123/#media-type-registration + template: + - application/xslt+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/xspf+xml + friendly: + en: XSPF - XML Shareable Playlist Format + encoding: base64 + extensions: + - xspf + registered: false +- !ruby/object:MIME::Type + content-type: application/xv+xml + friendly: + en: MXML + encoding: base64 + extensions: + - mxml + - xhvml + - xvm + - xvml + xrefs: + rfc: + - rfc4374 + template: + - application/xv+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/yang + friendly: + en: YANG Data Modeling Language + encoding: base64 + extensions: + - yang + xrefs: + rfc: + - rfc6020 + template: + - application/yang + registered: true +- !ruby/object:MIME::Type + content-type: application/yang-data+json + encoding: base64 + xrefs: + rfc: + - rfc8040 + template: + - application/yang-data+json + registered: true +- !ruby/object:MIME::Type + content-type: application/yang-data+xml + encoding: base64 + xrefs: + rfc: + - rfc8040 + template: + - application/yang-data+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/yang-patch+json + encoding: base64 + xrefs: + rfc: + - rfc8072 + template: + - application/yang-patch+json + registered: true +- !ruby/object:MIME::Type + content-type: application/yang-patch+xml + encoding: base64 + xrefs: + rfc: + - rfc8072 + template: + - application/yang-patch+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/yin+xml + friendly: + en: YIN (YANG - XML) + encoding: base64 + extensions: + - yin + xrefs: + rfc: + - rfc6020 + template: + - application/yin+xml + registered: true +- !ruby/object:MIME::Type + content-type: application/zip + friendly: + en: Zip Archive + encoding: base64 + extensions: + - zip + xrefs: + person: + - Paul_Lindner + template: + - application/zip + registered: true +- !ruby/object:MIME::Type + content-type: application/zlib + encoding: base64 + xrefs: + rfc: + - rfc6713 + template: + - application/zlib + registered: true +- !ruby/object:MIME::Type + content-type: application/zstd + encoding: base64 + xrefs: + rfc: + - rfc8878 + template: + - application/zstd + registered: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/audio.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/audio.yaml new file mode 100644 index 0000000..644801f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/audio.yaml @@ -0,0 +1,1716 @@ +--- +- !ruby/object:MIME::Type + content-type: audio/1d-interleaved-parityfec + encoding: base64 + xrefs: + rfc: + - rfc6015 + template: + - audio/1d-interleaved-parityfec + registered: true +- !ruby/object:MIME::Type + content-type: audio/32kadpcm + encoding: base64 + xrefs: + rfc: + - rfc2421 + - rfc3802 + template: + - audio/32kadpcm + registered: true +- !ruby/object:MIME::Type + content-type: audio/3gpp + encoding: base64 + xrefs: + rfc: + - rfc3839 + - rfc6381 + template: + - audio/3gpp + registered: true +- !ruby/object:MIME::Type + content-type: audio/3gpp2 + encoding: base64 + xrefs: + rfc: + - rfc4393 + - rfc6381 + template: + - audio/3gpp2 + registered: true +- !ruby/object:MIME::Type + content-type: audio/aac + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - Max_Neuendorf + template: + - audio/aac + registered: true +- !ruby/object:MIME::Type + content-type: audio/ac3 + encoding: base64 + xrefs: + rfc: + - rfc4184 + template: + - audio/ac3 + registered: true +- !ruby/object:MIME::Type + content-type: audio/adpcm + friendly: + en: Adaptive differential pulse-code modulation + encoding: base64 + extensions: + - adp + registered: false +- !ruby/object:MIME::Type + content-type: audio/AMR + encoding: base64 + extensions: + - amr + xrefs: + rfc: + - rfc4867 + template: + - audio/AMR + registered: true +- !ruby/object:MIME::Type + content-type: audio/AMR-WB + encoding: base64 + extensions: + - awb + xrefs: + rfc: + - rfc4867 + template: + - audio/AMR-WB + registered: true +- !ruby/object:MIME::Type + content-type: audio/amr-wb+ + encoding: base64 + xrefs: + rfc: + - rfc4352 + template: + - audio/amr-wb+ + registered: true +- !ruby/object:MIME::Type + content-type: audio/aptx + encoding: base64 + xrefs: + rfc: + - rfc7310 + template: + - audio/aptx + registered: true +- !ruby/object:MIME::Type + content-type: audio/asc + encoding: base64 + xrefs: + rfc: + - rfc6295 + template: + - audio/asc + registered: true +- !ruby/object:MIME::Type + content-type: audio/ATRAC-ADVANCED-LOSSLESS + encoding: base64 + xrefs: + rfc: + - rfc5584 + template: + - audio/ATRAC-ADVANCED-LOSSLESS + registered: true +- !ruby/object:MIME::Type + content-type: audio/ATRAC-X + encoding: base64 + xrefs: + rfc: + - rfc5584 + template: + - audio/ATRAC-X + registered: true +- !ruby/object:MIME::Type + content-type: audio/ATRAC3 + encoding: base64 + xrefs: + rfc: + - rfc5584 + template: + - audio/ATRAC3 + registered: true +- !ruby/object:MIME::Type + content-type: audio/basic + friendly: + en: Sun Audio - Au file format + encoding: base64 + extensions: + - au + - snd + xrefs: + rfc: + - rfc2045 + - rfc2046 + template: + - audio/basic + registered: true +- !ruby/object:MIME::Type + content-type: audio/BV16 + encoding: base64 + xrefs: + rfc: + - rfc4298 + template: + - audio/BV16 + registered: true +- !ruby/object:MIME::Type + content-type: audio/BV32 + encoding: base64 + xrefs: + rfc: + - rfc4298 + template: + - audio/BV32 + registered: true +- !ruby/object:MIME::Type + content-type: audio/clearmode + encoding: base64 + xrefs: + rfc: + - rfc4040 + template: + - audio/clearmode + registered: true +- !ruby/object:MIME::Type + content-type: audio/CN + encoding: base64 + xrefs: + rfc: + - rfc3389 + template: + - audio/CN + registered: true +- !ruby/object:MIME::Type + content-type: audio/DAT12 + encoding: base64 + xrefs: + rfc: + - rfc3190 + template: + - audio/DAT12 + registered: true +- !ruby/object:MIME::Type + content-type: audio/dls + encoding: base64 + xrefs: + rfc: + - rfc4613 + template: + - audio/dls + registered: true +- !ruby/object:MIME::Type + content-type: audio/dsr-es201108 + encoding: base64 + xrefs: + rfc: + - rfc3557 + template: + - audio/dsr-es201108 + registered: true +- !ruby/object:MIME::Type + content-type: audio/dsr-es202050 + encoding: base64 + xrefs: + rfc: + - rfc4060 + template: + - audio/dsr-es202050 + registered: true +- !ruby/object:MIME::Type + content-type: audio/dsr-es202211 + encoding: base64 + xrefs: + rfc: + - rfc4060 + template: + - audio/dsr-es202211 + registered: true +- !ruby/object:MIME::Type + content-type: audio/dsr-es202212 + encoding: base64 + xrefs: + rfc: + - rfc4060 + template: + - audio/dsr-es202212 + registered: true +- !ruby/object:MIME::Type + content-type: audio/DV + encoding: base64 + xrefs: + rfc: + - rfc6469 + template: + - audio/DV + registered: true +- !ruby/object:MIME::Type + content-type: audio/DVI4 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/DVI4 + registered: true +- !ruby/object:MIME::Type + content-type: audio/eac3 + encoding: base64 + xrefs: + rfc: + - rfc4598 + template: + - audio/eac3 + registered: true +- !ruby/object:MIME::Type + content-type: audio/encaprtp + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - audio/encaprtp + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRC + encoding: base64 + extensions: + - evc + xrefs: + rfc: + - rfc4788 + template: + - audio/EVRC + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRC-QCP + encoding: base64 + xrefs: + rfc: + - rfc3625 + template: + - audio/EVRC-QCP + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRC0 + encoding: base64 + xrefs: + rfc: + - rfc4788 + template: + - audio/EVRC0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRC1 + encoding: base64 + xrefs: + rfc: + - rfc4788 + template: + - audio/EVRC1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCB + encoding: base64 + xrefs: + rfc: + - rfc5188 + template: + - audio/EVRCB + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCB0 + encoding: base64 + xrefs: + rfc: + - rfc5188 + template: + - audio/EVRCB0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCB1 + encoding: base64 + xrefs: + rfc: + - rfc4788 + template: + - audio/EVRCB1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCNW + encoding: base64 + xrefs: + rfc: + - rfc6884 + template: + - audio/EVRCNW + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCNW0 + encoding: base64 + xrefs: + rfc: + - rfc6884 + template: + - audio/EVRCNW0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCNW1 + encoding: base64 + xrefs: + rfc: + - rfc6884 + template: + - audio/EVRCNW1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCWB + encoding: base64 + xrefs: + rfc: + - rfc5188 + template: + - audio/EVRCWB + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCWB0 + encoding: base64 + xrefs: + rfc: + - rfc5188 + template: + - audio/EVRCWB0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVRCWB1 + encoding: base64 + xrefs: + rfc: + - rfc5188 + template: + - audio/EVRCWB1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/EVS + encoding: base64 + xrefs: + person: + - Kyunghun_Jung + - _3GPP + template: + - audio/EVS + registered: true +- !ruby/object:MIME::Type + content-type: audio/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - audio/example + registered: true +- !ruby/object:MIME::Type + content-type: audio/flexfec + encoding: base64 + xrefs: + rfc: + - rfc8627 + template: + - audio/flexfec + registered: true +- !ruby/object:MIME::Type + content-type: audio/fwdred + encoding: base64 + xrefs: + rfc: + - rfc6354 + template: + - audio/fwdred + registered: true +- !ruby/object:MIME::Type + content-type: audio/G711-0 + encoding: base64 + xrefs: + rfc: + - rfc7655 + template: + - audio/G711-0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G719 + encoding: base64 + xrefs: + rfc: + - rfc5404 + rfc-errata: + - '3245' + template: + - audio/G719 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G722 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G722 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G7221 + encoding: base64 + xrefs: + rfc: + - rfc5577 + template: + - audio/G7221 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G723 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G723 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G726-16 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G726-16 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G726-24 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G726-24 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G726-32 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G726-32 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G726-40 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G726-40 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G728 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G728 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G729 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G729 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G7291 + encoding: base64 + xrefs: + rfc: + - rfc4749 + - rfc5459 + template: + - audio/G7291 + registered: true +- !ruby/object:MIME::Type + content-type: audio/G729D + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G729D + registered: true +- !ruby/object:MIME::Type + content-type: audio/G729E + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/G729E + registered: true +- !ruby/object:MIME::Type + content-type: audio/GSM + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/GSM + registered: true +- !ruby/object:MIME::Type + content-type: audio/GSM-EFR + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/GSM-EFR + registered: true +- !ruby/object:MIME::Type + content-type: audio/GSM-HR-08 + encoding: base64 + xrefs: + rfc: + - rfc5993 + template: + - audio/GSM-HR-08 + registered: true +- !ruby/object:MIME::Type + content-type: audio/iLBC + encoding: base64 + xrefs: + rfc: + - rfc3952 + template: + - audio/iLBC + registered: true +- !ruby/object:MIME::Type + content-type: audio/ip-mr_v2.5 + encoding: base64 + xrefs: + rfc: + - rfc6262 + template: + - audio/ip-mr_v2.5 + registered: true +- !ruby/object:MIME::Type + content-type: audio/L16 + encoding: base64 + extensions: + - l16 + xrefs: + rfc: + - rfc4856 + template: + - audio/L16 + registered: true +- !ruby/object:MIME::Type + content-type: audio/L20 + encoding: base64 + xrefs: + rfc: + - rfc3190 + template: + - audio/L20 + registered: true +- !ruby/object:MIME::Type + content-type: audio/L24 + encoding: base64 + xrefs: + rfc: + - rfc3190 + template: + - audio/L24 + registered: true +- !ruby/object:MIME::Type + content-type: audio/L8 + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/L8 + registered: true +- !ruby/object:MIME::Type + content-type: audio/LPC + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/LPC + registered: true +- !ruby/object:MIME::Type + content-type: audio/MELP + encoding: base64 + xrefs: + rfc: + - rfc8130 + template: + - audio/MELP + registered: true +- !ruby/object:MIME::Type + content-type: audio/MELP1200 + encoding: base64 + xrefs: + rfc: + - rfc8130 + template: + - audio/MELP1200 + registered: true +- !ruby/object:MIME::Type + content-type: audio/MELP2400 + encoding: base64 + xrefs: + rfc: + - rfc8130 + template: + - audio/MELP2400 + registered: true +- !ruby/object:MIME::Type + content-type: audio/MELP600 + encoding: base64 + xrefs: + rfc: + - rfc8130 + template: + - audio/MELP600 + registered: true +- !ruby/object:MIME::Type + content-type: audio/mhas + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - Ingo_Hofmann + - Nils_Peters + template: + - audio/mhas + registered: true +- !ruby/object:MIME::Type + content-type: audio/midi + friendly: + en: MIDI - Musical Instrument Digital Interface + encoding: base64 + extensions: + - kar + - mid + - midi + - rmi + registered: false +- !ruby/object:MIME::Type + content-type: audio/mobile-xmf + encoding: base64 + xrefs: + rfc: + - rfc4723 + template: + - audio/mobile-xmf + registered: true +- !ruby/object:MIME::Type + content-type: audio/mp4 + friendly: + en: MPEG-4 Audio + encoding: base64 + extensions: + - mp4 + - mpg4 + - f4a + - f4b + - mp4a + - m4a + xrefs: + rfc: + - rfc4337 + - rfc6381 + template: + - audio/mp4 + registered: true +- !ruby/object:MIME::Type + content-type: audio/MP4A-LATM + encoding: base64 + extensions: + - m4a + xrefs: + rfc: + - rfc6416 + template: + - audio/MP4A-LATM + registered: true +- !ruby/object:MIME::Type + content-type: audio/MPA + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - audio/MPA + registered: true +- !ruby/object:MIME::Type + content-type: audio/mpa-robust + encoding: base64 + xrefs: + rfc: + - rfc5219 + template: + - audio/mpa-robust + registered: true +- !ruby/object:MIME::Type + content-type: audio/mpeg + friendly: + en: MPEG Audio + encoding: base64 + extensions: + - mpga + - mp2 + - mp3 + - m2a + - m3a + - mp2a + xrefs: + rfc: + - rfc3003 + template: + - audio/mpeg + registered: true +- !ruby/object:MIME::Type + content-type: audio/mpeg4-generic + encoding: base64 + xrefs: + rfc: + - rfc3640 + - rfc5691 + - rfc6295 + template: + - audio/mpeg4-generic + registered: true +- !ruby/object:MIME::Type + content-type: audio/ogg + friendly: + en: Ogg Audio + encoding: base64 + extensions: + - oga + - ogg + - spx + - opus + xrefs: + rfc: + - rfc5334 + - rfc7845 + template: + - audio/ogg + registered: true +- !ruby/object:MIME::Type + content-type: audio/opus + encoding: base64 + xrefs: + rfc: + - rfc7587 + template: + - audio/opus + registered: true +- !ruby/object:MIME::Type + content-type: audio/parityfec + encoding: base64 + xrefs: + rfc: + - rfc3009 + template: + - audio/parityfec + registered: true +- !ruby/object:MIME::Type + content-type: audio/PCMA + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/PCMA + registered: true +- !ruby/object:MIME::Type + content-type: audio/PCMA-WB + encoding: base64 + xrefs: + rfc: + - rfc5391 + template: + - audio/PCMA-WB + registered: true +- !ruby/object:MIME::Type + content-type: audio/PCMU + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/PCMU + registered: true +- !ruby/object:MIME::Type + content-type: audio/PCMU-WB + encoding: base64 + xrefs: + rfc: + - rfc5391 + template: + - audio/PCMU-WB + registered: true +- !ruby/object:MIME::Type + content-type: audio/prs.sid + encoding: base64 + xrefs: + person: + - Linus_Walleij + template: + - audio/prs.sid + registered: true +- !ruby/object:MIME::Type + content-type: audio/QCELP + encoding: base64 + xrefs: + rfc: + - rfc3555 + - rfc3625 + template: + - audio/QCELP + registered: true +- !ruby/object:MIME::Type + content-type: audio/raptorfec + encoding: base64 + xrefs: + rfc: + - rfc6682 + template: + - audio/raptorfec + registered: true +- !ruby/object:MIME::Type + content-type: audio/RED + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - audio/RED + registered: true +- !ruby/object:MIME::Type + content-type: audio/rtp-enc-aescm128 + encoding: base64 + xrefs: + person: + - _3GPP + template: + - audio/rtp-enc-aescm128 + registered: true +- !ruby/object:MIME::Type + content-type: audio/rtp-midi + encoding: base64 + xrefs: + rfc: + - rfc6295 + template: + - audio/rtp-midi + registered: true +- !ruby/object:MIME::Type + content-type: audio/rtploopback + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - audio/rtploopback + registered: true +- !ruby/object:MIME::Type + content-type: audio/rtx + encoding: base64 + xrefs: + rfc: + - rfc4588 + template: + - audio/rtx + registered: true +- !ruby/object:MIME::Type + content-type: audio/s3m + encoding: base64 + extensions: + - s3m + registered: false +- !ruby/object:MIME::Type + content-type: audio/scip + encoding: base64 + xrefs: + person: + - Daniel_Hanson + - Michael_Faller + - SCIP + template: + - audio/scip + registered: true +- !ruby/object:MIME::Type + content-type: audio/silk + encoding: base64 + extensions: + - sil + registered: false +- !ruby/object:MIME::Type + content-type: audio/SMV + encoding: base64 + extensions: + - smv + xrefs: + rfc: + - rfc3558 + template: + - audio/SMV + registered: true +- !ruby/object:MIME::Type + content-type: audio/SMV-QCP + encoding: base64 + xrefs: + rfc: + - rfc3625 + template: + - audio/SMV-QCP + registered: true +- !ruby/object:MIME::Type + content-type: audio/SMV0 + encoding: base64 + xrefs: + rfc: + - rfc3558 + template: + - audio/SMV0 + registered: true +- !ruby/object:MIME::Type + content-type: audio/sofa + encoding: base64 + xrefs: + person: + - AES + - Piotr_Majdak + template: + - audio/sofa + registered: true +- !ruby/object:MIME::Type + content-type: audio/sp-midi + encoding: base64 + xrefs: + person: + - Timo_Kosonen + - Tom_White + template: + - audio/sp-midi + registered: true +- !ruby/object:MIME::Type + content-type: audio/speex + encoding: base64 + xrefs: + rfc: + - rfc5574 + template: + - audio/speex + registered: true +- !ruby/object:MIME::Type + content-type: audio/t140c + encoding: base64 + xrefs: + rfc: + - rfc4351 + template: + - audio/t140c + registered: true +- !ruby/object:MIME::Type + content-type: audio/t38 + encoding: base64 + xrefs: + rfc: + - rfc4612 + template: + - audio/t38 + registered: true +- !ruby/object:MIME::Type + content-type: audio/telephone-event + encoding: base64 + xrefs: + rfc: + - rfc4733 + template: + - audio/telephone-event + registered: true +- !ruby/object:MIME::Type + content-type: audio/TETRA_ACELP + encoding: base64 + xrefs: + person: + - ETSI + - Miguel_Angel_Reina_Ortega + template: + - audio/TETRA_ACELP + registered: true +- !ruby/object:MIME::Type + content-type: audio/TETRA_ACELP_BB + encoding: base64 + xrefs: + person: + - ETSI + - Miguel_Angel_Reina_Ortega + template: + - audio/TETRA_ACELP_BB + registered: true +- !ruby/object:MIME::Type + content-type: audio/tone + encoding: base64 + xrefs: + rfc: + - rfc4733 + template: + - audio/tone + registered: true +- !ruby/object:MIME::Type + content-type: audio/TSVCIS + encoding: base64 + xrefs: + rfc: + - rfc8817 + template: + - audio/TSVCIS + registered: true +- !ruby/object:MIME::Type + content-type: audio/UEMCLIP + encoding: base64 + xrefs: + rfc: + - rfc5686 + template: + - audio/UEMCLIP + registered: true +- !ruby/object:MIME::Type + content-type: audio/ulpfec + encoding: base64 + xrefs: + rfc: + - rfc5109 + template: + - audio/ulpfec + registered: true +- !ruby/object:MIME::Type + content-type: audio/usac + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - Max_Neuendorf + template: + - audio/usac + registered: true +- !ruby/object:MIME::Type + content-type: audio/VDVI + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - audio/VDVI + registered: true +- !ruby/object:MIME::Type + content-type: audio/VMR-WB + encoding: base64 + xrefs: + rfc: + - rfc4348 + - rfc4424 + template: + - audio/VMR-WB + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.3gpp.iufp + encoding: base64 + xrefs: + person: + - Thomas_Belling + template: + - audio/vnd.3gpp.iufp + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.4SB + encoding: base64 + xrefs: + person: + - Serge_De_Jaham + template: + - audio/vnd.4SB + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.audiokoz + encoding: base64 + xrefs: + person: + - Vicki_DeBarros + template: + - audio/vnd.audiokoz + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.CELP + encoding: base64 + xrefs: + person: + - Serge_De_Jaham + template: + - audio/vnd.CELP + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.cisco.nse + encoding: base64 + xrefs: + person: + - Rajesh_Kumar + template: + - audio/vnd.cisco.nse + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.cmles.radio-events + encoding: base64 + xrefs: + person: + - Jean-Philippe_Goulet + template: + - audio/vnd.cmles.radio-events + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.cns.anp1 + encoding: base64 + xrefs: + person: + - Ann_McLaughlin + template: + - audio/vnd.cns.anp1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.cns.inf1 + encoding: base64 + xrefs: + person: + - Ann_McLaughlin + template: + - audio/vnd.cns.inf1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dece.audio + friendly: + en: DECE Audio + encoding: base64 + extensions: + - uva + - uvva + xrefs: + person: + - Michael_A_Dolan + template: + - audio/vnd.dece.audio + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.digital-winds + friendly: + en: Digital Winds Music + encoding: 7bit + extensions: + - eol + xrefs: + person: + - Armands_Strazds + template: + - audio/vnd.digital-winds + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dlna.adts + encoding: base64 + xrefs: + person: + - Edwin_Heredia + template: + - audio/vnd.dlna.adts + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.heaac.1 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.heaac.1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.heaac.2 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.heaac.2 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.mlp + encoding: base64 + xrefs: + person: + - Mike_Ward + template: + - audio/vnd.dolby.mlp + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.mps + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.mps + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.pl2 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.pl2 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.pl2x + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.pl2x + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.pl2z + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.pl2z + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dolby.pulse.1 + encoding: base64 + xrefs: + person: + - Steve_Hattersley + template: + - audio/vnd.dolby.pulse.1 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dra + friendly: + en: DRA Audio + encoding: base64 + extensions: + - dra + xrefs: + person: + - Jiang_Tian + template: + - audio/vnd.dra + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dts + friendly: + en: DTS Audio + encoding: base64 + extensions: + - dts + xrefs: + person: + - William_Zou + template: + - audio/vnd.dts + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dts.hd + friendly: + en: DTS High Definition Audio + encoding: base64 + extensions: + - dtshd + xrefs: + person: + - William_Zou + template: + - audio/vnd.dts.hd + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dts.uhd + encoding: base64 + xrefs: + person: + - Phillip_Maness + template: + - audio/vnd.dts.uhd + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.dvb.file + encoding: base64 + xrefs: + person: + - Peter_Siebert + template: + - audio/vnd.dvb.file + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.everad.plj + encoding: base64 + extensions: + - plj + xrefs: + person: + - Shay_Cicelsky + template: + - audio/vnd.everad.plj + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.hns.audio + encoding: base64 + xrefs: + person: + - Swaminathan + template: + - audio/vnd.hns.audio + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.lucent.voice + friendly: + en: Lucent Voice + encoding: base64 + extensions: + - lvp + xrefs: + person: + - Greg_Vaudreuil + template: + - audio/vnd.lucent.voice + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.ms-playready.media.pya + friendly: + en: Microsoft PlayReady Ecosystem + encoding: base64 + extensions: + - pya + xrefs: + person: + - Steve_DiAcetis + template: + - audio/vnd.ms-playready.media.pya + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.nokia.mobile-xmf + encoding: base64 + extensions: + - mxmf + xrefs: + person: + - Nokia + template: + - audio/vnd.nokia.mobile-xmf + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.nortel.vbk + encoding: base64 + extensions: + - vbk + xrefs: + person: + - Glenn_Parsons + template: + - audio/vnd.nortel.vbk + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.nuera.ecelp4800 + friendly: + en: Nuera ECELP 4800 + encoding: base64 + extensions: + - ecelp4800 + xrefs: + person: + - Michael_Fox + template: + - audio/vnd.nuera.ecelp4800 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.nuera.ecelp7470 + friendly: + en: Nuera ECELP 7470 + encoding: base64 + extensions: + - ecelp7470 + xrefs: + person: + - Michael_Fox + template: + - audio/vnd.nuera.ecelp7470 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.nuera.ecelp9600 + friendly: + en: Nuera ECELP 9600 + encoding: base64 + extensions: + - ecelp9600 + xrefs: + person: + - Michael_Fox + template: + - audio/vnd.nuera.ecelp9600 + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.octel.sbc + encoding: base64 + xrefs: + person: + - Greg_Vaudreuil + template: + - audio/vnd.octel.sbc + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.presonus.multitrack + encoding: base64 + xrefs: + person: + - Matthias_Juwan + template: + - audio/vnd.presonus.multitrack + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.qcelp + encoding: base64 + extensions: + - qcp + obsolete: true + use-instead: audio/qcelp + xrefs: + rfc: + - rfc3625 + template: + - audio/vnd.qcelp + notes: + - "- DEPRECATED in favor of audio/qcelp" + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.rhetorex.32kadpcm + encoding: base64 + xrefs: + person: + - Greg_Vaudreuil + template: + - audio/vnd.rhetorex.32kadpcm + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.rip + friendly: + en: Hit'n'Mix + encoding: base64 + extensions: + - rip + xrefs: + person: + - Martin_Dawe + template: + - audio/vnd.rip + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.sealedmedia.softseal.mpeg + encoding: base64 + extensions: + - smp3 + - smp + - s1m + xrefs: + person: + - David_Petersen + template: + - audio/vnd.sealedmedia.softseal.mpeg + registered: true +- !ruby/object:MIME::Type + content-type: audio/vnd.vmx.cvsd + encoding: base64 + xrefs: + person: + - Greg_Vaudreuil + template: + - audio/vnd.vmx.cvsd + registered: true +- !ruby/object:MIME::Type + content-type: audio/vorbis + encoding: base64 + xrefs: + rfc: + - rfc5215 + template: + - audio/vorbis + registered: true +- !ruby/object:MIME::Type + content-type: audio/vorbis-config + encoding: base64 + xrefs: + rfc: + - rfc5215 + template: + - audio/vorbis-config + registered: true +- !ruby/object:MIME::Type + content-type: audio/wav + friendly: + en: Waveform Audio File Format (WAV) + encoding: base64 + extensions: + - wav + registered: false +- !ruby/object:MIME::Type + content-type: audio/webm + friendly: + en: Open Web Media Project - Audio + encoding: base64 + extensions: + - weba + - webm + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-aac + friendly: + en: Advanced Audio Coding (AAC) + encoding: base64 + extensions: + - aac + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-aiff + friendly: + en: Audio Interchange File Format + encoding: base64 + extensions: + - aif + - aifc + - aiff + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-caf + encoding: base64 + extensions: + - caf + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-flac + encoding: base64 + extensions: + - flac + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-m4a + encoding: base64 + extensions: + - m4a + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-matroska + encoding: base64 + extensions: + - mka + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-midi + encoding: base64 + extensions: + - mid + - midi + - kar + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-mpegurl + friendly: + en: M3U (Multimedia Playlist) + encoding: base64 + extensions: + - m3u + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-ms-wax + friendly: + en: Microsoft Windows Media Audio Redirector + encoding: base64 + extensions: + - wax + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-ms-wma + friendly: + en: Microsoft Windows Media Audio + encoding: base64 + extensions: + - wma + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-ms-wmv + encoding: base64 + extensions: + - wmv + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-pn-realaudio + friendly: + en: Real Audio Sound + encoding: base64 + extensions: + - ra + - ram + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-pn-realaudio-plugin + friendly: + en: Real Audio Sound + encoding: base64 + extensions: + - rmp + - rpm + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-realaudio + encoding: base64 + extensions: + - ra + registered: false +- !ruby/object:MIME::Type + content-type: audio/x-wav + friendly: + en: Waveform Audio File Format (WAV) + encoding: base64 + extensions: + - wav + registered: false +- !ruby/object:MIME::Type + content-type: audio/xm + encoding: base64 + extensions: + - xm + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/chemical.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/chemical.yaml new file mode 100644 index 0000000..188342e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/chemical.yaml @@ -0,0 +1,71 @@ +--- +- !ruby/object:MIME::Type + content-type: chemical/x-cdx + friendly: + en: ChemDraw eXchange file + encoding: base64 + extensions: + - cdx + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-cif + friendly: + en: Crystallographic Interchange Format + encoding: base64 + extensions: + - cif + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-cmdf + friendly: + en: CrystalMaker Data Format + encoding: base64 + extensions: + - cmdf + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-cml + friendly: + en: Chemical Markup Language + encoding: base64 + extensions: + - cml + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-csml + friendly: + en: Chemical Style Markup Language + encoding: base64 + extensions: + - csml + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-pdb + encoding: base64 + extensions: + - pdb + obsolete: true + use-instead: x-chemical/x-pdb + registered: false +- !ruby/object:MIME::Type + content-type: chemical/x-xyz + friendly: + en: XYZ File Format + encoding: base64 + extensions: + - xyz + obsolete: true + use-instead: x-chemical/x-xyz + registered: false +- !ruby/object:MIME::Type + content-type: x-chemical/x-pdb + encoding: base64 + extensions: + - pdb + registered: false +- !ruby/object:MIME::Type + content-type: x-chemical/x-xyz + encoding: base64 + extensions: + - xyz + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/conference.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/conference.yaml new file mode 100644 index 0000000..c0d26c4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/conference.yaml @@ -0,0 +1,9 @@ +--- +- !ruby/object:MIME::Type + content-type: x-conference/x-cooltalk + friendly: + en: CoolTalk + encoding: base64 + extensions: + - ice + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/drawing.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/drawing.yaml new file mode 100644 index 0000000..d66b8c4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/drawing.yaml @@ -0,0 +1,15 @@ +--- +- !ruby/object:MIME::Type + content-type: drawing/dwf + encoding: base64 + extensions: + - dwf + obsolete: true + use-instead: x-drawing/dwf + registered: false +- !ruby/object:MIME::Type + content-type: x-drawing/dwf + encoding: base64 + extensions: + - dwf + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/font.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/font.yaml new file mode 100644 index 0000000..9943732 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/font.yaml @@ -0,0 +1,65 @@ +--- +- !ruby/object:MIME::Type + content-type: font/collection + encoding: base64 + extensions: + - ttc + xrefs: + rfc: + - rfc8081 + template: + - font/collection + registered: true +- !ruby/object:MIME::Type + content-type: font/otf + encoding: base64 + extensions: + - otf + xrefs: + rfc: + - rfc8081 + template: + - font/otf + registered: true +- !ruby/object:MIME::Type + content-type: font/sfnt + encoding: base64 + xrefs: + rfc: + - rfc8081 + template: + - font/sfnt + registered: true +- !ruby/object:MIME::Type + content-type: font/ttf + encoding: base64 + extensions: + - ttf + xrefs: + rfc: + - rfc8081 + template: + - font/ttf + registered: true +- !ruby/object:MIME::Type + content-type: font/woff + encoding: base64 + extensions: + - woff + xrefs: + rfc: + - rfc8081 + template: + - font/woff + registered: true +- !ruby/object:MIME::Type + content-type: font/woff2 + encoding: base64 + extensions: + - woff2 + xrefs: + rfc: + - rfc8081 + template: + - font/woff2 + registered: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/image.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/image.yaml new file mode 100644 index 0000000..2685e07 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/image.yaml @@ -0,0 +1,1252 @@ +--- +- !ruby/object:MIME::Type + content-type: image/aces + encoding: base64 + xrefs: + person: + - Howard_Lukk + - SMPTE + template: + - image/aces + registered: true +- !ruby/object:MIME::Type + content-type: image/avci + encoding: base64 + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/avci + registered: true +- !ruby/object:MIME::Type + content-type: image/avcs + encoding: base64 + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/avcs + registered: true +- !ruby/object:MIME::Type + content-type: image/avif + encoding: base64 + extensions: + - avif + xrefs: + person: + - Alliance_for_Open_Media + - Cyril_Concolato + template: + - image/avif + registered: true +- !ruby/object:MIME::Type + content-type: image/bmp + friendly: + en: Bitmap Image File + encoding: base64 + extensions: + - bmp + xrefs: + rfc: + - rfc7903 + template: + - image/bmp + registered: true +- !ruby/object:MIME::Type + content-type: image/cgm + friendly: + en: Computer Graphics Metafile + encoding: base64 + extensions: + - cgm + xrefs: + person: + - Alan_Francis + template: + - image/cgm + registered: true +- !ruby/object:MIME::Type + content-type: image/cmu-raster + encoding: base64 + obsolete: true + use-instead: image/x-cmu-raster + registered: false +- !ruby/object:MIME::Type + content-type: image/dicom-rle + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - David_Clunie + template: + - image/dicom-rle + registered: true +- !ruby/object:MIME::Type + content-type: image/emf + encoding: base64 + xrefs: + rfc: + - rfc7903 + template: + - image/emf + registered: true +- !ruby/object:MIME::Type + content-type: image/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - image/example + registered: true +- !ruby/object:MIME::Type + content-type: image/fits + encoding: base64 + xrefs: + rfc: + - rfc4047 + template: + - image/fits + registered: true +- !ruby/object:MIME::Type + content-type: image/g3fax + friendly: + en: G3 Fax Image + encoding: base64 + extensions: + - g3 + xrefs: + rfc: + - rfc1494 + template: + - image/g3fax + registered: true +- !ruby/object:MIME::Type + content-type: image/gif + friendly: + en: Graphics Interchange Format + encoding: base64 + extensions: + - gif + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: image/heic + encoding: base64 + extensions: + - heic + - hif + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/heic + registered: true +- !ruby/object:MIME::Type + content-type: image/heic-sequence + encoding: base64 + extensions: + - heics + - hif + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/heic-sequence + registered: true +- !ruby/object:MIME::Type + content-type: image/heif + encoding: base64 + extensions: + - heif + - hif + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/heif + registered: true +- !ruby/object:MIME::Type + content-type: image/heif-sequence + encoding: base64 + extensions: + - heifs + - hif + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - image/heif-sequence + registered: true +- !ruby/object:MIME::Type + content-type: image/hej2k + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/hej2k + registered: true +- !ruby/object:MIME::Type + content-type: image/hsj2 + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/hsj2 + registered: true +- !ruby/object:MIME::Type + content-type: image/ief + friendly: + en: Image Exchange Format + encoding: base64 + extensions: + - ief + xrefs: + rfc: + - rfc1314 + registered: true +- !ruby/object:MIME::Type + content-type: image/jls + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - David_Clunie + template: + - image/jls + registered: true +- !ruby/object:MIME::Type + content-type: image/jp2 + encoding: base64 + extensions: + - jp2 + - jpg2 + xrefs: + rfc: + - rfc3745 + template: + - image/jp2 + registered: true +- !ruby/object:MIME::Type + content-type: image/jpeg + friendly: + en: JPEG Image + encoding: base64 + extensions: + - jpeg + - jpg + - jpe + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: image/jph + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/jph + registered: true +- !ruby/object:MIME::Type + content-type: image/jphc + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/jphc + registered: true +- !ruby/object:MIME::Type + content-type: image/jpm + encoding: base64 + extensions: + - jpm + - jpgm + xrefs: + rfc: + - rfc3745 + template: + - image/jpm + registered: true +- !ruby/object:MIME::Type + content-type: image/jpx + encoding: base64 + extensions: + - jpx + - jpf + xrefs: + rfc: + - rfc3745 + template: + - image/jpx + registered: true +- !ruby/object:MIME::Type + content-type: image/jxr + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/jxr + registered: true +- !ruby/object:MIME::Type + content-type: image/jxrA + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/jxrA + registered: true +- !ruby/object:MIME::Type + content-type: image/jxrS + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + - ITU-T + template: + - image/jxrS + registered: true +- !ruby/object:MIME::Type + content-type: image/jxs + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + template: + - image/jxs + registered: true +- !ruby/object:MIME::Type + content-type: image/jxsc + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + template: + - image/jxsc + registered: true +- !ruby/object:MIME::Type + content-type: image/jxsi + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + template: + - image/jxsi + registered: true +- !ruby/object:MIME::Type + content-type: image/jxss + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC1 + template: + - image/jxss + registered: true +- !ruby/object:MIME::Type + content-type: image/ktx + friendly: + en: OpenGL Textures (KTX) + encoding: base64 + extensions: + - ktx + xrefs: + person: + - Khronos + - Mark_Callow + template: + - image/ktx + registered: true +- !ruby/object:MIME::Type + content-type: image/ktx2 + encoding: base64 + xrefs: + person: + - Khronos + - Mark_Callow + template: + - image/ktx2 + registered: true +- !ruby/object:MIME::Type + content-type: image/naplps + encoding: base64 + xrefs: + person: + - Ilya_Ferber + template: + - image/naplps + registered: true +- !ruby/object:MIME::Type + content-type: image/pjpeg + docs: Fixes a bug with IE6 and progressive JPEGs + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: image/png + friendly: + en: Portable Network Graphics (PNG) + encoding: base64 + extensions: + - png + xrefs: + person: + - PNG_Working_Group + - W3C + template: + - image/png + registered: true +- !ruby/object:MIME::Type + content-type: image/prs.btif + friendly: + en: BTIF + encoding: base64 + extensions: + - btif + xrefs: + person: + - Ben_Simon + template: + - image/prs.btif + registered: true +- !ruby/object:MIME::Type + content-type: image/prs.pti + encoding: base64 + xrefs: + person: + - Juern_Laun + template: + - image/prs.pti + registered: true +- !ruby/object:MIME::Type + content-type: image/pwg-raster + encoding: base64 + xrefs: + person: + - Michael_Sweet + template: + - image/pwg-raster + registered: true +- !ruby/object:MIME::Type + content-type: image/sgi + encoding: base64 + extensions: + - sgi + registered: false +- !ruby/object:MIME::Type + content-type: image/svg+xml + friendly: + en: Scalable Vector Graphics (SVG) + encoding: 8bit + extensions: + - svg + - svgz + xrefs: + person: + - W3C + uri: + - http://www.w3.org/TR/SVG/mimereg.html + template: + - image/svg+xml + registered: true +- !ruby/object:MIME::Type + content-type: image/t38 + encoding: base64 + xrefs: + rfc: + - rfc3362 + template: + - image/t38 + registered: true +- !ruby/object:MIME::Type + content-type: image/targa + encoding: base64 + extensions: + - tga + obsolete: true + use-instead: image/x-targa + registered: false +- !ruby/object:MIME::Type + content-type: image/tiff + friendly: + en: Tagged Image File Format + encoding: base64 + extensions: + - tiff + - tif + xrefs: + rfc: + - rfc3302 + template: + - image/tiff + registered: true +- !ruby/object:MIME::Type + content-type: image/tiff-fx + encoding: base64 + xrefs: + rfc: + - rfc3950 + template: + - image/tiff-fx + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.adobe.photoshop + friendly: + en: Photoshop Document + encoding: base64 + extensions: + - psd + xrefs: + person: + - Kim_Scarborough + template: + - image/vnd.adobe.photoshop + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.airzip.accelerator.azv + encoding: base64 + xrefs: + person: + - Gary_Clueit + template: + - image/vnd.airzip.accelerator.azv + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.cns.inf2 + encoding: base64 + xrefs: + person: + - Ann_McLaughlin + template: + - image/vnd.cns.inf2 + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.dece.graphic + friendly: + en: DECE Graphic + encoding: base64 + extensions: + - uvg + - uvi + - uvvg + - uvvi + xrefs: + person: + - Michael_A_Dolan + template: + - image/vnd.dece.graphic + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.dgn + encoding: base64 + extensions: + - dgn + obsolete: true + use-instead: image/x-vnd.dgn + registered: false +- !ruby/object:MIME::Type + content-type: image/vnd.djvu + friendly: + en: DjVu + encoding: base64 + extensions: + - djvu + - djv + xrefs: + person: + - Leon_Bottou + template: + - image/vnd.djvu + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.dvb.subtitle + friendly: + en: Close Captioning - Subtitle + encoding: base64 + extensions: + - sub + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - image/vnd.dvb.subtitle + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.dwg + friendly: + en: DWG Drawing + encoding: base64 + extensions: + - dwg + xrefs: + person: + - Jodi_Moline + template: + - image/vnd.dwg + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.dxf + friendly: + en: AutoCAD DXF + encoding: base64 + extensions: + - dxf + xrefs: + person: + - Jodi_Moline + template: + - image/vnd.dxf + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.fastbidsheet + friendly: + en: FastBid Sheet + encoding: base64 + extensions: + - fbs + xrefs: + person: + - Scott_Becker + template: + - image/vnd.fastbidsheet + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.fpx + friendly: + en: FlashPix + encoding: base64 + extensions: + - fpx + xrefs: + person: + - Marc_Douglas_Spencer + template: + - image/vnd.fpx + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.fst + friendly: + en: FAST Search & Transfer ASA + encoding: base64 + extensions: + - fst + xrefs: + person: + - Arild_Fuldseth + template: + - image/vnd.fst + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.fujixerox.edmics-mmr + friendly: + en: EDMICS 2000 + encoding: base64 + extensions: + - mmr + xrefs: + person: + - Masanori_Onda + template: + - image/vnd.fujixerox.edmics-mmr + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.fujixerox.edmics-rlc + friendly: + en: EDMICS 2000 + encoding: base64 + extensions: + - rlc + xrefs: + person: + - Masanori_Onda + template: + - image/vnd.fujixerox.edmics-rlc + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.globalgraphics.pgb + encoding: base64 + extensions: + - pgb + xrefs: + person: + - Martin_Bailey + template: + - image/vnd.globalgraphics.pgb + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.microsoft.icon + encoding: base64 + extensions: + - ico + xrefs: + person: + - Simon_Butcher + template: + - image/vnd.microsoft.icon + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.mix + encoding: base64 + xrefs: + person: + - Saveen_Reddy + template: + - image/vnd.mix + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.mozilla.apng + encoding: base64 + xrefs: + person: + - Stuart_Parmenter + template: + - image/vnd.mozilla.apng + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.ms-modi + friendly: + en: Microsoft Document Imaging Format + encoding: base64 + extensions: + - mdi + xrefs: + person: + - Gregory_Vaughan + template: + - image/vnd.ms-modi + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.ms-photo + encoding: base64 + extensions: + - wdp + registered: false +- !ruby/object:MIME::Type + content-type: image/vnd.net-fpx + friendly: + en: FlashPix + encoding: base64 + extensions: + - npx + xrefs: + person: + - Marc_Douglas_Spencer + template: + - image/vnd.net-fpx + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.net.fpx + encoding: base64 + obsolete: true + use-instead: image/vnd.net-fpx + registered: false +- !ruby/object:MIME::Type + content-type: image/vnd.pco.b16 + encoding: base64 + xrefs: + person: + - Jan_Zeman + - PCO_AG + template: + - image/vnd.pco.b16 + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.radiance + encoding: base64 + xrefs: + person: + - Greg_Ward + - Randolph_Fritz + template: + - image/vnd.radiance + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.sealed.png + encoding: base64 + xrefs: + person: + - David_Petersen + template: + - image/vnd.sealed.png + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.sealedmedia.softseal.gif + encoding: base64 + xrefs: + person: + - David_Petersen + template: + - image/vnd.sealedmedia.softseal.gif + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.sealedmedia.softseal.jpg + encoding: base64 + xrefs: + person: + - David_Petersen + template: + - image/vnd.sealedmedia.softseal.jpg + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.svf + encoding: base64 + xrefs: + person: + - Jodi_Moline + template: + - image/vnd.svf + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.tencent.tap + encoding: base64 + xrefs: + person: + - Ni_Hui + template: + - image/vnd.tencent.tap + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.valve.source.texture + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - image/vnd.valve.source.texture + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.wap.wbmp + friendly: + en: WAP Bitamp (WBMP) + encoding: base64 + extensions: + - wbmp + xrefs: + person: + - Peter_Stark + template: + - image/vnd.wap.wbmp + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.xiff + friendly: + en: eXtended Image File Format (XIFF) + encoding: base64 + extensions: + - xif + xrefs: + person: + - Steven_Martin + template: + - image/vnd.xiff + registered: true +- !ruby/object:MIME::Type + content-type: image/vnd.zbrush.pcx + encoding: base64 + xrefs: + person: + - Chris_Charabaruk + template: + - image/vnd.zbrush.pcx + registered: true +- !ruby/object:MIME::Type + content-type: image/webp + friendly: + en: WebP Image + encoding: base64 + extensions: + - webp + registered: false +- !ruby/object:MIME::Type + content-type: image/wmf + encoding: base64 + xrefs: + rfc: + - rfc7903 + template: + - image/wmf + registered: true +- !ruby/object:MIME::Type + content-type: image/x-3ds + encoding: base64 + extensions: + - 3ds + registered: false +- !ruby/object:MIME::Type + content-type: image/x-adobe-dng + friendly: + en: Adobe Digital Negative + encoding: base64 + extensions: + - dng + registered: false +- !ruby/object:MIME::Type + content-type: image/x-bmp + encoding: base64 + extensions: + - bmp + obsolete: true + use-instead: image/bmp + registered: false +- !ruby/object:MIME::Type + content-type: image/x-canon-cr2 + friendly: + en: Canon Raw Image + encoding: base64 + extensions: + - cr2 + registered: false +- !ruby/object:MIME::Type + content-type: image/x-canon-crw + friendly: + en: Canon Raw Image + encoding: base64 + extensions: + - crw + registered: false +- !ruby/object:MIME::Type + content-type: image/x-cmu-raster + friendly: + en: CMU Image + encoding: base64 + extensions: + - ras + registered: false +- !ruby/object:MIME::Type + content-type: image/x-cmx + friendly: + en: Corel Metafile Exchange (CMX) + encoding: base64 + extensions: + - cmx + registered: false +- !ruby/object:MIME::Type + content-type: image/x-compressed-xcf + docs: see-also:image/x-xcf + encoding: base64 + extensions: + - xcfbz2 + - xcfgz + registered: false +- !ruby/object:MIME::Type + content-type: image/x-emf + encoding: base64 + obsolete: true + use-instead: image/emf + xrefs: + rfc: + - rfc7903 + template: + - image/emf + notes: + - "- DEPRECATED in favor of image/emf" + registered: true +- !ruby/object:MIME::Type + content-type: image/x-epson-erf + friendly: + en: Epson Raw Image + encoding: base64 + extensions: + - erf + registered: false +- !ruby/object:MIME::Type + content-type: image/x-freehand + friendly: + en: FreeHand MX + encoding: base64 + extensions: + - fh + - fh4 + - fh5 + - fh7 + - fhc + registered: false +- !ruby/object:MIME::Type + content-type: image/x-fuji-raf + friendly: + en: Fuji Raw Image + encoding: base64 + extensions: + - raf + registered: false +- !ruby/object:MIME::Type + content-type: image/x-hasselblad-3fr + encoding: base64 + extensions: + - 3fr + registered: false +- !ruby/object:MIME::Type + content-type: image/x-icon + friendly: + en: Icon Image + encoding: base64 + extensions: + - ico + registered: false +- !ruby/object:MIME::Type + content-type: image/x-kodak-dcr + friendly: + en: Kodak Raw Image + encoding: base64 + extensions: + - dcr + registered: false +- !ruby/object:MIME::Type + content-type: image/x-kodak-k25 + friendly: + en: Kodak Raw Image + encoding: base64 + extensions: + - k25 + registered: false +- !ruby/object:MIME::Type + content-type: image/x-kodak-kdc + friendly: + en: Kodak Raw Image + encoding: base64 + extensions: + - kdc + registered: false +- !ruby/object:MIME::Type + content-type: image/x-minolta-mrw + friendly: + en: Minolta Raw Image + encoding: base64 + extensions: + - mrw + registered: false +- !ruby/object:MIME::Type + content-type: image/x-mrsid-image + encoding: base64 + extensions: + - sid + registered: false +- !ruby/object:MIME::Type + content-type: image/x-ms-bmp + friendly: + en: Bitmap Image File + encoding: base64 + extensions: + - bmp + obsolete: true + registered: false +- !ruby/object:MIME::Type + content-type: image/x-nikon-nef + friendly: + en: Nikon Raw Image + encoding: base64 + extensions: + - nef + registered: false +- !ruby/object:MIME::Type + content-type: image/x-olympus-orf + friendly: + en: Olympus Raw Image + encoding: base64 + extensions: + - orf + registered: false +- !ruby/object:MIME::Type + content-type: image/x-paintshoppro + encoding: base64 + extensions: + - psp + - pspimage + registered: false +- !ruby/object:MIME::Type + content-type: image/x-panasonic-raw + friendly: + en: Panasonic Raw Image + encoding: base64 + extensions: + - raw + registered: false +- !ruby/object:MIME::Type + content-type: image/x-pcx + friendly: + en: PCX Image + encoding: base64 + extensions: + - pcx + registered: false +- !ruby/object:MIME::Type + content-type: image/x-pentax-pef + friendly: + en: Pentax Raw Image + encoding: base64 + extensions: + - pef + registered: false +- !ruby/object:MIME::Type + content-type: image/x-pict + friendly: + en: PICT Image + encoding: base64 + extensions: + - pct + - pic + registered: false +- !ruby/object:MIME::Type + content-type: image/x-portable-anymap + friendly: + en: Portable Anymap Image + encoding: base64 + extensions: + - pnm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-portable-bitmap + friendly: + en: Portable Bitmap Format + encoding: base64 + extensions: + - pbm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-portable-graymap + friendly: + en: Portable Graymap Format + encoding: base64 + extensions: + - pgm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-portable-pixmap + friendly: + en: Portable Pixmap Format + encoding: base64 + extensions: + - ppm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-rgb + friendly: + en: Silicon Graphics RGB Bitmap + encoding: base64 + extensions: + - rgb + registered: false +- !ruby/object:MIME::Type + content-type: image/x-sigma-x3f + friendly: + en: Sigma Raw Image + encoding: base64 + extensions: + - x3f + registered: false +- !ruby/object:MIME::Type + content-type: image/x-sony-arw + friendly: + en: Sony Raw Image + encoding: base64 + extensions: + - arw + registered: false +- !ruby/object:MIME::Type + content-type: image/x-sony-sr2 + friendly: + en: Sony Raw Image + encoding: base64 + extensions: + - sr2 + registered: false +- !ruby/object:MIME::Type + content-type: image/x-sony-srf + friendly: + en: Sony Raw Image + encoding: base64 + extensions: + - srf + registered: false +- !ruby/object:MIME::Type + content-type: image/x-targa + encoding: base64 + extensions: + - tga + registered: false +- !ruby/object:MIME::Type + content-type: image/x-tga + encoding: base64 + extensions: + - tga + registered: false +- !ruby/object:MIME::Type + content-type: image/x-vnd.dgn + encoding: base64 + extensions: + - dgn + registered: false +- !ruby/object:MIME::Type + content-type: image/x-win-bmp + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: image/x-wmf + encoding: base64 + obsolete: true + use-instead: image/wmf + xrefs: + rfc: + - rfc7903 + template: + - image/wmf + notes: + - "- DEPRECATED in favor of image/wmf" + registered: true +- !ruby/object:MIME::Type + content-type: image/x-xbitmap + friendly: + en: X BitMap + encoding: 7bit + extensions: + - xbm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-xbm + encoding: 7bit + extensions: + - xbm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-xcf + encoding: base64 + extensions: + - xcf + registered: false +- !ruby/object:MIME::Type + content-type: image/x-xpixmap + friendly: + en: X PixMap + encoding: 8bit + extensions: + - xpm + registered: false +- !ruby/object:MIME::Type + content-type: image/x-xwindowdump + friendly: + en: X Window Dump + encoding: base64 + extensions: + - xwd + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/message.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/message.yaml new file mode 100644 index 0000000..4bb3f66 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/message.yaml @@ -0,0 +1,205 @@ +--- +- !ruby/object:MIME::Type + content-type: message/CPIM + encoding: base64 + xrefs: + rfc: + - rfc3862 + template: + - message/CPIM + registered: true +- !ruby/object:MIME::Type + content-type: message/delivery-status + encoding: base64 + xrefs: + rfc: + - rfc1894 + template: + - message/delivery-status + registered: true +- !ruby/object:MIME::Type + content-type: message/disposition-notification + encoding: base64 + xrefs: + rfc: + - rfc8098 + template: + - message/disposition-notification + registered: true +- !ruby/object:MIME::Type + content-type: message/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - message/example + registered: true +- !ruby/object:MIME::Type + content-type: message/external-body + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: message/feedback-report + encoding: base64 + xrefs: + rfc: + - rfc5965 + template: + - message/feedback-report + registered: true +- !ruby/object:MIME::Type + content-type: message/global + encoding: base64 + xrefs: + rfc: + - rfc6532 + template: + - message/global + registered: true +- !ruby/object:MIME::Type + content-type: message/global-delivery-status + encoding: base64 + xrefs: + rfc: + - rfc6533 + template: + - message/global-delivery-status + registered: true +- !ruby/object:MIME::Type + content-type: message/global-disposition-notification + encoding: base64 + xrefs: + rfc: + - rfc6533 + template: + - message/global-disposition-notification + registered: true +- !ruby/object:MIME::Type + content-type: message/global-headers + encoding: base64 + xrefs: + rfc: + - rfc6533 + template: + - message/global-headers + registered: true +- !ruby/object:MIME::Type + content-type: message/http + encoding: base64 + xrefs: + draft: + - RFC-ietf-httpbis-messaging-19 + template: + - message/http + registered: true +- !ruby/object:MIME::Type + content-type: message/imdn+xml + encoding: base64 + xrefs: + rfc: + - rfc5438 + template: + - message/imdn+xml + registered: true +- !ruby/object:MIME::Type + content-type: message/news + encoding: 8bit + obsolete: true + xrefs: + rfc: + - rfc5537 + person: + - Henry_Spencer + template: + - message/news + notes: + - "(OBSOLETED by )" + registered: true +- !ruby/object:MIME::Type + content-type: message/partial + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: message/rfc822 + friendly: + en: Email Message + encoding: 8bit + extensions: + - eml + - mime + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: message/s-http + encoding: base64 + obsolete: true + xrefs: + rfc: + - rfc2660 + uri: + - https://datatracker.ietf.org/doc/status-change-http-experiments-to-historic + template: + - message/s-http + notes: + - "(OBSOLETE)" + registered: true +- !ruby/object:MIME::Type + content-type: message/sip + encoding: base64 + xrefs: + rfc: + - rfc3261 + template: + - message/sip + registered: true +- !ruby/object:MIME::Type + content-type: message/sipfrag + encoding: base64 + xrefs: + rfc: + - rfc3420 + template: + - message/sipfrag + registered: true +- !ruby/object:MIME::Type + content-type: message/tracking-status + encoding: base64 + xrefs: + rfc: + - rfc3886 + template: + - message/tracking-status + registered: true +- !ruby/object:MIME::Type + content-type: message/vnd.si.simp + encoding: base64 + obsolete: true + xrefs: + person: + - Nicholas_Parks_Young + template: + - message/vnd.si.simp + notes: + - "(OBSOLETED by request)" + registered: true +- !ruby/object:MIME::Type + content-type: message/vnd.wfa.wsc + encoding: base64 + xrefs: + person: + - Mick_Conley + template: + - message/vnd.wfa.wsc + registered: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/model.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/model.yaml new file mode 100644 index 0000000..938adf8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/model.yaml @@ -0,0 +1,390 @@ +--- +- !ruby/object:MIME::Type + content-type: model/3mf + encoding: base64 + xrefs: + uri: + - http://www.3mf.io/specification + person: + - Michael_Sweet + - _3MF + template: + - model/3mf + registered: true +- !ruby/object:MIME::Type + content-type: model/e57 + encoding: base64 + xrefs: + person: + - ASTM + template: + - model/e57 + registered: true +- !ruby/object:MIME::Type + content-type: model/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - model/example + registered: true +- !ruby/object:MIME::Type + content-type: model/gltf+json + encoding: base64 + xrefs: + person: + - Khronos + - Uli_Klumpp + template: + - model/gltf+json + registered: true +- !ruby/object:MIME::Type + content-type: model/gltf-binary + encoding: base64 + xrefs: + person: + - Khronos + - Saurabh_Bhatia + template: + - model/gltf-binary + registered: true +- !ruby/object:MIME::Type + content-type: model/iges + friendly: + en: Initial Graphics Exchange Specification (IGES) + encoding: base64 + extensions: + - igs + - iges + xrefs: + person: + - Curtis_Parks + template: + - model/iges + registered: true +- !ruby/object:MIME::Type + content-type: model/mesh + friendly: + en: Mesh Data Type + encoding: base64 + extensions: + - msh + - mesh + - silo + xrefs: + rfc: + - rfc2077 + registered: true +- !ruby/object:MIME::Type + content-type: model/mtl + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - Luiza_Kowalczyk + template: + - model/mtl + registered: true +- !ruby/object:MIME::Type + content-type: model/obj + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - Luiza_Kowalczyk + template: + - model/obj + registered: true +- !ruby/object:MIME::Type + content-type: model/step + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - model/step + registered: true +- !ruby/object:MIME::Type + content-type: model/step+xml + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - model/step+xml + registered: true +- !ruby/object:MIME::Type + content-type: model/step+zip + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - model/step+zip + registered: true +- !ruby/object:MIME::Type + content-type: model/step-xml+zip + encoding: base64 + xrefs: + person: + - Dana_Tripp + - ISO-TC_184-SC_4 + template: + - model/step-xml+zip + registered: true +- !ruby/object:MIME::Type + content-type: model/stl + encoding: base64 + xrefs: + person: + - DICOM_Standards_Committee + - Lisa_Spellman + template: + - model/stl + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.collada+xml + friendly: + en: COLLADA + encoding: base64 + extensions: + - dae + xrefs: + person: + - James_Riordon + template: + - model/vnd.collada+xml + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.dwf + friendly: + en: Autodesk Design Web Format (DWF) + encoding: base64 + extensions: + - dwf + xrefs: + person: + - Jason_Pratt + template: + - model/vnd.dwf + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.flatland.3dml + encoding: base64 + xrefs: + person: + - Michael_Powers + template: + - model/vnd.flatland.3dml + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.gdl + friendly: + en: Geometric Description Language (GDL) + encoding: base64 + extensions: + - gdl + xrefs: + person: + - Attila_Babits + template: + - model/vnd.gdl + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.gs-gdl + encoding: base64 + xrefs: + person: + - Attila_Babits + template: + - model/vnd.gs-gdl + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.gtw + friendly: + en: Gen-Trix Studio + encoding: base64 + extensions: + - gtw + xrefs: + person: + - Yutaka_Ozaki + template: + - model/vnd.gtw + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.moml+xml + encoding: base64 + xrefs: + person: + - Christopher_Brooks + template: + - model/vnd.moml+xml + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.mts + friendly: + en: Virtue MTS + encoding: base64 + extensions: + - mts + xrefs: + person: + - Boris_Rabinovitch + template: + - model/vnd.mts + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.opengex + encoding: base64 + xrefs: + person: + - Eric_Lengyel + template: + - model/vnd.opengex + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.parasolid.transmit.binary + encoding: base64 + extensions: + - x_b + - xmt_bin + xrefs: + person: + - Parasolid + template: + - model/vnd.parasolid.transmit.binary + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.parasolid.transmit.text + encoding: quoted-printable + extensions: + - x_t + - xmt_txt + xrefs: + person: + - Parasolid + template: + - model/vnd.parasolid.transmit.text + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.pytha.pyox + encoding: base64 + xrefs: + person: + - Daniel_Flassig + template: + - model/vnd.pytha.pyox + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.rosette.annotated-data-model + encoding: base64 + xrefs: + person: + - Benson_Margulies + template: + - model/vnd.rosette.annotated-data-model + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.sap.vds + encoding: base64 + xrefs: + person: + - Igor_Afanasyev + - SAP_SE + template: + - model/vnd.sap.vds + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.usdz+zip + encoding: base64 + xrefs: + person: + - Sebastian_Grassia + template: + - model/vnd.usdz+zip + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.valve.source.compiled-map + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - model/vnd.valve.source.compiled-map + registered: true +- !ruby/object:MIME::Type + content-type: model/vnd.vtu + friendly: + en: Virtue VTU + encoding: base64 + extensions: + - vtu + xrefs: + person: + - Boris_Rabinovitch + template: + - model/vnd.vtu + registered: true +- !ruby/object:MIME::Type + content-type: model/vrml + friendly: + en: Virtual Reality Modeling Language + encoding: base64 + extensions: + - wrl + - vrml + xrefs: + rfc: + - rfc2077 + registered: true +- !ruby/object:MIME::Type + content-type: model/x3d+binary + encoding: base64 + extensions: + - x3db + - x3dbz + registered: false +- !ruby/object:MIME::Type + content-type: model/x3d+fastinfoset + encoding: base64 + xrefs: + person: + - Web3D_X3D + template: + - model/x3d+fastinfoset + registered: true +- !ruby/object:MIME::Type + content-type: model/x3d+vrml + encoding: base64 + extensions: + - x3dv + - x3dvz + registered: false +- !ruby/object:MIME::Type + content-type: model/x3d+xml + encoding: base64 + extensions: + - x3d + - x3dz + xrefs: + person: + - Web3D + - Web3D_X3D + template: + - model/x3d+xml + registered: true +- !ruby/object:MIME::Type + content-type: model/x3d-vrml + encoding: base64 + xrefs: + person: + - Web3D + - Web3D_X3D + template: + - model/x3d-vrml + registered: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/multipart.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/multipart.yaml new file mode 100644 index 0000000..d76e99f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/multipart.yaml @@ -0,0 +1,179 @@ +--- +- !ruby/object:MIME::Type + content-type: multipart/alternative + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: multipart/appledouble + encoding: 8bit + xrefs: + person: + - Patrik_Faltstrom + template: + - multipart/appledouble + registered: true +- !ruby/object:MIME::Type + content-type: multipart/byteranges + encoding: base64 + xrefs: + draft: + - RFC-ietf-httpbis-semantics-19 + template: + - multipart/byteranges + registered: true +- !ruby/object:MIME::Type + content-type: multipart/digest + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: multipart/encrypted + encoding: base64 + xrefs: + rfc: + - rfc1847 + template: + - multipart/encrypted + registered: true +- !ruby/object:MIME::Type + content-type: multipart/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - multipart/example + registered: true +- !ruby/object:MIME::Type + content-type: multipart/form-data + encoding: base64 + xrefs: + rfc: + - rfc7578 + template: + - multipart/form-data + registered: true +- !ruby/object:MIME::Type + content-type: multipart/header-set + encoding: base64 + xrefs: + person: + - Dave_Crocker + template: + - multipart/header-set + registered: true +- !ruby/object:MIME::Type + content-type: multipart/mixed + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: multipart/multilingual + encoding: base64 + xrefs: + rfc: + - rfc8255 + template: + - multipart/multilingual + registered: true +- !ruby/object:MIME::Type + content-type: multipart/parallel + encoding: 8bit + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: multipart/related + encoding: base64 + xrefs: + rfc: + - rfc2387 + template: + - multipart/related + registered: true +- !ruby/object:MIME::Type + content-type: multipart/report + encoding: base64 + xrefs: + rfc: + - rfc6522 + template: + - multipart/report + registered: true +- !ruby/object:MIME::Type + content-type: multipart/signed + encoding: base64 + xrefs: + rfc: + - rfc1847 + template: + - multipart/signed + registered: true +- !ruby/object:MIME::Type + content-type: multipart/vnd.bint.med-plus + encoding: base64 + xrefs: + person: + - Heinz-Peter_Schütz + template: + - multipart/vnd.bint.med-plus + registered: true +- !ruby/object:MIME::Type + content-type: multipart/voice-message + encoding: base64 + xrefs: + rfc: + - rfc3801 + template: + - multipart/voice-message + registered: true +- !ruby/object:MIME::Type + content-type: multipart/x-gzip + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: multipart/x-mixed-replace + encoding: base64 + xrefs: + person: + - Robin_Berjon + - W3C + template: + - multipart/x-mixed-replace + registered: true +- !ruby/object:MIME::Type + content-type: multipart/x-parallel + encoding: base64 + obsolete: true + use-instead: multipart/parallel + registered: false +- !ruby/object:MIME::Type + content-type: multipart/x-tar + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: multipart/x-ustar + encoding: base64 + registered: false +- !ruby/object:MIME::Type + content-type: multipart/x-www-form-urlencoded + encoding: base64 + obsolete: true + use-instead: application/x-www-form-urlencoded + registered: false +- !ruby/object:MIME::Type + content-type: multipart/x-zip + encoding: base64 + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/provisional-standard-types.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/provisional-standard-types.yaml new file mode 100644 index 0000000..b823cb4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/provisional-standard-types.yaml @@ -0,0 +1,145 @@ +--- +- !ruby/object:MIME::Type + content-type: application/akn+xml + encoding: base64 + xrefs: + person: + - Chet_Ensign + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/cert-chain+cbor + encoding: base64 + xrefs: + draft: + - draft-yasskin-http-origin-signed-responses + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/city+json + encoding: base64 + xrefs: + person: + - Hugo_Ledoux + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/ion + encoding: base64 + xrefs: + person: + - Jonathan_Hohle + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/json-nd + encoding: base64 + xrefs: + person: + - Glen_Kleidon + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/netcdf + encoding: base64 + xrefs: + person: + - Ethan_Davis + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/odm+json + encoding: base64 + xrefs: + person: + - Sam_Hume + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/pkix-keyinfo + encoding: base64 + xrefs: + draft: + - draft-hallambaker-mesh-udf + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/reports+json + encoding: base64 + xrefs: + person: + - Douglas_Creager + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/rif+xml + encoding: base64 + xrefs: + person: + - Sandro_Hawke + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/rpki-checklist + encoding: base64 + xrefs: + draft: + - draft-ietf-sidrops-rpki-rsc-02 + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/signed-exchange + encoding: base64 + xrefs: + draft: + - draft-yasskin-http-origin-signed-responses + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/webbundle + encoding: base64 + xrefs: + draft: + - draft-yasskin-wpack-bundled-exchanges + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: application/won + encoding: base64 + xrefs: + person: + - Roy_T._Fielding + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: image/dpx + encoding: base64 + xrefs: + person: + - Director_of_Standards + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: image/j2is + encoding: base64 + xrefs: + person: + - ISO-IEC_JTC_1-SC_29-WG_1_Convenor + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: image/jxl + encoding: base64 + xrefs: + person: + - Touradj_Ebrahimi + registered: true + provisional: true +- !ruby/object:MIME::Type + content-type: text/nfo + encoding: quoted-printable + xrefs: + person: + - Sean_Leonard + registered: true + provisional: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/text.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/text.yaml new file mode 100644 index 0000000..7d82b2c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/text.yaml @@ -0,0 +1,1166 @@ +--- +- !ruby/object:MIME::Type + content-type: text/1d-interleaved-parityfec + encoding: quoted-printable + xrefs: + rfc: + - rfc6015 + template: + - text/1d-interleaved-parityfec + registered: true +- !ruby/object:MIME::Type + content-type: text/cache-manifest + encoding: quoted-printable + extensions: + - appcache + - manifest + xrefs: + person: + - Robin_Berjon + - W3C + template: + - text/cache-manifest + registered: true +- !ruby/object:MIME::Type + content-type: text/calendar + friendly: + en: iCalendar + encoding: quoted-printable + extensions: + - ics + - ifb + xrefs: + rfc: + - rfc5545 + template: + - text/calendar + registered: true +- !ruby/object:MIME::Type + content-type: text/comma-separated-values + encoding: 8bit + extensions: + - csv + obsolete: true + use-instead: text/csv + registered: false +- !ruby/object:MIME::Type + content-type: text/cql + encoding: quoted-printable + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - text/cql + registered: true +- !ruby/object:MIME::Type + content-type: text/cql-expression + encoding: quoted-printable + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - text/cql-expression + registered: true +- !ruby/object:MIME::Type + content-type: text/cql-identifier + encoding: quoted-printable + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - text/cql-identifier + registered: true +- !ruby/object:MIME::Type + content-type: text/css + friendly: + en: Cascading Style Sheets (CSS) + encoding: 8bit + extensions: + - css + xrefs: + rfc: + - rfc2318 + template: + - text/css + registered: true +- !ruby/object:MIME::Type + content-type: text/csv + friendly: + en: Comma-Separated Values + encoding: 8bit + extensions: + - csv + xrefs: + rfc: + - rfc4180 + - rfc7111 + template: + - text/csv + registered: true +- !ruby/object:MIME::Type + content-type: text/csv-schema + encoding: quoted-printable + xrefs: + person: + - David_Underdown + - National_Archives_UK + template: + - text/csv-schema + registered: true +- !ruby/object:MIME::Type + content-type: text/directory + encoding: quoted-printable + obsolete: true + xrefs: + rfc: + - rfc2425 + - rfc6350 + template: + - text/directory + notes: + - "- DEPRECATED by RFC6350" + registered: true +- !ruby/object:MIME::Type + content-type: text/dns + encoding: quoted-printable + xrefs: + rfc: + - rfc4027 + template: + - text/dns + registered: true +- !ruby/object:MIME::Type + content-type: text/ecmascript + encoding: quoted-printable + extensions: + - es + - ecma + obsolete: true + use-instead: application/ecmascript + xrefs: + rfc: + - rfc4329 + template: + - text/ecmascript + notes: + - "(OBSOLETED in favor of application/ecmascript)" + registered: true +- !ruby/object:MIME::Type + content-type: text/encaprtp + encoding: quoted-printable + xrefs: + rfc: + - rfc6849 + template: + - text/encaprtp + registered: true +- !ruby/object:MIME::Type + content-type: text/enriched + encoding: quoted-printable + xrefs: + rfc: + - rfc1896 + registered: true +- !ruby/object:MIME::Type + content-type: text/example + encoding: quoted-printable + xrefs: + rfc: + - rfc4735 + template: + - text/example + registered: true +- !ruby/object:MIME::Type + content-type: text/fhirpath + encoding: quoted-printable + xrefs: + person: + - Bryn_Rhodes + - HL7 + template: + - text/fhirpath + registered: true +- !ruby/object:MIME::Type + content-type: text/flexfec + encoding: quoted-printable + xrefs: + rfc: + - rfc8627 + template: + - text/flexfec + registered: true +- !ruby/object:MIME::Type + content-type: text/fwdred + encoding: quoted-printable + xrefs: + rfc: + - rfc6354 + template: + - text/fwdred + registered: true +- !ruby/object:MIME::Type + content-type: text/gff3 + encoding: quoted-printable + xrefs: + person: + - Sequence_Ontology + template: + - text/gff3 + registered: true +- !ruby/object:MIME::Type + content-type: text/grammar-ref-list + encoding: quoted-printable + xrefs: + rfc: + - rfc6787 + template: + - text/grammar-ref-list + registered: true +- !ruby/object:MIME::Type + content-type: text/html + friendly: + en: HyperText Markup Language (HTML) + encoding: 8bit + extensions: + - html + - htm + - htmlx + - shtml + - htx + xrefs: + person: + - Robin_Berjon + - W3C + template: + - text/html + registered: true +- !ruby/object:MIME::Type + content-type: text/javascript + encoding: quoted-printable + extensions: + - js + - mjs + obsolete: true + use-instead: application/javascript + xrefs: + rfc: + - rfc4329 + template: + - text/javascript + notes: + - "(OBSOLETED in favor of application/javascript)" + registered: true +- !ruby/object:MIME::Type + content-type: text/jcr-cnd + encoding: quoted-printable + xrefs: + person: + - Peeter_Piegaze + template: + - text/jcr-cnd + registered: true +- !ruby/object:MIME::Type + content-type: text/markdown + encoding: quoted-printable + extensions: + - markdown + - md + - mkd + xrefs: + rfc: + - rfc7763 + template: + - text/markdown + registered: true +- !ruby/object:MIME::Type + content-type: text/mizar + encoding: quoted-printable + xrefs: + person: + - Jesse_Alama + template: + - text/mizar + registered: true +- !ruby/object:MIME::Type + content-type: text/n3 + friendly: + en: Notation3 + encoding: quoted-printable + extensions: + - n3 + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - text/n3 + registered: true +- !ruby/object:MIME::Type + content-type: text/parameters + encoding: quoted-printable + xrefs: + rfc: + - rfc7826 + template: + - text/parameters + registered: true +- !ruby/object:MIME::Type + content-type: text/parityfec + encoding: quoted-printable + xrefs: + rfc: + - rfc3009 + template: + - text/parityfec + registered: true +- !ruby/object:MIME::Type + content-type: text/plain + friendly: + en: Text File + encoding: quoted-printable + extensions: + - txt + - asc + - c + - cc + - h + - hh + - cpp + - hpp + - dat + - hlp + - conf + - def + - doc + - in + - list + - log + - rst + - text + - textile + xrefs: + rfc: + - rfc2046 + - rfc3676 + - rfc5147 + registered: true +- !ruby/object:MIME::Type + content-type: text/provenance-notation + encoding: quoted-printable + xrefs: + person: + - Ivan_Herman + - W3C + template: + - text/provenance-notation + registered: true +- !ruby/object:MIME::Type + content-type: text/prs.fallenstein.rst + encoding: quoted-printable + extensions: + - rst + xrefs: + person: + - Benja_Fallenstein + template: + - text/prs.fallenstein.rst + registered: true +- !ruby/object:MIME::Type + content-type: text/prs.lines.tag + friendly: + en: PRS Lines Tag + encoding: quoted-printable + extensions: + - dsc + xrefs: + person: + - John_Lines + template: + - text/prs.lines.tag + registered: true +- !ruby/object:MIME::Type + content-type: text/prs.prop.logic + encoding: quoted-printable + xrefs: + person: + - Hans-Dieter_A._Hiep + template: + - text/prs.prop.logic + registered: true +- !ruby/object:MIME::Type + content-type: text/raptorfec + encoding: quoted-printable + xrefs: + rfc: + - rfc6682 + template: + - text/raptorfec + registered: true +- !ruby/object:MIME::Type + content-type: text/RED + encoding: quoted-printable + xrefs: + rfc: + - rfc4102 + template: + - text/RED + registered: true +- !ruby/object:MIME::Type + content-type: text/rfc822-headers + encoding: quoted-printable + xrefs: + rfc: + - rfc6522 + template: + - text/rfc822-headers + registered: true +- !ruby/object:MIME::Type + content-type: text/richtext + friendly: + en: Rich Text Format (RTF) + encoding: 8bit + extensions: + - rtx + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: text/rtf + encoding: 8bit + extensions: + - rtf + xrefs: + person: + - Paul_Lindner + template: + - text/rtf + registered: true +- !ruby/object:MIME::Type + content-type: text/rtp-enc-aescm128 + encoding: quoted-printable + xrefs: + person: + - _3GPP + template: + - text/rtp-enc-aescm128 + registered: true +- !ruby/object:MIME::Type + content-type: text/rtploopback + encoding: quoted-printable + xrefs: + rfc: + - rfc6849 + template: + - text/rtploopback + registered: true +- !ruby/object:MIME::Type + content-type: text/rtx + encoding: quoted-printable + xrefs: + rfc: + - rfc4588 + template: + - text/rtx + registered: true +- !ruby/object:MIME::Type + content-type: text/sgml + friendly: + en: Standard Generalized Markup Language (SGML) + encoding: quoted-printable + extensions: + - sgml + - sgm + xrefs: + rfc: + - rfc1874 + template: + - text/SGML + registered: true +- !ruby/object:MIME::Type + content-type: text/shaclc + encoding: quoted-printable + xrefs: + person: + - Vladimir_Alexiev + - W3C_SHACL_Community_Group + template: + - text/shaclc + registered: true +- !ruby/object:MIME::Type + content-type: text/shex + encoding: quoted-printable + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - text/shex + registered: true +- !ruby/object:MIME::Type + content-type: text/spdx + encoding: quoted-printable + xrefs: + person: + - Linux_Foundation + - Rose_Judge + template: + - text/spdx + registered: true +- !ruby/object:MIME::Type + content-type: text/strings + encoding: quoted-printable + xrefs: + person: + - IEEE-ISTO-PWG-PPP + template: + - text/strings + registered: true +- !ruby/object:MIME::Type + content-type: text/t140 + encoding: quoted-printable + xrefs: + rfc: + - rfc4103 + template: + - text/t140 + registered: true +- !ruby/object:MIME::Type + content-type: text/tab-separated-values + friendly: + en: Tab Separated Values + encoding: quoted-printable + extensions: + - tsv + xrefs: + person: + - Paul_Lindner + template: + - text/tab-separated-values + registered: true +- !ruby/object:MIME::Type + content-type: text/troff + friendly: + en: troff + encoding: 8bit + extensions: + - t + - tr + - roff + - troff + - man + - me + - ms + xrefs: + rfc: + - rfc4263 + template: + - text/troff + registered: true +- !ruby/object:MIME::Type + content-type: text/turtle + friendly: + en: Turtle (Terse RDF Triple Language) + encoding: quoted-printable + extensions: + - ttl + xrefs: + person: + - Eric_Prudhommeaux + - W3C + template: + - text/turtle + registered: true +- !ruby/object:MIME::Type + content-type: text/ulpfec + encoding: quoted-printable + xrefs: + rfc: + - rfc5109 + template: + - text/ulpfec + registered: true +- !ruby/object:MIME::Type + content-type: text/uri-list + friendly: + en: URI Resolution Services + encoding: quoted-printable + extensions: + - uri + - uris + - urls + xrefs: + rfc: + - rfc2483 + template: + - text/uri-list + registered: true +- !ruby/object:MIME::Type + content-type: text/vcard + encoding: quoted-printable + extensions: + - vcard + xrefs: + rfc: + - rfc6350 + template: + - text/vcard + registered: true + signature: true +- !ruby/object:MIME::Type + content-type: text/vnd.a + encoding: quoted-printable + xrefs: + person: + - Regis_Dehoux + template: + - text/vnd.a + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.abc + encoding: quoted-printable + xrefs: + person: + - Steve_Allen + template: + - text/vnd.abc + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.ascii-art + encoding: quoted-printable + xrefs: + person: + - Kim_Scarborough + template: + - text/vnd.ascii-art + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.curl + friendly: + en: Curl - Applet + encoding: quoted-printable + extensions: + - curl + xrefs: + person: + - Robert_Byrnes + template: + - text/vnd.curl + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.curl.dcurl + friendly: + en: Curl - Detached Applet + encoding: quoted-printable + extensions: + - dcurl + registered: false +- !ruby/object:MIME::Type + content-type: text/vnd.curl.mcurl + friendly: + en: Curl - Manifest File + encoding: quoted-printable + extensions: + - mcurl + registered: false +- !ruby/object:MIME::Type + content-type: text/vnd.curl.scurl + friendly: + en: Curl - Source Code + encoding: quoted-printable + extensions: + - scurl + registered: false +- !ruby/object:MIME::Type + content-type: text/vnd.debian.copyright + encoding: quoted-printable + xrefs: + person: + - Charles_Plessy + template: + - text/vnd.debian.copyright + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.DMClientScript + encoding: quoted-printable + xrefs: + person: + - Dan_Bradley + template: + - text/vnd.DMClientScript + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.dvb.subtitle + encoding: quoted-printable + extensions: + - sub + xrefs: + person: + - Michael_Lagally + - Peter_Siebert + template: + - text/vnd.dvb.subtitle + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.esmertec.theme-descriptor + encoding: quoted-printable + xrefs: + person: + - Stefan_Eilemann + template: + - text/vnd.esmertec.theme-descriptor + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.familysearch.gedcom + encoding: quoted-printable + xrefs: + person: + - Gordon_Clarke + template: + - text/vnd.familysearch.gedcom + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.ficlab.flt + encoding: quoted-printable + xrefs: + person: + - Steve_Gilberd + template: + - text/vnd.ficlab.flt + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.flatland.3dml + encoding: quoted-printable + obsolete: true + use-instead: model/vnd.flatland.3dml + registered: false +- !ruby/object:MIME::Type + content-type: text/vnd.fly + friendly: + en: mod_fly / fly.cgi + encoding: quoted-printable + extensions: + - fly + xrefs: + person: + - John-Mark_Gurney + template: + - text/vnd.fly + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.fmi.flexstor + friendly: + en: FLEXSTOR + encoding: quoted-printable + extensions: + - flx + xrefs: + person: + - Kari_E._Hurtta + template: + - text/vnd.fmi.flexstor + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.gml + encoding: quoted-printable + xrefs: + person: + - Mi_Tar + template: + - text/vnd.gml + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.graphviz + friendly: + en: Graphviz + encoding: quoted-printable + extensions: + - gv + xrefs: + person: + - John_Ellson + template: + - text/vnd.graphviz + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.hans + encoding: quoted-printable + xrefs: + person: + - Hill_Hanxv + template: + - text/vnd.hans + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.hgl + encoding: quoted-printable + xrefs: + person: + - Heungsub_Lee + template: + - text/vnd.hgl + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.in3d.3dml + friendly: + en: In3D - 3DML + encoding: quoted-printable + extensions: + - 3dml + xrefs: + person: + - Michael_Powers + template: + - text/vnd.in3d.3dml + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.in3d.spot + friendly: + en: In3D - 3DML + encoding: quoted-printable + extensions: + - spot + xrefs: + person: + - Michael_Powers + template: + - text/vnd.in3d.spot + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.IPTC.NewsML + encoding: quoted-printable + xrefs: + person: + - IPTC + template: + - text/vnd.IPTC.NewsML + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.IPTC.NITF + encoding: quoted-printable + xrefs: + person: + - IPTC + template: + - text/vnd.IPTC.NITF + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.latex-z + encoding: quoted-printable + xrefs: + person: + - Mikusiak_Lubos + template: + - text/vnd.latex-z + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.motorola.reflex + encoding: quoted-printable + xrefs: + person: + - Mark_Patton + template: + - text/vnd.motorola.reflex + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.ms-mediapackage + encoding: quoted-printable + xrefs: + person: + - Jan_Nelson + template: + - text/vnd.ms-mediapackage + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.net2phone.commcenter.command + encoding: quoted-printable + extensions: + - ccc + xrefs: + person: + - Feiyu_Xie + template: + - text/vnd.net2phone.commcenter.command + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.radisys.msml-basic-layout + encoding: quoted-printable + xrefs: + rfc: + - rfc5707 + template: + - text/vnd.radisys.msml-basic-layout + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.senx.warpscript + encoding: quoted-printable + xrefs: + person: + - Pierre_Papin + template: + - text/vnd.senx.warpscript + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.si.uricatalogue + encoding: quoted-printable + obsolete: true + xrefs: + person: + - Nicholas_Parks_Young + template: + - text/vnd.si.uricatalogue + notes: + - "(OBSOLETED by request)" + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.sosi + encoding: quoted-printable + xrefs: + person: + - Petter_Reinholdtsen + template: + - text/vnd.sosi + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.sun.j2me.app-descriptor + friendly: + en: J2ME App Descriptor + encoding: 8bit + extensions: + - jad + xrefs: + person: + - Gary_Adams + template: + - text/vnd.sun.j2me.app-descriptor + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.trolltech.linguist + encoding: quoted-printable + xrefs: + person: + - David_Lee_Lambert + template: + - text/vnd.trolltech.linguist + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.wap.si + encoding: quoted-printable + extensions: + - si + xrefs: + person: + - WAP-Forum + template: + - text/vnd.wap.si + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.wap.sl + encoding: quoted-printable + extensions: + - sl + xrefs: + person: + - WAP-Forum + template: + - text/vnd.wap.sl + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.wap.wml + friendly: + en: Wireless Markup Language (WML) + encoding: quoted-printable + extensions: + - wml + xrefs: + person: + - Peter_Stark + template: + - text/vnd.wap.wml + registered: true +- !ruby/object:MIME::Type + content-type: text/vnd.wap.wmlscript + friendly: + en: Wireless Markup Language Script (WMLScript) + encoding: quoted-printable + extensions: + - wmls + xrefs: + person: + - Peter_Stark + template: + - text/vnd.wap.wmlscript + registered: true +- !ruby/object:MIME::Type + content-type: text/vtt + encoding: quoted-printable + extensions: + - vtt + xrefs: + person: + - Silvia_Pfeiffer + - W3C + template: + - text/vtt + registered: true +- !ruby/object:MIME::Type + content-type: text/x-asm + friendly: + en: Assembler Source File + encoding: quoted-printable + extensions: + - asm + - s + registered: false +- !ruby/object:MIME::Type + content-type: text/x-c + friendly: + en: C Source File + encoding: quoted-printable + extensions: + - c + - cc + - cpp + - cxx + - dic + - h + - hh + registered: false +- !ruby/object:MIME::Type + content-type: text/x-coffescript + encoding: 8bit + extensions: + - coffee + registered: false +- !ruby/object:MIME::Type + content-type: text/x-component + encoding: 8bit + extensions: + - htc + registered: false +- !ruby/object:MIME::Type + content-type: text/x-fortran + friendly: + en: Fortran Source File + encoding: quoted-printable + extensions: + - f + - f77 + - f90 + - for + registered: false +- !ruby/object:MIME::Type + content-type: text/x-java-source + friendly: + en: Java Source File + encoding: quoted-printable + extensions: + - java + registered: false +- !ruby/object:MIME::Type + content-type: text/x-nfo + encoding: quoted-printable + extensions: + - nfo + registered: false +- !ruby/object:MIME::Type + content-type: text/x-opml + encoding: quoted-printable + extensions: + - opml + registered: false +- !ruby/object:MIME::Type + content-type: text/x-pascal + friendly: + en: Pascal Source File + encoding: quoted-printable + extensions: + - p + - pas + registered: false +- !ruby/object:MIME::Type + content-type: text/x-rtf + encoding: 8bit + extensions: + - rtf + obsolete: true + use-instead: text/rtf + registered: false +- !ruby/object:MIME::Type + content-type: text/x-setext + friendly: + en: Setext + encoding: quoted-printable + extensions: + - etx + registered: false +- !ruby/object:MIME::Type + content-type: text/x-sfv + encoding: quoted-printable + extensions: + - sfv + registered: false +- !ruby/object:MIME::Type + content-type: text/x-uuencode + friendly: + en: UUEncode + encoding: quoted-printable + extensions: + - uu + registered: false +- !ruby/object:MIME::Type + content-type: text/x-vcalendar + friendly: + en: vCalendar + encoding: 8bit + extensions: + - vcs + registered: false +- !ruby/object:MIME::Type + content-type: text/x-vcard + friendly: + en: vCard + encoding: 8bit + extensions: + - vcf + registered: false + signature: true +- !ruby/object:MIME::Type + content-type: text/x-vnd.flatland.3dml + encoding: quoted-printable + obsolete: true + use-instead: model/vnd.flatland.3dml + registered: false +- !ruby/object:MIME::Type + content-type: text/x-yaml + encoding: 8bit + extensions: + - yaml + - yml + registered: false +- !ruby/object:MIME::Type + content-type: text/xml + encoding: 8bit + extensions: + - xml + - dtd + - xsd + xrefs: + rfc: + - rfc7303 + template: + - text/xml + registered: true +- !ruby/object:MIME::Type + content-type: text/xml-external-parsed-entity + encoding: quoted-printable + xrefs: + rfc: + - rfc7303 + template: + - text/xml-external-parsed-entity + registered: true diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/video.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/video.yaml new file mode 100644 index 0000000..be4834f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/video.yaml @@ -0,0 +1,1121 @@ +--- +- !ruby/object:MIME::Type + content-type: video/1d-interleaved-parityfec + encoding: base64 + xrefs: + rfc: + - rfc6015 + template: + - video/1d-interleaved-parityfec + registered: true +- !ruby/object:MIME::Type + content-type: video/3gpp + friendly: + en: 3GP + encoding: base64 + extensions: + - 3gp + - 3gpp + xrefs: + rfc: + - rfc3839 + - rfc6381 + template: + - video/3gpp + registered: true +- !ruby/object:MIME::Type + content-type: video/3gpp-tt + encoding: base64 + xrefs: + rfc: + - rfc4396 + template: + - video/3gpp-tt + registered: true +- !ruby/object:MIME::Type + content-type: video/3gpp2 + friendly: + en: 3GP2 + encoding: base64 + extensions: + - 3g2 + - 3gpp2 + xrefs: + rfc: + - rfc4393 + - rfc6381 + template: + - video/3gpp2 + registered: true +- !ruby/object:MIME::Type + content-type: video/AV1 + encoding: base64 + xrefs: + person: + - Alliance_for_Open_Media + template: + - video/AV1 + registered: true +- !ruby/object:MIME::Type + content-type: video/BMPEG + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/BMPEG + registered: true +- !ruby/object:MIME::Type + content-type: video/BT656 + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/BT656 + registered: true +- !ruby/object:MIME::Type + content-type: video/CelB + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/CelB + registered: true +- !ruby/object:MIME::Type + content-type: video/dl + encoding: base64 + extensions: + - dl + obsolete: true + use-instead: video/x-dl + registered: false +- !ruby/object:MIME::Type + content-type: video/DV + encoding: base64 + extensions: + - dv + xrefs: + rfc: + - rfc6469 + template: + - video/DV + registered: true +- !ruby/object:MIME::Type + content-type: video/encaprtp + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - video/encaprtp + registered: true +- !ruby/object:MIME::Type + content-type: video/example + encoding: base64 + xrefs: + rfc: + - rfc4735 + template: + - video/example + registered: true +- !ruby/object:MIME::Type + content-type: video/FFV1 + encoding: base64 + xrefs: + rfc: + - rfc9043 + template: + - video/FFV1 + registered: true +- !ruby/object:MIME::Type + content-type: video/flexfec + encoding: base64 + xrefs: + rfc: + - rfc8627 + template: + - video/flexfec + registered: true +- !ruby/object:MIME::Type + content-type: video/gl + encoding: base64 + extensions: + - gl + obsolete: true + use-instead: video/x-gl + registered: false +- !ruby/object:MIME::Type + content-type: video/H261 + friendly: + en: H.261 + encoding: base64 + extensions: + - h261 + xrefs: + rfc: + - rfc4587 + template: + - video/H261 + registered: true +- !ruby/object:MIME::Type + content-type: video/H263 + friendly: + en: H.263 + encoding: base64 + extensions: + - h263 + xrefs: + rfc: + - rfc3555 + template: + - video/H263 + registered: true +- !ruby/object:MIME::Type + content-type: video/H263-1998 + encoding: base64 + xrefs: + rfc: + - rfc4629 + template: + - video/H263-1998 + registered: true +- !ruby/object:MIME::Type + content-type: video/H263-2000 + encoding: base64 + xrefs: + rfc: + - rfc4629 + template: + - video/H263-2000 + registered: true +- !ruby/object:MIME::Type + content-type: video/H264 + friendly: + en: H.264 + encoding: base64 + extensions: + - h264 + xrefs: + rfc: + - rfc6184 + template: + - video/H264 + registered: true +- !ruby/object:MIME::Type + content-type: video/H264-RCDO + encoding: base64 + xrefs: + rfc: + - rfc6185 + template: + - video/H264-RCDO + registered: true +- !ruby/object:MIME::Type + content-type: video/H264-SVC + encoding: base64 + xrefs: + rfc: + - rfc6190 + template: + - video/H264-SVC + registered: true +- !ruby/object:MIME::Type + content-type: video/H265 + encoding: base64 + xrefs: + rfc: + - rfc7798 + template: + - video/H265 + registered: true +- !ruby/object:MIME::Type + content-type: video/iso.segment + encoding: base64 + xrefs: + person: + - David_Singer + - ISO-IEC_JTC1 + template: + - video/iso.segment + registered: true +- !ruby/object:MIME::Type + content-type: video/JPEG + friendly: + en: JPGVideo + encoding: base64 + extensions: + - jpgv + xrefs: + rfc: + - rfc3555 + template: + - video/JPEG + registered: true +- !ruby/object:MIME::Type + content-type: video/jpeg2000 + encoding: base64 + xrefs: + rfc: + - rfc5371 + - rfc5372 + template: + - video/jpeg2000 + registered: true +- !ruby/object:MIME::Type + content-type: video/jpm + friendly: + en: JPEG 2000 Compound Image File Format + encoding: base64 + extensions: + - jpgm + - jpm + registered: false +- !ruby/object:MIME::Type + content-type: video/jxsv + encoding: base64 + xrefs: + rfc: + - rfc9134 + template: + - video/jxsv + registered: true +- !ruby/object:MIME::Type + content-type: video/MJ2 + friendly: + en: Motion JPEG 2000 + encoding: base64 + extensions: + - mj2 + - mjp2 + xrefs: + rfc: + - rfc3745 + template: + - video/mj2 + registered: true +- !ruby/object:MIME::Type + content-type: video/MP1S + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/MP1S + registered: true +- !ruby/object:MIME::Type + content-type: video/MP2P + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/MP2P + registered: true +- !ruby/object:MIME::Type + content-type: video/MP2T + encoding: base64 + extensions: + - ts + - mts + - m2ts + - cpi + - clpi + - mpl + - mpls + - bdm + xrefs: + rfc: + - rfc3555 + template: + - video/MP2T + registered: true +- !ruby/object:MIME::Type + content-type: video/mp4 + friendly: + en: MPEG-4 Video + encoding: base64 + extensions: + - mp4 + - mpg4 + - f4v + - f4p + - mp4v + xrefs: + rfc: + - rfc4337 + - rfc6381 + template: + - video/mp4 + registered: true +- !ruby/object:MIME::Type + content-type: video/MP4V-ES + encoding: base64 + xrefs: + rfc: + - rfc6416 + template: + - video/MP4V-ES + registered: true +- !ruby/object:MIME::Type + content-type: video/mpeg + friendly: + en: MPEG Video + encoding: base64 + extensions: + - mp2 + - mp3g + - mpe + - mpeg + - mpg + - m1v + - m2v + xrefs: + rfc: + - rfc2045 + - rfc2046 + registered: true +- !ruby/object:MIME::Type + content-type: video/mpeg4-generic + encoding: base64 + xrefs: + rfc: + - rfc3640 + template: + - video/mpeg4-generic + registered: true +- !ruby/object:MIME::Type + content-type: video/MPV + encoding: base64 + xrefs: + rfc: + - rfc3555 + template: + - video/MPV + registered: true +- !ruby/object:MIME::Type + content-type: video/nv + encoding: base64 + xrefs: + rfc: + - rfc4856 + template: + - video/nv + registered: true +- !ruby/object:MIME::Type + content-type: video/ogg + friendly: + en: Ogg Video + encoding: base64 + extensions: + - ogg + - ogv + xrefs: + rfc: + - rfc5334 + - rfc7845 + template: + - video/ogg + registered: true +- !ruby/object:MIME::Type + content-type: video/parityfec + encoding: base64 + xrefs: + rfc: + - rfc3009 + template: + - video/parityfec + registered: true +- !ruby/object:MIME::Type + content-type: video/pointer + encoding: base64 + xrefs: + rfc: + - rfc2862 + template: + - video/pointer + registered: true +- !ruby/object:MIME::Type + content-type: video/quicktime + friendly: + en: Quicktime Video + encoding: base64 + extensions: + - qt + - mov + xrefs: + rfc: + - rfc6381 + person: + - Paul_Lindner + template: + - video/quicktime + registered: true +- !ruby/object:MIME::Type + content-type: video/raptorfec + encoding: base64 + xrefs: + rfc: + - rfc6682 + template: + - video/raptorfec + registered: true +- !ruby/object:MIME::Type + content-type: video/raw + encoding: base64 + xrefs: + rfc: + - rfc4175 + template: + - video/raw + registered: true +- !ruby/object:MIME::Type + content-type: video/rtp-enc-aescm128 + encoding: base64 + xrefs: + person: + - _3GPP + template: + - video/rtp-enc-aescm128 + registered: true +- !ruby/object:MIME::Type + content-type: video/rtploopback + encoding: base64 + xrefs: + rfc: + - rfc6849 + template: + - video/rtploopback + registered: true +- !ruby/object:MIME::Type + content-type: video/rtx + encoding: base64 + xrefs: + rfc: + - rfc4588 + template: + - video/rtx + registered: true +- !ruby/object:MIME::Type + content-type: video/scip + encoding: base64 + xrefs: + person: + - Daniel_Hanson + - Michael_Faller + - SCIP + template: + - video/scip + registered: true +- !ruby/object:MIME::Type + content-type: video/smpte291 + encoding: base64 + xrefs: + rfc: + - rfc8331 + template: + - video/smpte291 + registered: true +- !ruby/object:MIME::Type + content-type: video/SMPTE292M + encoding: base64 + xrefs: + rfc: + - rfc3497 + template: + - video/SMPTE292M + registered: true +- !ruby/object:MIME::Type + content-type: video/ulpfec + encoding: base64 + xrefs: + rfc: + - rfc5109 + template: + - video/ulpfec + registered: true +- !ruby/object:MIME::Type + content-type: video/vc1 + encoding: base64 + xrefs: + rfc: + - rfc4425 + template: + - video/vc1 + registered: true +- !ruby/object:MIME::Type + content-type: video/vc2 + encoding: base64 + xrefs: + rfc: + - rfc8450 + template: + - video/vc2 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.CCTV + encoding: base64 + xrefs: + person: + - Frank_Rottmann + template: + - video/vnd.CCTV + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.hd + friendly: + en: DECE High Definition Video + encoding: base64 + extensions: + - uvh + - uvvh + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.hd + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.mobile + friendly: + en: DECE Mobile Video + encoding: base64 + extensions: + - uvm + - uvvm + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.mobile + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.mp4 + encoding: base64 + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.mp4 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.pd + friendly: + en: DECE PD Video + encoding: base64 + extensions: + - uvp + - uvvp + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.pd + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.sd + friendly: + en: DECE SD Video + encoding: base64 + extensions: + - uvs + - uvvs + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.sd + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dece.video + friendly: + en: DECE Video + encoding: base64 + extensions: + - uvv + - uvvv + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.dece.video + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.directv.mpeg + encoding: base64 + xrefs: + person: + - Nathan_Zerbe + template: + - video/vnd.directv.mpeg + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.directv.mpeg-tts + encoding: base64 + xrefs: + person: + - Nathan_Zerbe + template: + - video/vnd.directv.mpeg-tts + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dlna.mpeg-tts + encoding: base64 + xrefs: + person: + - Edwin_Heredia + template: + - video/vnd.dlna.mpeg-tts + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.dvb.file + encoding: base64 + extensions: + - dvb + xrefs: + person: + - Kevin_Murray + - Peter_Siebert + template: + - video/vnd.dvb.file + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.fvt + friendly: + en: FAST Search & Transfer ASA + encoding: base64 + extensions: + - fvt + xrefs: + person: + - Arild_Fuldseth + template: + - video/vnd.fvt + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.hns.video + encoding: base64 + xrefs: + person: + - Swaminathan + template: + - video/vnd.hns.video + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.1dparityfec-1010 + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.1dparityfec-1010 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.1dparityfec-2005 + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.1dparityfec-2005 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.2dparityfec-1010 + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.2dparityfec-1010 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.2dparityfec-2005 + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.2dparityfec-2005 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.ttsavc + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.ttsavc + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.iptvforum.ttsmpeg2 + encoding: base64 + xrefs: + person: + - Shuji_Nakamura + template: + - video/vnd.iptvforum.ttsmpeg2 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.motorola.video + encoding: base64 + xrefs: + person: + - Tom_McGinty + template: + - video/vnd.motorola.video + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.motorola.videop + encoding: base64 + xrefs: + person: + - Tom_McGinty + template: + - video/vnd.motorola.videop + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.mpegurl + friendly: + en: MPEG Url + encoding: 8bit + extensions: + - mxu + - m4u + xrefs: + person: + - Heiko_Recktenwald + template: + - video/vnd.mpegurl + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.ms-playready.media.pyv + friendly: + en: Microsoft PlayReady Ecosystem Video + encoding: base64 + extensions: + - pyv + xrefs: + person: + - Steve_DiAcetis + template: + - video/vnd.ms-playready.media.pyv + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.nokia.interleaved-multimedia + encoding: base64 + extensions: + - nim + xrefs: + person: + - Petteri_Kangaslampi + template: + - video/vnd.nokia.interleaved-multimedia + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.nokia.mp4vr + encoding: base64 + xrefs: + person: + - Miska_M._Hannuksela + template: + - video/vnd.nokia.mp4vr + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.nokia.videovoip + encoding: base64 + xrefs: + person: + - Nokia + template: + - video/vnd.nokia.videovoip + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.objectvideo + encoding: base64 + extensions: + - mp4 + - m4v + xrefs: + person: + - John_Clark + template: + - video/vnd.objectvideo + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.radgamettools.bink + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - video/vnd.radgamettools.bink + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.radgamettools.smacker + encoding: base64 + xrefs: + person: + - Henrik_Andersson + template: + - video/vnd.radgamettools.smacker + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.sealed.mpeg1 + encoding: base64 + extensions: + - s11 + xrefs: + person: + - David_Petersen + template: + - video/vnd.sealed.mpeg1 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.sealed.mpeg4 + encoding: base64 + extensions: + - smpg + - s14 + xrefs: + person: + - David_Petersen + template: + - video/vnd.sealed.mpeg4 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.sealed.swf + encoding: base64 + extensions: + - sswf + - ssw + xrefs: + person: + - David_Petersen + template: + - video/vnd.sealed.swf + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.sealedmedia.softseal.mov + encoding: base64 + extensions: + - smov + - smo + - s1q + xrefs: + person: + - David_Petersen + template: + - video/vnd.sealedmedia.softseal.mov + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.uvvu.mp4 + friendly: + en: DECE MP4 + encoding: base64 + extensions: + - uvu + - uvvu + xrefs: + person: + - Michael_A_Dolan + template: + - video/vnd.uvvu.mp4 + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.vivo + friendly: + en: Vivo + encoding: base64 + extensions: + - viv + - vivo + xrefs: + person: + - John_Wolfe + template: + - video/vnd.vivo + registered: true +- !ruby/object:MIME::Type + content-type: video/vnd.youtube.yt + encoding: base64 + xrefs: + person: + - Google + template: + - video/vnd.youtube.yt + registered: true +- !ruby/object:MIME::Type + content-type: video/VP8 + encoding: base64 + xrefs: + rfc: + - rfc7741 + template: + - video/VP8 + registered: true +- !ruby/object:MIME::Type + content-type: video/VP9 + encoding: base64 + xrefs: + draft: + - RFC-ietf-payload-vp9-16 + template: + - video/VP9 + registered: true +- !ruby/object:MIME::Type + content-type: video/webm + friendly: + en: Open Web Media Project - Video + encoding: base64 + extensions: + - webm + registered: false +- !ruby/object:MIME::Type + content-type: video/x-dl + encoding: base64 + extensions: + - dl + registered: false +- !ruby/object:MIME::Type + content-type: video/x-dv + encoding: base64 + extensions: + - dv + obsolete: true + use-instead: video/DV + registered: false +- !ruby/object:MIME::Type + content-type: video/x-f4v + friendly: + en: Flash Video + encoding: base64 + extensions: + - f4v + registered: false +- !ruby/object:MIME::Type + content-type: video/x-fli + friendly: + en: FLI/FLC Animation Format + encoding: base64 + extensions: + - fli + registered: false +- !ruby/object:MIME::Type + content-type: video/x-flv + friendly: + en: Flash Video + encoding: base64 + extensions: + - flv + registered: false +- !ruby/object:MIME::Type + content-type: video/x-gl + encoding: base64 + extensions: + - gl + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ivf + encoding: base64 + extensions: + - ivf + registered: false +- !ruby/object:MIME::Type + content-type: video/x-m4v + friendly: + en: M4v + encoding: base64 + extensions: + - m4v + registered: false +- !ruby/object:MIME::Type + content-type: video/x-matroska + encoding: base64 + extensions: + - mk3d + - mks + - mkv + registered: false +- !ruby/object:MIME::Type + content-type: video/x-mng + encoding: base64 + extensions: + - mng + registered: false +- !ruby/object:MIME::Type + content-type: video/x-motion-jpeg + encoding: base64 + extensions: + - mjpg + - mjpeg + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-asf + friendly: + en: Microsoft Advanced Systems Format (ASF) + encoding: base64 + extensions: + - asf + - asx + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-vob + encoding: base64 + extensions: + - vob + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-wm + friendly: + en: Microsoft Windows Media + encoding: base64 + extensions: + - wm + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-wmv + friendly: + en: Microsoft Windows Media Video + encoding: base64 + extensions: + - wmv + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-wmx + friendly: + en: Microsoft Windows Media Audio/Video Playlist + encoding: base64 + extensions: + - wmx + registered: false +- !ruby/object:MIME::Type + content-type: video/x-ms-wvx + friendly: + en: Microsoft Windows Media Video Playlist + encoding: base64 + extensions: + - wvx + registered: false +- !ruby/object:MIME::Type + content-type: video/x-msvideo + friendly: + en: Audio Video Interleave (AVI) + encoding: base64 + extensions: + - avi + registered: false +- !ruby/object:MIME::Type + content-type: video/x-sgi-movie + friendly: + en: SGI Movie + encoding: base64 + extensions: + - movie + registered: false +- !ruby/object:MIME::Type + content-type: video/x-smv + encoding: base64 + extensions: + - smv + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/world.yaml b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/world.yaml new file mode 100644 index 0000000..fc9bd15 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mime-types-data-3.2022.0105/types/world.yaml @@ -0,0 +1,8 @@ +--- +- !ruby/object:MIME::Type + content-type: x-world/x-vrml + encoding: base64 + extensions: + - wrl + - vrml + registered: false diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.gitignore b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.gitignore new file mode 100644 index 0000000..daba77c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.gitignore @@ -0,0 +1,13 @@ +*.swp +*.gem +Gemfile.lock +.bundle + +# doc +.yardoc +doc/ + +vendor + +# don't include generated files +lib/mimemagic/path.rb diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.travis.yml b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.travis.yml new file mode 100644 index 0000000..96311f9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.travis.yml @@ -0,0 +1,21 @@ +language: ruby +jobs: + include: + - rvm: 1.9.3 + - rvm: 2.0.0 + - rvm: 2.1 + - rvm: 2.2 + - rvm: 2.3 + - rvm: 2.4 + env: RUBYOPT="--enable-frozen-string-literal" + - rvm: 2.5 + env: RUBYOPT="--enable-frozen-string-literal" + - rvm: ruby-head + env: RUBYOPT="--enable-frozen-string-literal" +before_install: + # 1. The pre-installed Bundler version on Travis is very old; causes 1.9.3 build issues + # 2. Bundler 2.0 is not supported by the whole matrix + - gem install bundler -v'< 2' + +script: + - bundle exec rake diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.yardopts b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.yardopts new file mode 100644 index 0000000..acd858d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/.yardopts @@ -0,0 +1,6 @@ +--markup-provider=redcarpet +--markup=markdown +--no-private +- README.md +- LICENSE +- CHANGELOG.md diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/CHANGELOG.md b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/CHANGELOG.md new file mode 100644 index 0000000..eafb995 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/CHANGELOG.md @@ -0,0 +1,150 @@ +# Changelog + +## Unreleased + +### Breaking Changes + +## 0.4.1 + +Remove `mimemagic/overlay` as it contains outdated, little used, data. + +## 0.3.7 (2021-03-25) + +You will now need to ensure you have a copy of the fd.o shared MIME +types information available before installing this gem. More details +can be found in the readme. + +### Added + +None + +### Fixed + +None + +## 0.4.2 + +* Resolve issues parsing the version of freedesktop.org.xml shipped with + Ubuntu Trusty. + +* Make Rake a runtime dependency. + +* Fix the test suite. + +* Relax the dependency on Nokogiri to something less specific in order +to avoid conflicting with other dependencies in people's applications. + +## 0.4.1 + + +## 0.4.0 + +Yanked release. + +## 0.3.9 (2021-03-25) + +* Resolve issues parsing the version of freedesktop.org.xml shipped with + Ubuntu Trusty. + +* Reintroduce overlays, since it seems at least some people were using + them. + +* Make Rake a runtime dependency. + +* Fix the test suite. +## 0.3.8 (2021-03-25) + +Relax the dependency on Nokogiri to something less specific in order +to avoid conflicting with other dependencies in people's applications. + +## 0.3.7 (2021-03-25) + +Add a dependency on having a preinstalled version of the fd.o shared +MIME types info to resolve licensing concerns, and allow this gem to +remain MIT licensed. + +See the readme for details on ensuring you have a copy of the database +available at install time. +## 0.3.6 (2021-03-23) + +Yanked release, relicensing to GPL due to licensing concerns. +## 0.3.5 (2020-05-04) + +Mimetype extensions are now ordered by freedesktop.org's priority + +## 0.3.4 (2020-01-28) + +Added frozen string literal comments + +## 0.3.3 (2018-12-20) + +Upgrade to shared-mime-info-1.10 + +## 0.3.2 (2016-08-02) + +### Breaking Changes + +None + +### Added + +- [#37](https://github.com/minad/mimemagic/pull/37) + A convenient way to get all possible mime types by magic + +### Fixed + +- [#40](https://github.com/minad/mimemagic/pull/40), + [#41](https://github.com/minad/mimemagic/pull/41) + Performance improvements +- [#38](https://github.com/minad/mimemagic/pull/38) + Updated to shared-mime-info 1.6 + +## 0.3.1 (2016-01-04) + +No release notes yet. Contributions welcome. + +## 0.3.0 (2015-03-25) + +No release notes yet. Contributions welcome. + +## 0.2.1 (2013-07-29) + +No release notes yet. Contributions welcome. + +## 0.2.0 (2012-10-19) + +No release notes yet. Contributions welcome. + +## 0.1.9 (2012-09-20) + +No release notes yet. Contributions welcome. + +## 0.1.8 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.7 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.5 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.4 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.3 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.2 (2009-05-08) + +No release notes yet. Contributions welcome. + +## 0.1.1 (2009-05-08) + +No release notes yet. Contributions welcome. + + diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Gemfile b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Gemfile new file mode 100644 index 0000000..4ec9622 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org/' +gemspec + +gem 'yard' +gem 'redcarpet' +gem 'github-markup' diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/LICENSE b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/LICENSE new file mode 100644 index 0000000..cadc4b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2011 Daniel Mendler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/README.md b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/README.md new file mode 100644 index 0000000..f5ef301 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/README.md @@ -0,0 +1,65 @@ +MimeMagic is a library to detect the mime type of a file by extension or by content. It uses the mime database +provided by freedesktop.org (see http://freedesktop.org/wiki/Software/shared-mime-info/). + +[![Gem Version](https://img.shields.io/gem/v/mimemagic.svg)](http://rubygems.org/gems/mimemagic) + +Dependencies +============ + +You will require a copy of the Freedesktop.org shared-mime-info database to be available. If you're on Linux, +it's probably available via your package manager, and will probably be in the location it's being looked for +when the gem is installed. + +macOS users can install the database via Homebrew with `brew install shared-mime-info`. + +Should you be unable to use a package manager you can obtain a copy of the needed file by extracting it from +the Debian package. This process will also work on a Windows machine. + +1. Download the package from https://packages.debian.org/sid/amd64/shared-mime-info/download +2. Ensure the command line version of 7-Zip is installed +3. `7z x -so shared-mime-info_2.0-1_amd64.deb data.tar | 7z e -sidata.tar "./usr/share/mime/packages/freedesktop.org.xml"` + + +Place the file `freedesktop.org.xml` in an appropriate location, and then set the environment variable +`FREEDESKTOP_MIME_TYPES_PATH` to that path. Once that has been done the gem should install successfully. Please +note that the gem will depend upon the file remaining in that location at run time. + +Usage +===== + +```ruby +require 'mimemagic' +MimeMagic.by_extension('html').text? +MimeMagic.by_extension('.html').child_of? 'text/plain' +MimeMagic.by_path('filename.txt') +MimeMagic.by_magic(File.open('test.html')) +# etc... +``` + +You can add your own magic with `MimeMagic.add`. + +API +=== + +http://www.rubydoc.info/github/mimemagicrb/mimemagic + +Tests +===== + +```console +$ bundle install + +$ bundle exec rake test +``` + +Authors +======= + +* Daniel Mendler +* Jon Wood +* [MimeMagic Contributors](https://github.com/mimemagicrb/mimemagic/graphs/contributors) + +LICENSE +======= + +{file:LICENSE MIT} diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Rakefile b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Rakefile new file mode 100644 index 0000000..8be77d3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/Rakefile @@ -0,0 +1,22 @@ +require 'rake/testtask' +require 'rake/clean' + +namespace :ext do + load 'ext/mimemagic/Rakefile' +end +CLOBBER.include("lib/mimemagic/path.rb") + +task :default => %w(test) + +desc 'Run tests with minitest' +Rake::TestTask.new("test" => "ext:default") do |t| + t.libs << 'test' + t.pattern = 'test/*_test.rb' +end + +desc 'Generate mime tables' +task :tables => 'lib/mimemagic/tables.rb' +file 'lib/mimemagic/tables.rb' => FileList['script/freedesktop.org.xml'] do |f| + sh "script/generate-mime.rb #{f.prerequisites.join(' ')} > #{f.name}" +end + diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile new file mode 100644 index 0000000..4d32e71 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile @@ -0,0 +1,38 @@ +require "rubygems" +require "rake/clean" + +def locate_mime_database + possible_paths = [ + (File.expand_path(ENV["FREEDESKTOP_MIME_TYPES_PATH"]) if ENV["FREEDESKTOP_MIME_TYPES_PATH"]), + "/usr/local/share/mime/packages/freedesktop.org.xml", + "/opt/homebrew/share/mime/packages/freedesktop.org.xml", + "/opt/local/share/mime/packages/freedesktop.org.xml", + "/usr/share/mime/packages/freedesktop.org.xml" + ].compact + path = possible_paths.find { |candidate| File.exist?(candidate) } + + return path unless path.nil? + raise(<<-ERROR.gsub(/^ {3}/, "")) + Could not find MIME type database in the following locations: #{possible_paths} + + Ensure you have either installed the shared-mime-info package for your distribution, or + obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location + of that file. + ERROR +end + +desc "Build a file pointing at the database" +task :default do + mime_database_path = locate_mime_database + target_dir = "#{ENV.fetch("RUBYARCHDIR")}/mimemagic" + mkdir_p target_dir + + open("#{target_dir}/path.rb", "w") do |f| + f.print(<<~SOURCE + class MimeMagic + DATABASE_PATH="#{mime_database_path}" + end + SOURCE + ) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic.rb b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic.rb new file mode 100644 index 0000000..8fe8372 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +require 'mimemagic/tables' +require 'mimemagic/version' + +require 'stringio' + +MimeMagic.parse_database + +# Mime type detection +class MimeMagic + attr_reader :type, :mediatype, :subtype + + # Mime type by type string + def initialize(type) + @type = type + @mediatype, @subtype = type.split('/', 2) + end + + # Add custom mime type. Arguments: + # * type: Mime type + # * options: Options hash + # + # Option keys: + # * :extensions: String list or single string of file extensions + # * :parents: String list or single string of parent mime types + # * :magic: Mime magic specification + # * :comment: Comment string + def self.add(type, options) + extensions = [options[:extensions]].flatten.compact + TYPES[type] = [extensions, + [options[:parents]].flatten.compact, + options[:comment]] + extensions.each {|ext| EXTENSIONS[ext] = type } + MAGIC.unshift [type, options[:magic]] if options[:magic] + end + + # Removes a mime type from the dictionary. You might want to do this if + # you're seeing impossible conflicts (for instance, application/x-gmc-link). + # * type: The mime type to remove. All associated extensions and magic are removed too. + def self.remove(type) + EXTENSIONS.delete_if {|ext, t| t == type } + MAGIC.delete_if {|t, m| t == type } + TYPES.delete(type) + end + + # Returns true if type is a text format + def text?; mediatype == 'text' || child_of?('text/plain'); end + + # Mediatype shortcuts + def image?; mediatype == 'image'; end + def audio?; mediatype == 'audio'; end + def video?; mediatype == 'video'; end + + # Returns true if type is child of parent type + def child_of?(parent) + MimeMagic.child?(type, parent) + end + + # Get string list of file extensions + def extensions + TYPES.key?(type) ? TYPES[type][0] : [] + end + + # Get mime comment + def comment + (TYPES.key?(type) ? TYPES[type][2] : nil).to_s + end + + # Lookup mime type by file extension + def self.by_extension(ext) + ext = ext.to_s.downcase + mime = ext[0..0] == '.' ? EXTENSIONS[ext[1..-1]] : EXTENSIONS[ext] + mime && new(mime) + end + + # Lookup mime type by filename + def self.by_path(path) + by_extension(File.extname(path)) + end + + # Lookup mime type by magic content analysis. + # This is a slow operation. + def self.by_magic(io) + mime = magic_match(io, :find) + mime && new(mime[0]) + end + + # Lookup all mime types by magic content analysis. + # This is a slower operation. + def self.all_by_magic(io) + magic_match(io, :select).map { |mime| new(mime[0]) } + end + + # Return type as string + def to_s + type + end + + # Allow comparison with string + def eql?(other) + type == other.to_s + end + + def hash + type.hash + end + + alias == eql? + + def self.child?(child, parent) + child == parent || TYPES.key?(child) && TYPES[child][1].any? {|p| child?(p, parent) } + end + + def self.magic_match(io, method) + return magic_match(StringIO.new(io.to_s), method) unless io.respond_to?(:read) + + io.binmode if io.respond_to?(:binmode) + io.set_encoding(Encoding::BINARY) if io.respond_to?(:set_encoding) + buffer = "".encode(Encoding::BINARY) + + MAGIC.send(method) { |type, matches| magic_match_io(io, matches, buffer) } + end + + def self.magic_match_io(io, matches, buffer) + matches.any? do |offset, value, children| + match = + if Range === offset + io.read(offset.begin, buffer) + x = io.read(offset.end - offset.begin + value.bytesize, buffer) + x && x.include?(value) + else + io.read(offset, buffer) + io.read(value.bytesize, buffer) == value + end + io.rewind + match && (!children || magic_match_io(io, children, buffer)) + end + end + + private_class_method :magic_match, :magic_match_io +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/tables.rb b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/tables.rb new file mode 100644 index 0000000..11da9f6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/tables.rb @@ -0,0 +1,155 @@ +# -*- coding: binary -*- +# frozen_string_literal: true +# Generated from script/freedesktop.org.xml +require 'nokogiri' +require 'mimemagic/path' + +class MimeMagic + EXTENSIONS = {} + TYPES = {} + MAGIC = [] + + def self.str2int(s) + return s.to_i(16) if s[0..1].downcase == '0x' + return s.to_i(8) if s[0..0].downcase == '0' + s.to_i(10) + end + + def self.get_matches(parent) + parent.elements.map {|match| + if match['mask'] + nil + else + type = match['type'] + value = match['value'] + offset = match['offset'].split(':').map {|x| x.to_i } + offset = offset.size == 2 ? offset[0]..offset[1] : offset[0] + case type + when 'string' + # This *one* pattern match, in the entirety of fd.o's mime types blows up the parser + # because of the escape character \c, so right here we have a hideous hack to + # accommodate that. + if value == '\chapter' + '\chapter' + else + value.gsub!(/\\(x[\dA-Fa-f]{1,2}|0\d{1,3}|\d{1,3}|.)/) { + eval("\"\\#{$1}\"") + } + end + when 'big16' + value = str2int(value) + value = ((value >> 8).chr + (value & 0xFF).chr) + when 'big32' + value = str2int(value) + value = (((value >> 24) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 8) & 0xFF).chr + (value & 0xFF).chr) + when 'little16' + value = str2int(value) + value = ((value & 0xFF).chr + (value >> 8).chr) + when 'little32' + value = str2int(value) + value = ((value & 0xFF).chr + ((value >> 8) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 24) & 0xFF).chr) + when 'host16' # use little endian + value = str2int(value) + value = ((value & 0xFF).chr + (value >> 8).chr) + when 'host32' # use little endian + value = str2int(value) + value = ((value & 0xFF).chr + ((value >> 8) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 24) & 0xFF).chr) + when 'byte' + value = str2int(value) + value = value.chr + end + children = get_matches(match) + children.empty? ? [offset, value] : [offset, value, children] + end + }.compact + end + + def self.open_mime_database + path = MimeMagic::DATABASE_PATH + File.open(path) + end + + def self.parse_database + file = open_mime_database + + doc = Nokogiri::XML(file) + extensions = {} + types = {} + magics = [] + (doc/'mime-info/mime-type').each do |mime| + comments = Hash[*(mime/'comment').map {|comment| [comment['xml:lang'], comment.inner_text] }.flatten] + type = mime['type'] + subclass = (mime/'sub-class-of').map{|x| x['type']} + exts = (mime/'glob').map{|x| x['pattern'] =~ /^\*\.([^\[\]]+)$/ ? $1.downcase : nil }.compact + (mime/'magic').each do |magic| + priority = magic['priority'].to_i + matches = get_matches(magic) + magics << [priority, type, matches] + end + if !exts.empty? + exts.each{|x| + extensions[x] = type if !extensions.include?(x) + } + types[type] = [exts,subclass,comments[nil]] + end + end + + magics = magics.sort {|a,b| [-a[0],a[1]] <=> [-b[0],b[1]] } + + common_types = [ + "image/jpeg", # .jpg + "image/png", # .png + "image/gif", # .gif + "image/tiff", # .tiff + "image/bmp", # .bmp + "image/vnd.adobe.photoshop", # .psd + "image/webp", # .webp + "image/svg+xml", # .svg + + "video/x-msvideo", # .avi + "video/x-ms-wmv", # .wmv + "video/mp4", # .mp4, .m4v + "video/quicktime", # .mov + "video/mpeg", # .mpeg + "video/ogg", # .ogv + "video/webm", # .webm + "video/x-matroska", # .mkv + "video/x-flv", # .flv + + "audio/mpeg", # .mp3 + "audio/x-wav", # .wav + "audio/aac", # .aac + "audio/flac", # .flac + "audio/mp4", # .m4a + "audio/ogg", # .ogg + + "application/pdf", # .pdf + "application/msword", # .doc + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", # .docx + "application/vnd.ms-powerpoint", # .pps + "application/vnd.openxmlformats-officedocument.presentationml.slideshow", # .ppsx + "application/vnd.ms-excel", # .pps + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", # .ppsx + ] + + common_magics = common_types.map do |common_type| + magics.find { |_, type, _| type == common_type } + end + + magics = (common_magics.compact + magics).uniq + + extensions.keys.sort.each do |key| + EXTENSIONS[key] = extensions[key] + end + types.keys.sort.each do |key| + exts = types[key][0] + parents = types[key][1].sort + comment = types[key][2] + + TYPES[key] = [exts, parents, comment] + end + magics.each do |priority, type, matches| + MAGIC << [type, matches] + end + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/version.rb b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/version.rb new file mode 100644 index 0000000..56e3ee1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/lib/mimemagic/version.rb @@ -0,0 +1,5 @@ +class MimeMagic + # MimeMagic version string + # @api public + VERSION = '0.4.3' +end diff --git a/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/mimemagic.gemspec b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/mimemagic.gemspec new file mode 100644 index 0000000..e62ef67 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/mimemagic-0.4.3/mimemagic.gemspec @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +require File.dirname(__FILE__) + '/lib/mimemagic/version' +require 'date' + +Gem::Specification.new do |s| + s.name = 'mimemagic' + s.version = MimeMagic::VERSION + + s.authors = ['Daniel Mendler', 'Jon Wood'] + s.date = Date.today.to_s + s.email = ['mail@daniel-mendler.de', 'jon@blankpad.net'] + + s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|script)/}) } + s.require_paths = %w(lib) + s.extensions = %w(ext/mimemagic/Rakefile) + + s.summary = 'Fast mime detection by extension or content' + s.description = 'Fast mime detection by extension or content (Uses freedesktop.org.xml shared-mime-info database)' + s.homepage = 'https://github.com/mimemagicrb/mimemagic' + s.license = 'MIT' + + s.add_dependency('nokogiri', '~> 1') + s.add_dependency('rake') + + s.add_development_dependency('minitest', '~> 5.14') + + if s.respond_to?(:metadata) + s.metadata['changelog_uri'] = "https://github.com/mimemagicrb/mimemagic/blob/master/CHANGELOG.md" + s.metadata['source_code_uri'] = "https://github.com/mimemagicrb/mimemagic" + s.metadata['bug_tracker_uri'] = "https://github.com/mimemagicrb/mimemagic/issues" + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/LICENSE.md b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/LICENSE.md new file mode 100644 index 0000000..a834fbb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2011-2014 [CONTRIBUTORS.md](https://github.com/geemus/netrc/blob/master/CONTRIBUTORS.md) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/Readme.md b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/Readme.md new file mode 100644 index 0000000..9193474 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/Readme.md @@ -0,0 +1,53 @@ +# Netrc + +This library reads and writes +[`.netrc` files](http://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html). + +## API + +Read a netrc file: + + n = Netrc.read("sample.netrc") + +If the file doesn't exist, Netrc.read will return an empty object. If +the filename ends in ".gpg", it will be decrypted using +[GPG](http://www.gnupg.org/). + +Read the user's default netrc file. + +**On Unix:** `$NETRC/.netrc` or `$HOME/.netrc` (whichever is set first). + +**On Windows:** `%NETRC%\_netrc`, `%HOME%\_netrc`, `%HOMEDRIVE%%HOMEPATH%\_netrc`, or `%USERPROFILE%\_netrc` (whichever is set first). + + n = Netrc.read + +Configure netrc to allow permissive files (with permissions other than 0600): + + Netrc.configure do |config| + config[:allow_permissive_netrc_file] = true + end + +Look up a username and password: + + user, pass = n["example.com"] + +Write a username and password: + + n["example.com"] = user, newpass + n.save + +If you make an entry that wasn't there before, it will be appended +to the end of the file. Sometimes people want to include a comment +explaining that the entry was added automatically. You can do it +like this: + + n.new_item_prefix = "# This entry was added automatically\n" + n["example.com"] = user, newpass + n.save + +Have fun! + +## Running Tests + + $ bundle install + $ bundle exec ruby -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/changelog.txt b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/changelog.txt new file mode 100644 index 0000000..60beb4e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/changelog.txt @@ -0,0 +1,93 @@ +0.11.0 10/29/15 +=============== + +Respect NETRC environment variable +Fix for JRuby PernGen Space + +0.10.3 02/24/15 +=============== + +error when Dir.home is not readable + +0.10.2 12/17/14 +=============== + +set file permissions in /data to be world readable after test runs + +0.10.1 12/14/14 +=============== + +fix bug for `Dir.home` when can't find home + +0.10.0 12/10/14 +=============== + +use `Dir.home` for finding home on Ruby 1.9+ + +0.9.0 12/01/14 +============== + +use HOME or HOMEPATH/HOMEDRIVE to find home on windows + +0.8.0 10/16/14 +============== + +re-revert entry changes with minor bump + +0.7.9 10/16/14 +============== + +revert entry changes for a backwards-compatible version + +0.7.8 10/15/14 +============== + +add entry class to facilitate usage +switch gem source to rubygems.org +use guard, when available via guardfile +add default/read-only behavior +add allow_permissive_netrc_file option +fix an undefined variable path +fix Errno::EACCES error +silence const warnings in test + +0.7.7 08/15/12 +============== + +add newline between entries if one is missing + +0.7.6 08/15/12 +============== + +more unified newline handling +make entries with login/password parsable + + +0.7.5 06/25/12 +============== + +* improved operating system detection + +0.7.4 06/04/12 +============== + +* add support for encrypted files pgp netrc files + +0.7.3 06/04/12 +============== + +* also skip permissions check on cygwin + +0.7.2 05/23/12 +============= + +* use length instead of count on Array, provides compatibility with 1.8.6 + + +0.7.1 03/13/12 +============== + +* add Gemfile to simplify development +* add MIT license +* fix test require path +* fix unused variable assignment (caused warnings) in tests diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/default_only.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/default_only.netrc new file mode 100644 index 0000000..8df77a9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/default_only.netrc @@ -0,0 +1,4 @@ +# this is my netrc with only a default +default + login ld # this is my default username + password pd diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/login.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/login.netrc new file mode 100644 index 0000000..f0ec3b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/login.netrc @@ -0,0 +1,3 @@ +# this is my login netrc +machine m + login l # this is my username diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/newlineless.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/newlineless.netrc new file mode 100644 index 0000000..5f3b1ce --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/newlineless.netrc @@ -0,0 +1,4 @@ +# this is my netrc +machine m + login l # this is my username + password p \ No newline at end of file diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/password.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/password.netrc new file mode 100644 index 0000000..ce68670 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/password.netrc @@ -0,0 +1,3 @@ +# this is my password netrc +machine m + password p # this is my password diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/permissive.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/permissive.netrc new file mode 100644 index 0000000..b92cad3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/permissive.netrc @@ -0,0 +1,4 @@ +# this is my netrc +machine m + login l # this is my username + password p diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample.netrc new file mode 100644 index 0000000..b92cad3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample.netrc @@ -0,0 +1,4 @@ +# this is my netrc +machine m + login l # this is my username + password p diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi.netrc new file mode 100644 index 0000000..1936d4b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi.netrc @@ -0,0 +1,8 @@ +# this is my netrc with multiple machines +machine m + login lm # this is my m-username + password pm + +machine n + login ln # this is my n-username + password pn diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi_with_default.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi_with_default.netrc new file mode 100644 index 0000000..4e7dfe6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_multi_with_default.netrc @@ -0,0 +1,12 @@ +# this is my netrc with multiple machines and a default +machine m + login lm # this is my m-username + password pm + +machine n + login ln # this is my n-username + password pn + +default + login ld # this is my default username + password pd diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_with_default.netrc b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_with_default.netrc new file mode 100644 index 0000000..76597f3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/data/sample_with_default.netrc @@ -0,0 +1,8 @@ +# this is my netrc with default +machine m + login l # this is my username + password p + +default + login default_login # this is my default username + password default_password diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/lib/netrc.rb b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/lib/netrc.rb new file mode 100644 index 0000000..83e4c5e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/lib/netrc.rb @@ -0,0 +1,251 @@ +require 'rbconfig' + +class Netrc + VERSION = "0.11.0" + + # see http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows + WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/ + CYGWIN = RbConfig::CONFIG["host_os"] =~ /cygwin/ + + def self.default_path + File.join(ENV['NETRC'] || home_path, netrc_filename) + end + + def self.home_path + home = Dir.respond_to?(:home) ? Dir.home : ENV['HOME'] + + if WINDOWS && !CYGWIN + home ||= File.join(ENV['HOMEDRIVE'], ENV['HOMEPATH']) if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] + home ||= ENV['USERPROFILE'] + # XXX: old stuff; most likely unnecessary + home = home.tr("\\", "/") unless home.nil? + end + + (home && File.readable?(home)) ? home : Dir.pwd + rescue ArgumentError + return Dir.pwd + end + + def self.netrc_filename + WINDOWS && !CYGWIN ? "_netrc" : ".netrc" + end + + def self.config + @config ||= {} + end + + def self.configure + yield(self.config) if block_given? + self.config + end + + def self.check_permissions(path) + perm = File.stat(path).mode & 0777 + if perm != 0600 && !(WINDOWS) && !(Netrc.config[:allow_permissive_netrc_file]) + raise Error, "Permission bits for '#{path}' should be 0600, but are "+perm.to_s(8) + end + end + + # Reads path and parses it as a .netrc file. If path doesn't + # exist, returns an empty object. Decrypt paths ending in .gpg. + def self.read(path=default_path) + check_permissions(path) + data = if path =~ /\.gpg$/ + decrypted = `gpg --batch --quiet --decrypt #{path}` + if $?.success? + decrypted + else + raise Error.new("Decrypting #{path} failed.") unless $?.success? + end + else + File.read(path) + end + new(path, parse(lex(data.lines.to_a))) + rescue Errno::ENOENT + new(path, parse(lex([]))) + end + + class TokenArray < Array + def take + if length < 1 + raise Error, "unexpected EOF" + end + shift + end + + def readto + l = [] + while length > 0 && ! yield(self[0]) + l << shift + end + return l.join + end + end + + def self.lex(lines) + tokens = TokenArray.new + for line in lines + content, comment = line.split(/(\s*#.*)/m) + content.each_char do |char| + case char + when /\s/ + if tokens.last && tokens.last[-1..-1] =~ /\s/ + tokens.last << char + else + tokens << char + end + else + if tokens.last && tokens.last[-1..-1] =~ /\S/ + tokens.last << char + else + tokens << char + end + end + end + if comment + tokens << comment + end + end + tokens + end + + def self.skip?(s) + s =~ /^\s/ + end + + + + # Returns two values, a header and a list of items. + # Each item is a tuple, containing some or all of: + # - machine keyword (including trailing whitespace+comments) + # - machine name + # - login keyword (including surrounding whitespace+comments) + # - login + # - password keyword (including surrounding whitespace+comments) + # - password + # - trailing chars + # This lets us change individual fields, then write out the file + # with all its original formatting. + def self.parse(ts) + cur, item = [], [] + + unless ts.is_a?(TokenArray) + ts = TokenArray.new(ts) + end + + pre = ts.readto{|t| t == "machine" || t == "default"} + + while ts.length > 0 + if ts[0] == 'default' + cur << ts.take.to_sym + cur << '' + else + cur << ts.take + ts.readto{|t| ! skip?(t)} + cur << ts.take + end + + if ts.include?('login') + cur << ts.readto{|t| t == "login"} + ts.take + ts.readto{|t| ! skip?(t)} + cur << ts.take + end + + if ts.include?('password') + cur << ts.readto{|t| t == "password"} + ts.take + ts.readto{|t| ! skip?(t)} + cur << ts.take + end + + cur << ts.readto{|t| t == "machine" || t == "default"} + + item << cur + cur = [] + end + + [pre, item] + end + + def initialize(path, data) + @new_item_prefix = '' + @path = path + @pre, @data = data + + if @data && @data.last && :default == @data.last[0] + @default = @data.pop + else + @default = nil + end + end + + attr_accessor :new_item_prefix + + def [](k) + if item = @data.detect {|datum| datum[1] == k} + Entry.new(item[3], item[5]) + elsif @default + Entry.new(@default[3], @default[5]) + end + end + + def []=(k, info) + if item = @data.detect {|datum| datum[1] == k} + item[3], item[5] = info + else + @data << new_item(k, info[0], info[1]) + end + end + + def length + @data.length + end + + def delete(key) + datum = nil + for value in @data + if value[1] == key + datum = value + break + end + end + @data.delete(datum) + end + + def each(&block) + @data.each(&block) + end + + def new_item(m, l, p) + [new_item_prefix+"machine ", m, "\n login ", l, "\n password ", p, "\n"] + end + + def save + if @path =~ /\.gpg$/ + e = IO.popen("gpg -a --batch --default-recipient-self -e", "r+") do |gpg| + gpg.puts(unparse) + gpg.close_write + gpg.read + end + raise Error.new("Encrypting #{@path} failed.") unless $?.success? + File.open(@path, 'w', 0600) {|file| file.print(e)} + else + File.open(@path, 'w', 0600) {|file| file.print(unparse)} + end + end + + def unparse + @pre + @data.map do |datum| + datum = datum.join + unless datum[-1..-1] == "\n" + datum << "\n" + else + datum + end + end.join + end + + Entry = Struct.new(:login, :password) do + alias to_ary to_a + end + +end + +class Netrc::Error < ::StandardError +end diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_lex.rb b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_lex.rb new file mode 100644 index 0000000..e63ff1d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_lex.rb @@ -0,0 +1,58 @@ +$VERBOSE = true +require 'minitest/autorun' + +require File.expand_path("#{File.dirname(__FILE__)}/../lib/netrc") + +class TestLex < Minitest::Test + def test_lex_empty + t = Netrc.lex([]) + assert_equal([], t) + end + + def test_lex_comment + t = Netrc.lex(["# foo\n"]) + assert_equal(["# foo\n"], t) + end + + def test_lex_comment_after_space + t = Netrc.lex([" # foo\n"]) + assert_equal([" # foo\n"], t) + end + + def test_lex_comment_after_word + t = Netrc.lex(["x # foo\n"]) + assert_equal(["x", " # foo\n"], t) + end + + def test_lex_comment_with_hash + t = Netrc.lex(["x # foo # bar\n"]) + assert_equal(["x", " # foo # bar\n"], t) + end + + def test_lex_word + t = Netrc.lex(["x"]) + assert_equal(["x"], t) + end + + def test_lex_two_lines + t = Netrc.lex(["x\ny\n"]) + assert_equal(["x", "\n", "y", "\n"], t) + end + + def test_lex_word_and_comment + t = Netrc.lex(["x\n", "# foo\n"]) + assert_equal(["x", "\n", "# foo\n"], t) + end + + def test_lex_six_words + t = Netrc.lex(["machine m login l password p\n"]) + e = ["machine", " ", "m", " ", "login", " ", "l", " ", "password", " ", "p", "\n"] + assert_equal(e, t) + end + + def test_lex_complex + t = Netrc.lex(["machine sub.domain.com login email@domain.com password pass\n"]) + e = ["machine", " ", "sub.domain.com", " ", "login", " ", "email@domain.com", " ", "password", " ", "pass", "\n"] + assert_equal(e, t) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_netrc.rb b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_netrc.rb new file mode 100644 index 0000000..73c5c25 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_netrc.rb @@ -0,0 +1,273 @@ +$VERBOSE = true +require 'minitest/autorun' +require 'fileutils' + +require File.expand_path("#{File.dirname(__FILE__)}/../lib/netrc") +require "rbconfig" + +class TestNetrc < Minitest::Test + + def setup + Dir.glob('data/*.netrc').each{|f| File.chmod(0600, f)} + File.chmod(0644, "data/permissive.netrc") + end + + def teardown + Dir.glob('data/*.netrc').each{|f| File.chmod(0644, f)} + end + + def test_parse_empty + pre, items = Netrc.parse(Netrc.lex([])) + assert_equal("", pre) + assert_equal([], items) + end + + def test_parse_file + pre, items = Netrc.parse(Netrc.lex(IO.readlines("data/sample.netrc"))) + assert_equal("# this is my netrc\n", pre) + exp = [["machine ", + "m", + "\n login ", + "l", + " # this is my username\n password ", + "p", + "\n"]] + assert_equal(exp, items) + end + + def test_login_file + pre, items = Netrc.parse(Netrc.lex(IO.readlines("data/login.netrc"))) + assert_equal("# this is my login netrc\n", pre) + exp = [["machine ", + "m", + "\n login ", + "l", + " # this is my username\n"]] + assert_equal(exp, items) + end + + def test_password_file + pre, items = Netrc.parse(Netrc.lex(IO.readlines("data/password.netrc"))) + assert_equal("# this is my password netrc\n", pre) + exp = [["machine ", + "m", + "\n password ", + "p", + " # this is my password\n"]] + assert_equal(exp, items) + end + + def test_missing_file + n = Netrc.read("data/nonexistent.netrc") + assert_equal(0, n.length) + end + + def test_permission_error + original_windows = Netrc::WINDOWS + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, false) + Netrc.read("data/permissive.netrc") + assert false, "Should raise an error if permissions are wrong on a non-windows system." + rescue Netrc::Error + assert true, "" + ensure + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, original_windows) + end + + def test_allow_permissive_netrc_file_option + Netrc.configure do |config| + config[:allow_permissive_netrc_file] = true + end + original_windows = Netrc::WINDOWS + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, false) + Netrc.read("data/permissive.netrc") + assert true, "" + rescue Netrc::Error + assert false, "Should not raise an error if allow_permissive_netrc_file option is set to true" + ensure + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, original_windows) + Netrc.configure do |config| + config[:allow_permissive_netrc_file] = false + end + end + + def test_permission_error_windows + original_windows = Netrc::WINDOWS + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, true) + Netrc.read("data/permissive.netrc") + rescue Netrc::Error + assert false, "Should not raise an error if permissions are wrong on a non-windows system." + ensure + Netrc.send(:remove_const, :WINDOWS) + Netrc.const_set(:WINDOWS, original_windows) + end + + def test_round_trip + n = Netrc.read("data/sample.netrc") + assert_equal(IO.read("data/sample.netrc"), n.unparse) + end + + def test_set + n = Netrc.read("data/sample.netrc") + n["m"] = "a", "b" + exp = "# this is my netrc\n"+ + "machine m\n"+ + " login a # this is my username\n"+ + " password b\n" + assert_equal(exp, n.unparse) + end + + def test_set_get + n = Netrc.read("data/sample.netrc") + n["m"] = "a", "b" + assert_equal(["a", "b"], n["m"].to_a) + end + + def test_add + n = Netrc.read("data/sample.netrc") + n.new_item_prefix = "# added\n" + n["x"] = "a", "b" + exp = "# this is my netrc\n"+ + "machine m\n"+ + " login l # this is my username\n"+ + " password p\n"+ + "# added\n"+ + "machine x\n"+ + " login a\n"+ + " password b\n" + assert_equal(exp, n.unparse) + end + + def test_add_newlineless + n = Netrc.read("data/newlineless.netrc") + n.new_item_prefix = "# added\n" + n["x"] = "a", "b" + exp = "# this is my netrc\n"+ + "machine m\n"+ + " login l # this is my username\n"+ + " password p\n"+ + "# added\n"+ + "machine x\n"+ + " login a\n"+ + " password b\n" + assert_equal(exp, n.unparse) + end + + def test_add_get + n = Netrc.read("data/sample.netrc") + n.new_item_prefix = "# added\n" + n["x"] = "a", "b" + assert_equal(["a", "b"], n["x"].to_a) + end + + def test_get_missing + n = Netrc.read("data/sample.netrc") + assert_equal(nil, n["x"]) + end + + def test_save + n = Netrc.read("data/sample.netrc") + n.save + assert_equal(File.read("data/sample.netrc"), n.unparse) + end + + def test_save_create + FileUtils.rm_f("/tmp/created.netrc") + n = Netrc.read("/tmp/created.netrc") + n.save + unless Netrc::WINDOWS + assert_equal(0600, File.stat("/tmp/created.netrc").mode & 0777) + end + end + + def test_encrypted_roundtrip + if `gpg --list-keys 2> /dev/null` != "" + FileUtils.rm_f("/tmp/test.netrc.gpg") + n = Netrc.read("/tmp/test.netrc.gpg") + n["m"] = "a", "b" + n.save + assert_equal(0600, File.stat("/tmp/test.netrc.gpg").mode & 0777) + netrc = Netrc.read("/tmp/test.netrc.gpg")["m"] + assert_equal("a", netrc.login) + assert_equal("b", netrc.password) + end + end + + def test_missing_environment + nil_home = nil + ENV["HOME"], nil_home = nil_home, ENV["HOME"] + assert_equal File.join(Dir.pwd, '.netrc'), Netrc.default_path + ensure + ENV["HOME"], nil_home = nil_home, ENV["HOME"] + end + + def test_netrc_environment_variable + ENV["NETRC"] = File.join(Dir.pwd, 'data') + assert_equal File.join(Dir.pwd, 'data', '.netrc'), Netrc.default_path + ensure + ENV.delete("NETRC") + end + + def test_read_entry + entry = Netrc.read("data/sample.netrc")['m'] + assert_equal 'l', entry.login + assert_equal 'p', entry.password + + # hash-style + assert_equal 'l', entry[:login] + assert_equal 'p', entry[:password] + end + + def test_write_entry + n = Netrc.read("data/sample.netrc") + entry = n['m'] + entry.login = 'new_login' + entry.password = 'new_password' + n['m'] = entry + assert_equal(['new_login', 'new_password'], n['m'].to_a) + end + + def test_entry_splat + e = Netrc::Entry.new("user", "pass") + user, pass = *e + assert_equal("user", user) + assert_equal("pass", pass) + end + + def test_entry_implicit_splat + e = Netrc::Entry.new("user", "pass") + user, pass = e + assert_equal("user", user) + assert_equal("pass", pass) + end + + def test_with_default + netrc = Netrc.read('data/sample_with_default.netrc') + assert_equal(['l', 'p'], netrc['m'].to_a) + assert_equal(['default_login', 'default_password'], netrc['unknown'].to_a) + end + + def test_multi_without_default + netrc = Netrc.read('data/sample_multi.netrc') + assert_equal(['lm', 'pm'], netrc['m'].to_a) + assert_equal(['ln', 'pn'], netrc['n'].to_a) + assert_equal([], netrc['other'].to_a) + end + + def test_multi_with_default + netrc = Netrc.read('data/sample_multi_with_default.netrc') + assert_equal(['lm', 'pm'], netrc['m'].to_a) + assert_equal(['ln', 'pn'], netrc['n'].to_a) + assert_equal(['ld', 'pd'], netrc['other'].to_a) + end + + def test_default_only + netrc = Netrc.read('data/default_only.netrc') + assert_equal(['ld', 'pd'], netrc['m'].to_a) + assert_equal(['ld', 'pd'], netrc['other'].to_a) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_parse.rb b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_parse.rb new file mode 100644 index 0000000..9e61c69 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/netrc-0.11.0/test/test_parse.rb @@ -0,0 +1,34 @@ +$VERBOSE = true +require 'minitest/autorun' + +require File.expand_path("#{File.dirname(__FILE__)}/../lib/netrc") + +class TestParse < Minitest::Test + def test_parse_empty + pre, items = Netrc.parse([]) + assert_equal("", pre) + assert_equal([], items) + end + + def test_parse_comment + pre, items = Netrc.parse(["# foo\n"]) + assert_equal("# foo\n", pre) + assert_equal([], items) + end + + def test_parse_item + t = ["machine", " ", "m", " ", "login", " ", "l", " ", "password", " ", "p", "\n"] + pre, items = Netrc.parse(t) + assert_equal("", pre) + e = [["machine ", "m", " login ", "l", " password ", "p", "\n"]] + assert_equal(e, items) + end + + def test_parse_two_items + t = ["machine", " ", "m", " ", "login", " ", "l", " ", "password", " ", "p", "\n"] * 2 + pre, items = Netrc.parse(t) + assert_equal("", pre) + e = [["machine ", "m", " login ", "l", " password ", "p", "\n"]] * 2 + assert_equal(e, items) + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/Gemfile b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/Gemfile new file mode 100644 index 0000000..16f52b1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec + +# gem "rcodetools" +# gem "rdoc", path: "../rdoc" diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE-DEPENDENCIES.md b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE-DEPENDENCIES.md new file mode 100644 index 0000000..d6811cc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE-DEPENDENCIES.md @@ -0,0 +1,1903 @@ +# Vendored Dependency Licenses + +Nokogiri ships with some third party dependencies, which are listed here along with their licenses. + +Note that this document is broken into multiple sections, each of which describes the dependencies of a different "platform release" of Nokogiri. + + + + + +- [Platform Releases](#platform-releases) + * [Default platform release ("ruby")](#default-platform-release-ruby) + * [Native LinuxⓇ platform releases ("x86_64-linux" and "arm64-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-and-arm64-linux) + * [Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")](#native-darwin-macos%E2%93%A1-platform-releases-x86_64-darwin-and-arm64-darwin) + * [Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")](#native-windows%E2%93%A1-platform-releases-x86-mingw32-and-x64-mingw32) + * [JavaⓇ (JRuby) platform release ("java")](#java%E2%93%A1-jruby-platform-release-java) +- [Appendix: Dependencies' License Texts](#appendix-dependencies-license-texts) + * [libgumbo and nokogumbo](#libgumbo-and-nokogumbo) + * [libxml2](#libxml2) + * [libxslt](#libxslt) + * [zlib](#zlib) + * [libiconv](#libiconv) + * [isorelax](#isorelax) + * [jing](#jing) + * [nekodtd](#nekodtd) + * [nekohtml](#nekohtml) + * [xalan](#xalan) + * [xerces](#xerces) + * [xml-apis](#xml-apis) + + + +Anyone consuming this file via license-tracking software should endeavor to understand which gem file you're downloading and using, so as not to misinterpret the contents of this file and the licenses of the software being distributed. + +You can double-check the dependencies in your gem file by examining the output of `nokogiri -v` after installation, which will emit the complete set of libraries in use (for versions `>= 1.11.0.rc4`). + +In particular, I'm sure somebody's lawyer, somewhere, is going to freak out that the LGPL appears in this file; and so I'd like to take special note that the dependency covered by LGPL, `libiconv`, is only being redistributed in the native Windows and native Darwin platform releases. It's not present in default, JavaⓇ, or native LinuxⓇ releases. + + +## Platform Releases + +### Default platform release ("ruby") + +The default platform release distributes the following dependencies in source form: + +- [libxml2](#libxml2) +- [libxslt](#libxslt) +- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo) + +This distribution can be identified by inspecting the included Gem::Specification, which will have the value "ruby" for its "platform" attribute. + + +### Native LinuxⓇ platform releases ("x86_64-linux" and "arm64-linux") + +The native LinuxⓇ platform release distributes the following dependencies in source form: + +- [libxml2](#libxml2) +- [libxslt](#libxslt) +- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo) +- [zlib](#zlib) + +This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "x86-linux" for its "platform.cpu" attribute. + + +### Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin") + +The native Darwin platform release distributes the following dependencies in source form: + +- [libxml2](#libxml2) +- [libxslt](#libxslt) +- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo) +- [zlib](#zlib) +- [libiconv](#libiconv) + +This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-darwin" or "arm64-darwin" for its "platform.cpu" attribute. Darwin is also known more familiarly as "OSX" or "macOSⓇ" and is the operating system for many AppleⓇ computers. + + +### Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32") + +The native WindowsⓇ platform release distributes the following dependencies in source form: + +- [libxml2](#libxml2) +- [libxslt](#libxslt) +- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo) +- [zlib](#zlib) +- [libiconv](#libiconv) + +This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw32" or "x86-mingw32" for its "platform.cpu" attribute. + + +### JavaⓇ (JRuby) platform release ("java") + +The Java platform release distributes the following dependencies as compiled jar files: + +- [isorelax](#isorelax) +- [jing](#jing) +- [nekodtd](#nekodtd) +- [nekohtml](#nekohtml) +- [xalan](#xalan) +- [xerces](#xerces) +- [xml-apis](#xml-apis) + +This distribution can be identified by inspecting the included Gem::Specification, which will have the value "java" for its "platform.os" attribute. + + +## Appendix: Dependencies' License Texts + +This section contains a subsection for each potentially-distributed dependency, which includes the name of the license and the license text. + +Please see previous sections to understand which of these potential dependencies is actually distributed in the gem file you're downloading and using. + + +### libgumbo and nokogumbo + +Apache 2.0 + +https://github.com/rubys/nokogumbo/blob/f6a7412/LICENSE.txt + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +### libxml2 + +MIT + +http://xmlsoft.org/ + + Except where otherwise noted in the source code (e.g. the files hash.c, + list.c and the trio files, which are covered by a similar licence but + with different Copyright notices) all the files are: + + Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is fur- + nished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + +### libxslt + +MIT + +http://xmlsoft.org/libxslt/ + + Licence for libxslt except libexslt + ---------------------------------------------------------------------- + Copyright (C) 2001-2002 Daniel Veillard. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is fur- + nished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of Daniel Veillard shall not + be used in advertising or otherwise to promote the sale, use or other deal- + ings in this Software without prior written authorization from him. + + ---------------------------------------------------------------------- + + Licence for libexslt + ---------------------------------------------------------------------- + Copyright (C) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard. + All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is fur- + nished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of the authors shall not + be used in advertising or otherwise to promote the sale, use or other deal- + ings in this Software without prior written authorization from him. + ---------------------------------------------------------------------- + + +### zlib + +zlib license + +http://www.zlib.net/zlib_license.html + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + +### libiconv + +LGPL + +https://www.gnu.org/software/libiconv/ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + [This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + Licenses are intended to guarantee your freedom to share and change + free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some + specially designated Free Software Foundation software, and to any + other libraries whose authors decide to use it. You can use it for + your libraries, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if + you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis + or for a fee, you must give the recipients all the rights that we gave + you. You must make sure that they, too, receive or can get the source + code. If you link a program with the library, you must provide + complete object files to the recipients so that they can relink them + with the library, after making changes to the library and recompiling + it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright + the library, and (2) offer you this license which gives you legal + permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain + that everyone understands that there is no warranty for this free + library. If the library is modified by someone else and passed on, we + want its recipients to know that what they have is not the original + version, so that any problems introduced by others will not reflect on + the original authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that companies distributing free + software will individually obtain patent licenses, thus in effect + transforming the program into proprietary software. To prevent this, + we have made it clear that any patent must be licensed for everyone's + free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary + GNU General Public License, which was designed for utility programs. This + license, the GNU Library General Public License, applies to certain + designated libraries. This license is quite different from the ordinary + one; be sure to read it in full, and don't assume that anything in it is + the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that + they blur the distinction we usually make between modifying or adding to a + program and simply using it. Linking a program with a library, without + changing the library, is in some sense simply using the library, and is + analogous to running a utility program or application program. However, in + a textual and legal sense, the linked executable is a combined work, a + derivative of the original library, and the ordinary General Public License + treats it as such. + + Because of this blurred distinction, using the ordinary General + Public License for libraries did not effectively promote software + sharing, because most developers did not use the libraries. We + concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the + users of those programs of all benefit from the free status of the + libraries themselves. This Library General Public License is intended to + permit developers of non-free programs to use free libraries, while + preserving your freedom as a user of such programs to change the free + libraries that are incorporated in them. (We have not seen how to achieve + this as regards changes in header files, but we have achieved it as regards + changes in the actual functions of the Library.) The hope is that this + will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and + modification follow. Pay close attention to the difference between a + "work based on the library" and a "work that uses the library". The + former contains code derived from the library, while the latter only + works together with the library. + + Note that it is possible for a library to be covered by the ordinary + General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which + contains a notice placed by the copyright holder or other authorized + party saying it may be distributed under the terms of this Library + General Public License (also called "this License"). Each licensee is + addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or translated + straightforwardly into another language. (Hereinafter, translation is + included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code means + all the source code for all modules it contains, plus any associated + interface definition files, plus the scripts used to control compilation + and installation of the library. + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running a program using the Library is not restricted, and output from + such a program is covered only if its contents constitute a work based + on the Library (independent of the use of the Library in a tool for + writing it). Whether that is true depends on what the Library does + and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided that + you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and distribute a copy of this License along with the + Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange for a + fee. + + 2. You may modify your copy or copies of the Library or any portion + of it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Library, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote + it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library + with the Library (or with a work based on the Library) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To do + this, you must alter all the notices that refer to this License, so + that they refer to the ordinary GNU General Public License, version 2, + instead of to this License. (If a newer version than version 2 of the + ordinary GNU General Public License has appeared, then you can specify + that version instead if you wish.) Do not make any other change in + these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to all + subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of + the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable form + under the terms of Sections 1 and 2 above provided that you accompany + it with the complete corresponding machine-readable source code, which + must be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the + source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled or + linked with it, is called a "work that uses the Library". Such a + work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because it + contains portions of the Library), rather than a "work that uses the + library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file + that is part of the Library, the object code for the work may be a + derivative work of the Library even though the source code is not. + Whether this is true is especially significant if the work can be + linked without the Library, or if the work is itself a library. The + threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a derivative + work. (Executables containing this object code plus portions of the + Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section 6. + Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or + link a "work that uses the Library" with the Library to produce a + work containing portions of the Library, and distribute that work + under terms of your choice, provided that the terms permit + modification of the work for the customer's own use and reverse + engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered by + this License. You must supply a copy of this License. If the work + during execution displays copyright notices, you must include the + copyright notice for the Library among them, as well as a reference + directing the user to the copy of this License. Also, you must do one + of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special exception, + the source code distributed need not include anything that is normally + distributed (in either source or binary form) with the major + components (compiler, kernel, and so on) of the operating system on + which the executable runs, unless that component itself accompanies + the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you cannot + use both them and the Library together in an executable that you + distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a combined + library, provided that the separate distribution of the work based on + the Library and of the other library facilities is otherwise + permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute + the Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate your + rights under this License. However, parties who have received copies, + or rights, from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Library or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Library (or any work based on the + Library), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the Library + subject to these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Library at all. For example, if a patent + license would not permit royalty-free redistribution of the Library by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Library. + + If any portion of this section is held invalid or unenforceable under any + particular circumstance, the balance of the section is intended to apply, + and the section as a whole is intended to apply in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Library under this License may add + an explicit geographical distribution limitation excluding those countries, + so that distribution is permitted only in or among countries not thus + excluded. In such case, this License incorporates the limitation as if + written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Library General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published by + the Free Software Foundation. If the Library does not specify a + license version number, you may choose any version ever published by + the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free status + of all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR + OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY + AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU + FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF + SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest + possible use to the public, we recommend making it free software that + everyone can redistribute and change. You can do so by permitting + redistribution under these terms (or, alternatively, under the terms of the + ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is + safest to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least the + "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA + + Also add information on how to contact you by electronic and paper mail. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the library, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + + That's all there is to it! + + +### isorelax + +MIT + +http://iso-relax.sourceforge.net/ + + Copyright (c) 2001-2002, SourceForge ISO-RELAX Project (ASAMI + Tomoharu, Daisuke Okajima, Kohsuke Kawaguchi, and MURATA Makoto) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +### jing + +BSD-3-Clause + +http://www.thaiopensource.com/relaxng/jing.html + + Copyright (c) 2001-2003 Thai Open Source Software Center Ltd + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the Thai Open Source Software Center Ltd nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + +### nekodtd + +Apache 1.0-derived + +https://people.apache.org/~andyc/neko/doc/dtd/ + + The CyberNeko Software License, Version 1.0 + + (C) Copyright 2002-2005, Andy Clark. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The end-user documentation included with the redistribution, + if any, must include the following acknowledgment: + "This product includes software developed by Andy Clark." + Alternately, this acknowledgment may appear in the software itself, + if and wherever such third-party acknowledgments normally appear. + + 4. The names "CyberNeko" and "NekoHTML" must not be used to endorse + or promote products derived from this software without prior + written permission. For written permission, please contact + andyc@cyberneko.net. + + 5. Products derived from this software may not be called "CyberNeko", + nor may "CyberNeko" appear in their name, without prior written + permission of the author. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ==================================================================== + + This license is based on the Apache Software License, version 1.1. + +### nekohtml + +Apache 2.0 + +http://nekohtml.sourceforge.net/ + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +### xalan + +Apache 2.0 + +https://xml.apache.org/xalan-j/ + +covers xalan.jar and serializer.jar + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +### xerces + +Apache 2.0 + +https://xerces.apache.org/xerces2-j/ + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +### xml-apis + +Apache 2.0 + +https://xerces.apache.org/xml-commons/ + + Unless otherwise noted all files in XML Commons are covered under the + Apache License Version 2.0. Please read the LICENSE and NOTICE files. + + XML Commons contains some software and documentation that is covered + under a number of different licenses. This applies particularly to the + xml-commons/java/external/ directory. Most files under + xml-commons/java/external/ are covered under their respective + LICENSE.*.txt files; see the matching README.*.txt files for + descriptions. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE.md b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE.md new file mode 100644 index 0000000..6a58f6a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License + +Copyright 2008 -- 2021 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid, Karol Bucek, Sam Ruby, Craig Barnes, Stephen Checkoway, Lars Kanis, Sergio Arbeo, Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/README.md b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/README.md new file mode 100644 index 0000000..170ded3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/README.md @@ -0,0 +1,280 @@ +
+ +# Nokogiri + +Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for [reading](https://nokogiri.org/tutorials/parsing_an_html_xml_document.html), writing, [modifying](https://nokogiri.org/tutorials/modifying_an_html_xml_document.html), and [querying](https://nokogiri.org/tutorials/searching_a_xml_html_document.html) documents. It is fast and standards-compliant by relying on native parsers like libxml2 (CRuby) and xerces (JRuby). + +## Guiding Principles + +Some guiding principles Nokogiri tries to follow: + +- be secure-by-default by treating all documents as **untrusted** by default +- be a **thin-as-reasonable layer** on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers + + +## Features Overview + +- DOM Parser for XML, HTML4, and HTML5 +- SAX Parser for XML and HTML4 +- Push Parser for XML and HTML4 +- Document search via XPath 1.0 +- Document search via CSS3 selectors, with some jquery-like extensions +- XSD Schema validation +- XSLT transformation +- "Builder" DSL for XML and HTML documents + + +## Status + +[![Github Actions CI](https://github.com/sparklemotion/nokogiri/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sparklemotion/nokogiri/actions/workflows/ci.yml) +[![Appveyor CI](https://ci.appveyor.com/api/projects/status/xj2pqwvlxwuwgr06/branch/main?svg=true)](https://ci.appveyor.com/project/flavorjones/nokogiri/branch/main) + +[![Gem Version](https://badge.fury.io/rb/nokogiri.svg)](https://rubygems.org/gems/nokogiri) +[![SemVer compatibility](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&previous-version=1.11.7&new-version=1.12.5)](https://docs.github.com/en/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates#about-compatibility-scores) + +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5344/badge)](https://bestpractices.coreinfrastructure.org/projects/5344) +[![Tidelift dependencies](https://tidelift.com/badges/package/rubygems/nokogiri)](https://tidelift.com/subscription/pkg/rubygems-nokogiri?utm_source=rubygems-nokogiri&utm_medium=referral&utm_campaign=readme) + + +## Support, Getting Help, and Reporting Issues + +All official documentation is posted at https://nokogiri.org (the source for which is at https://github.com/sparklemotion/nokogiri.org/, and we welcome contributions). + +Consider subscribing to [Tidelift][tidelift] which provides license assurances and timely security notifications for your open source dependencies, including Nokogiri. [Tidelift][tidelift] subscriptions also help the Nokogiri maintainers fund our [automated testing](https://ci.nokogiri.org) which in turn allows us to ship releases, bugfixes, and security updates more often. + + [tidelift]: https://tidelift.com/subscription/pkg/rubygems-nokogiri?utm_source=rubygems-nokogiri&utm_medium=referral&utm_campaign=readme + +### Reading + +Your first stops for learning more about Nokogiri should be: + +- [API Documentation](https://nokogiri.org/rdoc/index.html) +- [Tutorials](https://nokogiri.org/tutorials/toc.html) +- An excellent community-maintained [Cheat Sheet](https://github.com/sparklemotion/nokogiri/wiki/Cheat-sheet) + + +### Ask For Help + +There are a few ways to ask exploratory questions: + +- The Ruby Discord chat server is active at https://discord.gg/UyQnKrT +- The Nokogiri mailing list is active at https://groups.google.com/group/nokogiri-talk +- Open an issue using the "Help Request" template at https://github.com/sparklemotion/nokogiri/issues + +Please do not mail the maintainers at their personal addresses. + + +### Report A Bug + +The Nokogiri bug tracker is at https://github.com/sparklemotion/nokogiri/issues + +Please use the "Bug Report" or "Installation Difficulties" templates. + + +### Security and Vulnerability Reporting + +Please report vulnerabilities at https://hackerone.com/nokogiri + +Full information and description of our security policy is in [`SECURITY.md`](SECURITY.md) + + +### Semantic Versioning Policy + +Nokogiri follows [Semantic Versioning](https://semver.org/) (since 2017 or so). [![Dependabot's SemVer compatibility score for Nokogiri](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&previous-version=1.11.7&new-version=1.12.5)](https://docs.github.com/en/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates#about-compatibility-scores) + +We bump `Major.Minor.Patch` versions following this guidance: + +`Major`: (we've never done this) + +- Significant backwards-incompatible changes to the public API that would require rewriting existing application code. +- Some examples of backwards-incompatible changes we might someday consider for a Major release are at [`ROADMAP.md`](ROADMAP.md). + +`Minor`: + +- Features and bugfixes. +- Updating packaged libraries for non-security-related reasons. +- Dropping support for EOLed Ruby versions. [Some folks find this objectionable](https://github.com/sparklemotion/nokogiri/issues/1568), but [SemVer says this is OK if the public API hasn't changed](https://semver.org/#what-should-i-do-if-i-update-my-own-dependencies-without-changing-the-public-api). +- Backwards-incompatible changes to internal or private methods and constants. These are detailed in the "Changes" section of each changelog entry. + +`Patch`: + +- Bugfixes. +- Security updates. +- Updating packaged libraries for security-related reasons. + + +## Installation + +Requirements: + +- Ruby >= 2.6 +- JRuby >= 9.3.0.0 + + +### Native Gems: Faster, more reliable installation + +"Native gems" contain pre-compiled libraries for a specific machine architecture. On supported platforms, this removes the need for compiling the C extension and the packaged libraries, or for system dependencies to exist. This results in **much faster installation** and **more reliable installation**, which as you probably know are the biggest headaches for Nokogiri users. + +### Supported Platforms + +Nokogiri ships pre-compiled, "native" gems for the following platforms: + +- Linux: `x86-linux` and `x86_64-linux` (req: `glibc >= 2.17`), including musl platforms like Alpine +- Darwin/MacOS: `x86_64-darwin` and `arm64-darwin` +- Windows: `x86-mingw32` and `x64-mingw32` +- Java: any platform running JRuby 9.3 or higher + +To determine whether your system supports one of these gems, look at the output of `bundle platform` or `ruby -e 'puts Gem::Platform.local.to_s'`. + +If you're on a supported platform, either `gem install` or `bundle install` should install a native gem without any additional action on your part. This installation should only take a few seconds, and your output should look something like: + +``` sh +$ gem install nokogiri +Fetching nokogiri-1.11.0-x86_64-linux.gem +Successfully installed nokogiri-1.11.0-x86_64-linux +1 gem installed +``` + + +### Other Installation Options + +Because Nokogiri is a C extension, it requires that you have a C compiler toolchain, Ruby development header files, and some system dependencies installed. + +The following may work for you if you have an appropriately-configured system: + +``` bash +gem install nokogiri +``` + +If you have any issues, please visit [Installing Nokogiri](https://nokogiri.org/tutorials/installing_nokogiri.html) for more complete instructions and troubleshooting. + + +## How To Use Nokogiri + +Nokogiri is a large library, and so it's challenging to briefly summarize it. We've tried to provide long, real-world examples at [Tutorials](https://nokogiri.org/tutorials/toc.html). + +### Parsing and Querying + +Here is example usage for parsing and querying a document: + +```ruby +#! /usr/bin/env ruby + +require 'nokogiri' +require 'open-uri' + +# Fetch and parse HTML document +doc = Nokogiri::HTML(URI.open('https://nokogiri.org/tutorials/installing_nokogiri.html')) + +# Search for nodes by css +doc.css('nav ul.menu li a', 'article h2').each do |link| + puts link.content +end + +# Search for nodes by xpath +doc.xpath('//nav//ul//li/a', '//article//h2').each do |link| + puts link.content +end + +# Or mix and match +doc.search('nav ul.menu li a', '//article//h2').each do |link| + puts link.content +end +``` + + +### Encoding + +Strings are always stored as UTF-8 internally. Methods that return +text values will always return UTF-8 encoded strings. Methods that +return a string containing markup (like `to_xml`, `to_html` and +`inner_html`) will return a string encoded like the source document. + +__WARNING__ + +Some documents declare one encoding, but actually use a different +one. In these cases, which encoding should the parser choose? + +Data is just a stream of bytes. Humans add meaning to that stream. Any +particular set of bytes could be valid characters in multiple +encodings, so detecting encoding with 100% accuracy is not +possible. `libxml2` does its best, but it can't be right all the time. + +If you want Nokogiri to handle the document encoding properly, your +best bet is to explicitly set the encoding. Here is an example of +explicitly setting the encoding to EUC-JP on the parser: + +```ruby + doc = Nokogiri.XML('', nil, 'EUC-JP') +``` + + +## Technical Overview + +### Guiding Principles + +As noted above, two guiding principles of the software are: + +- be secure-by-default by treating all documents as **untrusted** by default +- be a **thin-as-reasonable layer** on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers + +Notably, despite all parsers being standards-compliant, there are behavioral inconsistencies between the parsers used in the CRuby and JRuby implementations, and Nokogiri does not and should not attempt to remove these inconsistencies. Instead, we surface these differences in the test suite when they are important/semantic; or we intentionally write tests to depend only on the important/semantic bits (omitting whitespace from regex matchers on results, for example). + + +### CRuby + +The Ruby (a.k.a., CRuby, MRI, YARV) implementation is a C extension that depends on libxml2 and libxslt (which in turn depend on zlib and possibly libiconv). + +These dependencies are met by default by Nokogiri's packaged versions of the libxml2 and libxslt source code, but a configuration option `--use-system-libraries` is provided to allow specification of alternative library locations. See [Installing Nokogiri](https://nokogiri.org/tutorials/installing_nokogiri.html) for full documentation. + +We provide native gems by pre-compiling libxml2 and libxslt (and potentially zlib and libiconv) and packaging them into the gem file. In this case, no compilation is necessary at installation time, which leads to faster and more reliable installation. + +See [`LICENSE-DEPENDENCIES.md`](LICENSE-DEPENDENCIES.md) for more information on which dependencies are provided in which native and source gems. + + +### JRuby + +The Java (a.k.a. JRuby) implementation is a Java extension that depends primarily on Xerces and NekoHTML for parsing, though additional dependencies are on `isorelax`, `nekodtd`, `jing`, `serializer`, `xalan-j`, and `xml-apis`. + +These dependencies are provided by pre-compiled jar files packaged in the `java` platform gem. + +See [`LICENSE-DEPENDENCIES.md`](LICENSE-DEPENDENCIES.md) for more information on which dependencies are provided in which native and source gems. + + +## Contributing + +See [`CONTRIBUTING.md`](CONTRIBUTING.md) for an intro guide to developing Nokogiri. + + +## Code of Conduct + +We've adopted the Contributor Covenant code of conduct, which you can read in full in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md). + + +## License + +This project is licensed under the terms of the MIT license. + +See this license at [`LICENSE.md`](LICENSE.md). + + +### Dependencies + +Some additional libraries may be distributed with your version of Nokogiri. Please see [`LICENSE-DEPENDENCIES.md`](LICENSE-DEPENDENCIES.md) for a discussion of the variations as well as the licenses thereof. + + +## Authors + +- Mike Dalessio +- Aaron Patterson +- Yoko Harada +- Akinori MUSHA +- John Shahid +- Karol Bucek +- Sam Ruby +- Craig Barnes +- Stephen Checkoway +- Lars Kanis +- Sergio Arbeo +- Timothy Elliott +- Nobuyoshi Nakada diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/bin/nokogiri b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/bin/nokogiri new file mode 100755 index 0000000..04a5cea --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/bin/nokogiri @@ -0,0 +1,131 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "optparse" +require "open-uri" +require "uri" +require "rubygems" +require "nokogiri" +autoload :IRB, "irb" + +parse_class = Nokogiri +encoding = nil + +# This module provides some tunables with the nokogiri CLI for use in +# your ~/.nokogirirc. +module Nokogiri + module CLI + class << self + # Specify the console engine, defaulted to IRB. + # + # call-seq: + # require 'pry' + # Nokogiri::CLI.console = Pry + attr_writer :console + + def console + case @console + when Symbol + Kernel.const_get(@console) + else + @console + end + end + + attr_accessor :rcfile + end + + self.rcfile = File.expand_path("~/.nokogirirc") + self.console = :IRB + end +end + +def safe_read(uri_or_path) + uri = URI.parse(uri_or_path) + case uri + when URI::HTTP + uri.read + when URI::File + File.read(uri.path) + else + File.read(uri_or_path) + end +end + +opts = OptionParser.new do |opts| + opts.banner = "Nokogiri: an HTML, XML, SAX, and Reader parser" + opts.define_head("Usage: nokogiri [options]") + opts.separator("") + opts.separator("Examples:") + opts.separator(" nokogiri https://www.ruby-lang.org/") + opts.separator(" nokogiri ./public/index.html") + opts.separator(" curl -s http://www.nokogiri.org | nokogiri -e'p $_.css(\"h1\").length'") + opts.separator("") + opts.separator("Options:") + + opts.on("--type type", "Parse as type: xml or html (default: auto)", [:xml, :html]) do |v| + parse_class = { xml: Nokogiri::XML, html: Nokogiri::HTML }[v] + end + + opts.on("-C file", "Specifies initialization file to load (default #{Nokogiri::CLI.rcfile})") do |v| + Nokogiri::CLI.rcfile = v + end + + opts.on("-E", "--encoding encoding", "Read as encoding (default: #{encoding || "none"})") do |v| + encoding = v + end + + opts.on("-e command", "Specifies script from command-line.") do |v| + @script = v + end + + opts.on("--rng ", "Validate using this rng file.") do |v| + @rng = Nokogiri::XML::RelaxNG(safe_read(v)) + end + + opts.on_tail("-?", "--help", "Show this message") do + puts opts + exit + end + + opts.on_tail("-v", "--version", "Show version") do + puts Nokogiri::VersionInfo.instance.to_markdown + exit + end +end +opts.parse! + +url = ARGV.shift + +if url.to_s.strip.empty? && $stdin.tty? + puts opts + exit 1 +end + +if File.file?(Nokogiri::CLI.rcfile) + load Nokogiri::CLI.rcfile +end + +@doc = if url || $stdin.tty? + parse_class.parse(safe_read(url), url, encoding) +else + parse_class.parse($stdin, nil, encoding) +end + +$_ = @doc + +if @rng + @rng.validate(@doc).each do |error| + puts error.message + end +elsif @script + begin + eval(@script, binding, "
") # rubocop:disable Security/Eval + rescue Exception => e # rubocop:disable Lint/RescueException + warn("ERROR: Exception raised while evaluating '#{@script}'") + raise e + end +else + puts "Your document is stored in @doc..." + Nokogiri::CLI.console.start +end diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/dependencies.yml b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/dependencies.yml new file mode 100644 index 0000000..7e7813a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/dependencies.yml @@ -0,0 +1,73 @@ +libxml2: + version: "2.9.12" + sha256: "c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92" + # manually verified checksum: + # + # $ gpg --verify libxml2-2.9.12.tar.gz.asc ports/archives/libxml2-2.9.12.tar.gz + # gpg: Signature made Thu 13 May 2021 02:59:16 PM EDT + # gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D + # gpg: Good signature from "Daniel Veillard (Red Hat work email) " [unknown] + # gpg: aka "Daniel Veillard " [unknown] + # gpg: WARNING: This key is not certified with a trusted signature! + # gpg: There is no indication that the signature belongs to the owner. + # Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F + # Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D + # + # using this pgp signature: + # + # -----BEGIN PGP SIGNATURE----- + # + # iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAmCddwQACgkQFViLJllr + # 6l11LQgAioRTdfmcC+uK/7+6HPtF/3c5zkX6j8VGYuvFBwZ0jayqMRBAl++fcpjE + # JUU/JKebSZ/KCYjzyeOWK/i3Gq77iqm3UbZFB85rqu4a5P3gmj/4STWVyAx0KU3z + # G3jKqDhJOt7c0acXb5lh2DngfDa1dn/VGcQcIXsqplNxNr4ET7MnSJjZ3nlxYfW2 + # E5vWBdPCMUeXDBl6MjYvw9XnGGBLUAaEJWoFToG6jKmVf4GAd9nza20jj5dtbcJq + # QEOaSDKDr+f9h2NS8haOhJ9vOpy52PdeGzaFlbRkXarGXuAr8kITgATVs8FAqcgv + # MoVhmrO5r2hJf0dCM9fZoYqzpMfmNA== + # =KfJ9 + # -----END PGP SIGNATURE----- + # + +libxslt: + version: "1.1.34" + sha256: "98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f" + # manually verified checksum: + # + # $ gpg --verify ~/Downloads/libxslt-1.1.34.tar.gz.asc ports/archives/libxslt-1.1.34.tar.gz + # gpg: Signature made Wed 30 Oct 2019 04:02:48 PM EDT + # gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D + # gpg: Good signature from "Daniel Veillard (Red Hat work email) " [unknown] + # gpg: aka "Daniel Veillard " [unknown] + # gpg: WARNING: This key is not certified with a trusted signature! + # gpg: There is no indication that the signature belongs to the owner. + # Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F + # Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D + # + # using this pgp signature: + # + # -----BEGIN PGP SIGNATURE----- + # + # iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAl257GgACgkQFViLJllr + # 6l2vVggAjJEHmASiS56SxhPOsGqbfBihM66gQFoIymQfMu2430N1GSTkLsfbkJO8 + # 8yBX11NjzK/m9uxwshMW3rVCU7EpL3PUimN3reXdPiQj9hAOAWF1V3BZNevbQC2E + # FCIraioukaidf8sjUG4/sGpK/gOcP/3hYoN0HUoBigCNJjDqhijxM3M3GJJtCASp + # jL4CQbs2OmxW8ixOZbuWEESvFFHUgYRsdZjRVN+GRfSOvJjxypurmYwQ3RjO7JxL + # 2FY8qKQ+xpeID8NV8F5OUEvWBjk1QS133VTqBZNlONdnEtV/og6jNu5k0O/Kvhup + # caR+8TMErOcLr9OgDklO6DoYyAsf9Q== + # =g4i4 + # -----END PGP SIGNATURE----- + # + +zlib: + version: "1.2.11" + sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" + # SHA-256 hash provided on http://zlib.net/ + +libiconv: + version: "1.16" + sha256: "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04" + # gpg: Signature made Fri 26 Apr 2019 03:36:38 PM EDT + # gpg: using RSA key 4F494A942E4616C2 + # gpg: Good signature from "Bruno Haible (Open Source Development) " [expired] + # gpg: Note: This key has expired! + # Primary key fingerprint: 68D9 4D8A AEEA D48A E7DC 5B90 4F49 4A94 2E46 16C2 diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/depend b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/depend new file mode 100644 index 0000000..24f5908 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/depend @@ -0,0 +1,38 @@ +# -*-makefile-*- +# DO NOT DELETE + +gumbo.o: $(srcdir)/nokogiri.h +html_document.o: $(srcdir)/nokogiri.h +html_element_description.o: $(srcdir)/nokogiri.h +html_entity_lookup.o: $(srcdir)/nokogiri.h +html_sax_parser_context.o: $(srcdir)/nokogiri.h +html_sax_push_parser.o: $(srcdir)/nokogiri.h +libxml2_backwards_compat.o: $(srcdir)/nokogiri.h +nokogiri.o: $(srcdir)/nokogiri.h +test_global_handlers.o: $(srcdir)/nokogiri.h +xml_attr.o: $(srcdir)/nokogiri.h +xml_attribute_decl.o: $(srcdir)/nokogiri.h +xml_cdata.o: $(srcdir)/nokogiri.h +xml_comment.o: $(srcdir)/nokogiri.h +xml_document.o: $(srcdir)/nokogiri.h +xml_document_fragment.o: $(srcdir)/nokogiri.h +xml_dtd.o: $(srcdir)/nokogiri.h +xml_element_content.o: $(srcdir)/nokogiri.h +xml_element_decl.o: $(srcdir)/nokogiri.h +xml_encoding_handler.o: $(srcdir)/nokogiri.h +xml_entity_decl.o: $(srcdir)/nokogiri.h +xml_entity_reference.o: $(srcdir)/nokogiri.h +xml_namespace.o: $(srcdir)/nokogiri.h +xml_node.o: $(srcdir)/nokogiri.h +xml_node_set.o: $(srcdir)/nokogiri.h +xml_processing_instruction.o: $(srcdir)/nokogiri.h +xml_reader.o: $(srcdir)/nokogiri.h +xml_relax_ng.o: $(srcdir)/nokogiri.h +xml_sax_parser.o: $(srcdir)/nokogiri.h +xml_sax_parser_context.o: $(srcdir)/nokogiri.h +xml_sax_push_parser.o: $(srcdir)/nokogiri.h +xml_schema.o: $(srcdir)/nokogiri.h +xml_syntax_error.o: $(srcdir)/nokogiri.h +xml_text.o: $(srcdir)/nokogiri.h +xml_xpath_context.o: $(srcdir)/nokogiri.h +xslt_stylesheet.o: $(srcdir)/nokogiri.h diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/extconf.rb b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/extconf.rb new file mode 100644 index 0000000..de0eb54 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/extconf.rb @@ -0,0 +1,1000 @@ +# frozen_string_literal: true + +# rubocop:disable Style/GlobalVars + +ENV["RC_ARCHS"] = "" if RUBY_PLATFORM.include?("darwin") + +require "mkmf" +require "rbconfig" +require "fileutils" +require "shellwords" +require "pathname" + +# helpful constants +PACKAGE_ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", "..")) +REQUIRED_LIBXML_VERSION = "2.6.21" +RECOMMENDED_LIBXML_VERSION = "2.9.3" + +REQUIRED_MINI_PORTILE_VERSION = "~> 2.7.0" # keep this version in sync with the one in the gemspec +REQUIRED_PKG_CONFIG_VERSION = "~> 1.1" + +# Keep track of what versions of what libraries we build against +OTHER_LIBRARY_VERSIONS = {} + +NOKOGIRI_HELP_MESSAGE = <<~HELP + USAGE: ruby #{$PROGRAM_NAME} [options] + + Flags that are always valid: + + --use-system-libraries + --enable-system-libraries + Use system libraries instead of building and using the packaged libraries. + + --disable-system-libraries + Use the packaged libraries, and ignore the system libraries. This is the default on most + platforms, and overrides `--use-system-libraries` and the environment variable + `NOKOGIRI_USE_SYSTEM_LIBRARIES`. + + --disable-clean + Do not clean out intermediate files after successful build. + + --prevent-strip + Take steps to prevent stripping the symbol table and debugging info from the shared + library, potentially overriding RbConfig's CFLAGS/LDFLAGS/DLDFLAGS. + + + Flags only used when using system libraries: + + General: + + --with-opt-dir=DIRECTORY + Look for headers and libraries in DIRECTORY. + + --with-opt-lib=DIRECTORY + Look for libraries in DIRECTORY. + + --with-opt-include=DIRECTORY + Look for headers in DIRECTORY. + + + Related to zlib: + + --with-zlib-dir=DIRECTORY + Look for zlib headers and library in DIRECTORY. + + --with-zlib-lib=DIRECTORY + Look for zlib library in DIRECTORY. + + --with-zlib-include=DIRECTORY + Look for zlib headers in DIRECTORY. + + + Related to iconv: + + --with-iconv-dir=DIRECTORY + Look for iconv headers and library in DIRECTORY. + + --with-iconv-lib=DIRECTORY + Look for iconv library in DIRECTORY. + + --with-iconv-include=DIRECTORY + Look for iconv headers in DIRECTORY. + + + Related to libxml2: + + --with-xml2-dir=DIRECTORY + Look for xml2 headers and library in DIRECTORY. + + --with-xml2-lib=DIRECTORY + Look for xml2 library in DIRECTORY. + + --with-xml2-include=DIRECTORY + Look for xml2 headers in DIRECTORY. + + --with-xml2-source-dir=DIRECTORY + (dev only) Build libxml2 from the source code in DIRECTORY + + + Related to libxslt: + + --with-xslt-dir=DIRECTORY + Look for xslt headers and library in DIRECTORY. + + --with-xslt-lib=DIRECTORY + Look for xslt library in DIRECTORY. + + --with-xslt-include=DIRECTORY + Look for xslt headers in DIRECTORY. + + --with-xslt-source-dir=DIRECTORY + (dev only) Build libxslt from the source code in DIRECTORY + + + Related to libexslt: + + --with-exslt-dir=DIRECTORY + Look for exslt headers and library in DIRECTORY. + + --with-exslt-lib=DIRECTORY + Look for exslt library in DIRECTORY. + + --with-exslt-include=DIRECTORY + Look for exslt headers in DIRECTORY. + + + Flags only used when building and using the packaged libraries: + + --disable-static + Do not statically link packaged libraries, instead use shared libraries. + + --enable-cross-build + Enable cross-build mode. (You probably do not want to set this manually.) + + + Environment variables used: + + NOKOGIRI_USE_SYSTEM_LIBRARIES + Equivalent to `--enable-system-libraries` when set, even if nil or blank. + + CC + Use this path to invoke the compiler instead of `RbConfig::CONFIG['CC']` + + CPPFLAGS + If this string is accepted by the C preprocessor, add it to the flags passed to the C preprocessor + + CFLAGS + If this string is accepted by the compiler, add it to the flags passed to the compiler + + LDFLAGS + If this string is accepted by the linker, add it to the flags passed to the linker + + LIBS + Add this string to the flags passed to the linker +HELP + +# +# utility functions +# +def config_clean? + enable_config("clean", true) +end + +def config_static? + default_static = !truffle? + enable_config("static", default_static) +end + +def config_cross_build? + enable_config("cross-build") +end + +def config_system_libraries? + enable_config("system-libraries", ENV.key?("NOKOGIRI_USE_SYSTEM_LIBRARIES")) do |_, default| + arg_config("--use-system-libraries", default) + end +end + +def windows? + RbConfig::CONFIG["target_os"].match?(/mingw|mswin/) +end + +def solaris? + RbConfig::CONFIG["target_os"].include?("solaris") +end + +def darwin? + RbConfig::CONFIG["target_os"].include?("darwin") +end + +def openbsd? + RbConfig::CONFIG["target_os"].include?("openbsd") +end + +def aix? + RbConfig::CONFIG["target_os"].include?("aix") +end + +def nix? + !(windows? || solaris? || darwin?) +end + +def truffle? + ::RUBY_ENGINE == "truffleruby" +end + +def concat_flags(*args) + args.compact.join(" ") +end + +def local_have_library(lib, func = nil, headers = nil) + have_library(lib, func, headers) || have_library("lib#{lib}", func, headers) +end + +LOCAL_PACKAGE_RESPONSE = Object.new +def LOCAL_PACKAGE_RESPONSE.%(package) + package ? "yes: #{package}" : "no" +end + +# wrapper around MakeMakefil#pkg_config and the PKGConfig gem +def try_package_configuration(pc) + unless ENV.key?("NOKOGIRI_TEST_PKG_CONFIG_GEM") + # try MakeMakefile#pkg_config, which uses the system utility `pkg-config`. + return if checking_for("#{pc} using `pkg_config`", LOCAL_PACKAGE_RESPONSE) do + pkg_config(pc) + end + end + + # `pkg-config` probably isn't installed, which appears to be the case for lots of freebsd systems. + # let's fall back to the pkg-config gem, which knows how to parse .pc files, and wrap it with the + # same logic as MakeMakefile#pkg_config + begin + require "rubygems" + gem("pkg-config", REQUIRED_PKG_CONFIG_VERSION) + require "pkg-config" + + checking_for("#{pc} using pkg-config gem version #{PKGConfig::VERSION}", LOCAL_PACKAGE_RESPONSE) do + if PKGConfig.have_package(pc) + cflags = PKGConfig.cflags(pc) + ldflags = PKGConfig.libs_only_L(pc) + libs = PKGConfig.libs_only_l(pc) + + Logging.message("pkg-config gem found package configuration for %s\n", pc) + Logging.message("cflags: %s\nldflags: %s\nlibs: %s\n\n", cflags, ldflags, libs) + + [cflags, ldflags, libs] + end + end + rescue LoadError + message("Please install either the `pkg-config` utility or the `pkg-config` rubygem.\n") + end +end + +# set up mkmf to link against the library if we can find it +def have_package_configuration(opt: nil, pc: nil, lib:, func:, headers:) + if opt + dir_config(opt) + dir_config("opt") + end + + # see if we have enough path info to do this without trying any harder + unless ENV.key?("NOKOGIRI_TEST_PKG_CONFIG") + return true if local_have_library(lib, func, headers) + end + + try_package_configuration(pc) if pc + + # verify that we can compile and link against the library + local_have_library(lib, func, headers) +end + +def ensure_package_configuration(opt: nil, pc: nil, lib:, func:, headers:) + have_package_configuration(opt: opt, pc: pc, lib: lib, func: func, headers: headers) || + abort_could_not_find_library(lib) +end + +def ensure_func(func, headers = nil) + have_func(func, headers) || abort_could_not_find_library(func) +end + +def preserving_globals + values = [$arg_config, $INCFLAGS, $CFLAGS, $CPPFLAGS, $LDFLAGS, $DLDFLAGS, $LIBPATH, $libs].map(&:dup) + yield +ensure + $arg_config, $INCFLAGS, $CFLAGS, $CPPFLAGS, $LDFLAGS, $DLDFLAGS, $LIBPATH, $libs = values +end + +def abort_could_not_find_library(lib) + callers = caller(1..2).join("\n") + abort("-----\n#{callers}\n#{lib} is missing. Please locate mkmf.log to investigate how it is failing.\n-----") +end + +def chdir_for_build(&block) + # When using rake-compiler-dock on Windows, the underlying Virtualbox shared + # folders don't support symlinks, but libiconv expects it for a build on + # Linux. We work around this limitation by using the temp dir for cooking. + build_dir = /mingw|mswin|cygwin/.match?(ENV["RCD_HOST_RUBY_PLATFORM"].to_s) ? "/tmp" : "." + Dir.chdir(build_dir, &block) +end + +def sh_export_path(path) + # because libxslt 1.1.29 configure.in uses AC_PATH_TOOL which treats ":" + # as a $PATH separator, we need to convert windows paths from + # + # C:/path/to/foo + # + # to + # + # /C/path/to/foo + # + # which is sh-compatible, in order to find things properly during + # configuration + return path unless windows? + + match = Regexp.new("^([A-Z]):(/.*)").match(path) + if match && match.length == 3 + return File.join("/", match[1], match[2]) + end + + path +end + +def libflag_to_filename(ldflag) + case ldflag + when /\A-l(.+)/ + "lib#{Regexp.last_match(1)}.#{$LIBEXT}" + end +end + +def have_libxml_headers?(version = nil) + source = if version.nil? + <<~SRC + #include + SRC + else + version_int = format("%d%2.2d%2.2d", *version.split(".")) + <<~SRC + #include + #if LIBXML_VERSION < #{version_int} + # error libxml2 is older than #{version} + #endif + SRC + end + + try_cpp(source) +end + +def try_link_iconv(using = nil) + checking_for(using ? "iconv using #{using}" : "iconv") do + ["", "-liconv"].any? do |opt| + preserving_globals do + yield if block_given? + + try_link(<<~'SRC', opt) + #include + #include + int main(void) + { + iconv_t cd = iconv_open("", ""); + iconv(cd, NULL, NULL, NULL, NULL); + return EXIT_SUCCESS; + } + SRC + end + end + end +end + +def iconv_configure_flags + # give --with-iconv-dir and --with-opt-dir first priority + ["iconv", "opt"].each do |target| + config = preserving_globals { dir_config(target) } + next unless config.any? && try_link_iconv("--with-#{target}-* flags") { dir_config(target) } + idirs, ldirs = config.map do |dirs| + Array(dirs).flat_map do |dir| + dir.split(File::PATH_SEPARATOR) + end if dirs + end + + return [ + "--with-iconv=yes", + *("CPPFLAGS=#{idirs.map { |dir| "-I" + dir }.join(" ")}" if idirs), + *("LDFLAGS=#{ldirs.map { |dir| "-L" + dir }.join(" ")}" if ldirs), + ] + end + + if try_link_iconv + return ["--with-iconv=yes"] + end + + config = preserving_globals { have_package_configuration("libiconv") } + if config && try_link_iconv("pkg-config libiconv") { have_package_configuration("libiconv") } + cflags, ldflags, libs = config + + return [ + "--with-iconv=yes", + "CPPFLAGS=#{cflags}", + "LDFLAGS=#{ldflags}", + "LIBS=#{libs}", + ] + end + + abort_could_not_find_library("libiconv") +end + +def process_recipe(name, version, static_p, cross_p, cacheable_p = true) + require "rubygems" + gem("mini_portile2", REQUIRED_MINI_PORTILE_VERSION) # gemspec is not respected at install time + require "mini_portile2" + message("Using mini_portile version #{MiniPortile::VERSION}\n") + + unless ["libxml2", "libxslt"].include?(name) + OTHER_LIBRARY_VERSIONS[name] = version + end + + MiniPortile.new(name, version).tap do |recipe| + def recipe.port_path + "#{@target}/#{RUBY_PLATFORM}/#{@name}/#{@version}" + end + + recipe.target = File.join(PACKAGE_ROOT_DIR, "ports") if cacheable_p + # Prefer host_alias over host in order to use the correct compiler prefix for cross build, but + # use host if not set. + recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] + recipe.configure_options << "--libdir=#{File.join(recipe.path, "lib")}" + + yield recipe + + env = Hash.new do |hash, key| + hash[key] = (ENV[key]).to_s + end + + recipe.configure_options.flatten! + + recipe.configure_options.delete_if do |option| + case option + when /\A(\w+)=(.*)\z/ + env[Regexp.last_match(1)] = if env.key?(Regexp.last_match(1)) + concat_flags(env[Regexp.last_match(1)], Regexp.last_match(2)) + else + Regexp.last_match(2) + end + true + else + false + end + end + + if static_p + recipe.configure_options += [ + "--disable-shared", + "--enable-static", + ] + env["CFLAGS"] = concat_flags(env["CFLAGS"], "-fPIC") + else + recipe.configure_options += [ + "--enable-shared", + "--disable-static", + ] + end + + if cross_p + recipe.configure_options += [ + "--target=#{recipe.host}", + "--host=#{recipe.host}", + ] + end + + if RbConfig::CONFIG["target_cpu"] == "universal" + ["CFLAGS", "LDFLAGS"].each do |key| + unless env[key].include?("-arch") + env[key] = concat_flags(env[key], RbConfig::CONFIG["ARCH_FLAG"]) + end + end + end + + recipe.configure_options += env.map do |key, value| + "#{key}=#{value.strip}" + end + + checkpoint = "#{recipe.target}/#{recipe.name}-#{recipe.version}-#{RUBY_PLATFORM}.installed" + if File.exist?(checkpoint) && !recipe.source_directory + message("Building Nokogiri with a packaged version of #{name}-#{version}.\n") + else + message(<<~EOM) + ---------- IMPORTANT NOTICE ---------- + Building Nokogiri with a packaged version of #{name}-#{version}. + Configuration options: #{recipe.configure_options.shelljoin} + EOM + + unless recipe.patch_files.empty? + message("The following patches are being applied:\n") + + recipe.patch_files.each do |patch| + message(format(" - %s\n", File.basename(patch))) + end + end + + message(<<~EOM) if name != "libgumbo" + + The Nokogiri maintainers intend to provide timely security updates, but if + this is a concern for you and want to use your OS/distro system library + instead, then abort this installation process and install nokogiri as + instructed at: + + https://nokogiri.org/tutorials/installing_nokogiri.html#installing-using-standard-system-libraries + + EOM + + message(<<~EOM) if name == "libxml2" + Note, however, that nokogiri cannot guarantee compatibility with every + version of libxml2 that may be provided by OS/package vendors. + + EOM + + chdir_for_build { recipe.cook } + FileUtils.touch(checkpoint) + end + recipe.activate + end +end + +def copy_packaged_libraries_headers(to_path:, from_recipes:) + FileUtils.rm_rf(to_path, secure: true) + FileUtils.mkdir(to_path) + from_recipes.each do |recipe| + FileUtils.cp_r(Dir[File.join(recipe.path, "include/*")], to_path) + end +end + +def do_help + print(NOKOGIRI_HELP_MESSAGE) + exit!(0) +end + +def do_clean + root = Pathname(PACKAGE_ROOT_DIR) + pwd = Pathname(Dir.pwd) + + # Skip if this is a development work tree + unless (root + ".git").exist? + message("Cleaning files only used during build.\n") + + # (root + 'tmp') cannot be removed at this stage because + # nokogiri.so is yet to be copied to lib. + + # clean the ports build directory + Pathname.glob(pwd.join("tmp", "*", "ports")) do |dir| + FileUtils.rm_rf(dir, verbose: true) + end + + if config_static? + # ports installation can be safely removed if statically linked. + FileUtils.rm_rf(root + "ports", verbose: true) + else + FileUtils.rm_rf(root + "ports" + "archives", verbose: true) + end + end + + exit!(0) +end + +# +# main +# +do_help if arg_config("--help") +do_clean if arg_config("--clean") + +if openbsd? && !config_system_libraries? + if %x(#{ENV["CC"] || "/usr/bin/cc"} -v 2>&1) !~ /clang/ + (ENV["CC"] ||= find_executable("egcc")) || + abort("Please install gcc 4.9+ from ports using `pkg_add -v gcc`") + end + append_cppflags "-I/usr/local/include" +end + +if ENV["CC"] + RbConfig::CONFIG["CC"] = RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"] +end + +# use same c compiler for libxml and libxslt +ENV["CC"] = RbConfig::CONFIG["CC"] + +if arg_config("--prevent-strip") + old_cflags = $CFLAGS.split.join(" ") + old_ldflags = $LDFLAGS.split.join(" ") + old_dldflags = $DLDFLAGS.split.join(" ") + $CFLAGS = $CFLAGS.split.reject { |flag| flag == "-s" }.join(" ") + $LDFLAGS = $LDFLAGS.split.reject { |flag| flag == "-s" }.join(" ") + $DLDFLAGS = $DLDFLAGS.split.reject { |flag| flag == "-s" }.join(" ") + puts "Prevent stripping by removing '-s' from $CFLAGS" if old_cflags != $CFLAGS + puts "Prevent stripping by removing '-s' from $LDFLAGS" if old_ldflags != $LDFLAGS + puts "Prevent stripping by removing '-s' from $DLDFLAGS" if old_dldflags != $DLDFLAGS +end + +# adopt environment config +append_cflags(ENV["CFLAGS"].split) unless ENV["CFLAGS"].nil? +append_cppflags(ENV["CPPFLAGS"].split) unless ENV["CPPFLAGS"].nil? +append_ldflags(ENV["LDFLAGS"].split) unless ENV["LDFLAGS"].nil? +$LIBS = concat_flags($LIBS, ENV["LIBS"]) + +# nokogumbo code uses C90/C99 features, let's make sure older compilers won't give +# errors/warnings. see #2302 +append_cflags(["-std=c99", "-Wno-declaration-after-statement"]) + +# always include debugging information +append_cflags("-g") + +# we use at least one inline function in the C extension +append_cflags("-Winline") + +# good to have no matter what Ruby was compiled with +append_cflags("-Wmissing-noreturn") + +# handle clang variations, see #1101 +append_cflags("-Wno-error=unused-command-line-argument-hard-error-in-future") if darwin? + +# these tend to be noisy, but on occasion useful during development +# append_cflags(["-Wcast-qual", "-Wwrite-strings"]) + +# Add SDK-specific include path for macOS and brew versions before v2.2.12 (2020-04-08) [#1851, #1801] +macos_mojave_sdk_include_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2" +if config_system_libraries? && darwin? && Dir.exist?(macos_mojave_sdk_include_path) + append_cppflags("-I#{macos_mojave_sdk_include_path}") +end + +# Work around a character escaping bug in MSYS by passing an arbitrary double-quoted parameter to gcc. +# See https://sourceforge.net/p/mingw/bugs/2142 +append_cppflags(' "-Idummypath"') if windows? + +if config_system_libraries? + message "Building nokogiri using system libraries.\n" + ensure_package_configuration(opt: "zlib", pc: "zlib", lib: "z", + headers: "zlib.h", func: "gzdopen") + ensure_package_configuration(opt: "xml2", pc: "libxml-2.0", lib: "xml2", + headers: "libxml/parser.h", func: "xmlParseDoc") + ensure_package_configuration(opt: "xslt", pc: "libxslt", lib: "xslt", + headers: "libxslt/xslt.h", func: "xsltParseStylesheetDoc") + ensure_package_configuration(opt: "exslt", pc: "libexslt", lib: "exslt", + headers: "libexslt/exslt.h", func: "exsltFuncRegister") + + have_libxml_headers?(REQUIRED_LIBXML_VERSION) || + abort("ERROR: libxml2 version #{REQUIRED_LIBXML_VERSION} or later is required!") + have_libxml_headers?(RECOMMENDED_LIBXML_VERSION) || + warn("WARNING: libxml2 version #{RECOMMENDED_LIBXML_VERSION} or later is highly recommended, but proceeding anyway.") + +else + message "Building nokogiri using packaged libraries.\n" + + static_p = config_static? + message "Static linking is #{static_p ? "enabled" : "disabled"}.\n" + + cross_build_p = config_cross_build? + message "Cross build is #{cross_build_p ? "enabled" : "disabled"}.\n" + + require "yaml" + dependencies = YAML.load_file(File.join(PACKAGE_ROOT_DIR, "dependencies.yml")) + + dir_config("zlib") + + if cross_build_p || windows? + zlib_recipe = process_recipe("zlib", dependencies["zlib"]["version"], static_p, cross_build_p) do |recipe| + recipe.files = [{ + url: "https://zlib.net/fossils/#{recipe.name}-#{recipe.version}.tar.gz", + sha256: dependencies["zlib"]["sha256"], + }] + if windows? + class << recipe + attr_accessor :cross_build_p + + def configure + Dir.chdir(work_path) do + mk = File.read("win32/Makefile.gcc") + File.open("win32/Makefile.gcc", "wb") do |f| + f.puts "BINARY_PATH = #{path}/bin" + f.puts "LIBRARY_PATH = #{path}/lib" + f.puts "INCLUDE_PATH = #{path}/include" + mk.sub!(/^PREFIX\s*=\s*$/, "PREFIX = #{host}-") if cross_build_p + f.puts mk + end + end + end + + def configured? + Dir.chdir(work_path) do + !!(File.read("win32/Makefile.gcc") =~ /^BINARY_PATH/) + end + end + + def compile + execute("compile", "make -f win32/Makefile.gcc") + end + + def install + execute("install", "make -f win32/Makefile.gcc install") + end + end + recipe.cross_build_p = cross_build_p + else + class << recipe + def configure + cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g") + execute("configure", + ["env", "CHOST=#{host}", "CFLAGS=#{cflags}", "./configure", "--static", configure_prefix]) + end + + def compile + if /darwin/.match?(host) + execute("compile", "make AR=#{host}-libtool") + else + super + end + end + end + end + end + + unless nix? + libiconv_recipe = process_recipe("libiconv", dependencies["libiconv"]["version"], static_p, + cross_build_p) do |recipe| + recipe.files = [{ + url: "https://ftp.gnu.org/pub/gnu/libiconv/#{recipe.name}-#{recipe.version}.tar.gz", + sha256: dependencies["libiconv"]["sha256"], + }] + + # The libiconv configure script doesn't accept "arm64" host string but "aarch64" + recipe.host = recipe.host.gsub("arm64-apple-darwin", "aarch64-apple-darwin") + + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + + recipe.configure_options += [ + "--disable-dependency-tracking", + "CPPFLAGS=-Wall", + "CFLAGS=#{cflags}", + "CXXFLAGS=#{cflags}", + "LDFLAGS=", + ] + end + end + elsif darwin? && !have_header("iconv.h") + abort(<<~EOM.chomp) + ----- + The file "iconv.h" is missing in your build environment, + which means you haven't installed Xcode Command Line Tools properly. + + To install Command Line Tools, try running `xcode-select --install` on + terminal and follow the instructions. If it fails, open Xcode.app, + select from the menu "Xcode" - "Open Developer Tool" - "More Developer + Tools" to open the developer site, download the installer for your OS + version and run it. + ----- + EOM + end + + if zlib_recipe + append_cppflags("-I#{zlib_recipe.path}/include") + $LIBPATH = ["#{zlib_recipe.path}/lib"] | $LIBPATH + ensure_package_configuration(opt: "zlib", pc: "zlib", lib: "z", + headers: "zlib.h", func: "gzdopen") + end + + if libiconv_recipe + append_cppflags("-I#{libiconv_recipe.path}/include") + $LIBPATH = ["#{libiconv_recipe.path}/lib"] | $LIBPATH + ensure_package_configuration(opt: "iconv", pc: "iconv", lib: "iconv", + headers: "iconv.h", func: "iconv_open") + end + + libxml2_recipe = process_recipe("libxml2", dependencies["libxml2"]["version"], static_p, cross_build_p) do |recipe| + source_dir = arg_config("--with-xml2-source-dir") + if source_dir + recipe.source_directory = source_dir + else + recipe.files = [{ + url: "http://xmlsoft.org/sources/#{recipe.name}-#{recipe.version}.tar.gz", + sha256: dependencies["libxml2"]["sha256"], + }] + recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxml2", "*.patch")].sort + end + + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + + if zlib_recipe + recipe.configure_options << "--with-zlib=#{zlib_recipe.path}" + end + + if libiconv_recipe + recipe.configure_options << "--with-iconv=#{libiconv_recipe.path}" + else + recipe.configure_options += iconv_configure_flags + end + + if darwin? && !cross_build_p + recipe.configure_options += ["RANLIB=/usr/bin/ranlib", "AR=/usr/bin/ar"] + end + + if windows? + cflags = concat_flags(cflags, "-ULIBXML_STATIC", "-DIN_LIBXML") + end + + recipe.configure_options << if source_dir + "--config-cache" + else + "--disable-dependency-tracking" + end + + recipe.configure_options += [ + "--without-python", + "--without-readline", + "--with-c14n", + "--with-debug", + "--with-threads", + "CFLAGS=#{cflags}", + ] + end + + libxslt_recipe = process_recipe("libxslt", dependencies["libxslt"]["version"], static_p, cross_build_p) do |recipe| + source_dir = arg_config("--with-xslt-source-dir") + if source_dir + recipe.source_directory = source_dir + else + recipe.files = [{ + url: "http://xmlsoft.org/sources/#{recipe.name}-#{recipe.version}.tar.gz", + sha256: dependencies["libxslt"]["sha256"], + }] + recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort + end + + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + + if darwin? && !cross_build_p + recipe.configure_options += ["RANLIB=/usr/bin/ranlib", "AR=/usr/bin/ar"] + end + + recipe.configure_options << if source_dir + "--config-cache" + else + "--disable-dependency-tracking" + end + + recipe.configure_options += [ + "--without-python", + "--without-crypto", + "--with-debug", + "--with-libxml-prefix=#{sh_export_path(libxml2_recipe.path)}", + "CFLAGS=#{cflags}", + ] + end + + append_cppflags("-DNOKOGIRI_PACKAGED_LIBRARIES") + append_cppflags("-DNOKOGIRI_PRECOMPILED_LIBRARIES") if cross_build_p + + $libs = $libs.shellsplit.tap do |libs| + [libxml2_recipe, libxslt_recipe].each do |recipe| + libname = recipe.name[/\Alib(.+)\z/, 1] + File.join(recipe.path, "bin", "#{libname}-config").tap do |config| + # call config scripts explicit with 'sh' for compat with Windows + $CPPFLAGS = %x(sh #{config} --cflags).strip << " " << $CPPFLAGS + %x(sh #{config} --libs).strip.shellsplit.each do |arg| + case arg + when /\A-L(.+)\z/ + # Prioritize ports' directories + $LIBPATH = if Regexp.last_match(1).start_with?(PACKAGE_ROOT_DIR + "/") + [Regexp.last_match(1)] | $LIBPATH + else + $LIBPATH | [Regexp.last_match(1)] + end + when /\A-l./ + libs.unshift(arg) + else + $LDFLAGS << " " << arg.shellescape + end + end + end + + patches_string = recipe.patch_files.map { |path| File.basename(path) }.join(" ") + append_cppflags(%[-DNOKOGIRI_#{recipe.name.upcase}_PATCHES="\\\"#{patches_string}\\\""]) + + case libname + when "xml2" + # xslt-config --libs or pkg-config libxslt --libs does not include + # -llzma, so we need to add it manually when linking statically. + if static_p && preserving_globals { local_have_library("lzma") } + # Add it at the end; GH #988 + libs << "-llzma" + end + when "xslt" + # xslt-config does not have a flag to emit options including + # -lexslt, so add it manually. + libs.unshift("-lexslt") + end + end + end.shelljoin + + if static_p + $libs = $libs.shellsplit.map do |arg| + case arg + when "-lxml2" + File.join(libxml2_recipe.path, "lib", libflag_to_filename(arg)) + when "-lxslt", "-lexslt" + File.join(libxslt_recipe.path, "lib", libflag_to_filename(arg)) + else + arg + end + end.shelljoin + end + + ensure_func("xmlParseDoc", "libxml/parser.h") + ensure_func("xsltParseStylesheetDoc", "libxslt/xslt.h") + ensure_func("exsltFuncRegister", "libexslt/exslt.h") +end + +libgumbo_recipe = process_recipe("libgumbo", "1.0.0-nokogiri", static_p, cross_build_p, false) do |recipe| + recipe.configure_options = [] + + class << recipe + def downloaded? + true + end + + def extract + target = File.join(tmp_path, "gumbo-parser") + output("Copying gumbo-parser files into #{target}...") + FileUtils.mkdir_p(target) + FileUtils.cp(Dir.glob(File.join(PACKAGE_ROOT_DIR, "gumbo-parser/src/*")), target) + end + + def configured? + true + end + + def install + lib_dir = File.join(port_path, "lib") + inc_dir = File.join(port_path, "include") + FileUtils.mkdir_p([lib_dir, inc_dir]) + FileUtils.cp(File.join(work_path, "libgumbo.a"), lib_dir) + FileUtils.cp(Dir.glob(File.join(work_path, "*.h")), inc_dir) + end + + def compile + cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g") + + env = { "CC" => gcc_cmd, "CFLAGS" => cflags } + if config_cross_build? + if /darwin/.match?(host) + env["AR"] = "#{host}-libtool" + env["ARFLAGS"] = "-o" + else + env["AR"] = "#{host}-ar" + end + env["RANLIB"] = "#{host}-ranlib" + end + + execute("compile", make_cmd, { env: env }) + end + end +end +append_cppflags("-I#{File.join(libgumbo_recipe.path, "include")}") +$libs = $libs + " " + File.join(libgumbo_recipe.path, "lib", "libgumbo.a") +$LIBPATH = $LIBPATH | [File.join(libgumbo_recipe.path, "lib")] +ensure_func("gumbo_parse_with_options", "gumbo.h") + +have_func("xmlHasFeature") || abort("xmlHasFeature() is missing.") # introduced in libxml 2.6.21 +have_func("xmlFirstElementChild") # introduced in libxml 2.7.3 +have_func("xmlRelaxNGSetParserStructuredErrors") # introduced in libxml 2.6.24 +have_func("xmlRelaxNGSetValidStructuredErrors") # introduced in libxml 2.6.21 +have_func("xmlSchemaSetValidStructuredErrors") # introduced in libxml 2.6.23 +have_func("xmlSchemaSetParserStructuredErrors") # introduced in libxml 2.6.23 + +have_func("vasprintf") + +other_library_versions_string = OTHER_LIBRARY_VERSIONS.map { |k, v| [k, v].join(":") }.join(",") +append_cppflags(%[-DNOKOGIRI_OTHER_LIBRARY_VERSIONS="\\\"#{other_library_versions_string}\\\""]) + +unless config_system_libraries? + if cross_build_p + # When precompiling native gems, copy packaged libraries' headers to ext/nokogiri/include + # These are packaged up by the cross-compiling callback in the ExtensionTask + copy_packaged_libraries_headers(to_path: File.join(PACKAGE_ROOT_DIR, "ext/nokogiri/include"), + from_recipes: [libxml2_recipe, libxslt_recipe]) + else + # When compiling during installation, install packaged libraries' header files into ext/nokogiri/include + copy_packaged_libraries_headers(to_path: "include", + from_recipes: [libxml2_recipe, libxslt_recipe]) + $INSTALLFILES << ["include/**/*.h", "$(rubylibdir)"] + end +end + +create_makefile("nokogiri/nokogiri") + +if config_clean? + # Do not clean if run in a development work tree. + File.open("Makefile", "at") do |mk| + mk.print(<<~EOF) + + all: clean-ports + clean-ports: $(DLLIB) + \t-$(Q)$(RUBY) $(srcdir)/extconf.rb --clean --#{static_p ? "enable" : "disable"}-static + EOF + end +end diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/gumbo.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/gumbo.c new file mode 100644 index 0000000..0bc7d99 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/gumbo.c @@ -0,0 +1,584 @@ +// +// Copyright 2013-2021 Sam Ruby, Stephen Checkoway +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// nokogumbo.c defines the following: +// +// class Nokogumbo +// def parse(utf8_string) # returns Nokogiri::HTML5::Document +// end +// +// Processing starts by calling gumbo_parse_with_options. The resulting document tree +// is then walked, a parallel libxml2 tree is constructed, and the final document is +// then wrapped using Nokogiri_wrap_xml_document. This approach reduces memory and CPU +// requirements as Ruby objects are only built when necessary. +// + +#include + +#include "gumbo.h" + +VALUE cNokogiriHtml5Document; + +// Interned symbols +static ID internal_subset; +static ID parent; + +/* Backwards compatibility to Ruby 2.1.0 */ +#if RUBY_API_VERSION_CODE < 20200 +#define ONIG_ESCAPE_UCHAR_COLLISION 1 +#include + +static VALUE +rb_utf8_str_new(const char *str, long length) +{ + return rb_enc_str_new(str, length, rb_utf8_encoding()); +} + +static VALUE +rb_utf8_str_new_cstr(const char *str) +{ + return rb_enc_str_new_cstr(str, rb_utf8_encoding()); +} + +static VALUE +rb_utf8_str_new_static(const char *str, long length) +{ + return rb_enc_str_new(str, length, rb_utf8_encoding()); +} +#endif + +#include +#include +#include + +// URI = system id +// external id = public id +static xmlDocPtr +new_html_doc(const char *dtd_name, const char *system, const char *public) +{ + // These two libxml2 functions take the public and system ids in + // opposite orders. + htmlDocPtr doc = htmlNewDocNoDtD(/* URI */ NULL, /* ExternalID */NULL); + assert(doc); + if (dtd_name) { + xmlCreateIntSubset(doc, (const xmlChar *)dtd_name, (const xmlChar *)public, (const xmlChar *)system); + } + return doc; +} + +static xmlNodePtr +get_parent(xmlNodePtr node) +{ + return node->parent; +} + +static GumboOutput * +perform_parse(const GumboOptions *options, VALUE input) +{ + assert(RTEST(input)); + Check_Type(input, T_STRING); + GumboOutput *output = gumbo_parse_with_options( + options, + RSTRING_PTR(input), + RSTRING_LEN(input) + ); + + const char *status_string = gumbo_status_to_string(output->status); + switch (output->status) { + case GUMBO_STATUS_OK: + break; + case GUMBO_STATUS_TOO_MANY_ATTRIBUTES: + case GUMBO_STATUS_TREE_TOO_DEEP: + gumbo_destroy_output(output); + rb_raise(rb_eArgError, "%s", status_string); + case GUMBO_STATUS_OUT_OF_MEMORY: + gumbo_destroy_output(output); + rb_raise(rb_eNoMemError, "%s", status_string); + } + return output; +} + +static xmlNsPtr +lookup_or_add_ns( + xmlDocPtr doc, + xmlNodePtr root, + const char *href, + const char *prefix +) +{ + xmlNsPtr ns = xmlSearchNs(doc, root, (const xmlChar *)prefix); + if (ns) { + return ns; + } + return xmlNewNs(root, (const xmlChar *)href, (const xmlChar *)prefix); +} + +static void +set_line(xmlNodePtr node, size_t line) +{ + // libxml2 uses 65535 to mean look elsewhere for the line number on some + // nodes. + if (line < 65535) { + node->line = (unsigned short)line; + } +} + +// Construct an XML tree rooted at xml_output_node from the Gumbo tree rooted +// at gumbo_node. +static void +build_tree( + xmlDocPtr doc, + xmlNodePtr xml_output_node, + const GumboNode *gumbo_node +) +{ + xmlNodePtr xml_root = NULL; + xmlNodePtr xml_node = xml_output_node; + size_t child_index = 0; + + while (true) { + assert(gumbo_node != NULL); + const GumboVector *children = gumbo_node->type == GUMBO_NODE_DOCUMENT ? + &gumbo_node->v.document.children : &gumbo_node->v.element.children; + if (child_index >= children->length) { + // Move up the tree and to the next child. + if (xml_node == xml_output_node) { + // We've built as much of the tree as we can. + return; + } + child_index = gumbo_node->index_within_parent + 1; + gumbo_node = gumbo_node->parent; + xml_node = get_parent(xml_node); + // Children of fragments don't share the same root, so reset it and + // it'll be set below. In the non-fragment case, this will only happen + // after the html element has been finished at which point there are no + // further elements. + if (xml_node == xml_output_node) { + xml_root = NULL; + } + continue; + } + const GumboNode *gumbo_child = children->data[child_index++]; + xmlNodePtr xml_child; + + switch (gumbo_child->type) { + case GUMBO_NODE_DOCUMENT: + abort(); // Bug in Gumbo. + + case GUMBO_NODE_TEXT: + case GUMBO_NODE_WHITESPACE: + xml_child = xmlNewDocText(doc, (const xmlChar *)gumbo_child->v.text.text); + set_line(xml_child, gumbo_child->v.text.start_pos.line); + xmlAddChild(xml_node, xml_child); + break; + + case GUMBO_NODE_CDATA: + xml_child = xmlNewCDataBlock(doc, (const xmlChar *)gumbo_child->v.text.text, + (int) strlen(gumbo_child->v.text.text)); + set_line(xml_child, gumbo_child->v.text.start_pos.line); + xmlAddChild(xml_node, xml_child); + break; + + case GUMBO_NODE_COMMENT: + xml_child = xmlNewDocComment(doc, (const xmlChar *)gumbo_child->v.text.text); + set_line(xml_child, gumbo_child->v.text.start_pos.line); + xmlAddChild(xml_node, xml_child); + break; + + case GUMBO_NODE_TEMPLATE: + // XXX: Should create a template element and a new DocumentFragment + case GUMBO_NODE_ELEMENT: { + xml_child = xmlNewDocNode(doc, NULL, (const xmlChar *)gumbo_child->v.element.name, NULL); + set_line(xml_child, gumbo_child->v.element.start_pos.line); + if (xml_root == NULL) { + xml_root = xml_child; + } + xmlNsPtr ns = NULL; + switch (gumbo_child->v.element.tag_namespace) { + case GUMBO_NAMESPACE_HTML: + break; + case GUMBO_NAMESPACE_SVG: + ns = lookup_or_add_ns(doc, xml_root, "http://www.w3.org/2000/svg", "svg"); + break; + case GUMBO_NAMESPACE_MATHML: + ns = lookup_or_add_ns(doc, xml_root, "http://www.w3.org/1998/Math/MathML", "math"); + break; + } + if (ns != NULL) { + xmlSetNs(xml_child, ns); + } + xmlAddChild(xml_node, xml_child); + + // Add the attributes. + const GumboVector *attrs = &gumbo_child->v.element.attributes; + for (size_t i = 0; i < attrs->length; i++) { + const GumboAttribute *attr = attrs->data[i]; + + switch (attr->attr_namespace) { + case GUMBO_ATTR_NAMESPACE_XLINK: + ns = lookup_or_add_ns(doc, xml_root, "http://www.w3.org/1999/xlink", "xlink"); + break; + + case GUMBO_ATTR_NAMESPACE_XML: + ns = lookup_or_add_ns(doc, xml_root, "http://www.w3.org/XML/1998/namespace", "xml"); + break; + + case GUMBO_ATTR_NAMESPACE_XMLNS: + ns = lookup_or_add_ns(doc, xml_root, "http://www.w3.org/2000/xmlns/", "xmlns"); + break; + + default: + ns = NULL; + } + xmlNewNsProp(xml_child, ns, (const xmlChar *)attr->name, (const xmlChar *)attr->value); + } + + // Add children for this element. + child_index = 0; + gumbo_node = gumbo_child; + xml_node = xml_child; + } + } + } +} + +static void +add_errors(const GumboOutput *output, VALUE rdoc, VALUE input, VALUE url) +{ + const char *input_str = RSTRING_PTR(input); + size_t input_len = RSTRING_LEN(input); + + // Add parse errors to rdoc. + if (output->errors.length) { + const GumboVector *errors = &output->errors; + VALUE rerrors = rb_ary_new2(errors->length); + + for (size_t i = 0; i < errors->length; i++) { + GumboError *err = errors->data[i]; + GumboSourcePosition position = gumbo_error_position(err); + char *msg; + size_t size = gumbo_caret_diagnostic_to_string(err, input_str, input_len, &msg); + VALUE err_str = rb_utf8_str_new(msg, size); + free(msg); + VALUE syntax_error = rb_class_new_instance(1, &err_str, cNokogiriXmlSyntaxError); + const char *error_code = gumbo_error_code(err); + VALUE str1 = error_code ? rb_utf8_str_new_static(error_code, strlen(error_code)) : Qnil; + rb_iv_set(syntax_error, "@domain", INT2NUM(1)); // XML_FROM_PARSER + rb_iv_set(syntax_error, "@code", INT2NUM(1)); // XML_ERR_INTERNAL_ERROR + rb_iv_set(syntax_error, "@level", INT2NUM(2)); // XML_ERR_ERROR + rb_iv_set(syntax_error, "@file", url); + rb_iv_set(syntax_error, "@line", INT2NUM(position.line)); + rb_iv_set(syntax_error, "@str1", str1); + rb_iv_set(syntax_error, "@str2", Qnil); + rb_iv_set(syntax_error, "@str3", Qnil); + rb_iv_set(syntax_error, "@int1", INT2NUM(0)); + rb_iv_set(syntax_error, "@column", INT2NUM(position.column)); + rb_ary_push(rerrors, syntax_error); + } + rb_iv_set(rdoc, "@errors", rerrors); + } +} + +typedef struct { + GumboOutput *output; + VALUE input; + VALUE url_or_frag; + xmlDocPtr doc; +} ParseArgs; + +static VALUE +parse_cleanup(VALUE parse_args) +{ + ParseArgs *args = (ParseArgs *)parse_args; + gumbo_destroy_output(args->output); + // Make sure garbage collection doesn't mark the objects as being live based + // on references from the ParseArgs. This may be unnecessary. + args->input = Qnil; + args->url_or_frag = Qnil; + if (args->doc != NULL) { + xmlFreeDoc(args->doc); + } + return Qnil; +} + +static VALUE parse_continue(VALUE parse_args); + +/* + * @!visibility protected + */ +static VALUE +parse(VALUE self, VALUE input, VALUE url, VALUE max_attributes, VALUE max_errors, VALUE max_depth) +{ + GumboOptions options = kGumboDefaultOptions; + options.max_attributes = NUM2INT(max_attributes); + options.max_errors = NUM2INT(max_errors); + options.max_tree_depth = NUM2INT(max_depth); + + GumboOutput *output = perform_parse(&options, input); + ParseArgs args = { + .output = output, + .input = input, + .url_or_frag = url, + .doc = NULL, + }; + + return rb_ensure(parse_continue, (VALUE)(&args), parse_cleanup, (VALUE)(&args)); +} + +static VALUE +parse_continue(VALUE parse_args) +{ + ParseArgs *args = (ParseArgs *)parse_args; + GumboOutput *output = args->output; + xmlDocPtr doc; + if (output->document->v.document.has_doctype) { + const char *name = output->document->v.document.name; + const char *public = output->document->v.document.public_identifier; + const char *system = output->document->v.document.system_identifier; + public = public[0] ? public : NULL; + system = system[0] ? system : NULL; + doc = new_html_doc(name, system, public); + } else { + doc = new_html_doc(NULL, NULL, NULL); + } + args->doc = doc; // Make sure doc gets cleaned up if an error is thrown. + build_tree(doc, (xmlNodePtr)doc, output->document); + VALUE rdoc = Nokogiri_wrap_xml_document(cNokogiriHtml5Document, doc); + args->doc = NULL; // The Ruby runtime now owns doc so don't delete it. + add_errors(output, rdoc, args->input, args->url_or_frag); + return rdoc; +} + +static int +lookup_namespace(VALUE node, bool require_known_ns) +{ + ID namespace, href; + CONST_ID(namespace, "namespace"); + CONST_ID(href, "href"); + VALUE ns = rb_funcall(node, namespace, 0); + + if (NIL_P(ns)) { + return GUMBO_NAMESPACE_HTML; + } + ns = rb_funcall(ns, href, 0); + assert(RTEST(ns)); + Check_Type(ns, T_STRING); + + const char *href_ptr = RSTRING_PTR(ns); + size_t href_len = RSTRING_LEN(ns); +#define NAMESPACE_P(uri) (href_len == sizeof uri - 1 && !memcmp(href_ptr, uri, href_len)) + if (NAMESPACE_P("http://www.w3.org/1999/xhtml")) { + return GUMBO_NAMESPACE_HTML; + } + if (NAMESPACE_P("http://www.w3.org/1998/Math/MathML")) { + return GUMBO_NAMESPACE_MATHML; + } + if (NAMESPACE_P("http://www.w3.org/2000/svg")) { + return GUMBO_NAMESPACE_SVG; + } +#undef NAMESPACE_P + if (require_known_ns) { + rb_raise(rb_eArgError, "Unexpected namespace URI \"%*s\"", (int)href_len, href_ptr); + } + return -1; +} + +static xmlNodePtr +extract_xml_node(VALUE node) +{ + xmlNodePtr xml_node; + Data_Get_Struct(node, xmlNode, xml_node); + return xml_node; +} + +static VALUE fragment_continue(VALUE parse_args); + +/* + * @!visibility protected + */ +static VALUE +fragment( + VALUE self, + VALUE doc_fragment, + VALUE tags, + VALUE ctx, + VALUE max_attributes, + VALUE max_errors, + VALUE max_depth +) +{ + ID name = rb_intern_const("name"); + const char *ctx_tag; + GumboNamespaceEnum ctx_ns; + GumboQuirksModeEnum quirks_mode; + bool form = false; + const char *encoding = NULL; + + if (NIL_P(ctx)) { + ctx_tag = "body"; + ctx_ns = GUMBO_NAMESPACE_HTML; + } else if (TYPE(ctx) == T_STRING) { + ctx_tag = StringValueCStr(ctx); + ctx_ns = GUMBO_NAMESPACE_HTML; + size_t len = RSTRING_LEN(ctx); + const char *colon = memchr(ctx_tag, ':', len); + if (colon) { + switch (colon - ctx_tag) { + case 3: + if (st_strncasecmp(ctx_tag, "svg", 3) != 0) { + goto error; + } + ctx_ns = GUMBO_NAMESPACE_SVG; + break; + case 4: + if (st_strncasecmp(ctx_tag, "html", 4) == 0) { + ctx_ns = GUMBO_NAMESPACE_HTML; + } else if (st_strncasecmp(ctx_tag, "math", 4) == 0) { + ctx_ns = GUMBO_NAMESPACE_MATHML; + } else { + goto error; + } + break; + default: +error: + rb_raise(rb_eArgError, "Invalid context namespace '%*s'", (int)(colon - ctx_tag), ctx_tag); + } + ctx_tag = colon + 1; + } else { + // For convenience, put 'svg' and 'math' in their namespaces. + if (len == 3 && st_strncasecmp(ctx_tag, "svg", 3) == 0) { + ctx_ns = GUMBO_NAMESPACE_SVG; + } else if (len == 4 && st_strncasecmp(ctx_tag, "math", 4) == 0) { + ctx_ns = GUMBO_NAMESPACE_MATHML; + } + } + + // Check if it's a form. + form = ctx_ns == GUMBO_NAMESPACE_HTML && st_strcasecmp(ctx_tag, "form") == 0; + } else { + ID element_ = rb_intern_const("element?"); + + // Context fragment name. + VALUE tag_name = rb_funcall(ctx, name, 0); + assert(RTEST(tag_name)); + Check_Type(tag_name, T_STRING); + ctx_tag = StringValueCStr(tag_name); + + // Context fragment namespace. + ctx_ns = lookup_namespace(ctx, true); + + // Check for a form ancestor, including self. + for (VALUE node = ctx; + !NIL_P(node); + node = rb_respond_to(node, parent) ? rb_funcall(node, parent, 0) : Qnil) { + if (!RTEST(rb_funcall(node, element_, 0))) { + continue; + } + VALUE element_name = rb_funcall(node, name, 0); + if (RSTRING_LEN(element_name) == 4 + && !st_strcasecmp(RSTRING_PTR(element_name), "form") + && lookup_namespace(node, false) == GUMBO_NAMESPACE_HTML) { + form = true; + break; + } + } + + // Encoding. + if (RSTRING_LEN(tag_name) == 14 + && !st_strcasecmp(ctx_tag, "annotation-xml")) { + VALUE enc = rb_funcall(ctx, rb_intern_const("[]"), + rb_utf8_str_new_static("encoding", 8)); + if (RTEST(enc)) { + Check_Type(enc, T_STRING); + encoding = StringValueCStr(enc); + } + } + } + + // Quirks mode. + VALUE doc = rb_funcall(doc_fragment, rb_intern_const("document"), 0); + VALUE dtd = rb_funcall(doc, internal_subset, 0); + if (NIL_P(dtd)) { + quirks_mode = GUMBO_DOCTYPE_NO_QUIRKS; + } else { + VALUE dtd_name = rb_funcall(dtd, name, 0); + VALUE pubid = rb_funcall(dtd, rb_intern_const("external_id"), 0); + VALUE sysid = rb_funcall(dtd, rb_intern_const("system_id"), 0); + quirks_mode = gumbo_compute_quirks_mode( + NIL_P(dtd_name) ? NULL : StringValueCStr(dtd_name), + NIL_P(pubid) ? NULL : StringValueCStr(pubid), + NIL_P(sysid) ? NULL : StringValueCStr(sysid) + ); + } + + // Perform a fragment parse. + int depth = NUM2INT(max_depth); + GumboOptions options = kGumboDefaultOptions; + options.max_attributes = NUM2INT(max_attributes); + options.max_errors = NUM2INT(max_errors); + // Add one to account for the HTML element. + options.max_tree_depth = depth < 0 ? -1 : (depth + 1); + options.fragment_context = ctx_tag; + options.fragment_namespace = ctx_ns; + options.fragment_encoding = encoding; + options.quirks_mode = quirks_mode; + options.fragment_context_has_form_ancestor = form; + + GumboOutput *output = perform_parse(&options, tags); + ParseArgs args = { + .output = output, + .input = tags, + .url_or_frag = doc_fragment, + .doc = (xmlDocPtr)extract_xml_node(doc), + }; + rb_ensure(fragment_continue, (VALUE)(&args), parse_cleanup, (VALUE)(&args)); + return Qnil; +} + +static VALUE +fragment_continue(VALUE parse_args) +{ + ParseArgs *args = (ParseArgs *)parse_args; + GumboOutput *output = args->output; + VALUE doc_fragment = args->url_or_frag; + xmlDocPtr xml_doc = args->doc; + + args->doc = NULL; // The Ruby runtime owns doc so make sure we don't delete it. + xmlNodePtr xml_frag = extract_xml_node(doc_fragment); + build_tree(xml_doc, xml_frag, output->root); + add_errors(output, doc_fragment, args->input, rb_utf8_str_new_static("#fragment", 9)); + return Qnil; +} + +// Initialize the Nokogumbo class and fetch constants we will use later. +void +noko_init_gumbo() +{ + // Class constants. + cNokogiriHtml5Document = rb_define_class_under(mNokogiriHtml5, "Document", cNokogiriHtml4Document); + rb_gc_register_mark_object(cNokogiriHtml5Document); + + // Interned symbols. + internal_subset = rb_intern_const("internal_subset"); + parent = rb_intern_const("parent"); + + // Define Nokogumbo module with parse and fragment methods. + rb_define_singleton_method(mNokogiriGumbo, "parse", parse, 5); + rb_define_singleton_method(mNokogiriGumbo, "fragment", fragment, 6); +} + +// vim: set shiftwidth=2 softtabstop=2 tabstop=8 expandtab: diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_document.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_document.c new file mode 100644 index 0000000..9e9a016 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_document.c @@ -0,0 +1,166 @@ +#include + +VALUE cNokogiriHtml4Document ; + +static ID id_encoding_found; +static ID id_to_s; + +/* + * call-seq: + * new + * + * Create a new document + */ +static VALUE +rb_html_document_s_new(int argc, VALUE *argv, VALUE klass) +{ + VALUE uri, external_id, rest, rb_doc; + htmlDocPtr doc; + + rb_scan_args(argc, argv, "0*", &rest); + uri = rb_ary_entry(rest, (long)0); + external_id = rb_ary_entry(rest, (long)1); + + doc = htmlNewDoc( + RTEST(uri) ? (const xmlChar *)StringValueCStr(uri) : NULL, + RTEST(external_id) ? (const xmlChar *)StringValueCStr(external_id) : NULL + ); + rb_doc = noko_xml_document_wrap_with_init_args(klass, doc, argc, argv); + return rb_doc ; +} + +/* + * call-seq: + * read_io(io, url, encoding, options) + * + * Read the HTML document from +io+ with given +url+, +encoding+, + * and +options+. See Nokogiri::HTML4.parse + */ +static VALUE +rb_html_document_s_read_io(VALUE klass, VALUE rb_io, VALUE rb_url, VALUE rb_encoding, VALUE rb_options) +{ + VALUE rb_doc; + VALUE rb_error_list = rb_ary_new(); + htmlDocPtr c_doc; + const char *c_url = NIL_P(rb_url) ? NULL : StringValueCStr(rb_url); + const char *c_encoding = NIL_P(rb_encoding) ? NULL : StringValueCStr(rb_encoding); + int options = NUM2INT(rb_options); + + xmlSetStructuredErrorFunc((void *)rb_error_list, Nokogiri_error_array_pusher); + + c_doc = htmlReadIO(noko_io_read, noko_io_close, (void *)rb_io, c_url, c_encoding, options); + + xmlSetStructuredErrorFunc(NULL, NULL); + + /* + * If EncodingFound has occurred in EncodingReader, make sure to do + * a cleanup and propagate the error. + */ + if (rb_respond_to(rb_io, id_encoding_found)) { + VALUE encoding_found = rb_funcall(rb_io, id_encoding_found, 0); + if (!NIL_P(encoding_found)) { + xmlFreeDoc(c_doc); + rb_exc_raise(encoding_found); + } + } + + if ((c_doc == NULL) || (!(options & XML_PARSE_RECOVER) && (RARRAY_LEN(rb_error_list) > 0))) { + VALUE rb_error ; + + xmlFreeDoc(c_doc); + + rb_error = rb_ary_entry(rb_error_list, 0); + if (rb_error == Qnil) { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } else { + VALUE exception_message = rb_funcall(rb_error, id_to_s, 0); + exception_message = rb_str_concat(rb_str_new2("Parser without recover option encountered error or warning: "), + exception_message); + rb_exc_raise(rb_class_new_instance(1, &exception_message, cNokogiriXmlSyntaxError)); + } + + return Qnil; + } + + rb_doc = noko_xml_document_wrap(klass, c_doc); + rb_iv_set(rb_doc, "@errors", rb_error_list); + return rb_doc; +} + +/* + * call-seq: + * read_memory(string, url, encoding, options) + * + * Read the HTML document contained in +string+ with given +url+, +encoding+, + * and +options+. See Nokogiri::HTML4.parse + */ +static VALUE +rb_html_document_s_read_memory(VALUE klass, VALUE rb_html, VALUE rb_url, VALUE rb_encoding, VALUE rb_options) +{ + VALUE rb_doc; + VALUE rb_error_list = rb_ary_new(); + htmlDocPtr c_doc; + const char *c_buffer = StringValuePtr(rb_html); + const char *c_url = NIL_P(rb_url) ? NULL : StringValueCStr(rb_url); + const char *c_encoding = NIL_P(rb_encoding) ? NULL : StringValueCStr(rb_encoding); + int html_len = (int)RSTRING_LEN(rb_html); + int options = NUM2INT(rb_options); + + xmlSetStructuredErrorFunc((void *)rb_error_list, Nokogiri_error_array_pusher); + + c_doc = htmlReadMemory(c_buffer, html_len, c_url, c_encoding, options); + + xmlSetStructuredErrorFunc(NULL, NULL); + + if ((c_doc == NULL) || (!(options & XML_PARSE_RECOVER) && (RARRAY_LEN(rb_error_list) > 0))) { + VALUE rb_error ; + + xmlFreeDoc(c_doc); + + rb_error = rb_ary_entry(rb_error_list, 0); + if (rb_error == Qnil) { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } else { + VALUE exception_message = rb_funcall(rb_error, id_to_s, 0); + exception_message = rb_str_concat(rb_str_new2("Parser without recover option encountered error or warning: "), + exception_message); + rb_exc_raise(rb_class_new_instance(1, &exception_message, cNokogiriXmlSyntaxError)); + } + + return Qnil; + } + + rb_doc = noko_xml_document_wrap(klass, c_doc); + rb_iv_set(rb_doc, "@errors", rb_error_list); + return rb_doc; +} + +/* + * call-seq: + * type + * + * The type for this document + */ +static VALUE +rb_html_document_type(VALUE self) +{ + htmlDocPtr doc; + Data_Get_Struct(self, xmlDoc, doc); + return INT2NUM((long)doc->type); +} + +void +noko_init_html_document() +{ + assert(cNokogiriXmlDocument); + cNokogiriHtml4Document = rb_define_class_under(mNokogiriHtml4, "Document", cNokogiriXmlDocument); + + rb_define_singleton_method(cNokogiriHtml4Document, "read_memory", rb_html_document_s_read_memory, 4); + rb_define_singleton_method(cNokogiriHtml4Document, "read_io", rb_html_document_s_read_io, 4); + rb_define_singleton_method(cNokogiriHtml4Document, "new", rb_html_document_s_new, -1); + + rb_define_method(cNokogiriHtml4Document, "type", rb_html_document_type, 0); + + id_encoding_found = rb_intern("encoding_found"); + id_to_s = rb_intern("to_s"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_element_description.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_element_description.c new file mode 100644 index 0000000..a9ba9f7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_element_description.c @@ -0,0 +1,294 @@ +#include + +VALUE cNokogiriHtml4ElementDescription ; + +/* + * call-seq: + * required_attributes + * + * A list of required attributes for this element + */ +static VALUE +required_attributes(VALUE self) +{ + const htmlElemDesc *description; + VALUE list; + int i; + + Data_Get_Struct(self, htmlElemDesc, description); + + list = rb_ary_new(); + + if (NULL == description->attrs_req) { return list; } + + for (i = 0; description->attrs_depr[i]; i++) { + rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_req[i])); + } + + return list; +} + +/* + * call-seq: + * deprecated_attributes + * + * A list of deprecated attributes for this element + */ +static VALUE +deprecated_attributes(VALUE self) +{ + const htmlElemDesc *description; + VALUE list; + int i; + + Data_Get_Struct(self, htmlElemDesc, description); + + list = rb_ary_new(); + + if (NULL == description->attrs_depr) { return list; } + + for (i = 0; description->attrs_depr[i]; i++) { + rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_depr[i])); + } + + return list; +} + +/* + * call-seq: + * optional_attributes + * + * A list of optional attributes for this element + */ +static VALUE +optional_attributes(VALUE self) +{ + const htmlElemDesc *description; + VALUE list; + int i; + + Data_Get_Struct(self, htmlElemDesc, description); + + list = rb_ary_new(); + + if (NULL == description->attrs_opt) { return list; } + + for (i = 0; description->attrs_opt[i]; i++) { + rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_opt[i])); + } + + return list; +} + +/* + * call-seq: + * default_sub_element + * + * The default sub element for this element + */ +static VALUE +default_sub_element(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->defaultsubelt) { + return NOKOGIRI_STR_NEW2(description->defaultsubelt); + } + + return Qnil; +} + +/* + * call-seq: + * sub_elements + * + * A list of allowed sub elements for this element. + */ +static VALUE +sub_elements(VALUE self) +{ + const htmlElemDesc *description; + VALUE list; + int i; + + Data_Get_Struct(self, htmlElemDesc, description); + + list = rb_ary_new(); + + if (NULL == description->subelts) { return list; } + + for (i = 0; description->subelts[i]; i++) { + rb_ary_push(list, NOKOGIRI_STR_NEW2(description->subelts[i])); + } + + return list; +} + +/* + * call-seq: + * description + * + * The description for this element + */ +static VALUE +description(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + return NOKOGIRI_STR_NEW2(description->desc); +} + +/* + * call-seq: + * inline? + * + * Is this element an inline element? + */ +static VALUE +inline_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->isinline) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * deprecated? + * + * Is this element deprecated? + */ +static VALUE +deprecated_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->depr) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * empty? + * + * Is this an empty element? + */ +static VALUE +empty_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->empty) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * save_end_tag? + * + * Should the end tag be saved? + */ +static VALUE +save_end_tag_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->saveEndTag) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * implied_end_tag? + * + * Can the end tag be implied for this tag? + */ +static VALUE +implied_end_tag_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->endTag) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * implied_start_tag? + * + * Can the start tag be implied for this tag? + */ +static VALUE +implied_start_tag_eh(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (description->startTag) { return Qtrue; } + return Qfalse; +} + +/* + * call-seq: + * name + * + * Get the tag name for this ElemementDescription + */ +static VALUE +name(VALUE self) +{ + const htmlElemDesc *description; + Data_Get_Struct(self, htmlElemDesc, description); + + if (NULL == description->name) { return Qnil; } + return NOKOGIRI_STR_NEW2(description->name); +} + +/* + * call-seq: + * [](tag_name) + * + * Get ElemementDescription for +tag_name+ + */ +static VALUE +get_description(VALUE klass, VALUE tag_name) +{ + const htmlElemDesc *description = htmlTagLookup( + (const xmlChar *)StringValueCStr(tag_name) + ); + + if (NULL == description) { return Qnil; } + return Data_Wrap_Struct(klass, 0, 0, DISCARD_CONST_QUAL(void *, description)); +} + +void +noko_init_html_element_description() +{ + cNokogiriHtml4ElementDescription = rb_define_class_under(mNokogiriHtml4, "ElementDescription", rb_cObject); + + rb_undef_alloc_func(cNokogiriHtml4ElementDescription); + + rb_define_singleton_method(cNokogiriHtml4ElementDescription, "[]", get_description, 1); + + rb_define_method(cNokogiriHtml4ElementDescription, "name", name, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "implied_start_tag?", implied_start_tag_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "implied_end_tag?", implied_end_tag_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "save_end_tag?", save_end_tag_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "empty?", empty_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "deprecated?", deprecated_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "inline?", inline_eh, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "description", description, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "sub_elements", sub_elements, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "default_sub_element", default_sub_element, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "optional_attributes", optional_attributes, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "deprecated_attributes", deprecated_attributes, 0); + rb_define_method(cNokogiriHtml4ElementDescription, "required_attributes", required_attributes, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_entity_lookup.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_entity_lookup.c new file mode 100644 index 0000000..ee1589c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_entity_lookup.c @@ -0,0 +1,37 @@ +#include + +static VALUE cNokogiriHtml4EntityLookup; + +/* + * call-seq: + * get(key) + * + * Get the HTML4::EntityDescription for +key+ + */ +static VALUE +get(VALUE _, VALUE rb_entity_name) +{ + VALUE cNokogiriHtml4EntityDescription; + const htmlEntityDesc *c_entity_desc; + VALUE rb_constructor_args[3]; + + c_entity_desc = htmlEntityLookup((const xmlChar *)StringValueCStr(rb_entity_name)); + if (NULL == c_entity_desc) { + return Qnil; + } + + rb_constructor_args[0] = INT2NUM((long)c_entity_desc->value); + rb_constructor_args[1] = NOKOGIRI_STR_NEW2(c_entity_desc->name); + rb_constructor_args[2] = NOKOGIRI_STR_NEW2(c_entity_desc->desc); + + cNokogiriHtml4EntityDescription = rb_const_get_at(mNokogiriHtml4, rb_intern("EntityDescription")); + return rb_class_new_instance(3, rb_constructor_args, cNokogiriHtml4EntityDescription); +} + +void +noko_init_html_entity_lookup() +{ + cNokogiriHtml4EntityLookup = rb_define_class_under(mNokogiriHtml4, "EntityLookup", rb_cObject); + + rb_define_method(cNokogiriHtml4EntityLookup, "get", get, 1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_parser_context.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_parser_context.c new file mode 100644 index 0000000..dec0d88 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_parser_context.c @@ -0,0 +1,120 @@ +#include + +VALUE cNokogiriHtml4SaxParserContext ; + +static void +deallocate(xmlParserCtxtPtr ctxt) +{ + NOKOGIRI_DEBUG_START(ctxt); + + ctxt->sax = NULL; + + htmlFreeParserCtxt(ctxt); + + NOKOGIRI_DEBUG_END(ctxt); +} + +static VALUE +parse_memory(VALUE klass, VALUE data, VALUE encoding) +{ + htmlParserCtxtPtr ctxt; + + if (NIL_P(data)) { + rb_raise(rb_eArgError, "data cannot be nil"); + } + if (!(int)RSTRING_LEN(data)) { + rb_raise(rb_eRuntimeError, "data cannot be empty"); + } + + ctxt = htmlCreateMemoryParserCtxt(StringValuePtr(data), + (int)RSTRING_LEN(data)); + if (ctxt->sax) { + xmlFree(ctxt->sax); + ctxt->sax = NULL; + } + + if (RTEST(encoding)) { + xmlCharEncodingHandlerPtr enc = xmlFindCharEncodingHandler(StringValueCStr(encoding)); + if (enc != NULL) { + xmlSwitchToEncoding(ctxt, enc); + if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { + rb_raise(rb_eRuntimeError, "Unsupported encoding %s", + StringValueCStr(encoding)); + } + } + } + + return Data_Wrap_Struct(klass, NULL, deallocate, ctxt); +} + +static VALUE +parse_file(VALUE klass, VALUE filename, VALUE encoding) +{ + htmlParserCtxtPtr ctxt = htmlCreateFileParserCtxt( + StringValueCStr(filename), + StringValueCStr(encoding) + ); + return Data_Wrap_Struct(klass, NULL, deallocate, ctxt); +} + +static VALUE +parse_doc(VALUE ctxt_val) +{ + htmlParserCtxtPtr ctxt = (htmlParserCtxtPtr)ctxt_val; + htmlParseDocument(ctxt); + return Qnil; +} + +static VALUE +parse_doc_finalize(VALUE ctxt_val) +{ + htmlParserCtxtPtr ctxt = (htmlParserCtxtPtr)ctxt_val; + + if (ctxt->myDoc) { + xmlFreeDoc(ctxt->myDoc); + } + + NOKOGIRI_SAX_TUPLE_DESTROY(ctxt->userData); + return Qnil; +} + +static VALUE +parse_with(VALUE self, VALUE sax_handler) +{ + htmlParserCtxtPtr ctxt; + htmlSAXHandlerPtr sax; + + if (!rb_obj_is_kind_of(sax_handler, cNokogiriXmlSaxParser)) { + rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::SAX::Parser"); + } + + Data_Get_Struct(self, htmlParserCtxt, ctxt); + Data_Get_Struct(sax_handler, htmlSAXHandler, sax); + + /* Free the sax handler since we'll assign our own */ + if (ctxt->sax && ctxt->sax != (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) { + xmlFree(ctxt->sax); + } + + ctxt->sax = sax; + ctxt->userData = (void *)NOKOGIRI_SAX_TUPLE_NEW(ctxt, sax_handler); + + xmlSetStructuredErrorFunc(NULL, NULL); + + rb_ensure(parse_doc, (VALUE)ctxt, parse_doc_finalize, (VALUE)ctxt); + + return self; +} + +void +noko_init_html_sax_parser_context() +{ + assert(cNokogiriXmlSaxParserContext); + cNokogiriHtml4SaxParserContext = rb_define_class_under(mNokogiriHtml4Sax, "ParserContext", + cNokogiriXmlSaxParserContext); + + rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "memory", parse_memory, 2); + rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "file", parse_file, 2); + + rb_define_method(cNokogiriHtml4SaxParserContext, "parse_with", parse_with, 1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_push_parser.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_push_parser.c new file mode 100644 index 0000000..9dc4a8c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/html4_sax_push_parser.c @@ -0,0 +1,95 @@ +#include + +VALUE cNokogiriHtml4SaxPushParser; + +/* + * call-seq: + * native_write(chunk, last_chunk) + * + * Write +chunk+ to PushParser. +last_chunk+ triggers the end_document handle + */ +static VALUE +native_write(VALUE self, VALUE _chunk, VALUE _last_chunk) +{ + xmlParserCtxtPtr ctx; + const char *chunk = NULL; + int size = 0; + int status = 0; + libxmlStructuredErrorHandlerState handler_state; + + Data_Get_Struct(self, xmlParserCtxt, ctx); + + if (Qnil != _chunk) { + chunk = StringValuePtr(_chunk); + size = (int)RSTRING_LEN(_chunk); + } + + Nokogiri_structured_error_func_save_and_set(&handler_state, NULL, NULL); + + status = htmlParseChunk(ctx, chunk, size, Qtrue == _last_chunk ? 1 : 0); + + Nokogiri_structured_error_func_restore(&handler_state); + + if ((status != 0) && !(ctx->options & XML_PARSE_RECOVER)) { + // TODO: there appear to be no tests for this block + xmlErrorPtr e = xmlCtxtGetLastError(ctx); + Nokogiri_error_raise(NULL, e); + } + + return self; +} + +/* + * call-seq: + * initialize_native(xml_sax, filename) + * + * Initialize the push parser with +xml_sax+ using +filename+ + */ +static VALUE +initialize_native(VALUE self, VALUE _xml_sax, VALUE _filename, + VALUE encoding) +{ + htmlSAXHandlerPtr sax; + const char *filename = NULL; + htmlParserCtxtPtr ctx; + xmlCharEncoding enc = XML_CHAR_ENCODING_NONE; + + Data_Get_Struct(_xml_sax, xmlSAXHandler, sax); + + if (_filename != Qnil) { filename = StringValueCStr(_filename); } + + if (!NIL_P(encoding)) { + enc = xmlParseCharEncoding(StringValueCStr(encoding)); + if (enc == XML_CHAR_ENCODING_ERROR) { + rb_raise(rb_eArgError, "Unsupported Encoding"); + } + } + + ctx = htmlCreatePushParserCtxt( + sax, + NULL, + NULL, + 0, + filename, + enc + ); + if (ctx == NULL) { + rb_raise(rb_eRuntimeError, "Could not create a parser context"); + } + + ctx->userData = NOKOGIRI_SAX_TUPLE_NEW(ctx, self); + + ctx->sax2 = 1; + DATA_PTR(self) = ctx; + return self; +} + +void +noko_init_html_sax_push_parser() +{ + assert(cNokogiriXmlSaxPushParser); + cNokogiriHtml4SaxPushParser = rb_define_class_under(mNokogiriHtml4Sax, "PushParser", cNokogiriXmlSaxPushParser); + + rb_define_private_method(cNokogiriHtml4SaxPushParser, "initialize_native", initialize_native, 3); + rb_define_private_method(cNokogiriHtml4SaxPushParser, "native_write", native_write, 2); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exslt.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exslt.h new file mode 100644 index 0000000..2147308 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exslt.h @@ -0,0 +1,102 @@ + +#ifndef __EXSLT_H__ +#define __EXSLT_H__ + +#include +#include +#include "exsltexports.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +EXSLTPUBVAR const char *exsltLibraryVersion; +EXSLTPUBVAR const int exsltLibexsltVersion; +EXSLTPUBVAR const int exsltLibxsltVersion; +EXSLTPUBVAR const int exsltLibxmlVersion; + +/** + * EXSLT_COMMON_NAMESPACE: + * + * Namespace for EXSLT common functions + */ +#define EXSLT_COMMON_NAMESPACE ((const xmlChar *) "http://exslt.org/common") +/** + * EXSLT_CRYPTO_NAMESPACE: + * + * Namespace for EXSLT crypto functions + */ +#define EXSLT_CRYPTO_NAMESPACE ((const xmlChar *) "http://exslt.org/crypto") +/** + * EXSLT_MATH_NAMESPACE: + * + * Namespace for EXSLT math functions + */ +#define EXSLT_MATH_NAMESPACE ((const xmlChar *) "http://exslt.org/math") +/** + * EXSLT_SETS_NAMESPACE: + * + * Namespace for EXSLT set functions + */ +#define EXSLT_SETS_NAMESPACE ((const xmlChar *) "http://exslt.org/sets") +/** + * EXSLT_FUNCTIONS_NAMESPACE: + * + * Namespace for EXSLT functions extension functions + */ +#define EXSLT_FUNCTIONS_NAMESPACE ((const xmlChar *) "http://exslt.org/functions") +/** + * EXSLT_STRINGS_NAMESPACE: + * + * Namespace for EXSLT strings functions + */ +#define EXSLT_STRINGS_NAMESPACE ((const xmlChar *) "http://exslt.org/strings") +/** + * EXSLT_DATE_NAMESPACE: + * + * Namespace for EXSLT date functions + */ +#define EXSLT_DATE_NAMESPACE ((const xmlChar *) "http://exslt.org/dates-and-times") +/** + * EXSLT_DYNAMIC_NAMESPACE: + * + * Namespace for EXSLT dynamic functions + */ +#define EXSLT_DYNAMIC_NAMESPACE ((const xmlChar *) "http://exslt.org/dynamic") + +/** + * SAXON_NAMESPACE: + * + * Namespace for SAXON extensions functions + */ +#define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon") + +EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void); +#ifdef EXSLT_CRYPTO_ENABLED +EXSLTPUBFUN void EXSLTCALL exsltCryptoRegister (void); +#endif +EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltStrRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltDateRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltSaxonRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltDynRegister(void); + +EXSLTPUBFUN void EXSLTCALL exsltRegisterAll (void); + +EXSLTPUBFUN int EXSLTCALL exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +EXSLTPUBFUN int EXSLTCALL exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +EXSLTPUBFUN int EXSLTCALL exsltSetsXpathCtxtRegister (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +EXSLTPUBFUN int EXSLTCALL exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, + const xmlChar *prefix); + +#ifdef __cplusplus +} +#endif +#endif /* __EXSLT_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltconfig.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltconfig.h new file mode 100644 index 0000000..890ca85 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltconfig.h @@ -0,0 +1,70 @@ +/* + * exsltconfig.h: compile-time version information for the EXSLT library + * + * See Copyright for the status of this software. + * + * daniel@veillard.com + */ + +#ifndef __XML_EXSLTCONFIG_H__ +#define __XML_EXSLTCONFIG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * LIBEXSLT_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBEXSLT_DOTTED_VERSION "1.1.34" + +/** + * LIBEXSLT_VERSION: + * + * the version number: 1.2.3 value is 10203 + */ +#define LIBEXSLT_VERSION 820 + +/** + * LIBEXSLT_VERSION_STRING: + * + * the version number string, 1.2.3 value is "10203" + */ +#define LIBEXSLT_VERSION_STRING "820" + +/** + * LIBEXSLT_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBEXSLT_VERSION_EXTRA "" + +/** + * WITH_CRYPTO: + * + * Whether crypto support is configured into exslt + */ +#if 0 +#define EXSLT_CRYPTO_ENABLED +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * This macro is used to flag unused function parameters to GCC + */ +#ifdef __GNUC__ +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif +#else +#define ATTRIBUTE_UNUSED +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_EXSLTCONFIG_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltexports.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltexports.h new file mode 100644 index 0000000..eee8222 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libexslt/exsltexports.h @@ -0,0 +1,140 @@ +/* + * exsltexports.h : macros for marking symbols as exportable/importable. + * + * See Copyright for the status of this software. + * + * igor@zlatkovic.com + */ + +#ifndef __EXSLT_EXPORTS_H__ +#define __EXSLT_EXPORTS_H__ + +/** + * EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +/** + * EXSLTPUBFUN: + * + * Macros which declare an exportable function + */ +#define EXSLTPUBFUN +/** + * EXSLTPUBVAR: + * + * Macros which declare an exportable variable + */ +#define EXSLTPUBVAR extern +/** + * EXSLTCALL: + * + * Macros which declare the called convention for exported functions + */ +#define EXSLTCALL + +/** DOC_DISABLE */ + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR extern + #endif + #endif + #define EXSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) extern + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR extern + #endif + #endif + #define EXSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with GNU compiler (Mingw) */ +#if defined(_WIN32) && defined(__MINGW32__) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL +/* + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) +*/ + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) extern + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR extern + #endif + #endif + #define EXSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Cygwin platform (does not define _WIN32), GNU compiler */ +#if defined(__CYGWIN__) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR extern + #endif + #endif + #define EXSLTCALL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBEXSLT_PUBLIC) +#define LIBEXSLT_PUBLIC EXSLTPUBVAR +#endif + +#endif /* __EXSLT_EXPORTS_H__ */ + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/DOCBparser.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/DOCBparser.h new file mode 100644 index 0000000..9394fa7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/DOCBparser.h @@ -0,0 +1,96 @@ +/* + * Summary: old DocBook SGML parser + * Description: interface for a DocBook SGML non-verifying parser + * This code is DEPRECATED, and should not be used anymore. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DOCB_PARSER_H__ +#define __DOCB_PARSER_H__ +#include + +#ifdef LIBXML_DOCB_ENABLED + +#include +#include + +#ifndef IN_LIBXML +#ifdef __GNUC__ +#warning "The DOCBparser module has been deprecated in libxml2-2.6.0" +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and SGML are shared. + */ +typedef xmlParserCtxt docbParserCtxt; +typedef xmlParserCtxtPtr docbParserCtxtPtr; +typedef xmlSAXHandler docbSAXHandler; +typedef xmlSAXHandlerPtr docbSAXHandlerPtr; +typedef xmlParserInput docbParserInput; +typedef xmlParserInputPtr docbParserInputPtr; +typedef xmlDocPtr docbDocPtr; + +/* + * There is only few public functions. + */ +XMLPUBFUN int XMLCALL + docbEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); + +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseDoc (xmlChar *cur, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseDoc (xmlChar *cur, + const char *encoding); +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseFile (const char *filename, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseFile (const char *filename, + const char *encoding); + +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN void XMLCALL + docbFreeParserCtxt (docbParserCtxtPtr ctxt); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreatePushParserCtxt(docbSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + docbParseChunk (docbParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreateFileParserCtxt(const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + docbParseDocument (docbParserCtxtPtr ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DOCB_ENABLED */ + +#endif /* __DOCB_PARSER_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLparser.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLparser.h new file mode 100644 index 0000000..1d4fec2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLparser.h @@ -0,0 +1,306 @@ +/* + * Summary: interface for an HTML 4.0 non-verifying parser + * Description: this module implements an HTML 4.0 non-verifying parser + * with API compatible with the XML parser ones. It should + * be able to parse "real world" HTML, even if severely + * broken from a specification point of view. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_PARSER_H__ +#define __HTML_PARSER_H__ +#include +#include + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and HTML are shared. + */ +typedef xmlParserCtxt htmlParserCtxt; +typedef xmlParserCtxtPtr htmlParserCtxtPtr; +typedef xmlParserNodeInfo htmlParserNodeInfo; +typedef xmlSAXHandler htmlSAXHandler; +typedef xmlSAXHandlerPtr htmlSAXHandlerPtr; +typedef xmlParserInput htmlParserInput; +typedef xmlParserInputPtr htmlParserInputPtr; +typedef xmlDocPtr htmlDocPtr; +typedef xmlNodePtr htmlNodePtr; + +/* + * Internal description of an HTML element, representing HTML 4.01 + * and XHTML 1.0 (which share the same structure). + */ +typedef struct _htmlElemDesc htmlElemDesc; +typedef htmlElemDesc *htmlElemDescPtr; +struct _htmlElemDesc { + const char *name; /* The tag name */ + char startTag; /* Whether the start tag can be implied */ + char endTag; /* Whether the end tag can be implied */ + char saveEndTag; /* Whether the end tag should be saved */ + char empty; /* Is this an empty element ? */ + char depr; /* Is this a deprecated element ? */ + char dtd; /* 1: only in Loose DTD, 2: only Frameset one */ + char isinline; /* is this a block 0 or inline 1 element */ + const char *desc; /* the description */ + +/* NRK Jan.2003 + * New fields encapsulating HTML structure + * + * Bugs: + * This is a very limited representation. It fails to tell us when + * an element *requires* subelements (we only have whether they're + * allowed or not), and it doesn't tell us where CDATA and PCDATA + * are allowed. Some element relationships are not fully represented: + * these are flagged with the word MODIFIER + */ + const char** subelts; /* allowed sub-elements of this element */ + const char* defaultsubelt; /* subelement for suggested auto-repair + if necessary or NULL */ + const char** attrs_opt; /* Optional Attributes */ + const char** attrs_depr; /* Additional deprecated attributes */ + const char** attrs_req; /* Required attributes */ +}; + +/* + * Internal description of an HTML entity. + */ +typedef struct _htmlEntityDesc htmlEntityDesc; +typedef htmlEntityDesc *htmlEntityDescPtr; +struct _htmlEntityDesc { + unsigned int value; /* the UNICODE value for the character */ + const char *name; /* The entity name */ + const char *desc; /* the description */ +}; + +/* + * There is only few public functions. + */ +XMLPUBFUN const htmlElemDesc * XMLCALL + htmlTagLookup (const xmlChar *tag); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityLookup(const xmlChar *name); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityValueLookup(unsigned int value); + +XMLPUBFUN int XMLCALL + htmlIsAutoClosed(htmlDocPtr doc, + htmlNodePtr elem); +XMLPUBFUN int XMLCALL + htmlAutoCloseTag(htmlDocPtr doc, + const xmlChar *name, + htmlNodePtr elem); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlParseEntityRef(htmlParserCtxtPtr ctxt, + const xmlChar **str); +XMLPUBFUN int XMLCALL + htmlParseCharRef(htmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + htmlParseElement(htmlParserCtxtPtr ctxt); + +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlNewParserCtxt(void); + +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreateMemoryParserCtxt(const char *buffer, + int size); + +XMLPUBFUN int XMLCALL + htmlParseDocument(htmlParserCtxtPtr ctxt); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseDoc (const xmlChar *cur, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseDoc (const xmlChar *cur, + const char *encoding); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseFile(const char *filename, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseFile (const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + UTF8ToHtml (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +XMLPUBFUN int XMLCALL + htmlEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); +XMLPUBFUN int XMLCALL + htmlIsScriptAttribute(const xmlChar *name); +XMLPUBFUN int XMLCALL + htmlHandleOmittedElem(int val); + +#ifdef LIBXML_PUSH_ENABLED +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + htmlParseChunk (htmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +XMLPUBFUN void XMLCALL + htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */ + HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */ + HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ + HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + HTML_PARSE_NONET = 1<<11,/* Forbid network access */ + HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */ + HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */ + HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */ +} htmlParserOption; + +XMLPUBFUN void XMLCALL + htmlCtxtReset (htmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + htmlCtxtUseOptions (htmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +/* NRK/Jan2003: further knowledge of HTML structure + */ +typedef enum { + HTML_NA = 0 , /* something we don't check at all */ + HTML_INVALID = 0x1 , + HTML_DEPRECATED = 0x2 , + HTML_VALID = 0x4 , + HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */ +} htmlStatus ; + +/* Using htmlElemDesc rather than name here, to emphasise the fact + that otherwise there's a lookup overhead +*/ +XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ; +XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ; +XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ; +XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ; +/** + * htmlDefaultSubelement: + * @elt: HTML element + * + * Returns the default subelement for this element + */ +#define htmlDefaultSubelement(elt) elt->defaultsubelt +/** + * htmlElementAllowedHereDesc: + * @parent: HTML parent element + * @elt: HTML element + * + * Checks whether an HTML element description may be a + * direct child of the specified element. + * + * Returns 1 if allowed; 0 otherwise. + */ +#define htmlElementAllowedHereDesc(parent,elt) \ + htmlElementAllowedHere((parent), (elt)->name) +/** + * htmlRequiredAttrs: + * @elt: HTML element + * + * Returns the attributes required for the specified element. + */ +#define htmlRequiredAttrs(elt) (elt)->attrs_req + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ +#endif /* __HTML_PARSER_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLtree.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLtree.h new file mode 100644 index 0000000..c0e1103 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/HTMLtree.h @@ -0,0 +1,147 @@ +/* + * Summary: specific APIs to process HTML tree, especially serialization + * Description: this module implements a few function needed to process + * tree in an HTML specific way. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_TREE_H__ +#define __HTML_TREE_H__ + +#include +#include +#include +#include + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * HTML_TEXT_NODE: + * + * Macro. A text node in a HTML document is really implemented + * the same way as a text node in an XML document. + */ +#define HTML_TEXT_NODE XML_TEXT_NODE +/** + * HTML_ENTITY_REF_NODE: + * + * Macro. An entity reference in a HTML document is really implemented + * the same way as an entity reference in an XML document. + */ +#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE +/** + * HTML_COMMENT_NODE: + * + * Macro. A comment in a HTML document is really implemented + * the same way as a comment in an XML document. + */ +#define HTML_COMMENT_NODE XML_COMMENT_NODE +/** + * HTML_PRESERVE_NODE: + * + * Macro. A preserved node in a HTML document is really implemented + * the same way as a CDATA section in an XML document. + */ +#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE +/** + * HTML_PI_NODE: + * + * Macro. A processing instruction in a HTML document is really implemented + * the same way as a processing instruction in an XML document. + */ +#define HTML_PI_NODE XML_PI_NODE + +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDoc (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDocNoDtD (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN const xmlChar * XMLCALL + htmlGetMetaEncoding (htmlDocPtr doc); +XMLPUBFUN int XMLCALL + htmlSetMetaEncoding (htmlDocPtr doc, + const xmlChar *encoding); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + htmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN void XMLCALL + htmlDocDumpMemoryFormat (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); +XMLPUBFUN int XMLCALL + htmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN void XMLCALL + htmlNodeDumpFile (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDumpFileFormat (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN int XMLCALL + htmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + htmlSaveFileFormat (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN void XMLCALL + htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlDocContentDumpOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN void XMLCALL + htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN int XMLCALL + htmlIsBooleanAttr (const xmlChar *name); + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ + +#endif /* __HTML_TREE_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX.h new file mode 100644 index 0000000..20093ce --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX.h @@ -0,0 +1,173 @@ +/* + * Summary: Old SAX version 1 handler, deprecated + * Description: DEPRECATED set of SAX version 1 interfaces used to + * build the DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX_H__ +#define __XML_SAX_H__ + +#include +#include +#include +#include +#include + +#ifdef LIBXML_LEGACY_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + getPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + getSystemId (void *ctx); +XMLPUBFUN void XMLCALL + setDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + getLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + getColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + isStandalone (void *ctx); +XMLPUBFUN int XMLCALL + hasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + hasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + internalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + externalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + getEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + getParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + resolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + entityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + attributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + elementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + notationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + unparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + startDocument (void *ctx); +XMLPUBFUN void XMLCALL + endDocument (void *ctx); +XMLPUBFUN void XMLCALL + attribute (void *ctx, + const xmlChar *fullname, + const xmlChar *value); +XMLPUBFUN void XMLCALL + startElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + endElement (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + ignorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + processingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + globalNamespace (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + setNamespace (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlNsPtr XMLCALL + getNamespace (void *ctx); +XMLPUBFUN int XMLCALL + checkNamespace (void *ctx, + xmlChar *nameSpace); +XMLPUBFUN void XMLCALL + namespaceDecl (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + cdataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_LEGACY_ENABLED */ + +#endif /* __XML_SAX_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX2.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX2.h new file mode 100644 index 0000000..a55212e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/SAX2.h @@ -0,0 +1,178 @@ +/* + * Summary: SAX2 parser interface used to build the DOM tree + * Description: those are the default SAX2 interfaces used by + * the library when building DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX2_H__ +#define __XML_SAX2_H__ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetSystemId (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2SetDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + xmlSAX2GetLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2GetColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + xmlSAX2IsStandalone (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + xmlSAX2InternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + xmlSAX2ExternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlSAX2ResolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + xmlSAX2EntityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + xmlSAX2AttributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + xmlSAX2ElementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlSAX2NotationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + xmlSAX2UnparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + xmlSAX2StartDocument (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2EndDocument (void *ctx); +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || \ + defined(LIBXML_LEGACY_ENABLED) +XMLPUBFUN void XMLCALL + xmlSAX2StartElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + xmlSAX2EndElement (void *ctx, + const xmlChar *name); +#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */ +XMLPUBFUN void XMLCALL + xmlSAX2StartElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); +XMLPUBFUN void XMLCALL + xmlSAX2EndElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); +XMLPUBFUN void XMLCALL + xmlSAX2Reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSAX2Characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2IgnorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2ProcessingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + xmlSAX2Comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlSAX2CDataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXDefaultVersion (int version); +#endif /* LIBXML_SAX1_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlSAXVersion (xmlSAXHandler *hdlr, + int version); +XMLPUBFUN void XMLCALL + xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + htmlDefaultSAXHandlerInit (void); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + docbDefaultSAXHandlerInit (void); +#endif +XMLPUBFUN void XMLCALL + xmlDefaultSAXHandlerInit (void); +#ifdef __cplusplus +} +#endif +#endif /* __XML_SAX2_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/c14n.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/c14n.h new file mode 100644 index 0000000..af93de6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/c14n.h @@ -0,0 +1,128 @@ +/* + * Summary: Provide Canonical XML and Exclusive XML Canonicalization + * Description: the c14n modules provides a + * + * "Canonical XML" implementation + * http://www.w3.org/TR/xml-c14n + * + * and an + * + * "Exclusive XML Canonicalization" implementation + * http://www.w3.org/TR/xml-exc-c14n + + * Copy: See Copyright for the status of this software. + * + * Author: Aleksey Sanin + */ +#ifndef __XML_C14N_H__ +#define __XML_C14N_H__ + +#include + +#ifdef LIBXML_C14N_ENABLED +#ifdef LIBXML_OUTPUT_ENABLED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * XML Canonicalization + * http://www.w3.org/TR/xml-c14n + * + * Exclusive XML Canonicalization + * http://www.w3.org/TR/xml-exc-c14n + * + * Canonical form of an XML document could be created if and only if + * a) default attributes (if any) are added to all nodes + * b) all character and parsed entity references are resolved + * In order to achieve this in libxml2 the document MUST be loaded with + * following global settings: + * + * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * xmlSubstituteEntitiesDefault(1); + * + * or corresponding parser context setting: + * xmlParserCtxtPtr ctxt; + * + * ... + * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * ctxt->replaceEntities = 1; + * ... + */ + +/* + * xmlC14NMode: + * + * Predefined values for C14N modes + * + */ +typedef enum { + XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */ + XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */ + XML_C14N_1_1 = 2 /* C14N 1.1 spec */ +} xmlC14NMode; + +XMLPUBFUN int XMLCALL + xmlC14NDocSaveTo (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int mode, /* a xmlC14NMode */ + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +XMLPUBFUN int XMLCALL + xmlC14NDocDumpMemory (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int mode, /* a xmlC14NMode */ + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlChar **doc_txt_ptr); + +XMLPUBFUN int XMLCALL + xmlC14NDocSave (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int mode, /* a xmlC14NMode */ + xmlChar **inclusive_ns_prefixes, + int with_comments, + const char* filename, + int compression); + + +/** + * This is the core C14N function + */ +/** + * xmlC14NIsVisibleCallback: + * @user_data: user data + * @node: the current node + * @parent: the parent node + * + * Signature for a C14N callback on visible nodes + * + * Returns 1 if the node should be included + */ +typedef int (*xmlC14NIsVisibleCallback) (void* user_data, + xmlNodePtr node, + xmlNodePtr parent); + +XMLPUBFUN int XMLCALL + xmlC14NExecute (xmlDocPtr doc, + xmlC14NIsVisibleCallback is_visible_callback, + void* user_data, + int mode, /* a xmlC14NMode */ + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* LIBXML_C14N_ENABLED */ +#endif /* __XML_C14N_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/catalog.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/catalog.h new file mode 100644 index 0000000..26b178d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/catalog.h @@ -0,0 +1,182 @@ +/** + * Summary: interfaces to the Catalog handling system + * Description: the catalog module implements the support for + * XML Catalogs and SGML catalogs + * + * SGML Open Technical Resolution TR9401:1997. + * http://www.jclark.com/sp/catalog.htm + * + * XML Catalogs Working Draft 06 August 2001 + * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CATALOG_H__ +#define __XML_CATALOG_H__ + +#include + +#include +#include +#include + +#ifdef LIBXML_CATALOG_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_CATALOGS_NAMESPACE: + * + * The namespace for the XML Catalogs elements. + */ +#define XML_CATALOGS_NAMESPACE \ + (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" +/** + * XML_CATALOG_PI: + * + * The specific XML Catalog Processing Instruction name. + */ +#define XML_CATALOG_PI \ + (const xmlChar *) "oasis-xml-catalog" + +/* + * The API is voluntarily limited to general cataloging. + */ +typedef enum { + XML_CATA_PREFER_NONE = 0, + XML_CATA_PREFER_PUBLIC = 1, + XML_CATA_PREFER_SYSTEM +} xmlCatalogPrefer; + +typedef enum { + XML_CATA_ALLOW_NONE = 0, + XML_CATA_ALLOW_GLOBAL = 1, + XML_CATA_ALLOW_DOCUMENT = 2, + XML_CATA_ALLOW_ALL = 3 +} xmlCatalogAllow; + +typedef struct _xmlCatalog xmlCatalog; +typedef xmlCatalog *xmlCatalogPtr; + +/* + * Operations on a given catalog. + */ +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlNewCatalog (int sgml); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadACatalog (const char *filename); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadSGMLSuperCatalog (const char *filename); +XMLPUBFUN int XMLCALL + xmlConvertSGMLCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlACatalogAdd (xmlCatalogPtr catal, + const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlACatalogRemove (xmlCatalogPtr catal, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolve (xmlCatalogPtr catal, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveSystem(xmlCatalogPtr catal, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolvePublic(xmlCatalogPtr catal, + const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveURI (xmlCatalogPtr catal, + const xmlChar *URI); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlACatalogDump (xmlCatalogPtr catal, + FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlCatalogIsEmpty (xmlCatalogPtr catal); + +/* + * Global operations. + */ +XMLPUBFUN void XMLCALL + xmlInitializeCatalog (void); +XMLPUBFUN int XMLCALL + xmlLoadCatalog (const char *filename); +XMLPUBFUN void XMLCALL + xmlLoadCatalogs (const char *paths); +XMLPUBFUN void XMLCALL + xmlCatalogCleanup (void); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlCatalogDump (FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolve (const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveSystem (const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolvePublic (const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveURI (const xmlChar *URI); +XMLPUBFUN int XMLCALL + xmlCatalogAdd (const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlCatalogRemove (const xmlChar *value); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseCatalogFile (const char *filename); +XMLPUBFUN int XMLCALL + xmlCatalogConvert (void); + +/* + * Strictly minimal interfaces for per-document catalogs used + * by the parser. + */ +XMLPUBFUN void XMLCALL + xmlCatalogFreeLocal (void *catalogs); +XMLPUBFUN void * XMLCALL + xmlCatalogAddLocal (void *catalogs, + const xmlChar *URL); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolve (void *catalogs, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolveURI(void *catalogs, + const xmlChar *URI); +/* + * Preference settings. + */ +XMLPUBFUN int XMLCALL + xmlCatalogSetDebug (int level); +XMLPUBFUN xmlCatalogPrefer XMLCALL + xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); +XMLPUBFUN void XMLCALL + xmlCatalogSetDefaults (xmlCatalogAllow allow); +XMLPUBFUN xmlCatalogAllow XMLCALL + xmlCatalogGetDefaults (void); + + +/* DEPRECATED interfaces */ +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetSystem (const xmlChar *sysID); +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetPublic (const xmlChar *pubID); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_CATALOG_ENABLED */ +#endif /* __XML_CATALOG_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/chvalid.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/chvalid.h new file mode 100644 index 0000000..fb43016 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/chvalid.h @@ -0,0 +1,230 @@ +/* + * Summary: Unicode character range checking + * Description: this module exports interfaces for the character + * range validation APIs + * + * This file is automatically generated from the cvs source + * definition files using the genChRanges.py Python script + * + * Generation date: Mon Mar 27 11:09:48 2006 + * Sources: chvalid.def + * Author: William Brack + */ + +#ifndef __XML_CHVALID_H__ +#define __XML_CHVALID_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Define our typedefs and structures + * + */ +typedef struct _xmlChSRange xmlChSRange; +typedef xmlChSRange *xmlChSRangePtr; +struct _xmlChSRange { + unsigned short low; + unsigned short high; +}; + +typedef struct _xmlChLRange xmlChLRange; +typedef xmlChLRange *xmlChLRangePtr; +struct _xmlChLRange { + unsigned int low; + unsigned int high; +}; + +typedef struct _xmlChRangeGroup xmlChRangeGroup; +typedef xmlChRangeGroup *xmlChRangeGroupPtr; +struct _xmlChRangeGroup { + int nbShortRange; + int nbLongRange; + const xmlChSRange *shortRange; /* points to an array of ranges */ + const xmlChLRange *longRange; +}; + +/** + * Range checking routine + */ +XMLPUBFUN int XMLCALL + xmlCharInRange(unsigned int val, const xmlChRangeGroup *group); + + +/** + * xmlIsBaseChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a)) || \ + ((0xc0 <= (c)) && ((c) <= 0xd6)) || \ + ((0xd8 <= (c)) && ((c) <= 0xf6)) || \ + (0xf8 <= (c))) + +/** + * xmlIsBaseCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \ + xmlIsBaseChar_ch((c)) : \ + xmlCharInRange((c), &xmlIsBaseCharGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup; + +/** + * xmlIsBlank_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlank_ch(c) (((c) == 0x20) || \ + ((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd)) + +/** + * xmlIsBlankQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlankQ(c) (((c) < 0x100) ? \ + xmlIsBlank_ch((c)) : 0) + + +/** + * xmlIsChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd) || \ + (0x20 <= (c))) + +/** + * xmlIsCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCharQ(c) (((c) < 0x100) ? \ + xmlIsChar_ch((c)) :\ + (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \ + ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \ + ((0x10000 <= (c)) && ((c) <= 0x10ffff)))) + +XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup; + +/** + * xmlIsCombiningQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCombiningQ(c) (((c) < 0x100) ? \ + 0 : \ + xmlCharInRange((c), &xmlIsCombiningGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup; + +/** + * xmlIsDigit_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39))) + +/** + * xmlIsDigitQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigitQ(c) (((c) < 0x100) ? \ + xmlIsDigit_ch((c)) : \ + xmlCharInRange((c), &xmlIsDigitGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup; + +/** + * xmlIsExtender_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtender_ch(c) (((c) == 0xb7)) + +/** + * xmlIsExtenderQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtenderQ(c) (((c) < 0x100) ? \ + xmlIsExtender_ch((c)) : \ + xmlCharInRange((c), &xmlIsExtenderGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup; + +/** + * xmlIsIdeographicQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \ + 0 :\ + (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \ + ((c) == 0x3007) || \ + ((0x3021 <= (c)) && ((c) <= 0x3029)))) + +XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup; +XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256]; + +/** + * xmlIsPubidChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)]) + +/** + * xmlIsPubidCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \ + xmlIsPubidChar_ch((c)) : 0) + +XMLPUBFUN int XMLCALL + xmlIsBaseChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsBlank(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsCombining(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsDigit(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsExtender(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsIdeographic(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsPubidChar(unsigned int ch); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_CHVALID_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/debugXML.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/debugXML.h new file mode 100644 index 0000000..5b3be13 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/debugXML.h @@ -0,0 +1,217 @@ +/* + * Summary: Tree debugging APIs + * Description: Interfaces to a set of routines used for debugging the tree + * produced by the XML parser. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DEBUG_XML__ +#define __DEBUG_XML__ +#include +#include +#include + +#ifdef LIBXML_DEBUG_ENABLED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The standard Dump routines. + */ +XMLPUBFUN void XMLCALL + xmlDebugDumpString (FILE *output, + const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttr (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttrList (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpOneNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNodeList (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocumentHead(FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocument (FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDTD (FILE *output, + xmlDtdPtr dtd); +XMLPUBFUN void XMLCALL + xmlDebugDumpEntities (FILE *output, + xmlDocPtr doc); + +/**************************************************************** + * * + * Checking routines * + * * + ****************************************************************/ + +XMLPUBFUN int XMLCALL + xmlDebugCheckDocument (FILE * output, + xmlDocPtr doc); + +/**************************************************************** + * * + * XML shell helpers * + * * + ****************************************************************/ + +XMLPUBFUN void XMLCALL + xmlLsOneNode (FILE *output, xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlLsCountNode (xmlNodePtr node); + +XMLPUBFUN const char * XMLCALL + xmlBoolToText (int boolval); + +/**************************************************************** + * * + * The XML shell related structures and functions * + * * + ****************************************************************/ + +#ifdef LIBXML_XPATH_ENABLED +/** + * xmlShellReadlineFunc: + * @prompt: a string prompt + * + * This is a generic signature for the XML shell input function. + * + * Returns a string which will be freed by the Shell. + */ +typedef char * (* xmlShellReadlineFunc)(char *prompt); + +/** + * xmlShellCtxt: + * + * A debugging shell context. + * TODO: add the defined function tables. + */ +typedef struct _xmlShellCtxt xmlShellCtxt; +typedef xmlShellCtxt *xmlShellCtxtPtr; +struct _xmlShellCtxt { + char *filename; + xmlDocPtr doc; + xmlNodePtr node; + xmlXPathContextPtr pctxt; + int loaded; + FILE *output; + xmlShellReadlineFunc input; +}; + +/** + * xmlShellCmd: + * @ctxt: a shell context + * @arg: a string argument + * @node: a first node + * @node2: a second node + * + * This is a generic signature for the XML shell functions. + * + * Returns an int, negative returns indicating errors. + */ +typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); + +XMLPUBFUN void XMLCALL + xmlShellPrintXPathError (int errorType, + const char *arg); +XMLPUBFUN void XMLCALL + xmlShellPrintXPathResult(xmlXPathObjectPtr list); +XMLPUBFUN int XMLCALL + xmlShellList (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellBase (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellDir (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellLoad (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlShellPrintNode (xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlShellCat (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellWrite (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellSave (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN int XMLCALL + xmlShellValidate (xmlShellCtxtPtr ctxt, + char *dtd, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_VALID_ENABLED */ +XMLPUBFUN int XMLCALL + xmlShellDu (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr tree, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellPwd (xmlShellCtxtPtr ctxt, + char *buffer, + xmlNodePtr node, + xmlNodePtr node2); + +/* + * The Shell interface. + */ +XMLPUBFUN void XMLCALL + xmlShell (xmlDocPtr doc, + char *filename, + xmlShellReadlineFunc input, + FILE *output); + +#endif /* LIBXML_XPATH_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DEBUG_ENABLED */ +#endif /* __DEBUG_XML__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/dict.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/dict.h new file mode 100644 index 0000000..cf54af1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/dict.h @@ -0,0 +1,79 @@ +/* + * Summary: string dictionary + * Description: dictionary of reusable strings, just used to avoid allocation + * and freeing operations. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_DICT_H__ +#define __XML_DICT_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The dictionary. + */ +typedef struct _xmlDict xmlDict; +typedef xmlDict *xmlDictPtr; + +/* + * Initializer + */ +XMLPUBFUN int XMLCALL xmlInitializeDict(void); + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreate (void); +XMLPUBFUN size_t XMLCALL + xmlDictSetLimit (xmlDictPtr dict, + size_t limit); +XMLPUBFUN size_t XMLCALL + xmlDictGetUsage (xmlDictPtr dict); +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreateSub(xmlDictPtr sub); +XMLPUBFUN int XMLCALL + xmlDictReference(xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlDictFree (xmlDictPtr dict); + +/* + * Lookup of entry in the dictionary. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlDictLookup (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictExists (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictQLookup (xmlDictPtr dict, + const xmlChar *prefix, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlDictOwns (xmlDictPtr dict, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlDictSize (xmlDictPtr dict); + +/* + * Cleanup function + */ +XMLPUBFUN void XMLCALL + xmlDictCleanup (void); + +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_DICT_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/encoding.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/encoding.h new file mode 100644 index 0000000..c875af6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/encoding.h @@ -0,0 +1,245 @@ +/* + * Summary: interface for the encoding conversion functions + * Description: interface for the encoding conversion functions needed for + * XML basic encoding and iconv() support. + * + * Related specs are + * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies + * [ISO-10646] UTF-8 and UTF-16 in Annexes + * [ISO-8859-1] ISO Latin-1 characters codes. + * [UNICODE] The Unicode Consortium, "The Unicode Standard -- + * Worldwide Character Encoding -- Version 1.0", Addison- + * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is + * described in Unicode Technical Report #4. + * [US-ASCII] Coded Character Set--7-bit American Standard Code for + * Information Interchange, ANSI X3.4-1986. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CHAR_ENCODING_H__ +#define __XML_CHAR_ENCODING_H__ + +#include + +#ifdef LIBXML_ICONV_ENABLED +#include +#endif +#ifdef LIBXML_ICU_ENABLED +#include +#endif +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlCharEncoding: + * + * Predefined values for some standard encodings. + * Libxml does not do beforehand translation on UTF8 and ISOLatinX. + * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default. + * + * Anything else would have to be translated to UTF8 before being + * given to the parser itself. The BOM for UTF16 and the encoding + * declaration are looked at and a converter is looked for at that + * point. If not found the parser stops here as asked by the XML REC. A + * converter can be registered by the user using xmlRegisterCharEncodingHandler + * but the current form doesn't allow stateful transcoding (a serious + * problem agreed !). If iconv has been found it will be used + * automatically and allow stateful transcoding, the simplest is then + * to be sure to enable iconv and to provide iconv libs for the encoding + * support needed. + * + * Note that the generic "UTF-16" is not a predefined value. Instead, only + * the specific UTF-16LE and UTF-16BE are present. + */ +typedef enum { + XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */ + XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */ + XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */ + XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */ + XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */ + XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */ + XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */ + XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */ + XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */ + XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */ + XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */ + XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */ + XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */ + XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */ + XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */ + XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */ + XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */ + XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */ + XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */ + XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */ + XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */ + XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */ +} xmlCharEncoding; + +/** + * xmlCharEncodingInputFunc: + * @out: a pointer to an array of bytes to store the UTF-8 result + * @outlen: the length of @out + * @in: a pointer to an array of chars in the original encoding + * @inlen: the length of @in + * + * Take a block of chars in the original encoding and try to convert + * it to an UTF-8 block of chars out. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets consumed. + */ +typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/** + * xmlCharEncodingOutputFunc: + * @out: a pointer to an array of bytes to store the result + * @outlen: the length of @out + * @in: a pointer to an array of UTF-8 chars + * @inlen: the length of @in + * + * Take a block of UTF-8 chars in and try to convert it to another + * encoding. + * Note: a first call designed to produce heading info is called with + * in = NULL. If stateful this should also initialize the encoder state. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets produced. + */ +typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/* + * Block defining the handlers for non UTF-8 encodings. + * If iconv is supported, there are two extra fields. + */ +#ifdef LIBXML_ICU_ENABLED +/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ +#define ICU_PIVOT_BUF_SIZE 1024 +struct _uconv_t { + UConverter *uconv; /* for conversion between an encoding and UTF-16 */ + UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ + UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; + UChar *pivot_source; + UChar *pivot_target; +}; +typedef struct _uconv_t uconv_t; +#endif + +typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; +typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; +struct _xmlCharEncodingHandler { + char *name; + xmlCharEncodingInputFunc input; + xmlCharEncodingOutputFunc output; +#ifdef LIBXML_ICONV_ENABLED + iconv_t iconv_in; + iconv_t iconv_out; +#endif /* LIBXML_ICONV_ENABLED */ +#ifdef LIBXML_ICU_ENABLED + uconv_t *uconv_in; + uconv_t *uconv_out; +#endif /* LIBXML_ICU_ENABLED */ +}; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Interfaces for encoding handlers. + */ +XMLPUBFUN void XMLCALL + xmlInitCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlCleanupCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlGetCharEncodingHandler (xmlCharEncoding enc); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlFindCharEncodingHandler (const char *name); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlNewCharEncodingHandler (const char *name, + xmlCharEncodingInputFunc input, + xmlCharEncodingOutputFunc output); + +/* + * Interfaces for encoding names and aliases. + */ +XMLPUBFUN int XMLCALL + xmlAddEncodingAlias (const char *name, + const char *alias); +XMLPUBFUN int XMLCALL + xmlDelEncodingAlias (const char *alias); +XMLPUBFUN const char * XMLCALL + xmlGetEncodingAlias (const char *alias); +XMLPUBFUN void XMLCALL + xmlCleanupEncodingAliases (void); +XMLPUBFUN xmlCharEncoding XMLCALL + xmlParseCharEncoding (const char *name); +XMLPUBFUN const char * XMLCALL + xmlGetCharEncodingName (xmlCharEncoding enc); + +/* + * Interfaces directly used by the parsers. + */ +XMLPUBFUN xmlCharEncoding XMLCALL + xmlDetectCharEncoding (const unsigned char *in, + int len); + +XMLPUBFUN int XMLCALL + xmlCharEncOutFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); + +XMLPUBFUN int XMLCALL + xmlCharEncInFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncFirstLine (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); + +/* + * Export a few useful functions + */ +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + UTF8Toisolat1 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + isolat1ToUTF8 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_CHAR_ENCODING_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/entities.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/entities.h new file mode 100644 index 0000000..47b4573 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/entities.h @@ -0,0 +1,151 @@ +/* + * Summary: interface for the XML entities handling + * Description: this module provides some of the entity API needed + * for the parser and applications. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_ENTITIES_H__ +#define __XML_ENTITIES_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The different valid entity types. + */ +typedef enum { + XML_INTERNAL_GENERAL_ENTITY = 1, + XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2, + XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3, + XML_INTERNAL_PARAMETER_ENTITY = 4, + XML_EXTERNAL_PARAMETER_ENTITY = 5, + XML_INTERNAL_PREDEFINED_ENTITY = 6 +} xmlEntityType; + +/* + * An unit of storage for an entity, contains the string, the value + * and the linkind data needed for the linking in the hash table. + */ + +struct _xmlEntity { + void *_private; /* application data */ + xmlElementType type; /* XML_ENTITY_DECL, must be second ! */ + const xmlChar *name; /* Entity name */ + struct _xmlNode *children; /* First child link */ + struct _xmlNode *last; /* Last child link */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlChar *orig; /* content without ref substitution */ + xmlChar *content; /* content or ndata if unparsed */ + int length; /* the content length */ + xmlEntityType etype; /* The entity type */ + const xmlChar *ExternalID; /* External identifier for PUBLIC */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ + + struct _xmlEntity *nexte; /* unused */ + const xmlChar *URI; /* the full URI as computed */ + int owner; /* does the entity own the childrens */ + int checked; /* was the entity content checked */ + /* this is also used to count entities + * references done from that entity + * and if it contains '<' */ +}; + +/* + * All entities are stored in an hash table. + * There is 2 separate hash tables for global and parameter entities. + */ + +typedef struct _xmlHashTable xmlEntitiesTable; +typedef xmlEntitiesTable *xmlEntitiesTablePtr; + +/* + * External functions: + */ + +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlInitializePredefinedEntities (void); +#endif /* LIBXML_LEGACY_ENABLED */ + +XMLPUBFUN xmlEntityPtr XMLCALL + xmlNewEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDocEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDtdEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetPredefinedEntity (const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDocEntity (const xmlDoc *doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDtdEntity (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetParameterEntity (xmlDocPtr doc, + const xmlChar *name); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlEncodeEntities (xmlDocPtr doc, + const xmlChar *input); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeEntitiesReentrant(xmlDocPtr doc, + const xmlChar *input); +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeSpecialChars (const xmlDoc *doc, + const xmlChar *input); +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCreateEntitiesTable (void); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCopyEntitiesTable (xmlEntitiesTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeEntitiesTable (xmlEntitiesTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpEntitiesTable (xmlBufferPtr buf, + xmlEntitiesTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpEntityDecl (xmlBufferPtr buf, + xmlEntityPtr ent); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlCleanupPredefinedEntities(void); +#endif /* LIBXML_LEGACY_ENABLED */ + + +#ifdef __cplusplus +} +#endif + +# endif /* __XML_ENTITIES_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/globals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/globals.h new file mode 100644 index 0000000..5e41b7b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/globals.h @@ -0,0 +1,508 @@ +/* + * Summary: interface for all global variables of the library + * Description: all the global variables and thread handling for + * those variables is handled by this module. + * + * The bottom of this file is automatically generated by build_glob.py + * based on the description file global.data + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington , Daniel Veillard + */ + +#ifndef __XML_GLOBALS_H +#define __XML_GLOBALS_H + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitGlobals(void); +XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); + +/** + * xmlParserInputBufferCreateFilenameFunc: + * @URI: the URI to read from + * @enc: the requested source encoding + * + * Signature for the function doing the lookup for a suitable input method + * corresponding to an URI. + * + * Returns the new xmlParserInputBufferPtr in case of success or NULL if no + * method was found. + */ +typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, + xmlCharEncoding enc); + + +/** + * xmlOutputBufferCreateFilenameFunc: + * @URI: the URI to write to + * @enc: the requested target encoding + * + * Signature for the function doing the lookup for a suitable output method + * corresponding to an URI. + * + * Returns the new xmlOutputBufferPtr in case of success or NULL if no + * method was found. + */ +typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc +XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); +XMLPUBFUN xmlOutputBufferCreateFilenameFunc +XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); + +/* + * Externally global symbols which need to be protected for backwards + * compatibility support. + */ + +#undef docbDefaultSAXHandler +#undef htmlDefaultSAXHandler +#undef oldXMLWDcompatibility +#undef xmlBufferAllocScheme +#undef xmlDefaultBufferSize +#undef xmlDefaultSAXHandler +#undef xmlDefaultSAXLocator +#undef xmlDoValidityCheckingDefaultValue +#undef xmlFree +#undef xmlGenericError +#undef xmlStructuredError +#undef xmlGenericErrorContext +#undef xmlStructuredErrorContext +#undef xmlGetWarningsDefaultValue +#undef xmlIndentTreeOutput +#undef xmlTreeIndentString +#undef xmlKeepBlanksDefaultValue +#undef xmlLineNumbersDefaultValue +#undef xmlLoadExtDtdDefaultValue +#undef xmlMalloc +#undef xmlMallocAtomic +#undef xmlMemStrdup +#undef xmlParserDebugEntities +#undef xmlParserVersion +#undef xmlPedanticParserDefaultValue +#undef xmlRealloc +#undef xmlSaveNoEmptyTags +#undef xmlSubstituteEntitiesDefaultValue +#undef xmlRegisterNodeDefaultValue +#undef xmlDeregisterNodeDefaultValue +#undef xmlLastError +#undef xmlParserInputBufferCreateFilenameValue +#undef xmlOutputBufferCreateFilenameValue + +/** + * xmlRegisterNodeFunc: + * @node: the current node + * + * Signature for the registration callback of a created node + */ +typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node); +/** + * xmlDeregisterNodeFunc: + * @node: the current node + * + * Signature for the deregistration callback of a discarded node + */ +typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node); + +typedef struct _xmlGlobalState xmlGlobalState; +typedef xmlGlobalState *xmlGlobalStatePtr; +struct _xmlGlobalState +{ + const char *xmlParserVersion; + + xmlSAXLocator xmlDefaultSAXLocator; + xmlSAXHandlerV1 xmlDefaultSAXHandler; + xmlSAXHandlerV1 docbDefaultSAXHandler; + xmlSAXHandlerV1 htmlDefaultSAXHandler; + + xmlFreeFunc xmlFree; + xmlMallocFunc xmlMalloc; + xmlStrdupFunc xmlMemStrdup; + xmlReallocFunc xmlRealloc; + + xmlGenericErrorFunc xmlGenericError; + xmlStructuredErrorFunc xmlStructuredError; + void *xmlGenericErrorContext; + + int oldXMLWDcompatibility; + + xmlBufferAllocationScheme xmlBufferAllocScheme; + int xmlDefaultBufferSize; + + int xmlSubstituteEntitiesDefaultValue; + int xmlDoValidityCheckingDefaultValue; + int xmlGetWarningsDefaultValue; + int xmlKeepBlanksDefaultValue; + int xmlLineNumbersDefaultValue; + int xmlLoadExtDtdDefaultValue; + int xmlParserDebugEntities; + int xmlPedanticParserDefaultValue; + + int xmlSaveNoEmptyTags; + int xmlIndentTreeOutput; + const char *xmlTreeIndentString; + + xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; + xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; + + xmlMallocFunc xmlMallocAtomic; + xmlError xmlLastError; + + xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; + xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; + + void *xmlStructuredErrorContext; +}; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs); + +XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); + +XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler); + +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL + xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL + xmlThrDefParserInputBufferCreateFilenameDefault( + xmlParserInputBufferCreateFilenameFunc func); + +/** DOC_DISABLE */ +/* + * In general the memory allocation entry points are not kept + * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED + * - xmlMalloc + * - xmlMallocAtomic + * - xmlRealloc + * - xmlMemStrdup + * - xmlFree + */ + +#ifdef LIBXML_THREAD_ALLOC_ENABLED +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void); +#define xmlMalloc \ +(*(__xmlMalloc())) +#else +XMLPUBVAR xmlMallocFunc xmlMalloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void); +#define xmlMallocAtomic \ +(*(__xmlMallocAtomic())) +#else +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void); +#define xmlRealloc \ +(*(__xmlRealloc())) +#else +XMLPUBVAR xmlReallocFunc xmlRealloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void); +#define xmlFree \ +(*(__xmlFree())) +#else +XMLPUBVAR xmlFreeFunc xmlFree; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void); +#define xmlMemStrdup \ +(*(__xmlMemStrdup())) +#else +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif + +#else /* !LIBXML_THREAD_ALLOC_ENABLED */ +XMLPUBVAR xmlMallocFunc xmlMalloc; +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +XMLPUBVAR xmlReallocFunc xmlRealloc; +XMLPUBVAR xmlFreeFunc xmlFree; +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif /* LIBXML_THREAD_ALLOC_ENABLED */ + +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define docbDefaultSAXHandler \ +(*(__docbDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler; +#endif +#endif + +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define htmlDefaultSAXHandler \ +(*(__htmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler; +#endif +#endif + +XMLPUBFUN xmlError * XMLCALL __xmlLastError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLastError \ +(*(__xmlLastError())) +#else +XMLPUBVAR xmlError xmlLastError; +#endif + +/* + * Everything starting from the line below is + * Automatically generated by build_glob.py. + * Do not modify the previous line. + */ + + +XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void); +#ifdef LIBXML_THREAD_ENABLED +#define oldXMLWDcompatibility \ +(*(__oldXMLWDcompatibility())) +#else +XMLPUBVAR int oldXMLWDcompatibility; +#endif + +XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlBufferAllocScheme \ +(*(__xmlBufferAllocScheme())) +#else +XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme; +#endif +XMLPUBFUN xmlBufferAllocationScheme XMLCALL + xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v); + +XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultBufferSize \ +(*(__xmlDefaultBufferSize())) +#else +XMLPUBVAR int xmlDefaultBufferSize; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v); + +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXHandler \ +(*(__xmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler; +#endif + +XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXLocator \ +(*(__xmlDefaultSAXLocator())) +#else +XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator; +#endif + +XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDoValidityCheckingDefaultValue \ +(*(__xmlDoValidityCheckingDefaultValue())) +#else +XMLPUBVAR int xmlDoValidityCheckingDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v); + +XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericError \ +(*(__xmlGenericError())) +#else +XMLPUBVAR xmlGenericErrorFunc xmlGenericError; +#endif + +XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlStructuredError \ +(*(__xmlStructuredError())) +#else +XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError; +#endif + +XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericErrorContext \ +(*(__xmlGenericErrorContext())) +#else +XMLPUBVAR void * xmlGenericErrorContext; +#endif + +XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlStructuredErrorContext \ +(*(__xmlStructuredErrorContext())) +#else +XMLPUBVAR void * xmlStructuredErrorContext; +#endif + +XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGetWarningsDefaultValue \ +(*(__xmlGetWarningsDefaultValue())) +#else +XMLPUBVAR int xmlGetWarningsDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlIndentTreeOutput \ +(*(__xmlIndentTreeOutput())) +#else +XMLPUBVAR int xmlIndentTreeOutput; +#endif +XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v); + +XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlTreeIndentString \ +(*(__xmlTreeIndentString())) +#else +XMLPUBVAR const char * xmlTreeIndentString; +#endif +XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v); + +XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlKeepBlanksDefaultValue \ +(*(__xmlKeepBlanksDefaultValue())) +#else +XMLPUBVAR int xmlKeepBlanksDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLineNumbersDefaultValue \ +(*(__xmlLineNumbersDefaultValue())) +#else +XMLPUBVAR int xmlLineNumbersDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLoadExtDtdDefaultValue \ +(*(__xmlLoadExtDtdDefaultValue())) +#else +XMLPUBVAR int xmlLoadExtDtdDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserDebugEntities \ +(*(__xmlParserDebugEntities())) +#else +XMLPUBVAR int xmlParserDebugEntities; +#endif +XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v); + +XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserVersion \ +(*(__xmlParserVersion())) +#else +XMLPUBVAR const char * xmlParserVersion; +#endif + +XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlPedanticParserDefaultValue \ +(*(__xmlPedanticParserDefaultValue())) +#else +XMLPUBVAR int xmlPedanticParserDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSaveNoEmptyTags \ +(*(__xmlSaveNoEmptyTags())) +#else +XMLPUBVAR int xmlSaveNoEmptyTags; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v); + +XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSubstituteEntitiesDefaultValue \ +(*(__xmlSubstituteEntitiesDefaultValue())) +#else +XMLPUBVAR int xmlSubstituteEntitiesDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v); + +XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlRegisterNodeDefaultValue \ +(*(__xmlRegisterNodeDefaultValue())) +#else +XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDeregisterNodeDefaultValue \ +(*(__xmlDeregisterNodeDefaultValue())) +#else +XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \ + __xmlParserInputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserInputBufferCreateFilenameValue \ +(*(__xmlParserInputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; +#endif + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlOutputBufferCreateFilenameValue \ +(*(__xmlOutputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_GLOBALS_H */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/hash.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/hash.h new file mode 100644 index 0000000..b682b6b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/hash.h @@ -0,0 +1,236 @@ +/* + * Summary: Chained hash tables + * Description: This module implements the hash table support used in + * various places in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Bjorn Reese + */ + +#ifndef __XML_HASH_H__ +#define __XML_HASH_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The hash table. + */ +typedef struct _xmlHashTable xmlHashTable; +typedef xmlHashTable *xmlHashTablePtr; + +#ifdef __cplusplus +} +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Recent version of gcc produce a warning when a function pointer is assigned + * to an object pointer, or vice versa. The following macro is a dirty hack + * to allow suppression of the warning. If your architecture has function + * pointers which are a different size than a void pointer, there may be some + * serious trouble within the library. + */ +/** + * XML_CAST_FPTR: + * @fptr: pointer to a function + * + * Macro to do a casting from an object pointer to a + * function pointer without encountering a warning from + * gcc + * + * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) + * This macro violated ISO C aliasing rules (gcc4 on s390 broke) + * so it is disabled now + */ + +#define XML_CAST_FPTR(fptr) fptr + + +/* + * function types: + */ +/** + * xmlHashDeallocator: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to free data from a hash. + */ +typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name); +/** + * xmlHashCopier: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to copy data from a hash. + * + * Returns a copy of the data or NULL in case of error. + */ +typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name); +/** + * xmlHashScanner: + * @payload: the data in the hash + * @data: extra scanner data + * @name: the name associated + * + * Callback when scanning data in a hash with the simple scanner. + */ +typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name); +/** + * xmlHashScannerFull: + * @payload: the data in the hash + * @data: extra scanner data + * @name: the name associated + * @name2: the second name associated + * @name3: the third name associated + * + * Callback when scanning data in a hash with the full scanner. + */ +typedef void (*xmlHashScannerFull)(void *payload, void *data, + const xmlChar *name, const xmlChar *name2, + const xmlChar *name3); + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreate (int size); +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreateDict(int size, + xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlHashFree (xmlHashTablePtr table, + xmlHashDeallocator f); +XMLPUBFUN void XMLCALL + xmlHashDefaultDeallocator(void *entry, + const xmlChar *name); + +/* + * Add a new entry to the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashAddEntry (xmlHashTablePtr table, + const xmlChar *name, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry(xmlHashTablePtr table, + const xmlChar *name, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata, + xmlHashDeallocator f); + +/* + * Remove an entry from the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, const xmlChar *name3, + xmlHashDeallocator f); + +/* + * Retrieve the userdata. + */ +XMLPUBFUN void * XMLCALL + xmlHashLookup (xmlHashTablePtr table, + const xmlChar *name); +XMLPUBFUN void * XMLCALL + xmlHashLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2); +XMLPUBFUN void * XMLCALL + xmlHashLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3); +XMLPUBFUN void * XMLCALL + xmlHashQLookup (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN void * XMLCALL + xmlHashQLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2); +XMLPUBFUN void * XMLCALL + xmlHashQLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2, + const xmlChar *name3, + const xmlChar *prefix3); + +/* + * Helpers. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCopy (xmlHashTablePtr table, + xmlHashCopier f); +XMLPUBFUN int XMLCALL + xmlHashSize (xmlHashTablePtr table); +XMLPUBFUN void XMLCALL + xmlHashScan (xmlHashTablePtr table, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScan3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull (xmlHashTablePtr table, + xmlHashScannerFull f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScannerFull f, + void *data); +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_HASH_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/list.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/list.h new file mode 100644 index 0000000..3211c75 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/list.h @@ -0,0 +1,137 @@ +/* + * Summary: lists interfaces + * Description: this module implement the list support used in + * various place in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington + */ + +#ifndef __XML_LINK_INCLUDE__ +#define __XML_LINK_INCLUDE__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlLink xmlLink; +typedef xmlLink *xmlLinkPtr; + +typedef struct _xmlList xmlList; +typedef xmlList *xmlListPtr; + +/** + * xmlListDeallocator: + * @lk: the data to deallocate + * + * Callback function used to free data from a list. + */ +typedef void (*xmlListDeallocator) (xmlLinkPtr lk); +/** + * xmlListDataCompare: + * @data0: the first data + * @data1: the second data + * + * Callback function used to compare 2 data. + * + * Returns 0 is equality, -1 or 1 otherwise depending on the ordering. + */ +typedef int (*xmlListDataCompare) (const void *data0, const void *data1); +/** + * xmlListWalker: + * @data: the data found in the list + * @user: extra user provided data to the walker + * + * Callback function used when walking a list with xmlListWalk(). + * + * Returns 0 to stop walking the list, 1 otherwise. + */ +typedef int (*xmlListWalker) (const void *data, void *user); + +/* Creation/Deletion */ +XMLPUBFUN xmlListPtr XMLCALL + xmlListCreate (xmlListDeallocator deallocator, + xmlListDataCompare compare); +XMLPUBFUN void XMLCALL + xmlListDelete (xmlListPtr l); + +/* Basic Operators */ +XMLPUBFUN void * XMLCALL + xmlListSearch (xmlListPtr l, + void *data); +XMLPUBFUN void * XMLCALL + xmlListReverseSearch (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListInsert (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListAppend (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListRemoveFirst (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveLast (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveAll (xmlListPtr l, + void *data); +XMLPUBFUN void XMLCALL + xmlListClear (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListEmpty (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListFront (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListEnd (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListSize (xmlListPtr l); + +XMLPUBFUN void XMLCALL + xmlListPopFront (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListPopBack (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListPushFront (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListPushBack (xmlListPtr l, + void *data); + +/* Advanced Operators */ +XMLPUBFUN void XMLCALL + xmlListReverse (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListSort (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListWalk (xmlListPtr l, + xmlListWalker walker, + void *user); +XMLPUBFUN void XMLCALL + xmlListReverseWalk (xmlListPtr l, + xmlListWalker walker, + void *user); +XMLPUBFUN void XMLCALL + xmlListMerge (xmlListPtr l1, + xmlListPtr l2); +XMLPUBFUN xmlListPtr XMLCALL + xmlListDup (const xmlListPtr old); +XMLPUBFUN int XMLCALL + xmlListCopy (xmlListPtr cur, + const xmlListPtr old); +/* Link operators */ +XMLPUBFUN void * XMLCALL + xmlLinkGetData (xmlLinkPtr lk); + +/* xmlListUnique() */ +/* xmlListSwap */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_LINK_INCLUDE__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanoftp.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanoftp.h new file mode 100644 index 0000000..7335faf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanoftp.h @@ -0,0 +1,163 @@ +/* + * Summary: minimal FTP implementation + * Description: minimal FTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_FTP_H__ +#define __NANO_FTP_H__ + +#include + +#ifdef LIBXML_FTP_ENABLED + +/* Needed for portability to Windows 64 bits */ +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#else +/** + * SOCKET: + * + * macro used to provide portability of code to windows sockets + */ +#define SOCKET int +/** + * INVALID_SOCKET: + * + * macro used to provide portability of code to windows sockets + * the value to be used when the socket is not valid + */ +#undef INVALID_SOCKET +#define INVALID_SOCKET (-1) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * ftpListCallback: + * @userData: user provided data for the callback + * @filename: the file name (including "->" when links are shown) + * @attrib: the attribute string + * @owner: the owner string + * @group: the group string + * @size: the file size + * @links: the link count + * @year: the year + * @month: the month + * @day: the day + * @hour: the hour + * @minute: the minute + * + * A callback for the xmlNanoFTPList command. + * Note that only one of year and day:minute are specified. + */ +typedef void (*ftpListCallback) (void *userData, + const char *filename, const char *attrib, + const char *owner, const char *group, + unsigned long size, int links, int year, + const char *month, int day, int hour, + int minute); +/** + * ftpDataCallback: + * @userData: the user provided context + * @data: the data received + * @len: its size in bytes + * + * A callback for the xmlNanoFTPGet command. + */ +typedef void (*ftpDataCallback) (void *userData, + const char *data, + int len); + +/* + * Init + */ +XMLPUBFUN void XMLCALL + xmlNanoFTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoFTPCleanup (void); + +/* + * Creating/freeing contexts. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPNewCtxt (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPFreeCtxt (void * ctx); +XMLPUBFUN void * XMLCALL + xmlNanoFTPConnectTo (const char *server, + int port); +/* + * Opening/closing session connections. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPOpen (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoFTPConnect (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPClose (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPQuit (void *ctx); +XMLPUBFUN void XMLCALL + xmlNanoFTPScanProxy (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPProxy (const char *host, + int port, + const char *user, + const char *passwd, + int type); +XMLPUBFUN int XMLCALL + xmlNanoFTPUpdateURL (void *ctx, + const char *URL); + +/* + * Rather internal commands. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPGetResponse (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCheckResponse (void *ctx); + +/* + * CD/DIR/GET handlers. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPCwd (void *ctx, + const char *directory); +XMLPUBFUN int XMLCALL + xmlNanoFTPDele (void *ctx, + const char *file); + +XMLPUBFUN SOCKET XMLCALL + xmlNanoFTPGetConnection (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCloseConnection(void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPList (void *ctx, + ftpListCallback callback, + void *userData, + const char *filename); +XMLPUBFUN SOCKET XMLCALL + xmlNanoFTPGetSocket (void *ctx, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPGet (void *ctx, + ftpDataCallback callback, + void *userData, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPRead (void *ctx, + void *dest, + int len); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_FTP_ENABLED */ +#endif /* __NANO_FTP_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanohttp.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanohttp.h new file mode 100644 index 0000000..22b8fb4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/nanohttp.h @@ -0,0 +1,81 @@ +/* + * Summary: minimal HTTP implementation + * Description: minimal HTTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_HTTP_H__ +#define __NANO_HTTP_H__ + +#include + +#ifdef LIBXML_HTTP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN void XMLCALL + xmlNanoHTTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPCleanup (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPScanProxy (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoHTTPFetch (const char *URL, + const char *filename, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethod (const char *URL, + const char *method, + const char *input, + char **contentType, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethodRedir (const char *URL, + const char *method, + const char *input, + char **contentType, + char **redir, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpen (const char *URL, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpenRedir (const char *URL, + char **contentType, + char **redir); +XMLPUBFUN int XMLCALL + xmlNanoHTTPReturnCode (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPAuthHeader (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPRedir (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPContentLength( void * ctx ); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPEncoding (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPMimeType (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPRead (void *ctx, + void *dest, + int len); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + xmlNanoHTTPSave (void *ctxt, + const char *filename); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNanoHTTPClose (void *ctx); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTTP_ENABLED */ +#endif /* __NANO_HTTP_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parser.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parser.h new file mode 100644 index 0000000..0ba1c38 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parser.h @@ -0,0 +1,1243 @@ +/* + * Summary: the core parser module + * Description: Interfaces, constants and types related to the XML parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_H__ +#define __XML_PARSER_H__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_DEFAULT_VERSION: + * + * The default version of XML used: 1.0 + */ +#define XML_DEFAULT_VERSION "1.0" + +/** + * xmlParserInput: + * + * An xmlParserInput is an input flow for the XML processor. + * Each entity parsed is associated an xmlParserInput (except the + * few predefined ones). This is the case both for internal entities + * - in which case the flow is already completely in memory - or + * external entities - in which case we use the buf structure for + * progressive reading and I18N conversions to the internal UTF-8 format. + */ + +/** + * xmlParserInputDeallocate: + * @str: the string to deallocate + * + * Callback for freeing some parser input allocations. + */ +typedef void (* xmlParserInputDeallocate)(xmlChar *str); + +struct _xmlParserInput { + /* Input buffer */ + xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ + + const char *filename; /* The file analyzed, if any */ + const char *directory; /* the directory/base of the file */ + const xmlChar *base; /* Base of the array to parse */ + const xmlChar *cur; /* Current char being parsed */ + const xmlChar *end; /* end of the array to parse */ + int length; /* length if known */ + int line; /* Current line */ + int col; /* Current column */ + /* + * NOTE: consumed is only tested for equality in the parser code, + * so even if there is an overflow this should not give troubles + * for parsing very large instances. + */ + unsigned long consumed; /* How many xmlChars already consumed */ + xmlParserInputDeallocate free; /* function to deallocate the base */ + const xmlChar *encoding; /* the encoding string for entity */ + const xmlChar *version; /* the version string for entity */ + int standalone; /* Was that entity marked standalone */ + int id; /* an unique identifier for the entity */ +}; + +/** + * xmlParserNodeInfo: + * + * The parser can be asked to collect Node information, i.e. at what + * place in the file they were detected. + * NOTE: This is off by default and not very well tested. + */ +typedef struct _xmlParserNodeInfo xmlParserNodeInfo; +typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; + +struct _xmlParserNodeInfo { + const struct _xmlNode* node; + /* Position & line # that text that created the node begins & ends on */ + unsigned long begin_pos; + unsigned long begin_line; + unsigned long end_pos; + unsigned long end_line; +}; + +typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq; +typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; +struct _xmlParserNodeInfoSeq { + unsigned long maximum; + unsigned long length; + xmlParserNodeInfo* buffer; +}; + +/** + * xmlParserInputState: + * + * The parser is now working also as a state based parser. + * The recursive one use the state info for entities processing. + */ +typedef enum { + XML_PARSER_EOF = -1, /* nothing is to be parsed */ + XML_PARSER_START = 0, /* nothing has been parsed */ + XML_PARSER_MISC, /* Misc* before int subset */ + XML_PARSER_PI, /* Within a processing instruction */ + XML_PARSER_DTD, /* within some DTD content */ + XML_PARSER_PROLOG, /* Misc* after internal subset */ + XML_PARSER_COMMENT, /* within a comment */ + XML_PARSER_START_TAG, /* within a start tag */ + XML_PARSER_CONTENT, /* within the content */ + XML_PARSER_CDATA_SECTION, /* within a CDATA section */ + XML_PARSER_END_TAG, /* within a closing tag */ + XML_PARSER_ENTITY_DECL, /* within an entity declaration */ + XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ + XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ + XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ + XML_PARSER_EPILOG, /* the Misc* after the last end tag */ + XML_PARSER_IGNORE, /* within an IGNORED section */ + XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ +} xmlParserInputState; + +/** + * XML_DETECT_IDS: + * + * Bit in the loadsubset context field to tell to do ID/REFs lookups. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_DETECT_IDS 2 + +/** + * XML_COMPLETE_ATTRS: + * + * Bit in the loadsubset context field to tell to do complete the + * elements attributes lists with the ones defaulted from the DTDs. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_COMPLETE_ATTRS 4 + +/** + * XML_SKIP_IDS: + * + * Bit in the loadsubset context field to tell to not do ID/REFs registration. + * Used to initialize xmlLoadExtDtdDefaultValue in some special cases. + */ +#define XML_SKIP_IDS 8 + +/** + * xmlParserMode: + * + * A parser can operate in various modes + */ +typedef enum { + XML_PARSE_UNKNOWN = 0, + XML_PARSE_DOM = 1, + XML_PARSE_SAX = 2, + XML_PARSE_PUSH_DOM = 3, + XML_PARSE_PUSH_SAX = 4, + XML_PARSE_READER = 5 +} xmlParserMode; + +typedef struct _xmlStartTag xmlStartTag; + +/** + * xmlParserCtxt: + * + * The parser context. + * NOTE This doesn't completely define the parser state, the (current ?) + * design of the parser uses recursive function calls since this allow + * and easy mapping from the production rules of the specification + * to the actual code. The drawback is that the actual function call + * also reflect the parser state. However most of the parsing routines + * takes as the only argument the parser context pointer, so migrating + * to a state based parser for progressive parsing shouldn't be too hard. + */ +struct _xmlParserCtxt { + struct _xmlSAXHandler *sax; /* The SAX handler */ + void *userData; /* For SAX interface only, used by DOM build */ + xmlDocPtr myDoc; /* the document being built */ + int wellFormed; /* is the document well formed */ + int replaceEntities; /* shall we replace entities ? */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* the declared encoding, if any */ + int standalone; /* standalone document */ + int html; /* an HTML(1)/Docbook(2) document + * 3 is HTML after + * 10 is HTML after + */ + + /* Input stream stack */ + xmlParserInputPtr input; /* Current input stream */ + int inputNr; /* Number of current input streams */ + int inputMax; /* Max number of input streams */ + xmlParserInputPtr *inputTab; /* stack of inputs */ + + /* Node analysis stack only used for DOM building */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + int record_info; /* Whether node info should be kept */ + xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ + + int errNo; /* error code */ + + int hasExternalSubset; /* reference and external subset */ + int hasPErefs; /* the internal subset has PE refs */ + int external; /* are we parsing an external entity */ + + int valid; /* is the document valid */ + int validate; /* shall we try to validate ? */ + xmlValidCtxt vctxt; /* The validity context */ + + xmlParserInputState instate; /* current type of input */ + int token; /* next char look-ahead */ + + char *directory; /* the data directory */ + + /* Node name stack */ + const xmlChar *name; /* Current parsed Node */ + int nameNr; /* Depth of the parsing stack */ + int nameMax; /* Max depth of the parsing stack */ + const xmlChar * *nameTab; /* array of nodes */ + + long nbChars; /* unused */ + long checkIndex; /* used by progressive parsing lookup */ + int keepBlanks; /* ugly but ... */ + int disableSAX; /* SAX callbacks are disabled */ + int inSubset; /* Parsing is in int 1/ext 2 subset */ + const xmlChar * intSubName; /* name of subset */ + xmlChar * extSubURI; /* URI of external subset */ + xmlChar * extSubSystem; /* SYSTEM ID of external subset */ + + /* xml:space values */ + int * space; /* Should the parser preserve spaces */ + int spaceNr; /* Depth of the parsing stack */ + int spaceMax; /* Max depth of the parsing stack */ + int * spaceTab; /* array of space infos */ + + int depth; /* to prevent entity substitution loops */ + xmlParserInputPtr entity; /* used to check entities boundaries */ + int charset; /* encoding of the in-memory content + actually an xmlCharEncoding */ + int nodelen; /* Those two fields are there to */ + int nodemem; /* Speed up large node parsing */ + int pedantic; /* signal pedantic warnings */ + void *_private; /* For user data, libxml won't touch it */ + + int loadsubset; /* should the external subset be loaded */ + int linenumbers; /* set line number in element content */ + void *catalogs; /* document's own catalog */ + int recovery; /* run in recovery mode */ + int progressive; /* is this a progressive parsing */ + xmlDictPtr dict; /* dictionary for the parser */ + const xmlChar * *atts; /* array for the attributes callbacks */ + int maxatts; /* the size of the array */ + int docdict; /* use strings from dict to build tree */ + + /* + * pre-interned strings + */ + const xmlChar *str_xml; + const xmlChar *str_xmlns; + const xmlChar *str_xml_ns; + + /* + * Everything below is used only by the new SAX mode + */ + int sax2; /* operating in the new SAX mode */ + int nsNr; /* the number of inherited namespaces */ + int nsMax; /* the size of the arrays */ + const xmlChar * *nsTab; /* the array of prefix/namespace name */ + int *attallocs; /* which attribute were allocated */ + xmlStartTag *pushTab; /* array of data for push */ + xmlHashTablePtr attsDefault; /* defaulted attributes if any */ + xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ + int nsWellFormed; /* is the document XML Namespace okay */ + int options; /* Extra options */ + + /* + * Those fields are needed only for streaming parsing so far + */ + int dictNames; /* Use dictionary names for the tree */ + int freeElemsNr; /* number of freed element nodes */ + xmlNodePtr freeElems; /* List of freed element nodes */ + int freeAttrsNr; /* number of freed attributes nodes */ + xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ + + /* + * the complete error information for the last error. + */ + xmlError lastError; + xmlParserMode parseMode; /* the parser mode */ + unsigned long nbentities; /* number of entities references */ + unsigned long sizeentities; /* size of parsed entities */ + + /* for use by HTML non-recursive parser */ + xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */ + int nodeInfoNr; /* Depth of the parsing stack */ + int nodeInfoMax; /* Max depth of the parsing stack */ + xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ + + int input_id; /* we need to label inputs */ + unsigned long sizeentcopy; /* volume of entity copy */ +}; + +/** + * xmlSAXLocator: + * + * A SAX Locator. + */ +struct _xmlSAXLocator { + const xmlChar *(*getPublicId)(void *ctx); + const xmlChar *(*getSystemId)(void *ctx); + int (*getLineNumber)(void *ctx); + int (*getColumnNumber)(void *ctx); +}; + +/** + * xmlSAXHandler: + * + * A SAX handler is bunch of callbacks called by the parser when processing + * of the input generate data or structure information. + */ + +/** + * resolveEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * Callback: + * The entity loader, to control the loading of external entities, + * the application can either: + * - override this resolveEntity() callback in the SAX block + * - or better use the xmlSetExternalEntityLoader() function to + * set up it's own entity resolution routine + * + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. + */ +typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * internalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on internal subset declaration. + */ +typedef void (*internalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * externalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on external subset declaration. + */ +typedef void (*externalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * getEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get an entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * getParameterEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get a parameter entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * entityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the entity name + * @type: the entity type + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @content: the entity value (without processing). + * + * An entity definition has been parsed. + */ +typedef void (*entityDeclSAXFunc) (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +/** + * notationDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the notation + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * What to do when a notation declaration has been parsed. + */ +typedef void (*notationDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * attributeDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @elem: the name of the element + * @fullname: the attribute name + * @type: the attribute type + * @def: the type of default value + * @defaultValue: the attribute default value + * @tree: the tree of enumerated value set + * + * An attribute definition has been parsed. + */ +typedef void (*attributeDeclSAXFunc)(void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +/** + * elementDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the element name + * @type: the element type + * @content: the element value tree + * + * An element definition has been parsed. + */ +typedef void (*elementDeclSAXFunc)(void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +/** + * unparsedEntityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the entity + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @notationName: the name of the notation + * + * What to do when an unparsed entity declaration is parsed. + */ +typedef void (*unparsedEntityDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); +/** + * setDocumentLocatorSAXFunc: + * @ctx: the user data (XML parser context) + * @loc: A SAX Locator + * + * Receive the document locator at startup, actually xmlDefaultSAXLocator. + * Everything is available on the context, so this is useless in our case. + */ +typedef void (*setDocumentLocatorSAXFunc) (void *ctx, + xmlSAXLocatorPtr loc); +/** + * startDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document start being processed. + */ +typedef void (*startDocumentSAXFunc) (void *ctx); +/** + * endDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document end has been detected. + */ +typedef void (*endDocumentSAXFunc) (void *ctx); +/** + * startElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name, including namespace prefix + * @atts: An array of name/value attributes pairs, NULL terminated + * + * Called when an opening tag has been processed. + */ +typedef void (*startElementSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar **atts); +/** + * endElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name + * + * Called when the end of an element has been detected. + */ +typedef void (*endElementSAXFunc) (void *ctx, + const xmlChar *name); +/** + * attributeSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The attribute name, including namespace prefix + * @value: The attribute value + * + * Handle an attribute that has been read by the parser. + * The default handling is to convert the attribute into an + * DOM subtree and past it in a new xmlAttr element added to + * the element. + */ +typedef void (*attributeSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *value); +/** + * referenceSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Called when an entity reference is detected. + */ +typedef void (*referenceSAXFunc) (void *ctx, + const xmlChar *name); +/** + * charactersSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some chars from the parser. + */ +typedef void (*charactersSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * ignorableWhitespaceSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some ignorable whitespaces from the parser. + * UNUSED: by default the DOM building will use characters. + */ +typedef void (*ignorableWhitespaceSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * processingInstructionSAXFunc: + * @ctx: the user data (XML parser context) + * @target: the target name + * @data: the PI data's + * + * A processing instruction has been parsed. + */ +typedef void (*processingInstructionSAXFunc) (void *ctx, + const xmlChar *target, + const xmlChar *data); +/** + * commentSAXFunc: + * @ctx: the user data (XML parser context) + * @value: the comment content + * + * A comment has been parsed. + */ +typedef void (*commentSAXFunc) (void *ctx, + const xmlChar *value); +/** + * cdataBlockSAXFunc: + * @ctx: the user data (XML parser context) + * @value: The pcdata content + * @len: the block length + * + * Called when a pcdata block has been parsed. + */ +typedef void (*cdataBlockSAXFunc) ( + void *ctx, + const xmlChar *value, + int len); +/** + * warningSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a warning messages, callback. + */ +typedef void (XMLCDECL *warningSAXFunc) (void *ctx, + const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +/** + * errorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format an error messages, callback. + */ +typedef void (XMLCDECL *errorSAXFunc) (void *ctx, + const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +/** + * fatalErrorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format fatal error messages, callback. + * Note: so far fatalError() SAX callbacks are not used, error() + * get all the callbacks for errors. + */ +typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, + const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); +/** + * isStandaloneSAXFunc: + * @ctx: the user data (XML parser context) + * + * Is this document tagged standalone? + * + * Returns 1 if true + */ +typedef int (*isStandaloneSAXFunc) (void *ctx); +/** + * hasInternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an internal subset. + * + * Returns 1 if true + */ +typedef int (*hasInternalSubsetSAXFunc) (void *ctx); + +/** + * hasExternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an external subset? + * + * Returns 1 if true + */ +typedef int (*hasExternalSubsetSAXFunc) (void *ctx); + +/************************************************************************ + * * + * The SAX version 2 API extensions * + * * + ************************************************************************/ +/** + * XML_SAX2_MAGIC: + * + * Special constant found in SAX2 blocks initialized fields + */ +#define XML_SAX2_MAGIC 0xDEEDBEAF + +/** + * startElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * @nb_namespaces: number of namespace definitions on that node + * @namespaces: pointer to the array of prefix/URI pairs namespace definitions + * @nb_attributes: the number of attributes on that node + * @nb_defaulted: the number of defaulted attributes. The defaulted + * ones are at the end of the array + * @attributes: pointer to the array of (localname/prefix/URI/value/end) + * attribute values. + * + * SAX2 callback when an element start has been detected by the parser. + * It provides the namespace information for the element, as well as + * the new namespace declarations on the element. + */ + +typedef void (*startElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +/** + * endElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * + * SAX2 callback when an element end has been detected by the parser. + * It provides the namespace information for the element. + */ + +typedef void (*endElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + + +struct _xmlSAXHandler { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; + /* The following fields are extensions available only on version 2 */ + void *_private; + startElementNsSAX2Func startElementNs; + endElementNsSAX2Func endElementNs; + xmlStructuredErrorFunc serror; +}; + +/* + * SAX Version 1 + */ +typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1; +typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; +struct _xmlSAXHandlerV1 { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; +}; + + +/** + * xmlExternalEntityLoader: + * @URL: The System ID of the resource requested + * @ID: The Public ID of the resource requested + * @context: the XML parser context + * + * External entity loaders types. + * + * Returns the entity input parser. + */ +typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, + const char *ID, + xmlParserCtxtPtr context); + +#ifdef __cplusplus +} +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Init/Cleanup + */ +XMLPUBFUN void XMLCALL + xmlInitParser (void); +XMLPUBFUN void XMLCALL + xmlCleanupParser (void); + +/* + * Input functions + */ +XMLPUBFUN int XMLCALL + xmlParserInputRead (xmlParserInputPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputGrow (xmlParserInputPtr in, + int len); + +/* + * Basic parsing Interfaces + */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseDoc (const xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseFile (const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseMemory (const char *buffer, + int size); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlSubstituteEntitiesDefault(int val); +XMLPUBFUN int XMLCALL + xmlKeepBlanksDefault (int val); +XMLPUBFUN void XMLCALL + xmlStopParser (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlPedanticParserDefault(int val); +XMLPUBFUN int XMLCALL + xmlLineNumbersDefault (int val); + +#ifdef LIBXML_SAX1_ENABLED +/* + * Recovery mode + */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverDoc (const xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverMemory (const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverFile (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +/* + * Less common routines and SAX interfaces + */ +XMLPUBFUN int XMLCALL + xmlParseDocument (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXUserParseFile (xmlSAXHandlerPtr sax, + void *user_data, + const char *filename); +XMLPUBFUN int XMLCALL + xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, + void *user_data, + const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseDoc (xmlSAXHandlerPtr sax, + const xmlChar *cur, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemory (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFile (xmlSAXHandlerPtr sax, + const char *filename, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, + const char *filename, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseEntity (xmlSAXHandlerPtr sax, + const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseEntity (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlSAXParseDTD (xmlSAXHandlerPtr sax, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlParseDTD (const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlIOParseDTD (xmlSAXHandlerPtr sax, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); +#endif /* LIBXML_VALID_ENABLE */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemory(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserErrors XMLCALL + xmlParseInNodeContext (xmlNodePtr node, + const char *data, + int datalen, + int options, + xmlNodePtr *lst); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst, + int recover); +XMLPUBFUN int XMLCALL + xmlParseExternalEntity (xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); + +/* + * Parser contexts handling. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlNewParserCtxt (void); +XMLPUBFUN int XMLCALL + xmlInitParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlClearParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, + const xmlChar* buffer, + const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateDocParserCtxt (const xmlChar *cur); + +#ifdef LIBXML_LEGACY_ENABLED +/* + * Reading/setting optional parsing features. + */ +XMLPUBFUN int XMLCALL + xmlGetFeaturesList (int *len, + const char **result); +XMLPUBFUN int XMLCALL + xmlGetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *result); +XMLPUBFUN int XMLCALL + xmlSetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *value); +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef LIBXML_PUSH_ENABLED +/* + * Interfaces for the Push mode. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename); +XMLPUBFUN int XMLCALL + xmlParseChunk (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +/* + * Special I/O mode. + */ + +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, + void *user_data, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewIOInputStream (xmlParserCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); + +/* + * Node infos. + */ +XMLPUBFUN const xmlParserNodeInfo* XMLCALL + xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN void XMLCALL + xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN unsigned long XMLCALL + xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, + const xmlParserNodeInfoPtr info); + +/* + * External entities handling actually implemented in xmlIO. + */ + +XMLPUBFUN void XMLCALL + xmlSetExternalEntityLoader(xmlExternalEntityLoader f); +XMLPUBFUN xmlExternalEntityLoader XMLCALL + xmlGetExternalEntityLoader(void); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlLoadExternalEntity (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * Index lookup, actually implemented in the encoding module + */ +XMLPUBFUN long XMLCALL + xmlByteConsumed (xmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + XML_PARSE_RECOVER = 1<<0, /* recover on errors */ + XML_PARSE_NOENT = 1<<1, /* substitute entities */ + XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ + XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ + XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ + XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ + XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ + XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */ + XML_PARSE_NONET = 1<<11,/* Forbid network access */ + XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */ + XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ + XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ + XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ + XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of + the tree allowed afterwards (will possibly + crash if you try to modify the tree) */ + XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ + XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ + XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */ + XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */ + XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */ + XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */ +} xmlParserOption; + +XMLPUBFUN void XMLCALL + xmlCtxtReset (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlCtxtResetPush (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +/* + * Library wide options + */ +/** + * xmlFeature: + * + * Used to examine the existence of features that can be enabled + * or disabled at compile-time. + * They used to be called XML_FEATURE_xxx but this clashed with Expat + */ +typedef enum { + XML_WITH_THREAD = 1, + XML_WITH_TREE = 2, + XML_WITH_OUTPUT = 3, + XML_WITH_PUSH = 4, + XML_WITH_READER = 5, + XML_WITH_PATTERN = 6, + XML_WITH_WRITER = 7, + XML_WITH_SAX1 = 8, + XML_WITH_FTP = 9, + XML_WITH_HTTP = 10, + XML_WITH_VALID = 11, + XML_WITH_HTML = 12, + XML_WITH_LEGACY = 13, + XML_WITH_C14N = 14, + XML_WITH_CATALOG = 15, + XML_WITH_XPATH = 16, + XML_WITH_XPTR = 17, + XML_WITH_XINCLUDE = 18, + XML_WITH_ICONV = 19, + XML_WITH_ISO8859X = 20, + XML_WITH_UNICODE = 21, + XML_WITH_REGEXP = 22, + XML_WITH_AUTOMATA = 23, + XML_WITH_EXPR = 24, + XML_WITH_SCHEMAS = 25, + XML_WITH_SCHEMATRON = 26, + XML_WITH_MODULES = 27, + XML_WITH_DEBUG = 28, + XML_WITH_DEBUG_MEM = 29, + XML_WITH_DEBUG_RUN = 30, + XML_WITH_ZLIB = 31, + XML_WITH_ICU = 32, + XML_WITH_LZMA = 33, + XML_WITH_NONE = 99999 /* just to be sure of allocation size */ +} xmlFeature; + +XMLPUBFUN int XMLCALL + xmlHasFeature (xmlFeature feature); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parserInternals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parserInternals.h new file mode 100644 index 0000000..1f26ce2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/parserInternals.h @@ -0,0 +1,644 @@ +/* + * Summary: internals routines and limits exported by the parser. + * Description: this module exports a number of internal parsing routines + * they are not really all intended for applications but + * can prove useful doing low level processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_INTERNALS_H__ +#define __XML_PARSER_INTERNALS_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlParserMaxDepth: + * + * arbitrary depth limit for the XML documents that we allow to + * process. This is not a limitation of the parser but a safety + * boundary feature, use XML_PARSE_HUGE option to override it. + */ +XMLPUBVAR unsigned int xmlParserMaxDepth; + +/** + * XML_MAX_TEXT_LENGTH: + * + * Maximum size allowed for a single text node when building a tree. + * This is not a limitation of the parser but a safety boundary feature, + * use XML_PARSE_HUGE option to override it. + * Introduced in 2.9.0 + */ +#define XML_MAX_TEXT_LENGTH 10000000 + +/** + * XML_MAX_NAME_LENGTH: + * + * Maximum size allowed for a markup identifier. + * This is not a limitation of the parser but a safety boundary feature, + * use XML_PARSE_HUGE option to override it. + * Note that with the use of parsing dictionaries overriding the limit + * may result in more runtime memory usage in face of "unfriendly' content + * Introduced in 2.9.0 + */ +#define XML_MAX_NAME_LENGTH 50000 + +/** + * XML_MAX_DICTIONARY_LIMIT: + * + * Maximum size allowed by the parser for a dictionary by default + * This is not a limitation of the parser but a safety boundary feature, + * use XML_PARSE_HUGE option to override it. + * Introduced in 2.9.0 + */ +#define XML_MAX_DICTIONARY_LIMIT 10000000 + +/** + * XML_MAX_LOOKUP_LIMIT: + * + * Maximum size allowed by the parser for ahead lookup + * This is an upper boundary enforced by the parser to avoid bad + * behaviour on "unfriendly' content + * Introduced in 2.9.0 + */ +#define XML_MAX_LOOKUP_LIMIT 10000000 + +/** + * XML_MAX_NAMELEN: + * + * Identifiers can be longer, but this will be more costly + * at runtime. + */ +#define XML_MAX_NAMELEN 100 + +/** + * INPUT_CHUNK: + * + * The parser tries to always have that amount of input ready. + * One of the point is providing context when reporting errors. + */ +#define INPUT_CHUNK 250 + +/************************************************************************ + * * + * UNICODE version of the macros. * + * * + ************************************************************************/ +/** + * IS_BYTE_CHAR: + * @c: an byte value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20...] + * any byte character in the accepted range + */ +#define IS_BYTE_CHAR(c) xmlIsChar_ch(c) + +/** + * IS_CHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] + * | [#x10000-#x10FFFF] + * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + */ +#define IS_CHAR(c) xmlIsCharQ(c) + +/** + * IS_CHAR_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Behaves like IS_CHAR on single-byte value + */ +#define IS_CHAR_CH(c) xmlIsChar_ch(c) + +/** + * IS_BLANK: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [3] S ::= (#x20 | #x9 | #xD | #xA)+ + */ +#define IS_BLANK(c) xmlIsBlankQ(c) + +/** + * IS_BLANK_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Behaviour same as IS_BLANK + */ +#define IS_BLANK_CH(c) xmlIsBlank_ch(c) + +/** + * IS_BASECHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [85] BaseChar ::= ... long list see REC ... + */ +#define IS_BASECHAR(c) xmlIsBaseCharQ(c) + +/** + * IS_DIGIT: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [88] Digit ::= ... long list see REC ... + */ +#define IS_DIGIT(c) xmlIsDigitQ(c) + +/** + * IS_DIGIT_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_DIGIT but with a single byte argument + */ +#define IS_DIGIT_CH(c) xmlIsDigit_ch(c) + +/** + * IS_COMBINING: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [87] CombiningChar ::= ... long list see REC ... + */ +#define IS_COMBINING(c) xmlIsCombiningQ(c) + +/** + * IS_COMBINING_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Always false (all combining chars > 0xff) + */ +#define IS_COMBINING_CH(c) 0 + +/** + * IS_EXTENDER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | + * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | + * [#x309D-#x309E] | [#x30FC-#x30FE] + */ +#define IS_EXTENDER(c) xmlIsExtenderQ(c) + +/** + * IS_EXTENDER_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_EXTENDER but with a single-byte argument + */ +#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c) + +/** + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] + */ +#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c) + +/** + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [84] Letter ::= BaseChar | Ideographic + */ +#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) + +/** + * IS_LETTER_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Macro behaves like IS_LETTER, but only check base chars + * + */ +#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c) + +/** + * IS_ASCII_LETTER: + * @c: an xmlChar value + * + * Macro to check [a-zA-Z] + * + */ +#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a))) + +/** + * IS_ASCII_DIGIT: + * @c: an xmlChar value + * + * Macro to check [0-9] + * + */ +#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39)) + +/** + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] + */ +#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c) + +/** + * IS_PUBIDCHAR_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Same as IS_PUBIDCHAR but for single-byte value + */ +#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c) + +/** + * SKIP_EOL: + * @p: and UTF8 string pointer + * + * Skips the end of line chars. + */ +#define SKIP_EOL(p) \ + if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ + if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } + +/** + * MOVETO_ENDTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '>' char. + */ +#define MOVETO_ENDTAG(p) \ + while ((*p) && (*(p) != '>')) (p)++ + +/** + * MOVETO_STARTTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '<' char. + */ +#define MOVETO_STARTTAG(p) \ + while ((*p) && (*(p) != '<')) (p)++ + +/** + * Global variables used for predefined strings. + */ +XMLPUBVAR const xmlChar xmlStringText[]; +XMLPUBVAR const xmlChar xmlStringTextNoenc[]; +XMLPUBVAR const xmlChar xmlStringComment[]; + +/* + * Function to finish the work of the macros where needed. + */ +XMLPUBFUN int XMLCALL xmlIsLetter (int c); + +/** + * Parser context. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateFileParserCtxt (const char *filename); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateURLParserCtxt (const char *filename, + int options); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateMemoryParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateEntityParserCtxt(const xmlChar *URL, + const xmlChar *ID, + const xmlChar *base); +XMLPUBFUN int XMLCALL + xmlSwitchEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncodingHandlerPtr handler); +XMLPUBFUN int XMLCALL + xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input, + xmlCharEncodingHandlerPtr handler); + +#ifdef IN_LIBXML +/* internal error reporting */ +XMLPUBFUN void XMLCALL + __xmlErrEncoding (xmlParserCtxtPtr ctxt, + xmlParserErrors xmlerr, + const char *msg, + const xmlChar * str1, + const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0); +#endif + +/** + * Input Streams. + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewStringInputStream (xmlParserCtxtPtr ctxt, + const xmlChar *buffer); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); +XMLPUBFUN int XMLCALL + xmlPushInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input); +XMLPUBFUN xmlChar XMLCALL + xmlPopInput (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeInputStream (xmlParserInputPtr input); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputFromFile (xmlParserCtxtPtr ctxt, + const char *filename); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputStream (xmlParserCtxtPtr ctxt); + +/** + * Namespaces. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName (xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlChar **prefix); + +/** + * Generic production rules. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlParseName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseNmtoken (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEntityValue (xmlParserCtxtPtr ctxt, + xmlChar **orig); +XMLPUBFUN xmlChar * XMLCALL + xmlParseAttValue (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseCharData (xmlParserCtxtPtr ctxt, + int cdata); +XMLPUBFUN xmlChar * XMLCALL + xmlParseExternalID (xmlParserCtxtPtr ctxt, + xmlChar **publicID, + int strict); +XMLPUBFUN void XMLCALL + xmlParseComment (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParsePITarget (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePI (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNotationDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEntityDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseNotationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseEnumerationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN int XMLCALL + xmlParseAttributeType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN void XMLCALL + xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementMixedContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementChildrenContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN int XMLCALL + xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlElementContentPtr *result); +XMLPUBFUN int XMLCALL + xmlParseElementDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseCharRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlParseEntityRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePEReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlParseAttribute (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseStartTag (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEndTag (xmlParserCtxtPtr ctxt); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN void XMLCALL + xmlParseCDSect (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseContent (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseElement (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionNum (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionInfo (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEncName (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseSDDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseXMLDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseTextDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMisc (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseExternalSubset (xmlParserCtxtPtr ctxt, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * XML_SUBSTITUTE_NONE: + * + * If no entities need to be substituted. + */ +#define XML_SUBSTITUTE_NONE 0 +/** + * XML_SUBSTITUTE_REF: + * + * Whether general entities need to be substituted. + */ +#define XML_SUBSTITUTE_REF 1 +/** + * XML_SUBSTITUTE_PEREF: + * + * Whether parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_PEREF 2 +/** + * XML_SUBSTITUTE_BOTH: + * + * Both general and parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_BOTH 3 + +XMLPUBFUN xmlChar * XMLCALL + xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN xmlChar * XMLCALL + xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); + +/* + * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. + */ +XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt, + xmlNodePtr value); +XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt, + xmlParserInputPtr value); +XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt, + const xmlChar *value); + +/* + * other commodities shared between parser.c and parserInternals. + */ +XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + int *len); +XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang); + +/* + * Really core function shared with HTML parser. + */ +XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt, + int *len); +XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out, + int val); +XMLPUBFUN int XMLCALL xmlCopyChar (int len, + xmlChar *out, + int val); +XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); + +#ifdef LIBXML_HTML_ENABLED +/* + * Actually comes from the HTML parser but launched from the init stuff. + */ +XMLPUBFUN void XMLCALL htmlInitAutoClose (void); +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, + const char *encoding); +#endif + +/* + * Specific function to keep track of entities references + * and used by the XSLT debugger. + */ +#ifdef LIBXML_LEGACY_ENABLED +/** + * xmlEntityReferenceFunc: + * @ent: the entity + * @firstNode: the fist node in the chunk + * @lastNode: the last nod in the chunk + * + * Callback function used when one needs to be able to track back the + * provenance of a chunk of nodes inherited from an entity replacement. + */ +typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, + xmlNodePtr firstNode, + xmlNodePtr lastNode); + +XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); + +XMLPUBFUN xmlChar * XMLCALL + xmlParseQuotedString (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNamespace (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlScanName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, + xmlChar **prefix); +/** + * Entities + */ +XMLPUBFUN xmlChar * XMLCALL + xmlDecodeEntities (xmlParserCtxtPtr ctxt, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN void XMLCALL + xmlHandleEntity (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); + +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef IN_LIBXML +/* + * internal only + */ +XMLPUBFUN void XMLCALL + xmlErrMemory (xmlParserCtxtPtr ctxt, + const char *extra); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_INTERNALS_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/pattern.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/pattern.h new file mode 100644 index 0000000..97d2cd2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/pattern.h @@ -0,0 +1,100 @@ +/* + * Summary: pattern expression handling + * Description: allows to compile and test pattern expressions for nodes + * either in a tree or based on a parser state. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PATTERN_H__ +#define __XML_PATTERN_H__ + +#include +#include +#include + +#ifdef LIBXML_PATTERN_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlPattern: + * + * A compiled (XPath based) pattern to select nodes + */ +typedef struct _xmlPattern xmlPattern; +typedef xmlPattern *xmlPatternPtr; + +/** + * xmlPatternFlags: + * + * This is the set of options affecting the behaviour of pattern + * matching with this module + * + */ +typedef enum { + XML_PATTERN_DEFAULT = 0, /* simple pattern match */ + XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */ + XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */ + XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */ +} xmlPatternFlags; + +XMLPUBFUN void XMLCALL + xmlFreePattern (xmlPatternPtr comp); + +XMLPUBFUN void XMLCALL + xmlFreePatternList (xmlPatternPtr comp); + +XMLPUBFUN xmlPatternPtr XMLCALL + xmlPatterncompile (const xmlChar *pattern, + xmlDict *dict, + int flags, + const xmlChar **namespaces); +XMLPUBFUN int XMLCALL + xmlPatternMatch (xmlPatternPtr comp, + xmlNodePtr node); + +/* streaming interfaces */ +typedef struct _xmlStreamCtxt xmlStreamCtxt; +typedef xmlStreamCtxt *xmlStreamCtxtPtr; + +XMLPUBFUN int XMLCALL + xmlPatternStreamable (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternMaxDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternMinDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternFromRoot (xmlPatternPtr comp); +XMLPUBFUN xmlStreamCtxtPtr XMLCALL + xmlPatternGetStreamCtxt (xmlPatternPtr comp); +XMLPUBFUN void XMLCALL + xmlFreeStreamCtxt (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamPushNode (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns, + int nodeType); +XMLPUBFUN int XMLCALL + xmlStreamPush (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPushAttr (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPop (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_PATTERN_ENABLED */ + +#endif /* __XML_PATTERN_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/relaxng.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/relaxng.h new file mode 100644 index 0000000..f269c9e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/relaxng.h @@ -0,0 +1,217 @@ +/* + * Summary: implementation of the Relax-NG validation + * Description: implementation of the Relax-NG validation + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_RELAX_NG__ +#define __XML_RELAX_NG__ + +#include +#include +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlRelaxNG xmlRelaxNG; +typedef xmlRelaxNG *xmlRelaxNGPtr; + + +/** + * xmlRelaxNGValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from a Relax-NG validation + */ +typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); + +/** + * xmlRelaxNGValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from a Relax-NG validation + */ +typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); + +/** + * A schemas validation context + */ +typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; +typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; + +typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt; +typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr; + +/* + * xmlRelaxNGValidErr: + * + * List of possible Relax NG validation errors + */ +typedef enum { + XML_RELAXNG_OK = 0, + XML_RELAXNG_ERR_MEMORY, + XML_RELAXNG_ERR_TYPE, + XML_RELAXNG_ERR_TYPEVAL, + XML_RELAXNG_ERR_DUPID, + XML_RELAXNG_ERR_TYPECMP, + XML_RELAXNG_ERR_NOSTATE, + XML_RELAXNG_ERR_NODEFINE, + XML_RELAXNG_ERR_LISTEXTRA, + XML_RELAXNG_ERR_LISTEMPTY, + XML_RELAXNG_ERR_INTERNODATA, + XML_RELAXNG_ERR_INTERSEQ, + XML_RELAXNG_ERR_INTEREXTRA, + XML_RELAXNG_ERR_ELEMNAME, + XML_RELAXNG_ERR_ATTRNAME, + XML_RELAXNG_ERR_ELEMNONS, + XML_RELAXNG_ERR_ATTRNONS, + XML_RELAXNG_ERR_ELEMWRONGNS, + XML_RELAXNG_ERR_ATTRWRONGNS, + XML_RELAXNG_ERR_ELEMEXTRANS, + XML_RELAXNG_ERR_ATTREXTRANS, + XML_RELAXNG_ERR_ELEMNOTEMPTY, + XML_RELAXNG_ERR_NOELEM, + XML_RELAXNG_ERR_NOTELEM, + XML_RELAXNG_ERR_ATTRVALID, + XML_RELAXNG_ERR_CONTENTVALID, + XML_RELAXNG_ERR_EXTRACONTENT, + XML_RELAXNG_ERR_INVALIDATTR, + XML_RELAXNG_ERR_DATAELEM, + XML_RELAXNG_ERR_VALELEM, + XML_RELAXNG_ERR_LISTELEM, + XML_RELAXNG_ERR_DATATYPE, + XML_RELAXNG_ERR_VALUE, + XML_RELAXNG_ERR_LIST, + XML_RELAXNG_ERR_NOGRAMMAR, + XML_RELAXNG_ERR_EXTRADATA, + XML_RELAXNG_ERR_LACKDATA, + XML_RELAXNG_ERR_INTERNAL, + XML_RELAXNG_ERR_ELEMWRONG, + XML_RELAXNG_ERR_TEXTWRONG +} xmlRelaxNGValidErr; + +/* + * xmlRelaxNGParserFlags: + * + * List of possible Relax NG Parser flags + */ +typedef enum { + XML_RELAXNGP_NONE = 0, + XML_RELAXNGP_FREE_DOC = 1, + XML_RELAXNGP_CRNG = 2 +} xmlRelaxNGParserFlag; + +XMLPUBFUN int XMLCALL + xmlRelaxNGInitTypes (void); +XMLPUBFUN void XMLCALL + xmlRelaxNGCleanupTypes (void); + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewParserCtxt (const char *URL); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc); + +XMLPUBFUN int XMLCALL + xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt, + int flag); + +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetParserStructuredErrors( + xmlRelaxNGParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN xmlRelaxNGPtr XMLCALL + xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGFree (xmlRelaxNGPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlRelaxNGDump (FILE *output, + xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGDumpTree (FILE * output, + xmlRelaxNGPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, void *ctx); +XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL + xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc); +/* + * Interfaces for progressive validation when possible + */ +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ + +#endif /* __XML_RELAX_NG__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schemasInternals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schemasInternals.h new file mode 100644 index 0000000..c521d1c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schemasInternals.h @@ -0,0 +1,958 @@ +/* + * Summary: internal interfaces for XML Schemas + * Description: internal interfaces for the XML Schemas handling + * and schema validity checking + * The Schemas development is a Work In Progress. + * Some of those interfaces are not guaranteed to be API or ABI stable ! + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_INTERNALS_H__ +#define __XML_SCHEMA_INTERNALS_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMAS_UNKNOWN = 0, + XML_SCHEMAS_STRING = 1, + XML_SCHEMAS_NORMSTRING = 2, + XML_SCHEMAS_DECIMAL = 3, + XML_SCHEMAS_TIME = 4, + XML_SCHEMAS_GDAY = 5, + XML_SCHEMAS_GMONTH = 6, + XML_SCHEMAS_GMONTHDAY = 7, + XML_SCHEMAS_GYEAR = 8, + XML_SCHEMAS_GYEARMONTH = 9, + XML_SCHEMAS_DATE = 10, + XML_SCHEMAS_DATETIME = 11, + XML_SCHEMAS_DURATION = 12, + XML_SCHEMAS_FLOAT = 13, + XML_SCHEMAS_DOUBLE = 14, + XML_SCHEMAS_BOOLEAN = 15, + XML_SCHEMAS_TOKEN = 16, + XML_SCHEMAS_LANGUAGE = 17, + XML_SCHEMAS_NMTOKEN = 18, + XML_SCHEMAS_NMTOKENS = 19, + XML_SCHEMAS_NAME = 20, + XML_SCHEMAS_QNAME = 21, + XML_SCHEMAS_NCNAME = 22, + XML_SCHEMAS_ID = 23, + XML_SCHEMAS_IDREF = 24, + XML_SCHEMAS_IDREFS = 25, + XML_SCHEMAS_ENTITY = 26, + XML_SCHEMAS_ENTITIES = 27, + XML_SCHEMAS_NOTATION = 28, + XML_SCHEMAS_ANYURI = 29, + XML_SCHEMAS_INTEGER = 30, + XML_SCHEMAS_NPINTEGER = 31, + XML_SCHEMAS_NINTEGER = 32, + XML_SCHEMAS_NNINTEGER = 33, + XML_SCHEMAS_PINTEGER = 34, + XML_SCHEMAS_INT = 35, + XML_SCHEMAS_UINT = 36, + XML_SCHEMAS_LONG = 37, + XML_SCHEMAS_ULONG = 38, + XML_SCHEMAS_SHORT = 39, + XML_SCHEMAS_USHORT = 40, + XML_SCHEMAS_BYTE = 41, + XML_SCHEMAS_UBYTE = 42, + XML_SCHEMAS_HEXBINARY = 43, + XML_SCHEMAS_BASE64BINARY = 44, + XML_SCHEMAS_ANYTYPE = 45, + XML_SCHEMAS_ANYSIMPLETYPE = 46 +} xmlSchemaValType; + +/* + * XML Schemas defines multiple type of types. + */ +typedef enum { + XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */ + XML_SCHEMA_TYPE_ANY, + XML_SCHEMA_TYPE_FACET, + XML_SCHEMA_TYPE_SIMPLE, + XML_SCHEMA_TYPE_COMPLEX, + XML_SCHEMA_TYPE_SEQUENCE = 6, + XML_SCHEMA_TYPE_CHOICE, + XML_SCHEMA_TYPE_ALL, + XML_SCHEMA_TYPE_SIMPLE_CONTENT, + XML_SCHEMA_TYPE_COMPLEX_CONTENT, + XML_SCHEMA_TYPE_UR, + XML_SCHEMA_TYPE_RESTRICTION, + XML_SCHEMA_TYPE_EXTENSION, + XML_SCHEMA_TYPE_ELEMENT, + XML_SCHEMA_TYPE_ATTRIBUTE, + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, + XML_SCHEMA_TYPE_GROUP, + XML_SCHEMA_TYPE_NOTATION, + XML_SCHEMA_TYPE_LIST, + XML_SCHEMA_TYPE_UNION, + XML_SCHEMA_TYPE_ANY_ATTRIBUTE, + XML_SCHEMA_TYPE_IDC_UNIQUE, + XML_SCHEMA_TYPE_IDC_KEY, + XML_SCHEMA_TYPE_IDC_KEYREF, + XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_TYPE_ATTRIBUTE_USE, + XML_SCHEMA_FACET_MININCLUSIVE = 1000, + XML_SCHEMA_FACET_MINEXCLUSIVE, + XML_SCHEMA_FACET_MAXINCLUSIVE, + XML_SCHEMA_FACET_MAXEXCLUSIVE, + XML_SCHEMA_FACET_TOTALDIGITS, + XML_SCHEMA_FACET_FRACTIONDIGITS, + XML_SCHEMA_FACET_PATTERN, + XML_SCHEMA_FACET_ENUMERATION, + XML_SCHEMA_FACET_WHITESPACE, + XML_SCHEMA_FACET_LENGTH, + XML_SCHEMA_FACET_MAXLENGTH, + XML_SCHEMA_FACET_MINLENGTH, + XML_SCHEMA_EXTRA_QNAMEREF = 2000, + XML_SCHEMA_EXTRA_ATTR_USE_PROHIB +} xmlSchemaTypeType; + +typedef enum { + XML_SCHEMA_CONTENT_UNKNOWN = 0, + XML_SCHEMA_CONTENT_EMPTY = 1, + XML_SCHEMA_CONTENT_ELEMENTS, + XML_SCHEMA_CONTENT_MIXED, + XML_SCHEMA_CONTENT_SIMPLE, + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */ + XML_SCHEMA_CONTENT_BASIC, + XML_SCHEMA_CONTENT_ANY +} xmlSchemaContentType; + +typedef struct _xmlSchemaVal xmlSchemaVal; +typedef xmlSchemaVal *xmlSchemaValPtr; + +typedef struct _xmlSchemaType xmlSchemaType; +typedef xmlSchemaType *xmlSchemaTypePtr; + +typedef struct _xmlSchemaFacet xmlSchemaFacet; +typedef xmlSchemaFacet *xmlSchemaFacetPtr; + +/** + * Annotation + */ +typedef struct _xmlSchemaAnnot xmlSchemaAnnot; +typedef xmlSchemaAnnot *xmlSchemaAnnotPtr; +struct _xmlSchemaAnnot { + struct _xmlSchemaAnnot *next; + xmlNodePtr content; /* the annotation */ +}; + +/** + * XML_SCHEMAS_ANYATTR_SKIP: + * + * Skip unknown attribute from validation + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_SKIP 1 +/** + * XML_SCHEMAS_ANYATTR_LAX: + * + * Ignore validation non definition on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_LAX 2 +/** + * XML_SCHEMAS_ANYATTR_STRICT: + * + * Apply strict validation rules on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_STRICT 3 +/** + * XML_SCHEMAS_ANY_SKIP: + * + * Skip unknown attribute from validation + */ +#define XML_SCHEMAS_ANY_SKIP 1 +/** + * XML_SCHEMAS_ANY_LAX: + * + * Used by wildcards. + * Validate if type found, don't worry if not found + */ +#define XML_SCHEMAS_ANY_LAX 2 +/** + * XML_SCHEMAS_ANY_STRICT: + * + * Used by wildcards. + * Apply strict validation rules + */ +#define XML_SCHEMAS_ANY_STRICT 3 +/** + * XML_SCHEMAS_ATTR_USE_PROHIBITED: + * + * Used by wildcards. + * The attribute is prohibited. + */ +#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0 +/** + * XML_SCHEMAS_ATTR_USE_REQUIRED: + * + * The attribute is required. + */ +#define XML_SCHEMAS_ATTR_USE_REQUIRED 1 +/** + * XML_SCHEMAS_ATTR_USE_OPTIONAL: + * + * The attribute is optional. + */ +#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2 +/** + * XML_SCHEMAS_ATTR_GLOBAL: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0 +/** + * XML_SCHEMAS_ATTR_NSDEFAULT: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED: + * + * this is set when the "type" and "ref" references + * have been resolved. + */ +#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8 +/** + * XML_SCHEMAS_ATTR_FIXED: + * + * the attribute has a fixed value + */ +#define XML_SCHEMAS_ATTR_FIXED 1 << 9 + +/** + * xmlSchemaAttribute: + * An attribute definition. + */ + +typedef struct _xmlSchemaAttribute xmlSchemaAttribute; +typedef xmlSchemaAttribute *xmlSchemaAttributePtr; +struct _xmlSchemaAttribute { + xmlSchemaTypeType type; + struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */ + const xmlChar *name; /* the name of the declaration */ + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + const xmlChar *typeName; /* the local name of the type definition */ + const xmlChar *typeNs; /* the ns URI of the type definition */ + xmlSchemaAnnotPtr annot; + + xmlSchemaTypePtr base; /* Deprecated; not used */ + int occurs; /* Deprecated; not used */ + const xmlChar *defValue; /* The initial value of the value constraint */ + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlNodePtr node; + const xmlChar *targetNamespace; + int flags; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value constraint */ + xmlSchemaAttributePtr refDecl; /* Deprecated; not used */ +}; + +/** + * xmlSchemaAttributeLink: + * Used to build a list of attribute uses on complexType definitions. + * WARNING: Deprecated; not used. + */ +typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink; +typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr; +struct _xmlSchemaAttributeLink { + struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */ + struct _xmlSchemaAttribute *attr;/* the linked attribute */ +}; + +/** + * XML_SCHEMAS_WILDCARD_COMPLETE: + * + * If the wildcard is complete. + */ +#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0 + +/** + * xmlSchemaCharValueLink: + * Used to build a list of namespaces on wildcards. + */ +typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs; +typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr; +struct _xmlSchemaWildcardNs { + struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */ + const xmlChar *value;/* the value */ +}; + +/** + * xmlSchemaWildcard. + * A wildcard. + */ +typedef struct _xmlSchemaWildcard xmlSchemaWildcard; +typedef xmlSchemaWildcard *xmlSchemaWildcardPtr; +struct _xmlSchemaWildcard { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *id; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + int processContents; + int any; /* Indicates if the ns constraint is of ##any */ + xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */ + xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */ + int flags; +}; + +/** + * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED: + * + * The attribute wildcard has been built. + */ +#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0 +/** + * XML_SCHEMAS_ATTRGROUP_GLOBAL: + * + * The attribute group has been defined. + */ +#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ATTRGROUP_MARKED: + * + * Marks the attr group as marked; used for circular checks. + */ +#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2 + +/** + * XML_SCHEMAS_ATTRGROUP_REDEFINED: + * + * The attr group was redefined. + */ +#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3 +/** + * XML_SCHEMAS_ATTRGROUP_HAS_REFS: + * + * Whether this attr. group contains attr. group references. + */ +#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4 + +/** + * An attribute group definition. + * + * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures + * must be kept similar + */ +typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup; +typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr; +struct _xmlSchemaAttributeGroup { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ + const xmlChar *name; + const xmlChar *id; + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ + xmlNodePtr node; + int flags; + xmlSchemaWildcardPtr attributeWildcard; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */ + const xmlChar *targetNamespace; + void *attrUses; +}; + +/** + * xmlSchemaTypeLink: + * Used to build a list of types (e.g. member types of + * simpleType with variety "union"). + */ +typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink; +typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr; +struct _xmlSchemaTypeLink { + struct _xmlSchemaTypeLink *next;/* the next type link ... */ + xmlSchemaTypePtr type;/* the linked type */ +}; + +/** + * xmlSchemaFacetLink: + * Used to build a list of facets. + */ +typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink; +typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr; +struct _xmlSchemaFacetLink { + struct _xmlSchemaFacetLink *next;/* the next facet link ... */ + xmlSchemaFacetPtr facet;/* the linked facet */ +}; + +/** + * XML_SCHEMAS_TYPE_MIXED: + * + * the element content type is mixed + */ +#define XML_SCHEMAS_TYPE_MIXED 1 << 0 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION: + * + * the simple or complex type has a derivation method of "extension". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION: + * + * the simple or complex type has a derivation method of "restriction". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2 +/** + * XML_SCHEMAS_TYPE_GLOBAL: + * + * the type is global + */ +#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3 +/** + * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD: + * + * the complexType owns an attribute wildcard, i.e. + * it can be freed by the complexType + */ +#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */ +/** + * XML_SCHEMAS_TYPE_VARIETY_ABSENT: + * + * the simpleType has a variety of "absent". + * TODO: Actually not necessary :-/, since if + * none of the variety flags occur then it's + * automatically absent. + */ +#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5 +/** + * XML_SCHEMAS_TYPE_VARIETY_LIST: + * + * the simpleType has a variety of "list". + */ +#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6 +/** + * XML_SCHEMAS_TYPE_VARIETY_UNION: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7 +/** + * XML_SCHEMAS_TYPE_VARIETY_ATOMIC: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8 +/** + * XML_SCHEMAS_TYPE_FINAL_EXTENSION: + * + * the complexType has a final of "extension". + */ +#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9 +/** + * XML_SCHEMAS_TYPE_FINAL_RESTRICTION: + * + * the simpleType/complexType has a final of "restriction". + */ +#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10 +/** + * XML_SCHEMAS_TYPE_FINAL_LIST: + * + * the simpleType has a final of "list". + */ +#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11 +/** + * XML_SCHEMAS_TYPE_FINAL_UNION: + * + * the simpleType has a final of "union". + */ +#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12 +/** + * XML_SCHEMAS_TYPE_FINAL_DEFAULT: + * + * the simpleType has a final of "default". + */ +#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13 +/** + * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE: + * + * Marks the item as a builtin primitive. + */ +#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14 +/** + * XML_SCHEMAS_TYPE_MARKED: + * + * Marks the item as marked; used for circular checks. + */ +#define XML_SCHEMAS_TYPE_MARKED 1 << 16 +/** + * XML_SCHEMAS_TYPE_BLOCK_DEFAULT: + * + * the complexType did not specify 'block' so use the default of the + * item. + */ +#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17 +/** + * XML_SCHEMAS_TYPE_BLOCK_EXTENSION: + * + * the complexType has a 'block' of "extension". + */ +#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18 +/** + * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION: + * + * the complexType has a 'block' of "restriction". + */ +#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19 +/** + * XML_SCHEMAS_TYPE_ABSTRACT: + * + * the simple/complexType is abstract. + */ +#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20 +/** + * XML_SCHEMAS_TYPE_FACETSNEEDVALUE: + * + * indicates if the facets need a computed value + */ +#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21 +/** + * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED: + * + * indicates that the type was typefixed + */ +#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22 +/** + * XML_SCHEMAS_TYPE_INTERNAL_INVALID: + * + * indicates that the type is invalid + */ +#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE: + * + * a whitespace-facet value of "preserve" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE: + * + * a whitespace-facet value of "replace" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE: + * + * a whitespace-facet value of "collapse" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26 +/** + * XML_SCHEMAS_TYPE_HAS_FACETS: + * + * has facets + */ +#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27 +/** + * XML_SCHEMAS_TYPE_NORMVALUENEEDED: + * + * indicates if the facets (pattern) need a normalized value + */ +#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28 + +/** + * XML_SCHEMAS_TYPE_FIXUP_1: + * + * First stage of fixup was done. + */ +#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29 + +/** + * XML_SCHEMAS_TYPE_REDEFINED: + * + * The type was redefined. + */ +#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30 +/** + * XML_SCHEMAS_TYPE_REDEFINING: + * + * The type redefines an other type. + */ +/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */ + +/** + * _xmlSchemaType: + * + * Schemas type definition. + */ +struct _xmlSchemaType { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* the next type if in a sequence ... */ + const xmlChar *name; + const xmlChar *id ; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + + int flags; + xmlSchemaContentType contentType; + const xmlChar *base; /* Base type's local name */ + const xmlChar *baseNs; /* Base type's target namespace */ + xmlSchemaTypePtr baseType; /* The base type component */ + xmlSchemaFacetPtr facets; /* Local facets */ + struct _xmlSchemaType *redef; /* Deprecated; not used */ + int recurse; /* Obsolete */ + xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */ + xmlSchemaWildcardPtr attributeWildcard; + int builtInType; /* Type of built-in types. */ + xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */ + xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */ + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types. + Could we use @subtypes for this? */ + xmlRegexpPtr contModel; /* Holds the automaton of the content model */ + const xmlChar *targetNamespace; + void *attrUses; +}; + +/* + * xmlSchemaElement: + * An element definition. + * + * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of + * structures must be kept similar + */ +/** + * XML_SCHEMAS_ELEM_NILLABLE: + * + * the element is nillable + */ +#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0 +/** + * XML_SCHEMAS_ELEM_GLOBAL: + * + * the element is global + */ +#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ELEM_DEFAULT: + * + * the element has a default value + */ +#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2 +/** + * XML_SCHEMAS_ELEM_FIXED: + * + * the element has a fixed value + */ +#define XML_SCHEMAS_ELEM_FIXED 1 << 3 +/** + * XML_SCHEMAS_ELEM_ABSTRACT: + * + * the element is abstract + */ +#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4 +/** + * XML_SCHEMAS_ELEM_TOPLEVEL: + * + * the element is top level + * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead + */ +#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5 +/** + * XML_SCHEMAS_ELEM_REF: + * + * the element is a reference to a type + */ +#define XML_SCHEMAS_ELEM_REF 1 << 6 +/** + * XML_SCHEMAS_ELEM_NSDEFAULT: + * + * allow elements in no namespace + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED: + * + * this is set when "type", "ref", "substitutionGroup" + * references have been resolved. + */ +#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8 + /** + * XML_SCHEMAS_ELEM_CIRCULAR: + * + * a helper flag for the search of circular references. + */ +#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9 +/** + * XML_SCHEMAS_ELEM_BLOCK_ABSENT: + * + * the "block" attribute is absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10 +/** + * XML_SCHEMAS_ELEM_BLOCK_EXTENSION: + * + * disallowed substitutions are absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11 +/** + * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION: + * + * disallowed substitutions: "restriction" + */ +#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12 +/** + * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION: + * + * disallowed substitutions: "substitution" + */ +#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13 +/** + * XML_SCHEMAS_ELEM_FINAL_ABSENT: + * + * substitution group exclusions are absent + */ +#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14 +/** + * XML_SCHEMAS_ELEM_FINAL_EXTENSION: + * + * substitution group exclusions: "extension" + */ +#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15 +/** + * XML_SCHEMAS_ELEM_FINAL_RESTRICTION: + * + * substitution group exclusions: "restriction" + */ +#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16 +/** + * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD: + * + * the declaration is a substitution group head + */ +#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17 +/** + * XML_SCHEMAS_ELEM_INTERNAL_CHECKED: + * + * this is set when the elem decl has been checked against + * all constraints + */ +#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18 + +typedef struct _xmlSchemaElement xmlSchemaElement; +typedef xmlSchemaElement *xmlSchemaElementPtr; +struct _xmlSchemaElement { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* Not used? */ + const xmlChar *name; + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlSchemaAttributePtr attributes; + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + + int flags; + const xmlChar *targetNamespace; + const xmlChar *namedType; + const xmlChar *namedTypeNs; + const xmlChar *substGroup; + const xmlChar *substGroupNs; + const xmlChar *scope; + const xmlChar *value; /* The original value of the value constraint. */ + struct _xmlSchemaElement *refDecl; /* This will now be used for the + substitution group affiliation */ + xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */ + xmlSchemaContentType contentType; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value constraint. */ + void *idcs; /* The identity-constraint defs */ +}; + +/* + * XML_SCHEMAS_FACET_UNKNOWN: + * + * unknown facet handling + */ +#define XML_SCHEMAS_FACET_UNKNOWN 0 +/* + * XML_SCHEMAS_FACET_PRESERVE: + * + * preserve the type of the facet + */ +#define XML_SCHEMAS_FACET_PRESERVE 1 +/* + * XML_SCHEMAS_FACET_REPLACE: + * + * replace the type of the facet + */ +#define XML_SCHEMAS_FACET_REPLACE 2 +/* + * XML_SCHEMAS_FACET_COLLAPSE: + * + * collapse the types of the facet + */ +#define XML_SCHEMAS_FACET_COLLAPSE 3 +/** + * A facet definition. + */ +struct _xmlSchemaFacet { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */ + const xmlChar *value; /* The original value */ + const xmlChar *id; /* Obsolete */ + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */ + int whitespace; + xmlSchemaValPtr val; /* The compiled value */ + xmlRegexpPtr regexp; /* The regex for patterns */ +}; + +/** + * A notation definition. + */ +typedef struct _xmlSchemaNotation xmlSchemaNotation; +typedef xmlSchemaNotation *xmlSchemaNotationPtr; +struct _xmlSchemaNotation { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *name; + xmlSchemaAnnotPtr annot; + const xmlChar *identifier; + const xmlChar *targetNamespace; +}; + +/* +* TODO: Actually all those flags used for the schema should sit +* on the schema parser context, since they are used only +* during parsing an XML schema document, and not available +* on the component level as per spec. +*/ +/** + * XML_SCHEMAS_QUALIF_ELEM: + * + * Reflects elementFormDefault == qualified in + * an XML schema document. + */ +#define XML_SCHEMAS_QUALIF_ELEM 1 << 0 +/** + * XML_SCHEMAS_QUALIF_ATTR: + * + * Reflects attributeFormDefault == qualified in + * an XML schema document. + */ +#define XML_SCHEMAS_QUALIF_ATTR 1 << 1 +/** + * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2 +/** + * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3 +/** + * XML_SCHEMAS_FINAL_DEFAULT_LIST: + * + * the schema has "list" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4 +/** + * XML_SCHEMAS_FINAL_DEFAULT_UNION: + * + * the schema has "union" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION: + * + * the schema has "substitution" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8 +/** + * XML_SCHEMAS_INCLUDING_CONVERT_NS: + * + * the schema is currently including an other schema with + * no target namespace. + */ +#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9 +/** + * _xmlSchema: + * + * A Schemas definition + */ +struct _xmlSchema { + const xmlChar *name; /* schema name */ + const xmlChar *targetNamespace; /* the target namespace */ + const xmlChar *version; + const xmlChar *id; /* Obsolete */ + xmlDocPtr doc; + xmlSchemaAnnotPtr annot; + int flags; + + xmlHashTablePtr typeDecl; + xmlHashTablePtr attrDecl; + xmlHashTablePtr attrgrpDecl; + xmlHashTablePtr elemDecl; + xmlHashTablePtr notaDecl; + + xmlHashTablePtr schemasImports; + + void *_private; /* unused by the library for users or bindings */ + xmlHashTablePtr groupDecl; + xmlDictPtr dict; + void *includes; /* the includes, this is opaque for now */ + int preserve; /* whether to free the document */ + int counter; /* used to give anonymous components unique names */ + xmlHashTablePtr idcDef; /* All identity-constraint defs. */ + void *volatiles; /* Obsolete */ +}; + +XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); +XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_INTERNALS_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schematron.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schematron.h new file mode 100644 index 0000000..364eaec --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/schematron.h @@ -0,0 +1,142 @@ +/* + * Summary: XML Schemastron implementation + * Description: interface to the XML Schematron validity checking. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMATRON_H__ +#define __XML_SCHEMATRON_H__ + +#include + +#ifdef LIBXML_SCHEMATRON_ENABLED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */ + XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */ + XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */ + XML_SCHEMATRON_OUT_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */ + XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */ + XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */ + XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */ +} xmlSchematronValidOptions; + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchematron xmlSchematron; +typedef xmlSchematron *xmlSchematronPtr; + +/** + * xmlSchematronValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from a Schematron validation + */ +typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...); + +/** + * xmlSchematronValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from a Schematron validation + */ +typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...); + +/** + * A schemas validation context + */ +typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt; +typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr; + +typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt; +typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr; + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewMemParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewDocParserCtxt(xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); +/***** +XMLPUBFUN void XMLCALL + xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc * err, + xmlSchematronValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt); + *****/ +XMLPUBFUN xmlSchematronPtr XMLCALL + xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchematronFree (xmlSchematronPtr schema); +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlSchematronSetValidStructuredErrors( + xmlSchematronValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +/****** +XMLPUBFUN void XMLCALL + xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc *err, + xmlSchematronValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt, + xmlNodePtr elem); + *******/ + +XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL + xmlSchematronNewValidCtxt (xmlSchematronPtr schema, + int options); +XMLPUBFUN void XMLCALL + xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt, + xmlDocPtr instance); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMATRON_ENABLED */ +#endif /* __XML_SCHEMATRON_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/threads.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/threads.h new file mode 100644 index 0000000..9969ae7 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/threads.h @@ -0,0 +1,89 @@ +/** + * Summary: interfaces for thread handling + * Description: set of generic threading related routines + * should work with pthreads, Windows native or TLS threads + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_THREADS_H__ +#define __XML_THREADS_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlMutex are a simple mutual exception locks. + */ +typedef struct _xmlMutex xmlMutex; +typedef xmlMutex *xmlMutexPtr; + +/* + * xmlRMutex are reentrant mutual exception locks. + */ +typedef struct _xmlRMutex xmlRMutex; +typedef xmlRMutex *xmlRMutexPtr; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN xmlMutexPtr XMLCALL + xmlNewMutex (void); +XMLPUBFUN void XMLCALL + xmlMutexLock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlMutexUnlock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeMutex (xmlMutexPtr tok); + +XMLPUBFUN xmlRMutexPtr XMLCALL + xmlNewRMutex (void); +XMLPUBFUN void XMLCALL + xmlRMutexLock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlRMutexUnlock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeRMutex (xmlRMutexPtr tok); + +/* + * Library wide APIs. + */ +XMLPUBFUN void XMLCALL + xmlInitThreads (void); +XMLPUBFUN void XMLCALL + xmlLockLibrary (void); +XMLPUBFUN void XMLCALL + xmlUnlockLibrary(void); +XMLPUBFUN int XMLCALL + xmlGetThreadId (void); +XMLPUBFUN int XMLCALL + xmlIsMainThread (void); +XMLPUBFUN void XMLCALL + xmlCleanupThreads(void); +XMLPUBFUN xmlGlobalStatePtr XMLCALL + xmlGetGlobalState(void); + +#ifdef HAVE_PTHREAD_H +#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) +#if defined(LIBXML_STATIC_FOR_DLL) +int XMLCALL +xmlDllMain(void *hinstDLL, unsigned long fdwReason, + void *lpvReserved); +#endif +#endif + +#ifdef __cplusplus +} +#endif + + +#endif /* __XML_THREADS_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/tree.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/tree.h new file mode 100644 index 0000000..1e79be9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/tree.h @@ -0,0 +1,1311 @@ +/* + * Summary: interfaces for tree manipulation + * Description: this module describes the structures found in an tree resulting + * from an XML or HTML parsing, as well as the API provided for + * various processing on that tree + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_TREE_H__ +#define __XML_TREE_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Some of the basic types pointer to structures: + */ +/* xmlIO.h */ +typedef struct _xmlParserInputBuffer xmlParserInputBuffer; +typedef xmlParserInputBuffer *xmlParserInputBufferPtr; + +typedef struct _xmlOutputBuffer xmlOutputBuffer; +typedef xmlOutputBuffer *xmlOutputBufferPtr; + +/* parser.h */ +typedef struct _xmlParserInput xmlParserInput; +typedef xmlParserInput *xmlParserInputPtr; + +typedef struct _xmlParserCtxt xmlParserCtxt; +typedef xmlParserCtxt *xmlParserCtxtPtr; + +typedef struct _xmlSAXLocator xmlSAXLocator; +typedef xmlSAXLocator *xmlSAXLocatorPtr; + +typedef struct _xmlSAXHandler xmlSAXHandler; +typedef xmlSAXHandler *xmlSAXHandlerPtr; + +/* entities.h */ +typedef struct _xmlEntity xmlEntity; +typedef xmlEntity *xmlEntityPtr; + +/** + * BASE_BUFFER_SIZE: + * + * default buffer size 4000. + */ +#define BASE_BUFFER_SIZE 4096 + +/** + * LIBXML_NAMESPACE_DICT: + * + * Defines experimental behaviour: + * 1) xmlNs gets an additional field @context (a xmlDoc) + * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc. + */ +/* #define LIBXML_NAMESPACE_DICT */ + +/** + * xmlBufferAllocationScheme: + * + * A buffer allocation scheme can be defined to either match exactly the + * need or double it's allocated size each time it is found too small. + */ + +typedef enum { + XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ + XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ + XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ + XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */ + XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */ + XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */ +} xmlBufferAllocationScheme; + +/** + * xmlBuffer: + * + * A buffer structure, this old construct is limited to 2GB and + * is being deprecated, use API with xmlBuf instead + */ +typedef struct _xmlBuffer xmlBuffer; +typedef xmlBuffer *xmlBufferPtr; +struct _xmlBuffer { + xmlChar *content; /* The buffer content UTF8 */ + unsigned int use; /* The buffer size used */ + unsigned int size; /* The buffer size */ + xmlBufferAllocationScheme alloc; /* The realloc method */ + xmlChar *contentIO; /* in IO mode we may have a different base */ +}; + +/** + * xmlBuf: + * + * A buffer structure, new one, the actual structure internals are not public + */ + +typedef struct _xmlBuf xmlBuf; + +/** + * xmlBufPtr: + * + * A pointer to a buffer structure, the actual structure internals are not + * public + */ + +typedef xmlBuf *xmlBufPtr; + +/* + * A few public routines for xmlBuf. As those are expected to be used + * mostly internally the bulk of the routines are internal in buf.h + */ +XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBuf* buf); +XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (xmlBufPtr buf); +XMLPUBFUN size_t XMLCALL xmlBufUse (const xmlBufPtr buf); +XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len); + +/* + * LIBXML2_NEW_BUFFER: + * + * Macro used to express that the API use the new buffers for + * xmlParserInputBuffer and xmlOutputBuffer. The change was + * introduced in 2.9.0. + */ +#define LIBXML2_NEW_BUFFER + +/** + * XML_XML_NAMESPACE: + * + * This is the namespace for the special xml: prefix predefined in the + * XML Namespace specification. + */ +#define XML_XML_NAMESPACE \ + (const xmlChar *) "http://www.w3.org/XML/1998/namespace" + +/** + * XML_XML_ID: + * + * This is the name for the special xml:id attribute + */ +#define XML_XML_ID (const xmlChar *) "xml:id" + +/* + * The different element types carried by an XML tree. + * + * NOTE: This is synchronized with DOM Level1 values + * See http://www.w3.org/TR/REC-DOM-Level-1/ + * + * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should + * be deprecated to use an XML_DTD_NODE. + */ +typedef enum { + XML_ELEMENT_NODE= 1, + XML_ATTRIBUTE_NODE= 2, + XML_TEXT_NODE= 3, + XML_CDATA_SECTION_NODE= 4, + XML_ENTITY_REF_NODE= 5, + XML_ENTITY_NODE= 6, + XML_PI_NODE= 7, + XML_COMMENT_NODE= 8, + XML_DOCUMENT_NODE= 9, + XML_DOCUMENT_TYPE_NODE= 10, + XML_DOCUMENT_FRAG_NODE= 11, + XML_NOTATION_NODE= 12, + XML_HTML_DOCUMENT_NODE= 13, + XML_DTD_NODE= 14, + XML_ELEMENT_DECL= 15, + XML_ATTRIBUTE_DECL= 16, + XML_ENTITY_DECL= 17, + XML_NAMESPACE_DECL= 18, + XML_XINCLUDE_START= 19, + XML_XINCLUDE_END= 20 +#ifdef LIBXML_DOCB_ENABLED + ,XML_DOCB_DOCUMENT_NODE= 21 +#endif +} xmlElementType; + + +/** + * xmlNotation: + * + * A DTD Notation definition. + */ + +typedef struct _xmlNotation xmlNotation; +typedef xmlNotation *xmlNotationPtr; +struct _xmlNotation { + const xmlChar *name; /* Notation name */ + const xmlChar *PublicID; /* Public identifier, if any */ + const xmlChar *SystemID; /* System identifier, if any */ +}; + +/** + * xmlAttributeType: + * + * A DTD Attribute type definition. + */ + +typedef enum { + XML_ATTRIBUTE_CDATA = 1, + XML_ATTRIBUTE_ID, + XML_ATTRIBUTE_IDREF , + XML_ATTRIBUTE_IDREFS, + XML_ATTRIBUTE_ENTITY, + XML_ATTRIBUTE_ENTITIES, + XML_ATTRIBUTE_NMTOKEN, + XML_ATTRIBUTE_NMTOKENS, + XML_ATTRIBUTE_ENUMERATION, + XML_ATTRIBUTE_NOTATION +} xmlAttributeType; + +/** + * xmlAttributeDefault: + * + * A DTD Attribute default definition. + */ + +typedef enum { + XML_ATTRIBUTE_NONE = 1, + XML_ATTRIBUTE_REQUIRED, + XML_ATTRIBUTE_IMPLIED, + XML_ATTRIBUTE_FIXED +} xmlAttributeDefault; + +/** + * xmlEnumeration: + * + * List structure used when there is an enumeration in DTDs. + */ + +typedef struct _xmlEnumeration xmlEnumeration; +typedef xmlEnumeration *xmlEnumerationPtr; +struct _xmlEnumeration { + struct _xmlEnumeration *next; /* next one */ + const xmlChar *name; /* Enumeration name */ +}; + +/** + * xmlAttribute: + * + * An Attribute declaration in a DTD. + */ + +typedef struct _xmlAttribute xmlAttribute; +typedef xmlAttribute *xmlAttributePtr; +struct _xmlAttribute { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ + const xmlChar *name; /* Attribute name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + struct _xmlAttribute *nexth; /* next in hash table */ + xmlAttributeType atype; /* The attribute type */ + xmlAttributeDefault def; /* the default */ + const xmlChar *defaultValue; /* or the default value */ + xmlEnumerationPtr tree; /* or the enumeration tree if any */ + const xmlChar *prefix; /* the namespace prefix if any */ + const xmlChar *elem; /* Element holding the attribute */ +}; + +/** + * xmlElementContentType: + * + * Possible definitions of element content types. + */ +typedef enum { + XML_ELEMENT_CONTENT_PCDATA = 1, + XML_ELEMENT_CONTENT_ELEMENT, + XML_ELEMENT_CONTENT_SEQ, + XML_ELEMENT_CONTENT_OR +} xmlElementContentType; + +/** + * xmlElementContentOccur: + * + * Possible definitions of element content occurrences. + */ +typedef enum { + XML_ELEMENT_CONTENT_ONCE = 1, + XML_ELEMENT_CONTENT_OPT, + XML_ELEMENT_CONTENT_MULT, + XML_ELEMENT_CONTENT_PLUS +} xmlElementContentOccur; + +/** + * xmlElementContent: + * + * An XML Element content as stored after parsing an element definition + * in a DTD. + */ + +typedef struct _xmlElementContent xmlElementContent; +typedef xmlElementContent *xmlElementContentPtr; +struct _xmlElementContent { + xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ + xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ + const xmlChar *name; /* Element name */ + struct _xmlElementContent *c1; /* first child */ + struct _xmlElementContent *c2; /* second child */ + struct _xmlElementContent *parent; /* parent */ + const xmlChar *prefix; /* Namespace prefix */ +}; + +/** + * xmlElementTypeVal: + * + * The different possibilities for an element content type. + */ + +typedef enum { + XML_ELEMENT_TYPE_UNDEFINED = 0, + XML_ELEMENT_TYPE_EMPTY = 1, + XML_ELEMENT_TYPE_ANY, + XML_ELEMENT_TYPE_MIXED, + XML_ELEMENT_TYPE_ELEMENT +} xmlElementTypeVal; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlElement: + * + * An XML Element declaration from a DTD. + */ + +typedef struct _xmlElement xmlElement; +typedef xmlElement *xmlElementPtr; +struct _xmlElement { + void *_private; /* application data */ + xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ + const xmlChar *name; /* Element name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlElementTypeVal etype; /* The type */ + xmlElementContentPtr content; /* the allowed element content */ + xmlAttributePtr attributes; /* List of the declared attributes */ + const xmlChar *prefix; /* the namespace prefix if any */ +#ifdef LIBXML_REGEXP_ENABLED + xmlRegexpPtr contModel; /* the validating regexp */ +#else + void *contModel; +#endif +}; + + +/** + * XML_LOCAL_NAMESPACE: + * + * A namespace declaration node. + */ +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; + +/** + * xmlNs: + * + * An XML namespace. + * Note that prefix == NULL is valid, it defines the default namespace + * within the subtree (until overridden). + * + * xmlNsType is unified with xmlElementType. + */ + +typedef struct _xmlNs xmlNs; +typedef xmlNs *xmlNsPtr; +struct _xmlNs { + struct _xmlNs *next; /* next Ns link for this node */ + xmlNsType type; /* global or local */ + const xmlChar *href; /* URL for the namespace */ + const xmlChar *prefix; /* prefix for the namespace */ + void *_private; /* application data */ + struct _xmlDoc *context; /* normally an xmlDoc */ +}; + +/** + * xmlDtd: + * + * An XML DTD, as defined by parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + void *notations; /* Hash table for notations if any */ + void *elements; /* Hash table for elements if any */ + void *attributes; /* Hash table for attributes if any */ + void *entities; /* Hash table for entities if any */ + const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ + void *pentities; /* Hash table for param entities if any */ +}; + +/** + * xmlAttr: + * + * An attribute on an XML node. + */ +typedef struct _xmlAttr xmlAttr; +typedef xmlAttr *xmlAttrPtr; +struct _xmlAttr { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ + const xmlChar *name; /* the name of the property */ + struct _xmlNode *children; /* the value of the property */ + struct _xmlNode *last; /* NULL */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlAttr *next; /* next sibling link */ + struct _xmlAttr *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlAttributeType atype; /* the attribute type if validating */ + void *psvi; /* for type/PSVI information */ +}; + +/** + * xmlID: + * + * An XML ID instance. + */ + +typedef struct _xmlID xmlID; +typedef xmlID *xmlIDPtr; +struct _xmlID { + struct _xmlID *next; /* next ID */ + const xmlChar *value; /* The ID name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ + struct _xmlDoc *doc; /* The document holding the ID */ +}; + +/** + * xmlRef: + * + * An XML IDREF instance. + */ + +typedef struct _xmlRef xmlRef; +typedef xmlRef *xmlRefPtr; +struct _xmlRef { + struct _xmlRef *next; /* next Ref */ + const xmlChar *value; /* The Ref name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ +}; + +/** + * xmlNode: + * + * A node in an XML tree. + */ +typedef struct _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; +struct _xmlNode { + void *_private; /* application data */ + xmlElementType type; /* type number, must be second ! */ + const xmlChar *name; /* the name of the node, or the entity */ + struct _xmlNode *children; /* parent->childs link */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlChar *content; /* the content */ + struct _xmlAttr *properties;/* properties list */ + xmlNs *nsDef; /* namespace definitions on this node */ + void *psvi; /* for type/PSVI information */ + unsigned short line; /* line number */ + unsigned short extra; /* extra data for XPath/XSLT */ +}; + +/** + * XML_GET_CONTENT: + * + * Macro to extract the content pointer of a node. + */ +#define XML_GET_CONTENT(n) \ + ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content) + +/** + * XML_GET_LINE: + * + * Macro to extract the line number of an element node. + */ +#define XML_GET_LINE(n) \ + (xmlGetLineNo(n)) + +/** + * xmlDocProperty + * + * Set of properties of the document as found by the parser + * Some of them are linked to similarly named xmlParserOption + */ +typedef enum { + XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */ + XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */ + XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */ + XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */ + XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */ + XML_DOC_USERBUILT = 1<<5, /* Document was built using the API + and not by parsing an instance */ + XML_DOC_INTERNAL = 1<<6, /* built for internal processing */ + XML_DOC_HTML = 1<<7 /* parsed or built HTML document */ +} xmlDocProperties; + +/** + * xmlDoc: + * + * An XML document. + */ +typedef struct _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; +struct _xmlDoc { + void *_private; /* application data */ + xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ + char *name; /* name/filename/URI of the document */ + struct _xmlNode *children; /* the document tree */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* autoreference to itself */ + + /* End of common part */ + int compression;/* level of zlib compression */ + int standalone; /* standalone document (no external refs) + 1 if standalone="yes" + 0 if standalone="no" + -1 if there is no XML declaration + -2 if there is an XML declaration, but no + standalone attribute was specified */ + struct _xmlDtd *intSubset; /* the document internal subset */ + struct _xmlDtd *extSubset; /* the document external subset */ + struct _xmlNs *oldNs; /* Global namespace, the old way */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* external initial encoding, if any */ + void *ids; /* Hash table for ID attributes if any */ + void *refs; /* Hash table for IDREFs attributes if any */ + const xmlChar *URL; /* The URI for that document */ + int charset; /* Internal flag for charset handling, + actually an xmlCharEncoding */ + struct _xmlDict *dict; /* dict used to allocate names or NULL */ + void *psvi; /* for type/PSVI information */ + int parseFlags; /* set of xmlParserOption used to parse the + document */ + int properties; /* set of xmlDocProperties for this document + set at the end of parsing */ +}; + + +typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt; +typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr; + +/** + * xmlDOMWrapAcquireNsFunction: + * @ctxt: a DOM wrapper context + * @node: the context node (element or attribute) + * @nsName: the requested namespace name + * @nsPrefix: the requested namespace prefix + * + * A function called to acquire namespaces (xmlNs) from the wrapper. + * + * Returns an xmlNsPtr or NULL in case of an error. + */ +typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr node, + const xmlChar *nsName, + const xmlChar *nsPrefix); + +/** + * xmlDOMWrapCtxt: + * + * Context for DOM wrapper-operations. + */ +struct _xmlDOMWrapCtxt { + void * _private; + /* + * The type of this context, just in case we need specialized + * contexts in the future. + */ + int type; + /* + * Internal namespace map used for various operations. + */ + void * namespaceMap; + /* + * Use this one to acquire an xmlNsPtr intended for node->ns. + * (Note that this is not intended for elem->nsDef). + */ + xmlDOMWrapAcquireNsFunction getNsForNodeFunc; +}; + +/** + * xmlChildrenNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children." + */ +#ifndef xmlChildrenNode +#define xmlChildrenNode children +#endif + +/** + * xmlRootNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children". + */ +#ifndef xmlRootNode +#define xmlRootNode children +#endif + +/* + * Variables. + */ + +/* + * Some helper functions + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \ + defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \ + defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \ + defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNCName (const xmlChar *value, + int space); +#endif + +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateQName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateNMToken (const xmlChar *value, + int space); +#endif + +XMLPUBFUN xmlChar * XMLCALL + xmlBuildQName (const xmlChar *ncname, + const xmlChar *prefix, + xmlChar *memory, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName2 (const xmlChar *name, + xmlChar **prefix); +XMLPUBFUN const xmlChar * XMLCALL + xmlSplitQName3 (const xmlChar *name, + int *len); + +/* + * Handling Buffers, the old ones see @xmlBuf for the new ones. + */ + +XMLPUBFUN void XMLCALL + xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); +XMLPUBFUN xmlBufferAllocationScheme XMLCALL + xmlGetBufferAllocationScheme(void); + +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreate (void); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateSize (size_t size); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateStatic (void *mem, + size_t size); +XMLPUBFUN int XMLCALL + xmlBufferResize (xmlBufferPtr buf, + unsigned int size); +XMLPUBFUN void XMLCALL + xmlBufferFree (xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferDump (FILE *file, + xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferAdd (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferAddHead (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferCat (xmlBufferPtr buf, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlBufferCCat (xmlBufferPtr buf, + const char *str); +XMLPUBFUN int XMLCALL + xmlBufferShrink (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN int XMLCALL + xmlBufferGrow (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN void XMLCALL + xmlBufferEmpty (xmlBufferPtr buf); +XMLPUBFUN const xmlChar* XMLCALL + xmlBufferContent (const xmlBuffer *buf); +XMLPUBFUN xmlChar* XMLCALL + xmlBufferDetach (xmlBufferPtr buf); +XMLPUBFUN void XMLCALL + xmlBufferSetAllocationScheme(xmlBufferPtr buf, + xmlBufferAllocationScheme scheme); +XMLPUBFUN int XMLCALL + xmlBufferLength (const xmlBuffer *buf); + +/* + * Creating/freeing new structures. + */ +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCreateIntSubset (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlNewDtd (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlGetIntSubset (const xmlDoc *doc); +XMLPUBFUN void XMLCALL + xmlFreeDtd (xmlDtdPtr cur); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewGlobalNs (xmlDocPtr doc, + const xmlChar *href, + const xmlChar *prefix); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewNs (xmlNodePtr node, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlFreeNs (xmlNsPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNsList (xmlNsPtr cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlNewDoc (const xmlChar *version); +XMLPUBFUN void XMLCALL + xmlFreeDoc (xmlDocPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewDocProp (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *value); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +#endif +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsPropEatName (xmlNodePtr node, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlFreePropList (xmlAttrPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeProp (xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyProp (xmlNodePtr target, + xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyPropList (xmlNodePtr target, + xmlAttrPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCopyDtd (xmlDtdPtr dtd); +#endif /* LIBXML_TREE_ENABLED */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlDocPtr XMLCALL + xmlCopyDoc (xmlDocPtr doc, + int recursive); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ +/* + * Creating new nodes. + */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNodeEatName (xmlDocPtr doc, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNode (xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNodeEatName (xmlNsPtr ns, + xmlChar *name); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +#endif +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocText (const xmlDoc *doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewText (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocPI (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewPI (const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocTextLen (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextLen (const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocComment (xmlDocPtr doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewComment (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCDataBlock (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCharRef (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewReference (const xmlDoc *doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNode (xmlNodePtr node, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNode (xmlNodePtr node, + xmlDocPtr doc, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNodeList (xmlDocPtr doc, + xmlNodePtr node); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNodeList (xmlNodePtr node); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocRawNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocFragment (xmlDocPtr doc); +#endif /* LIBXML_TREE_ENABLED */ + +/* + * Navigating. + */ +XMLPUBFUN long XMLCALL + xmlGetLineNo (const xmlNode *node); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) +XMLPUBFUN xmlChar * XMLCALL + xmlGetNodePath (const xmlNode *node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocGetRootElement (const xmlDoc *doc); +XMLPUBFUN xmlNodePtr XMLCALL + xmlGetLastChild (const xmlNode *parent); +XMLPUBFUN int XMLCALL + xmlNodeIsText (const xmlNode *node); +XMLPUBFUN int XMLCALL + xmlIsBlankNode (const xmlNode *node); + +/* + * Changing the structure. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocSetRootElement (xmlDocPtr doc, + xmlNodePtr root); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetName (xmlNodePtr cur, + const xmlChar *name); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChild (xmlNodePtr parent, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChildList (xmlNodePtr parent, + xmlNodePtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlReplaceNode (xmlNodePtr old, + xmlNodePtr cur); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddPrevSibling (xmlNodePtr cur, + xmlNodePtr elem); +#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddNextSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN void XMLCALL + xmlUnlinkNode (xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextMerge (xmlNodePtr first, + xmlNodePtr second); +XMLPUBFUN int XMLCALL + xmlTextConcat (xmlNodePtr node, + const xmlChar *content, + int len); +XMLPUBFUN void XMLCALL + xmlFreeNodeList (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNode (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlSetTreeDoc (xmlNodePtr tree, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSetListDoc (xmlNodePtr list, + xmlDocPtr doc); +/* + * Namespaces. + */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNs (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *nameSpace); +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNsByHref (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *href); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNsPtr * XMLCALL + xmlGetNsList (const xmlDoc *doc, + const xmlNode *node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ + +XMLPUBFUN void XMLCALL + xmlSetNs (xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespace (xmlNsPtr cur); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespaceList (xmlNsPtr cur); + +/* + * Changing the content. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ +XMLPUBFUN xmlChar * XMLCALL + xmlGetNoNsProp (const xmlNode *node, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlGetProp (const xmlNode *node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasProp (const xmlNode *node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasNsProp (const xmlNode *node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlChar * XMLCALL + xmlGetNsProp (const xmlNode *node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringGetNodeList (const xmlDoc *doc, + const xmlChar *value); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringLenGetNodeList (const xmlDoc *doc, + const xmlChar *value, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetString (xmlDocPtr doc, + const xmlNode *list, + int inLine); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetRawString (const xmlDoc *doc, + const xmlNode *list, + int inLine); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeSetContent (xmlNodePtr cur, + const xmlChar *content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeAddContent (xmlNodePtr cur, + const xmlChar *content); +XMLPUBFUN void XMLCALL + xmlNodeAddContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetContent (const xmlNode *cur); + +XMLPUBFUN int XMLCALL + xmlNodeBufGetContent (xmlBufferPtr buffer, + const xmlNode *cur); +XMLPUBFUN int XMLCALL + xmlBufGetNodeContent (xmlBufPtr buf, + const xmlNode *cur); + +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetLang (const xmlNode *cur); +XMLPUBFUN int XMLCALL + xmlNodeGetSpacePreserve (const xmlNode *cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetLang (xmlNodePtr cur, + const xmlChar *lang); +XMLPUBFUN void XMLCALL + xmlNodeSetSpacePreserve (xmlNodePtr cur, + int val); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetBase (const xmlDoc *doc, + const xmlNode *cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) +XMLPUBFUN void XMLCALL + xmlNodeSetBase (xmlNodePtr cur, + const xmlChar *uri); +#endif + +/* + * Removing content. + */ +XMLPUBFUN int XMLCALL + xmlRemoveProp (xmlAttrPtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlUnsetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlUnsetProp (xmlNodePtr node, + const xmlChar *name); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ + +/* + * Internal, don't use. + */ +XMLPUBFUN void XMLCALL + xmlBufferWriteCHAR (xmlBufferPtr buf, + const xmlChar *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteChar (xmlBufferPtr buf, + const char *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteQuotedString(xmlBufferPtr buf, + const xmlChar *string); + +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf, + xmlDocPtr doc, + xmlAttrPtr attr, + const xmlChar *string); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef LIBXML_TREE_ENABLED +/* + * Namespace handling. + */ +XMLPUBFUN int XMLCALL + xmlReconciliateNs (xmlDocPtr doc, + xmlNodePtr tree); +#endif + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Saving. + */ +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemory (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); +XMLPUBFUN void XMLCALL + xmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN void XMLCALL + xmlDocDumpMemoryEnc (xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding); +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding, + int format); +XMLPUBFUN int XMLCALL + xmlDocFormatDump (FILE *f, + xmlDocPtr cur, + int format); +XMLPUBFUN int XMLCALL + xmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN void XMLCALL + xmlElemDump (FILE *f, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFormatFile (const char *filename, + xmlDocPtr cur, + int format); +XMLPUBFUN size_t XMLCALL + xmlBufNodeDump (xmlBufPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format); +XMLPUBFUN int XMLCALL + xmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlSaveFormatFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + xmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format, + const char *encoding); + +XMLPUBFUN int XMLCALL + xmlSaveFormatFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * XHTML + */ +XMLPUBFUN int XMLCALL + xmlIsXHTML (const xmlChar *systemID, + const xmlChar *publicID); + +/* + * Compression. + */ +XMLPUBFUN int XMLCALL + xmlGetDocCompressMode (const xmlDoc *doc); +XMLPUBFUN void XMLCALL + xmlSetDocCompressMode (xmlDocPtr doc, + int mode); +XMLPUBFUN int XMLCALL + xmlGetCompressMode (void); +XMLPUBFUN void XMLCALL + xmlSetCompressMode (int mode); + +/* +* DOM-wrapper helper functions. +*/ +XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL + xmlDOMWrapNewCtxt (void); +XMLPUBFUN void XMLCALL + xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr elem, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr sourceDoc, + xmlNodePtr node, + xmlDocPtr destDoc, + xmlNodePtr destParent, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr node, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr sourceDoc, + xmlNodePtr node, + xmlNodePtr *clonedNode, + xmlDocPtr destDoc, + xmlNodePtr destParent, + int deep, + int options); + +#ifdef LIBXML_TREE_ENABLED +/* + * 5 interfaces from DOM ElementTraversal, but different in entities + * traversal. + */ +XMLPUBFUN unsigned long XMLCALL + xmlChildElementCount (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNextElementSibling (xmlNodePtr node); +XMLPUBFUN xmlNodePtr XMLCALL + xmlFirstElementChild (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlLastElementChild (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlPreviousElementSibling (xmlNodePtr node); +#endif +#ifdef __cplusplus +} +#endif +#ifndef __XML_PARSER_H__ +#include +#endif + +#endif /* __XML_TREE_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/uri.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/uri.h new file mode 100644 index 0000000..db48262 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/uri.h @@ -0,0 +1,94 @@ +/** + * Summary: library of generic URI related routines + * Description: library of generic URI related routines + * Implements RFC 2396 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_URI_H__ +#define __XML_URI_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlURI: + * + * A parsed URI reference. This is a struct containing the various fields + * as described in RFC 2396 but separated for further processing. + * + * Note: query is a deprecated field which is incorrectly unescaped. + * query_raw takes precedence over query if the former is set. + * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127 + */ +typedef struct _xmlURI xmlURI; +typedef xmlURI *xmlURIPtr; +struct _xmlURI { + char *scheme; /* the URI scheme */ + char *opaque; /* opaque part */ + char *authority; /* the authority part */ + char *server; /* the server part */ + char *user; /* the user part */ + int port; /* the port number */ + char *path; /* the path string */ + char *query; /* the query string (deprecated - use with caution) */ + char *fragment; /* the fragment identifier */ + int cleanup; /* parsing potentially unclean URI */ + char *query_raw; /* the query string (as it appears in the URI) */ +}; + +/* + * This function is in tree.h: + * xmlChar * xmlNodeGetBase (xmlDocPtr doc, + * xmlNodePtr cur); + */ +XMLPUBFUN xmlURIPtr XMLCALL + xmlCreateURI (void); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildRelativeURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURI (const char *str); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURIRaw (const char *str, + int raw); +XMLPUBFUN int XMLCALL + xmlParseURIReference (xmlURIPtr uri, + const char *str); +XMLPUBFUN xmlChar * XMLCALL + xmlSaveUri (xmlURIPtr uri); +XMLPUBFUN void XMLCALL + xmlPrintURI (FILE *stream, + xmlURIPtr uri); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscapeStr (const xmlChar *str, + const xmlChar *list); +XMLPUBFUN char * XMLCALL + xmlURIUnescapeString (const char *str, + int len, + char *target); +XMLPUBFUN int XMLCALL + xmlNormalizeURIPath (char *path); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscape (const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlFreeURI (xmlURIPtr uri); +XMLPUBFUN xmlChar* XMLCALL + xmlCanonicPath (const xmlChar *path); +XMLPUBFUN xmlChar* XMLCALL + xmlPathToURI (const xmlChar *path); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_URI_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/valid.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/valid.h new file mode 100644 index 0000000..2bc7b38 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/valid.h @@ -0,0 +1,458 @@ +/* + * Summary: The DTD validation + * Description: API for the DTD handling and the validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_VALID_H__ +#define __XML_VALID_H__ + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Validation state added for non-determinist content model. + */ +typedef struct _xmlValidState xmlValidState; +typedef xmlValidState *xmlValidStatePtr; + +/** + * xmlValidityErrorFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity error is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); + +/** + * xmlValidityWarningFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity warning is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); + +#ifdef IN_LIBXML +/** + * XML_CTXT_FINISH_DTD_0: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_0 0xabcd1234 +/** + * XML_CTXT_FINISH_DTD_1: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_1 0xabcd1235 +#endif + +/* + * xmlValidCtxt: + * An xmlValidCtxt is used for error reporting when validating. + */ +typedef struct _xmlValidCtxt xmlValidCtxt; +typedef xmlValidCtxt *xmlValidCtxtPtr; +struct _xmlValidCtxt { + void *userData; /* user specific data block */ + xmlValidityErrorFunc error; /* the callback in case of errors */ + xmlValidityWarningFunc warning; /* the callback in case of warning */ + + /* Node analysis stack used when validating within entities */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + unsigned int finishDtd; /* finished validating the Dtd ? */ + xmlDocPtr doc; /* the document */ + int valid; /* temporary validity check result */ + + /* state state used for non-determinist content validation */ + xmlValidState *vstate; /* current state */ + int vstateNr; /* Depth of the validation stack */ + int vstateMax; /* Max depth of the validation stack */ + xmlValidState *vstateTab; /* array of validation states */ + +#ifdef LIBXML_REGEXP_ENABLED + xmlAutomataPtr am; /* the automata */ + xmlAutomataStatePtr state; /* used to build the automata */ +#else + void *am; + void *state; +#endif +}; + +/* + * ALL notation declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlNotationTable; +typedef xmlNotationTable *xmlNotationTablePtr; + +/* + * ALL element declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlElementTable; +typedef xmlElementTable *xmlElementTablePtr; + +/* + * ALL attribute declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlAttributeTable; +typedef xmlAttributeTable *xmlAttributeTablePtr; + +/* + * ALL IDs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlIDTable; +typedef xmlIDTable *xmlIDTablePtr; + +/* + * ALL Refs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlRefTable; +typedef xmlRefTable *xmlRefTablePtr; + +/* Notation */ +XMLPUBFUN xmlNotationPtr XMLCALL + xmlAddNotationDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *PublicID, + const xmlChar *SystemID); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNotationTablePtr XMLCALL + xmlCopyNotationTable (xmlNotationTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeNotationTable (xmlNotationTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpNotationDecl (xmlBufferPtr buf, + xmlNotationPtr nota); +XMLPUBFUN void XMLCALL + xmlDumpNotationTable (xmlBufferPtr buf, + xmlNotationTablePtr table); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Element Content */ +/* the non Doc version are being deprecated */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewElementContent (const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyElementContent (xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeElementContent (xmlElementContentPtr cur); +/* the new versions with doc argument */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewDocElementContent (xmlDocPtr doc, + const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyDocElementContent(xmlDocPtr doc, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeDocElementContent(xmlDocPtr doc, + xmlElementContentPtr cur); +XMLPUBFUN void XMLCALL + xmlSnprintfElementContent(char *buf, + int size, + xmlElementContentPtr content, + int englob); +#ifdef LIBXML_OUTPUT_ENABLED +/* DEPRECATED */ +XMLPUBFUN void XMLCALL + xmlSprintfElementContent(char *buf, + xmlElementContentPtr content, + int englob); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* DEPRECATED */ + +/* Element */ +XMLPUBFUN xmlElementPtr XMLCALL + xmlAddElementDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + xmlElementTypeVal type, + xmlElementContentPtr content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlElementTablePtr XMLCALL + xmlCopyElementTable (xmlElementTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeElementTable (xmlElementTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpElementTable (xmlBufferPtr buf, + xmlElementTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpElementDecl (xmlBufferPtr buf, + xmlElementPtr elem); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Enumeration */ +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCreateEnumeration (const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlFreeEnumeration (xmlEnumerationPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCopyEnumeration (xmlEnumerationPtr cur); +#endif /* LIBXML_TREE_ENABLED */ + +/* Attribute */ +XMLPUBFUN xmlAttributePtr XMLCALL + xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *ns, + xmlAttributeType type, + xmlAttributeDefault def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlAttributeTablePtr XMLCALL + xmlCopyAttributeTable (xmlAttributeTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeAttributeTable (xmlAttributeTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpAttributeTable (xmlBufferPtr buf, + xmlAttributeTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpAttributeDecl (xmlBufferPtr buf, + xmlAttributePtr attr); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* IDs */ +XMLPUBFUN xmlIDPtr XMLCALL + xmlAddID (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeIDTable (xmlIDTablePtr table); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlGetID (xmlDocPtr doc, + const xmlChar *ID); +XMLPUBFUN int XMLCALL + xmlIsID (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveID (xmlDocPtr doc, + xmlAttrPtr attr); + +/* IDREFs */ +XMLPUBFUN xmlRefPtr XMLCALL + xmlAddRef (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeRefTable (xmlRefTablePtr table); +XMLPUBFUN int XMLCALL + xmlIsRef (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveRef (xmlDocPtr doc, + xmlAttrPtr attr); +XMLPUBFUN xmlListPtr XMLCALL + xmlGetRefs (xmlDocPtr doc, + const xmlChar *ID); + +/** + * The public function calls related to validity checking. + */ +#ifdef LIBXML_VALID_ENABLED +/* Allocate/Release Validation Contexts */ +XMLPUBFUN xmlValidCtxtPtr XMLCALL + xmlNewValidCtxt(void); +XMLPUBFUN void XMLCALL + xmlFreeValidCtxt(xmlValidCtxtPtr); + +XMLPUBFUN int XMLCALL + xmlValidateRoot (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElementDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlElementPtr elem); +XMLPUBFUN xmlChar * XMLCALL + xmlValidNormalizeAttributeValue(xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlAttributePtr attr); +XMLPUBFUN int XMLCALL + xmlValidateAttributeValue(xmlAttributeType type, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNotationPtr nota); +XMLPUBFUN int XMLCALL + xmlValidateDtd (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlDtdPtr dtd); +XMLPUBFUN int XMLCALL + xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateDocument (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *prefix, + xmlNsPtr ns, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +#endif /* LIBXML_VALID_ENABLED */ + +#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNotationUse (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *notationName); +#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlIsMixedElement (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdQAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlNotationPtr XMLCALL + xmlGetDtdNotationDesc (xmlDtdPtr dtd, + const xmlChar *name); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdQElementDesc (xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdElementDesc (xmlDtdPtr dtd, + const xmlChar *name); + +#ifdef LIBXML_VALID_ENABLED + +XMLPUBFUN int XMLCALL + xmlValidGetPotentialChildren(xmlElementContent *ctree, + const xmlChar **names, + int *len, + int max); + +XMLPUBFUN int XMLCALL + xmlValidGetValidElements(xmlNode *prev, + xmlNode *next, + const xmlChar **names, + int max); +XMLPUBFUN int XMLCALL + xmlValidateNameValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNamesValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokenValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokensValue(const xmlChar *value); + +#ifdef LIBXML_REGEXP_ENABLED +/* + * Validation based on the regexp support + */ +XMLPUBFUN int XMLCALL + xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, + xmlElementPtr elem); + +XMLPUBFUN int XMLCALL + xmlValidatePushElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +XMLPUBFUN int XMLCALL + xmlValidatePushCData (xmlValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlValidatePopElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +#endif /* LIBXML_REGEXP_ENABLED */ +#endif /* LIBXML_VALID_ENABLED */ +#ifdef __cplusplus +} +#endif +#endif /* __XML_VALID_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xinclude.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xinclude.h new file mode 100644 index 0000000..863ab25 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xinclude.h @@ -0,0 +1,129 @@ +/* + * Summary: implementation of XInclude + * Description: API to handle XInclude processing, + * implements the + * World Wide Web Consortium Last Call Working Draft 10 November 2003 + * http://www.w3.org/TR/2003/WD-xinclude-20031110 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XINCLUDE_H__ +#define __XML_XINCLUDE_H__ + +#include +#include + +#ifdef LIBXML_XINCLUDE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XINCLUDE_NS: + * + * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude + */ +#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude" +/** + * XINCLUDE_OLD_NS: + * + * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude + */ +#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude" +/** + * XINCLUDE_NODE: + * + * Macro defining "include" + */ +#define XINCLUDE_NODE (const xmlChar *) "include" +/** + * XINCLUDE_FALLBACK: + * + * Macro defining "fallback" + */ +#define XINCLUDE_FALLBACK (const xmlChar *) "fallback" +/** + * XINCLUDE_HREF: + * + * Macro defining "href" + */ +#define XINCLUDE_HREF (const xmlChar *) "href" +/** + * XINCLUDE_PARSE: + * + * Macro defining "parse" + */ +#define XINCLUDE_PARSE (const xmlChar *) "parse" +/** + * XINCLUDE_PARSE_XML: + * + * Macro defining "xml" + */ +#define XINCLUDE_PARSE_XML (const xmlChar *) "xml" +/** + * XINCLUDE_PARSE_TEXT: + * + * Macro defining "text" + */ +#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text" +/** + * XINCLUDE_PARSE_ENCODING: + * + * Macro defining "encoding" + */ +#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding" +/** + * XINCLUDE_PARSE_XPOINTER: + * + * Macro defining "xpointer" + */ +#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer" + +typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; +typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; + +/* + * standalone processing + */ +XMLPUBFUN int XMLCALL + xmlXIncludeProcess (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlags (xmlDocPtr doc, + int flags); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlagsData(xmlDocPtr doc, + int flags, + void *data); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree, + int flags, + void *data); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTree (xmlNodePtr tree); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTreeFlags(xmlNodePtr tree, + int flags); +/* + * contextual processing + */ +XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL + xmlXIncludeNewContext (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt, + int flags); +XMLPUBFUN void XMLCALL + xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt, + xmlNodePtr tree); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XINCLUDE_ENABLED */ + +#endif /* __XML_XINCLUDE_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xlink.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xlink.h new file mode 100644 index 0000000..04e4b32 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xlink.h @@ -0,0 +1,189 @@ +/* + * Summary: unfinished XLink detection module + * Description: unfinished XLink detection module + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XLINK_H__ +#define __XML_XLINK_H__ + +#include +#include + +#ifdef LIBXML_XPTR_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Various defines for the various Link properties. + * + * NOTE: the link detection layer will try to resolve QName expansion + * of namespaces. If "foo" is the prefix for "http://foo.com/" + * then the link detection layer will expand role="foo:myrole" + * to "http://foo.com/:myrole". + * NOTE: the link detection layer will expand URI-References found on + * href attributes by using the base mechanism if found. + */ +typedef xmlChar *xlinkHRef; +typedef xmlChar *xlinkRole; +typedef xmlChar *xlinkTitle; + +typedef enum { + XLINK_TYPE_NONE = 0, + XLINK_TYPE_SIMPLE, + XLINK_TYPE_EXTENDED, + XLINK_TYPE_EXTENDED_SET +} xlinkType; + +typedef enum { + XLINK_SHOW_NONE = 0, + XLINK_SHOW_NEW, + XLINK_SHOW_EMBED, + XLINK_SHOW_REPLACE +} xlinkShow; + +typedef enum { + XLINK_ACTUATE_NONE = 0, + XLINK_ACTUATE_AUTO, + XLINK_ACTUATE_ONREQUEST +} xlinkActuate; + +/** + * xlinkNodeDetectFunc: + * @ctx: user data pointer + * @node: the node to check + * + * This is the prototype for the link detection routine. + * It calls the default link detection callbacks upon link detection. + */ +typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); + +/* + * The link detection module interact with the upper layers using + * a set of callback registered at parsing time. + */ + +/** + * xlinkSimpleLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @href: the target of the link + * @role: the role string + * @title: the link title + * + * This is the prototype for a simple link detection callback. + */ +typedef void +(*xlinkSimpleLinkFunk) (void *ctx, + xmlNodePtr node, + const xlinkHRef href, + const xlinkRole role, + const xlinkTitle title); + +/** + * xlinkExtendedLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbArcs: the number of arcs detected on the link + * @from: pointer to the array of source roles found on the arcs + * @to: pointer to the array of target roles found on the arcs + * @show: array of values for the show attributes found on the arcs + * @actuate: array of values for the actuate attributes found on the arcs + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link detection callback. + */ +typedef void +(*xlinkExtendedLinkFunk)(void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbArcs, + const xlinkRole *from, + const xlinkRole *to, + xlinkShow *show, + xlinkActuate *actuate, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * xlinkExtendedLinkSetFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link set detection callback. + */ +typedef void +(*xlinkExtendedLinkSetFunk) (void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * This is the structure containing a set of Links detection callbacks. + * + * There is no default xlink callbacks, if one want to get link + * recognition activated, those call backs must be provided before parsing. + */ +typedef struct _xlinkHandler xlinkHandler; +typedef xlinkHandler *xlinkHandlerPtr; +struct _xlinkHandler { + xlinkSimpleLinkFunk simple; + xlinkExtendedLinkFunk extended; + xlinkExtendedLinkSetFunk set; +}; + +/* + * The default detection routine, can be overridden, they call the default + * detection callbacks. + */ + +XMLPUBFUN xlinkNodeDetectFunc XMLCALL + xlinkGetDefaultDetect (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultDetect (xlinkNodeDetectFunc func); + +/* + * Routines to set/get the default handlers. + */ +XMLPUBFUN xlinkHandlerPtr XMLCALL + xlinkGetDefaultHandler (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultHandler (xlinkHandlerPtr handler); + +/* + * Link detection module itself. + */ +XMLPUBFUN xlinkType XMLCALL + xlinkIsLink (xmlDocPtr doc, + xmlNodePtr node); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ + +#endif /* __XML_XLINK_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlIO.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlIO.h new file mode 100644 index 0000000..095b2f5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlIO.h @@ -0,0 +1,368 @@ +/* + * Summary: interface for the I/O interfaces used by the parser + * Description: interface for the I/O interfaces used by the parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_IO_H__ +#define __XML_IO_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Those are the functions and datatypes for the parser input + * I/O structures. + */ + +/** + * xmlInputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to detect if the current handler + * can provide input functionality for this resource. + * + * Returns 1 if yes and 0 if another Input module should be used + */ +typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename); +/** + * xmlInputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to open the resource + * + * Returns an Input context or NULL in case or error + */ +typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename); +/** + * xmlInputReadCallback: + * @context: an Input context + * @buffer: the buffer to store data read + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Input API to read the resource + * + * Returns the number of bytes read or -1 in case of error + */ +typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len); +/** + * xmlInputCloseCallback: + * @context: an Input context + * + * Callback used in the I/O Input API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (XMLCALL *xmlInputCloseCallback) (void * context); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Those are the functions and datatypes for the library output + * I/O structures. + */ + +/** + * xmlOutputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to detect if the current handler + * can provide output functionality for this resource. + * + * Returns 1 if yes and 0 if another Output module should be used + */ +typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename); +/** + * xmlOutputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to open the resource + * + * Returns an Output context or NULL in case or error + */ +typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename); +/** + * xmlOutputWriteCallback: + * @context: an Output context + * @buffer: the buffer of data to write + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Output API to write to the resource + * + * Returns the number of bytes written or -1 in case of error + */ +typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer, + int len); +/** + * xmlOutputCloseCallback: + * @context: an Output context + * + * Callback used in the I/O Output API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (XMLCALL *xmlOutputCloseCallback) (void * context); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +struct _xmlParserInputBuffer { + void* context; + xmlInputReadCallback readcallback; + xmlInputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */ + xmlBufPtr raw; /* if encoder != NULL buffer for raw input */ + int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ + int error; + unsigned long rawconsumed;/* amount consumed from raw */ +}; + + +#ifdef LIBXML_OUTPUT_ENABLED +struct _xmlOutputBuffer { + void* context; + xmlOutputWriteCallback writecallback; + xmlOutputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ + xmlBufPtr conv; /* if encoder != NULL buffer for output */ + int written; /* total number of byte written */ + int error; +}; +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* + * Interfaces for input + */ +XMLPUBFUN void XMLCALL + xmlCleanupInputCallbacks (void); + +XMLPUBFUN int XMLCALL + xmlPopInputCallbacks (void); + +XMLPUBFUN void XMLCALL + xmlRegisterDefaultInputCallbacks (void); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlAllocParserInputBuffer (xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFilename (const char *URI, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFile (FILE *file, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFd (int fd, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateMem (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateStatic (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlParserInputBufferRead (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferGrow (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferPush (xmlParserInputBufferPtr in, + int len, + const char *buf); +XMLPUBFUN void XMLCALL + xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); +XMLPUBFUN char * XMLCALL + xmlParserGetDirectory (const char *filename); + +XMLPUBFUN int XMLCALL + xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, + xmlInputOpenCallback openFunc, + xmlInputReadCallback readFunc, + xmlInputCloseCallback closeFunc); + +xmlParserInputBufferPtr + __xmlParserInputBufferCreateFilename(const char *URI, + xmlCharEncoding enc); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Interfaces for output + */ +XMLPUBFUN void XMLCALL + xmlCleanupOutputCallbacks (void); +XMLPUBFUN int XMLCALL + xmlPopOutputCallbacks (void); +XMLPUBFUN void XMLCALL + xmlRegisterDefaultOutputCallbacks(void); +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFilename (const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFile (FILE *file, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateBuffer (xmlBufferPtr buffer, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFd (int fd, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + xmlCharEncodingHandlerPtr encoder); + +/* Couple of APIs to get the output without digging into the buffers */ +XMLPUBFUN const xmlChar * XMLCALL + xmlOutputBufferGetContent (xmlOutputBufferPtr out); +XMLPUBFUN size_t XMLCALL + xmlOutputBufferGetSize (xmlOutputBufferPtr out); + +XMLPUBFUN int XMLCALL + xmlOutputBufferWrite (xmlOutputBufferPtr out, + int len, + const char *buf); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteString (xmlOutputBufferPtr out, + const char *str); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, + const xmlChar *str, + xmlCharEncodingOutputFunc escaping); + +XMLPUBFUN int XMLCALL + xmlOutputBufferFlush (xmlOutputBufferPtr out); +XMLPUBFUN int XMLCALL + xmlOutputBufferClose (xmlOutputBufferPtr out); + +XMLPUBFUN int XMLCALL + xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, + xmlOutputOpenCallback openFunc, + xmlOutputWriteCallback writeFunc, + xmlOutputCloseCallback closeFunc); + +xmlOutputBufferPtr + __xmlOutputBufferCreateFilename(const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +#ifdef LIBXML_HTTP_ENABLED +/* This function only exists if HTTP support built into the library */ +XMLPUBFUN void XMLCALL + xmlRegisterHTTPPostCallbacks (void ); +#endif /* LIBXML_HTTP_ENABLED */ + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlCheckHTTPInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr ret); + +/* + * A predefined entity loader disabling network accesses + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNoNetExternalEntityLoader (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * xmlNormalizeWindowsPath is obsolete, don't use it. + * Check xmlCanonicPath in uri.h for a better alternative. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlNormalizeWindowsPath (const xmlChar *path); + +XMLPUBFUN int XMLCALL + xmlCheckFilename (const char *path); +/** + * Default 'file://' protocol callbacks + */ +XMLPUBFUN int XMLCALL + xmlFileMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlFileOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlFileRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlFileClose (void * context); + +/** + * Default 'http://' protocol callbacks + */ +#ifdef LIBXML_HTTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOHTTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpen (const char *filename); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpenW (const char * post_uri, + int compression ); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + xmlIOHTTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOHTTPClose (void * context); +#endif /* LIBXML_HTTP_ENABLED */ + +/** + * Default 'ftp://' protocol callbacks + */ +#ifdef LIBXML_FTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOFTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOFTPOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlIOFTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOFTPClose (void * context); +#endif /* LIBXML_FTP_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_IO_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlautomata.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlautomata.h new file mode 100644 index 0000000..bf1b131 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlautomata.h @@ -0,0 +1,146 @@ +/* + * Summary: API to build regexp automata + * Description: the API to build regexp automata + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_AUTOMATA_H__ +#define __XML_AUTOMATA_H__ + +#include +#include + +#ifdef LIBXML_REGEXP_ENABLED +#ifdef LIBXML_AUTOMATA_ENABLED +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlAutomataPtr: + * + * A libxml automata description, It can be compiled into a regexp + */ +typedef struct _xmlAutomata xmlAutomata; +typedef xmlAutomata *xmlAutomataPtr; + +/** + * xmlAutomataStatePtr: + * + * A state int the automata description, + */ +typedef struct _xmlAutomataState xmlAutomataState; +typedef xmlAutomataState *xmlAutomataStatePtr; + +/* + * Building API + */ +XMLPUBFUN xmlAutomataPtr XMLCALL + xmlNewAutomata (void); +XMLPUBFUN void XMLCALL + xmlFreeAutomata (xmlAutomataPtr am); + +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataGetInitState (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataSetFinalState (xmlAutomataPtr am, + xmlAutomataStatePtr state); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewState (xmlAutomataPtr am); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewNegTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); + +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewAllTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int lax); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewEpsilon (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountedTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCounterTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN int XMLCALL + xmlAutomataNewCounter (xmlAutomataPtr am, + int min, + int max); + +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlAutomataCompile (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataIsDeterminist (xmlAutomataPtr am); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_AUTOMATA_ENABLED */ +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /* __XML_AUTOMATA_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlerror.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlerror.h new file mode 100644 index 0000000..7b68e40 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlerror.h @@ -0,0 +1,946 @@ +/* + * Summary: error handling + * Description: the API used to report errors + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#include + +#ifndef __XML_ERROR_H__ +#define __XML_ERROR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlErrorLevel: + * + * Indicates the level of an error + */ +typedef enum { + XML_ERR_NONE = 0, + XML_ERR_WARNING = 1, /* A simple warning */ + XML_ERR_ERROR = 2, /* A recoverable error */ + XML_ERR_FATAL = 3 /* A fatal error */ +} xmlErrorLevel; + +/** + * xmlErrorDomain: + * + * Indicates where an error may have come from + */ +typedef enum { + XML_FROM_NONE = 0, + XML_FROM_PARSER, /* The XML parser */ + XML_FROM_TREE, /* The tree module */ + XML_FROM_NAMESPACE, /* The XML Namespace module */ + XML_FROM_DTD, /* The XML DTD validation with parser context*/ + XML_FROM_HTML, /* The HTML parser */ + XML_FROM_MEMORY, /* The memory allocator */ + XML_FROM_OUTPUT, /* The serialization code */ + XML_FROM_IO, /* The Input/Output stack */ + XML_FROM_FTP, /* The FTP module */ + XML_FROM_HTTP, /* The HTTP module */ + XML_FROM_XINCLUDE, /* The XInclude processing */ + XML_FROM_XPATH, /* The XPath module */ + XML_FROM_XPOINTER, /* The XPointer module */ + XML_FROM_REGEXP, /* The regular expressions module */ + XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */ + XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */ + XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */ + XML_FROM_RELAXNGP, /* The Relax-NG parser module */ + XML_FROM_RELAXNGV, /* The Relax-NG validator module */ + XML_FROM_CATALOG, /* The Catalog module */ + XML_FROM_C14N, /* The Canonicalization module */ + XML_FROM_XSLT, /* The XSLT engine from libxslt */ + XML_FROM_VALID, /* The XML DTD validation with valid context */ + XML_FROM_CHECK, /* The error checking module */ + XML_FROM_WRITER, /* The xmlwriter module */ + XML_FROM_MODULE, /* The dynamically loaded module module*/ + XML_FROM_I18N, /* The module handling character conversion */ + XML_FROM_SCHEMATRONV,/* The Schematron validator module */ + XML_FROM_BUFFER, /* The buffers module */ + XML_FROM_URI /* The URI module */ +} xmlErrorDomain; + +/** + * xmlError: + * + * An XML Error instance. + */ + +typedef struct _xmlError xmlError; +typedef xmlError *xmlErrorPtr; +struct _xmlError { + int domain; /* What part of the library raised this error */ + int code; /* The error code, e.g. an xmlParserError */ + char *message;/* human-readable informative error message */ + xmlErrorLevel level;/* how consequent is the error */ + char *file; /* the filename */ + int line; /* the line number if available */ + char *str1; /* extra string information */ + char *str2; /* extra string information */ + char *str3; /* extra string information */ + int int1; /* extra number information */ + int int2; /* error column # or 0 if N/A (todo: rename field when we would brk ABI) */ + void *ctxt; /* the parser context if available */ + void *node; /* the node in the tree */ +}; + +/** + * xmlParserError: + * + * This is an error that the XML (or HTML) parser can generate + */ +typedef enum { + XML_ERR_OK = 0, + XML_ERR_INTERNAL_ERROR, /* 1 */ + XML_ERR_NO_MEMORY, /* 2 */ + XML_ERR_DOCUMENT_START, /* 3 */ + XML_ERR_DOCUMENT_EMPTY, /* 4 */ + XML_ERR_DOCUMENT_END, /* 5 */ + XML_ERR_INVALID_HEX_CHARREF, /* 6 */ + XML_ERR_INVALID_DEC_CHARREF, /* 7 */ + XML_ERR_INVALID_CHARREF, /* 8 */ + XML_ERR_INVALID_CHAR, /* 9 */ + XML_ERR_CHARREF_AT_EOF, /* 10 */ + XML_ERR_CHARREF_IN_PROLOG, /* 11 */ + XML_ERR_CHARREF_IN_EPILOG, /* 12 */ + XML_ERR_CHARREF_IN_DTD, /* 13 */ + XML_ERR_ENTITYREF_AT_EOF, /* 14 */ + XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */ + XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */ + XML_ERR_ENTITYREF_IN_DTD, /* 17 */ + XML_ERR_PEREF_AT_EOF, /* 18 */ + XML_ERR_PEREF_IN_PROLOG, /* 19 */ + XML_ERR_PEREF_IN_EPILOG, /* 20 */ + XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */ + XML_ERR_ENTITYREF_NO_NAME, /* 22 */ + XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */ + XML_ERR_PEREF_NO_NAME, /* 24 */ + XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */ + XML_ERR_UNDECLARED_ENTITY, /* 26 */ + XML_WAR_UNDECLARED_ENTITY, /* 27 */ + XML_ERR_UNPARSED_ENTITY, /* 28 */ + XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */ + XML_ERR_ENTITY_IS_PARAMETER, /* 30 */ + XML_ERR_UNKNOWN_ENCODING, /* 31 */ + XML_ERR_UNSUPPORTED_ENCODING, /* 32 */ + XML_ERR_STRING_NOT_STARTED, /* 33 */ + XML_ERR_STRING_NOT_CLOSED, /* 34 */ + XML_ERR_NS_DECL_ERROR, /* 35 */ + XML_ERR_ENTITY_NOT_STARTED, /* 36 */ + XML_ERR_ENTITY_NOT_FINISHED, /* 37 */ + XML_ERR_LT_IN_ATTRIBUTE, /* 38 */ + XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */ + XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */ + XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */ + XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */ + XML_ERR_LITERAL_NOT_STARTED, /* 43 */ + XML_ERR_LITERAL_NOT_FINISHED, /* 44 */ + XML_ERR_COMMENT_NOT_FINISHED, /* 45 */ + XML_ERR_PI_NOT_STARTED, /* 46 */ + XML_ERR_PI_NOT_FINISHED, /* 47 */ + XML_ERR_NOTATION_NOT_STARTED, /* 48 */ + XML_ERR_NOTATION_NOT_FINISHED, /* 49 */ + XML_ERR_ATTLIST_NOT_STARTED, /* 50 */ + XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */ + XML_ERR_MIXED_NOT_STARTED, /* 52 */ + XML_ERR_MIXED_NOT_FINISHED, /* 53 */ + XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */ + XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */ + XML_ERR_XMLDECL_NOT_STARTED, /* 56 */ + XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */ + XML_ERR_CONDSEC_NOT_STARTED, /* 58 */ + XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */ + XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */ + XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */ + XML_ERR_MISPLACED_CDATA_END, /* 62 */ + XML_ERR_CDATA_NOT_FINISHED, /* 63 */ + XML_ERR_RESERVED_XML_NAME, /* 64 */ + XML_ERR_SPACE_REQUIRED, /* 65 */ + XML_ERR_SEPARATOR_REQUIRED, /* 66 */ + XML_ERR_NMTOKEN_REQUIRED, /* 67 */ + XML_ERR_NAME_REQUIRED, /* 68 */ + XML_ERR_PCDATA_REQUIRED, /* 69 */ + XML_ERR_URI_REQUIRED, /* 70 */ + XML_ERR_PUBID_REQUIRED, /* 71 */ + XML_ERR_LT_REQUIRED, /* 72 */ + XML_ERR_GT_REQUIRED, /* 73 */ + XML_ERR_LTSLASH_REQUIRED, /* 74 */ + XML_ERR_EQUAL_REQUIRED, /* 75 */ + XML_ERR_TAG_NAME_MISMATCH, /* 76 */ + XML_ERR_TAG_NOT_FINISHED, /* 77 */ + XML_ERR_STANDALONE_VALUE, /* 78 */ + XML_ERR_ENCODING_NAME, /* 79 */ + XML_ERR_HYPHEN_IN_COMMENT, /* 80 */ + XML_ERR_INVALID_ENCODING, /* 81 */ + XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */ + XML_ERR_CONDSEC_INVALID, /* 83 */ + XML_ERR_VALUE_REQUIRED, /* 84 */ + XML_ERR_NOT_WELL_BALANCED, /* 85 */ + XML_ERR_EXTRA_CONTENT, /* 86 */ + XML_ERR_ENTITY_CHAR_ERROR, /* 87 */ + XML_ERR_ENTITY_PE_INTERNAL, /* 88 */ + XML_ERR_ENTITY_LOOP, /* 89 */ + XML_ERR_ENTITY_BOUNDARY, /* 90 */ + XML_ERR_INVALID_URI, /* 91 */ + XML_ERR_URI_FRAGMENT, /* 92 */ + XML_WAR_CATALOG_PI, /* 93 */ + XML_ERR_NO_DTD, /* 94 */ + XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */ + XML_ERR_VERSION_MISSING, /* 96 */ + XML_WAR_UNKNOWN_VERSION, /* 97 */ + XML_WAR_LANG_VALUE, /* 98 */ + XML_WAR_NS_URI, /* 99 */ + XML_WAR_NS_URI_RELATIVE, /* 100 */ + XML_ERR_MISSING_ENCODING, /* 101 */ + XML_WAR_SPACE_VALUE, /* 102 */ + XML_ERR_NOT_STANDALONE, /* 103 */ + XML_ERR_ENTITY_PROCESSING, /* 104 */ + XML_ERR_NOTATION_PROCESSING, /* 105 */ + XML_WAR_NS_COLUMN, /* 106 */ + XML_WAR_ENTITY_REDEFINED, /* 107 */ + XML_ERR_UNKNOWN_VERSION, /* 108 */ + XML_ERR_VERSION_MISMATCH, /* 109 */ + XML_ERR_NAME_TOO_LONG, /* 110 */ + XML_ERR_USER_STOP, /* 111 */ + XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */ + XML_NS_ERR_XML_NAMESPACE = 200, + XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ + XML_NS_ERR_QNAME, /* 202 */ + XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */ + XML_NS_ERR_EMPTY, /* 204 */ + XML_NS_ERR_COLON, /* 205 */ + XML_DTD_ATTRIBUTE_DEFAULT = 500, + XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */ + XML_DTD_ATTRIBUTE_VALUE, /* 502 */ + XML_DTD_CONTENT_ERROR, /* 503 */ + XML_DTD_CONTENT_MODEL, /* 504 */ + XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */ + XML_DTD_DIFFERENT_PREFIX, /* 506 */ + XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */ + XML_DTD_ELEM_NAMESPACE, /* 508 */ + XML_DTD_ELEM_REDEFINED, /* 509 */ + XML_DTD_EMPTY_NOTATION, /* 510 */ + XML_DTD_ENTITY_TYPE, /* 511 */ + XML_DTD_ID_FIXED, /* 512 */ + XML_DTD_ID_REDEFINED, /* 513 */ + XML_DTD_ID_SUBSET, /* 514 */ + XML_DTD_INVALID_CHILD, /* 515 */ + XML_DTD_INVALID_DEFAULT, /* 516 */ + XML_DTD_LOAD_ERROR, /* 517 */ + XML_DTD_MISSING_ATTRIBUTE, /* 518 */ + XML_DTD_MIXED_CORRUPT, /* 519 */ + XML_DTD_MULTIPLE_ID, /* 520 */ + XML_DTD_NO_DOC, /* 521 */ + XML_DTD_NO_DTD, /* 522 */ + XML_DTD_NO_ELEM_NAME, /* 523 */ + XML_DTD_NO_PREFIX, /* 524 */ + XML_DTD_NO_ROOT, /* 525 */ + XML_DTD_NOTATION_REDEFINED, /* 526 */ + XML_DTD_NOTATION_VALUE, /* 527 */ + XML_DTD_NOT_EMPTY, /* 528 */ + XML_DTD_NOT_PCDATA, /* 529 */ + XML_DTD_NOT_STANDALONE, /* 530 */ + XML_DTD_ROOT_NAME, /* 531 */ + XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */ + XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */ + XML_DTD_UNKNOWN_ELEM, /* 534 */ + XML_DTD_UNKNOWN_ENTITY, /* 535 */ + XML_DTD_UNKNOWN_ID, /* 536 */ + XML_DTD_UNKNOWN_NOTATION, /* 537 */ + XML_DTD_STANDALONE_DEFAULTED, /* 538 */ + XML_DTD_XMLID_VALUE, /* 539 */ + XML_DTD_XMLID_TYPE, /* 540 */ + XML_DTD_DUP_TOKEN, /* 541 */ + XML_HTML_STRUCURE_ERROR = 800, + XML_HTML_UNKNOWN_TAG, /* 801 */ + XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000, + XML_RNGP_ATTR_CONFLICT, /* 1001 */ + XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */ + XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */ + XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */ + XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */ + XML_RNGP_CHOICE_CONTENT, /* 1006 */ + XML_RNGP_CHOICE_EMPTY, /* 1007 */ + XML_RNGP_CREATE_FAILURE, /* 1008 */ + XML_RNGP_DATA_CONTENT, /* 1009 */ + XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */ + XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */ + XML_RNGP_DEFINE_EMPTY, /* 1012 */ + XML_RNGP_DEFINE_MISSING, /* 1013 */ + XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */ + XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */ + XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */ + XML_RNGP_ELEMENT_EMPTY, /* 1017 */ + XML_RNGP_ELEMENT_CONTENT, /* 1018 */ + XML_RNGP_ELEMENT_NAME, /* 1019 */ + XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */ + XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */ + XML_RNGP_EMPTY, /* 1022 */ + XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */ + XML_RNGP_EMPTY_CONTENT, /* 1024 */ + XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */ + XML_RNGP_ERROR_TYPE_LIB, /* 1026 */ + XML_RNGP_EXCEPT_EMPTY, /* 1027 */ + XML_RNGP_EXCEPT_MISSING, /* 1028 */ + XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */ + XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */ + XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */ + XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */ + XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */ + XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */ + XML_RNGP_FOREIGN_ELEMENT, /* 1035 */ + XML_RNGP_GRAMMAR_CONTENT, /* 1036 */ + XML_RNGP_GRAMMAR_EMPTY, /* 1037 */ + XML_RNGP_GRAMMAR_MISSING, /* 1038 */ + XML_RNGP_GRAMMAR_NO_START, /* 1039 */ + XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */ + XML_RNGP_HREF_ERROR, /* 1041 */ + XML_RNGP_INCLUDE_EMPTY, /* 1042 */ + XML_RNGP_INCLUDE_FAILURE, /* 1043 */ + XML_RNGP_INCLUDE_RECURSE, /* 1044 */ + XML_RNGP_INTERLEAVE_ADD, /* 1045 */ + XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */ + XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */ + XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */ + XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */ + XML_RNGP_INVALID_URI, /* 1050 */ + XML_RNGP_INVALID_VALUE, /* 1051 */ + XML_RNGP_MISSING_HREF, /* 1052 */ + XML_RNGP_NAME_MISSING, /* 1053 */ + XML_RNGP_NEED_COMBINE, /* 1054 */ + XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */ + XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */ + XML_RNGP_NSNAME_NO_NS, /* 1057 */ + XML_RNGP_PARAM_FORBIDDEN, /* 1058 */ + XML_RNGP_PARAM_NAME_MISSING, /* 1059 */ + XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */ + XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */ + XML_RNGP_PARENTREF_NO_NAME, /* 1062 */ + XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */ + XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */ + XML_RNGP_PARSE_ERROR, /* 1065 */ + XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */ + XML_RNGP_PAT_ATTR_ATTR, /* 1067 */ + XML_RNGP_PAT_ATTR_ELEM, /* 1068 */ + XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */ + XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */ + XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */ + XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */ + XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */ + XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */ + XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */ + XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */ + XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */ + XML_RNGP_PAT_LIST_ATTR, /* 1078 */ + XML_RNGP_PAT_LIST_ELEM, /* 1079 */ + XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */ + XML_RNGP_PAT_LIST_LIST, /* 1081 */ + XML_RNGP_PAT_LIST_REF, /* 1082 */ + XML_RNGP_PAT_LIST_TEXT, /* 1083 */ + XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */ + XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */ + XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */ + XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */ + XML_RNGP_PAT_START_ATTR, /* 1088 */ + XML_RNGP_PAT_START_DATA, /* 1089 */ + XML_RNGP_PAT_START_EMPTY, /* 1090 */ + XML_RNGP_PAT_START_GROUP, /* 1091 */ + XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */ + XML_RNGP_PAT_START_LIST, /* 1093 */ + XML_RNGP_PAT_START_ONEMORE, /* 1094 */ + XML_RNGP_PAT_START_TEXT, /* 1095 */ + XML_RNGP_PAT_START_VALUE, /* 1096 */ + XML_RNGP_PREFIX_UNDEFINED, /* 1097 */ + XML_RNGP_REF_CREATE_FAILED, /* 1098 */ + XML_RNGP_REF_CYCLE, /* 1099 */ + XML_RNGP_REF_NAME_INVALID, /* 1100 */ + XML_RNGP_REF_NO_DEF, /* 1101 */ + XML_RNGP_REF_NO_NAME, /* 1102 */ + XML_RNGP_REF_NOT_EMPTY, /* 1103 */ + XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */ + XML_RNGP_START_CONTENT, /* 1105 */ + XML_RNGP_START_EMPTY, /* 1106 */ + XML_RNGP_START_MISSING, /* 1107 */ + XML_RNGP_TEXT_EXPECTED, /* 1108 */ + XML_RNGP_TEXT_HAS_CHILD, /* 1109 */ + XML_RNGP_TYPE_MISSING, /* 1110 */ + XML_RNGP_TYPE_NOT_FOUND, /* 1111 */ + XML_RNGP_TYPE_VALUE, /* 1112 */ + XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */ + XML_RNGP_UNKNOWN_COMBINE, /* 1114 */ + XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */ + XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */ + XML_RNGP_URI_FRAGMENT, /* 1117 */ + XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */ + XML_RNGP_VALUE_EMPTY, /* 1119 */ + XML_RNGP_VALUE_NO_CONTENT, /* 1120 */ + XML_RNGP_XMLNS_NAME, /* 1121 */ + XML_RNGP_XML_NS, /* 1122 */ + XML_XPATH_EXPRESSION_OK = 1200, + XML_XPATH_NUMBER_ERROR, /* 1201 */ + XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */ + XML_XPATH_START_LITERAL_ERROR, /* 1203 */ + XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */ + XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */ + XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */ + XML_XPATH_EXPR_ERROR, /* 1207 */ + XML_XPATH_UNCLOSED_ERROR, /* 1208 */ + XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */ + XML_XPATH_INVALID_OPERAND, /* 1210 */ + XML_XPATH_INVALID_TYPE, /* 1211 */ + XML_XPATH_INVALID_ARITY, /* 1212 */ + XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */ + XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */ + XML_XPATH_MEMORY_ERROR, /* 1215 */ + XML_XPTR_SYNTAX_ERROR, /* 1216 */ + XML_XPTR_RESOURCE_ERROR, /* 1217 */ + XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */ + XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */ + XML_XPATH_ENCODING_ERROR, /* 1220 */ + XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */ + XML_TREE_INVALID_HEX = 1300, + XML_TREE_INVALID_DEC, /* 1301 */ + XML_TREE_UNTERMINATED_ENTITY, /* 1302 */ + XML_TREE_NOT_UTF8, /* 1303 */ + XML_SAVE_NOT_UTF8 = 1400, + XML_SAVE_CHAR_INVALID, /* 1401 */ + XML_SAVE_NO_DOCTYPE, /* 1402 */ + XML_SAVE_UNKNOWN_ENCODING, /* 1403 */ + XML_REGEXP_COMPILE_ERROR = 1450, + XML_IO_UNKNOWN = 1500, + XML_IO_EACCES, /* 1501 */ + XML_IO_EAGAIN, /* 1502 */ + XML_IO_EBADF, /* 1503 */ + XML_IO_EBADMSG, /* 1504 */ + XML_IO_EBUSY, /* 1505 */ + XML_IO_ECANCELED, /* 1506 */ + XML_IO_ECHILD, /* 1507 */ + XML_IO_EDEADLK, /* 1508 */ + XML_IO_EDOM, /* 1509 */ + XML_IO_EEXIST, /* 1510 */ + XML_IO_EFAULT, /* 1511 */ + XML_IO_EFBIG, /* 1512 */ + XML_IO_EINPROGRESS, /* 1513 */ + XML_IO_EINTR, /* 1514 */ + XML_IO_EINVAL, /* 1515 */ + XML_IO_EIO, /* 1516 */ + XML_IO_EISDIR, /* 1517 */ + XML_IO_EMFILE, /* 1518 */ + XML_IO_EMLINK, /* 1519 */ + XML_IO_EMSGSIZE, /* 1520 */ + XML_IO_ENAMETOOLONG, /* 1521 */ + XML_IO_ENFILE, /* 1522 */ + XML_IO_ENODEV, /* 1523 */ + XML_IO_ENOENT, /* 1524 */ + XML_IO_ENOEXEC, /* 1525 */ + XML_IO_ENOLCK, /* 1526 */ + XML_IO_ENOMEM, /* 1527 */ + XML_IO_ENOSPC, /* 1528 */ + XML_IO_ENOSYS, /* 1529 */ + XML_IO_ENOTDIR, /* 1530 */ + XML_IO_ENOTEMPTY, /* 1531 */ + XML_IO_ENOTSUP, /* 1532 */ + XML_IO_ENOTTY, /* 1533 */ + XML_IO_ENXIO, /* 1534 */ + XML_IO_EPERM, /* 1535 */ + XML_IO_EPIPE, /* 1536 */ + XML_IO_ERANGE, /* 1537 */ + XML_IO_EROFS, /* 1538 */ + XML_IO_ESPIPE, /* 1539 */ + XML_IO_ESRCH, /* 1540 */ + XML_IO_ETIMEDOUT, /* 1541 */ + XML_IO_EXDEV, /* 1542 */ + XML_IO_NETWORK_ATTEMPT, /* 1543 */ + XML_IO_ENCODER, /* 1544 */ + XML_IO_FLUSH, /* 1545 */ + XML_IO_WRITE, /* 1546 */ + XML_IO_NO_INPUT, /* 1547 */ + XML_IO_BUFFER_FULL, /* 1548 */ + XML_IO_LOAD_ERROR, /* 1549 */ + XML_IO_ENOTSOCK, /* 1550 */ + XML_IO_EISCONN, /* 1551 */ + XML_IO_ECONNREFUSED, /* 1552 */ + XML_IO_ENETUNREACH, /* 1553 */ + XML_IO_EADDRINUSE, /* 1554 */ + XML_IO_EALREADY, /* 1555 */ + XML_IO_EAFNOSUPPORT, /* 1556 */ + XML_XINCLUDE_RECURSION=1600, + XML_XINCLUDE_PARSE_VALUE, /* 1601 */ + XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */ + XML_XINCLUDE_NO_HREF, /* 1603 */ + XML_XINCLUDE_NO_FALLBACK, /* 1604 */ + XML_XINCLUDE_HREF_URI, /* 1605 */ + XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */ + XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */ + XML_XINCLUDE_INVALID_CHAR, /* 1608 */ + XML_XINCLUDE_BUILD_FAILED, /* 1609 */ + XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */ + XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */ + XML_XINCLUDE_XPTR_FAILED, /* 1612 */ + XML_XINCLUDE_XPTR_RESULT, /* 1613 */ + XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */ + XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */ + XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */ + XML_XINCLUDE_DEPRECATED_NS, /* 1617 */ + XML_XINCLUDE_FRAGMENT_ID, /* 1618 */ + XML_CATALOG_MISSING_ATTR = 1650, + XML_CATALOG_ENTRY_BROKEN, /* 1651 */ + XML_CATALOG_PREFER_VALUE, /* 1652 */ + XML_CATALOG_NOT_CATALOG, /* 1653 */ + XML_CATALOG_RECURSION, /* 1654 */ + XML_SCHEMAP_PREFIX_UNDEFINED = 1700, + XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */ + XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */ + XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */ + XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */ + XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */ + XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */ + XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */ + XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */ + XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */ + XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */ + XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */ + XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */ + XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */ + XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */ + XML_SCHEMAP_INVALID_ENUM, /* 1715 */ + XML_SCHEMAP_INVALID_FACET, /* 1716 */ + XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */ + XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */ + XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */ + XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */ + XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */ + XML_SCHEMAP_NOATTR_NOREF, /* 1722 */ + XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */ + XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */ + XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */ + XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */ + XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */ + XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */ + XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */ + XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */ + XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */ + XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */ + XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */ + XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */ + XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */ + XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */ + XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */ + XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */ + XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */ + XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */ + XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */ + XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */ + XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */ + XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */ + XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */ + XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */ + XML_SCHEMAP_UNKNOWN_REF, /* 1747 */ + XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */ + XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */ + XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */ + XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */ + XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */ + XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */ + XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */ + XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */ + XML_SCHEMAP_REGEXP_INVALID, /* 1756 */ + XML_SCHEMAP_FAILED_LOAD, /* 1757 */ + XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */ + XML_SCHEMAP_NOROOT, /* 1759 */ + XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */ + XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */ + XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */ + XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */ + XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */ + XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */ + XML_SCHEMAP_FAILED_PARSE, /* 1766 */ + XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */ + XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */ + XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */ + XML_SCHEMAP_NOT_SCHEMA, /* 1772 */ + XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */ + XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */ + XML_SCHEMAP_RECURSIVE, /* 1775 */ + XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */ + XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */ + XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */ + XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */ + XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */ + XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */ + XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */ + XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */ + XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */ + XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */ + XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */ + XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */ + XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */ + XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */ + XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */ + XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */ + XML_SCHEMAV_NOROOT = 1801, + XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */ + XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */ + XML_SCHEMAV_MISSING, /* 1804 */ + XML_SCHEMAV_WRONGELEM, /* 1805 */ + XML_SCHEMAV_NOTYPE, /* 1806 */ + XML_SCHEMAV_NOROLLBACK, /* 1807 */ + XML_SCHEMAV_ISABSTRACT, /* 1808 */ + XML_SCHEMAV_NOTEMPTY, /* 1809 */ + XML_SCHEMAV_ELEMCONT, /* 1810 */ + XML_SCHEMAV_HAVEDEFAULT, /* 1811 */ + XML_SCHEMAV_NOTNILLABLE, /* 1812 */ + XML_SCHEMAV_EXTRACONTENT, /* 1813 */ + XML_SCHEMAV_INVALIDATTR, /* 1814 */ + XML_SCHEMAV_INVALIDELEM, /* 1815 */ + XML_SCHEMAV_NOTDETERMINIST, /* 1816 */ + XML_SCHEMAV_CONSTRUCT, /* 1817 */ + XML_SCHEMAV_INTERNAL, /* 1818 */ + XML_SCHEMAV_NOTSIMPLE, /* 1819 */ + XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */ + XML_SCHEMAV_ATTRINVALID, /* 1821 */ + XML_SCHEMAV_VALUE, /* 1822 */ + XML_SCHEMAV_FACET, /* 1823 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */ + XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */ + XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */ + XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */ + XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */ + XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */ + XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */ + XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */ + XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */ + XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */ + XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */ + XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */ + XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */ + XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */ + XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */ + XML_SCHEMAV_CVC_ELT_1, /* 1845 */ + XML_SCHEMAV_CVC_ELT_2, /* 1846 */ + XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */ + XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */ + XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */ + XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */ + XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */ + XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */ + XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */ + XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */ + XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ + XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */ + XML_SCHEMAV_CVC_ELT_6, /* 1859 */ + XML_SCHEMAV_CVC_ELT_7, /* 1860 */ + XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */ + XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */ + XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */ + XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */ + XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */ + XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */ + XML_SCHEMAV_CVC_AU, /* 1874 */ + XML_SCHEMAV_CVC_TYPE_1, /* 1875 */ + XML_SCHEMAV_CVC_TYPE_2, /* 1876 */ + XML_SCHEMAV_CVC_IDC, /* 1877 */ + XML_SCHEMAV_CVC_WILDCARD, /* 1878 */ + XML_SCHEMAV_MISC, /* 1879 */ + XML_XPTR_UNKNOWN_SCHEME = 1900, + XML_XPTR_CHILDSEQ_START, /* 1901 */ + XML_XPTR_EVAL_FAILED, /* 1902 */ + XML_XPTR_EXTRA_OBJECTS, /* 1903 */ + XML_C14N_CREATE_CTXT = 1950, + XML_C14N_REQUIRES_UTF8, /* 1951 */ + XML_C14N_CREATE_STACK, /* 1952 */ + XML_C14N_INVALID_NODE, /* 1953 */ + XML_C14N_UNKNOW_NODE, /* 1954 */ + XML_C14N_RELATIVE_NAMESPACE, /* 1955 */ + XML_FTP_PASV_ANSWER = 2000, + XML_FTP_EPSV_ANSWER, /* 2001 */ + XML_FTP_ACCNT, /* 2002 */ + XML_FTP_URL_SYNTAX, /* 2003 */ + XML_HTTP_URL_SYNTAX = 2020, + XML_HTTP_USE_IP, /* 2021 */ + XML_HTTP_UNKNOWN_HOST, /* 2022 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000, + XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */ + XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ + XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */ + XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */ + XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */ + XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */ + XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */ + XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */ + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */ + XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */ + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */ + XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */ + XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */ + XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */ + XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */ + XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */ + XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */ + XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */ + XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */ + XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */ + XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */ + XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */ + XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */ + XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ + XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */ + XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */ + XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */ + XML_SCHEMAP_NO_XMLNS, /* 3056 */ + XML_SCHEMAP_NO_XSI, /* 3057 */ + XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */ + XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */ + XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */ + XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */ + XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */ + XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */ + XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */ + XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */ + XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */ + XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */ + XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */ + XML_SCHEMAP_SRC_CT_1, /* 3076 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */ + XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ + XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ + XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */ + XML_SCHEMAP_SRC_REDEFINE, /* 3081 */ + XML_SCHEMAP_SRC_IMPORT, /* 3082 */ + XML_SCHEMAP_WARN_SKIP_SCHEMA, /* 3083 */ + XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */ + XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */ + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */ + XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */ + XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */ + XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */ + XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */ + XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */ + XML_SCHEMATRONV_REPORT, + XML_MODULE_OPEN = 4900, /* 4900 */ + XML_MODULE_CLOSE, /* 4901 */ + XML_CHECK_FOUND_ELEMENT = 5000, + XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */ + XML_CHECK_FOUND_TEXT, /* 5002 */ + XML_CHECK_FOUND_CDATA, /* 5003 */ + XML_CHECK_FOUND_ENTITYREF, /* 5004 */ + XML_CHECK_FOUND_ENTITY, /* 5005 */ + XML_CHECK_FOUND_PI, /* 5006 */ + XML_CHECK_FOUND_COMMENT, /* 5007 */ + XML_CHECK_FOUND_DOCTYPE, /* 5008 */ + XML_CHECK_FOUND_FRAGMENT, /* 5009 */ + XML_CHECK_FOUND_NOTATION, /* 5010 */ + XML_CHECK_UNKNOWN_NODE, /* 5011 */ + XML_CHECK_ENTITY_TYPE, /* 5012 */ + XML_CHECK_NO_PARENT, /* 5013 */ + XML_CHECK_NO_DOC, /* 5014 */ + XML_CHECK_NO_NAME, /* 5015 */ + XML_CHECK_NO_ELEM, /* 5016 */ + XML_CHECK_WRONG_DOC, /* 5017 */ + XML_CHECK_NO_PREV, /* 5018 */ + XML_CHECK_WRONG_PREV, /* 5019 */ + XML_CHECK_NO_NEXT, /* 5020 */ + XML_CHECK_WRONG_NEXT, /* 5021 */ + XML_CHECK_NOT_DTD, /* 5022 */ + XML_CHECK_NOT_ATTR, /* 5023 */ + XML_CHECK_NOT_ATTR_DECL, /* 5024 */ + XML_CHECK_NOT_ELEM_DECL, /* 5025 */ + XML_CHECK_NOT_ENTITY_DECL, /* 5026 */ + XML_CHECK_NOT_NS_DECL, /* 5027 */ + XML_CHECK_NO_HREF, /* 5028 */ + XML_CHECK_WRONG_PARENT,/* 5029 */ + XML_CHECK_NS_SCOPE, /* 5030 */ + XML_CHECK_NS_ANCESTOR, /* 5031 */ + XML_CHECK_NOT_UTF8, /* 5032 */ + XML_CHECK_NO_DICT, /* 5033 */ + XML_CHECK_NOT_NCNAME, /* 5034 */ + XML_CHECK_OUTSIDE_DICT, /* 5035 */ + XML_CHECK_WRONG_NAME, /* 5036 */ + XML_CHECK_NAME_NOT_NULL, /* 5037 */ + XML_I18N_NO_NAME = 6000, + XML_I18N_NO_HANDLER, /* 6001 */ + XML_I18N_EXCESS_HANDLER, /* 6002 */ + XML_I18N_CONV_FAILED, /* 6003 */ + XML_I18N_NO_OUTPUT, /* 6004 */ + XML_BUF_OVERFLOW = 7000 +} xmlParserErrors; + +/** + * xmlGenericErrorFunc: + * @ctx: a parsing context + * @msg: the message + * @...: the extra arguments of the varargs to format the message + * + * Signature of the function to use when there is an error and + * no parsing or validity context available . + */ +typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); +/** + * xmlStructuredErrorFunc: + * @userData: user provided data for the error callback + * @error: the error being raised. + * + * Signature of the function to use when there is an error and + * the module handles the new error reporting mechanism. + */ +typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); + +/* + * Use the following function to reset the two global variables + * xmlGenericError and xmlGenericErrorContext. + */ +XMLPUBFUN void XMLCALL + xmlSetGenericErrorFunc (void *ctx, + xmlGenericErrorFunc handler); +XMLPUBFUN void XMLCALL + initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); + +XMLPUBFUN void XMLCALL + xmlSetStructuredErrorFunc (void *ctx, + xmlStructuredErrorFunc handler); +/* + * Default message routines used by SAX and Valid context for error + * and warning reporting. + */ +XMLPUBFUN void XMLCDECL + xmlParserError (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); +XMLPUBFUN void XMLCDECL + xmlParserWarning (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); +XMLPUBFUN void XMLCDECL + xmlParserValidityError (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); +XMLPUBFUN void XMLCDECL + xmlParserValidityWarning (void *ctx, + const char *msg, + ...) LIBXML_ATTR_FORMAT(2,3); +XMLPUBFUN void XMLCALL + xmlParserPrintFileInfo (xmlParserInputPtr input); +XMLPUBFUN void XMLCALL + xmlParserPrintFileContext (xmlParserInputPtr input); + +/* + * Extended error information routines + */ +XMLPUBFUN xmlErrorPtr XMLCALL + xmlGetLastError (void); +XMLPUBFUN void XMLCALL + xmlResetLastError (void); +XMLPUBFUN xmlErrorPtr XMLCALL + xmlCtxtGetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlCtxtResetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlResetError (xmlErrorPtr err); +XMLPUBFUN int XMLCALL + xmlCopyError (xmlErrorPtr from, + xmlErrorPtr to); + +#ifdef IN_LIBXML +/* + * Internal callback reporting routine + */ +XMLPUBFUN void XMLCALL + __xmlRaiseError (xmlStructuredErrorFunc schannel, + xmlGenericErrorFunc channel, + void *data, + void *ctx, + void *node, + int domain, + int code, + xmlErrorLevel level, + const char *file, + int line, + const char *str1, + const char *str2, + const char *str3, + int int1, + int col, + const char *msg, + ...) LIBXML_ATTR_FORMAT(16,17); +XMLPUBFUN void XMLCALL + __xmlSimpleError (int domain, + int code, + xmlNodePtr node, + const char *msg, + const char *extra) LIBXML_ATTR_FORMAT(4,0); +#endif +#ifdef __cplusplus +} +#endif +#endif /* __XML_ERROR_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlexports.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlexports.h new file mode 100644 index 0000000..aceede5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlexports.h @@ -0,0 +1,77 @@ +/* + * Summary: macros for marking symbols as exportable/importable. + * Description: macros for marking symbols as exportable/importable. + * + * Copy: See Copyright for the status of this software. + */ + +#ifndef __XML_EXPORTS_H__ +#define __XML_EXPORTS_H__ + +#if defined(_WIN32) || defined(__CYGWIN__) +/** DOC_DISABLE */ + +#ifdef LIBXML_STATIC + #define XMLPUBLIC +#elif defined(IN_LIBXML) + #define XMLPUBLIC __declspec(dllexport) +#else + #define XMLPUBLIC __declspec(dllimport) +#endif + +#if defined(LIBXML_FASTCALL) + #define XMLCALL __fastcall +#else + #define XMLCALL __cdecl +#endif +#define XMLCDECL __cdecl + +/** DOC_ENABLE */ +#else /* not Windows */ + +/** + * XMLPUBLIC: + * + * Macro which declares a public symbol + */ +#define XMLPUBLIC + +/** + * XMLCALL: + * + * Macro which declares the calling convention for exported functions + */ +#define XMLCALL + +/** + * XMLCDECL: + * + * Macro which declares the calling convention for exported functions that + * use '...'. + */ +#define XMLCDECL + +#endif /* platform switch */ + +/* + * XMLPUBFUN: + * + * Macro which declares an exportable function + */ +#define XMLPUBFUN XMLPUBLIC + +/** + * XMLPUBVAR: + * + * Macro which declares an exportable variable + */ +#define XMLPUBVAR XMLPUBLIC extern + +/* Compatibility */ +#if !defined(LIBXML_DLL_IMPORT) +#define LIBXML_DLL_IMPORT XMLPUBVAR +#endif + +#endif /* __XML_EXPORTS_H__ */ + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmemory.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmemory.h new file mode 100644 index 0000000..17e375a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmemory.h @@ -0,0 +1,224 @@ +/* + * Summary: interface for the memory allocator + * Description: provides interfaces for the memory allocator, + * including debugging capabilities. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __DEBUG_MEMORY_ALLOC__ +#define __DEBUG_MEMORY_ALLOC__ + +#include +#include + +/** + * DEBUG_MEMORY: + * + * DEBUG_MEMORY replaces the allocator with a collect and debug + * shell to the libc allocator. + * DEBUG_MEMORY should only be activated when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +/* #define DEBUG_MEMORY_FREED */ +/* #define DEBUG_MEMORY_LOCATION */ + +#ifdef DEBUG +#ifndef DEBUG_MEMORY +#define DEBUG_MEMORY +#endif +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * DEBUG_MEMORY_LOCATION should be activated only when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +#ifdef DEBUG_MEMORY_LOCATION +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The XML memory wrapper support 4 basic overloadable functions. + */ +/** + * xmlFreeFunc: + * @mem: an already allocated block of memory + * + * Signature for a free() implementation. + */ +typedef void (XMLCALL *xmlFreeFunc)(void *mem); +/** + * xmlMallocFunc: + * @size: the size requested in bytes + * + * Signature for a malloc() implementation. + * + * Returns a pointer to the newly allocated block or NULL in case of error. + */ +typedef void *(LIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); + +/** + * xmlReallocFunc: + * @mem: an already allocated block of memory + * @size: the new size requested in bytes + * + * Signature for a realloc() implementation. + * + * Returns a pointer to the newly reallocated block or NULL in case of error. + */ +typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size); + +/** + * xmlStrdupFunc: + * @str: a zero terminated string + * + * Signature for an strdup() implementation. + * + * Returns the copy of the string or NULL in case of error. + */ +typedef char *(XMLCALL *xmlStrdupFunc)(const char *str); + +/* + * The 4 interfaces used for all memory handling within libxml. +LIBXML_DLL_IMPORT xmlFreeFunc xmlFree; +LIBXML_DLL_IMPORT xmlMallocFunc xmlMalloc; +LIBXML_DLL_IMPORT xmlMallocFunc xmlMallocAtomic; +LIBXML_DLL_IMPORT xmlReallocFunc xmlRealloc; +LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup; + */ + +/* + * The way to overload the existing functions. + * The xmlGc function have an extra entry for atomic block + * allocations useful for garbage collected memory allocators + */ +XMLPUBFUN int XMLCALL + xmlMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlMallocFunc mallocAtomicFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlMallocFunc *mallocAtomicFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); + +/* + * Initialization of the memory layer. + */ +XMLPUBFUN int XMLCALL + xmlInitMemory (void); + +/* + * Cleanup of the memory layer. + */ +XMLPUBFUN void XMLCALL + xmlCleanupMemory (void); +/* + * These are specific to the XML debug memory wrapper. + */ +XMLPUBFUN int XMLCALL + xmlMemUsed (void); +XMLPUBFUN int XMLCALL + xmlMemBlocks (void); +XMLPUBFUN void XMLCALL + xmlMemDisplay (FILE *fp); +XMLPUBFUN void XMLCALL + xmlMemDisplayLast(FILE *fp, long nbBytes); +XMLPUBFUN void XMLCALL + xmlMemShow (FILE *fp, int nr); +XMLPUBFUN void XMLCALL + xmlMemoryDump (void); +XMLPUBFUN void * XMLCALL + xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1); +XMLPUBFUN void * XMLCALL + xmlMemRealloc (void *ptr,size_t size); +XMLPUBFUN void XMLCALL + xmlMemFree (void *ptr); +XMLPUBFUN char * XMLCALL + xmlMemoryStrdup (const char *str); +XMLPUBFUN void * XMLCALL + xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); +XMLPUBFUN void * XMLCALL + xmlReallocLoc (void *ptr, size_t size, const char *file, int line); +XMLPUBFUN void * XMLCALL + xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1); +XMLPUBFUN char * XMLCALL + xmlMemStrdupLoc (const char *str, const char *file, int line); + + +#ifdef DEBUG_MEMORY_LOCATION +/** + * xmlMalloc: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__) +/** + * xmlMallocAtomic: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library for allocation + * of block not containing pointers to other areas. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__) +/** + * xmlRealloc: + * @ptr: pointer to the existing allocated area + * @size: number of bytes to allocate + * + * Wrapper for the realloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) +/** + * xmlMemStrdup: + * @str: pointer to the existing string + * + * Wrapper for the strdup() function, xmlStrdup() is usually preferred. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) + +#endif /* DEBUG_MEMORY_LOCATION */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef __XML_GLOBALS_H +#ifndef __XML_THREADS_H__ +#include +#include +#endif +#endif + +#endif /* __DEBUG_MEMORY_ALLOC__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmodule.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmodule.h new file mode 100644 index 0000000..9667820 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlmodule.h @@ -0,0 +1,57 @@ +/* + * Summary: dynamic module loading + * Description: basic API for dynamic module loading, used by + * libexslt added in 2.6.17 + * + * Copy: See Copyright for the status of this software. + * + * Author: Joel W. Reed + */ + +#ifndef __XML_MODULE_H__ +#define __XML_MODULE_H__ + +#include + +#ifdef LIBXML_MODULES_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlModulePtr: + * + * A handle to a dynamically loaded module + */ +typedef struct _xmlModule xmlModule; +typedef xmlModule *xmlModulePtr; + +/** + * xmlModuleOption: + * + * enumeration of options that can be passed down to xmlModuleOpen() + */ +typedef enum { + XML_MODULE_LAZY = 1, /* lazy binding */ + XML_MODULE_LOCAL= 2 /* local binding */ +} xmlModuleOption; + +XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename, + int options); + +XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module, + const char* name, + void **result); + +XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module); + +XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_MODULES_ENABLED */ + +#endif /*__XML_MODULE_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlreader.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlreader.h new file mode 100644 index 0000000..e8a8bcc --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlreader.h @@ -0,0 +1,428 @@ +/* + * Summary: the XMLReader implementation + * Description: API of the XML streaming API based on C# interfaces. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLREADER_H__ +#define __XML_XMLREADER_H__ + +#include +#include +#include +#ifdef LIBXML_SCHEMAS_ENABLED +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlParserSeverities: + * + * How severe an error callback is when the per-reader error callback API + * is used. + */ +typedef enum { + XML_PARSER_SEVERITY_VALIDITY_WARNING = 1, + XML_PARSER_SEVERITY_VALIDITY_ERROR = 2, + XML_PARSER_SEVERITY_WARNING = 3, + XML_PARSER_SEVERITY_ERROR = 4 +} xmlParserSeverities; + +#ifdef LIBXML_READER_ENABLED + +/** + * xmlTextReaderMode: + * + * Internal state values for the reader. + */ +typedef enum { + XML_TEXTREADER_MODE_INITIAL = 0, + XML_TEXTREADER_MODE_INTERACTIVE = 1, + XML_TEXTREADER_MODE_ERROR = 2, + XML_TEXTREADER_MODE_EOF =3, + XML_TEXTREADER_MODE_CLOSED = 4, + XML_TEXTREADER_MODE_READING = 5 +} xmlTextReaderMode; + +/** + * xmlParserProperties: + * + * Some common options to use with xmlTextReaderSetParserProp, but it + * is better to use xmlParserOption and the xmlReaderNewxxx and + * xmlReaderForxxx APIs now. + */ +typedef enum { + XML_PARSER_LOADDTD = 1, + XML_PARSER_DEFAULTATTRS = 2, + XML_PARSER_VALIDATE = 3, + XML_PARSER_SUBST_ENTITIES = 4 +} xmlParserProperties; + +/** + * xmlReaderTypes: + * + * Predefined constants for the different types of nodes. + */ +typedef enum { + XML_READER_TYPE_NONE = 0, + XML_READER_TYPE_ELEMENT = 1, + XML_READER_TYPE_ATTRIBUTE = 2, + XML_READER_TYPE_TEXT = 3, + XML_READER_TYPE_CDATA = 4, + XML_READER_TYPE_ENTITY_REFERENCE = 5, + XML_READER_TYPE_ENTITY = 6, + XML_READER_TYPE_PROCESSING_INSTRUCTION = 7, + XML_READER_TYPE_COMMENT = 8, + XML_READER_TYPE_DOCUMENT = 9, + XML_READER_TYPE_DOCUMENT_TYPE = 10, + XML_READER_TYPE_DOCUMENT_FRAGMENT = 11, + XML_READER_TYPE_NOTATION = 12, + XML_READER_TYPE_WHITESPACE = 13, + XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14, + XML_READER_TYPE_END_ELEMENT = 15, + XML_READER_TYPE_END_ENTITY = 16, + XML_READER_TYPE_XML_DECLARATION = 17 +} xmlReaderTypes; + +/** + * xmlTextReader: + * + * Structure for an xmlReader context. + */ +typedef struct _xmlTextReader xmlTextReader; + +/** + * xmlTextReaderPtr: + * + * Pointer to an xmlReader context. + */ +typedef xmlTextReader *xmlTextReaderPtr; + +/* + * Constructors & Destructor + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReader (xmlParserInputBufferPtr input, + const char *URI); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReaderFilename(const char *URI); + +XMLPUBFUN void XMLCALL + xmlFreeTextReader (xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderSetup(xmlTextReaderPtr reader, + xmlParserInputBufferPtr input, const char *URL, + const char *encoding, int options); + +/* + * Iterators + */ +XMLPUBFUN int XMLCALL + xmlTextReaderRead (xmlTextReaderPtr reader); + +#ifdef LIBXML_WRITER_ENABLED +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadInnerXml(xmlTextReaderPtr reader); + +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadOuterXml(xmlTextReaderPtr reader); +#endif + +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadString (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader); + +/* + * Attributes of the node + */ +XMLPUBFUN int XMLCALL + xmlTextReaderAttributeCount(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderDepth (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasAttributes(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasValue(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsDefault (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNodeType (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderQuoteChar (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadState (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader); + +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstLocalName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstPrefix (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstString (xmlTextReaderPtr reader, + const xmlChar *str); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstValue (xmlTextReaderPtr reader); + +/* + * use the Const version of the routine for + * better performance and simpler code + */ +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocalName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderPrefix (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderValue (xmlTextReaderPtr reader); + +/* + * Methods of the XmlTextReader + */ +XMLPUBFUN int XMLCALL + xmlTextReaderClose (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader, + int no); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttribute (xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlTextReaderGetRemainder (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, + const xmlChar *prefix); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, + int no); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToElement (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNormalization (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstEncoding (xmlTextReaderPtr reader); + +/* + * Extensions + */ +XMLPUBFUN int XMLCALL + xmlTextReaderSetParserProp (xmlTextReaderPtr reader, + int prop, + int value); +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserProp (xmlTextReaderPtr reader, + int prop); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderCurrentNode (xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader); + +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderPreserve (xmlTextReaderPtr reader); +#ifdef LIBXML_PATTERN_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderPreservePattern(xmlTextReaderPtr reader, + const xmlChar *pattern, + const xmlChar **namespaces); +#endif /* LIBXML_PATTERN_ENABLED */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlTextReaderCurrentDoc (xmlTextReaderPtr reader); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderExpand (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNext (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNextSibling (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsValid (xmlTextReaderPtr reader); +#ifdef LIBXML_SCHEMAS_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, + const char *rng); +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader, + xmlRelaxNGValidCtxtPtr ctxt, + int options); + +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, + xmlRelaxNGPtr schema); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, + const char *xsd); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader, + xmlSchemaValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlTextReaderSetSchema (xmlTextReaderPtr reader, + xmlSchemaPtr schema); +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderStandalone (xmlTextReaderPtr reader); + + +/* + * Index lookup + */ +XMLPUBFUN long XMLCALL + xmlTextReaderByteConsumed (xmlTextReaderPtr reader); + +/* + * New more complete APIs for simpler creation and reuse of readers + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderWalker (xmlDocPtr doc); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForDoc (const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFile (const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +XMLPUBFUN int XMLCALL + xmlReaderNewWalker (xmlTextReaderPtr reader, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlReaderNewDoc (xmlTextReaderPtr reader, + const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFile (xmlTextReaderPtr reader, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewMemory (xmlTextReaderPtr reader, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFd (xmlTextReaderPtr reader, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewIO (xmlTextReaderPtr reader, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +/* + * Error handling extensions + */ +typedef void * xmlTextReaderLocatorPtr; + +/** + * xmlTextReaderErrorFunc: + * @arg: the user argument + * @msg: the message + * @severity: the severity of the error + * @locator: a locator indicating where the error occurred + * + * Signature of an error callback from a reader parser + */ +typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, + const char *msg, + xmlParserSeverities severity, + xmlTextReaderLocatorPtr locator); +XMLPUBFUN int XMLCALL + xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); +XMLPUBFUN void XMLCALL + xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, + xmlStructuredErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, + void **arg); + +#endif /* LIBXML_READER_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XMLREADER_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlregexp.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlregexp.h new file mode 100644 index 0000000..7009645 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlregexp.h @@ -0,0 +1,222 @@ +/* + * Summary: regular expressions handling + * Description: basic API for libxml regular expressions handling used + * for XML Schemas and validation. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_REGEXP_H__ +#define __XML_REGEXP_H__ + +#include + +#ifdef LIBXML_REGEXP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlRegexpPtr: + * + * A libxml regular expression, they can actually be far more complex + * thank the POSIX regex expressions. + */ +typedef struct _xmlRegexp xmlRegexp; +typedef xmlRegexp *xmlRegexpPtr; + +/** + * xmlRegExecCtxtPtr: + * + * A libxml progressive regular expression evaluation context + */ +typedef struct _xmlRegExecCtxt xmlRegExecCtxt; +typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; + +#ifdef __cplusplus +} +#endif +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The POSIX like API + */ +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlRegexpCompile (const xmlChar *regexp); +XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpExec (xmlRegexpPtr comp, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlRegexpPrint (FILE *output, + xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpIsDeterminist(xmlRegexpPtr comp); + +/** + * xmlRegExecCallbacks: + * @exec: the regular expression context + * @token: the current token string + * @transdata: transition data + * @inputdata: input data + * + * Callback function when doing a transition in the automata + */ +typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, + const xmlChar *token, + void *transdata, + void *inputdata); + +/* + * The progressive API + */ +XMLPUBFUN xmlRegExecCtxtPtr XMLCALL + xmlRegNewExecCtxt (xmlRegexpPtr comp, + xmlRegExecCallbacks callback, + void *data); +XMLPUBFUN void XMLCALL + xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); +XMLPUBFUN int XMLCALL + xmlRegExecPushString(xmlRegExecCtxtPtr exec, + const xmlChar *value, + void *data); +XMLPUBFUN int XMLCALL + xmlRegExecPushString2(xmlRegExecCtxtPtr exec, + const xmlChar *value, + const xmlChar *value2, + void *data); + +XMLPUBFUN int XMLCALL + xmlRegExecNextValues(xmlRegExecCtxtPtr exec, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +XMLPUBFUN int XMLCALL + xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, + const xmlChar **string, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +#ifdef LIBXML_EXPR_ENABLED +/* + * Formal regular expression handling + * Its goal is to do some formal work on content models + */ + +/* expressions are used within a context */ +typedef struct _xmlExpCtxt xmlExpCtxt; +typedef xmlExpCtxt *xmlExpCtxtPtr; + +XMLPUBFUN void XMLCALL + xmlExpFreeCtxt (xmlExpCtxtPtr ctxt); +XMLPUBFUN xmlExpCtxtPtr XMLCALL + xmlExpNewCtxt (int maxNodes, + xmlDictPtr dict); + +XMLPUBFUN int XMLCALL + xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt); + +/* Expressions are trees but the tree is opaque */ +typedef struct _xmlExpNode xmlExpNode; +typedef xmlExpNode *xmlExpNodePtr; + +typedef enum { + XML_EXP_EMPTY = 0, + XML_EXP_FORBID = 1, + XML_EXP_ATOM = 2, + XML_EXP_SEQ = 3, + XML_EXP_OR = 4, + XML_EXP_COUNT = 5 +} xmlExpNodeType; + +/* + * 2 core expressions shared by all for the empty language set + * and for the set with just the empty token + */ +XMLPUBVAR xmlExpNodePtr forbiddenExp; +XMLPUBVAR xmlExpNodePtr emptyExp; + +/* + * Expressions are reference counted internally + */ +XMLPUBFUN void XMLCALL + xmlExpFree (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr); +XMLPUBFUN void XMLCALL + xmlExpRef (xmlExpNodePtr expr); + +/* + * constructors can be either manual or from a string + */ +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpParse (xmlExpCtxtPtr ctxt, + const char *expr); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewAtom (xmlExpCtxtPtr ctxt, + const xmlChar *name, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewOr (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewSeq (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewRange (xmlExpCtxtPtr ctxt, + xmlExpNodePtr subset, + int min, + int max); +/* + * The really interesting APIs + */ +XMLPUBFUN int XMLCALL + xmlExpIsNillable(xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpMaxToken (xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpGetLanguage(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**langList, + int len); +XMLPUBFUN int XMLCALL + xmlExpGetStart (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**tokList, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpStringDerive(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar *str, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpExpDerive (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN int XMLCALL + xmlExpSubsume (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN void XMLCALL + xmlExpDump (xmlBufferPtr buf, + xmlExpNodePtr expr); +#endif /* LIBXML_EXPR_ENABLED */ +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /*__XML_REGEXP_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlsave.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlsave.h new file mode 100644 index 0000000..fb329b2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlsave.h @@ -0,0 +1,88 @@ +/* + * Summary: the XML document serializer + * Description: API to save document or subtree of document + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLSAVE_H__ +#define __XML_XMLSAVE_H__ + +#include +#include +#include +#include + +#ifdef LIBXML_OUTPUT_ENABLED +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlSaveOption: + * + * This is the set of XML save options that can be passed down + * to the xmlSaveToFd() and similar calls. + */ +typedef enum { + XML_SAVE_FORMAT = 1<<0, /* format save output */ + XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ + XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ + XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ + XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ + XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ + XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */ + XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */ +} xmlSaveOption; + + +typedef struct _xmlSaveCtxt xmlSaveCtxt; +typedef xmlSaveCtxt *xmlSaveCtxtPtr; + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFd (int fd, + const char *encoding, + int options); +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFilename (const char *filename, + const char *encoding, + int options); + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToBuffer (xmlBufferPtr buffer, + const char *encoding, + int options); + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + const char *encoding, + int options); + +XMLPUBFUN long XMLCALL + xmlSaveDoc (xmlSaveCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN long XMLCALL + xmlSaveTree (xmlSaveCtxtPtr ctxt, + xmlNodePtr node); + +XMLPUBFUN int XMLCALL + xmlSaveFlush (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveClose (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveSetEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +XMLPUBFUN int XMLCALL + xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* __XML_XMLSAVE_H__ */ + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemas.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemas.h new file mode 100644 index 0000000..b90e9d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemas.h @@ -0,0 +1,246 @@ +/* + * Summary: incomplete XML Schemas structure implementation + * Description: interface to the XML Schemas handling and schema validity + * checking, it is incomplete right now. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_H__ +#define __XML_SCHEMA_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This error codes are obsolete; not used any more. + */ +typedef enum { + XML_SCHEMAS_ERR_OK = 0, + XML_SCHEMAS_ERR_NOROOT = 1, + XML_SCHEMAS_ERR_UNDECLAREDELEM, + XML_SCHEMAS_ERR_NOTTOPLEVEL, + XML_SCHEMAS_ERR_MISSING, + XML_SCHEMAS_ERR_WRONGELEM, + XML_SCHEMAS_ERR_NOTYPE, + XML_SCHEMAS_ERR_NOROLLBACK, + XML_SCHEMAS_ERR_ISABSTRACT, + XML_SCHEMAS_ERR_NOTEMPTY, + XML_SCHEMAS_ERR_ELEMCONT, + XML_SCHEMAS_ERR_HAVEDEFAULT, + XML_SCHEMAS_ERR_NOTNILLABLE, + XML_SCHEMAS_ERR_EXTRACONTENT, + XML_SCHEMAS_ERR_INVALIDATTR, + XML_SCHEMAS_ERR_INVALIDELEM, + XML_SCHEMAS_ERR_NOTDETERMINIST, + XML_SCHEMAS_ERR_CONSTRUCT, + XML_SCHEMAS_ERR_INTERNAL, + XML_SCHEMAS_ERR_NOTSIMPLE, + XML_SCHEMAS_ERR_ATTRUNKNOWN, + XML_SCHEMAS_ERR_ATTRINVALID, + XML_SCHEMAS_ERR_VALUE, + XML_SCHEMAS_ERR_FACET, + XML_SCHEMAS_ERR_, + XML_SCHEMAS_ERR_XXX +} xmlSchemaValidError; + +/* +* ATTENTION: Change xmlSchemaSetValidOptions's check +* for invalid values, if adding to the validation +* options below. +*/ +/** + * xmlSchemaValidOption: + * + * This is the set of XML Schema validation options. + */ +typedef enum { + XML_SCHEMA_VAL_VC_I_CREATE = 1<<0 + /* Default/fixed: create an attribute node + * or an element's text node on the instance. + */ +} xmlSchemaValidOption; + +/* + XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1, + * assemble schemata using + * xsi:schemaLocation and + * xsi:noNamespaceSchemaLocation +*/ + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchema xmlSchema; +typedef xmlSchema *xmlSchemaPtr; + +/** + * xmlSchemaValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from an XSD validation + */ +typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) + (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); + +/** + * xmlSchemaValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from an XSD validation + */ +typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) + (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); + +/** + * A schemas validation context + */ +typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt; +typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr; + +typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; +typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; + +/** + * xmlSchemaValidityLocatorFunc: + * @ctx: user provided context + * @file: returned file information + * @line: returned line information + * + * A schemas validation locator, a callback called by the validator. + * This is used when file or node information are not available + * to find out what file and line number are affected + * + * Returns: 0 in case of success and -1 in case of error + */ + +typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx, + const char **file, unsigned long *line); + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewDocParserCtxt (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc * err, + xmlSchemaValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaPtr XMLCALL + xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaFree (xmlSchemaPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlSchemaDump (FILE *output, + xmlSchemaPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc *err, + xmlSchemaValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, + int options); +XMLPUBFUN void XMLCALL + xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt, + const char *filename); +XMLPUBFUN int XMLCALL + xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL + xmlSchemaNewValidCtxt (xmlSchemaPtr schema); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, + xmlDocPtr instance); +XMLPUBFUN int XMLCALL + xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc, + xmlSAXHandlerPtr sax, + void *user_data); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt, + const char * filename, + int options); + +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt); + +/* + * Interface to insert Schemas SAX validation in a SAX stream + */ +typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct; +typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr; + +XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL + xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt, + xmlSAXHandlerPtr *sax, + void **user_data); +XMLPUBFUN int XMLCALL + xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); + + +XMLPUBFUN void XMLCALL + xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt, + xmlSchemaValidityLocatorFunc f, + void *ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h new file mode 100644 index 0000000..35d48d4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h @@ -0,0 +1,151 @@ +/* + * Summary: implementation of XML Schema Datatypes + * Description: module providing the XML Schema Datatypes implementation + * both definition and validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_TYPES_H__ +#define __XML_SCHEMA_TYPES_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMA_WHITESPACE_UNKNOWN = 0, + XML_SCHEMA_WHITESPACE_PRESERVE = 1, + XML_SCHEMA_WHITESPACE_REPLACE = 2, + XML_SCHEMA_WHITESPACE_COLLAPSE = 3 +} xmlSchemaWhitespaceValueType; + +XMLPUBFUN void XMLCALL + xmlSchemaInitTypes (void); +XMLPUBFUN void XMLCALL + xmlSchemaCleanupTypes (void); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetPredefinedType (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacet (xmlSchemaTypePtr base, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, + xmlSchemaWhitespaceValueType fws, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaFacetPtr XMLCALL + xmlSchemaNewFacet (void); +XMLPUBFUN int XMLCALL + xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, + xmlSchemaTypePtr typeDecl, + xmlSchemaParserCtxtPtr ctxt, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValues (xmlSchemaValPtr x, + xmlSchemaValPtr y); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); +XMLPUBFUN int XMLCALL + xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, + const xmlChar *value, + unsigned long actualLen, + unsigned long *expectedLen); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInType (xmlSchemaValType type); +XMLPUBFUN int XMLCALL + xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, + int facetType); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaCollapseString (const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaWhiteSpaceReplace (const xmlChar *value); +XMLPUBFUN unsigned long XMLCALL + xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValue (xmlSchemaValPtr val, + const xmlChar **retValue); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, + const xmlChar **retValue, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValueAppend (xmlSchemaValPtr prev, + xmlSchemaValPtr cur); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaValueGetNext (xmlSchemaValPtr cur); +XMLPUBFUN const xmlChar * XMLCALL + xmlSchemaValueGetAsString (xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewStringValue (xmlSchemaValType type, + const xmlChar *value); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewNOTATIONValue (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewQNameValue (const xmlChar *namespaceName, + const xmlChar *localName); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x, + xmlSchemaWhitespaceValueType xws, + xmlSchemaValPtr y, + xmlSchemaWhitespaceValueType yws); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaCopyValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValType XMLCALL + xmlSchemaGetValType (xmlSchemaValPtr val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_TYPES_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlstring.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlstring.h new file mode 100644 index 0000000..2d0b2d1 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlstring.h @@ -0,0 +1,140 @@ +/* + * Summary: set of routines to process strings + * Description: type and interfaces needed for the internal string handling + * of the library, especially UTF8 processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_STRING_H__ +#define __XML_STRING_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlChar: + * + * This is a basic byte in an UTF-8 encoded string. + * It's unsigned allowing to pinpoint case where char * are assigned + * to xmlChar * (possibly making serialization back impossible). + */ +typedef unsigned char xmlChar; + +/** + * BAD_CAST: + * + * Macro to cast a string to an xmlChar * when one know its safe. + */ +#define BAD_CAST (xmlChar *) + +/* + * xmlChar handling + */ +XMLPUBFUN xmlChar * XMLCALL + xmlStrdup (const xmlChar *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrndup (const xmlChar *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrndup (const char *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrdup (const char *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrsub (const xmlChar *str, + int start, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrchr (const xmlChar *str, + xmlChar val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrstr (const xmlChar *str, + const xmlChar *val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrcasestr (const xmlChar *str, + const xmlChar *val); +XMLPUBFUN int XMLCALL + xmlStrcmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrcasecmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncasecmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrEqual (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrQEqual (const xmlChar *pref, + const xmlChar *name, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlStrlen (const xmlChar *str); +XMLPUBFUN xmlChar * XMLCALL + xmlStrcat (xmlChar *cur, + const xmlChar *add); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncat (xmlChar *cur, + const xmlChar *add, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncatNew (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrPrintf (xmlChar *buf, + int len, + const char *msg, + ...) LIBXML_ATTR_FORMAT(3,4); +XMLPUBFUN int XMLCALL + xmlStrVPrintf (xmlChar *buf, + int len, + const char *msg, + va_list ap) LIBXML_ATTR_FORMAT(3,0); + +XMLPUBFUN int XMLCALL + xmlGetUTF8Char (const unsigned char *utf, + int *len); +XMLPUBFUN int XMLCALL + xmlCheckUTF8 (const unsigned char *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Strsize (const xmlChar *utf, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strndup (const xmlChar *utf, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlUTF8Strpos (const xmlChar *utf, + int pos); +XMLPUBFUN int XMLCALL + xmlUTF8Strloc (const xmlChar *utf, + const xmlChar *utfchar); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strsub (const xmlChar *utf, + int start, + int len); +XMLPUBFUN int XMLCALL + xmlUTF8Strlen (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Size (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Charcmp (const xmlChar *utf1, + const xmlChar *utf2); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_STRING_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlunicode.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlunicode.h new file mode 100644 index 0000000..01ac8b6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlunicode.h @@ -0,0 +1,202 @@ +/* + * Summary: Unicode character APIs + * Description: API for the Unicode character APIs + * + * This file is automatically generated from the + * UCS description files of the Unicode Character Database + * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html + * using the genUnicode.py Python script. + * + * Generation date: Mon Mar 27 11:09:52 2006 + * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt + * Author: Daniel Veillard + */ + +#ifndef __XML_UNICODE_H__ +#define __XML_UNICODE_H__ + +#include + +#ifdef LIBXML_UNICODE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers (int code); +XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArmenian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBengali (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBlockElements (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBuhid (int code); +XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCherokee (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsControlPictures (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDeseret (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDevanagari (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDingbats (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEthiopic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeorgian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGothic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreek (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGujarati (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHanunoo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHebrew (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHiragana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKanbun (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKannada (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmer (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLao (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLimbu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMalayalam (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMongolian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMyanmar (int code); +XMLPUBFUN int XMLCALL xmlUCSIsNumberForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOgham (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOldItalic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOriya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOsmanya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea (int code); +XMLPUBFUN int XMLCALL xmlUCSIsRunic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsShavian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSinhala (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpecials (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSyriac (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagalog (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTags (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiLe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTamil (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTelugu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThaana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThai (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTibetan (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUgaritic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsBlock (int code, const char *block); + +XMLPUBFUN int XMLCALL xmlUCSIsCatC (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatL (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLt (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatM (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMn (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatN (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatP (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatS (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSk (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZ (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZp (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZs (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsCat (int code, const char *cat); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_UNICODE_ENABLED */ + +#endif /* __XML_UNICODE_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlversion.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlversion.h new file mode 100644 index 0000000..e2dd875 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlversion.h @@ -0,0 +1,485 @@ +/* + * Summary: compile-time version information + * Description: compile-time version information for the XML library + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_VERSION_H__ +#define __XML_VERSION_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * use those to be sure nothing nasty will happen if + * your library and includes mismatch + */ +#ifndef LIBXML2_COMPILING_MSCCDEF +XMLPUBFUN void XMLCALL xmlCheckVersion(int version); +#endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXML_DOTTED_VERSION "2.9.12" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 10203 + */ +#define LIBXML_VERSION 20912 + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "10203" + */ +#define LIBXML_VERSION_STRING "20912" + +/** + * LIBXML_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXML_VERSION_EXTRA "" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ +#define LIBXML_TEST_VERSION xmlCheckVersion(20912); + +#ifndef VMS +#if 0 +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO +#else +/** + * WITHOUT_TRIO: + * + * defined if the trio support should not be configured in + */ +#define WITHOUT_TRIO +#endif +#else /* VMS */ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO 1 +#endif /* VMS */ + +/** + * LIBXML_THREAD_ENABLED: + * + * Whether the thread support is configured in + */ +#if 1 +#define LIBXML_THREAD_ENABLED +#endif + +/** + * LIBXML_THREAD_ALLOC_ENABLED: + * + * Whether the allocation hooks are per-thread + */ +#if 0 +#define LIBXML_THREAD_ALLOC_ENABLED +#endif + +/** + * LIBXML_TREE_ENABLED: + * + * Whether the DOM like tree manipulation API support is configured in + */ +#if 1 +#define LIBXML_TREE_ENABLED +#endif + +/** + * LIBXML_OUTPUT_ENABLED: + * + * Whether the serialization/saving support is configured in + */ +#if 1 +#define LIBXML_OUTPUT_ENABLED +#endif + +/** + * LIBXML_PUSH_ENABLED: + * + * Whether the push parsing interfaces are configured in + */ +#if 1 +#define LIBXML_PUSH_ENABLED +#endif + +/** + * LIBXML_READER_ENABLED: + * + * Whether the xmlReader parsing interface is configured in + */ +#if 1 +#define LIBXML_READER_ENABLED +#endif + +/** + * LIBXML_PATTERN_ENABLED: + * + * Whether the xmlPattern node selection interface is configured in + */ +#if 1 +#define LIBXML_PATTERN_ENABLED +#endif + +/** + * LIBXML_WRITER_ENABLED: + * + * Whether the xmlWriter saving interface is configured in + */ +#if 1 +#define LIBXML_WRITER_ENABLED +#endif + +/** + * LIBXML_SAX1_ENABLED: + * + * Whether the older SAX1 interface is configured in + */ +#if 1 +#define LIBXML_SAX1_ENABLED +#endif + +/** + * LIBXML_FTP_ENABLED: + * + * Whether the FTP support is configured in + */ +#if 1 +#define LIBXML_FTP_ENABLED +#endif + +/** + * LIBXML_HTTP_ENABLED: + * + * Whether the HTTP support is configured in + */ +#if 1 +#define LIBXML_HTTP_ENABLED +#endif + +/** + * LIBXML_VALID_ENABLED: + * + * Whether the DTD validation support is configured in + */ +#if 1 +#define LIBXML_VALID_ENABLED +#endif + +/** + * LIBXML_HTML_ENABLED: + * + * Whether the HTML support is configured in + */ +#if 1 +#define LIBXML_HTML_ENABLED +#endif + +/** + * LIBXML_LEGACY_ENABLED: + * + * Whether the deprecated APIs are compiled in for compatibility + */ +#if 1 +#define LIBXML_LEGACY_ENABLED +#endif + +/** + * LIBXML_C14N_ENABLED: + * + * Whether the Canonicalization support is configured in + */ +#if 1 +#define LIBXML_C14N_ENABLED +#endif + +/** + * LIBXML_CATALOG_ENABLED: + * + * Whether the Catalog support is configured in + */ +#if 1 +#define LIBXML_CATALOG_ENABLED +#endif + +/** + * LIBXML_DOCB_ENABLED: + * + * Whether the SGML Docbook support is configured in + */ +#if 1 +#define LIBXML_DOCB_ENABLED +#endif + +/** + * LIBXML_XPATH_ENABLED: + * + * Whether XPath is configured in + */ +#if 1 +#define LIBXML_XPATH_ENABLED +#endif + +/** + * LIBXML_XPTR_ENABLED: + * + * Whether XPointer is configured in + */ +#if 1 +#define LIBXML_XPTR_ENABLED +#endif + +/** + * LIBXML_XINCLUDE_ENABLED: + * + * Whether XInclude is configured in + */ +#if 1 +#define LIBXML_XINCLUDE_ENABLED +#endif + +/** + * LIBXML_ICONV_ENABLED: + * + * Whether iconv support is available + */ +#if 1 +#define LIBXML_ICONV_ENABLED +#endif + +/** + * LIBXML_ICU_ENABLED: + * + * Whether icu support is available + */ +#if 0 +#define LIBXML_ICU_ENABLED +#endif + +/** + * LIBXML_ISO8859X_ENABLED: + * + * Whether ISO-8859-* support is made available in case iconv is not + */ +#if 1 +#define LIBXML_ISO8859X_ENABLED +#endif + +/** + * LIBXML_DEBUG_ENABLED: + * + * Whether Debugging module is configured in + */ +#if 1 +#define LIBXML_DEBUG_ENABLED +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * Whether the memory debugging is configured in + */ +#if 0 +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * LIBXML_DEBUG_RUNTIME: + * + * Whether the runtime debugging is configured in + */ +#if 0 +#define LIBXML_DEBUG_RUNTIME +#endif + +/** + * LIBXML_UNICODE_ENABLED: + * + * Whether the Unicode related interfaces are compiled in + */ +#if 1 +#define LIBXML_UNICODE_ENABLED +#endif + +/** + * LIBXML_REGEXP_ENABLED: + * + * Whether the regular expressions interfaces are compiled in + */ +#if 1 +#define LIBXML_REGEXP_ENABLED +#endif + +/** + * LIBXML_AUTOMATA_ENABLED: + * + * Whether the automata interfaces are compiled in + */ +#if 1 +#define LIBXML_AUTOMATA_ENABLED +#endif + +/** + * LIBXML_EXPR_ENABLED: + * + * Whether the formal expressions interfaces are compiled in + * + * This code is unused and disabled unconditionally for now. + */ +#if 0 +#define LIBXML_EXPR_ENABLED +#endif + +/** + * LIBXML_SCHEMAS_ENABLED: + * + * Whether the Schemas validation interfaces are compiled in + */ +#if 1 +#define LIBXML_SCHEMAS_ENABLED +#endif + +/** + * LIBXML_SCHEMATRON_ENABLED: + * + * Whether the Schematron validation interfaces are compiled in + */ +#if 1 +#define LIBXML_SCHEMATRON_ENABLED +#endif + +/** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if 1 +#define LIBXML_MODULES_ENABLED +/** + * LIBXML_MODULE_EXTENSION: + * + * the string suffix used by dynamic modules (usually shared libraries) + */ +#define LIBXML_MODULE_EXTENSION ".so" +#endif + +/** + * LIBXML_ZLIB_ENABLED: + * + * Whether the Zlib support is compiled in + */ +#if 1 +#define LIBXML_ZLIB_ENABLED +#endif + +/** + * LIBXML_LZMA_ENABLED: + * + * Whether the Lzma support is compiled in + */ +#if 0 +#define LIBXML_LZMA_ENABLED +#endif + +#ifdef __GNUC__ + +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ + +#ifndef ATTRIBUTE_UNUSED +# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +# else +# define ATTRIBUTE_UNUSED +# endif +#endif + +/** + * LIBXML_ATTR_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ + +#ifndef LIBXML_ATTR_ALLOC_SIZE +# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) +# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) +# else +# define LIBXML_ATTR_ALLOC_SIZE(x) +# endif +#else +# define LIBXML_ATTR_ALLOC_SIZE(x) +#endif + +/** + * LIBXML_ATTR_FORMAT: + * + * Macro used to indicate to GCC the parameter are printf like + */ + +#ifndef LIBXML_ATTR_FORMAT +# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args))) +# else +# define LIBXML_ATTR_FORMAT(fmt,args) +# endif +#else +# define LIBXML_ATTR_FORMAT(fmt,args) +#endif + +#else /* ! __GNUC__ */ +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ +#define ATTRIBUTE_UNUSED +/** + * LIBXML_ATTR_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ +#define LIBXML_ATTR_ALLOC_SIZE(x) +/** + * LIBXML_ATTR_FORMAT: + * + * Macro used to indicate to GCC the parameter are printf like + */ +#define LIBXML_ATTR_FORMAT(fmt,args) +#endif /* __GNUC__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlwriter.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlwriter.h new file mode 100644 index 0000000..dd5add3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xmlwriter.h @@ -0,0 +1,488 @@ +/* + * Summary: text writing API for XML + * Description: text writing API for XML + * + * Copy: See Copyright for the status of this software. + * + * Author: Alfred Mickautsch + */ + +#ifndef __XML_XMLWRITER_H__ +#define __XML_XMLWRITER_H__ + +#include + +#ifdef LIBXML_WRITER_ENABLED + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _xmlTextWriter xmlTextWriter; + typedef xmlTextWriter *xmlTextWriterPtr; + +/* + * Constructors & Destructor + */ + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriter(xmlOutputBufferPtr out); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterFilename(const char *uri, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, + int compression); + XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); + +/* + * Functions + */ + + +/* + * Document + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDocument(xmlTextWriterPtr writer, + const char *version, + const char *encoding, + const char *standalone); + XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr + writer); + +/* + * Comments + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr + writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, + const char *format, ...) + LIBXML_ATTR_FORMAT(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(2,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr + writer, + const xmlChar * + content); + +/* + * Elements + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr + writer); + +/* + * Elements conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + LIBXML_ATTR_FORMAT(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...) + LIBXML_ATTR_FORMAT(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(5,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * Text + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer, + const char *format, ...) + LIBXML_ATTR_FORMAT(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer, + const char *format, va_list argptr) + LIBXML_ATTR_FORMAT(2,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, + const xmlChar * content, int len); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRaw(xmlTextWriterPtr writer, + const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr + writer, + const char + *format, ...) + LIBXML_ATTR_FORMAT(2,3); + XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr + writer, + const char + *format, + va_list argptr) + LIBXML_ATTR_FORMAT(2,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer, + const xmlChar * + content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer, + const char *data, + int start, int len); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, + const char *data, + int start, int len); + +/* + * Attributes + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartAttribute(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr + writer); + +/* + * Attributes conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + LIBXML_ATTR_FORMAT(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...) + LIBXML_ATTR_FORMAT(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(5,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * PI's + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartPI(xmlTextWriterPtr writer, + const xmlChar * target); + XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer); + +/* + * PI conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, ...) + LIBXML_ATTR_FORMAT(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, va_list argptr) + LIBXML_ATTR_FORMAT(3,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWritePI(xmlTextWriterPtr writer, + const xmlChar * target, + const xmlChar * content); + +/** + * xmlTextWriterWriteProcessingInstruction: + * + * This macro maps to xmlTextWriterWritePI + */ +#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI + +/* + * CDATA + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer); + +/* + * CDATA conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, + const char *format, ...) + LIBXML_ATTR_FORMAT(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer, + const char *format, va_list argptr) + LIBXML_ATTR_FORMAT(2,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteCDATA(xmlTextWriterPtr writer, + const xmlChar * content); + +/* + * DTD + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer); + +/* + * DTD conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, ...) + LIBXML_ATTR_FORMAT(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, va_list argptr) + LIBXML_ATTR_FORMAT(5,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * subset); + +/** + * xmlTextWriterWriteDocType: + * + * this macro maps to xmlTextWriterWriteDTD + */ +#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD + +/* + * DTD element definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr + writer); + +/* + * DTD element definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + LIBXML_ATTR_FORMAT(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD attribute list definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr + writer); + +/* + * DTD attribute list definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + LIBXML_ATTR_FORMAT(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD entity definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, + int pe, const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr + writer); + +/* + * DTD entity definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, ...) + LIBXML_ATTR_FORMAT(4,5); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, + va_list argptr) + LIBXML_ATTR_FORMAT(4,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * ndataid); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr + writer, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * + ndataid); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr + writer, int pe, + const xmlChar * name, + const xmlChar * + pubid, + const xmlChar * + sysid, + const xmlChar * + ndataid, + const xmlChar * + content); + +/* + * DTD notation definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + +/* + * Indentation + */ + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent); + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndentString(xmlTextWriterPtr writer, + const xmlChar * str); + + XMLPUBFUN int XMLCALL + xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar); + + +/* + * misc + */ + XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_WRITER_ENABLED */ + +#endif /* __XML_XMLWRITER_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpath.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpath.h new file mode 100644 index 0000000..539593f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpath.h @@ -0,0 +1,564 @@ +/* + * Summary: XML Path Language implementation + * Description: API for the XML Path Language implementation + * + * XML Path Language implementation + * XPath is a language for addressing parts of an XML document, + * designed to be used by both XSLT and XPointer + * http://www.w3.org/TR/xpath + * + * Implements + * W3C Recommendation 16 November 1999 + * http://www.w3.org/TR/1999/REC-xpath-19991116 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_H__ +#define __XML_XPATH_H__ + +#include + +#ifdef LIBXML_XPATH_ENABLED + +#include +#include +#include +#endif /* LIBXML_XPATH_ENABLED */ + +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +#ifdef __cplusplus +extern "C" { +#endif +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +#ifdef LIBXML_XPATH_ENABLED + +typedef struct _xmlXPathContext xmlXPathContext; +typedef xmlXPathContext *xmlXPathContextPtr; +typedef struct _xmlXPathParserContext xmlXPathParserContext; +typedef xmlXPathParserContext *xmlXPathParserContextPtr; + +/** + * The set of XPath error codes. + */ + +typedef enum { + XPATH_EXPRESSION_OK = 0, + XPATH_NUMBER_ERROR, + XPATH_UNFINISHED_LITERAL_ERROR, + XPATH_START_LITERAL_ERROR, + XPATH_VARIABLE_REF_ERROR, + XPATH_UNDEF_VARIABLE_ERROR, + XPATH_INVALID_PREDICATE_ERROR, + XPATH_EXPR_ERROR, + XPATH_UNCLOSED_ERROR, + XPATH_UNKNOWN_FUNC_ERROR, + XPATH_INVALID_OPERAND, + XPATH_INVALID_TYPE, + XPATH_INVALID_ARITY, + XPATH_INVALID_CTXT_SIZE, + XPATH_INVALID_CTXT_POSITION, + XPATH_MEMORY_ERROR, + XPTR_SYNTAX_ERROR, + XPTR_RESOURCE_ERROR, + XPTR_SUB_RESOURCE_ERROR, + XPATH_UNDEF_PREFIX_ERROR, + XPATH_ENCODING_ERROR, + XPATH_INVALID_CHAR_ERROR, + XPATH_INVALID_CTXT, + XPATH_STACK_ERROR, + XPATH_FORBID_VARIABLE_ERROR, + XPATH_OP_LIMIT_EXCEEDED, + XPATH_RECURSION_LIMIT_EXCEEDED +} xmlXPathError; + +/* + * A node-set (an unordered collection of nodes without duplicates). + */ +typedef struct _xmlNodeSet xmlNodeSet; +typedef xmlNodeSet *xmlNodeSetPtr; +struct _xmlNodeSet { + int nodeNr; /* number of nodes in the set */ + int nodeMax; /* size of the array as allocated */ + xmlNodePtr *nodeTab; /* array of nodes in no particular order */ + /* @@ with_ns to check whether namespace nodes should be looked at @@ */ +}; + +/* + * An expression is evaluated to yield an object, which + * has one of the following four basic types: + * - node-set + * - boolean + * - number + * - string + * + * @@ XPointer will add more types ! + */ + +typedef enum { + XPATH_UNDEFINED = 0, + XPATH_NODESET = 1, + XPATH_BOOLEAN = 2, + XPATH_NUMBER = 3, + XPATH_STRING = 4, + XPATH_POINT = 5, + XPATH_RANGE = 6, + XPATH_LOCATIONSET = 7, + XPATH_USERS = 8, + XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ +} xmlXPathObjectType; + +typedef struct _xmlXPathObject xmlXPathObject; +typedef xmlXPathObject *xmlXPathObjectPtr; +struct _xmlXPathObject { + xmlXPathObjectType type; + xmlNodeSetPtr nodesetval; + int boolval; + double floatval; + xmlChar *stringval; + void *user; + int index; + void *user2; + int index2; +}; + +/** + * xmlXPathConvertFunc: + * @obj: an XPath object + * @type: the number of the target type + * + * A conversion function is associated to a type and used to cast + * the new type to primitive values. + * + * Returns -1 in case of error, 0 otherwise + */ +typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type); + +/* + * Extra type: a name and a conversion function. + */ + +typedef struct _xmlXPathType xmlXPathType; +typedef xmlXPathType *xmlXPathTypePtr; +struct _xmlXPathType { + const xmlChar *name; /* the type name */ + xmlXPathConvertFunc func; /* the conversion function */ +}; + +/* + * Extra variable: a name and a value. + */ + +typedef struct _xmlXPathVariable xmlXPathVariable; +typedef xmlXPathVariable *xmlXPathVariablePtr; +struct _xmlXPathVariable { + const xmlChar *name; /* the variable name */ + xmlXPathObjectPtr value; /* the value */ +}; + +/** + * xmlXPathEvalFunc: + * @ctxt: an XPath parser context + * @nargs: the number of arguments passed to the function + * + * An XPath evaluation function, the parameters are on the XPath context stack. + */ + +typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt, + int nargs); + +/* + * Extra function: a name and a evaluation function. + */ + +typedef struct _xmlXPathFunct xmlXPathFunct; +typedef xmlXPathFunct *xmlXPathFuncPtr; +struct _xmlXPathFunct { + const xmlChar *name; /* the function name */ + xmlXPathEvalFunc func; /* the evaluation function */ +}; + +/** + * xmlXPathAxisFunc: + * @ctxt: the XPath interpreter context + * @cur: the previous node being explored on that axis + * + * An axis traversal function. To traverse an axis, the engine calls + * the first time with cur == NULL and repeat until the function returns + * NULL indicating the end of the axis traversal. + * + * Returns the next node in that axis or NULL if at the end of the axis. + */ + +typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr cur); + +/* + * Extra axis: a name and an axis function. + */ + +typedef struct _xmlXPathAxis xmlXPathAxis; +typedef xmlXPathAxis *xmlXPathAxisPtr; +struct _xmlXPathAxis { + const xmlChar *name; /* the axis name */ + xmlXPathAxisFunc func; /* the search function */ +}; + +/** + * xmlXPathFunction: + * @ctxt: the XPath interprestation context + * @nargs: the number of arguments + * + * An XPath function. + * The arguments (if any) are popped out from the context stack + * and the result is pushed on the stack. + */ + +typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs); + +/* + * Function and Variable Lookup. + */ + +/** + * xmlXPathVariableLookupFunc: + * @ctxt: an XPath context + * @name: name of the variable + * @ns_uri: the namespace name hosting this variable + * + * Prototype for callbacks used to plug variable lookup in the XPath + * engine. + * + * Returns the XPath object value or NULL if not found. + */ +typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathFuncLookupFunc: + * @ctxt: an XPath context + * @name: name of the function + * @ns_uri: the namespace name hosting this function + * + * Prototype for callbacks used to plug function lookup in the XPath + * engine. + * + * Returns the XPath function or NULL if not found. + */ +typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathFlags: + * Flags for XPath engine compilation and runtime + */ +/** + * XML_XPATH_CHECKNS: + * + * check namespaces at compilation + */ +#define XML_XPATH_CHECKNS (1<<0) +/** + * XML_XPATH_NOVAR: + * + * forbid variables in expression + */ +#define XML_XPATH_NOVAR (1<<1) + +/** + * xmlXPathContext: + * + * Expression evaluation occurs with respect to a context. + * he context consists of: + * - a node (the context node) + * - a node list (the context node list) + * - a set of variable bindings + * - a function library + * - the set of namespace declarations in scope for the expression + * Following the switch to hash tables, this need to be trimmed up at + * the next binary incompatible release. + * The node may be modified when the context is passed to libxml2 + * for an XPath evaluation so you may need to initialize it again + * before the next call. + */ + +struct _xmlXPathContext { + xmlDocPtr doc; /* The current document */ + xmlNodePtr node; /* The current node */ + + int nb_variables_unused; /* unused (hash table) */ + int max_variables_unused; /* unused (hash table) */ + xmlHashTablePtr varHash; /* Hash table of defined variables */ + + int nb_types; /* number of defined types */ + int max_types; /* max number of types */ + xmlXPathTypePtr types; /* Array of defined types */ + + int nb_funcs_unused; /* unused (hash table) */ + int max_funcs_unused; /* unused (hash table) */ + xmlHashTablePtr funcHash; /* Hash table of defined funcs */ + + int nb_axis; /* number of defined axis */ + int max_axis; /* max number of axis */ + xmlXPathAxisPtr axis; /* Array of defined axis */ + + /* the namespace nodes of the context node */ + xmlNsPtr *namespaces; /* Array of namespaces */ + int nsNr; /* number of namespace in scope */ + void *user; /* function to free */ + + /* extra variables */ + int contextSize; /* the context size */ + int proximityPosition; /* the proximity position */ + + /* extra stuff for XPointer */ + int xptr; /* is this an XPointer context? */ + xmlNodePtr here; /* for here() */ + xmlNodePtr origin; /* for origin() */ + + /* the set of namespace declarations in scope for the expression */ + xmlHashTablePtr nsHash; /* The namespaces hash table */ + xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */ + void *varLookupData; /* variable lookup data */ + + /* Possibility to link in an extra item */ + void *extra; /* needed for XSLT */ + + /* The function name and URI when calling a function */ + const xmlChar *function; + const xmlChar *functionURI; + + /* function lookup function and data */ + xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */ + void *funcLookupData; /* function lookup data */ + + /* temporary namespace lists kept for walking the namespace axis */ + xmlNsPtr *tmpNsList; /* Array of namespaces */ + int tmpNsNr; /* number of namespaces in scope */ + + /* error reporting mechanism */ + void *userData; /* user specific data block */ + xmlStructuredErrorFunc error; /* the callback in case of errors */ + xmlError lastError; /* the last error */ + xmlNodePtr debugNode; /* the source node XSLT */ + + /* dictionary */ + xmlDictPtr dict; /* dictionary if any */ + + int flags; /* flags to control compilation */ + + /* Cache for reusal of XPath objects */ + void *cache; + + /* Resource limits */ + unsigned long opLimit; + unsigned long opCount; + int depth; +}; + +/* + * The structure of a compiled expression form is not public. + */ + +typedef struct _xmlXPathCompExpr xmlXPathCompExpr; +typedef xmlXPathCompExpr *xmlXPathCompExprPtr; + +/** + * xmlXPathParserContext: + * + * An XPath parser context. It contains pure parsing information, + * an xmlXPathContext, and the stack of objects. + */ +struct _xmlXPathParserContext { + const xmlChar *cur; /* the current char being parsed */ + const xmlChar *base; /* the full expression */ + + int error; /* error code */ + + xmlXPathContextPtr context; /* the evaluation context */ + xmlXPathObjectPtr value; /* the current value */ + int valueNr; /* number of values stacked */ + int valueMax; /* max number of values stacked */ + xmlXPathObjectPtr *valueTab; /* stack of values */ + + xmlXPathCompExprPtr comp; /* the precompiled expression */ + int xptr; /* it this an XPointer expression */ + xmlNodePtr ancestor; /* used for walking preceding axis */ + + int valueFrame; /* used to limit Pop on the stack */ +}; + +/************************************************************************ + * * + * Public API * + * * + ************************************************************************/ + +/** + * Objects and Nodesets handling + */ + +XMLPUBVAR double xmlXPathNAN; +XMLPUBVAR double xmlXPathPINF; +XMLPUBVAR double xmlXPathNINF; + +/* These macros may later turn into functions */ +/** + * xmlXPathNodeSetGetLength: + * @ns: a node-set + * + * Implement a functionality similar to the DOM NodeList.length. + * + * Returns the number of nodes in the node-set. + */ +#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0) +/** + * xmlXPathNodeSetItem: + * @ns: a node-set + * @index: index of a node in the set + * + * Implements a functionality similar to the DOM NodeList.item(). + * + * Returns the xmlNodePtr at the given @index in @ns or NULL if + * @index is out of range (0 to length-1) + */ +#define xmlXPathNodeSetItem(ns, index) \ + ((((ns) != NULL) && \ + ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ + (ns)->nodeTab[(index)] \ + : NULL) +/** + * xmlXPathNodeSetIsEmpty: + * @ns: a node-set + * + * Checks whether @ns is empty or not. + * + * Returns %TRUE if @ns is an empty node-set. + */ +#define xmlXPathNodeSetIsEmpty(ns) \ + (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) + + +XMLPUBFUN void XMLCALL + xmlXPathFreeObject (xmlXPathObjectPtr obj); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetCreate (xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSet (xmlNodeSetPtr obj); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathObjectCopy (xmlXPathObjectPtr val); +XMLPUBFUN int XMLCALL + xmlXPathCmpNodes (xmlNodePtr node1, + xmlNodePtr node2); +/** + * Conversion functions to basic types. + */ +XMLPUBFUN int XMLCALL + xmlXPathCastNumberToBoolean (double val); +XMLPUBFUN int XMLCALL + xmlXPathCastStringToBoolean (const xmlChar * val); +XMLPUBFUN int XMLCALL + xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); +XMLPUBFUN int XMLCALL + xmlXPathCastToBoolean (xmlXPathObjectPtr val); + +XMLPUBFUN double XMLCALL + xmlXPathCastBooleanToNumber (int val); +XMLPUBFUN double XMLCALL + xmlXPathCastStringToNumber (const xmlChar * val); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeToNumber (xmlNodePtr node); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); +XMLPUBFUN double XMLCALL + xmlXPathCastToNumber (xmlXPathObjectPtr val); + +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastBooleanToString (int val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNumberToString (double val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeToString (xmlNodePtr node); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastToString (xmlXPathObjectPtr val); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertBoolean (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertNumber (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertString (xmlXPathObjectPtr val); + +/** + * Context handling. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPathNewContext (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlXPathFreeContext (xmlXPathContextPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXPathContextSetCache(xmlXPathContextPtr ctxt, + int active, + int value, + int options); +/** + * Evaluation functions. + */ +XMLPUBFUN long XMLCALL + xmlXPathOrderDocElems (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXPathSetContextNode (xmlNodePtr node, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNodeEval (xmlNodePtr node, + const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEvalExpression (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, + xmlXPathObjectPtr res); +/** + * Separate compilation/evaluation entry points. + */ +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCompile (const xmlChar *str); +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, + const xmlChar *str); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathCompiledEval (xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctx); +XMLPUBFUN int XMLCALL + xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); +#endif /* LIBXML_XPATH_ENABLED */ +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN void XMLCALL + xmlXPathInit (void); +XMLPUBFUN int XMLCALL + xmlXPathIsNaN (double val); +XMLPUBFUN int XMLCALL + xmlXPathIsInf (double val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/ +#endif /* ! __XML_XPATH_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpathInternals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpathInternals.h new file mode 100644 index 0000000..76a6b48 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpathInternals.h @@ -0,0 +1,632 @@ +/* + * Summary: internal interfaces for XML Path Language implementation + * Description: internal interfaces for XML Path Language implementation + * used to build new modules on top of XPath like XPointer and + * XSLT + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_INTERNALS_H__ +#define __XML_XPATH_INTERNALS_H__ + +#include +#include + +#ifdef LIBXML_XPATH_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************ + * * + * Helpers * + * * + ************************************************************************/ + +/* + * Many of these macros may later turn into functions. They + * shouldn't be used in #ifdef's preprocessor instructions. + */ +/** + * xmlXPathSetError: + * @ctxt: an XPath parser context + * @err: an xmlXPathError code + * + * Raises an error. + */ +#define xmlXPathSetError(ctxt, err) \ + { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \ + if ((ctxt) != NULL) (ctxt)->error = (err); } + +/** + * xmlXPathSetArityError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_ARITY error. + */ +#define xmlXPathSetArityError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_ARITY) + +/** + * xmlXPathSetTypeError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_TYPE error. + */ +#define xmlXPathSetTypeError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_TYPE) + +/** + * xmlXPathGetError: + * @ctxt: an XPath parser context + * + * Get the error code of an XPath context. + * + * Returns the context error. + */ +#define xmlXPathGetError(ctxt) ((ctxt)->error) + +/** + * xmlXPathCheckError: + * @ctxt: an XPath parser context + * + * Check if an XPath error was raised. + * + * Returns true if an error has been raised, false otherwise. + */ +#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK) + +/** + * xmlXPathGetDocument: + * @ctxt: an XPath parser context + * + * Get the document of an XPath context. + * + * Returns the context document. + */ +#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc) + +/** + * xmlXPathGetContextNode: + * @ctxt: an XPath parser context + * + * Get the context node of an XPath context. + * + * Returns the context node. + */ +#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) + +XMLPUBFUN int XMLCALL + xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); +XMLPUBFUN double XMLCALL + xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathPopString (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void * XMLCALL + xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); + +/** + * xmlXPathReturnBoolean: + * @ctxt: an XPath parser context + * @val: a boolean + * + * Pushes the boolean @val on the context stack. + */ +#define xmlXPathReturnBoolean(ctxt, val) \ + valuePush((ctxt), xmlXPathNewBoolean(val)) + +/** + * xmlXPathReturnTrue: + * @ctxt: an XPath parser context + * + * Pushes true on the context stack. + */ +#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1) + +/** + * xmlXPathReturnFalse: + * @ctxt: an XPath parser context + * + * Pushes false on the context stack. + */ +#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0) + +/** + * xmlXPathReturnNumber: + * @ctxt: an XPath parser context + * @val: a double + * + * Pushes the double @val on the context stack. + */ +#define xmlXPathReturnNumber(ctxt, val) \ + valuePush((ctxt), xmlXPathNewFloat(val)) + +/** + * xmlXPathReturnString: + * @ctxt: an XPath parser context + * @str: a string + * + * Pushes the string @str on the context stack. + */ +#define xmlXPathReturnString(ctxt, str) \ + valuePush((ctxt), xmlXPathWrapString(str)) + +/** + * xmlXPathReturnEmptyString: + * @ctxt: an XPath parser context + * + * Pushes an empty string on the stack. + */ +#define xmlXPathReturnEmptyString(ctxt) \ + valuePush((ctxt), xmlXPathNewCString("")) + +/** + * xmlXPathReturnNodeSet: + * @ctxt: an XPath parser context + * @ns: a node-set + * + * Pushes the node-set @ns on the context stack. + */ +#define xmlXPathReturnNodeSet(ctxt, ns) \ + valuePush((ctxt), xmlXPathWrapNodeSet(ns)) + +/** + * xmlXPathReturnEmptyNodeSet: + * @ctxt: an XPath parser context + * + * Pushes an empty node-set on the context stack. + */ +#define xmlXPathReturnEmptyNodeSet(ctxt) \ + valuePush((ctxt), xmlXPathNewNodeSet(NULL)) + +/** + * xmlXPathReturnExternal: + * @ctxt: an XPath parser context + * @val: user data + * + * Pushes user data on the context stack. + */ +#define xmlXPathReturnExternal(ctxt, val) \ + valuePush((ctxt), xmlXPathWrapExternal(val)) + +/** + * xmlXPathStackIsNodeSet: + * @ctxt: an XPath parser context + * + * Check if the current value on the XPath stack is a node set or + * an XSLT value tree. + * + * Returns true if the current object on the stack is a node-set. + */ +#define xmlXPathStackIsNodeSet(ctxt) \ + (((ctxt)->value != NULL) \ + && (((ctxt)->value->type == XPATH_NODESET) \ + || ((ctxt)->value->type == XPATH_XSLT_TREE))) + +/** + * xmlXPathStackIsExternal: + * @ctxt: an XPath parser context + * + * Checks if the current value on the XPath stack is an external + * object. + * + * Returns true if the current object on the stack is an external + * object. + */ +#define xmlXPathStackIsExternal(ctxt) \ + ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS)) + +/** + * xmlXPathEmptyNodeSet: + * @ns: a node-set + * + * Empties a node-set. + */ +#define xmlXPathEmptyNodeSet(ns) \ + { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; } + +/** + * CHECK_ERROR: + * + * Macro to return from the function if an XPath error was detected. + */ +#define CHECK_ERROR \ + if (ctxt->error != XPATH_EXPRESSION_OK) return + +/** + * CHECK_ERROR0: + * + * Macro to return 0 from the function if an XPath error was detected. + */ +#define CHECK_ERROR0 \ + if (ctxt->error != XPATH_EXPRESSION_OK) return(0) + +/** + * XP_ERROR: + * @X: the error code + * + * Macro to raise an XPath error and return. + */ +#define XP_ERROR(X) \ + { xmlXPathErr(ctxt, X); return; } + +/** + * XP_ERROR0: + * @X: the error code + * + * Macro to raise an XPath error and return 0. + */ +#define XP_ERROR0(X) \ + { xmlXPathErr(ctxt, X); return(0); } + +/** + * CHECK_TYPE: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. + */ +#define CHECK_TYPE(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR(XPATH_INVALID_TYPE) + +/** + * CHECK_TYPE0: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. Return(0) in case of failure + */ +#define CHECK_TYPE0(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR0(XPATH_INVALID_TYPE) + +/** + * CHECK_ARITY: + * @x: the number of expected args + * + * Macro to check that the number of args passed to an XPath function matches. + */ +#define CHECK_ARITY(x) \ + if (ctxt == NULL) return; \ + if (nargs != (x)) \ + XP_ERROR(XPATH_INVALID_ARITY); \ + if (ctxt->valueNr < ctxt->valueFrame + (x)) \ + XP_ERROR(XPATH_STACK_ERROR); + +/** + * CAST_TO_STRING: + * + * Macro to try to cast the value on the top of the XPath stack to a string. + */ +#define CAST_TO_STRING \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ + xmlXPathStringFunction(ctxt, 1); + +/** + * CAST_TO_NUMBER: + * + * Macro to try to cast the value on the top of the XPath stack to a number. + */ +#define CAST_TO_NUMBER \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ + xmlXPathNumberFunction(ctxt, 1); + +/** + * CAST_TO_BOOLEAN: + * + * Macro to try to cast the value on the top of the XPath stack to a boolean. + */ +#define CAST_TO_BOOLEAN \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ + xmlXPathBooleanFunction(ctxt, 1); + +/* + * Variable Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, + xmlXPathVariableLookupFunc f, + void *data); + +/* + * Function Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, + xmlXPathFuncLookupFunc f, + void *funcCtxt); + +/* + * Error reporting. + */ +XMLPUBFUN void XMLCALL + xmlXPatherror (xmlXPathParserContextPtr ctxt, + const char *file, + int line, + int no); + +XMLPUBFUN void XMLCALL + xmlXPathErr (xmlXPathParserContextPtr ctxt, + int error); + +#ifdef LIBXML_DEBUG_ENABLED +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpObject (FILE *output, + xmlXPathObjectPtr cur, + int depth); +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpCompExpr(FILE *output, + xmlXPathCompExprPtr comp, + int depth); +#endif +/** + * NodeSet handling. + */ +XMLPUBFUN int XMLCALL + xmlXPathNodeSetContains (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDifference (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathIntersection (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinctSorted (xmlNodeSetPtr nodes); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinct (xmlNodeSetPtr nodes); + +XMLPUBFUN int XMLCALL + xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeading (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeading (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailing (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailing (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + + +/** + * Extending a context. + */ + +XMLPUBFUN int XMLCALL + xmlXPathRegisterNs (xmlXPathContextPtr ctxt, + const xmlChar *prefix, + const xmlChar *ns_uri); +XMLPUBFUN const xmlChar * XMLCALL + xmlXPathNsLookup (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); + +XMLPUBFUN int XMLCALL + xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathObjectPtr value); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathObjectPtr value); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); + +/** + * Utilities to extend XPath. + */ +XMLPUBFUN xmlXPathParserContextPtr XMLCALL + xmlXPathNewParserContext (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); + +/* TODO: remap to xmlXPathValuePop and Push. */ +XMLPUBFUN xmlXPathObjectPtr XMLCALL + valuePop (xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL + valuePush (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr value); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewString (const xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewCString (const char *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapString (xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapCString (char * val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewFloat (double val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewBoolean (int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSet (xmlNodePtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewValueTree (xmlNodePtr val); +XMLPUBFUN int XMLCALL + xmlXPathNodeSetAdd (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN int XMLCALL + xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN int XMLCALL + xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, + xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetSort (xmlNodeSetPtr set); + +XMLPUBFUN void XMLCALL + xmlXPathRoot (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseName (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); + +/* + * Existing functions. + */ +XMLPUBFUN double XMLCALL + xmlXPathStringEvalNumber (const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr res); +XMLPUBFUN void XMLCALL + xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetMerge (xmlNodeSetPtr val1, + xmlNodeSetPtr val2); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetDel (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetRemove (xmlNodeSetPtr cur, + int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSetList (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapNodeSet (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapExternal (void *val); + +XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict); +XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt); + +XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name); + +/* + * Some of the axis navigation routines. + */ +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +/* + * The official core of XPath functions. + */ +XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs); + +/** + * Really internal functions + */ +XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED */ +#endif /* ! __XML_XPATH_INTERNALS_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpointer.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpointer.h new file mode 100644 index 0000000..b99112b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxml2/libxml/xpointer.h @@ -0,0 +1,114 @@ +/* + * Summary: API to handle XML Pointers + * Description: API to handle XML Pointers + * Base implementation was made accordingly to + * W3C Candidate Recommendation 7 June 2000 + * http://www.w3.org/TR/2000/CR-xptr-20000607 + * + * Added support for the element() scheme described in: + * W3C Proposed Recommendation 13 November 2002 + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPTR_H__ +#define __XML_XPTR_H__ + +#include + +#ifdef LIBXML_XPTR_ENABLED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A Location Set + */ +typedef struct _xmlLocationSet xmlLocationSet; +typedef xmlLocationSet *xmlLocationSetPtr; +struct _xmlLocationSet { + int locNr; /* number of locations in the set */ + int locMax; /* size of the array as allocated */ + xmlXPathObjectPtr *locTab;/* array of locations */ +}; + +/* + * Handling of location sets. + */ + +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, + xmlLocationSetPtr val2); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRange (xmlNodePtr start, + int startindex, + xmlNodePtr end, + int endindex); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePoints (xmlXPathObjectPtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodePoint (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodeObject (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewCollapsedRange (xmlNodePtr start); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrWrapLocationSet (xmlLocationSetPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetDel (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, + int val); + +/* + * Functions. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPtrNewContext (xmlDocPtr doc, + xmlNodePtr here, + xmlNodePtr origin); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN void XMLCALL + xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XMLPUBFUN xmlNodePtr XMLCALL + xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ +#endif /* __XML_XPTR_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/attributes.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/attributes.h new file mode 100644 index 0000000..05b8a6e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/attributes.h @@ -0,0 +1,38 @@ +/* + * Summary: interface for the XSLT attribute handling + * Description: this module handles the specificities of attribute + * and attribute groups processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_ATTRIBUTES_H__ +#define __XML_XSLT_ATTRIBUTES_H__ + +#include +#include "xsltexports.h" + +#ifdef __cplusplus +extern "C" { +#endif + +XSLTPUBFUN void XSLTCALL + xsltParseStylesheetAttributeSet (xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN void XSLTCALL + xsltFreeAttributeSetsHashes (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltApplyAttributeSet (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + const xmlChar *attributes); +XSLTPUBFUN void XSLTCALL + xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_ATTRIBUTES_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/documents.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/documents.h new file mode 100644 index 0000000..ae7c0ca --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/documents.h @@ -0,0 +1,93 @@ +/* + * Summary: interface for the document handling + * Description: implements document loading and cache (multiple + * document() reference for the same resources must + * be equal. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_DOCUMENTS_H__ +#define __XML_XSLT_DOCUMENTS_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltNewDocument (xsltTransformContextPtr ctxt, + xmlDocPtr doc); +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltLoadDocument (xsltTransformContextPtr ctxt, + const xmlChar *URI); +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltFindDocument (xsltTransformContextPtr ctxt, + xmlDocPtr doc); +XSLTPUBFUN void XSLTCALL + xsltFreeDocuments (xsltTransformContextPtr ctxt); + +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltLoadStyleDocument (xsltStylesheetPtr style, + const xmlChar *URI); +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltNewStyleDocument (xsltStylesheetPtr style, + xmlDocPtr doc); +XSLTPUBFUN void XSLTCALL + xsltFreeStyleDocuments (xsltStylesheetPtr style); + +/* + * Hooks for document loading + */ + +/** + * xsltLoadType: + * + * Enum defining the kind of loader requirement. + */ +typedef enum { + XSLT_LOAD_START = 0, /* loading for a top stylesheet */ + XSLT_LOAD_STYLESHEET = 1, /* loading for a stylesheet include/import */ + XSLT_LOAD_DOCUMENT = 2 /* loading document at transformation time */ +} xsltLoadType; + +/** + * xsltDocLoaderFunc: + * @URI: the URI of the document to load + * @dict: the dictionary to use when parsing that document + * @options: parsing options, a set of xmlParserOption + * @ctxt: the context, either a stylesheet or a transformation context + * @type: the xsltLoadType indicating the kind of loading required + * + * An xsltDocLoaderFunc is a signature for a function which can be + * registered to load document not provided by the compilation or + * transformation API themselve, for example when an xsl:import, + * xsl:include is found at compilation time or when a document() + * call is made at runtime. + * + * Returns the pointer to the document (which will be modified and + * freed by the engine later), or NULL in case of error. + */ +typedef xmlDocPtr (*xsltDocLoaderFunc) (const xmlChar *URI, + xmlDictPtr dict, + int options, + void *ctxt, + xsltLoadType type); + +XSLTPUBFUN void XSLTCALL + xsltSetLoaderFunc (xsltDocLoaderFunc f); + +/* the loader may be needed by extension libraries so it is exported */ +XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader; + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_DOCUMENTS_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extensions.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extensions.h new file mode 100644 index 0000000..900779c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extensions.h @@ -0,0 +1,262 @@ +/* + * Summary: interface for the extension support + * Description: This provide the API needed for simple and module + * extension support. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_EXTENSION_H__ +#define __XML_XSLT_EXTENSION_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Extension Modules API. + */ + +/** + * xsltInitGlobals: + * + * Initialize the global variables for extensions + * + */ + +XSLTPUBFUN void XSLTCALL + xsltInitGlobals (void); + +/** + * xsltStyleExtInitFunction: + * @ctxt: an XSLT stylesheet + * @URI: the namespace URI for the extension + * + * A function called at initialization time of an XSLT extension module. + * + * Returns a pointer to the module specific data for this transformation. + */ +typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style, + const xmlChar *URI); + +/** + * xsltStyleExtShutdownFunction: + * @ctxt: an XSLT stylesheet + * @URI: the namespace URI for the extension + * @data: the data associated to this module + * + * A function called at shutdown time of an XSLT extension module. + */ +typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style, + const xmlChar *URI, + void *data); + +/** + * xsltExtInitFunction: + * @ctxt: an XSLT transformation context + * @URI: the namespace URI for the extension + * + * A function called at initialization time of an XSLT extension module. + * + * Returns a pointer to the module specific data for this transformation. + */ +typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt, + const xmlChar *URI); + +/** + * xsltExtShutdownFunction: + * @ctxt: an XSLT transformation context + * @URI: the namespace URI for the extension + * @data: the data associated to this module + * + * A function called at shutdown time of an XSLT extension module. + */ +typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt, + const xmlChar *URI, + void *data); + +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModule (const xmlChar *URI, + xsltExtInitFunction initFunc, + xsltExtShutdownFunction shutdownFunc); +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModuleFull + (const xmlChar * URI, + xsltExtInitFunction initFunc, + xsltExtShutdownFunction shutdownFunc, + xsltStyleExtInitFunction styleInitFunc, + xsltStyleExtShutdownFunction styleShutdownFunc); + +XSLTPUBFUN int XSLTCALL + xsltUnregisterExtModule (const xmlChar * URI); + +XSLTPUBFUN void * XSLTCALL + xsltGetExtData (xsltTransformContextPtr ctxt, + const xmlChar *URI); + +XSLTPUBFUN void * XSLTCALL + xsltStyleGetExtData (xsltStylesheetPtr style, + const xmlChar *URI); +#ifdef XSLT_REFACTORED +XSLTPUBFUN void * XSLTCALL + xsltStyleStylesheetLevelGetExtData( + xsltStylesheetPtr style, + const xmlChar * URI); +#endif +XSLTPUBFUN void XSLTCALL + xsltShutdownCtxtExts (xsltTransformContextPtr ctxt); + +XSLTPUBFUN void XSLTCALL + xsltShutdownExts (xsltStylesheetPtr style); + +XSLTPUBFUN xsltTransformContextPtr XSLTCALL + xsltXPathGetTransformContext + (xmlXPathParserContextPtr ctxt); + +/* + * extension functions +*/ +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModuleFunction + (const xmlChar *name, + const xmlChar *URI, + xmlXPathFunction function); +XSLTPUBFUN xmlXPathFunction XSLTCALL + xsltExtModuleFunctionLookup (const xmlChar *name, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltUnregisterExtModuleFunction + (const xmlChar *name, + const xmlChar *URI); + +/* + * extension elements + */ +typedef xsltElemPreCompPtr (*xsltPreComputeFunction) + (xsltStylesheetPtr style, + xmlNodePtr inst, + xsltTransformFunction function); + +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL + xsltNewElemPreComp (xsltStylesheetPtr style, + xmlNodePtr inst, + xsltTransformFunction function); +XSLTPUBFUN void XSLTCALL + xsltInitElemPreComp (xsltElemPreCompPtr comp, + xsltStylesheetPtr style, + xmlNodePtr inst, + xsltTransformFunction function, + xsltElemPreCompDeallocator freeFunc); + +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModuleElement + (const xmlChar *name, + const xmlChar *URI, + xsltPreComputeFunction precomp, + xsltTransformFunction transform); +XSLTPUBFUN xsltTransformFunction XSLTCALL + xsltExtElementLookup (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *URI); +XSLTPUBFUN xsltTransformFunction XSLTCALL + xsltExtModuleElementLookup + (const xmlChar *name, + const xmlChar *URI); +XSLTPUBFUN xsltPreComputeFunction XSLTCALL + xsltExtModuleElementPreComputeLookup + (const xmlChar *name, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltUnregisterExtModuleElement + (const xmlChar *name, + const xmlChar *URI); + +/* + * top-level elements + */ +typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style, + xmlNodePtr inst); + +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModuleTopLevel + (const xmlChar *name, + const xmlChar *URI, + xsltTopLevelFunction function); +XSLTPUBFUN xsltTopLevelFunction XSLTCALL + xsltExtModuleTopLevelLookup + (const xmlChar *name, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltUnregisterExtModuleTopLevel + (const xmlChar *name, + const xmlChar *URI); + + +/* These 2 functions are deprecated for use within modules. */ +XSLTPUBFUN int XSLTCALL + xsltRegisterExtFunction (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *URI, + xmlXPathFunction function); +XSLTPUBFUN int XSLTCALL + xsltRegisterExtElement (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *URI, + xsltTransformFunction function); + +/* + * Extension Prefix handling API. + * Those are used by the XSLT (pre)processor. + */ + +XSLTPUBFUN int XSLTCALL + xsltRegisterExtPrefix (xsltStylesheetPtr style, + const xmlChar *prefix, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltCheckExtPrefix (xsltStylesheetPtr style, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltCheckExtURI (xsltStylesheetPtr style, + const xmlChar *URI); +XSLTPUBFUN int XSLTCALL + xsltInitCtxtExts (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL + xsltFreeCtxtExts (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL + xsltFreeExts (xsltStylesheetPtr style); + +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL + xsltPreComputeExtModuleElement + (xsltStylesheetPtr style, + xmlNodePtr inst); +/* + * Extension Infos access. + * Used by exslt initialisation + */ + +XSLTPUBFUN xmlHashTablePtr XSLTCALL + xsltGetExtInfo (xsltStylesheetPtr style, + const xmlChar *URI); + +/** + * Test module http://xmlsoft.org/XSLT/ + */ +XSLTPUBFUN void XSLTCALL + xsltRegisterTestModule (void); +XSLTPUBFUN void XSLTCALL + xsltDebugDumpExtensions (FILE * output); + + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_EXTENSION_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extra.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extra.h new file mode 100644 index 0000000..e512fd0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/extra.h @@ -0,0 +1,72 @@ +/* + * Summary: interface for the non-standard features + * Description: implement some extension outside the XSLT namespace + * but not EXSLT with is in a different library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_EXTRA_H__ +#define __XML_XSLT_EXTRA_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XSLT_LIBXSLT_NAMESPACE: + * + * This is the libxslt namespace for specific extensions. + */ +#define XSLT_LIBXSLT_NAMESPACE ((xmlChar *) "http://xmlsoft.org/XSLT/namespace") + +/** + * XSLT_SAXON_NAMESPACE: + * + * This is Michael Kay's Saxon processor namespace for extensions. + */ +#define XSLT_SAXON_NAMESPACE ((xmlChar *) "http://icl.com/saxon") + +/** + * XSLT_XT_NAMESPACE: + * + * This is James Clark's XT processor namespace for extensions. + */ +#define XSLT_XT_NAMESPACE ((xmlChar *) "http://www.jclark.com/xt") + +/** + * XSLT_XALAN_NAMESPACE: + * + * This is the Apache project XALAN processor namespace for extensions. + */ +#define XSLT_XALAN_NAMESPACE ((xmlChar *) \ + "org.apache.xalan.xslt.extensions.Redirect") + + +XSLTPUBFUN void XSLTCALL + xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltDebug (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); + + +XSLTPUBFUN void XSLTCALL + xsltRegisterExtras (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL + xsltRegisterAllExtras (void); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_EXTRA_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/functions.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/functions.h new file mode 100644 index 0000000..5455b7f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/functions.h @@ -0,0 +1,78 @@ +/* + * Summary: interface for the XSLT functions not from XPath + * Description: a set of extra functions coming from XSLT but not in XPath + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard and Bjorn Reese + */ + +#ifndef __XML_XSLT_FUNCTIONS_H__ +#define __XML_XSLT_FUNCTIONS_H__ + +#include +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XSLT_REGISTER_FUNCTION_LOOKUP: + * + * Registering macro, not general purpose at all but used in different modules. + */ +#define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \ + xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \ + xsltXPathFunctionLookup, \ + (void *)(ctxt->xpathCtxt)); + +XSLTPUBFUN xmlXPathFunction XSLTCALL + xsltXPathFunctionLookup (void *vctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/* + * Interfaces for the functions implementations. + */ + +XSLTPUBFUN void XSLTCALL + xsltDocumentFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltKeyFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XSLTPUBFUN void XSLTCALL + xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt, + int nargs); + +/* + * And the registration + */ + +XSLTPUBFUN void XSLTCALL + xsltRegisterAllFunctions (xmlXPathContextPtr ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_FUNCTIONS_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/imports.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/imports.h new file mode 100644 index 0000000..95e44e5 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/imports.h @@ -0,0 +1,75 @@ +/* + * Summary: interface for the XSLT import support + * Description: macros and fuctions needed to implement and + * access the import tree + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_IMPORTS_H__ +#define __XML_XSLT_IMPORTS_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XSLT_GET_IMPORT_PTR: + * + * A macro to import pointers from the stylesheet cascading order. + */ +#define XSLT_GET_IMPORT_PTR(res, style, name) { \ + xsltStylesheetPtr st = style; \ + res = NULL; \ + while (st != NULL) { \ + if (st->name != NULL) { res = st->name; break; } \ + st = xsltNextImport(st); \ + }} + +/** + * XSLT_GET_IMPORT_INT: + * + * A macro to import intergers from the stylesheet cascading order. + */ +#define XSLT_GET_IMPORT_INT(res, style, name) { \ + xsltStylesheetPtr st = style; \ + res = -1; \ + while (st != NULL) { \ + if (st->name != -1) { res = st->name; break; } \ + st = xsltNextImport(st); \ + }} + +/* + * Module interfaces + */ +XSLTPUBFUN int XSLTCALL + xsltParseStylesheetImport(xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN int XSLTCALL + xsltParseStylesheetInclude + (xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltNextImport (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL + xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, + xmlNodePtr node); +XSLTPUBFUN xsltTemplatePtr XSLTCALL + xsltFindTemplate (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *nameURI); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_IMPORTS_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/keys.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/keys.h new file mode 100644 index 0000000..757d122 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/keys.h @@ -0,0 +1,53 @@ +/* + * Summary: interface for the key matching used in key() and template matches. + * Description: implementation of the key mechanims. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_KEY_H__ +#define __XML_XSLT_KEY_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * NODE_IS_KEYED: + * + * check for bit 15 set + */ +#define NODE_IS_KEYED (1 >> 15) + +XSLTPUBFUN int XSLTCALL + xsltAddKey (xsltStylesheetPtr style, + const xmlChar *name, + const xmlChar *nameURI, + const xmlChar *match, + const xmlChar *use, + xmlNodePtr inst); +XSLTPUBFUN xmlNodeSetPtr XSLTCALL + xsltGetKey (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *nameURI, + const xmlChar *value); +XSLTPUBFUN void XSLTCALL + xsltInitCtxtKeys (xsltTransformContextPtr ctxt, + xsltDocumentPtr doc); +XSLTPUBFUN void XSLTCALL + xsltFreeKeys (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltFreeDocumentKeys (xsltDocumentPtr doc); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/namespaces.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/namespaces.h new file mode 100644 index 0000000..fa2d3b4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/namespaces.h @@ -0,0 +1,68 @@ +/* + * Summary: interface for the XSLT namespace handling + * Description: set of function easing the processing and generation + * of namespace nodes in XSLT. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_NAMESPACES_H__ +#define __XML_XSLT_NAMESPACES_H__ + +#include +#include "xsltexports.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Used within nsAliases hashtable when the default namespace is required + * but it's not been explicitly defined + */ +/** + * UNDEFINED_DEFAULT_NS: + * + * Special value for undefined namespace, internal + */ +#define UNDEFINED_DEFAULT_NS (const xmlChar *) -1L + +XSLTPUBFUN void XSLTCALL + xsltNamespaceAlias (xsltStylesheetPtr style, + xmlNodePtr node); +XSLTPUBFUN xmlNsPtr XSLTCALL + xsltGetNamespace (xsltTransformContextPtr ctxt, + xmlNodePtr cur, + xmlNsPtr ns, + xmlNodePtr out); +XSLTPUBFUN xmlNsPtr XSLTCALL + xsltGetPlainNamespace (xsltTransformContextPtr ctxt, + xmlNodePtr cur, + xmlNsPtr ns, + xmlNodePtr out); +XSLTPUBFUN xmlNsPtr XSLTCALL + xsltGetSpecialNamespace (xsltTransformContextPtr ctxt, + xmlNodePtr cur, + const xmlChar *URI, + const xmlChar *prefix, + xmlNodePtr out); +XSLTPUBFUN xmlNsPtr XSLTCALL + xsltCopyNamespace (xsltTransformContextPtr ctxt, + xmlNodePtr elem, + xmlNsPtr ns); +XSLTPUBFUN xmlNsPtr XSLTCALL + xsltCopyNamespaceList (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNsPtr cur); +XSLTPUBFUN void XSLTCALL + xsltFreeNamespaceAliasHashes + (xsltStylesheetPtr style); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_NAMESPACES_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/numbersInternals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/numbersInternals.h new file mode 100644 index 0000000..8524592 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/numbersInternals.h @@ -0,0 +1,73 @@ +/* + * Summary: Implementation of the XSLT number functions + * Description: Implementation of the XSLT number functions + * + * Copy: See Copyright for the status of this software. + * + * Author: Bjorn Reese and Daniel Veillard + */ + +#ifndef __XML_XSLT_NUMBERSINTERNALS_H__ +#define __XML_XSLT_NUMBERSINTERNALS_H__ + +#include +#include "xsltexports.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _xsltCompMatch; + +/** + * xsltNumberData: + * + * This data structure is just a wrapper to pass xsl:number data in. + */ +typedef struct _xsltNumberData xsltNumberData; +typedef xsltNumberData *xsltNumberDataPtr; + +struct _xsltNumberData { + const xmlChar *level; + const xmlChar *count; + const xmlChar *from; + const xmlChar *value; + const xmlChar *format; + int has_format; + int digitsPerGroup; + int groupingCharacter; + int groupingCharacterLen; + xmlDocPtr doc; + xmlNodePtr node; + struct _xsltCompMatch *countPat; + struct _xsltCompMatch *fromPat; + + /* + * accelerators + */ +}; + +/** + * xsltFormatNumberInfo,: + * + * This data structure lists the various parameters needed to format numbers. + */ +typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo; +typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr; + +struct _xsltFormatNumberInfo { + int integer_hash; /* Number of '#' in integer part */ + int integer_digits; /* Number of '0' in integer part */ + int frac_digits; /* Number of '0' in fractional part */ + int frac_hash; /* Number of '#' in fractional part */ + int group; /* Number of chars per display 'group' */ + int multiplier; /* Scaling for percent or permille */ + char add_decimal; /* Flag for whether decimal point appears in pattern */ + char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */ + char is_negative_pattern;/* Flag for processing -ve prefix/suffix */ +}; + +#ifdef __cplusplus +} +#endif +#endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/pattern.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/pattern.h new file mode 100644 index 0000000..a0991c0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/pattern.h @@ -0,0 +1,84 @@ +/* + * Summary: interface for the pattern matching used in template matches. + * Description: the implementation of the lookup of the right template + * for a given node must be really fast in order to keep + * decent performances. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_PATTERN_H__ +#define __XML_XSLT_PATTERN_H__ + +#include "xsltInternals.h" +#include "xsltexports.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xsltCompMatch: + * + * Data structure used for the implementation of patterns. + * It is kept private (in pattern.c). + */ +typedef struct _xsltCompMatch xsltCompMatch; +typedef xsltCompMatch *xsltCompMatchPtr; + +/* + * Pattern related interfaces. + */ + +XSLTPUBFUN xsltCompMatchPtr XSLTCALL + xsltCompilePattern (const xmlChar *pattern, + xmlDocPtr doc, + xmlNodePtr node, + xsltStylesheetPtr style, + xsltTransformContextPtr runtime); +XSLTPUBFUN void XSLTCALL + xsltFreeCompMatchList (xsltCompMatchPtr comp); +XSLTPUBFUN int XSLTCALL + xsltTestCompMatchList (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xsltCompMatchPtr comp); +XSLTPUBFUN void XSLTCALL + xsltCompMatchClearCache (xsltTransformContextPtr ctxt, + xsltCompMatchPtr comp); +XSLTPUBFUN void XSLTCALL + xsltNormalizeCompSteps (void *payload, + void *data, + const xmlChar *name); + +/* + * Template related interfaces. + */ +XSLTPUBFUN int XSLTCALL + xsltAddTemplate (xsltStylesheetPtr style, + xsltTemplatePtr cur, + const xmlChar *mode, + const xmlChar *modeURI); +XSLTPUBFUN xsltTemplatePtr XSLTCALL + xsltGetTemplate (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltFreeTemplateHashes (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltCleanupTemplates (xsltStylesheetPtr style); + +#if 0 +int xsltMatchPattern (xsltTransformContextPtr ctxt, + xmlNodePtr node, + const xmlChar *pattern, + xmlDocPtr ctxtdoc, + xmlNodePtr ctxtnode); +#endif +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_PATTERN_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/preproc.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/preproc.h new file mode 100644 index 0000000..caf464a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/preproc.h @@ -0,0 +1,43 @@ +/* + * Summary: precomputing stylesheets + * Description: this is the compilation phase, where most of the + * stylesheet is "compiled" into faster to use data. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_PRECOMP_H__ +#define __XML_XSLT_PRECOMP_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Interfaces + */ +extern const xmlChar *xsltExtMarker; + +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL + xsltDocumentComp (xsltStylesheetPtr style, + xmlNodePtr inst, + xsltTransformFunction function); + +XSLTPUBFUN void XSLTCALL + xsltStylePreCompute (xsltStylesheetPtr style, + xmlNodePtr inst); +XSLTPUBFUN void XSLTCALL + xsltFreeStylePreComps (xsltStylesheetPtr style); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_PRECOMP_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/security.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/security.h new file mode 100644 index 0000000..bab5c8c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/security.h @@ -0,0 +1,104 @@ +/* + * Summary: interface for the libxslt security framework + * Description: the libxslt security framework allow to restrict + * the access to new resources (file or URL) from + * the stylesheet at runtime. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_SECURITY_H__ +#define __XML_XSLT_SECURITY_H__ + +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xsltSecurityPref: + * + * structure to indicate the preferences for security in the XSLT + * transformation. + */ +typedef struct _xsltSecurityPrefs xsltSecurityPrefs; +typedef xsltSecurityPrefs *xsltSecurityPrefsPtr; + +/** + * xsltSecurityOption: + * + * the set of option that can be configured + */ +typedef enum { + XSLT_SECPREF_READ_FILE = 1, + XSLT_SECPREF_WRITE_FILE, + XSLT_SECPREF_CREATE_DIRECTORY, + XSLT_SECPREF_READ_NETWORK, + XSLT_SECPREF_WRITE_NETWORK +} xsltSecurityOption; + +/** + * xsltSecurityCheck: + * + * User provided function to check the value of a string like a file + * path or an URL ... + */ +typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt, + const char *value); + +/* + * Module interfaces + */ +XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL + xsltNewSecurityPrefs (void); +XSLTPUBFUN void XSLTCALL + xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec); +XSLTPUBFUN int XSLTCALL + xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec, + xsltSecurityOption option, + xsltSecurityCheck func); +XSLTPUBFUN xsltSecurityCheck XSLTCALL + xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec, + xsltSecurityOption option); + +XSLTPUBFUN void XSLTCALL + xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec); +XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL + xsltGetDefaultSecurityPrefs (void); + +XSLTPUBFUN int XSLTCALL + xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt); + +XSLTPUBFUN int XSLTCALL + xsltSecurityAllow (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt, + const char *value); +XSLTPUBFUN int XSLTCALL + xsltSecurityForbid (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt, + const char *value); +/* + * internal interfaces + */ +XSLTPUBFUN int XSLTCALL + xsltCheckWrite (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt, + const xmlChar *URL); +XSLTPUBFUN int XSLTCALL + xsltCheckRead (xsltSecurityPrefsPtr sec, + xsltTransformContextPtr ctxt, + const xmlChar *URL); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_SECURITY_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/templates.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/templates.h new file mode 100644 index 0000000..84a9de4 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/templates.h @@ -0,0 +1,77 @@ +/* + * Summary: interface for the template processing + * Description: This set of routine encapsulates XPath calls + * and Attribute Value Templates evaluation. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_TEMPLATES_H__ +#define __XML_XSLT_TEMPLATES_H__ + +#include +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +XSLTPUBFUN int XSLTCALL + xsltEvalXPathPredicate (xsltTransformContextPtr ctxt, + xmlXPathCompExprPtr comp, + xmlNsPtr *nsList, + int nsNr); +XSLTPUBFUN xmlChar * XSLTCALL + xsltEvalTemplateString (xsltTransformContextPtr ctxt, + xmlNodePtr contextNode, + xmlNodePtr inst); +XSLTPUBFUN xmlChar * XSLTCALL + xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt, + xmlNodePtr node, + const xmlChar *name, + const xmlChar *ns); +XSLTPUBFUN const xmlChar * XSLTCALL + xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style, + xmlNodePtr node, + const xmlChar *name, + const xmlChar *ns, + int *found); + +/* TODO: this is obviously broken ... the namespaces should be passed too ! */ +XSLTPUBFUN xmlChar * XSLTCALL + xsltEvalXPathString (xsltTransformContextPtr ctxt, + xmlXPathCompExprPtr comp); +XSLTPUBFUN xmlChar * XSLTCALL + xsltEvalXPathStringNs (xsltTransformContextPtr ctxt, + xmlXPathCompExprPtr comp, + int nsNr, + xmlNsPtr *nsList); + +XSLTPUBFUN xmlNodePtr * XSLTCALL + xsltTemplateProcess (xsltTransformContextPtr ctxt, + xmlNodePtr node); +XSLTPUBFUN xmlAttrPtr XSLTCALL + xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt, + xmlNodePtr target, + xmlAttrPtr cur); +XSLTPUBFUN xmlAttrPtr XSLTCALL + xsltAttrTemplateProcess (xsltTransformContextPtr ctxt, + xmlNodePtr target, + xmlAttrPtr attr); +XSLTPUBFUN xmlChar * XSLTCALL + xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt, + const xmlChar* attr); +XSLTPUBFUN xmlChar * XSLTCALL + xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt, + const xmlChar* str, + xmlNodePtr node); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_TEMPLATES_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/transform.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/transform.h new file mode 100644 index 0000000..5a6f795 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/transform.h @@ -0,0 +1,207 @@ +/* + * Summary: the XSLT engine transformation part. + * Description: This module implements the bulk of the actual + * transformation processing. Most of the xsl: element + * constructs are implemented in this module. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_TRANSFORM_H__ +#define __XML_XSLT_TRANSFORM_H__ + +#include +#include +#include "xsltexports.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XInclude default processing. + */ +XSLTPUBFUN void XSLTCALL + xsltSetXIncludeDefault (int xinclude); +XSLTPUBFUN int XSLTCALL + xsltGetXIncludeDefault (void); + +/** + * Export context to users. + */ +XSLTPUBFUN xsltTransformContextPtr XSLTCALL + xsltNewTransformContext (xsltStylesheetPtr style, + xmlDocPtr doc); + +XSLTPUBFUN void XSLTCALL + xsltFreeTransformContext(xsltTransformContextPtr ctxt); + +XSLTPUBFUN xmlDocPtr XSLTCALL + xsltApplyStylesheetUser (xsltStylesheetPtr style, + xmlDocPtr doc, + const char **params, + const char *output, + FILE * profile, + xsltTransformContextPtr userCtxt); +XSLTPUBFUN void XSLTCALL + xsltProcessOneNode (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xsltStackElemPtr params); +/** + * Private Interfaces. + */ +XSLTPUBFUN void XSLTCALL + xsltApplyStripSpaces (xsltTransformContextPtr ctxt, + xmlNodePtr node); +XSLTPUBFUN xmlDocPtr XSLTCALL + xsltApplyStylesheet (xsltStylesheetPtr style, + xmlDocPtr doc, + const char **params); +XSLTPUBFUN xmlDocPtr XSLTCALL + xsltProfileStylesheet (xsltStylesheetPtr style, + xmlDocPtr doc, + const char **params, + FILE * output); +XSLTPUBFUN int XSLTCALL + xsltRunStylesheet (xsltStylesheetPtr style, + xmlDocPtr doc, + const char **params, + const char *output, + xmlSAXHandlerPtr SAX, + xmlOutputBufferPtr IObuf); +XSLTPUBFUN int XSLTCALL + xsltRunStylesheetUser (xsltStylesheetPtr style, + xmlDocPtr doc, + const char **params, + const char *output, + xmlSAXHandlerPtr SAX, + xmlOutputBufferPtr IObuf, + FILE * profile, + xsltTransformContextPtr userCtxt); +XSLTPUBFUN void XSLTCALL + xsltApplyOneTemplate (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr list, + xsltTemplatePtr templ, + xsltStackElemPtr params); +XSLTPUBFUN void XSLTCALL + xsltDocumentElem (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltSort (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltCopy (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltText (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltElement (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltComment (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltAttribute (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltProcessingInstruction(xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltCopyOf (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltValueOf (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltNumber (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltApplyImports (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltCallTemplate (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltApplyTemplates (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltChoose (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltIf (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltForEach (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); +XSLTPUBFUN void XSLTCALL + xsltRegisterAllElement (xsltTransformContextPtr ctxt); + +XSLTPUBFUN xmlNodePtr XSLTCALL + xsltCopyTextString (xsltTransformContextPtr ctxt, + xmlNodePtr target, + const xmlChar *string, + int noescape); + +/* Following 2 functions needed for libexslt/functions.c */ +XSLTPUBFUN void XSLTCALL + xsltLocalVariablePop (xsltTransformContextPtr ctxt, + int limitNr, + int level); +XSLTPUBFUN int XSLTCALL + xsltLocalVariablePush (xsltTransformContextPtr ctxt, + xsltStackElemPtr variable, + int level); +/* + * Hook for the debugger if activated. + */ +XSLTPUBFUN void XSLTCALL + xslHandleDebugger (xmlNodePtr cur, + xmlNodePtr node, + xsltTemplatePtr templ, + xsltTransformContextPtr ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_TRANSFORM_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/variables.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/variables.h new file mode 100644 index 0000000..039288f --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/variables.h @@ -0,0 +1,118 @@ +/* + * Summary: interface for the variable matching and lookup. + * Description: interface for the variable matching and lookup. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_VARIABLES_H__ +#define __XML_XSLT_VARIABLES_H__ + +#include +#include +#include "xsltexports.h" +#include "xsltInternals.h" +#include "functions.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * XSLT_REGISTER_VARIABLE_LOOKUP: + * + * Registering macro, not general purpose at all but used in different modules. + */ + +#define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt) \ + xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt, \ + xsltXPathVariableLookup, (void *)(ctxt)); \ + xsltRegisterAllFunctions((ctxt)->xpathCtxt); \ + xsltRegisterAllElement(ctxt); \ + (ctxt)->xpathCtxt->extra = ctxt + +/* + * Flags for memory management of RVTs + */ + +/** + * XSLT_RVT_LOCAL: + * + * RVT is destroyed after the current instructions ends. + */ +#define XSLT_RVT_LOCAL ((void *)1) + +/** + * XSLT_RVT_FUNC_RESULT: + * + * RVT is part of results returned with func:result. The RVT won't be + * destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or + * XSLT_RVT_VARIABLE in the template that receives the return value. + */ +#define XSLT_RVT_FUNC_RESULT ((void *)2) + +/** + * XSLT_RVT_GLOBAL: + * + * RVT is part of a global variable. + */ +#define XSLT_RVT_GLOBAL ((void *)3) + +/* + * Interfaces for the variable module. + */ + +XSLTPUBFUN int XSLTCALL + xsltEvalGlobalVariables (xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL + xsltEvalUserParams (xsltTransformContextPtr ctxt, + const char **params); +XSLTPUBFUN int XSLTCALL + xsltQuoteUserParams (xsltTransformContextPtr ctxt, + const char **params); +XSLTPUBFUN int XSLTCALL + xsltEvalOneUserParam (xsltTransformContextPtr ctxt, + const xmlChar * name, + const xmlChar * value); +XSLTPUBFUN int XSLTCALL + xsltQuoteOneUserParam (xsltTransformContextPtr ctxt, + const xmlChar * name, + const xmlChar * value); + +XSLTPUBFUN void XSLTCALL + xsltParseGlobalVariable (xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN void XSLTCALL + xsltParseGlobalParam (xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN void XSLTCALL + xsltParseStylesheetVariable (xsltTransformContextPtr ctxt, + xmlNodePtr cur); +XSLTPUBFUN void XSLTCALL + xsltParseStylesheetParam (xsltTransformContextPtr ctxt, + xmlNodePtr cur); +XSLTPUBFUN xsltStackElemPtr XSLTCALL + xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt, + xmlNodePtr cur); +XSLTPUBFUN int XSLTCALL + xsltAddStackElemList (xsltTransformContextPtr ctxt, + xsltStackElemPtr elems); +XSLTPUBFUN void XSLTCALL + xsltFreeGlobalVariables (xsltTransformContextPtr ctxt); +XSLTPUBFUN xmlXPathObjectPtr XSLTCALL + xsltVariableLookup (xsltTransformContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XSLTPUBFUN xmlXPathObjectPtr XSLTCALL + xsltXPathVariableLookup (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_VARIABLES_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xslt.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xslt.h new file mode 100644 index 0000000..02f491a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xslt.h @@ -0,0 +1,110 @@ +/* + * Summary: Interfaces, constants and types related to the XSLT engine + * Description: Interfaces, constants and types related to the XSLT engine + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_H__ +#define __XML_XSLT_H__ + +#include +#include "xsltexports.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XSLT_DEFAULT_VERSION: + * + * The default version of XSLT supported. + */ +#define XSLT_DEFAULT_VERSION "1.0" + +/** + * XSLT_DEFAULT_VENDOR: + * + * The XSLT "vendor" string for this processor. + */ +#define XSLT_DEFAULT_VENDOR "libxslt" + +/** + * XSLT_DEFAULT_URL: + * + * The XSLT "vendor" URL for this processor. + */ +#define XSLT_DEFAULT_URL "http://xmlsoft.org/XSLT/" + +/** + * XSLT_NAMESPACE: + * + * The XSLT specification namespace. + */ +#define XSLT_NAMESPACE ((const xmlChar *)"http://www.w3.org/1999/XSL/Transform") + +/** + * XSLT_PARSE_OPTIONS: + * + * The set of options to pass to an xmlReadxxx when loading files for + * XSLT consumption. + */ +#define XSLT_PARSE_OPTIONS \ + XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_NOCDATA + +/** + * xsltMaxDepth: + * + * This value is used to detect templates loops. + */ +XSLTPUBVAR int xsltMaxDepth; + +/** + * * xsltMaxVars: + * * + * * This value is used to detect templates loops. + * */ +XSLTPUBVAR int xsltMaxVars; + +/** + * xsltEngineVersion: + * + * The version string for libxslt. + */ +XSLTPUBVAR const char *xsltEngineVersion; + +/** + * xsltLibxsltVersion: + * + * The version of libxslt compiled. + */ +XSLTPUBVAR const int xsltLibxsltVersion; + +/** + * xsltLibxmlVersion: + * + * The version of libxml libxslt was compiled against. + */ +XSLTPUBVAR const int xsltLibxmlVersion; + +/* + * Global initialization function. + */ + +XSLTPUBFUN void XSLTCALL + xsltInit (void); + +/* + * Global cleanup function. + */ +XSLTPUBFUN void XSLTCALL + xsltCleanupGlobals (void); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltInternals.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltInternals.h new file mode 100644 index 0000000..14a971a --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltInternals.h @@ -0,0 +1,1978 @@ +/* + * Summary: internal data structures, constants and functions + * Description: Internal data structures, constants and functions used + * by the XSLT engine. + * They are not part of the API or ABI, i.e. they can change + * without prior notice, use carefully. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLT_INTERNALS_H__ +#define __XML_XSLT_INTERNALS_H__ + +#include +#include +#include +#include +#include +#include +#include +#include "xsltexports.h" +#include "xsltlocale.h" +#include "numbersInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* #define XSLT_DEBUG_PROFILE_CACHE */ + +/** + * XSLT_IS_TEXT_NODE: + * + * check if the argument is a text node + */ +#define XSLT_IS_TEXT_NODE(n) ((n != NULL) && \ + (((n)->type == XML_TEXT_NODE) || \ + ((n)->type == XML_CDATA_SECTION_NODE))) + + +/** + * XSLT_MARK_RES_TREE_FRAG: + * + * internal macro to set up tree fragments + */ +#define XSLT_MARK_RES_TREE_FRAG(n) \ + (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt"); + +/** + * XSLT_IS_RES_TREE_FRAG: + * + * internal macro to test tree fragments + */ +#define XSLT_IS_RES_TREE_FRAG(n) \ + ((n != NULL) && ((n)->type == XML_DOCUMENT_NODE) && \ + ((n)->name != NULL) && ((n)->name[0] == ' ')) + +/** + * XSLT_REFACTORED_KEYCOMP: + * + * Internal define to enable on-demand xsl:key computation. + * That's the only mode now but the define is kept for compatibility + */ +#define XSLT_REFACTORED_KEYCOMP + +/** + * XSLT_FAST_IF: + * + * Internal define to enable usage of xmlXPathCompiledEvalToBoolean() + * for XSLT "tests"; e.g. in + */ +#define XSLT_FAST_IF + +/** + * XSLT_REFACTORED: + * + * Internal define to enable the refactored parts of Libxslt. + */ +/* #define XSLT_REFACTORED */ +/* ==================================================================== */ + +/** + * XSLT_REFACTORED_VARS: + * + * Internal define to enable the refactored variable part of libxslt + */ +#define XSLT_REFACTORED_VARS + +#ifdef XSLT_REFACTORED + +extern const xmlChar *xsltXSLTAttrMarker; + + +/* TODO: REMOVE: #define XSLT_REFACTORED_EXCLRESNS */ + +/* TODO: REMOVE: #define XSLT_REFACTORED_NSALIAS */ + +/** + * XSLT_REFACTORED_XSLT_NSCOMP + * + * Internal define to enable the pointer-comparison of + * namespaces of XSLT elements. + */ +/* #define XSLT_REFACTORED_XSLT_NSCOMP */ + +#ifdef XSLT_REFACTORED_XSLT_NSCOMP + +extern const xmlChar *xsltConstNamespaceNameXSLT; + +/** + * IS_XSLT_ELEM_FAST: + * + * quick test to detect XSLT elements + */ +#define IS_XSLT_ELEM_FAST(n) \ + (((n) != NULL) && ((n)->ns != NULL) && \ + ((n)->ns->href == xsltConstNamespaceNameXSLT)) + +/** + * IS_XSLT_ATTR_FAST: + * + * quick test to detect XSLT attributes + */ +#define IS_XSLT_ATTR_FAST(a) \ + (((a) != NULL) && ((a)->ns != NULL) && \ + ((a)->ns->href == xsltConstNamespaceNameXSLT)) + +/** + * XSLT_HAS_INTERNAL_NSMAP: + * + * check for namespace mapping + */ +#define XSLT_HAS_INTERNAL_NSMAP(s) \ + (((s) != NULL) && ((s)->principal) && \ + ((s)->principal->principalData) && \ + ((s)->principal->principalData->nsMap)) + +/** + * XSLT_GET_INTERNAL_NSMAP: + * + * get pointer to namespace map + */ +#define XSLT_GET_INTERNAL_NSMAP(s) ((s)->principal->principalData->nsMap) + +#else /* XSLT_REFACTORED_XSLT_NSCOMP */ + +/** + * IS_XSLT_ELEM_FAST: + * + * quick check whether this is an xslt element + */ +#define IS_XSLT_ELEM_FAST(n) \ + (((n) != NULL) && ((n)->ns != NULL) && \ + (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE))) + +/** + * IS_XSLT_ATTR_FAST: + * + * quick check for xslt namespace attribute + */ +#define IS_XSLT_ATTR_FAST(a) \ + (((a) != NULL) && ((a)->ns != NULL) && \ + (xmlStrEqual((a)->ns->href, XSLT_NAMESPACE))) + + +#endif /* XSLT_REFACTORED_XSLT_NSCOMP */ + + +/** + * XSLT_REFACTORED_MANDATORY_VERSION: + * + * TODO: Currently disabled to surpress regression test failures, since + * the old behaviour was that a missing version attribute + * produced a only a warning and not an error, which was incerrect. + * So the regression tests need to be fixed if this is enabled. + */ +/* #define XSLT_REFACTORED_MANDATORY_VERSION */ + +/** + * xsltPointerList: + * + * Pointer-list for various purposes. + */ +typedef struct _xsltPointerList xsltPointerList; +typedef xsltPointerList *xsltPointerListPtr; +struct _xsltPointerList { + void **items; + int number; + int size; +}; + +#endif + +/** + * XSLT_REFACTORED_PARSING: + * + * Internal define to enable the refactored parts of Libxslt + * related to parsing. + */ +/* #define XSLT_REFACTORED_PARSING */ + +/** + * XSLT_MAX_SORT: + * + * Max number of specified xsl:sort on an element. + */ +#define XSLT_MAX_SORT 15 + +/** + * XSLT_PAT_NO_PRIORITY: + * + * Specific value for pattern without priority expressed. + */ +#define XSLT_PAT_NO_PRIORITY -12345789 + +/** + * xsltRuntimeExtra: + * + * Extra information added to the transformation context. + */ +typedef struct _xsltRuntimeExtra xsltRuntimeExtra; +typedef xsltRuntimeExtra *xsltRuntimeExtraPtr; +struct _xsltRuntimeExtra { + void *info; /* pointer to the extra data */ + xmlFreeFunc deallocate; /* pointer to the deallocation routine */ + union { /* dual-purpose field */ + void *ptr; /* data not needing deallocation */ + int ival; /* integer value storage */ + } val; +}; + +/** + * XSLT_RUNTIME_EXTRA_LST: + * @ctxt: the transformation context + * @nr: the index + * + * Macro used to access extra information stored in the context + */ +#define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info +/** + * XSLT_RUNTIME_EXTRA_FREE: + * @ctxt: the transformation context + * @nr: the index + * + * Macro used to free extra information stored in the context + */ +#define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate +/** + * XSLT_RUNTIME_EXTRA: + * @ctxt: the transformation context + * @nr: the index + * + * Macro used to define extra information stored in the context + */ +#define XSLT_RUNTIME_EXTRA(ctxt, nr, typ) (ctxt)->extras[(nr)].val.typ + +/** + * xsltTemplate: + * + * The in-memory structure corresponding to an XSLT Template. + */ +typedef struct _xsltTemplate xsltTemplate; +typedef xsltTemplate *xsltTemplatePtr; +struct _xsltTemplate { + struct _xsltTemplate *next;/* chained list sorted by priority */ + struct _xsltStylesheet *style;/* the containing stylesheet */ + xmlChar *match; /* the matching string */ + float priority; /* as given from the stylesheet, not computed */ + const xmlChar *name; /* the local part of the name QName */ + const xmlChar *nameURI; /* the URI part of the name QName */ + const xmlChar *mode;/* the local part of the mode QName */ + const xmlChar *modeURI;/* the URI part of the mode QName */ + xmlNodePtr content; /* the template replacement value */ + xmlNodePtr elem; /* the source element */ + + /* + * TODO: @inheritedNsNr and @inheritedNs won't be used in the + * refactored code. + */ + int inheritedNsNr; /* number of inherited namespaces */ + xmlNsPtr *inheritedNs;/* inherited non-excluded namespaces */ + + /* Profiling information */ + int nbCalls; /* the number of time the template was called */ + unsigned long time; /* the time spent in this template */ + void *params; /* xsl:param instructions */ + + int templNr; /* Nb of templates in the stack */ + int templMax; /* Size of the templtes stack */ + xsltTemplatePtr *templCalledTab; /* templates called */ + int *templCountTab; /* .. and how often */ +}; + +/** + * xsltDecimalFormat: + * + * Data structure of decimal-format. + */ +typedef struct _xsltDecimalFormat xsltDecimalFormat; +typedef xsltDecimalFormat *xsltDecimalFormatPtr; +struct _xsltDecimalFormat { + struct _xsltDecimalFormat *next; /* chained list */ + xmlChar *name; + /* Used for interpretation of pattern */ + xmlChar *digit; + xmlChar *patternSeparator; + /* May appear in result */ + xmlChar *minusSign; + xmlChar *infinity; + xmlChar *noNumber; /* Not-a-number */ + /* Used for interpretation of pattern and may appear in result */ + xmlChar *decimalPoint; + xmlChar *grouping; + xmlChar *percent; + xmlChar *permille; + xmlChar *zeroDigit; + const xmlChar *nsUri; +}; + +/** + * xsltDocument: + * + * Data structure associated to a parsed document. + */ +typedef struct _xsltDocument xsltDocument; +typedef xsltDocument *xsltDocumentPtr; +struct _xsltDocument { + struct _xsltDocument *next; /* documents are kept in a chained list */ + int main; /* is this the main document */ + xmlDocPtr doc; /* the parsed document */ + void *keys; /* key tables storage */ + struct _xsltDocument *includes; /* subsidiary includes */ + int preproc; /* pre-processing already done */ + int nbKeysComputed; +}; + +/** + * xsltKeyDef: + * + * Representation of an xsl:key. + */ +typedef struct _xsltKeyDef xsltKeyDef; +typedef xsltKeyDef *xsltKeyDefPtr; +struct _xsltKeyDef { + struct _xsltKeyDef *next; + xmlNodePtr inst; + xmlChar *name; + xmlChar *nameURI; + xmlChar *match; + xmlChar *use; + xmlXPathCompExprPtr comp; + xmlXPathCompExprPtr usecomp; + xmlNsPtr *nsList; /* the namespaces in scope */ + int nsNr; /* the number of namespaces in scope */ +}; + +/** + * xsltKeyTable: + * + * Holds the computed keys for key definitions of the same QName. + * Is owned by an xsltDocument. + */ +typedef struct _xsltKeyTable xsltKeyTable; +typedef xsltKeyTable *xsltKeyTablePtr; +struct _xsltKeyTable { + struct _xsltKeyTable *next; + xmlChar *name; + xmlChar *nameURI; + xmlHashTablePtr keys; +}; + +/* + * The in-memory structure corresponding to an XSLT Stylesheet. + * NOTE: most of the content is simply linked from the doc tree + * structure, no specific allocation is made. + */ +typedef struct _xsltStylesheet xsltStylesheet; +typedef xsltStylesheet *xsltStylesheetPtr; + +typedef struct _xsltTransformContext xsltTransformContext; +typedef xsltTransformContext *xsltTransformContextPtr; + +/** + * xsltElemPreComp: + * + * The in-memory structure corresponding to element precomputed data, + * designed to be extended by extension implementors. + */ +typedef struct _xsltElemPreComp xsltElemPreComp; +typedef xsltElemPreComp *xsltElemPreCompPtr; + +/** + * xsltTransformFunction: + * @ctxt: the XSLT transformation context + * @node: the input node + * @inst: the stylesheet node + * @comp: the compiled information from the stylesheet + * + * Signature of the function associated to elements part of the + * stylesheet language like xsl:if or xsl:apply-templates. + */ +typedef void (*xsltTransformFunction) (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst, + xsltElemPreCompPtr comp); + +/** + * xsltSortFunc: + * @ctxt: a transformation context + * @sorts: the node-set to sort + * @nbsorts: the number of sorts + * + * Signature of the function to use during sorting + */ +typedef void (*xsltSortFunc) (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, + int nbsorts); + +typedef enum { + XSLT_FUNC_COPY=1, + XSLT_FUNC_SORT, + XSLT_FUNC_TEXT, + XSLT_FUNC_ELEMENT, + XSLT_FUNC_ATTRIBUTE, + XSLT_FUNC_COMMENT, + XSLT_FUNC_PI, + XSLT_FUNC_COPYOF, + XSLT_FUNC_VALUEOF, + XSLT_FUNC_NUMBER, + XSLT_FUNC_APPLYIMPORTS, + XSLT_FUNC_CALLTEMPLATE, + XSLT_FUNC_APPLYTEMPLATES, + XSLT_FUNC_CHOOSE, + XSLT_FUNC_IF, + XSLT_FUNC_FOREACH, + XSLT_FUNC_DOCUMENT, + XSLT_FUNC_WITHPARAM, + XSLT_FUNC_PARAM, + XSLT_FUNC_VARIABLE, + XSLT_FUNC_WHEN, + XSLT_FUNC_EXTENSION +#ifdef XSLT_REFACTORED + , + XSLT_FUNC_OTHERWISE, + XSLT_FUNC_FALLBACK, + XSLT_FUNC_MESSAGE, + XSLT_FUNC_INCLUDE, + XSLT_FUNC_ATTRSET, + XSLT_FUNC_LITERAL_RESULT_ELEMENT, + XSLT_FUNC_UNKOWN_FORWARDS_COMPAT +#endif +} xsltStyleType; + +/** + * xsltElemPreCompDeallocator: + * @comp: the #xsltElemPreComp to free up + * + * Deallocates an #xsltElemPreComp structure. + */ +typedef void (*xsltElemPreCompDeallocator) (xsltElemPreCompPtr comp); + +/** + * xsltElemPreComp: + * + * The basic structure for compiled items of the AST of the XSLT processor. + * This structure is also intended to be extended by extension implementors. + * TODO: This is somehow not nice, since it has a "free" field, which + * derived stylesheet-structs do not have. + */ +struct _xsltElemPreComp { + xsltElemPreCompPtr next; /* next item in the global chained + list held by xsltStylesheet. */ + xsltStyleType type; /* type of the element */ + xsltTransformFunction func; /* handling function */ + xmlNodePtr inst; /* the node in the stylesheet's tree + corresponding to this item */ + + /* end of common part */ + xsltElemPreCompDeallocator free; /* the deallocator */ +}; + +/** + * xsltStylePreComp: + * + * The abstract basic structure for items of the XSLT processor. + * This includes: + * 1) compiled forms of XSLT instructions (xsl:if, xsl:attribute, etc.) + * 2) compiled forms of literal result elements + * 3) compiled forms of extension elements + */ +typedef struct _xsltStylePreComp xsltStylePreComp; +typedef xsltStylePreComp *xsltStylePreCompPtr; + +#ifdef XSLT_REFACTORED + +/* +* Some pointer-list utility functions. +*/ +XSLTPUBFUN xsltPointerListPtr XSLTCALL + xsltPointerListCreate (int initialSize); +XSLTPUBFUN void XSLTCALL + xsltPointerListFree (xsltPointerListPtr list); +XSLTPUBFUN void XSLTCALL + xsltPointerListClear (xsltPointerListPtr list); +XSLTPUBFUN int XSLTCALL + xsltPointerListAddSize (xsltPointerListPtr list, + void *item, + int initialSize); + +/************************************************************************ + * * + * Refactored structures * + * * + ************************************************************************/ + +typedef struct _xsltNsListContainer xsltNsListContainer; +typedef xsltNsListContainer *xsltNsListContainerPtr; +struct _xsltNsListContainer { + xmlNsPtr *list; + int totalNumber; + int xpathNumber; +}; + +/** + * XSLT_ITEM_COMPATIBILITY_FIELDS: + * + * Fields for API compatibility to the structure + * _xsltElemPreComp which is used for extension functions. + * Note that @next is used for storage; it does not reflect a next + * sibling in the tree. + * TODO: Evaluate if we really need such a compatibility. + */ +#define XSLT_ITEM_COMPATIBILITY_FIELDS \ + xsltElemPreCompPtr next;\ + xsltStyleType type;\ + xsltTransformFunction func;\ + xmlNodePtr inst; + +/** + * XSLT_ITEM_NAVIGATION_FIELDS: + * + * Currently empty. + * TODO: It is intended to hold navigational fields in the future. + */ +#define XSLT_ITEM_NAVIGATION_FIELDS +/* + xsltStylePreCompPtr parent;\ + xsltStylePreCompPtr children;\ + xsltStylePreCompPtr nextItem; +*/ + +/** + * XSLT_ITEM_NSINSCOPE_FIELDS: + * + * The in-scope namespaces. + */ +#define XSLT_ITEM_NSINSCOPE_FIELDS xsltNsListContainerPtr inScopeNs; + +/** + * XSLT_ITEM_COMMON_FIELDS: + * + * Common fields used for all items. + */ +#define XSLT_ITEM_COMMON_FIELDS \ + XSLT_ITEM_COMPATIBILITY_FIELDS \ + XSLT_ITEM_NAVIGATION_FIELDS \ + XSLT_ITEM_NSINSCOPE_FIELDS + +/** + * _xsltStylePreComp: + * + * The abstract basic structure for items of the XSLT processor. + * This includes: + * 1) compiled forms of XSLT instructions (e.g. xsl:if, xsl:attribute, etc.) + * 2) compiled forms of literal result elements + * 3) various properties for XSLT instructions (e.g. xsl:when, + * xsl:with-param) + * + * REVISIT TODO: Keep this structure equal to the fields + * defined by XSLT_ITEM_COMMON_FIELDS + */ +struct _xsltStylePreComp { + xsltElemPreCompPtr next; /* next item in the global chained + list held by xsltStylesheet */ + xsltStyleType type; /* type of the item */ + xsltTransformFunction func; /* handling function */ + xmlNodePtr inst; /* the node in the stylesheet's tree + corresponding to this item. */ + /* Currently no navigational fields. */ + xsltNsListContainerPtr inScopeNs; +}; + +/** + * xsltStyleBasicEmptyItem: + * + * Abstract structure only used as a short-cut for + * XSLT items with no extra fields. + * NOTE that it is intended that this structure looks the same as + * _xsltStylePreComp. + */ +typedef struct _xsltStyleBasicEmptyItem xsltStyleBasicEmptyItem; +typedef xsltStyleBasicEmptyItem *xsltStyleBasicEmptyItemPtr; + +struct _xsltStyleBasicEmptyItem { + XSLT_ITEM_COMMON_FIELDS +}; + +/** + * xsltStyleBasicExpressionItem: + * + * Abstract structure only used as a short-cut for + * XSLT items with just an expression. + */ +typedef struct _xsltStyleBasicExpressionItem xsltStyleBasicExpressionItem; +typedef xsltStyleBasicExpressionItem *xsltStyleBasicExpressionItemPtr; + +struct _xsltStyleBasicExpressionItem { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *select; /* TODO: Change this to "expression". */ + xmlXPathCompExprPtr comp; /* TODO: Change this to compExpr. */ +}; + +/************************************************************************ + * * + * XSLT-instructions/declarations * + * * + ************************************************************************/ + +/** + * xsltStyleItemElement: + * + * + * + * + * + */ +typedef struct _xsltStyleItemElement xsltStyleItemElement; +typedef xsltStyleItemElement *xsltStyleItemElementPtr; + +struct _xsltStyleItemElement { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *use; + int has_use; + const xmlChar *name; + int has_name; + const xmlChar *ns; + const xmlChar *nsPrefix; + int has_ns; +}; + +/** + * xsltStyleItemAttribute: + * + * + * + * + * + */ +typedef struct _xsltStyleItemAttribute xsltStyleItemAttribute; +typedef xsltStyleItemAttribute *xsltStyleItemAttributePtr; + +struct _xsltStyleItemAttribute { + XSLT_ITEM_COMMON_FIELDS + const xmlChar *name; + int has_name; + const xmlChar *ns; + const xmlChar *nsPrefix; + int has_ns; +}; + +/** + * xsltStyleItemText: + * + * + * + * + * + */ +typedef struct _xsltStyleItemText xsltStyleItemText; +typedef xsltStyleItemText *xsltStyleItemTextPtr; + +struct _xsltStyleItemText { + XSLT_ITEM_COMMON_FIELDS + int noescape; /* text */ +}; + +/** + * xsltStyleItemComment: + * + * + * + * + * + */ +typedef xsltStyleBasicEmptyItem xsltStyleItemComment; +typedef xsltStyleItemComment *xsltStyleItemCommentPtr; + +/** + * xsltStyleItemPI: + * + * + * + * + * + */ +typedef struct _xsltStyleItemPI xsltStyleItemPI; +typedef xsltStyleItemPI *xsltStyleItemPIPtr; + +struct _xsltStyleItemPI { + XSLT_ITEM_COMMON_FIELDS + const xmlChar *name; + int has_name; +}; + +/** + * xsltStyleItemApplyImports: + * + * + * + */ +typedef xsltStyleBasicEmptyItem xsltStyleItemApplyImports; +typedef xsltStyleItemApplyImports *xsltStyleItemApplyImportsPtr; + +/** + * xsltStyleItemApplyTemplates: + * + * + * + * + * + */ +typedef struct _xsltStyleItemApplyTemplates xsltStyleItemApplyTemplates; +typedef xsltStyleItemApplyTemplates *xsltStyleItemApplyTemplatesPtr; + +struct _xsltStyleItemApplyTemplates { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *mode; /* apply-templates */ + const xmlChar *modeURI; /* apply-templates */ + const xmlChar *select; /* sort, copy-of, value-of, apply-templates */ + xmlXPathCompExprPtr comp; /* a precompiled XPath expression */ + /* TODO: with-params */ +}; + +/** + * xsltStyleItemCallTemplate: + * + * + * + * + * + */ +typedef struct _xsltStyleItemCallTemplate xsltStyleItemCallTemplate; +typedef xsltStyleItemCallTemplate *xsltStyleItemCallTemplatePtr; + +struct _xsltStyleItemCallTemplate { + XSLT_ITEM_COMMON_FIELDS + + xsltTemplatePtr templ; /* call-template */ + const xmlChar *name; /* element, attribute, pi */ + int has_name; /* element, attribute, pi */ + const xmlChar *ns; /* element */ + int has_ns; /* element */ + /* TODO: with-params */ +}; + +/** + * xsltStyleItemCopy: + * + * + * + * + * + */ +typedef struct _xsltStyleItemCopy xsltStyleItemCopy; +typedef xsltStyleItemCopy *xsltStyleItemCopyPtr; + +struct _xsltStyleItemCopy { + XSLT_ITEM_COMMON_FIELDS + const xmlChar *use; /* copy, element */ + int has_use; /* copy, element */ +}; + +/** + * xsltStyleItemIf: + * + * + * + * + * + */ +typedef struct _xsltStyleItemIf xsltStyleItemIf; +typedef xsltStyleItemIf *xsltStyleItemIfPtr; + +struct _xsltStyleItemIf { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *test; /* if */ + xmlXPathCompExprPtr comp; /* a precompiled XPath expression */ +}; + + +/** + * xsltStyleItemCopyOf: + * + * + * + */ +typedef xsltStyleBasicExpressionItem xsltStyleItemCopyOf; +typedef xsltStyleItemCopyOf *xsltStyleItemCopyOfPtr; + +/** + * xsltStyleItemValueOf: + * + * + * + */ +typedef struct _xsltStyleItemValueOf xsltStyleItemValueOf; +typedef xsltStyleItemValueOf *xsltStyleItemValueOfPtr; + +struct _xsltStyleItemValueOf { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *select; + xmlXPathCompExprPtr comp; /* a precompiled XPath expression */ + int noescape; +}; + +/** + * xsltStyleItemNumber: + * + * + * + */ +typedef struct _xsltStyleItemNumber xsltStyleItemNumber; +typedef xsltStyleItemNumber *xsltStyleItemNumberPtr; + +struct _xsltStyleItemNumber { + XSLT_ITEM_COMMON_FIELDS + xsltNumberData numdata; /* number */ +}; + +/** + * xsltStyleItemChoose: + * + * + * + * + * + */ +typedef xsltStyleBasicEmptyItem xsltStyleItemChoose; +typedef xsltStyleItemChoose *xsltStyleItemChoosePtr; + +/** + * xsltStyleItemFallback: + * + * + * + * + * + */ +typedef xsltStyleBasicEmptyItem xsltStyleItemFallback; +typedef xsltStyleItemFallback *xsltStyleItemFallbackPtr; + +/** + * xsltStyleItemForEach: + * + * + * + * + * + */ +typedef xsltStyleBasicExpressionItem xsltStyleItemForEach; +typedef xsltStyleItemForEach *xsltStyleItemForEachPtr; + +/** + * xsltStyleItemMessage: + * + * + * + * + * + */ +typedef struct _xsltStyleItemMessage xsltStyleItemMessage; +typedef xsltStyleItemMessage *xsltStyleItemMessagePtr; + +struct _xsltStyleItemMessage { + XSLT_ITEM_COMMON_FIELDS + int terminate; +}; + +/** + * xsltStyleItemDocument: + * + * NOTE: This is not an instruction of XSLT 1.0. + */ +typedef struct _xsltStyleItemDocument xsltStyleItemDocument; +typedef xsltStyleItemDocument *xsltStyleItemDocumentPtr; + +struct _xsltStyleItemDocument { + XSLT_ITEM_COMMON_FIELDS + int ver11; /* assigned: in xsltDocumentComp; + read: nowhere; + TODO: Check if we need. */ + const xmlChar *filename; /* document URL */ + int has_filename; +}; + +/************************************************************************ + * * + * Non-instructions (actually properties of instructions/declarations) * + * * + ************************************************************************/ + +/** + * xsltStyleBasicItemVariable: + * + * Basic struct for xsl:variable, xsl:param and xsl:with-param. + * It's currently important to have equal fields, since + * xsltParseStylesheetCallerParam() is used with xsl:with-param from + * the xslt side and with xsl:param from the exslt side (in + * exsltFuncFunctionFunction()). + * + * FUTURE NOTE: In XSLT 2.0 xsl:param, xsl:variable and xsl:with-param + * have additional different fields. + */ +typedef struct _xsltStyleBasicItemVariable xsltStyleBasicItemVariable; +typedef xsltStyleBasicItemVariable *xsltStyleBasicItemVariablePtr; + +struct _xsltStyleBasicItemVariable { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *select; + xmlXPathCompExprPtr comp; + + const xmlChar *name; + int has_name; + const xmlChar *ns; + int has_ns; +}; + +/** + * xsltStyleItemVariable: + * + * + * + * + * + */ +typedef xsltStyleBasicItemVariable xsltStyleItemVariable; +typedef xsltStyleItemVariable *xsltStyleItemVariablePtr; + +/** + * xsltStyleItemParam: + * + * + * + * + * + */ +typedef struct _xsltStyleItemParam xsltStyleItemParam; +typedef xsltStyleItemParam *xsltStyleItemParamPtr; + +struct _xsltStyleItemParam { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *select; + xmlXPathCompExprPtr comp; + + const xmlChar *name; + int has_name; + const xmlChar *ns; + int has_ns; +}; + +/** + * xsltStyleItemWithParam: + * + * + * + * + */ +typedef xsltStyleBasicItemVariable xsltStyleItemWithParam; +typedef xsltStyleItemWithParam *xsltStyleItemWithParamPtr; + +/** + * xsltStyleItemSort: + * + * Reflects the XSLT xsl:sort item. + * Allowed parents: xsl:apply-templates, xsl:for-each + * + */ +typedef struct _xsltStyleItemSort xsltStyleItemSort; +typedef xsltStyleItemSort *xsltStyleItemSortPtr; + +struct _xsltStyleItemSort { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *stype; /* sort */ + int has_stype; /* sort */ + int number; /* sort */ + const xmlChar *order; /* sort */ + int has_order; /* sort */ + int descending; /* sort */ + const xmlChar *lang; /* sort */ + int has_lang; /* sort */ + xsltLocale locale; /* sort */ + const xmlChar *case_order; /* sort */ + int lower_first; /* sort */ + + const xmlChar *use; + int has_use; + + const xmlChar *select; /* sort, copy-of, value-of, apply-templates */ + + xmlXPathCompExprPtr comp; /* a precompiled XPath expression */ +}; + + +/** + * xsltStyleItemWhen: + * + * + * + * + * Allowed parent: xsl:choose + */ +typedef struct _xsltStyleItemWhen xsltStyleItemWhen; +typedef xsltStyleItemWhen *xsltStyleItemWhenPtr; + +struct _xsltStyleItemWhen { + XSLT_ITEM_COMMON_FIELDS + + const xmlChar *test; + xmlXPathCompExprPtr comp; +}; + +/** + * xsltStyleItemOtherwise: + * + * Allowed parent: xsl:choose + * + * + * + */ +typedef struct _xsltStyleItemOtherwise xsltStyleItemOtherwise; +typedef xsltStyleItemOtherwise *xsltStyleItemOtherwisePtr; + +struct _xsltStyleItemOtherwise { + XSLT_ITEM_COMMON_FIELDS +}; + +typedef struct _xsltStyleItemInclude xsltStyleItemInclude; +typedef xsltStyleItemInclude *xsltStyleItemIncludePtr; + +struct _xsltStyleItemInclude { + XSLT_ITEM_COMMON_FIELDS + xsltDocumentPtr include; +}; + +/************************************************************************ + * * + * XSLT elements in forwards-compatible mode * + * * + ************************************************************************/ + +typedef struct _xsltStyleItemUknown xsltStyleItemUknown; +typedef xsltStyleItemUknown *xsltStyleItemUknownPtr; +struct _xsltStyleItemUknown { + XSLT_ITEM_COMMON_FIELDS +}; + + +/************************************************************************ + * * + * Extension elements * + * * + ************************************************************************/ + +/* + * xsltStyleItemExtElement: + * + * Reflects extension elements. + * + * NOTE: Due to the fact that the structure xsltElemPreComp is most + * probably already heavily in use out there by users, so we cannot + * easily change it, we'll create an intermediate structure which will + * hold an xsltElemPreCompPtr. + * BIG NOTE: The only problem I see here is that the user processes the + * content of the stylesheet tree, possibly he'll lookup the node->psvi + * fields in order to find subsequent extension functions. + * In this case, the user's code will break, since the node->psvi + * field will hold now the xsltStyleItemExtElementPtr and not + * the xsltElemPreCompPtr. + * However the place where the structure is anchored in the node-tree, + * namely node->psvi, has beed already once been moved from node->_private + * to node->psvi, so we have a precedent here, which, I think, should allow + * us to change such semantics without headaches. + */ +typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement; +typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr; +struct _xsltStyleItemExtElement { + XSLT_ITEM_COMMON_FIELDS + xsltElemPreCompPtr item; +}; + +/************************************************************************ + * * + * Literal result elements * + * * + ************************************************************************/ + +typedef struct _xsltEffectiveNs xsltEffectiveNs; +typedef xsltEffectiveNs *xsltEffectiveNsPtr; +struct _xsltEffectiveNs { + xsltEffectiveNsPtr nextInStore; /* storage next */ + xsltEffectiveNsPtr next; /* next item in the list */ + const xmlChar *prefix; + const xmlChar *nsName; + /* + * Indicates if eclared on the literal result element; dunno if really + * needed. + */ + int holdByElem; +}; + +/* + * Info for literal result elements. + * This will be set on the elem->psvi field and will be + * shared by literal result elements, which have the same + * excluded result namespaces; i.e., this *won't* be created uniquely + * for every literal result element. + */ +typedef struct _xsltStyleItemLRElementInfo xsltStyleItemLRElementInfo; +typedef xsltStyleItemLRElementInfo *xsltStyleItemLRElementInfoPtr; +struct _xsltStyleItemLRElementInfo { + XSLT_ITEM_COMMON_FIELDS + /* + * @effectiveNs is the set of effective ns-nodes + * on the literal result element, which will be added to the result + * element if not already existing in the result tree. + * This means that excluded namespaces (via exclude-result-prefixes, + * extension-element-prefixes and the XSLT namespace) not added + * to the set. + * Namespace-aliasing was applied on the @effectiveNs. + */ + xsltEffectiveNsPtr effectiveNs; + +}; + +#ifdef XSLT_REFACTORED + +typedef struct _xsltNsAlias xsltNsAlias; +typedef xsltNsAlias *xsltNsAliasPtr; +struct _xsltNsAlias { + xsltNsAliasPtr next; /* next in the list */ + xmlNsPtr literalNs; + xmlNsPtr targetNs; + xmlDocPtr docOfTargetNs; +}; +#endif + +#ifdef XSLT_REFACTORED_XSLT_NSCOMP + +typedef struct _xsltNsMap xsltNsMap; +typedef xsltNsMap *xsltNsMapPtr; +struct _xsltNsMap { + xsltNsMapPtr next; /* next in the list */ + xmlDocPtr doc; + xmlNodePtr elem; /* the element holding the ns-decl */ + xmlNsPtr ns; /* the xmlNs structure holding the XML namespace name */ + const xmlChar *origNsName; /* the original XML namespace name */ + const xmlChar *newNsName; /* the mapped XML namespace name */ +}; +#endif + +/************************************************************************ + * * + * Compile-time structures for *internal* use only * + * * + ************************************************************************/ + +typedef struct _xsltPrincipalStylesheetData xsltPrincipalStylesheetData; +typedef xsltPrincipalStylesheetData *xsltPrincipalStylesheetDataPtr; + +typedef struct _xsltNsList xsltNsList; +typedef xsltNsList *xsltNsListPtr; +struct _xsltNsList { + xsltNsListPtr next; /* next in the list */ + xmlNsPtr ns; +}; + +/* +* xsltVarInfo: +* +* Used at compilation time for parameters and variables. +*/ +typedef struct _xsltVarInfo xsltVarInfo; +typedef xsltVarInfo *xsltVarInfoPtr; +struct _xsltVarInfo { + xsltVarInfoPtr next; /* next in the list */ + xsltVarInfoPtr prev; + int depth; /* the depth in the tree */ + const xmlChar *name; + const xmlChar *nsName; +}; + +/** + * xsltCompilerNodeInfo: + * + * Per-node information during compile-time. + */ +typedef struct _xsltCompilerNodeInfo xsltCompilerNodeInfo; +typedef xsltCompilerNodeInfo *xsltCompilerNodeInfoPtr; +struct _xsltCompilerNodeInfo { + xsltCompilerNodeInfoPtr next; + xsltCompilerNodeInfoPtr prev; + xmlNodePtr node; + int depth; + xsltTemplatePtr templ; /* The owning template */ + int category; /* XSLT element, LR-element or + extension element */ + xsltStyleType type; + xsltElemPreCompPtr item; /* The compiled information */ + /* The current in-scope namespaces */ + xsltNsListContainerPtr inScopeNs; + /* The current excluded result namespaces */ + xsltPointerListPtr exclResultNs; + /* The current extension instruction namespaces */ + xsltPointerListPtr extElemNs; + + /* The current info for literal result elements. */ + xsltStyleItemLRElementInfoPtr litResElemInfo; + /* + * Set to 1 if in-scope namespaces changed, + * or excluded result namespaces changed, + * or extension element namespaces changed. + * This will trigger creation of new infos + * for literal result elements. + */ + int nsChanged; + int preserveWhitespace; + int stripWhitespace; + int isRoot; /* whether this is the stylesheet's root node */ + int forwardsCompat; /* whether forwards-compatible mode is enabled */ + /* whether the content of an extension element was processed */ + int extContentHandled; + /* the type of the current child */ + xsltStyleType curChildType; +}; + +/** + * XSLT_CCTXT: + * + * get pointer to compiler context + */ +#define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt) + +typedef enum { + XSLT_ERROR_SEVERITY_ERROR = 0, + XSLT_ERROR_SEVERITY_WARNING +} xsltErrorSeverityType; + +typedef struct _xsltCompilerCtxt xsltCompilerCtxt; +typedef xsltCompilerCtxt *xsltCompilerCtxtPtr; +struct _xsltCompilerCtxt { + void *errorCtxt; /* user specific error context */ + /* + * used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING */ + xsltErrorSeverityType errSeverity; + int warnings; /* TODO: number of warnings found at + compilation */ + int errors; /* TODO: number of errors found at + compilation */ + xmlDictPtr dict; + xsltStylesheetPtr style; + int simplified; /* whether this is a simplified stylesheet */ + /* TODO: structured/unstructured error contexts. */ + int depth; /* Current depth of processing */ + + xsltCompilerNodeInfoPtr inode; + xsltCompilerNodeInfoPtr inodeList; + xsltCompilerNodeInfoPtr inodeLast; + xsltPointerListPtr tmpList; /* Used for various purposes */ + /* + * The XSLT version as specified by the stylesheet's root element. + */ + int isInclude; + int hasForwardsCompat; /* whether forwards-compatible mode was used + in a parsing episode */ + int maxNodeInfos; /* TEMP TODO: just for the interest */ + int maxLREs; /* TEMP TODO: just for the interest */ + /* + * In order to keep the old behaviour, applying strict rules of + * the spec can be turned off. This has effect only on special + * mechanisms like whitespace-stripping in the stylesheet. + */ + int strict; + xsltPrincipalStylesheetDataPtr psData; + xsltStyleItemUknownPtr unknownItem; + int hasNsAliases; /* Indicator if there was an xsl:namespace-alias. */ + xsltNsAliasPtr nsAliases; + xsltVarInfoPtr ivars; /* Storage of local in-scope variables/params. */ + xsltVarInfoPtr ivar; /* topmost local variable/param. */ +}; + +#else /* XSLT_REFACTORED */ +/* +* The old structures before refactoring. +*/ + +/** + * _xsltStylePreComp: + * + * The in-memory structure corresponding to XSLT stylesheet constructs + * precomputed data. + */ +struct _xsltStylePreComp { + xsltElemPreCompPtr next; /* chained list */ + xsltStyleType type; /* type of the element */ + xsltTransformFunction func; /* handling function */ + xmlNodePtr inst; /* the instruction */ + + /* + * Pre computed values. + */ + + const xmlChar *stype; /* sort */ + int has_stype; /* sort */ + int number; /* sort */ + const xmlChar *order; /* sort */ + int has_order; /* sort */ + int descending; /* sort */ + const xmlChar *lang; /* sort */ + int has_lang; /* sort */ + xsltLocale locale; /* sort */ + const xmlChar *case_order; /* sort */ + int lower_first; /* sort */ + + const xmlChar *use; /* copy, element */ + int has_use; /* copy, element */ + + int noescape; /* text */ + + const xmlChar *name; /* element, attribute, pi */ + int has_name; /* element, attribute, pi */ + const xmlChar *ns; /* element */ + int has_ns; /* element */ + + const xmlChar *mode; /* apply-templates */ + const xmlChar *modeURI; /* apply-templates */ + + const xmlChar *test; /* if */ + + xsltTemplatePtr templ; /* call-template */ + + const xmlChar *select; /* sort, copy-of, value-of, apply-templates */ + + int ver11; /* document */ + const xmlChar *filename; /* document URL */ + int has_filename; /* document */ + + xsltNumberData numdata; /* number */ + + xmlXPathCompExprPtr comp; /* a precompiled XPath expression */ + xmlNsPtr *nsList; /* the namespaces in scope */ + int nsNr; /* the number of namespaces in scope */ +}; + +#endif /* XSLT_REFACTORED */ + + +/* + * The in-memory structure corresponding to an XSLT Variable + * or Param. + */ +typedef struct _xsltStackElem xsltStackElem; +typedef xsltStackElem *xsltStackElemPtr; +struct _xsltStackElem { + struct _xsltStackElem *next;/* chained list */ + xsltStylePreCompPtr comp; /* the compiled form */ + int computed; /* was the evaluation done */ + const xmlChar *name; /* the local part of the name QName */ + const xmlChar *nameURI; /* the URI part of the name QName */ + const xmlChar *select; /* the eval string */ + xmlNodePtr tree; /* the sequence constructor if no eval + string or the location */ + xmlXPathObjectPtr value; /* The value if computed */ + xmlDocPtr fragment; /* The Result Tree Fragments (needed for XSLT 1.0) + which are bound to the variable's lifetime. */ + int level; /* the depth in the tree; + -1 if persistent (e.g. a given xsl:with-param) */ + xsltTransformContextPtr context; /* The transformation context; needed to cache + the variables */ + int flags; +}; + +#ifdef XSLT_REFACTORED + +struct _xsltPrincipalStylesheetData { + /* + * Namespace dictionary for ns-prefixes and ns-names: + * TODO: Shared between stylesheets, and XPath mechanisms. + * Not used yet. + */ + xmlDictPtr namespaceDict; + /* + * Global list of in-scope namespaces. + */ + xsltPointerListPtr inScopeNamespaces; + /* + * Global list of information for [xsl:]excluded-result-prefixes. + */ + xsltPointerListPtr exclResultNamespaces; + /* + * Global list of information for [xsl:]extension-element-prefixes. + */ + xsltPointerListPtr extElemNamespaces; + xsltEffectiveNsPtr effectiveNs; +#ifdef XSLT_REFACTORED_XSLT_NSCOMP + /* + * Namespace name map to get rid of string comparison of namespace names. + */ + xsltNsMapPtr nsMap; +#endif +}; + + +#endif +/* + * Note that we added a @compCtxt field to anchor an stylesheet compilation + * context, since, due to historical reasons, various compile-time function + * take only the stylesheet as argument and not a compilation context. + */ +struct _xsltStylesheet { + /* + * The stylesheet import relation is kept as a tree. + */ + struct _xsltStylesheet *parent; + struct _xsltStylesheet *next; + struct _xsltStylesheet *imports; + + xsltDocumentPtr docList; /* the include document list */ + + /* + * General data on the style sheet document. + */ + xmlDocPtr doc; /* the parsed XML stylesheet */ + xmlHashTablePtr stripSpaces;/* the hash table of the strip-space and + preserve space elements */ + int stripAll; /* strip-space * (1) preserve-space * (-1) */ + xmlHashTablePtr cdataSection;/* the hash table of the cdata-section */ + + /* + * Global variable or parameters. + */ + xsltStackElemPtr variables; /* linked list of param and variables */ + + /* + * Template descriptions. + */ + xsltTemplatePtr templates; /* the ordered list of templates */ + void *templatesHash; /* hash table or wherever compiled templates + information is stored */ + void *rootMatch; /* template based on / */ + void *keyMatch; /* template based on key() */ + void *elemMatch; /* template based on * */ + void *attrMatch; /* template based on @* */ + void *parentMatch; /* template based on .. */ + void *textMatch; /* template based on text() */ + void *piMatch; /* template based on processing-instruction() */ + void *commentMatch; /* template based on comment() */ + + /* + * Namespace aliases. + * NOTE: Not used in the refactored code. + */ + xmlHashTablePtr nsAliases; /* the namespace alias hash tables */ + + /* + * Attribute sets. + */ + xmlHashTablePtr attributeSets;/* the attribute sets hash tables */ + + /* + * Namespaces. + * TODO: Eliminate this. + */ + xmlHashTablePtr nsHash; /* the set of namespaces in use: + ATTENTION: This is used for + execution of XPath expressions; unfortunately + it restricts the stylesheet to have distinct + prefixes. + TODO: We need to get rid of this. + */ + void *nsDefs; /* ATTENTION TODO: This is currently used to store + xsltExtDefPtr (in extensions.c) and + *not* xmlNsPtr. + */ + + /* + * Key definitions. + */ + void *keys; /* key definitions */ + + /* + * Output related stuff. + */ + xmlChar *method; /* the output method */ + xmlChar *methodURI; /* associated namespace if any */ + xmlChar *version; /* version string */ + xmlChar *encoding; /* encoding string */ + int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */ + + /* + * Number formatting. + */ + xsltDecimalFormatPtr decimalFormat; + int standalone; /* standalone = "yes" | "no" */ + xmlChar *doctypePublic; /* doctype-public string */ + xmlChar *doctypeSystem; /* doctype-system string */ + int indent; /* should output being indented */ + xmlChar *mediaType; /* media-type string */ + + /* + * Precomputed blocks. + */ + xsltElemPreCompPtr preComps;/* list of precomputed blocks */ + int warnings; /* number of warnings found at compilation */ + int errors; /* number of errors found at compilation */ + + xmlChar *exclPrefix; /* last excluded prefixes */ + xmlChar **exclPrefixTab; /* array of excluded prefixes */ + int exclPrefixNr; /* number of excluded prefixes in scope */ + int exclPrefixMax; /* size of the array */ + + void *_private; /* user defined data */ + + /* + * Extensions. + */ + xmlHashTablePtr extInfos; /* the extension data */ + int extrasNr; /* the number of extras required */ + + /* + * For keeping track of nested includes + */ + xsltDocumentPtr includes; /* points to last nested include */ + + /* + * dictionary: shared between stylesheet, context and documents. + */ + xmlDictPtr dict; + /* + * precompiled attribute value templates. + */ + void *attVTs; + /* + * if namespace-alias has an alias for the default stylesheet prefix + * NOTE: Not used in the refactored code. + */ + const xmlChar *defaultAlias; + /* + * bypass pre-processing (already done) (used in imports) + */ + int nopreproc; + /* + * all document text strings were internalized + */ + int internalized; + /* + * Literal Result Element as Stylesheet c.f. section 2.3 + */ + int literal_result; + /* + * The principal stylesheet + */ + xsltStylesheetPtr principal; +#ifdef XSLT_REFACTORED + /* + * Compilation context used during compile-time. + */ + xsltCompilerCtxtPtr compCtxt; /* TODO: Change this to (void *). */ + + xsltPrincipalStylesheetDataPtr principalData; +#endif + /* + * Forwards-compatible processing + */ + int forwards_compatible; + + xmlHashTablePtr namedTemplates; /* hash table of named templates */ + + xmlXPathContextPtr xpathCtxt; +}; + +typedef struct _xsltTransformCache xsltTransformCache; +typedef xsltTransformCache *xsltTransformCachePtr; +struct _xsltTransformCache { + xmlDocPtr RVT; + int nbRVT; + xsltStackElemPtr stackItems; + int nbStackItems; +#ifdef XSLT_DEBUG_PROFILE_CACHE + int dbgCachedRVTs; + int dbgReusedRVTs; + int dbgCachedVars; + int dbgReusedVars; +#endif +}; + +/* + * The in-memory structure corresponding to an XSLT Transformation. + */ +typedef enum { + XSLT_OUTPUT_XML = 0, + XSLT_OUTPUT_HTML, + XSLT_OUTPUT_TEXT +} xsltOutputType; + +typedef enum { + XSLT_STATE_OK = 0, + XSLT_STATE_ERROR, + XSLT_STATE_STOPPED +} xsltTransformState; + +struct _xsltTransformContext { + xsltStylesheetPtr style; /* the stylesheet used */ + xsltOutputType type; /* the type of output */ + + xsltTemplatePtr templ; /* the current template */ + int templNr; /* Nb of templates in the stack */ + int templMax; /* Size of the templtes stack */ + xsltTemplatePtr *templTab; /* the template stack */ + + xsltStackElemPtr vars; /* the current variable list */ + int varsNr; /* Nb of variable list in the stack */ + int varsMax; /* Size of the variable list stack */ + xsltStackElemPtr *varsTab; /* the variable list stack */ + int varsBase; /* the var base for current templ */ + + /* + * Extensions + */ + xmlHashTablePtr extFunctions; /* the extension functions */ + xmlHashTablePtr extElements; /* the extension elements */ + xmlHashTablePtr extInfos; /* the extension data */ + + const xmlChar *mode; /* the current mode */ + const xmlChar *modeURI; /* the current mode URI */ + + xsltDocumentPtr docList; /* the document list */ + + xsltDocumentPtr document; /* the current source document; can be NULL if an RTF */ + xmlNodePtr node; /* the current node being processed */ + xmlNodeSetPtr nodeList; /* the current node list */ + /* xmlNodePtr current; the node */ + + xmlDocPtr output; /* the resulting document */ + xmlNodePtr insert; /* the insertion node */ + + xmlXPathContextPtr xpathCtxt; /* the XPath context */ + xsltTransformState state; /* the current state */ + + /* + * Global variables + */ + xmlHashTablePtr globalVars; /* the global variables and params */ + + xmlNodePtr inst; /* the instruction in the stylesheet */ + + int xinclude; /* should XInclude be processed */ + + const char * outputFile; /* the output URI if known */ + + int profile; /* is this run profiled */ + long prof; /* the current profiled value */ + int profNr; /* Nb of templates in the stack */ + int profMax; /* Size of the templtaes stack */ + long *profTab; /* the profile template stack */ + + void *_private; /* user defined data */ + + int extrasNr; /* the number of extras used */ + int extrasMax; /* the number of extras allocated */ + xsltRuntimeExtraPtr extras; /* extra per runtime information */ + + xsltDocumentPtr styleList; /* the stylesheet docs list */ + void * sec; /* the security preferences if any */ + + xmlGenericErrorFunc error; /* a specific error handler */ + void * errctx; /* context for the error handler */ + + xsltSortFunc sortfunc; /* a ctxt specific sort routine */ + + /* + * handling of temporary Result Value Tree + * (XSLT 1.0 term: "Result Tree Fragment") + */ + xmlDocPtr tmpRVT; /* list of RVT without persistance */ + xmlDocPtr persistRVT; /* list of persistant RVTs */ + int ctxtflags; /* context processing flags */ + + /* + * Speed optimization when coalescing text nodes + */ + const xmlChar *lasttext; /* last text node content */ + int lasttsize; /* last text node size */ + int lasttuse; /* last text node use */ + /* + * Per Context Debugging + */ + int debugStatus; /* the context level debug status */ + unsigned long* traceCode; /* pointer to the variable holding the mask */ + + int parserOptions; /* parser options xmlParserOption */ + + /* + * dictionary: shared between stylesheet, context and documents. + */ + xmlDictPtr dict; + xmlDocPtr tmpDoc; /* Obsolete; not used in the library. */ + /* + * all document text strings are internalized + */ + int internalized; + int nbKeys; + int hasTemplKeyPatterns; + xsltTemplatePtr currentTemplateRule; /* the Current Template Rule */ + xmlNodePtr initialContextNode; + xmlDocPtr initialContextDoc; + xsltTransformCachePtr cache; + void *contextVariable; /* the current variable item */ + xmlDocPtr localRVT; /* list of local tree fragments; will be freed when + the instruction which created the fragment + exits */ + xmlDocPtr localRVTBase; /* Obsolete */ + int keyInitLevel; /* Needed to catch recursive keys issues */ + int depth; /* Needed to catch recursions */ + int maxTemplateDepth; + int maxTemplateVars; + unsigned long opLimit; + unsigned long opCount; +}; + +/** + * CHECK_STOPPED: + * + * Macro to check if the XSLT processing should be stopped. + * Will return from the function. + */ +#define CHECK_STOPPED if (ctxt->state == XSLT_STATE_STOPPED) return; + +/** + * CHECK_STOPPEDE: + * + * Macro to check if the XSLT processing should be stopped. + * Will goto the error: label. + */ +#define CHECK_STOPPEDE if (ctxt->state == XSLT_STATE_STOPPED) goto error; + +/** + * CHECK_STOPPED0: + * + * Macro to check if the XSLT processing should be stopped. + * Will return from the function with a 0 value. + */ +#define CHECK_STOPPED0 if (ctxt->state == XSLT_STATE_STOPPED) return(0); + +/* + * The macro XML_CAST_FPTR is a hack to avoid a gcc warning about + * possible incompatibilities between function pointers and object + * pointers. It is defined in libxml/hash.h within recent versions + * of libxml2, but is put here for compatibility. + */ +#ifndef XML_CAST_FPTR +/** + * XML_CAST_FPTR: + * @fptr: pointer to a function + * + * Macro to do a casting from an object pointer to a + * function pointer without encountering a warning from + * gcc + * + * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) + * This macro violated ISO C aliasing rules (gcc4 on s390 broke) + * so it is disabled now + */ + +#define XML_CAST_FPTR(fptr) fptr +#endif +/* + * Functions associated to the internal types +xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, + xmlChar *name); + */ +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltNewStylesheet (void); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltParseStylesheetFile (const xmlChar* filename); +XSLTPUBFUN void XSLTCALL + xsltFreeStylesheet (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltIsBlank (xmlChar *str); +XSLTPUBFUN void XSLTCALL + xsltFreeStackElemList (xsltStackElemPtr elem); +XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL + xsltDecimalFormatGetByName(xsltStylesheetPtr style, + xmlChar *name); +XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL + xsltDecimalFormatGetByQName(xsltStylesheetPtr style, + const xmlChar *nsUri, + const xmlChar *name); + +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltParseStylesheetProcess(xsltStylesheetPtr ret, + xmlDocPtr doc); +XSLTPUBFUN void XSLTCALL + xsltParseStylesheetOutput(xsltStylesheetPtr style, + xmlNodePtr cur); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltParseStylesheetDoc (xmlDocPtr doc); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltParseStylesheetImportedDoc(xmlDocPtr doc, + xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltParseStylesheetUser(xsltStylesheetPtr style, + xmlDocPtr doc); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL + xsltLoadStylesheetPI (xmlDocPtr doc); +XSLTPUBFUN void XSLTCALL + xsltNumberFormat (xsltTransformContextPtr ctxt, + xsltNumberDataPtr data, + xmlNodePtr node); +XSLTPUBFUN xmlXPathError XSLTCALL + xsltFormatNumberConversion(xsltDecimalFormatPtr self, + xmlChar *format, + double number, + xmlChar **result); + +XSLTPUBFUN void XSLTCALL + xsltParseTemplateContent(xsltStylesheetPtr style, + xmlNodePtr templ); +XSLTPUBFUN int XSLTCALL + xsltAllocateExtra (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt); +/* + * Extra functions for Result Value Trees + */ +XSLTPUBFUN xmlDocPtr XSLTCALL + xsltCreateRVT (xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL + xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, + xmlDocPtr RVT); +XSLTPUBFUN int XSLTCALL + xsltRegisterLocalRVT (xsltTransformContextPtr ctxt, + xmlDocPtr RVT); +XSLTPUBFUN int XSLTCALL + xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, + xmlDocPtr RVT); +XSLTPUBFUN int XSLTCALL + xsltExtensionInstructionResultRegister( + xsltTransformContextPtr ctxt, + xmlXPathObjectPtr obj); +XSLTPUBFUN int XSLTCALL + xsltExtensionInstructionResultFinalize( + xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL + xsltFlagRVTs( + xsltTransformContextPtr ctxt, + xmlXPathObjectPtr obj, + void *val); +XSLTPUBFUN void XSLTCALL + xsltFreeRVTs (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL + xsltReleaseRVT (xsltTransformContextPtr ctxt, + xmlDocPtr RVT); +/* + * Extra functions for Attribute Value Templates + */ +XSLTPUBFUN void XSLTCALL + xsltCompileAttr (xsltStylesheetPtr style, + xmlAttrPtr attr); +XSLTPUBFUN xmlChar * XSLTCALL + xsltEvalAVT (xsltTransformContextPtr ctxt, + void *avt, + xmlNodePtr node); +XSLTPUBFUN void XSLTCALL + xsltFreeAVTList (void *avt); + +/* + * Extra function for successful xsltCleanupGlobals / xsltInit sequence. + */ + +XSLTPUBFUN void XSLTCALL + xsltUninit (void); + +/************************************************************************ + * * + * Compile-time functions for *internal* use only * + * * + ************************************************************************/ + +#ifdef XSLT_REFACTORED +XSLTPUBFUN void XSLTCALL + xsltParseSequenceConstructor( + xsltCompilerCtxtPtr cctxt, + xmlNodePtr start); +XSLTPUBFUN int XSLTCALL + xsltParseAnyXSLTElem (xsltCompilerCtxtPtr cctxt, + xmlNodePtr elem); +#ifdef XSLT_REFACTORED_XSLT_NSCOMP +XSLTPUBFUN int XSLTCALL + xsltRestoreDocumentNamespaces( + xsltNsMapPtr ns, + xmlDocPtr doc); +#endif +#endif /* XSLT_REFACTORED */ + +/************************************************************************ + * * + * Transformation-time functions for *internal* use only * + * * + ************************************************************************/ +XSLTPUBFUN int XSLTCALL + xsltInitCtxtKey (xsltTransformContextPtr ctxt, + xsltDocumentPtr doc, + xsltKeyDefPtr keyd); +XSLTPUBFUN int XSLTCALL + xsltInitAllDocKeys (xsltTransformContextPtr ctxt); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLT_H__ */ + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltconfig.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltconfig.h new file mode 100644 index 0000000..72e8b20 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltconfig.h @@ -0,0 +1,180 @@ +/* + * Summary: compile-time version information for the XSLT engine + * Description: compile-time version information for the XSLT engine + * this module is autogenerated. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLTCONFIG_H__ +#define __XML_XSLTCONFIG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * LIBXSLT_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXSLT_DOTTED_VERSION "1.1.34" + +/** + * LIBXSLT_VERSION: + * + * the version number: 1.2.3 value is 10203 + */ +#define LIBXSLT_VERSION 10134 + +/** + * LIBXSLT_VERSION_STRING: + * + * the version number string, 1.2.3 value is "10203" + */ +#define LIBXSLT_VERSION_STRING "10134" + +/** + * LIBXSLT_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXSLT_VERSION_EXTRA "" + +/** + * WITH_XSLT_DEBUG: + * + * Activate the compilation of the debug reporting. Speed penalty + * is insignifiant and being able to run xsltpoc -v is useful. On + * by default unless --without-debug is passed to configure + */ +#if 1 +#define WITH_XSLT_DEBUG +#endif + +#if 0 +/** + * DEBUG_MEMORY: + * + * should be activated only when debugging libxslt. It replaces the + * allocator with a collect and debug shell to the libc allocator. + * Use configure --with-mem-debug to activate it on both library + */ +#define DEBUG_MEMORY + +/** + * DEBUG_MEMORY_LOCATION: + * + * should be activated only when debugging libxslt. + * DEBUG_MEMORY_LOCATION should be activated only when libxml has + * been configured with --with-debug-mem too + */ +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * XSLT_NEED_TRIO: + * + * should be activated if the existing libc library lacks some of the + * string formatting function, in that case reuse the Trio ones already + * compiled in the libxml2 library. + */ + +#if 0 +#define XSLT_NEED_TRIO +#endif +#ifdef __VMS +#define HAVE_MATH_H 1 +#define HAVE_SYS_STAT_H 1 +#ifndef XSLT_NEED_TRIO +#define XSLT_NEED_TRIO +#endif +#endif + +#ifdef XSLT_NEED_TRIO +#define TRIO_REPLACE_STDIO +#endif + +/** + * WITH_XSLT_DEBUGGER: + * + * Activate the compilation of the debugger support. Speed penalty + * is insignifiant. + * On by default unless --without-debugger is passed to configure + */ +#if 1 +#ifndef WITH_DEBUGGER +#define WITH_DEBUGGER +#endif +#endif + +/** + * WITH_PROFILER: + * + * Activate the compilation of the profiler. Speed penalty + * is insignifiant. + * On by default unless --without-profiler is passed to configure + */ +#if 1 +#ifndef WITH_PROFILER +#define WITH_PROFILER +#endif +#endif + +/** + * WITH_MODULES: + * + * Whether module support is configured into libxslt + * Note: no default module path for win32 platforms + */ +#if 0 +#ifndef WITH_MODULES +#define WITH_MODULES +#endif +#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/x86-linux/libxslt/1.1.34/lib/libxslt-plugins" +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * This macro is used to flag unused function parameters to GCC + */ +#ifdef __GNUC__ +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif +#else +#define ATTRIBUTE_UNUSED +#endif + +/** + * LIBXSLT_ATTR_FORMAT: + * + * This macro is used to indicate to GCC the parameters are printf-like + */ +#ifdef __GNUC__ +#define LIBXSLT_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args))) +#else +#define LIBXSLT_ATTR_FORMAT(fmt,args) +#endif + +/** + * LIBXSLT_PUBLIC: + * + * This macro is used to declare PUBLIC variables for Cygwin and for MSC on Windows + */ +#if !defined LIBXSLT_PUBLIC +#if (defined(__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC +#define LIBXSLT_PUBLIC __declspec(dllimport) +#else +#define LIBXSLT_PUBLIC +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLTCONFIG_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltexports.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltexports.h new file mode 100644 index 0000000..99b6ac3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltexports.h @@ -0,0 +1,142 @@ +/* + * Summary: macros for marking symbols as exportable/importable. + * Description: macros for marking symbols as exportable/importable. + * + * Copy: See Copyright for the status of this software. + * + * Author: Igor Zlatkovic + */ + +#ifndef __XSLT_EXPORTS_H__ +#define __XSLT_EXPORTS_H__ + +/** + * XSLTPUBFUN: + * XSLTPUBFUN, XSLTPUBVAR, XSLTCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +/** + * XSLTPUBFUN: + * + * Macros which declare an exportable function + */ +#define XSLTPUBFUN +/** + * XSLTPUBVAR: + * + * Macros which declare an exportable variable + */ +#define XSLTPUBVAR extern +/** + * XSLTCALL: + * + * Macros which declare the called convention for exported functions + */ +#define XSLTCALL + +/** DOC_DISABLE */ + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR extern + #endif + #endif + #define XSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) extern + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR extern + #endif + #endif + #define XSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with GNU compiler (Mingw) */ +#if defined(_WIN32) && defined(__MINGW32__) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL +/* + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) +*/ + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) extern + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR extern + #endif + #endif + #define XSLTCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Cygwin platform (does not define _WIN32), GNU compiler */ +#if defined(__CYGWIN__) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR extern + #endif + #endif + #define XSLTCALL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBXSLT_PUBLIC) +#define LIBXSLT_PUBLIC XSLTPUBVAR +#endif + +#endif /* __XSLT_EXPORTS_H__ */ + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltlocale.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltlocale.h new file mode 100644 index 0000000..f3b9d6e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltlocale.h @@ -0,0 +1,76 @@ +/* + * Summary: Locale handling + * Description: Interfaces for locale handling. Needed for language dependent + * sorting. + * + * Copy: See Copyright for the status of this software. + * + * Author: Nick Wellnhofer + */ + +#ifndef __XML_XSLTLOCALE_H__ +#define __XML_XSLTLOCALE_H__ + +#include +#include "xsltexports.h" + +#ifdef HAVE_STRXFRM_L + +/* + * XSLT_LOCALE_POSIX: + * Macro indicating to use POSIX locale extensions + */ +#define XSLT_LOCALE_POSIX + +#ifdef HAVE_LOCALE_H +#include +#endif +#ifdef HAVE_XLOCALE_H +#include +#endif + +typedef locale_t xsltLocale; +typedef xmlChar xsltLocaleChar; + +#elif defined(_WIN32) && !defined(__CYGWIN__) + +/* + * XSLT_LOCALE_WINAPI: + * Macro indicating to use WinAPI for extended locale support + */ +#define XSLT_LOCALE_WINAPI + +#include +#include + +typedef LCID xsltLocale; +typedef wchar_t xsltLocaleChar; + +#else + +/* + * XSLT_LOCALE_NONE: + * Macro indicating that there's no extended locale support + */ +#define XSLT_LOCALE_NONE + +typedef void *xsltLocale; +typedef xmlChar xsltLocaleChar; + +#endif + +XSLTPUBFUN xsltLocale XSLTCALL + xsltNewLocale (const xmlChar *langName); +XSLTPUBFUN void XSLTCALL + xsltFreeLocale (xsltLocale locale); +XSLTPUBFUN xsltLocaleChar * XSLTCALL + xsltStrxfrm (xsltLocale locale, + const xmlChar *string); +XSLTPUBFUN int XSLTCALL + xsltLocaleStrcmp (xsltLocale locale, + const xsltLocaleChar *str1, + const xsltLocaleChar *str2); +XSLTPUBFUN void XSLTCALL + xsltFreeLocales (void); + +#endif /* __XML_XSLTLOCALE_H__ */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltutils.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltutils.h new file mode 100644 index 0000000..ea6c374 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/include/libxslt/xsltutils.h @@ -0,0 +1,313 @@ +/* + * Summary: set of utilities for the XSLT engine + * Description: interfaces for the utilities module of the XSLT engine. + * things like message handling, profiling, and other + * generally useful routines. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XSLTUTILS_H__ +#define __XML_XSLTUTILS_H__ + +#include +#ifdef HAVE_STDARG_H +#include +#endif +#include +#include +#include +#include "xsltexports.h" +#include "xsltInternals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XSLT_TODO: + * + * Macro to flag unimplemented blocks. + */ +#define XSLT_TODO \ + xsltGenericError(xsltGenericErrorContext, \ + "Unimplemented block at %s:%d\n", \ + __FILE__, __LINE__); + +/** + * XSLT_STRANGE: + * + * Macro to flag that a problem was detected internally. + */ +#define XSLT_STRANGE \ + xsltGenericError(xsltGenericErrorContext, \ + "Internal error at %s:%d\n", \ + __FILE__, __LINE__); + +/** + * IS_XSLT_ELEM: + * + * Checks that the element pertains to XSLT namespace. + */ +#define IS_XSLT_ELEM(n) \ + (((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \ + ((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE))) + +/** + * IS_XSLT_NAME: + * + * Checks the value of an element in XSLT namespace. + */ +#define IS_XSLT_NAME(n, val) \ + (xmlStrEqual((n)->name, (const xmlChar *) (val))) + +/** + * IS_XSLT_REAL_NODE: + * + * Check that a node is a 'real' one: document, element, text or attribute. + */ +#define IS_XSLT_REAL_NODE(n) \ + (((n) != NULL) && \ + (((n)->type == XML_ELEMENT_NODE) || \ + ((n)->type == XML_TEXT_NODE) || \ + ((n)->type == XML_CDATA_SECTION_NODE) || \ + ((n)->type == XML_ATTRIBUTE_NODE) || \ + ((n)->type == XML_DOCUMENT_NODE) || \ + ((n)->type == XML_HTML_DOCUMENT_NODE) || \ + ((n)->type == XML_COMMENT_NODE) || \ + ((n)->type == XML_PI_NODE))) + +/* + * Our own version of namespaced attributes lookup. + */ +XSLTPUBFUN xmlChar * XSLTCALL + xsltGetNsProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XSLTPUBFUN const xmlChar * XSLTCALL + xsltGetCNsProp (xsltStylesheetPtr style, + xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XSLTPUBFUN int XSLTCALL + xsltGetUTF8Char (const unsigned char *utf, + int *len); + +/* + * XSLT Debug Tracing Tracing Types + */ +typedef enum { + XSLT_TRACE_ALL = -1, + XSLT_TRACE_NONE = 0, + XSLT_TRACE_COPY_TEXT = 1<<0, + XSLT_TRACE_PROCESS_NODE = 1<<1, + XSLT_TRACE_APPLY_TEMPLATE = 1<<2, + XSLT_TRACE_COPY = 1<<3, + XSLT_TRACE_COMMENT = 1<<4, + XSLT_TRACE_PI = 1<<5, + XSLT_TRACE_COPY_OF = 1<<6, + XSLT_TRACE_VALUE_OF = 1<<7, + XSLT_TRACE_CALL_TEMPLATE = 1<<8, + XSLT_TRACE_APPLY_TEMPLATES = 1<<9, + XSLT_TRACE_CHOOSE = 1<<10, + XSLT_TRACE_IF = 1<<11, + XSLT_TRACE_FOR_EACH = 1<<12, + XSLT_TRACE_STRIP_SPACES = 1<<13, + XSLT_TRACE_TEMPLATES = 1<<14, + XSLT_TRACE_KEYS = 1<<15, + XSLT_TRACE_VARIABLES = 1<<16 +} xsltDebugTraceCodes; + +/** + * XSLT_TRACE: + * + * Control the type of xsl debugtrace messages emitted. + */ +#define XSLT_TRACE(ctxt,code,call) \ + if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \ + call + +XSLTPUBFUN void XSLTCALL + xsltDebugSetDefaultTrace(xsltDebugTraceCodes val); +XSLTPUBFUN xsltDebugTraceCodes XSLTCALL + xsltDebugGetDefaultTrace(void); + +/* + * XSLT specific error and debug reporting functions. + */ +XSLTPUBVAR xmlGenericErrorFunc xsltGenericError; +XSLTPUBVAR void *xsltGenericErrorContext; +XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug; +XSLTPUBVAR void *xsltGenericDebugContext; + +XSLTPUBFUN void XSLTCALL + xsltPrintErrorContext (xsltTransformContextPtr ctxt, + xsltStylesheetPtr style, + xmlNodePtr node); +XSLTPUBFUN void XSLTCALL + xsltMessage (xsltTransformContextPtr ctxt, + xmlNodePtr node, + xmlNodePtr inst); +XSLTPUBFUN void XSLTCALL + xsltSetGenericErrorFunc (void *ctx, + xmlGenericErrorFunc handler); +XSLTPUBFUN void XSLTCALL + xsltSetGenericDebugFunc (void *ctx, + xmlGenericErrorFunc handler); +XSLTPUBFUN void XSLTCALL + xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, + void *ctx, + xmlGenericErrorFunc handler); +XSLTPUBFUN void XSLTCALL + xsltTransformError (xsltTransformContextPtr ctxt, + xsltStylesheetPtr style, + xmlNodePtr node, + const char *msg, + ...) LIBXSLT_ATTR_FORMAT(4,5); + +XSLTPUBFUN int XSLTCALL + xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt, + int options); +/* + * Sorting. + */ + +XSLTPUBFUN void XSLTCALL + xsltDocumentSortFunction (xmlNodeSetPtr list); +XSLTPUBFUN void XSLTCALL + xsltSetSortFunc (xsltSortFunc handler); +XSLTPUBFUN void XSLTCALL + xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, + xsltSortFunc handler); +XSLTPUBFUN void XSLTCALL + xsltDefaultSortFunction (xsltTransformContextPtr ctxt, + xmlNodePtr *sorts, + int nbsorts); +XSLTPUBFUN void XSLTCALL + xsltDoSortFunction (xsltTransformContextPtr ctxt, + xmlNodePtr * sorts, + int nbsorts); +XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL + xsltComputeSortResult (xsltTransformContextPtr ctxt, + xmlNodePtr sort); + +/* + * QNames handling. + */ + +XSLTPUBFUN const xmlChar * XSLTCALL + xsltSplitQName (xmlDictPtr dict, + const xmlChar *name, + const xmlChar **prefix); +XSLTPUBFUN const xmlChar * XSLTCALL + xsltGetQNameURI (xmlNodePtr node, + xmlChar **name); + +XSLTPUBFUN const xmlChar * XSLTCALL + xsltGetQNameURI2 (xsltStylesheetPtr style, + xmlNodePtr node, + const xmlChar **name); + +/* + * Output, reuse libxml I/O buffers. + */ +XSLTPUBFUN int XSLTCALL + xsltSaveResultTo (xmlOutputBufferPtr buf, + xmlDocPtr result, + xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltSaveResultToFilename (const char *URI, + xmlDocPtr result, + xsltStylesheetPtr style, + int compression); +XSLTPUBFUN int XSLTCALL + xsltSaveResultToFile (FILE *file, + xmlDocPtr result, + xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltSaveResultToFd (int fd, + xmlDocPtr result, + xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL + xsltSaveResultToString (xmlChar **doc_txt_ptr, + int * doc_txt_len, + xmlDocPtr result, + xsltStylesheetPtr style); + +/* + * XPath interface + */ +XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL + xsltXPathCompile (xsltStylesheetPtr style, + const xmlChar *str); +XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL + xsltXPathCompileFlags (xsltStylesheetPtr style, + const xmlChar *str, + int flags); + +/* + * Profiling. + */ +XSLTPUBFUN void XSLTCALL + xsltSaveProfiling (xsltTransformContextPtr ctxt, + FILE *output); +XSLTPUBFUN xmlDocPtr XSLTCALL + xsltGetProfileInformation (xsltTransformContextPtr ctxt); + +XSLTPUBFUN long XSLTCALL + xsltTimestamp (void); +XSLTPUBFUN void XSLTCALL + xsltCalibrateAdjust (long delta); + +/** + * XSLT_TIMESTAMP_TICS_PER_SEC: + * + * Sampling precision for profiling + */ +#define XSLT_TIMESTAMP_TICS_PER_SEC 100000l + +/* + * Hooks for the debugger. + */ + +typedef enum { + XSLT_DEBUG_NONE = 0, /* no debugging allowed */ + XSLT_DEBUG_INIT, + XSLT_DEBUG_STEP, + XSLT_DEBUG_STEPOUT, + XSLT_DEBUG_NEXT, + XSLT_DEBUG_STOP, + XSLT_DEBUG_CONT, + XSLT_DEBUG_RUN, + XSLT_DEBUG_RUN_RESTART, + XSLT_DEBUG_QUIT +} xsltDebugStatusCodes; + +XSLTPUBVAR int xslDebugStatus; + +typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node, + xsltTemplatePtr templ, xsltTransformContextPtr ctxt); +typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source); +typedef void (*xsltDropCallCallback) (void); + +XSLTPUBFUN void XSLTCALL + xsltSetDebuggerStatus (int value); +XSLTPUBFUN int XSLTCALL + xsltGetDebuggerStatus (void); +XSLTPUBFUN int XSLTCALL + xsltSetDebuggerCallbacks (int no, void *block); +XSLTPUBFUN int XSLTCALL + xslAddCall (xsltTemplatePtr templ, + xmlNodePtr source); +XSLTPUBFUN void XSLTCALL + xslDropCall (void); + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XSLTUTILS_H__ */ + + diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/libxml2_backwards_compat.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/libxml2_backwards_compat.c new file mode 100644 index 0000000..f5255cb --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/libxml2_backwards_compat.c @@ -0,0 +1,121 @@ +#ifndef HAVE_XMLFIRSTELEMENTCHILD +#include +/** + * xmlFirstElementChild: + * @parent: the parent node + * + * Finds the first child node of that element which is a Element node + * Note the handling of entities references is different than in + * the W3C DOM element traversal spec since we don't have back reference + * from entities content to entities references. + * + * Returns the first element child or NULL if not available + */ +xmlNodePtr +xmlFirstElementChild(xmlNodePtr parent) +{ + xmlNodePtr cur = NULL; + + if (parent == NULL) { + return (NULL); + } + switch (parent->type) { + case XML_ELEMENT_NODE: + case XML_ENTITY_NODE: + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: + cur = parent->children; + break; + default: + return (NULL); + } + while (cur != NULL) { + if (cur->type == XML_ELEMENT_NODE) { + return (cur); + } + cur = cur->next; + } + return (NULL); +} + +/** + * xmlNextElementSibling: + * @node: the current node + * + * Finds the first closest next sibling of the node which is an + * element node. + * Note the handling of entities references is different than in + * the W3C DOM element traversal spec since we don't have back reference + * from entities content to entities references. + * + * Returns the next element sibling or NULL if not available + */ +xmlNodePtr +xmlNextElementSibling(xmlNodePtr node) +{ + if (node == NULL) { + return (NULL); + } + switch (node->type) { + case XML_ELEMENT_NODE: + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_ENTITY_REF_NODE: + case XML_ENTITY_NODE: + case XML_PI_NODE: + case XML_COMMENT_NODE: + case XML_DTD_NODE: + case XML_XINCLUDE_START: + case XML_XINCLUDE_END: + node = node->next; + break; + default: + return (NULL); + } + while (node != NULL) { + if (node->type == XML_ELEMENT_NODE) { + return (node); + } + node = node->next; + } + return (NULL); +} + +/** + * xmlLastElementChild: + * @parent: the parent node + * + * Finds the last child node of that element which is a Element node + * Note the handling of entities references is different than in + * the W3C DOM element traversal spec since we don't have back reference + * from entities content to entities references. + * + * Returns the last element child or NULL if not available + */ +xmlNodePtr +xmlLastElementChild(xmlNodePtr parent) +{ + xmlNodePtr cur = NULL; + + if (parent == NULL) { + return (NULL); + } + switch (parent->type) { + case XML_ELEMENT_NODE: + case XML_ENTITY_NODE: + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: + cur = parent->last; + break; + default: + return (NULL); + } + while (cur != NULL) { + if (cur->type == XML_ELEMENT_NODE) { + return (cur); + } + cur = cur->prev; + } + return (NULL); +} +#endif diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.c new file mode 100644 index 0000000..b82329c --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.c @@ -0,0 +1,278 @@ +#include + +VALUE mNokogiri ; +VALUE mNokogiriGumbo ; +VALUE mNokogiriHtml4 ; +VALUE mNokogiriHtml4Sax ; +VALUE mNokogiriHtml5 ; +VALUE mNokogiriXml ; +VALUE mNokogiriXmlSax ; +VALUE mNokogiriXmlXpath ; +VALUE mNokogiriXslt ; + +VALUE cNokogiriSyntaxError; +VALUE cNokogiriXmlCharacterData; +VALUE cNokogiriXmlElement; +VALUE cNokogiriXmlXpathSyntaxError; + +void noko_init_xml_attr(void); +void noko_init_xml_attribute_decl(void); +void noko_init_xml_cdata(void); +void noko_init_xml_comment(void); +void noko_init_xml_document(void); +void noko_init_xml_document_fragment(void); +void noko_init_xml_dtd(void); +void noko_init_xml_element_content(void); +void noko_init_xml_element_decl(void); +void noko_init_xml_encoding_handler(void); +void noko_init_xml_entity_decl(void); +void noko_init_xml_entity_reference(void); +void noko_init_xml_namespace(void); +void noko_init_xml_node(void); +void noko_init_xml_node_set(void); +void noko_init_xml_processing_instruction(void); +void noko_init_xml_reader(void); +void noko_init_xml_relax_ng(void); +void noko_init_xml_sax_parser(void); +void noko_init_xml_sax_parser_context(void); +void noko_init_xml_sax_push_parser(void); +void noko_init_xml_schema(void); +void noko_init_xml_syntax_error(void); +void noko_init_xml_text(void); +void noko_init_xml_xpath_context(void); +void noko_init_xslt_stylesheet(void); +void noko_init_html_document(void); +void noko_init_html_element_description(void); +void noko_init_html_entity_lookup(void); +void noko_init_html_sax_parser_context(void); +void noko_init_html_sax_push_parser(void); +void noko_init_gumbo(void); +void noko_init_test_global_handlers(void); + +static ID id_read, id_write; + + +#ifndef HAVE_VASPRINTF +/* + * Thank you Geoffroy Couprie for this implementation of vasprintf! + */ +int +vasprintf(char **strp, const char *fmt, va_list ap) +{ + /* Mingw32/64 have a broken vsnprintf implementation that fails when + * using a zero-byte limit in order to retrieve the required size for malloc. + * So we use a one byte buffer instead. + */ + char tmp[1]; + int len = vsnprintf(tmp, 1, fmt, ap) + 1; + char *res = (char *)malloc((unsigned int)len); + if (res == NULL) { + return -1; + } + *strp = res; + return vsnprintf(res, (unsigned int)len, fmt, ap); +} +#endif + + +static VALUE +read_check(VALUE val) +{ + VALUE *args = (VALUE *)val; + return rb_funcall(args[0], id_read, 1, args[1]); +} + + +static VALUE +read_failed(VALUE arg, VALUE exc) +{ + return Qundef; +} + + +int +noko_io_read(void *ctx, char *buffer, int len) +{ + VALUE string, args[2]; + size_t str_len, safe_len; + + args[0] = (VALUE)ctx; + args[1] = INT2NUM(len); + + string = rb_rescue(read_check, (VALUE)args, read_failed, 0); + + if (NIL_P(string)) { return 0; } + if (string == Qundef) { return -1; } + if (TYPE(string) != T_STRING) { return -1; } + + str_len = (size_t)RSTRING_LEN(string); + safe_len = str_len > (size_t)len ? (size_t)len : str_len; + memcpy(buffer, StringValuePtr(string), safe_len); + + return (int)safe_len; +} + + +static VALUE +write_check(VALUE val) +{ + VALUE *args = (VALUE *)val; + return rb_funcall(args[0], id_write, 1, args[1]); +} + + +static VALUE +write_failed(VALUE arg, VALUE exc) +{ + return Qundef; +} + + +int +noko_io_write(void *ctx, char *buffer, int len) +{ + VALUE args[2], size; + + args[0] = (VALUE)ctx; + args[1] = rb_str_new(buffer, (long)len); + + size = rb_rescue(write_check, (VALUE)args, write_failed, 0); + + if (size == Qundef) { return -1; } + + return NUM2INT(size); +} + + +int +noko_io_close(void *ctx) +{ + return 0; +} + + +void +Init_nokogiri() +{ + mNokogiri = rb_define_module("Nokogiri"); + mNokogiriGumbo = rb_define_module_under(mNokogiri, "Gumbo"); + mNokogiriHtml4 = rb_define_module_under(mNokogiri, "HTML4"); + mNokogiriHtml4Sax = rb_define_module_under(mNokogiriHtml4, "SAX"); + mNokogiriHtml5 = rb_define_module_under(mNokogiri, "HTML5"); + mNokogiriXml = rb_define_module_under(mNokogiri, "XML"); + mNokogiriXmlSax = rb_define_module_under(mNokogiriXml, "SAX"); + mNokogiriXmlXpath = rb_define_module_under(mNokogiriXml, "XPath"); + mNokogiriXslt = rb_define_module_under(mNokogiri, "XSLT"); + + rb_const_set(mNokogiri, rb_intern("LIBXML_COMPILED_VERSION"), NOKOGIRI_STR_NEW2(LIBXML_DOTTED_VERSION)); + rb_const_set(mNokogiri, rb_intern("LIBXML_LOADED_VERSION"), NOKOGIRI_STR_NEW2(xmlParserVersion)); + + rb_const_set(mNokogiri, rb_intern("LIBXSLT_COMPILED_VERSION"), NOKOGIRI_STR_NEW2(LIBXSLT_DOTTED_VERSION)); + rb_const_set(mNokogiri, rb_intern("LIBXSLT_LOADED_VERSION"), NOKOGIRI_STR_NEW2(xsltEngineVersion)); + +#ifdef NOKOGIRI_PACKAGED_LIBRARIES + rb_const_set(mNokogiri, rb_intern("PACKAGED_LIBRARIES"), Qtrue); +# ifdef NOKOGIRI_PRECOMPILED_LIBRARIES + rb_const_set(mNokogiri, rb_intern("PRECOMPILED_LIBRARIES"), Qtrue); +# else + rb_const_set(mNokogiri, rb_intern("PRECOMPILED_LIBRARIES"), Qfalse); +# endif + rb_const_set(mNokogiri, rb_intern("LIBXML2_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATCHES), " ")); + rb_const_set(mNokogiri, rb_intern("LIBXSLT_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATCHES), " ")); +#else + rb_const_set(mNokogiri, rb_intern("PACKAGED_LIBRARIES"), Qfalse); + rb_const_set(mNokogiri, rb_intern("PRECOMPILED_LIBRARIES"), Qfalse); + rb_const_set(mNokogiri, rb_intern("LIBXML2_PATCHES"), Qnil); + rb_const_set(mNokogiri, rb_intern("LIBXSLT_PATCHES"), Qnil); +#endif + +#ifdef LIBXML_ICONV_ENABLED + rb_const_set(mNokogiri, rb_intern("LIBXML_ICONV_ENABLED"), Qtrue); +#else + rb_const_set(mNokogiri, rb_intern("LIBXML_ICONV_ENABLED"), Qfalse); +#endif + +#ifdef NOKOGIRI_OTHER_LIBRARY_VERSIONS + rb_const_set(mNokogiri, rb_intern("OTHER_LIBRARY_VERSIONS"), NOKOGIRI_STR_NEW2(NOKOGIRI_OTHER_LIBRARY_VERSIONS)); +#endif + +#if defined(_WIN32) && !defined(NOKOGIRI_PACKAGED_LIBRARIES) + /* + * We choose *not* to do use Ruby's memory management functions with windows DLLs because of this + * issue in libxml 2.9.12: + * + * https://github.com/sparklemotion/nokogiri/issues/2241 + * + * If the atexit() issue gets fixed in a future version of libxml2, then we may be able to skip + * this config only for the specific libxml2 versions 2.9.12. + * + * Alternatively, now that Ruby has a generational GC, it might be OK to let libxml2 use its + * default memory management functions (recall that this config was introduced to reduce memory + * bloat and allow Ruby to GC more often); but we should *really* test with production workloads + * before making that kind of a potentially-invasive change. + */ + rb_const_set(mNokogiri, rb_intern("LIBXML_MEMORY_MANAGEMENT"), NOKOGIRI_STR_NEW2("default")); +#else + rb_const_set(mNokogiri, rb_intern("LIBXML_MEMORY_MANAGEMENT"), NOKOGIRI_STR_NEW2("ruby")); + xmlMemSetup((xmlFreeFunc)ruby_xfree, (xmlMallocFunc)ruby_xmalloc, (xmlReallocFunc)ruby_xrealloc, ruby_strdup); +#endif + + xmlInitParser(); + exsltRegisterAll(); + + if (xsltExtModuleFunctionLookup((const xmlChar *)"date-time", EXSLT_DATE_NAMESPACE)) { + rb_const_set(mNokogiri, rb_intern("LIBXSLT_DATETIME_ENABLED"), Qtrue); + } else { + rb_const_set(mNokogiri, rb_intern("LIBXSLT_DATETIME_ENABLED"), Qfalse); + } + + cNokogiriSyntaxError = rb_define_class_under(mNokogiri, "SyntaxError", rb_eStandardError); + noko_init_xml_syntax_error(); + assert(cNokogiriXmlSyntaxError); + cNokogiriXmlXpathSyntaxError = rb_define_class_under(mNokogiriXmlXpath, "SyntaxError", cNokogiriXmlSyntaxError); + + noko_init_xml_element_content(); + noko_init_xml_encoding_handler(); + noko_init_xml_namespace(); + noko_init_xml_node_set(); + noko_init_xml_reader(); + noko_init_xml_sax_parser(); + noko_init_xml_xpath_context(); + noko_init_xslt_stylesheet(); + noko_init_html_element_description(); + noko_init_html_entity_lookup(); + + noko_init_xml_schema(); + noko_init_xml_relax_ng(); + + noko_init_xml_sax_parser_context(); + noko_init_html_sax_parser_context(); + + noko_init_xml_sax_push_parser(); + noko_init_html_sax_push_parser(); + + noko_init_xml_node(); + noko_init_xml_attr(); + noko_init_xml_attribute_decl(); + noko_init_xml_dtd(); + noko_init_xml_element_decl(); + noko_init_xml_entity_decl(); + noko_init_xml_entity_reference(); + noko_init_xml_processing_instruction(); + assert(cNokogiriXmlNode); + cNokogiriXmlElement = rb_define_class_under(mNokogiriXml, "Element", cNokogiriXmlNode); + cNokogiriXmlCharacterData = rb_define_class_under(mNokogiriXml, "CharacterData", cNokogiriXmlNode); + noko_init_xml_comment(); + noko_init_xml_text(); + noko_init_xml_cdata(); + + noko_init_xml_document_fragment(); + noko_init_xml_document(); + noko_init_html_document(); + noko_init_gumbo(); + + noko_init_test_global_handlers(); + + id_read = rb_intern("read"); + id_write = rb_intern("write"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.h b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.h new file mode 100644 index 0000000..ba3d6d9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/nokogiri.h @@ -0,0 +1,223 @@ +#ifndef NOKOGIRI_NATIVE +#define NOKOGIRI_NATIVE + +#ifdef _MSC_VER +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif /* WIN32_LEAN_AND_MEAN */ + +# ifndef WIN32 +# define WIN32 +# endif /* WIN32 */ + +# include +# include +# include +#endif + +#ifdef _WIN32 +# define NOKOPUBFUN __declspec(dllexport) +# define NOKOPUBVAR __declspec(dllexport) extern +#else +# define NOKOPUBFUN +# define NOKOPUBVAR extern +#endif + + +#include +#include +#include +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +/* libxml2_backwards_compat.c */ +#ifndef HAVE_XMLFIRSTELEMENTCHILD +xmlNodePtr xmlFirstElementChild(xmlNodePtr parent); +xmlNodePtr xmlNextElementSibling(xmlNodePtr node); +xmlNodePtr xmlLastElementChild(xmlNodePtr parent); +#endif + +#define XMLNS_PREFIX "xmlns" +#define XMLNS_PREFIX_LEN 6 /* including either colon or \0 */ + + +#include +#include +#include +#include +#include + +#define NOKOGIRI_STR_NEW2(str) NOKOGIRI_STR_NEW(str, strlen((const char *)(str))) +#define NOKOGIRI_STR_NEW(str, len) rb_external_str_new_with_enc((const char *)(str), (long)(len), rb_utf8_encoding()) +#define RBSTR_OR_QNIL(_str) (_str ? NOKOGIRI_STR_NEW2(_str) : Qnil) + +#ifdef DEBUG +# define NOKOGIRI_DEBUG_START(p) if (getenv("NOKOGIRI_NO_FREE")) return ; if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p start\n", __FILE__, __LINE__, p); +# define NOKOGIRI_DEBUG_END(p) if (getenv("NOKOGIRI_DEBUG")) fprintf(stderr,"nokogiri: %s:%d %p end\n", __FILE__, __LINE__, p); +#else +# define NOKOGIRI_DEBUG_START(p) +# define NOKOGIRI_DEBUG_END(p) +#endif + +#ifndef NORETURN +# if defined(__GNUC__) +# define NORETURN(name) __attribute__((noreturn)) name +# else +# define NORETURN(name) name +# endif +#endif + + +NOKOPUBVAR VALUE mNokogiri ; +NOKOPUBVAR VALUE mNokogiriGumbo ; +NOKOPUBVAR VALUE mNokogiriHtml4 ; +NOKOPUBVAR VALUE mNokogiriHtml4Sax ; +NOKOPUBVAR VALUE mNokogiriHtml5 ; +NOKOPUBVAR VALUE mNokogiriXml ; +NOKOPUBVAR VALUE mNokogiriXmlSax ; +NOKOPUBVAR VALUE mNokogiriXmlXpath ; +NOKOPUBVAR VALUE mNokogiriXslt ; + +NOKOPUBVAR VALUE cNokogiriEncodingHandler; +NOKOPUBVAR VALUE cNokogiriSyntaxError; +NOKOPUBVAR VALUE cNokogiriXmlAttr; +NOKOPUBVAR VALUE cNokogiriXmlAttributeDecl; +NOKOPUBVAR VALUE cNokogiriXmlCData; +NOKOPUBVAR VALUE cNokogiriXmlCharacterData; +NOKOPUBVAR VALUE cNokogiriXmlComment; +NOKOPUBVAR VALUE cNokogiriXmlDocument ; +NOKOPUBVAR VALUE cNokogiriXmlDocumentFragment; +NOKOPUBVAR VALUE cNokogiriXmlDtd; +NOKOPUBVAR VALUE cNokogiriXmlElement ; +NOKOPUBVAR VALUE cNokogiriXmlElementContent; +NOKOPUBVAR VALUE cNokogiriXmlElementDecl; +NOKOPUBVAR VALUE cNokogiriXmlEntityDecl; +NOKOPUBVAR VALUE cNokogiriXmlEntityReference; +NOKOPUBVAR VALUE cNokogiriXmlNamespace ; +NOKOPUBVAR VALUE cNokogiriXmlNode ; +NOKOPUBVAR VALUE cNokogiriXmlNodeSet ; +NOKOPUBVAR VALUE cNokogiriXmlProcessingInstruction; +NOKOPUBVAR VALUE cNokogiriXmlReader; +NOKOPUBVAR VALUE cNokogiriXmlRelaxNG; +NOKOPUBVAR VALUE cNokogiriXmlSaxParser ; +NOKOPUBVAR VALUE cNokogiriXmlSaxParserContext; +NOKOPUBVAR VALUE cNokogiriXmlSaxPushParser ; +NOKOPUBVAR VALUE cNokogiriXmlSchema; +NOKOPUBVAR VALUE cNokogiriXmlSyntaxError; +NOKOPUBVAR VALUE cNokogiriXmlText ; +NOKOPUBVAR VALUE cNokogiriXmlXpathContext; +NOKOPUBVAR VALUE cNokogiriXmlXpathSyntaxError; +NOKOPUBVAR VALUE cNokogiriXsltStylesheet ; + +NOKOPUBVAR VALUE cNokogiriHtml4Document ; +NOKOPUBVAR VALUE cNokogiriHtml4SaxPushParser ; +NOKOPUBVAR VALUE cNokogiriHtml4ElementDescription ; +NOKOPUBVAR VALUE cNokogiriHtml4SaxParserContext; +NOKOPUBVAR VALUE cNokogiriHtml5Document ; + +typedef struct _nokogiriTuple { + VALUE doc; + st_table *unlinkedNodes; + VALUE node_cache; +} nokogiriTuple; +typedef nokogiriTuple *nokogiriTuplePtr; + +typedef struct _nokogiriSAXTuple { + xmlParserCtxtPtr ctxt; + VALUE self; +} nokogiriSAXTuple; +typedef nokogiriSAXTuple *nokogiriSAXTuplePtr; + +typedef struct _libxmlStructuredErrorHandlerState { + void *user_data; + xmlStructuredErrorFunc handler; +} libxmlStructuredErrorHandlerState ; + +typedef struct _nokogiriXsltStylesheetTuple { + xsltStylesheetPtr ss; + VALUE func_instances; +} nokogiriXsltStylesheetTuple; + +int vasprintf(char **strp, const char *fmt, va_list ap); +void noko_xml_document_pin_node(xmlNodePtr); +void noko_xml_document_pin_namespace(xmlNsPtr, xmlDocPtr); + +int noko_io_read(void *ctx, char *buffer, int len); +int noko_io_write(void *ctx, char *buffer, int len); +int noko_io_close(void *ctx); + +VALUE noko_xml_node_wrap(VALUE klass, xmlNodePtr node) ; +VALUE noko_xml_node_wrap_node_set_result(xmlNodePtr node, VALUE node_set) ; +VALUE noko_xml_node_attrs(xmlNodePtr node) ; + +VALUE noko_xml_namespace_wrap(xmlNsPtr node, xmlDocPtr doc); +VALUE noko_xml_namespace_wrap_xpath_copy(xmlNsPtr node); + +VALUE noko_xml_element_content_wrap(VALUE doc, xmlElementContentPtr element); + +VALUE noko_xml_node_set_wrap(xmlNodeSetPtr node_set, VALUE document) ; + +VALUE noko_xml_document_wrap_with_init_args(VALUE klass, xmlDocPtr doc, int argc, VALUE *argv); +VALUE noko_xml_document_wrap(VALUE klass, xmlDocPtr doc); +NOKOPUBFUN VALUE Nokogiri_wrap_xml_document(VALUE klass, + xmlDocPtr doc); /* deprecated. use noko_xml_document_wrap() instead. */ + +#define DOC_RUBY_OBJECT_TEST(x) ((nokogiriTuplePtr)(x->_private)) +#define DOC_RUBY_OBJECT(x) (((nokogiriTuplePtr)(x->_private))->doc) +#define DOC_UNLINKED_NODE_HASH(x) (((nokogiriTuplePtr)(x->_private))->unlinkedNodes) +#define DOC_NODE_CACHE(x) (((nokogiriTuplePtr)(x->_private))->node_cache) +#define NOKOGIRI_NAMESPACE_EH(node) ((node)->type == XML_NAMESPACE_DECL) + +#define NOKOGIRI_SAX_SELF(_ctxt) ((nokogiriSAXTuplePtr)(_ctxt))->self +#define NOKOGIRI_SAX_CTXT(_ctxt) ((nokogiriSAXTuplePtr)(_ctxt))->ctxt +#define NOKOGIRI_SAX_TUPLE_NEW(_ctxt, _self) nokogiri_sax_tuple_new(_ctxt, _self) +#define NOKOGIRI_SAX_TUPLE_DESTROY(_tuple) free(_tuple) + +#define DISCARD_CONST_QUAL(t, v) ((t)(uintptr_t)(v)) +#define DISCARD_CONST_QUAL_XMLCHAR(v) DISCARD_CONST_QUAL(xmlChar *, v) + +void Nokogiri_structured_error_func_save(libxmlStructuredErrorHandlerState *handler_state); +void Nokogiri_structured_error_func_save_and_set(libxmlStructuredErrorHandlerState *handler_state, void *user_data, + xmlStructuredErrorFunc handler); +void Nokogiri_structured_error_func_restore(libxmlStructuredErrorHandlerState *handler_state); +VALUE Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error); +void Nokogiri_error_array_pusher(void *ctx, xmlErrorPtr error); +NORETURN(void Nokogiri_error_raise(void *ctx, xmlErrorPtr error)); +void Nokogiri_marshal_xpath_funcall_and_return_values(xmlXPathParserContextPtr ctx, int nargs, VALUE handler, + const char *function_name) ; + +static inline +nokogiriSAXTuplePtr +nokogiri_sax_tuple_new(xmlParserCtxtPtr ctxt, VALUE self) +{ + nokogiriSAXTuplePtr tuple = malloc(sizeof(nokogiriSAXTuple)); + tuple->self = self; + tuple->ctxt = ctxt; + return tuple; +} + +#endif /* NOKOGIRI_NATIVE */ diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/test_global_handlers.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/test_global_handlers.c new file mode 100644 index 0000000..012bf74 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/test_global_handlers.c @@ -0,0 +1,40 @@ +#include + +static VALUE foreign_error_handler_block = Qnil; + +static void +foreign_error_handler(void *user_data, xmlErrorPtr c_error) +{ + rb_funcall(foreign_error_handler_block, rb_intern("call"), 0); +} + +/* + * call-seq: + * __foreign_error_handler { ... } -> nil + * + * Override libxml2's global error handlers to call the block. This method thus has very little + * value except to test that Nokogiri is properly setting error handlers elsewhere in the code. See + * test/helper.rb for how this is being used. + */ +static VALUE +rb_foreign_error_handler(VALUE klass) +{ + rb_need_block(); + foreign_error_handler_block = rb_block_proc(); + xmlSetStructuredErrorFunc(NULL, foreign_error_handler); + return Qnil; +} + +/* + * Document-module: Nokogiri::Test + * + * The Nokogiri::Test module should only be used for testing Nokogiri. + * Do NOT use this outside of the Nokogiri test suite. + */ +void +noko_init_test_global_handlers() +{ + VALUE mNokogiriTest = rb_define_module_under(mNokogiri, "Test"); + + rb_define_singleton_method(mNokogiriTest, "__foreign_error_handler", rb_foreign_error_handler, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attr.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attr.c new file mode 100644 index 0000000..63e5498 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attr.c @@ -0,0 +1,103 @@ +#include + +VALUE cNokogiriXmlAttr; + +/* + * call-seq: + * value=(content) + * + * Set the value for this Attr to +content+. Use `nil` to remove the value + * (e.g., a HTML boolean attribute). + */ +static VALUE +set_value(VALUE self, VALUE content) +{ + xmlAttrPtr attr; + xmlChar *value; + xmlNode *cur; + + Data_Get_Struct(self, xmlAttr, attr); + + if (attr->children) { + xmlFreeNodeList(attr->children); + } + attr->children = attr->last = NULL; + + if (content == Qnil) { + return content; + } + + value = xmlEncodeEntitiesReentrant(attr->doc, (unsigned char *)StringValueCStr(content)); + if (xmlStrlen(value) == 0) { + attr->children = xmlNewDocText(attr->doc, value); + } else { + attr->children = xmlStringGetNodeList(attr->doc, value); + } + xmlFree(value); + + for (cur = attr->children; cur; cur = cur->next) { + cur->parent = (xmlNode *)attr; + cur->doc = attr->doc; + if (cur->next == NULL) { + attr->last = cur; + } + } + + return content; +} + +/* + * call-seq: + * new(document, name) + * + * Create a new Attr element on the +document+ with +name+ + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + VALUE document; + VALUE name; + VALUE rest; + xmlAttrPtr node; + VALUE rb_node; + + rb_scan_args(argc, argv, "2*", &document, &name, &rest); + + if (! rb_obj_is_kind_of(document, cNokogiriXmlDocument)) { + rb_raise(rb_eArgError, "parameter must be a Nokogiri::XML::Document"); + } + + Data_Get_Struct(document, xmlDoc, xml_doc); + + node = xmlNewDocProp( + xml_doc, + (const xmlChar *)StringValueCStr(name), + NULL + ); + + noko_xml_document_pin_node((xmlNodePtr)node); + + rb_node = noko_xml_node_wrap(klass, (xmlNodePtr)node); + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { + rb_yield(rb_node); + } + + return rb_node; +} + +void +noko_init_xml_attr() +{ + assert(cNokogiriXmlNode); + /* + * Attr represents a Attr node in an xml document. + */ + cNokogiriXmlAttr = rb_define_class_under(mNokogiriXml, "Attr", cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlAttr, "new", new, -1); + + rb_define_method(cNokogiriXmlAttr, "value=", set_value, 1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attribute_decl.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attribute_decl.c new file mode 100644 index 0000000..8603ff9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_attribute_decl.c @@ -0,0 +1,70 @@ +#include + +VALUE cNokogiriXmlAttributeDecl; + +/* + * call-seq: + * attribute_type + * + * The attribute_type for this AttributeDecl + */ +static VALUE +attribute_type(VALUE self) +{ + xmlAttributePtr node; + Data_Get_Struct(self, xmlAttribute, node); + return INT2NUM((long)node->atype); +} + +/* + * call-seq: + * default + * + * The default value + */ +static VALUE +default_value(VALUE self) +{ + xmlAttributePtr node; + Data_Get_Struct(self, xmlAttribute, node); + + if (node->defaultValue) { return NOKOGIRI_STR_NEW2(node->defaultValue); } + return Qnil; +} + +/* + * call-seq: + * enumeration + * + * An enumeration of possible values + */ +static VALUE +enumeration(VALUE self) +{ + xmlAttributePtr node; + xmlEnumerationPtr enm; + VALUE list; + + Data_Get_Struct(self, xmlAttribute, node); + + list = rb_ary_new(); + enm = node->tree; + + while (enm) { + rb_ary_push(list, NOKOGIRI_STR_NEW2(enm->name)); + enm = enm->next; + } + + return list; +} + +void +noko_init_xml_attribute_decl() +{ + assert(cNokogiriXmlNode); + cNokogiriXmlAttributeDecl = rb_define_class_under(mNokogiriXml, "AttributeDecl", cNokogiriXmlNode); + + rb_define_method(cNokogiriXmlAttributeDecl, "attribute_type", attribute_type, 0); + rb_define_method(cNokogiriXmlAttributeDecl, "default", default_value, 0); + rb_define_method(cNokogiriXmlAttributeDecl, "enumeration", enumeration, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_cdata.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_cdata.c new file mode 100644 index 0000000..954f3ab --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_cdata.c @@ -0,0 +1,57 @@ +#include + +VALUE cNokogiriXmlCData; + +/* + * call-seq: + * new(document, content) + * + * Create a new CDATA element on the +document+ with +content+ + * + * If +content+ cannot be implicitly converted to a string, this method will + * raise a TypeError exception. + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + xmlNodePtr node; + VALUE doc; + VALUE content; + VALUE rest; + VALUE rb_node; + xmlChar *content_str = NULL; + int content_str_len = 0; + + rb_scan_args(argc, argv, "2*", &doc, &content, &rest); + + Data_Get_Struct(doc, xmlDoc, xml_doc); + + if (!NIL_P(content)) { + content_str = (xmlChar *)StringValuePtr(content); + content_str_len = RSTRING_LEN(content); + } + + node = xmlNewCDataBlock(xml_doc->doc, content_str, content_str_len); + + noko_xml_document_pin_node(node); + + rb_node = noko_xml_node_wrap(klass, node); + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +void +noko_init_xml_cdata() +{ + assert(cNokogiriXmlText); + /* + * CData represents a CData node in an xml document. + */ + cNokogiriXmlCData = rb_define_class_under(mNokogiriXml, "CDATA", cNokogiriXmlText); + + rb_define_singleton_method(cNokogiriXmlCData, "new", new, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_comment.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_comment.c new file mode 100644 index 0000000..10ba10d --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_comment.c @@ -0,0 +1,62 @@ +#include + +VALUE cNokogiriXmlComment; + +static ID document_id ; + +/* + * call-seq: + * new(document_or_node, content) + * + * Create a new Comment element on the +document+ with +content+. + * Alternatively, if a +node+ is passed, the +node+'s document is used. + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + xmlNodePtr node; + VALUE document; + VALUE content; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "2*", &document, &content, &rest); + + if (rb_obj_is_kind_of(document, cNokogiriXmlNode)) { + document = rb_funcall(document, document_id, 0); + } else if (!rb_obj_is_kind_of(document, cNokogiriXmlDocument) + && !rb_obj_is_kind_of(document, cNokogiriXmlDocumentFragment)) { + rb_raise(rb_eArgError, "first argument must be a XML::Document or XML::Node"); + } + + Data_Get_Struct(document, xmlDoc, xml_doc); + + node = xmlNewDocComment( + xml_doc, + (const xmlChar *)StringValueCStr(content) + ); + + rb_node = noko_xml_node_wrap(klass, node); + rb_obj_call_init(rb_node, argc, argv); + + noko_xml_document_pin_node(node); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +void +noko_init_xml_comment() +{ + assert(cNokogiriXmlCharacterData); + /* + * Comment represents a comment node in an xml document. + */ + cNokogiriXmlComment = rb_define_class_under(mNokogiriXml, "Comment", cNokogiriXmlCharacterData); + + rb_define_singleton_method(cNokogiriXmlComment, "new", new, -1); + + document_id = rb_intern("document"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document.c new file mode 100644 index 0000000..1af62ac --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document.c @@ -0,0 +1,680 @@ +#include + +VALUE cNokogiriXmlDocument ; + +static int +dealloc_node_i2(xmlNodePtr key, xmlNodePtr node, xmlDocPtr doc) +{ + switch (node->type) { + case XML_ATTRIBUTE_NODE: + xmlFreePropList((xmlAttrPtr)node); + break; + case XML_NAMESPACE_DECL: + xmlFreeNs((xmlNsPtr)node); + break; + case XML_DTD_NODE: + xmlFreeDtd((xmlDtdPtr)node); + break; + default: + if (node->parent == NULL) { + xmlAddChild((xmlNodePtr)doc, node); + } + } + return ST_CONTINUE; +} + +static int +dealloc_node_i(st_data_t key, st_data_t node, st_data_t doc) +{ + return dealloc_node_i2((xmlNodePtr)key, (xmlNodePtr)node, (xmlDocPtr)doc); +} + +static void +remove_private(xmlNodePtr node) +{ + xmlNodePtr child; + + for (child = node->children; child; child = child->next) { + remove_private(child); + } + + if ((node->type == XML_ELEMENT_NODE || + node->type == XML_XINCLUDE_START || + node->type == XML_XINCLUDE_END) && + node->properties) { + for (child = (xmlNodePtr)node->properties; child; child = child->next) { + remove_private(child); + } + } + + node->_private = NULL; +} + +static void +mark(xmlDocPtr doc) +{ + nokogiriTuplePtr tuple = (nokogiriTuplePtr)doc->_private; + if (tuple) { + rb_gc_mark(tuple->doc); + rb_gc_mark(tuple->node_cache); + } +} + +static void +dealloc(xmlDocPtr doc) +{ + st_table *node_hash; + + NOKOGIRI_DEBUG_START(doc); + + node_hash = DOC_UNLINKED_NODE_HASH(doc); + + st_foreach(node_hash, dealloc_node_i, (st_data_t)doc); + st_free_table(node_hash); + + free(doc->_private); + + /* When both Nokogiri and libxml-ruby are loaded, make sure that all nodes + * have their _private pointers cleared. This is to avoid libxml-ruby's + * xmlDeregisterNode callback from accessing VALUE pointers from ruby's GC + * free context, which can result in segfaults. + */ + if (xmlDeregisterNodeDefaultValue) { + remove_private((xmlNodePtr)doc); + } + + xmlFreeDoc(doc); + + NOKOGIRI_DEBUG_END(doc); +} + +static void +recursively_remove_namespaces_from_node(xmlNodePtr node) +{ + xmlNodePtr child ; + xmlAttrPtr property ; + + xmlSetNs(node, NULL); + + for (child = node->children ; child ; child = child->next) { + recursively_remove_namespaces_from_node(child); + } + + if (((node->type == XML_ELEMENT_NODE) || + (node->type == XML_XINCLUDE_START) || + (node->type == XML_XINCLUDE_END)) && + node->nsDef) { + xmlFreeNsList(node->nsDef); + node->nsDef = NULL; + } + + if (node->type == XML_ELEMENT_NODE && node->properties != NULL) { + property = node->properties ; + while (property != NULL) { + if (property->ns) { property->ns = NULL ; } + property = property->next ; + } + } +} + +/* + * call-seq: + * url + * + * Get the url name for this document. + */ +static VALUE +url(VALUE self) +{ + xmlDocPtr doc; + Data_Get_Struct(self, xmlDoc, doc); + + if (doc->URL) { return NOKOGIRI_STR_NEW2(doc->URL); } + + return Qnil; +} + +/* + * call-seq: + * root= + * + * Set the root element on this document + */ +static VALUE +rb_xml_document_root_set(VALUE self, VALUE rb_new_root) +{ + xmlDocPtr c_document; + xmlNodePtr c_new_root = NULL, c_current_root; + + Data_Get_Struct(self, xmlDoc, c_document); + + c_current_root = xmlDocGetRootElement(c_document); + if (c_current_root) { + xmlUnlinkNode(c_current_root); + noko_xml_document_pin_node(c_current_root); + } + + if (!NIL_P(rb_new_root)) { + if (!rb_obj_is_kind_of(rb_new_root, cNokogiriXmlNode)) { + rb_raise(rb_eArgError, + "expected Nokogiri::XML::Node but received %"PRIsVALUE, + rb_obj_class(rb_new_root)); + } + + Data_Get_Struct(rb_new_root, xmlNode, c_new_root); + + /* If the new root's document is not the same as the current document, + * then we need to dup the node in to this document. */ + if (c_new_root->doc != c_document) { + c_new_root = xmlDocCopyNode(c_new_root, c_document, 1); + if (!c_new_root) { + rb_raise(rb_eRuntimeError, "Could not reparent node (xmlDocCopyNode)"); + } + } + } + + xmlDocSetRootElement(c_document, c_new_root); + + return rb_new_root; +} + +/* + * call-seq: + * root + * + * Get the root node for this document. + */ +static VALUE +rb_xml_document_root(VALUE self) +{ + xmlDocPtr c_document; + xmlNodePtr c_root; + + Data_Get_Struct(self, xmlDoc, c_document); + + c_root = xmlDocGetRootElement(c_document); + if (!c_root) { + return Qnil; + } + + return noko_xml_node_wrap(Qnil, c_root) ; +} + +/* + * call-seq: + * encoding= encoding + * + * Set the encoding string for this Document + */ +static VALUE +set_encoding(VALUE self, VALUE encoding) +{ + xmlDocPtr doc; + Data_Get_Struct(self, xmlDoc, doc); + + if (doc->encoding) { + xmlFree(DISCARD_CONST_QUAL_XMLCHAR(doc->encoding)); + } + + doc->encoding = xmlStrdup((xmlChar *)StringValueCStr(encoding)); + + return encoding; +} + +/* + * call-seq: + * encoding + * + * Get the encoding for this Document + */ +static VALUE +encoding(VALUE self) +{ + xmlDocPtr doc; + Data_Get_Struct(self, xmlDoc, doc); + + if (!doc->encoding) { return Qnil; } + return NOKOGIRI_STR_NEW2(doc->encoding); +} + +/* + * call-seq: + * version + * + * Get the XML version for this Document + */ +static VALUE +version(VALUE self) +{ + xmlDocPtr doc; + Data_Get_Struct(self, xmlDoc, doc); + + if (!doc->version) { return Qnil; } + return NOKOGIRI_STR_NEW2(doc->version); +} + +/* + * call-seq: + * read_io(io, url, encoding, options) + * + * Create a new document from an IO object + */ +static VALUE +read_io(VALUE klass, + VALUE io, + VALUE url, + VALUE encoding, + VALUE options) +{ + const char *c_url = NIL_P(url) ? NULL : StringValueCStr(url); + const char *c_enc = NIL_P(encoding) ? NULL : StringValueCStr(encoding); + VALUE error_list = rb_ary_new(); + VALUE document; + xmlDocPtr doc; + + xmlResetLastError(); + xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher); + + doc = xmlReadIO( + (xmlInputReadCallback)noko_io_read, + (xmlInputCloseCallback)noko_io_close, + (void *)io, + c_url, + c_enc, + (int)NUM2INT(options) + ); + xmlSetStructuredErrorFunc(NULL, NULL); + + if (doc == NULL) { + xmlErrorPtr error; + + xmlFreeDoc(doc); + + error = xmlGetLastError(); + if (error) { + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + document = noko_xml_document_wrap(klass, doc); + rb_iv_set(document, "@errors", error_list); + return document; +} + +/* + * call-seq: + * read_memory(string, url, encoding, options) + * + * Create a new document from a String + */ +static VALUE +read_memory(VALUE klass, + VALUE string, + VALUE url, + VALUE encoding, + VALUE options) +{ + const char *c_buffer = StringValuePtr(string); + const char *c_url = NIL_P(url) ? NULL : StringValueCStr(url); + const char *c_enc = NIL_P(encoding) ? NULL : StringValueCStr(encoding); + int len = (int)RSTRING_LEN(string); + VALUE error_list = rb_ary_new(); + VALUE document; + xmlDocPtr doc; + + xmlResetLastError(); + xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher); + doc = xmlReadMemory(c_buffer, len, c_url, c_enc, (int)NUM2INT(options)); + xmlSetStructuredErrorFunc(NULL, NULL); + + if (doc == NULL) { + xmlErrorPtr error; + + xmlFreeDoc(doc); + + error = xmlGetLastError(); + if (error) { + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + document = noko_xml_document_wrap(klass, doc); + rb_iv_set(document, "@errors", error_list); + return document; +} + +/* + * call-seq: + * dup + * + * Copy this Document. An optional depth may be passed in, but it defaults + * to a deep copy. 0 is a shallow copy, 1 is a deep copy. + */ +static VALUE +duplicate_document(int argc, VALUE *argv, VALUE self) +{ + xmlDocPtr doc, dup; + VALUE copy; + VALUE level; + + if (rb_scan_args(argc, argv, "01", &level) == 0) { + level = INT2NUM((long)1); + } + + Data_Get_Struct(self, xmlDoc, doc); + + dup = xmlCopyDoc(doc, (int)NUM2INT(level)); + + if (dup == NULL) { return Qnil; } + + dup->type = doc->type; + copy = noko_xml_document_wrap(rb_obj_class(self), dup); + rb_iv_set(copy, "@errors", rb_iv_get(self, "@errors")); + return copy ; +} + +/* + * call-seq: + * new(version = default) + * + * Create a new document with +version+ (defaults to "1.0") + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr doc; + VALUE version, rest, rb_doc ; + + rb_scan_args(argc, argv, "0*", &rest); + version = rb_ary_entry(rest, (long)0); + if (NIL_P(version)) { version = rb_str_new2("1.0"); } + + doc = xmlNewDoc((xmlChar *)StringValueCStr(version)); + rb_doc = noko_xml_document_wrap_with_init_args(klass, doc, argc, argv); + return rb_doc ; +} + +/* + * call-seq: + * remove_namespaces! + * + * Remove all namespaces from all nodes in the document. + * + * This could be useful for developers who either don't understand namespaces + * or don't care about them. + * + * The following example shows a use case, and you can decide for yourself + * whether this is a good thing or not: + * + * doc = Nokogiri::XML <<-EOXML + * + * + * Michelin Model XGV + * + * + * I'm a bicycle tire! + * + * + * EOXML + * + * doc.xpath("//tire").to_s # => "" + * doc.xpath("//part:tire", "part" => "http://general-motors.com/").to_s # => "Michelin Model XGV" + * doc.xpath("//part:tire", "part" => "http://schwinn.com/").to_s # => "I'm a bicycle tire!" + * + * doc.remove_namespaces! + * + * doc.xpath("//tire").to_s # => "Michelin Model XGVI'm a bicycle tire!" + * doc.xpath("//part:tire", "part" => "http://general-motors.com/").to_s # => "" + * doc.xpath("//part:tire", "part" => "http://schwinn.com/").to_s # => "" + * + * For more information on why this probably is *not* a good thing in general, + * please direct your browser to + * http://tenderlovemaking.com/2009/04/23/namespaces-in-xml.html + */ +static VALUE +remove_namespaces_bang(VALUE self) +{ + xmlDocPtr doc ; + Data_Get_Struct(self, xmlDoc, doc); + + recursively_remove_namespaces_from_node((xmlNodePtr)doc); + return self; +} + +/* call-seq: doc.create_entity(name, type, external_id, system_id, content) + * + * Create a new entity named +name+. + * + * +type+ is an integer representing the type of entity to be created, and it + * defaults to Nokogiri::XML::EntityDecl::INTERNAL_GENERAL. See + * the constants on Nokogiri::XML::EntityDecl for more information. + * + * +external_id+, +system_id+, and +content+ set the External ID, System ID, + * and content respectively. All of these parameters are optional. + */ +static VALUE +create_entity(int argc, VALUE *argv, VALUE self) +{ + VALUE name; + VALUE type; + VALUE external_id; + VALUE system_id; + VALUE content; + xmlEntityPtr ptr; + xmlDocPtr doc ; + + Data_Get_Struct(self, xmlDoc, doc); + + rb_scan_args(argc, argv, "14", &name, &type, &external_id, &system_id, + &content); + + xmlResetLastError(); + ptr = xmlAddDocEntity( + doc, + (xmlChar *)(NIL_P(name) ? NULL : StringValueCStr(name)), + (int)(NIL_P(type) ? XML_INTERNAL_GENERAL_ENTITY : NUM2INT(type)), + (xmlChar *)(NIL_P(external_id) ? NULL : StringValueCStr(external_id)), + (xmlChar *)(NIL_P(system_id) ? NULL : StringValueCStr(system_id)), + (xmlChar *)(NIL_P(content) ? NULL : StringValueCStr(content)) + ); + + if (NULL == ptr) { + xmlErrorPtr error = xmlGetLastError(); + if (error) { + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } else { + rb_raise(rb_eRuntimeError, "Could not create entity"); + } + + return Qnil; + } + + return noko_xml_node_wrap(cNokogiriXmlEntityDecl, (xmlNodePtr)ptr); +} + +static int +block_caller(void *ctx, xmlNodePtr c_node, xmlNodePtr c_parent_node) +{ + VALUE block = (VALUE)ctx; + VALUE rb_node; + VALUE rb_parent_node; + VALUE ret; + + if (c_node->type == XML_NAMESPACE_DECL) { + rb_node = noko_xml_namespace_wrap((xmlNsPtr)c_node, c_parent_node->doc); + } else { + rb_node = noko_xml_node_wrap(Qnil, c_node); + } + rb_parent_node = c_parent_node ? noko_xml_node_wrap(Qnil, c_parent_node) : Qnil; + + ret = rb_funcall(block, rb_intern("call"), 2, rb_node, rb_parent_node); + + return (Qfalse == ret || Qnil == ret) ? 0 : 1; +} + +/* call-seq: + * doc.canonicalize(mode=XML_C14N_1_0,inclusive_namespaces=nil,with_comments=false) + * doc.canonicalize { |obj, parent| ... } + * + * Canonicalize a document and return the results. Takes an optional block + * that takes two parameters: the +obj+ and that node's +parent+. + * The +obj+ will be either a Nokogiri::XML::Node, or a Nokogiri::XML::Namespace + * The block must return a non-nil, non-false value if the +obj+ passed in + * should be included in the canonicalized document. + */ +static VALUE +rb_xml_document_canonicalize(int argc, VALUE *argv, VALUE self) +{ + VALUE rb_mode; + VALUE rb_namespaces; + VALUE rb_comments_p; + xmlChar **c_namespaces; + + xmlDocPtr c_doc; + xmlOutputBufferPtr c_obuf; + xmlC14NIsVisibleCallback c_callback_wrapper = NULL; + void *rb_callback = NULL; + + VALUE rb_cStringIO; + VALUE rb_io; + + rb_scan_args(argc, argv, "03", &rb_mode, &rb_namespaces, &rb_comments_p); + if (!NIL_P(rb_mode)) { Check_Type(rb_mode, T_FIXNUM); } + if (!NIL_P(rb_namespaces)) { Check_Type(rb_namespaces, T_ARRAY); } + + Data_Get_Struct(self, xmlDoc, c_doc); + + rb_cStringIO = rb_const_get_at(rb_cObject, rb_intern("StringIO")); + rb_io = rb_class_new_instance(0, 0, rb_cStringIO); + c_obuf = xmlAllocOutputBuffer(NULL); + + c_obuf->writecallback = (xmlOutputWriteCallback)noko_io_write; + c_obuf->closecallback = (xmlOutputCloseCallback)noko_io_close; + c_obuf->context = (void *)rb_io; + + if (rb_block_given_p()) { + c_callback_wrapper = block_caller; + rb_callback = (void *)rb_block_proc(); + } + + if (NIL_P(rb_namespaces)) { + c_namespaces = NULL; + } else { + long ns_len = RARRAY_LEN(rb_namespaces); + c_namespaces = calloc((size_t)ns_len + 1, sizeof(xmlChar *)); + for (int j = 0 ; j < ns_len ; j++) { + VALUE entry = rb_ary_entry(rb_namespaces, j); + c_namespaces[j] = (xmlChar *)StringValueCStr(entry); + } + } + + xmlC14NExecute(c_doc, c_callback_wrapper, rb_callback, + (int)(NIL_P(rb_mode) ? 0 : NUM2INT(rb_mode)), + c_namespaces, + (int)RTEST(rb_comments_p), + c_obuf); + + free(c_namespaces); + xmlOutputBufferClose(c_obuf); + + return rb_funcall(rb_io, rb_intern("string"), 0); +} + +VALUE +noko_xml_document_wrap_with_init_args(VALUE klass, xmlDocPtr c_document, int argc, VALUE *argv) +{ + VALUE rb_document; + nokogiriTuplePtr tuple; + + if (!klass) { + klass = cNokogiriXmlDocument; + } + + rb_document = Data_Wrap_Struct(klass, mark, dealloc, c_document); + + tuple = (nokogiriTuplePtr)malloc(sizeof(nokogiriTuple)); + tuple->doc = rb_document; + tuple->unlinkedNodes = st_init_numtable_with_size(128); + tuple->node_cache = rb_ary_new(); + + c_document->_private = tuple ; + + rb_iv_set(rb_document, "@decorators", Qnil); + rb_iv_set(rb_document, "@errors", Qnil); + rb_iv_set(rb_document, "@node_cache", tuple->node_cache); + + rb_obj_call_init(rb_document, argc, argv); + + return rb_document ; +} + + +/* deprecated. use noko_xml_document_wrap() instead. */ +VALUE +Nokogiri_wrap_xml_document(VALUE klass, xmlDocPtr doc) +{ + /* TODO: deprecate this method in v2.0 */ + return noko_xml_document_wrap_with_init_args(klass, doc, 0, NULL); +} + +VALUE +noko_xml_document_wrap(VALUE klass, xmlDocPtr doc) +{ + return noko_xml_document_wrap_with_init_args(klass, doc, 0, NULL); +} + + +void +noko_xml_document_pin_node(xmlNodePtr node) +{ + xmlDocPtr doc; + nokogiriTuplePtr tuple; + + doc = node->doc; + tuple = (nokogiriTuplePtr)doc->_private; + st_insert(tuple->unlinkedNodes, (st_data_t)node, (st_data_t)node); +} + + +void +noko_xml_document_pin_namespace(xmlNsPtr ns, xmlDocPtr doc) +{ + nokogiriTuplePtr tuple; + + tuple = (nokogiriTuplePtr)doc->_private; + st_insert(tuple->unlinkedNodes, (st_data_t)ns, (st_data_t)ns); +} + + +void +noko_init_xml_document() +{ + assert(cNokogiriXmlNode); + /* + * Nokogiri::XML::Document wraps an xml document. + */ + cNokogiriXmlDocument = rb_define_class_under(mNokogiriXml, "Document", cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlDocument, "read_memory", read_memory, 4); + rb_define_singleton_method(cNokogiriXmlDocument, "read_io", read_io, 4); + rb_define_singleton_method(cNokogiriXmlDocument, "new", new, -1); + + rb_define_method(cNokogiriXmlDocument, "root", rb_xml_document_root, 0); + rb_define_method(cNokogiriXmlDocument, "root=", rb_xml_document_root_set, 1); + rb_define_method(cNokogiriXmlDocument, "encoding", encoding, 0); + rb_define_method(cNokogiriXmlDocument, "encoding=", set_encoding, 1); + rb_define_method(cNokogiriXmlDocument, "version", version, 0); + rb_define_method(cNokogiriXmlDocument, "canonicalize", rb_xml_document_canonicalize, -1); + rb_define_method(cNokogiriXmlDocument, "dup", duplicate_document, -1); + rb_define_method(cNokogiriXmlDocument, "url", url, 0); + rb_define_method(cNokogiriXmlDocument, "create_entity", create_entity, -1); + rb_define_method(cNokogiriXmlDocument, "remove_namespaces!", remove_namespaces_bang, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document_fragment.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document_fragment.c new file mode 100644 index 0000000..8163957 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_document_fragment.c @@ -0,0 +1,44 @@ +#include + +VALUE cNokogiriXmlDocumentFragment; + +/* + * call-seq: + * new(document) + * + * Create a new DocumentFragment element on the +document+ + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + xmlNodePtr node; + VALUE document; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "1*", &document, &rest); + + Data_Get_Struct(document, xmlDoc, xml_doc); + + node = xmlNewDocFragment(xml_doc->doc); + + noko_xml_document_pin_node(node); + + rb_node = noko_xml_node_wrap(klass, node); + rb_obj_call_init(rb_node, argc, argv); + + return rb_node; +} + +void +noko_init_xml_document_fragment() +{ + assert(cNokogiriXmlNode); + /* + * DocumentFragment represents a DocumentFragment node in an xml document. + */ + cNokogiriXmlDocumentFragment = rb_define_class_under(mNokogiriXml, "DocumentFragment", cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlDocumentFragment, "new", new, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_dtd.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_dtd.c new file mode 100644 index 0000000..15908d3 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_dtd.c @@ -0,0 +1,208 @@ +#include + +VALUE cNokogiriXmlDtd; + +static void +notation_copier(void *c_notation_ptr, void *rb_hash_ptr, const xmlChar *name) +{ + VALUE rb_hash = (VALUE)rb_hash_ptr; + xmlNotationPtr c_notation = (xmlNotationPtr)c_notation_ptr; + VALUE rb_notation; + VALUE cNokogiriXmlNotation; + VALUE rb_constructor_args[3]; + + rb_constructor_args[0] = (c_notation->name ? NOKOGIRI_STR_NEW2(c_notation->name) : Qnil); + rb_constructor_args[1] = (c_notation->PublicID ? NOKOGIRI_STR_NEW2(c_notation->PublicID) : Qnil); + rb_constructor_args[2] = (c_notation->SystemID ? NOKOGIRI_STR_NEW2(c_notation->SystemID) : Qnil); + + cNokogiriXmlNotation = rb_const_get_at(mNokogiriXml, rb_intern("Notation")); + rb_notation = rb_class_new_instance(3, rb_constructor_args, cNokogiriXmlNotation); + + rb_hash_aset(rb_hash, NOKOGIRI_STR_NEW2(name), rb_notation); +} + +static void +element_copier(void *c_node_ptr, void *rb_hash_ptr, const xmlChar *c_name) +{ + VALUE rb_hash = (VALUE)rb_hash_ptr; + xmlNodePtr c_node = (xmlNodePtr)c_node_ptr; + + VALUE rb_node = noko_xml_node_wrap(Qnil, c_node); + + rb_hash_aset(rb_hash, NOKOGIRI_STR_NEW2(c_name), rb_node); +} + +/* + * call-seq: + * entities + * + * Get a hash of the elements for this DTD. + */ +static VALUE +entities(VALUE self) +{ + xmlDtdPtr dtd; + VALUE hash; + + Data_Get_Struct(self, xmlDtd, dtd); + + if (!dtd->entities) { return Qnil; } + + hash = rb_hash_new(); + + xmlHashScan((xmlHashTablePtr)dtd->entities, element_copier, (void *)hash); + + return hash; +} + +/* + * call-seq: + * notations() → Hash + * + * [Returns] All the notations for this DTD in a Hash of Notation +name+ to Notation. + */ +static VALUE +notations(VALUE self) +{ + xmlDtdPtr dtd; + VALUE hash; + + Data_Get_Struct(self, xmlDtd, dtd); + + if (!dtd->notations) { return Qnil; } + + hash = rb_hash_new(); + + xmlHashScan((xmlHashTablePtr)dtd->notations, notation_copier, (void *)hash); + + return hash; +} + +/* + * call-seq: + * attributes + * + * Get a hash of the attributes for this DTD. + */ +static VALUE +attributes(VALUE self) +{ + xmlDtdPtr dtd; + VALUE hash; + + Data_Get_Struct(self, xmlDtd, dtd); + + hash = rb_hash_new(); + + if (!dtd->attributes) { return hash; } + + xmlHashScan((xmlHashTablePtr)dtd->attributes, element_copier, (void *)hash); + + return hash; +} + +/* + * call-seq: + * elements + * + * Get a hash of the elements for this DTD. + */ +static VALUE +elements(VALUE self) +{ + xmlDtdPtr dtd; + VALUE hash; + + Data_Get_Struct(self, xmlDtd, dtd); + + if (!dtd->elements) { return Qnil; } + + hash = rb_hash_new(); + + xmlHashScan((xmlHashTablePtr)dtd->elements, element_copier, (void *)hash); + + return hash; +} + +/* + * call-seq: + * validate(document) + * + * Validate +document+ returning a list of errors + */ +static VALUE +validate(VALUE self, VALUE document) +{ + xmlDocPtr doc; + xmlDtdPtr dtd; + xmlValidCtxtPtr ctxt; + VALUE error_list; + + Data_Get_Struct(self, xmlDtd, dtd); + Data_Get_Struct(document, xmlDoc, doc); + error_list = rb_ary_new(); + + ctxt = xmlNewValidCtxt(); + + xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher); + + xmlValidateDtd(ctxt, doc, dtd); + + xmlSetStructuredErrorFunc(NULL, NULL); + + xmlFreeValidCtxt(ctxt); + + return error_list; +} + +/* + * call-seq: + * system_id + * + * Get the System ID for this DTD + */ +static VALUE +system_id(VALUE self) +{ + xmlDtdPtr dtd; + Data_Get_Struct(self, xmlDtd, dtd); + + if (!dtd->SystemID) { return Qnil; } + + return NOKOGIRI_STR_NEW2(dtd->SystemID); +} + +/* + * call-seq: + * external_id + * + * Get the External ID for this DTD + */ +static VALUE +external_id(VALUE self) +{ + xmlDtdPtr dtd; + Data_Get_Struct(self, xmlDtd, dtd); + + if (!dtd->ExternalID) { return Qnil; } + + return NOKOGIRI_STR_NEW2(dtd->ExternalID); +} + +void +noko_init_xml_dtd() +{ + assert(cNokogiriXmlNode); + /* + * Nokogiri::XML::DTD wraps DTD nodes in an XML document + */ + cNokogiriXmlDtd = rb_define_class_under(mNokogiriXml, "DTD", cNokogiriXmlNode); + + rb_define_method(cNokogiriXmlDtd, "notations", notations, 0); + rb_define_method(cNokogiriXmlDtd, "elements", elements, 0); + rb_define_method(cNokogiriXmlDtd, "entities", entities, 0); + rb_define_method(cNokogiriXmlDtd, "validate", validate, 1); + rb_define_method(cNokogiriXmlDtd, "attributes", attributes, 0); + rb_define_method(cNokogiriXmlDtd, "system_id", system_id, 0); + rb_define_method(cNokogiriXmlDtd, "external_id", external_id, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_content.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_content.c new file mode 100644 index 0000000..64176f0 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_content.c @@ -0,0 +1,128 @@ +#include + +VALUE cNokogiriXmlElementContent; + +/* + * call-seq: + * name + * + * Get the require element +name+ + */ +static VALUE +get_name(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + if (!elem->name) { return Qnil; } + return NOKOGIRI_STR_NEW2(elem->name); +} + +/* + * call-seq: + * type + * + * Get the element content +type+. Possible values are PCDATA, ELEMENT, SEQ, + * or OR. + */ +static VALUE +get_type(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + return INT2NUM((long)elem->type); +} + +/* + * call-seq: + * c1 + * + * Get the first child. + */ +static VALUE +get_c1(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + if (!elem->c1) { return Qnil; } + return noko_xml_element_content_wrap(rb_iv_get(self, "@document"), elem->c1); +} + +/* + * call-seq: + * c2 + * + * Get the first child. + */ +static VALUE +get_c2(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + if (!elem->c2) { return Qnil; } + return noko_xml_element_content_wrap(rb_iv_get(self, "@document"), elem->c2); +} + +/* + * call-seq: + * occur + * + * Get the element content +occur+ flag. Possible values are ONCE, OPT, MULT + * or PLUS. + */ +static VALUE +get_occur(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + return INT2NUM((long)elem->ocur); +} + +/* + * call-seq: + * prefix + * + * Get the element content namespace +prefix+. + */ +static VALUE +get_prefix(VALUE self) +{ + xmlElementContentPtr elem; + Data_Get_Struct(self, xmlElementContent, elem); + + if (!elem->prefix) { return Qnil; } + + return NOKOGIRI_STR_NEW2(elem->prefix); +} + +VALUE +noko_xml_element_content_wrap(VALUE doc, xmlElementContentPtr element) +{ + VALUE elem = Data_Wrap_Struct(cNokogiriXmlElementContent, 0, 0, element); + + /* Setting the document is necessary so that this does not get GC'd until */ + /* the document is GC'd */ + rb_iv_set(elem, "@document", doc); + + return elem; +} + +void +noko_init_xml_element_content() +{ + cNokogiriXmlElementContent = rb_define_class_under(mNokogiriXml, "ElementContent", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlElementContent); + + rb_define_method(cNokogiriXmlElementContent, "name", get_name, 0); + rb_define_method(cNokogiriXmlElementContent, "type", get_type, 0); + rb_define_method(cNokogiriXmlElementContent, "occur", get_occur, 0); + rb_define_method(cNokogiriXmlElementContent, "prefix", get_prefix, 0); + + rb_define_private_method(cNokogiriXmlElementContent, "c1", get_c1, 0); + rb_define_private_method(cNokogiriXmlElementContent, "c2", get_c2, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_decl.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_decl.c new file mode 100644 index 0000000..178c69b --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_element_decl.c @@ -0,0 +1,69 @@ +#include + +VALUE cNokogiriXmlElementDecl; + +static ID id_document; + +/* + * call-seq: + * element_type + * + * The element_type + */ +static VALUE +element_type(VALUE self) +{ + xmlElementPtr node; + Data_Get_Struct(self, xmlElement, node); + return INT2NUM((long)node->etype); +} + +/* + * call-seq: + * content + * + * The allowed content for this ElementDecl + */ +static VALUE +content(VALUE self) +{ + xmlElementPtr node; + Data_Get_Struct(self, xmlElement, node); + + if (!node->content) { return Qnil; } + + return noko_xml_element_content_wrap( + rb_funcall(self, id_document, 0), + node->content + ); +} + +/* + * call-seq: + * prefix + * + * The namespace prefix for this ElementDecl + */ +static VALUE +prefix(VALUE self) +{ + xmlElementPtr node; + Data_Get_Struct(self, xmlElement, node); + + if (!node->prefix) { return Qnil; } + + return NOKOGIRI_STR_NEW2(node->prefix); +} + +void +noko_init_xml_element_decl() +{ + assert(cNokogiriXmlNode); + cNokogiriXmlElementDecl = rb_define_class_under(mNokogiriXml, "ElementDecl", cNokogiriXmlNode); + + rb_define_method(cNokogiriXmlElementDecl, "element_type", element_type, 0); + rb_define_method(cNokogiriXmlElementDecl, "content", content, 0); + rb_define_method(cNokogiriXmlElementDecl, "prefix", prefix, 0); + + id_document = rb_intern("document"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_encoding_handler.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_encoding_handler.c new file mode 100644 index 0000000..8d5b88e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_encoding_handler.c @@ -0,0 +1,104 @@ +#include + +VALUE cNokogiriEncodingHandler; + + +static void +_xml_encoding_handler_dealloc(xmlCharEncodingHandlerPtr c_handler) +{ + /* make sure iconv handlers are cleaned up and freed */ + xmlCharEncCloseFunc(c_handler); +} + + +/* + * call-seq: Nokogiri::EncodingHandler.[](name) + * + * Get the encoding handler for +name+ + */ +static VALUE +rb_xml_encoding_handler_s_get(VALUE klass, VALUE key) +{ + xmlCharEncodingHandlerPtr handler; + + handler = xmlFindCharEncodingHandler(StringValueCStr(key)); + if (handler) { + return Data_Wrap_Struct(klass, NULL, _xml_encoding_handler_dealloc, handler); + } + + return Qnil; +} + + +/* + * call-seq: Nokogiri::EncodingHandler.delete(name) + * + * Delete the encoding alias named +name+ + */ +static VALUE +rb_xml_encoding_handler_s_delete(VALUE klass, VALUE name) +{ + if (xmlDelEncodingAlias(StringValueCStr(name))) { return Qnil; } + + return Qtrue; +} + + +/* + * call-seq: Nokogiri::EncodingHandler.alias(from, to) + * + * Alias encoding handler with name +from+ to name +to+ + */ +static VALUE +rb_xml_encoding_handler_s_alias(VALUE klass, VALUE from, VALUE to) +{ + xmlAddEncodingAlias(StringValueCStr(from), StringValueCStr(to)); + + return to; +} + + +/* + * call-seq: Nokogiri::EncodingHandler.clear_aliases! + * + * Remove all encoding aliases. + */ +static VALUE +rb_xml_encoding_handler_s_clear_aliases(VALUE klass) +{ + xmlCleanupEncodingAliases(); + + return klass; +} + + +/* + * call-seq: name + * + * Get the name of this EncodingHandler + */ +static VALUE +rb_xml_encoding_handler_name(VALUE self) +{ + xmlCharEncodingHandlerPtr handler; + + Data_Get_Struct(self, xmlCharEncodingHandler, handler); + + return NOKOGIRI_STR_NEW2(handler->name); +} + + +void +noko_init_xml_encoding_handler() +{ + cNokogiriEncodingHandler = rb_define_class_under(mNokogiri, "EncodingHandler", rb_cObject); + + rb_undef_alloc_func(cNokogiriEncodingHandler); + + rb_define_singleton_method(cNokogiriEncodingHandler, "[]", rb_xml_encoding_handler_s_get, 1); + rb_define_singleton_method(cNokogiriEncodingHandler, "delete", rb_xml_encoding_handler_s_delete, 1); + rb_define_singleton_method(cNokogiriEncodingHandler, "alias", rb_xml_encoding_handler_s_alias, 2); + rb_define_singleton_method(cNokogiriEncodingHandler, "clear_aliases!", rb_xml_encoding_handler_s_clear_aliases, 0); + + rb_define_method(cNokogiriEncodingHandler, "name", rb_xml_encoding_handler_name, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_decl.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_decl.c new file mode 100644 index 0000000..50893d2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_decl.c @@ -0,0 +1,112 @@ +#include + +VALUE cNokogiriXmlEntityDecl; + +/* + * call-seq: + * original_content + * + * Get the original_content before ref substitution + */ +static VALUE +original_content(VALUE self) +{ + xmlEntityPtr node; + Data_Get_Struct(self, xmlEntity, node); + + if (!node->orig) { return Qnil; } + + return NOKOGIRI_STR_NEW2(node->orig); +} + +/* + * call-seq: + * content + * + * Get the content + */ +static VALUE +get_content(VALUE self) +{ + xmlEntityPtr node; + Data_Get_Struct(self, xmlEntity, node); + + if (!node->content) { return Qnil; } + + return NOKOGIRI_STR_NEW(node->content, node->length); +} + +/* + * call-seq: + * entity_type + * + * Get the entity type + */ +static VALUE +entity_type(VALUE self) +{ + xmlEntityPtr node; + Data_Get_Struct(self, xmlEntity, node); + + return INT2NUM((int)node->etype); +} + +/* + * call-seq: + * external_id + * + * Get the external identifier for PUBLIC + */ +static VALUE +external_id(VALUE self) +{ + xmlEntityPtr node; + Data_Get_Struct(self, xmlEntity, node); + + if (!node->ExternalID) { return Qnil; } + + return NOKOGIRI_STR_NEW2(node->ExternalID); +} + +/* + * call-seq: + * system_id + * + * Get the URI for a SYSTEM or PUBLIC Entity + */ +static VALUE +system_id(VALUE self) +{ + xmlEntityPtr node; + Data_Get_Struct(self, xmlEntity, node); + + if (!node->SystemID) { return Qnil; } + + return NOKOGIRI_STR_NEW2(node->SystemID); +} + +void +noko_init_xml_entity_decl() +{ + assert(cNokogiriXmlNode); + cNokogiriXmlEntityDecl = rb_define_class_under(mNokogiriXml, "EntityDecl", cNokogiriXmlNode); + + rb_define_method(cNokogiriXmlEntityDecl, "original_content", original_content, 0); + rb_define_method(cNokogiriXmlEntityDecl, "content", get_content, 0); + rb_define_method(cNokogiriXmlEntityDecl, "entity_type", entity_type, 0); + rb_define_method(cNokogiriXmlEntityDecl, "external_id", external_id, 0); + rb_define_method(cNokogiriXmlEntityDecl, "system_id", system_id, 0); + + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_GENERAL"), + INT2NUM(XML_INTERNAL_GENERAL_ENTITY)); + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_GENERAL_PARSED"), + INT2NUM(XML_EXTERNAL_GENERAL_PARSED_ENTITY)); + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_GENERAL_UNPARSED"), + INT2NUM(XML_EXTERNAL_GENERAL_UNPARSED_ENTITY)); + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_PARAMETER"), + INT2NUM(XML_INTERNAL_PARAMETER_ENTITY)); + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_PARAMETER"), + INT2NUM(XML_EXTERNAL_PARAMETER_ENTITY)); + rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_PREDEFINED"), + INT2NUM(XML_INTERNAL_PREDEFINED_ENTITY)); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_reference.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_reference.c new file mode 100644 index 0000000..1415ece --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_entity_reference.c @@ -0,0 +1,50 @@ +#include + +VALUE cNokogiriXmlEntityReference; + +/* + * call-seq: + * new(document, content) + * + * Create a new EntityReference element on the +document+ with +name+ + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + xmlNodePtr node; + VALUE document; + VALUE name; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "2*", &document, &name, &rest); + + Data_Get_Struct(document, xmlDoc, xml_doc); + + node = xmlNewReference( + xml_doc, + (const xmlChar *)StringValueCStr(name) + ); + + noko_xml_document_pin_node(node); + + rb_node = noko_xml_node_wrap(klass, node); + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +void +noko_init_xml_entity_reference() +{ + assert(cNokogiriXmlNode); + /* + * EntityReference represents an EntityReference node in an xml document. + */ + cNokogiriXmlEntityReference = rb_define_class_under(mNokogiriXml, "EntityReference", cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlEntityReference, "new", new, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_namespace.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_namespace.c new file mode 100644 index 0000000..0b41acf --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_namespace.c @@ -0,0 +1,120 @@ +#include + +/* + * The lifecycle of a Namespace node is more complicated than other Nodes, for two reasons: + * + * 1. the underlying C structure has a different layout than all the other node structs, with the + * `_private` member where we store a pointer to Ruby object data not being in first position. + * 2. xmlNs structures returned in an xmlNodeset from an XPath query are copies of the document's + * namespaces, and so do not share the same memory lifecycle as everything else in a document. + * + * As a result of 1, you may see special handling of XML_NAMESPACE_DECL node types throughout the + * Nokogiri C code, though I intend to wrap up that logic in ruby_object_{get,set} functions + * shortly. + * + * As a result of 2, you will see we have special handling in this file and in xml_node_set.c to + * carefully manage the memory lifecycle of xmlNs structs to match the Ruby object's GC + * lifecycle. In xml_node_set.c we have local versions of xmlXPathNodeSetDel() and + * xmlXPathFreeNodeSet() that avoid freeing xmlNs structs in the node set. In this file, we decide + * whether or not to call dealloc_namespace() depending on whether the xmlNs struct appears to be + * in an xmlNodeSet (and thus the result of an XPath query) or not. + * + * Yes, this is madness. + */ + +VALUE cNokogiriXmlNamespace ; + +static void +dealloc_namespace(xmlNsPtr ns) +{ + /* + * this deallocator is only used for namespace nodes that are part of an xpath + * node set. see noko_xml_namespace_wrap(). + */ + NOKOGIRI_DEBUG_START(ns) ; + if (ns->href) { + xmlFree(DISCARD_CONST_QUAL_XMLCHAR(ns->href)); + } + if (ns->prefix) { + xmlFree(DISCARD_CONST_QUAL_XMLCHAR(ns->prefix)); + } + xmlFree(ns); + NOKOGIRI_DEBUG_END(ns) ; +} + + +/* + * call-seq: + * prefix + * + * Get the prefix for this namespace. Returns +nil+ if there is no prefix. + */ +static VALUE +prefix(VALUE self) +{ + xmlNsPtr ns; + + Data_Get_Struct(self, xmlNs, ns); + if (!ns->prefix) { return Qnil; } + + return NOKOGIRI_STR_NEW2(ns->prefix); +} + +/* + * call-seq: + * href + * + * Get the href for this namespace + */ +static VALUE +href(VALUE self) +{ + xmlNsPtr ns; + + Data_Get_Struct(self, xmlNs, ns); + if (!ns->href) { return Qnil; } + + return NOKOGIRI_STR_NEW2(ns->href); +} + +VALUE +noko_xml_namespace_wrap(xmlNsPtr c_namespace, xmlDocPtr c_document) +{ + VALUE rb_namespace; + + if (c_namespace->_private) { + return (VALUE)c_namespace->_private; + } + + if (c_document) { + rb_namespace = Data_Wrap_Struct(cNokogiriXmlNamespace, 0, 0, c_namespace); + + if (DOC_RUBY_OBJECT_TEST(c_document)) { + rb_iv_set(rb_namespace, "@document", DOC_RUBY_OBJECT(c_document)); + rb_ary_push(DOC_NODE_CACHE(c_document), rb_namespace); + } + } else { + rb_namespace = Data_Wrap_Struct(cNokogiriXmlNamespace, 0, dealloc_namespace, c_namespace); + } + + c_namespace->_private = (void *)rb_namespace; + + return rb_namespace; +} + +VALUE +noko_xml_namespace_wrap_xpath_copy(xmlNsPtr c_namespace) +{ + return noko_xml_namespace_wrap(c_namespace, NULL); +} + +void +noko_init_xml_namespace() +{ + cNokogiriXmlNamespace = rb_define_class_under(mNokogiriXml, "Namespace", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlNamespace); + + rb_define_method(cNokogiriXmlNamespace, "prefix", prefix, 0); + rb_define_method(cNokogiriXmlNamespace, "href", href, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node.c new file mode 100644 index 0000000..14f1a87 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node.c @@ -0,0 +1,2144 @@ +#include + +// :stopdoc: + +VALUE cNokogiriXmlNode ; +static ID id_decorate, id_decorate_bang; + +typedef xmlNodePtr(*pivot_reparentee_func)(xmlNodePtr, xmlNodePtr); + + +#ifdef DEBUG +static void +_xml_node_dealloc(xmlNodePtr x) +{ + NOKOGIRI_DEBUG_START(x) + NOKOGIRI_DEBUG_END(x) +} +#else +# define _xml_node_dealloc 0 +#endif + + +static void +_xml_node_mark(xmlNodePtr node) +{ + xmlDocPtr doc = node->doc; + if (doc->type == XML_DOCUMENT_NODE || doc->type == XML_HTML_DOCUMENT_NODE) { + if (DOC_RUBY_OBJECT_TEST(doc)) { + rb_gc_mark(DOC_RUBY_OBJECT(doc)); + } + } else if (node->doc->_private) { + rb_gc_mark((VALUE)doc->_private); + } +} + + +static void +relink_namespace(xmlNodePtr reparented) +{ + xmlNodePtr child; + xmlAttrPtr attr; + + if (reparented->type != XML_ATTRIBUTE_NODE && + reparented->type != XML_ELEMENT_NODE) { return; } + + if (reparented->ns == NULL || reparented->ns->prefix == NULL) { + xmlNsPtr ns = NULL; + xmlChar *name = NULL, *prefix = NULL; + + name = xmlSplitQName2(reparented->name, &prefix); + + if (reparented->type == XML_ATTRIBUTE_NODE) { + if (prefix == NULL || strcmp((char *)prefix, XMLNS_PREFIX) == 0) { + xmlFree(name); + xmlFree(prefix); + return; + } + } + + ns = xmlSearchNs(reparented->doc, reparented, prefix); + + if (ns != NULL) { + xmlNodeSetName(reparented, name); + xmlSetNs(reparented, ns); + } + + xmlFree(name); + xmlFree(prefix); + } + + /* Avoid segv when relinking against unlinked nodes. */ + if (reparented->type != XML_ELEMENT_NODE || !reparented->parent) { return; } + + /* Make sure that our reparented node has the correct namespaces */ + if (!reparented->ns && + (reparented->doc != (xmlDocPtr)reparented->parent) && + (rb_iv_get(DOC_RUBY_OBJECT(reparented->doc), "@namespace_inheritance") == Qtrue)) { + xmlSetNs(reparented, reparented->parent->ns); + } + + /* Search our parents for an existing definition */ + if (reparented->nsDef) { + xmlNsPtr curr = reparented->nsDef; + xmlNsPtr prev = NULL; + + while (curr) { + xmlNsPtr ns = xmlSearchNsByHref( + reparented->doc, + reparented->parent, + curr->href + ); + /* If we find the namespace is already declared, remove it from this + * definition list. */ + if (ns && ns != curr && xmlStrEqual(ns->prefix, curr->prefix)) { + if (prev) { + prev->next = curr->next; + } else { + reparented->nsDef = curr->next; + } + noko_xml_document_pin_namespace(curr, reparented->doc); + } else { + prev = curr; + } + curr = curr->next; + } + } + + /* + * Search our parents for an existing definition of current namespace, + * because the definition it's pointing to may have just been removed nsDef. + * + * And although that would technically probably be OK, I'd feel better if we + * referred to a namespace that's still present in a node's nsDef somewhere + * in the doc. + */ + if (reparented->ns) { + xmlNsPtr ns = xmlSearchNs(reparented->doc, reparented, reparented->ns->prefix); + if (ns + && ns != reparented->ns + && xmlStrEqual(ns->prefix, reparented->ns->prefix) + && xmlStrEqual(ns->href, reparented->ns->href) + ) { + xmlSetNs(reparented, ns); + } + } + + /* Only walk all children if there actually is a namespace we need to */ + /* reparent. */ + if (NULL == reparented->ns) { return; } + + /* When a node gets reparented, walk it's children to make sure that */ + /* their namespaces are reparented as well. */ + child = reparented->children; + while (NULL != child) { + relink_namespace(child); + child = child->next; + } + + if (reparented->type == XML_ELEMENT_NODE) { + attr = reparented->properties; + while (NULL != attr) { + relink_namespace((xmlNodePtr)attr); + attr = attr->next; + } + } +} + + +/* internal function meant to wrap xmlReplaceNode + and fix some issues we have with libxml2 merging nodes */ +static xmlNodePtr +xmlReplaceNodeWrapper(xmlNodePtr pivot, xmlNodePtr new_node) +{ + xmlNodePtr retval ; + + retval = xmlReplaceNode(pivot, new_node) ; + + if (retval == pivot) { + retval = new_node ; /* return semantics for reparent_node_with */ + } + + /* work around libxml2 issue: https://bugzilla.gnome.org/show_bug.cgi?id=615612 */ + if (retval && retval->type == XML_TEXT_NODE) { + if (retval->prev && retval->prev->type == XML_TEXT_NODE) { + retval = xmlTextMerge(retval->prev, retval); + } + if (retval->next && retval->next->type == XML_TEXT_NODE) { + retval = xmlTextMerge(retval, retval->next); + } + } + + return retval ; +} + + +static void +raise_if_ancestor_of_self(xmlNodePtr self) +{ + for (xmlNodePtr ancestor = self->parent ; ancestor ; ancestor = ancestor->parent) { + if (self == ancestor) { + rb_raise(rb_eRuntimeError, "cycle detected: node '%s' is an ancestor of itself", self->name); + } + } +} + + +static VALUE +reparent_node_with(VALUE pivot_obj, VALUE reparentee_obj, pivot_reparentee_func prf) +{ + VALUE reparented_obj ; + xmlNodePtr reparentee, original_reparentee, pivot, reparented, next_text, new_next_text, parent ; + int original_ns_prefix_is_default = 0 ; + + if (!rb_obj_is_kind_of(reparentee_obj, cNokogiriXmlNode)) { + rb_raise(rb_eArgError, "node must be a Nokogiri::XML::Node"); + } + if (rb_obj_is_kind_of(reparentee_obj, cNokogiriXmlDocument)) { + rb_raise(rb_eArgError, "node must be a Nokogiri::XML::Node"); + } + + Data_Get_Struct(reparentee_obj, xmlNode, reparentee); + Data_Get_Struct(pivot_obj, xmlNode, pivot); + + /* + * Check if nodes given are appropriate to have a parent-child + * relationship, based on the DOM specification. + * + * cf. http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1590626202 + */ + if (prf == xmlAddChild) { + parent = pivot; + } else { + parent = pivot->parent; + } + + if (parent) { + switch (parent->type) { + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: + switch (reparentee->type) { + case XML_ELEMENT_NODE: + case XML_PI_NODE: + case XML_COMMENT_NODE: + case XML_DOCUMENT_TYPE_NODE: + /* + * The DOM specification says no to adding text-like nodes + * directly to a document, but we allow it for compatibility. + */ + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_ENTITY_REF_NODE: + goto ok; + default: + break; + } + break; + case XML_DOCUMENT_FRAG_NODE: + case XML_ENTITY_REF_NODE: + case XML_ELEMENT_NODE: + switch (reparentee->type) { + case XML_ELEMENT_NODE: + case XML_PI_NODE: + case XML_COMMENT_NODE: + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + case XML_ENTITY_REF_NODE: + goto ok; + default: + break; + } + break; + case XML_ATTRIBUTE_NODE: + switch (reparentee->type) { + case XML_TEXT_NODE: + case XML_ENTITY_REF_NODE: + goto ok; + default: + break; + } + break; + case XML_TEXT_NODE: + /* + * xmlAddChild() breaks the DOM specification in that it allows + * adding a text node to another, in which case text nodes are + * coalesced, but since our JRuby version does not support such + * operation, we should inhibit it. + */ + break; + default: + break; + } + + rb_raise(rb_eArgError, "cannot reparent %s there", rb_obj_classname(reparentee_obj)); + } + +ok: + original_reparentee = reparentee; + + if (reparentee->doc != pivot->doc || reparentee->type == XML_TEXT_NODE) { + /* + * if the reparentee is a text node, there's a very good chance it will be + * merged with an adjacent text node after being reparented, and in that case + * libxml will free the underlying C struct. + * + * since we clearly have a ruby object which references the underlying + * memory, we can't let the C struct get freed. let's pickle the original + * reparentee by rooting it; and then we'll reparent a duplicate of the + * node that we don't care about preserving. + * + * alternatively, if the reparentee is from a different document than the + * pivot node, libxml2 is going to get confused about which document's + * "dictionary" the node's strings belong to (this is an otherwise + * uninteresting libxml2 implementation detail). as a result, we cannot + * reparent the actual reparentee, so we reparent a duplicate. + */ + if (reparentee->type == XML_TEXT_NODE && reparentee->_private) { + /* + * additionally, since we know this C struct isn't going to be related to + * a Ruby object anymore, let's break the relationship on this end as + * well. + * + * this is not absolutely necessary unless libxml-ruby is also in effect, + * in which case its global callback `rxml_node_deregisterNode` will try + * to do things to our data. + * + * for more details on this particular (and particularly nasty) edge + * case, see: + * + * https://github.com/sparklemotion/nokogiri/issues/1426 + */ + reparentee->_private = NULL ; + } + + if (reparentee->ns != NULL && reparentee->ns->prefix == NULL) { + original_ns_prefix_is_default = 1; + } + + noko_xml_document_pin_node(reparentee); + + if (!(reparentee = xmlDocCopyNode(reparentee, pivot->doc, 1))) { + rb_raise(rb_eRuntimeError, "Could not reparent node (xmlDocCopyNode)"); + } + + if (original_ns_prefix_is_default && reparentee->ns != NULL && reparentee->ns->prefix != NULL) { + /* + * issue #391, where new node's prefix may become the string "default" + * see libxml2 tree.c xmlNewReconciliedNs which implements this behavior. + */ + xmlFree(DISCARD_CONST_QUAL_XMLCHAR(reparentee->ns->prefix)); + reparentee->ns->prefix = NULL; + } + } + + xmlUnlinkNode(original_reparentee); + + if (prf != xmlAddPrevSibling && prf != xmlAddNextSibling + && reparentee->type == XML_TEXT_NODE && pivot->next && pivot->next->type == XML_TEXT_NODE) { + /* + * libxml merges text nodes in a right-to-left fashion, meaning that if + * there are two text nodes who would be adjacent, the right (or following, + * or next) node will be merged into the left (or preceding, or previous) + * node. + * + * and by "merged" I mean the string contents will be concatenated onto the + * left node's contents, and then the node will be freed. + * + * which means that if we have a ruby object wrapped around the right node, + * its memory would be freed out from under it. + * + * so, we detect this edge case and unlink-and-root the text node before it gets + * merged. then we dup the node and insert that duplicate back into the + * document where the real node was. + * + * yes, this is totally lame. + */ + next_text = pivot->next ; + new_next_text = xmlDocCopyNode(next_text, pivot->doc, 1) ; + + xmlUnlinkNode(next_text); + noko_xml_document_pin_node(next_text); + + xmlAddNextSibling(pivot, new_next_text); + } + + if (!(reparented = (*prf)(pivot, reparentee))) { + rb_raise(rb_eRuntimeError, "Could not reparent node"); + } + + /* + * make sure the ruby object is pointed at the just-reparented node, which + * might be a duplicate (see above) or might be the result of merging + * adjacent text nodes. + */ + DATA_PTR(reparentee_obj) = reparented ; + reparented_obj = noko_xml_node_wrap(Qnil, reparented); + + rb_funcall(reparented_obj, id_decorate_bang, 0); + + /* if we've created a cycle, raise an exception */ + raise_if_ancestor_of_self(reparented); + + relink_namespace(reparented); + + return reparented_obj ; +} + +// :startdoc: + +/* + * :call-seq: + * add_namespace_definition(prefix, href) → Nokogiri::XML::Namespace + * add_namespace(prefix, href) → Nokogiri::XML::Namespace + * + * :category: Manipulating Document Structure + * + * Adds a namespace definition to this node with +prefix+ using +href+ value, as if this node had + * included an attribute "xmlns:prefix=href". + * + * A default namespace definition for this node can be added by passing +nil+ for +prefix+. + * + * [Parameters] + * - +prefix+ (String, +nil+) An {XML Name}[https://www.w3.org/TR/xml-names/#ns-decl] + * - +href+ (String) The {URI reference}[https://www.w3.org/TR/xml-names/#sec-namespaces] + * + * [Returns] The new Nokogiri::XML::Namespace + * + * *Example:* adding a non-default namespace definition + * + * doc = Nokogiri::XML("") + * inventory = doc.at_css("inventory") + * inventory.add_namespace_definition("automobile", "http://alices-autos.com/") + * inventory.add_namespace_definition("bicycle", "http://bobs-bikes.com/") + * inventory.add_child("Michelin model XGV, size 75R") + * doc.to_xml + * # => "\n" + + * # "\n" + + * # " \n" + + * # " Michelin model XGV, size 75R\n" + + * # " \n" + + * # "\n" + * + * *Example:* adding a default namespace definition + * + * doc = Nokogiri::XML("Michelin model XGV, size 75R") + * doc.at_css("tire").add_namespace_definition(nil, "http://bobs-bikes.com/") + * doc.to_xml + * # => "\n" + + * # "\n" + + * # " \n" + + * # " Michelin model XGV, size 75R\n" + + * # " \n" + + * # "\n" + * + */ +static VALUE +rb_xml_node_add_namespace_definition(VALUE rb_node, VALUE rb_prefix, VALUE rb_href) +{ + xmlNodePtr c_node, element; + xmlNsPtr c_namespace; + const xmlChar *c_prefix = (const xmlChar *)(NIL_P(rb_prefix) ? NULL : StringValueCStr(rb_prefix)); + + Data_Get_Struct(rb_node, xmlNode, c_node); + element = c_node ; + + c_namespace = xmlSearchNs(c_node->doc, c_node, c_prefix); + + if (!c_namespace) { + if (c_node->type != XML_ELEMENT_NODE) { + element = c_node->parent; + } + c_namespace = xmlNewNs(element, (const xmlChar *)StringValueCStr(rb_href), c_prefix); + } + + if (!c_namespace) { + return Qnil ; + } + + if (NIL_P(rb_prefix) || c_node != element) { + xmlSetNs(c_node, c_namespace); + } + + return noko_xml_namespace_wrap(c_namespace, c_node->doc); +} + + +/* + * :call-seq: attribute(name) → Nokogiri::XML::Attr + * + * :category: Working With Node Attributes + * + * [Returns] Attribute (Nokogiri::XML::Attr) belonging to this node with name +name+. + * + * ⚠ Note that attribute namespaces are ignored and only the simple (non-namespace-prefixed) name is + * used to find a matching attribute. In case of a simple name collision, only one of the matching + * attributes will be returned. In this case, you will need to use #attribute_with_ns. + * + * *Example:* + * + * doc = Nokogiri::XML("") + * child = doc.at_css("child") + * child.attribute("size") # => # + * child.attribute("class") # => # + * + * *Example* showing that namespaced attributes will not be returned: + * + * ⚠ Note that only one of the two matching attributes is returned. + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * EOF + * doc.at_css("child").attribute("size") + * # => #(Attr:0x550 { + * # name = "size", + * # namespace = #(Namespace:0x564 { + * # prefix = "width", + * # href = "http://example.com/widths" + * # }), + * # value = "broad" + * # }) + */ +static VALUE +rb_xml_node_attribute(VALUE self, VALUE name) +{ + xmlNodePtr node; + xmlAttrPtr prop; + Data_Get_Struct(self, xmlNode, node); + prop = xmlHasProp(node, (xmlChar *)StringValueCStr(name)); + + if (! prop) { return Qnil; } + return noko_xml_node_wrap(Qnil, (xmlNodePtr)prop); +} + + +/* + * :call-seq: attribute_nodes() → Array + * + * :category: Working With Node Attributes + * + * [Returns] Attributes (an Array of Nokogiri::XML::Attr) belonging to this node. + * + * Note that this is the preferred alternative to #attributes when the simple + * (non-namespace-prefixed) attribute names may collide. + * + * *Example:* + * + * Contrast this with the colliding-name example from #attributes. + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * EOF + * doc.at_css("child").attribute_nodes + * # => [#(Attr:0x550 { + * # name = "size", + * # namespace = #(Namespace:0x564 { + * # prefix = "width", + * # href = "http://example.com/widths" + * # }), + * # value = "broad" + * # }), + * # #(Attr:0x578 { + * # name = "size", + * # namespace = #(Namespace:0x58c { + * # prefix = "height", + * # href = "http://example.com/heights" + * # }), + * # value = "tall" + * # })] + */ +static VALUE +rb_xml_node_attribute_nodes(VALUE rb_node) +{ + xmlNodePtr c_node; + + Data_Get_Struct(rb_node, xmlNode, c_node); + + return noko_xml_node_attrs(c_node); +} + + +/* + * :call-seq: attribute_with_ns(name, namespace) → Nokogiri::XML::Attr + * + * :category: Working With Node Attributes + * + * [Returns] + * Attribute (Nokogiri::XML::Attr) belonging to this node with matching +name+ and +namespace+. + * + * [Parameters] + * - +name+ (String): the simple (non-namespace-prefixed) name of the attribute + * - +namespace+ (String): the URI of the attribute's namespace + * + * See related: #attribute + * + * *Example:* + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * EOF + * doc.at_css("child").attribute_with_ns("size", "http://example.com/widths") + * # => #(Attr:0x550 { + * # name = "size", + * # namespace = #(Namespace:0x564 { + * # prefix = "width", + * # href = "http://example.com/widths" + * # }), + * # value = "broad" + * # }) + * doc.at_css("child").attribute_with_ns("size", "http://example.com/heights") + * # => #(Attr:0x578 { + * # name = "size", + * # namespace = #(Namespace:0x58c { + * # prefix = "height", + * # href = "http://example.com/heights" + * # }), + * # value = "tall" + * # }) + */ +static VALUE +rb_xml_node_attribute_with_ns(VALUE self, VALUE name, VALUE namespace) +{ + xmlNodePtr node; + xmlAttrPtr prop; + Data_Get_Struct(self, xmlNode, node); + prop = xmlHasNsProp(node, (xmlChar *)StringValueCStr(name), + NIL_P(namespace) ? NULL : (xmlChar *)StringValueCStr(namespace)); + + if (! prop) { return Qnil; } + return noko_xml_node_wrap(Qnil, (xmlNodePtr)prop); +} + + + +/* + * call-seq: blank? → Boolean + * + * [Returns] +true+ if the node is an empty or whitespace-only text or cdata node, else +false+. + * + * *Example:* + * + * Nokogiri("").root.child.blank? # => false + * Nokogiri("\t \n").root.child.blank? # => true + * Nokogiri("").root.child.blank? # => true + * Nokogiri("not-blank").root.child + * .tap { |n| n.content = "" }.blank # => true + */ +static VALUE +rb_xml_node_blank_eh(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + return (1 == xmlIsBlankNode(node)) ? Qtrue : Qfalse ; +} + + +/* + * :call-seq: child() → Nokogiri::XML::Node + * + * :category: Traversing Document Structure + * + * [Returns] First of this node's children, or +nil+ if there are no children + * + * This is a convenience method and is equivalent to: + * + * node.children.first + * + * See related: #children + */ +static VALUE +rb_xml_node_child(VALUE self) +{ + xmlNodePtr node, child; + Data_Get_Struct(self, xmlNode, node); + + child = node->children; + if (!child) { return Qnil; } + + return noko_xml_node_wrap(Qnil, child); +} + + +/* + * :call-seq: children() → Nokogiri::XML::NodeSet + * + * :category: Traversing Document Structure + * + * [Returns] Nokogiri::XML::NodeSet containing this node's children. + */ +static VALUE +rb_xml_node_children(VALUE self) +{ + xmlNodePtr node; + xmlNodePtr child; + xmlNodeSetPtr set; + VALUE document; + VALUE node_set; + + Data_Get_Struct(self, xmlNode, node); + + child = node->children; + set = xmlXPathNodeSetCreate(child); + + document = DOC_RUBY_OBJECT(node->doc); + + if (!child) { return noko_xml_node_set_wrap(set, document); } + + child = child->next; + while (NULL != child) { + xmlXPathNodeSetAddUnique(set, child); + child = child->next; + } + + node_set = noko_xml_node_set_wrap(set, document); + + return node_set; +} + + +/* + * :call-seq: + * content() → String + * inner_text() → String + * text() → String + * to_str() → String + * + * [Returns] + * Contents of all the text nodes in this node's subtree, concatenated together into a single + * String. + * + * ⚠ Note that entities will _always_ be expanded in the returned String. + * + * See related: #inner_html + * + * *Example* of how entities are handled: + * + * Note that < becomes < in the returned String. + * + * doc = Nokogiri::XML.fragment("a < b") + * doc.at_css("child").content + * # => "a < b" + * + * *Example* of how a subtree is handled: + * + * Note that the tags are omitted and only the text node contents are returned, + * concatenated into a single string. + * + * doc = Nokogiri::XML.fragment("first second") + * doc.at_css("child").content + * # => "first second" + */ +static VALUE +rb_xml_node_content(VALUE self) +{ + xmlNodePtr node; + xmlChar *content; + + Data_Get_Struct(self, xmlNode, node); + + content = xmlNodeGetContent(node); + if (content) { + VALUE rval = NOKOGIRI_STR_NEW2(content); + xmlFree(content); + return rval; + } + return Qnil; +} + + +/* + * :call-seq: document() → Nokogiri::XML::Document + * + * :category: Traversing Document Structure + * + * [Returns] Parent Nokogiri::XML::Document for this node + */ +static VALUE +rb_xml_node_document(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + return DOC_RUBY_OBJECT(node->doc); +} + +/* + * :call-seq: pointer_id() → Integer + * + * [Returns] + * A unique id for this node based on the internal memory structures. This method is used by #== + * to determine node identity. + */ +static VALUE +rb_xml_node_pointer_id(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + + return INT2NUM((long)(node)); +} + +/* + * :call-seq: encode_special_chars(string) → String + * + * Encode any special characters in +string+ + */ +static VALUE +encode_special_chars(VALUE self, VALUE string) +{ + xmlNodePtr node; + xmlChar *encoded; + VALUE encoded_str; + + Data_Get_Struct(self, xmlNode, node); + encoded = xmlEncodeSpecialChars( + node->doc, + (const xmlChar *)StringValueCStr(string) + ); + + encoded_str = NOKOGIRI_STR_NEW2(encoded); + xmlFree(encoded); + + return encoded_str; +} + +/* + * :call-seq: + * create_internal_subset(name, external_id, system_id) + * + * Create the internal subset of a document. + * + * doc.create_internal_subset("chapter", "-//OASIS//DTD DocBook XML//EN", "chapter.dtd") + * # => + * + * doc.create_internal_subset("chapter", nil, "chapter.dtd") + * # => + */ +static VALUE +create_internal_subset(VALUE self, VALUE name, VALUE external_id, VALUE system_id) +{ + xmlNodePtr node; + xmlDocPtr doc; + xmlDtdPtr dtd; + + Data_Get_Struct(self, xmlNode, node); + + doc = node->doc; + + if (xmlGetIntSubset(doc)) { + rb_raise(rb_eRuntimeError, "Document already has an internal subset"); + } + + dtd = xmlCreateIntSubset( + doc, + NIL_P(name) ? NULL : (const xmlChar *)StringValueCStr(name), + NIL_P(external_id) ? NULL : (const xmlChar *)StringValueCStr(external_id), + NIL_P(system_id) ? NULL : (const xmlChar *)StringValueCStr(system_id) + ); + + if (!dtd) { return Qnil; } + + return noko_xml_node_wrap(Qnil, (xmlNodePtr)dtd); +} + +/* + * :call-seq: + * create_external_subset(name, external_id, system_id) + * + * Create an external subset + */ +static VALUE +create_external_subset(VALUE self, VALUE name, VALUE external_id, VALUE system_id) +{ + xmlNodePtr node; + xmlDocPtr doc; + xmlDtdPtr dtd; + + Data_Get_Struct(self, xmlNode, node); + + doc = node->doc; + + if (doc->extSubset) { + rb_raise(rb_eRuntimeError, "Document already has an external subset"); + } + + dtd = xmlNewDtd( + doc, + NIL_P(name) ? NULL : (const xmlChar *)StringValueCStr(name), + NIL_P(external_id) ? NULL : (const xmlChar *)StringValueCStr(external_id), + NIL_P(system_id) ? NULL : (const xmlChar *)StringValueCStr(system_id) + ); + + if (!dtd) { return Qnil; } + + return noko_xml_node_wrap(Qnil, (xmlNodePtr)dtd); +} + +/* + * :call-seq: + * external_subset() + * + * Get the external subset + */ +static VALUE +external_subset(VALUE self) +{ + xmlNodePtr node; + xmlDocPtr doc; + xmlDtdPtr dtd; + + Data_Get_Struct(self, xmlNode, node); + + if (!node->doc) { return Qnil; } + + doc = node->doc; + dtd = doc->extSubset; + + if (!dtd) { return Qnil; } + + return noko_xml_node_wrap(Qnil, (xmlNodePtr)dtd); +} + +/* + * :call-seq: + * internal_subset() + * + * Get the internal subset + */ +static VALUE +internal_subset(VALUE self) +{ + xmlNodePtr node; + xmlDocPtr doc; + xmlDtdPtr dtd; + + Data_Get_Struct(self, xmlNode, node); + + if (!node->doc) { return Qnil; } + + doc = node->doc; + dtd = xmlGetIntSubset(doc); + + if (!dtd) { return Qnil; } + + return noko_xml_node_wrap(Qnil, (xmlNodePtr)dtd); +} + +/* + * :call-seq: + * dup → Nokogiri::XML::Node + * dup(depth) → Nokogiri::XML::Node + * dup(depth, new_parent_doc) → Nokogiri::XML::Node + * + * Copy this node. + * + * [Parameters] + * - +depth+ 0 is a shallow copy, 1 (the default) is a deep copy. + * - +new_parent_doc+ + * The new node's parent Document. Defaults to the this node's document. + * + * [Returns] The new Nokgiri::XML::Node + */ +static VALUE +duplicate_node(int argc, VALUE *argv, VALUE self) +{ + VALUE r_level, r_new_parent_doc; + int level; + int n_args; + xmlDocPtr new_parent_doc; + xmlNodePtr node, dup; + + Data_Get_Struct(self, xmlNode, node); + + n_args = rb_scan_args(argc, argv, "02", &r_level, &r_new_parent_doc); + + if (n_args < 1) { + r_level = INT2NUM((long)1); + } + level = (int)NUM2INT(r_level); + + if (n_args < 2) { + new_parent_doc = node->doc; + } else { + Data_Get_Struct(r_new_parent_doc, xmlDoc, new_parent_doc); + } + + dup = xmlDocCopyNode(node, new_parent_doc, level); + if (dup == NULL) { return Qnil; } + + noko_xml_document_pin_node(dup); + + return noko_xml_node_wrap(rb_obj_class(self), dup); +} + +/* + * :call-seq: + * unlink() → self + * + * Unlink this node from its current context. + */ +static VALUE +unlink_node(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + xmlUnlinkNode(node); + noko_xml_document_pin_node(node); + return self; +} + + +/* + * call-seq: + * next_sibling + * + * Returns the next sibling node + */ +static VALUE +next_sibling(VALUE self) +{ + xmlNodePtr node, sibling; + Data_Get_Struct(self, xmlNode, node); + + sibling = node->next; + if (!sibling) { return Qnil; } + + return noko_xml_node_wrap(Qnil, sibling) ; +} + +/* + * call-seq: + * previous_sibling + * + * Returns the previous sibling node + */ +static VALUE +previous_sibling(VALUE self) +{ + xmlNodePtr node, sibling; + Data_Get_Struct(self, xmlNode, node); + + sibling = node->prev; + if (!sibling) { return Qnil; } + + return noko_xml_node_wrap(Qnil, sibling); +} + +/* + * call-seq: + * next_element + * + * Returns the next Nokogiri::XML::Element type sibling node. + */ +static VALUE +next_element(VALUE self) +{ + xmlNodePtr node, sibling; + Data_Get_Struct(self, xmlNode, node); + + sibling = xmlNextElementSibling(node); + if (!sibling) { return Qnil; } + + return noko_xml_node_wrap(Qnil, sibling); +} + +/* + * call-seq: + * previous_element + * + * Returns the previous Nokogiri::XML::Element type sibling node. + */ +static VALUE +previous_element(VALUE self) +{ + xmlNodePtr node, sibling; + Data_Get_Struct(self, xmlNode, node); + + /* + * note that we don't use xmlPreviousElementSibling here because it's buggy pre-2.7.7. + */ + sibling = node->prev; + if (!sibling) { return Qnil; } + + while (sibling && sibling->type != XML_ELEMENT_NODE) { + sibling = sibling->prev; + } + + return sibling ? noko_xml_node_wrap(Qnil, sibling) : Qnil ; +} + +/* :nodoc: */ +static VALUE +replace(VALUE self, VALUE new_node) +{ + VALUE reparent = reparent_node_with(self, new_node, xmlReplaceNodeWrapper); + + xmlNodePtr pivot; + Data_Get_Struct(self, xmlNode, pivot); + noko_xml_document_pin_node(pivot); + + return reparent; +} + +/* + * :call-seq: + * element_children() → NodeSet + * elements() → NodeSet + * + * [Returns] + * The node's child elements as a NodeSet. Only children that are elements will be returned, which + * notably excludes Text nodes. + * + * *Example:* + * + * Note that #children returns the Text node "hello" while #element_children does not. + * + * div = Nokogiri::HTML5("
helloworld").at_css("div") + * div.element_children + * # => [#]>] + * div.children + * # => [#, + * # #]>] + */ +static VALUE +rb_xml_node_element_children(VALUE self) +{ + xmlNodePtr node; + xmlNodePtr child; + xmlNodeSetPtr set; + VALUE document; + VALUE node_set; + + Data_Get_Struct(self, xmlNode, node); + + child = xmlFirstElementChild(node); + set = xmlXPathNodeSetCreate(child); + + document = DOC_RUBY_OBJECT(node->doc); + + if (!child) { return noko_xml_node_set_wrap(set, document); } + + child = xmlNextElementSibling(child); + while (NULL != child) { + xmlXPathNodeSetAddUnique(set, child); + child = xmlNextElementSibling(child); + } + + node_set = noko_xml_node_set_wrap(set, document); + + return node_set; +} + +/* + * :call-seq: + * first_element_child() → Node + * + * [Returns] The first child Node that is an element. + * + * *Example:* + * + * Note that the "hello" child, which is a Text node, is skipped and the element is + * returned. + * + * div = Nokogiri::HTML5("
helloworld").at_css("div") + * div.first_element_child + * # => #(Element:0x3c { name = "span", children = [ #(Text "world")] }) + */ +static VALUE +rb_xml_node_first_element_child(VALUE self) +{ + xmlNodePtr node, child; + Data_Get_Struct(self, xmlNode, node); + + child = xmlFirstElementChild(node); + if (!child) { return Qnil; } + + return noko_xml_node_wrap(Qnil, child); +} + +/* + * :call-seq: + * last_element_child() → Node + * + * [Returns] The last child Node that is an element. + * + * *Example:* + * + * Note that the "hello" child, which is a Text node, is skipped and the yes + * element is returned. + * + * div = Nokogiri::HTML5("
noyesskip
").at_css("div") + * div.last_element_child + * # => #(Element:0x3c { name = "span", children = [ #(Text "yes")] }) + */ +static VALUE +rb_xml_node_last_element_child(VALUE self) +{ + xmlNodePtr node, child; + Data_Get_Struct(self, xmlNode, node); + + child = xmlLastElementChild(node); + if (!child) { return Qnil; } + + return noko_xml_node_wrap(Qnil, child); +} + +/* + * call-seq: + * key?(attribute) + * + * Returns true if +attribute+ is set + */ +static VALUE +key_eh(VALUE self, VALUE attribute) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + if (xmlHasProp(node, (xmlChar *)StringValueCStr(attribute))) { + return Qtrue; + } + return Qfalse; +} + +/* + * call-seq: + * namespaced_key?(attribute, namespace) + * + * Returns true if +attribute+ is set with +namespace+ + */ +static VALUE +namespaced_key_eh(VALUE self, VALUE attribute, VALUE namespace) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + if (xmlHasNsProp(node, (xmlChar *)StringValueCStr(attribute), + NIL_P(namespace) ? NULL : (xmlChar *)StringValueCStr(namespace))) { + return Qtrue; + } + return Qfalse; +} + +/* + * call-seq: + * []=(property, value) + * + * Set the +property+ to +value+ + */ +static VALUE +set(VALUE self, VALUE property, VALUE value) +{ + xmlNodePtr node, cur; + xmlAttrPtr prop; + Data_Get_Struct(self, xmlNode, node); + + /* If a matching attribute node already exists, then xmlSetProp will destroy + * the existing node's children. However, if Nokogiri has a node object + * pointing to one of those children, we are left with a broken reference. + * + * We can avoid this by unlinking these nodes first. + */ + if (node->type != XML_ELEMENT_NODE) { + return (Qnil); + } + prop = xmlHasProp(node, (xmlChar *)StringValueCStr(property)); + if (prop && prop->children) { + for (cur = prop->children; cur; cur = cur->next) { + if (cur->_private) { + noko_xml_document_pin_node(cur); + xmlUnlinkNode(cur); + } + } + } + + xmlSetProp(node, (xmlChar *)StringValueCStr(property), + (xmlChar *)StringValueCStr(value)); + + return value; +} + +/* + * call-seq: + * get(attribute) + * + * Get the value for +attribute+ + */ +static VALUE +get(VALUE self, VALUE rattribute) +{ + xmlNodePtr node; + xmlChar *value = 0; + VALUE rvalue; + xmlChar *colon; + xmlChar *attribute, *attr_name, *prefix; + xmlNsPtr ns; + + if (NIL_P(rattribute)) { return Qnil; } + + Data_Get_Struct(self, xmlNode, node); + attribute = xmlCharStrdup(StringValueCStr(rattribute)); + + colon = DISCARD_CONST_QUAL_XMLCHAR(xmlStrchr(attribute, (const xmlChar)':')); + if (colon) { + /* split the attribute string into separate prefix and name by + * null-terminating the prefix at the colon */ + prefix = attribute; + attr_name = colon + 1; + (*colon) = 0; + + ns = xmlSearchNs(node->doc, node, prefix); + if (ns) { + value = xmlGetNsProp(node, attr_name, ns->href); + } else { + value = xmlGetProp(node, (xmlChar *)StringValueCStr(rattribute)); + } + } else { + value = xmlGetNoNsProp(node, attribute); + } + + xmlFree((void *)attribute); + if (!value) { return Qnil; } + + rvalue = NOKOGIRI_STR_NEW2(value); + xmlFree((void *)value); + + return rvalue ; +} + +/* + * call-seq: + * set_namespace(namespace) + * + * Set the namespace to +namespace+ + */ +static VALUE +set_namespace(VALUE self, VALUE namespace) +{ + xmlNodePtr node; + xmlNsPtr ns = NULL; + + Data_Get_Struct(self, xmlNode, node); + + if (!NIL_P(namespace)) { + Data_Get_Struct(namespace, xmlNs, ns); + } + + xmlSetNs(node, ns); + + return self; +} + +/* + * :call-seq: + * namespace() → Namespace + * + * [Returns] The Namespace of the element or attribute node, or +nil+ if there is no namespace. + * + * *Example:* + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * + * + * EOF + * doc.at_xpath("//first").namespace + * # => nil + * doc.at_xpath("//xmlns:second", "xmlns" => "http://example.com/child").namespace + * # => #(Namespace:0x3c { href = "http://example.com/child" }) + * doc.at_xpath("//foo:third", "foo" => "http://example.com/foo").namespace + * # => #(Namespace:0x50 { prefix = "foo", href = "http://example.com/foo" }) + */ +static VALUE +rb_xml_node_namespace(VALUE rb_node) +{ + xmlNodePtr c_node ; + Data_Get_Struct(rb_node, xmlNode, c_node); + + if (c_node->ns) { + return noko_xml_namespace_wrap(c_node->ns, c_node->doc); + } + + return Qnil ; +} + +/* + * :call-seq: + * namespace_definitions() → Array + * + * [Returns] + * Namespaces that are defined directly on this node, as an Array of Namespace objects. The array + * will be empty if no namespaces are defined on this node. + * + * *Example:* + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * + * + * EOF + * doc.at_xpath("//root:first", "root" => "http://example.com/root").namespace_definitions + * # => [] + * doc.at_xpath("//xmlns:second", "xmlns" => "http://example.com/child").namespace_definitions + * # => [#(Namespace:0x3c { href = "http://example.com/child" }), + * # #(Namespace:0x50 { + * # prefix = "unused", + * # href = "http://example.com/unused" + * # })] + * doc.at_xpath("//foo:third", "foo" => "http://example.com/foo").namespace_definitions + * # => [#(Namespace:0x64 { prefix = "foo", href = "http://example.com/foo" })] + */ +static VALUE +namespace_definitions(VALUE rb_node) +{ + /* this code in the mode of xmlHasProp() */ + xmlNodePtr c_node ; + xmlNsPtr c_namespace; + VALUE definitions = rb_ary_new(); + + Data_Get_Struct(rb_node, xmlNode, c_node); + + c_namespace = c_node->nsDef; + if (!c_namespace) { + return definitions; + } + + while (c_namespace != NULL) { + rb_ary_push(definitions, noko_xml_namespace_wrap(c_namespace, c_node->doc)); + c_namespace = c_namespace->next; + } + + return definitions; +} + +/* + * :call-seq: + * namespace_scopes() → Array + * + * [Returns] Array of all the Namespaces on this node and its ancestors. + * + * See also #namespaces + * + * *Example:* + * + * doc = Nokogiri::XML(<<~EOF) + * + * + * + * + * + * EOF + * doc.at_xpath("//root:first", "root" => "http://example.com/root").namespace_scopes + * # => [#(Namespace:0x3c { href = "http://example.com/root" }), + * # #(Namespace:0x50 { prefix = "bar", href = "http://example.com/bar" })] + * doc.at_xpath("//child:second", "child" => "http://example.com/child").namespace_scopes + * # => [#(Namespace:0x64 { href = "http://example.com/child" }), + * # #(Namespace:0x50 { prefix = "bar", href = "http://example.com/bar" })] + * doc.at_xpath("//root:third", "root" => "http://example.com/root").namespace_scopes + * # => [#(Namespace:0x78 { prefix = "foo", href = "http://example.com/foo" }), + * # #(Namespace:0x3c { href = "http://example.com/root" }), + * # #(Namespace:0x50 { prefix = "bar", href = "http://example.com/bar" })] + */ +static VALUE +rb_xml_node_namespace_scopes(VALUE rb_node) +{ + xmlNodePtr c_node ; + xmlNsPtr *namespaces; + VALUE scopes = rb_ary_new(); + int j; + + Data_Get_Struct(rb_node, xmlNode, c_node); + + namespaces = xmlGetNsList(c_node->doc, c_node); + if (!namespaces) { + return scopes; + } + + for (j = 0 ; namespaces[j] != NULL ; ++j) { + rb_ary_push(scopes, noko_xml_namespace_wrap(namespaces[j], c_node->doc)); + } + + xmlFree(namespaces); + return scopes; +} + +/* + * call-seq: + * node_type + * + * Get the type for this Node + */ +static VALUE +node_type(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + return INT2NUM((long)node->type); +} + +/* + * call-seq: + * content= + * + * Set the content for this Node + */ +static VALUE +set_native_content(VALUE self, VALUE content) +{ + xmlNodePtr node, child, next ; + Data_Get_Struct(self, xmlNode, node); + + child = node->children; + while (NULL != child) { + next = child->next ; + xmlUnlinkNode(child) ; + noko_xml_document_pin_node(child); + child = next ; + } + + xmlNodeSetContent(node, (xmlChar *)StringValueCStr(content)); + return content; +} + +/* + * call-seq: + * lang= + * + * Set the language of a node, i.e. the values of the xml:lang attribute. + */ +static VALUE +set_lang(VALUE self_rb, VALUE lang_rb) +{ + xmlNodePtr self ; + xmlChar *lang ; + + Data_Get_Struct(self_rb, xmlNode, self); + lang = (xmlChar *)StringValueCStr(lang_rb); + + xmlNodeSetLang(self, lang); + + return Qnil ; +} + +/* + * call-seq: + * lang + * + * Searches the language of a node, i.e. the values of the xml:lang attribute or + * the one carried by the nearest ancestor. + */ +static VALUE +get_lang(VALUE self_rb) +{ + xmlNodePtr self ; + xmlChar *lang ; + VALUE lang_rb ; + + Data_Get_Struct(self_rb, xmlNode, self); + + lang = xmlNodeGetLang(self); + if (lang) { + lang_rb = NOKOGIRI_STR_NEW2(lang); + xmlFree(lang); + return lang_rb ; + } + + return Qnil ; +} + +/* :nodoc: */ +static VALUE +add_child(VALUE self, VALUE new_child) +{ + return reparent_node_with(self, new_child, xmlAddChild); +} + +/* + * call-seq: + * parent + * + * Get the parent Node for this Node + */ +static VALUE +get_parent(VALUE self) +{ + xmlNodePtr node, parent; + Data_Get_Struct(self, xmlNode, node); + + parent = node->parent; + if (!parent) { return Qnil; } + + return noko_xml_node_wrap(Qnil, parent) ; +} + +/* + * call-seq: + * name=(new_name) + * + * Set the name for this Node + */ +static VALUE +set_name(VALUE self, VALUE new_name) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + xmlNodeSetName(node, (xmlChar *)StringValueCStr(new_name)); + return new_name; +} + +/* + * call-seq: + * name + * + * Returns the name for this Node + */ +static VALUE +get_name(VALUE self) +{ + xmlNodePtr node; + Data_Get_Struct(self, xmlNode, node); + if (node->name) { + return NOKOGIRI_STR_NEW2(node->name); + } + return Qnil; +} + +/* + * call-seq: + * path + * + * Returns the path associated with this Node + */ +static VALUE +rb_xml_node_path(VALUE rb_node) +{ + xmlNodePtr c_node; + xmlChar *c_path ; + VALUE rval; + + Data_Get_Struct(rb_node, xmlNode, c_node); + + c_path = xmlGetNodePath(c_node); + if (c_path == NULL) { + // see https://github.com/sparklemotion/nokogiri/issues/2250 + // this behavior is clearly undesirable, but is what libxml <= 2.9.10 returned, and so we + // do this for now to preserve the behavior across libxml2 versions. + rval = NOKOGIRI_STR_NEW2("?"); + } else { + rval = NOKOGIRI_STR_NEW2(c_path); + xmlFree(c_path); + } + + return rval ; +} + +/* :nodoc: */ +static VALUE +add_next_sibling(VALUE self, VALUE new_sibling) +{ + return reparent_node_with(self, new_sibling, xmlAddNextSibling) ; +} + +/* :nodoc: */ +static VALUE +add_previous_sibling(VALUE self, VALUE new_sibling) +{ + return reparent_node_with(self, new_sibling, xmlAddPrevSibling) ; +} + +/* + * call-seq: + * native_write_to(io, encoding, options) + * + * Write this Node to +io+ with +encoding+ and +options+ + */ +static VALUE +native_write_to( + VALUE self, + VALUE io, + VALUE encoding, + VALUE indent_string, + VALUE options +) +{ + xmlNodePtr node; + const char *before_indent; + xmlSaveCtxtPtr savectx; + + Data_Get_Struct(self, xmlNode, node); + + xmlIndentTreeOutput = 1; + + before_indent = xmlTreeIndentString; + + xmlTreeIndentString = StringValueCStr(indent_string); + + savectx = xmlSaveToIO( + (xmlOutputWriteCallback)noko_io_write, + (xmlOutputCloseCallback)noko_io_close, + (void *)io, + RTEST(encoding) ? StringValueCStr(encoding) : NULL, + (int)NUM2INT(options) + ); + + xmlSaveTree(savectx, node); + xmlSaveClose(savectx); + + xmlTreeIndentString = before_indent; + return io; +} + +/* + * :call-seq: + * line() → Integer + * + * [Returns] The line number of this Node. + * + * --- + * + * ⚠ The CRuby and JRuby implementations differ in important ways! + * + * Semantic differences: + * - The CRuby method reflects the node's line number in the parsed string + * - The JRuby method reflects the node's line number in the final DOM structure after + * corrections have been applied + * + * Performance differences: + * - The CRuby method is {O(1)}[https://en.wikipedia.org/wiki/Time_complexity#Constant_time] + * (constant time) + * - The JRuby method is {O(n)}[https://en.wikipedia.org/wiki/Time_complexity#Linear_time] (linear + * time, where n is the number of nodes before/above the element in the DOM) + * + * If you'd like to help improve the JRuby implementation, please review these issues and reach out + * to the maintainers: + * - https://github.com/sparklemotion/nokogiri/issues/1223 + * - https://github.com/sparklemotion/nokogiri/pull/2177 + * - https://github.com/sparklemotion/nokogiri/issues/2380 + */ +static VALUE +rb_xml_node_line(VALUE rb_node) +{ + xmlNodePtr c_node; + Data_Get_Struct(rb_node, xmlNode, c_node); + + return INT2NUM(xmlGetLineNo(c_node)); +} + +/* + * call-seq: + * line=(num) + * + * Sets the line for this Node. num must be less than 65535. + */ +static VALUE +rb_xml_node_line_set(VALUE rb_node, VALUE rb_line_number) +{ + xmlNodePtr c_node; + int line_number = NUM2INT(rb_line_number); + + Data_Get_Struct(rb_node, xmlNode, c_node); + + // libxml2 optionally uses xmlNode.psvi to store longer line numbers, but only for text nodes. + // search for "psvi" in SAX2.c and tree.c to learn more. + if (line_number < 65535) { + c_node->line = (short) line_number; + } else { + c_node->line = 65535; + if (c_node->type == XML_TEXT_NODE) { + c_node->psvi = (void *)(ptrdiff_t) line_number; + } + } + + return rb_line_number; +} + +/* :nodoc: documented in lib/nokogiri/xml/node.rb */ +static VALUE +rb_xml_node_new(int argc, VALUE *argv, VALUE klass) +{ + xmlNodePtr c_document_node; + xmlNodePtr c_node; + VALUE rb_name; + VALUE rb_document_node; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "2*", &rb_name, &rb_document_node, &rest); + + if (!rb_obj_is_kind_of(rb_document_node, cNokogiriXmlNode)) { + rb_raise(rb_eArgError, "document must be a Nokogiri::XML::Node"); + } + if (!rb_obj_is_kind_of(rb_document_node, cNokogiriXmlDocument)) { + // TODO: deprecate allowing Node + rb_warn("Passing a Node as the second parameter to Node.new is deprecated. Please pass a Document instead, or prefer an alternative constructor like Node#add_child. This will become an error in a future release of Nokogiri."); + } + Data_Get_Struct(rb_document_node, xmlNode, c_document_node); + + c_node = xmlNewNode(NULL, (xmlChar *)StringValueCStr(rb_name)); + c_node->doc = c_document_node->doc; + noko_xml_document_pin_node(c_node); + + rb_node = noko_xml_node_wrap( + klass == cNokogiriXmlNode ? (VALUE)NULL : klass, + c_node + ); + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +/* + * call-seq: + * dump_html + * + * Returns the Node as html. + */ +static VALUE +dump_html(VALUE self) +{ + xmlBufferPtr buf ; + xmlNodePtr node ; + VALUE html; + + Data_Get_Struct(self, xmlNode, node); + + buf = xmlBufferCreate() ; + htmlNodeDump(buf, node->doc, node); + html = NOKOGIRI_STR_NEW2(buf->content); + xmlBufferFree(buf); + return html ; +} + +/* + * call-seq: + * compare(other) + * + * Compare this Node to +other+ with respect to their Document + */ +static VALUE +compare(VALUE self, VALUE _other) +{ + xmlNodePtr node, other; + Data_Get_Struct(self, xmlNode, node); + Data_Get_Struct(_other, xmlNode, other); + + return INT2NUM((long)xmlXPathCmpNodes(other, node)); +} + + +/* + * call-seq: + * process_xincludes(options) + * + * Loads and substitutes all xinclude elements below the node. The + * parser context will be initialized with +options+. + */ +static VALUE +process_xincludes(VALUE self, VALUE options) +{ + int rcode ; + xmlNodePtr node; + VALUE error_list = rb_ary_new(); + + Data_Get_Struct(self, xmlNode, node); + + xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher); + rcode = xmlXIncludeProcessTreeFlags(node, (int)NUM2INT(options)); + xmlSetStructuredErrorFunc(NULL, NULL); + + if (rcode < 0) { + xmlErrorPtr error; + + error = xmlGetLastError(); + if (error) { + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } else { + rb_raise(rb_eRuntimeError, "Could not perform xinclude substitution"); + } + } + + return self; +} + + +/* TODO: DOCUMENT ME */ +static VALUE +in_context(VALUE self, VALUE _str, VALUE _options) +{ + xmlNodePtr node, list = 0, tmp, child_iter, node_children, doc_children; + xmlNodeSetPtr set; + xmlParserErrors error; + VALUE doc, err; + int doc_is_empty; + + Data_Get_Struct(self, xmlNode, node); + + doc = DOC_RUBY_OBJECT(node->doc); + err = rb_iv_get(doc, "@errors"); + doc_is_empty = (node->doc->children == NULL) ? 1 : 0; + node_children = node->children; + doc_children = node->doc->children; + + xmlSetStructuredErrorFunc((void *)err, Nokogiri_error_array_pusher); + + /* Twiddle global variable because of a bug in libxml2. + * http://git.gnome.org/browse/libxml2/commit/?id=e20fb5a72c83cbfc8e4a8aa3943c6be8febadab7 + */ +#ifndef HTML_PARSE_NOIMPLIED + htmlHandleOmittedElem(0); +#endif + + /* This function adds a fake node to the child of +node+. If the parser + * does not exit cleanly with XML_ERR_OK, the list is freed. This can + * leave the child pointers in a bad state if they were originally empty. + * + * http://git.gnome.org/browse/libxml2/tree/parser.c#n13177 + * */ + error = xmlParseInNodeContext(node, StringValuePtr(_str), + (int)RSTRING_LEN(_str), + (int)NUM2INT(_options), &list); + + /* xmlParseInNodeContext should not mutate the original document or node, + * so reassigning these pointers should be OK. The reason we're reassigning + * is because if there were errors, it's possible for the child pointers + * to be manipulated. */ + if (error != XML_ERR_OK) { + node->doc->children = doc_children; + node->children = node_children; + } + + /* make sure parent/child pointers are coherent so an unlink will work + * properly (#331) + */ + child_iter = node->doc->children ; + while (child_iter) { + child_iter->parent = (xmlNodePtr)node->doc; + child_iter = child_iter->next; + } + +#ifndef HTML_PARSE_NOIMPLIED + htmlHandleOmittedElem(1); +#endif + + xmlSetStructuredErrorFunc(NULL, NULL); + + /* Workaround for a libxml2 bug where a parsing error may leave a broken + * node reference in node->doc->children. + * This workaround is limited to when a parse error occurs, the document + * went from having no children to having children, and the context node is + * part of a document fragment. + * https://bugzilla.gnome.org/show_bug.cgi?id=668155 + */ + if (error != XML_ERR_OK && doc_is_empty && node->doc->children != NULL) { + child_iter = node; + while (child_iter->parent) { + child_iter = child_iter->parent; + } + + if (child_iter->type == XML_DOCUMENT_FRAG_NODE) { + node->doc->children = NULL; + } + } + + /* FIXME: This probably needs to handle more constants... */ + switch (error) { + case XML_ERR_INTERNAL_ERROR: + case XML_ERR_NO_MEMORY: + rb_raise(rb_eRuntimeError, "error parsing fragment (%d)", error); + break; + default: + break; + } + + set = xmlXPathNodeSetCreate(NULL); + + while (list) { + tmp = list->next; + list->next = NULL; + xmlXPathNodeSetAddUnique(set, list); + noko_xml_document_pin_node(list); + list = tmp; + } + + return noko_xml_node_set_wrap(set, doc); +} + + +VALUE +noko_xml_node_wrap(VALUE rb_class, xmlNodePtr c_node) +{ + VALUE rb_document, rb_node_cache, rb_node; + nokogiriTuplePtr node_has_a_document; + xmlDocPtr c_doc; + void (*f_mark)(xmlNodePtr) = NULL ; + + assert(c_node); + + if (c_node->type == XML_DOCUMENT_NODE || c_node->type == XML_HTML_DOCUMENT_NODE) { + return DOC_RUBY_OBJECT(c_node->doc); + } + + /* It's OK if the node doesn't have a fully-realized document (as in XML::Reader). */ + /* see https://github.com/sparklemotion/nokogiri/issues/95 */ + /* and https://github.com/sparklemotion/nokogiri/issues/439 */ + c_doc = c_node->doc; + if (c_doc->type == XML_DOCUMENT_FRAG_NODE) { c_doc = c_doc->doc; } + node_has_a_document = DOC_RUBY_OBJECT_TEST(c_doc); + + if (c_node->_private && node_has_a_document) { + return (VALUE)c_node->_private; + } + + if (!RTEST(rb_class)) { + switch (c_node->type) { + case XML_ELEMENT_NODE: + rb_class = cNokogiriXmlElement; + break; + case XML_TEXT_NODE: + rb_class = cNokogiriXmlText; + break; + case XML_ATTRIBUTE_NODE: + rb_class = cNokogiriXmlAttr; + break; + case XML_ENTITY_REF_NODE: + rb_class = cNokogiriXmlEntityReference; + break; + case XML_COMMENT_NODE: + rb_class = cNokogiriXmlComment; + break; + case XML_DOCUMENT_FRAG_NODE: + rb_class = cNokogiriXmlDocumentFragment; + break; + case XML_PI_NODE: + rb_class = cNokogiriXmlProcessingInstruction; + break; + case XML_ENTITY_DECL: + rb_class = cNokogiriXmlEntityDecl; + break; + case XML_CDATA_SECTION_NODE: + rb_class = cNokogiriXmlCData; + break; + case XML_DTD_NODE: + rb_class = cNokogiriXmlDtd; + break; + case XML_ATTRIBUTE_DECL: + rb_class = cNokogiriXmlAttributeDecl; + break; + case XML_ELEMENT_DECL: + rb_class = cNokogiriXmlElementDecl; + break; + default: + rb_class = cNokogiriXmlNode; + } + } + + f_mark = node_has_a_document ? _xml_node_mark : NULL ; + + rb_node = Data_Wrap_Struct(rb_class, f_mark, _xml_node_dealloc, c_node) ; + c_node->_private = (void *)rb_node; + + if (node_has_a_document) { + rb_document = DOC_RUBY_OBJECT(c_doc); + rb_node_cache = DOC_NODE_CACHE(c_doc); + rb_ary_push(rb_node_cache, rb_node); + rb_funcall(rb_document, id_decorate, 1, rb_node); + } + + return rb_node ; +} + + +/* + * return Array containing the node's attributes + */ +VALUE +noko_xml_node_attrs(xmlNodePtr c_node) +{ + VALUE rb_properties = rb_ary_new(); + xmlAttrPtr c_property; + + c_property = c_node->properties ; + while (c_property != NULL) { + rb_ary_push(rb_properties, noko_xml_node_wrap(Qnil, (xmlNodePtr)c_property)); + c_property = c_property->next ; + } + + return rb_properties; +} + +void +noko_init_xml_node() +{ + cNokogiriXmlNode = rb_define_class_under(mNokogiriXml, "Node", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlNode, "new", rb_xml_node_new, -1); + + rb_define_method(cNokogiriXmlNode, "add_namespace_definition", rb_xml_node_add_namespace_definition, 2); + rb_define_method(cNokogiriXmlNode, "attribute", rb_xml_node_attribute, 1); + rb_define_method(cNokogiriXmlNode, "attribute_nodes", rb_xml_node_attribute_nodes, 0); + rb_define_method(cNokogiriXmlNode, "attribute_with_ns", rb_xml_node_attribute_with_ns, 2); + rb_define_method(cNokogiriXmlNode, "blank?", rb_xml_node_blank_eh, 0); + rb_define_method(cNokogiriXmlNode, "child", rb_xml_node_child, 0); + rb_define_method(cNokogiriXmlNode, "children", rb_xml_node_children, 0); + rb_define_method(cNokogiriXmlNode, "content", rb_xml_node_content, 0); + rb_define_method(cNokogiriXmlNode, "create_external_subset", create_external_subset, 3); + rb_define_method(cNokogiriXmlNode, "create_internal_subset", create_internal_subset, 3); + rb_define_method(cNokogiriXmlNode, "document", rb_xml_node_document, 0); + rb_define_method(cNokogiriXmlNode, "dup", duplicate_node, -1); + rb_define_method(cNokogiriXmlNode, "element_children", rb_xml_node_element_children, 0); + rb_define_method(cNokogiriXmlNode, "encode_special_chars", encode_special_chars, 1); + rb_define_method(cNokogiriXmlNode, "external_subset", external_subset, 0); + rb_define_method(cNokogiriXmlNode, "first_element_child", rb_xml_node_first_element_child, 0); + rb_define_method(cNokogiriXmlNode, "internal_subset", internal_subset, 0); + rb_define_method(cNokogiriXmlNode, "key?", key_eh, 1); + rb_define_method(cNokogiriXmlNode, "lang", get_lang, 0); + rb_define_method(cNokogiriXmlNode, "lang=", set_lang, 1); + rb_define_method(cNokogiriXmlNode, "last_element_child", rb_xml_node_last_element_child, 0); + rb_define_method(cNokogiriXmlNode, "line", rb_xml_node_line, 0); + rb_define_method(cNokogiriXmlNode, "line=", rb_xml_node_line_set, 1); + rb_define_method(cNokogiriXmlNode, "namespace", rb_xml_node_namespace, 0); + rb_define_method(cNokogiriXmlNode, "namespace_definitions", namespace_definitions, 0); + rb_define_method(cNokogiriXmlNode, "namespace_scopes", rb_xml_node_namespace_scopes, 0); + rb_define_method(cNokogiriXmlNode, "namespaced_key?", namespaced_key_eh, 2); + rb_define_method(cNokogiriXmlNode, "native_content=", set_native_content, 1); + rb_define_method(cNokogiriXmlNode, "next_element", next_element, 0); + rb_define_method(cNokogiriXmlNode, "next_sibling", next_sibling, 0); + rb_define_method(cNokogiriXmlNode, "node_name", get_name, 0); + rb_define_method(cNokogiriXmlNode, "node_name=", set_name, 1); + rb_define_method(cNokogiriXmlNode, "node_type", node_type, 0); + rb_define_method(cNokogiriXmlNode, "parent", get_parent, 0); + rb_define_method(cNokogiriXmlNode, "path", rb_xml_node_path, 0); + rb_define_method(cNokogiriXmlNode, "pointer_id", rb_xml_node_pointer_id, 0); + rb_define_method(cNokogiriXmlNode, "previous_element", previous_element, 0); + rb_define_method(cNokogiriXmlNode, "previous_sibling", previous_sibling, 0); + rb_define_method(cNokogiriXmlNode, "unlink", unlink_node, 0); + + rb_define_private_method(cNokogiriXmlNode, "add_child_node", add_child, 1); + rb_define_private_method(cNokogiriXmlNode, "add_next_sibling_node", add_next_sibling, 1); + rb_define_private_method(cNokogiriXmlNode, "add_previous_sibling_node", add_previous_sibling, 1); + rb_define_private_method(cNokogiriXmlNode, "compare", compare, 1); + rb_define_private_method(cNokogiriXmlNode, "dump_html", dump_html, 0); + rb_define_private_method(cNokogiriXmlNode, "get", get, 1); + rb_define_private_method(cNokogiriXmlNode, "in_context", in_context, 2); + rb_define_private_method(cNokogiriXmlNode, "native_write_to", native_write_to, 4); + rb_define_private_method(cNokogiriXmlNode, "process_xincludes", process_xincludes, 1); + rb_define_private_method(cNokogiriXmlNode, "replace_node", replace, 1); + rb_define_private_method(cNokogiriXmlNode, "set", set, 2); + rb_define_private_method(cNokogiriXmlNode, "set_namespace", set_namespace, 1); + + id_decorate = rb_intern("decorate"); + id_decorate_bang = rb_intern("decorate!"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node_set.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node_set.c new file mode 100644 index 0000000..5670371 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_node_set.c @@ -0,0 +1,498 @@ +#include + +VALUE cNokogiriXmlNodeSet ; + +static ID decorate ; + +static void +Check_Node_Set_Node_Type(VALUE node) +{ + if (!(rb_obj_is_kind_of(node, cNokogiriXmlNode) || + rb_obj_is_kind_of(node, cNokogiriXmlNamespace))) { + rb_raise(rb_eArgError, "node must be a Nokogiri::XML::Node or Nokogiri::XML::Namespace"); + } +} + + +static +VALUE +ruby_object_get(xmlNodePtr c_node) +{ + /* see xmlElementType in libxml2 tree.h */ + switch (c_node->type) { + case XML_NAMESPACE_DECL: + /* _private is later in the namespace struct */ + return (VALUE)(((xmlNsPtr)c_node)->_private); + + case XML_DOCUMENT_NODE: + case XML_HTML_DOCUMENT_NODE: + /* in documents we use _private to store a tuple */ + if (DOC_RUBY_OBJECT_TEST(((xmlDocPtr)c_node))) { + return DOC_RUBY_OBJECT((xmlDocPtr)c_node); + } + return (VALUE)NULL; + + default: + return (VALUE)(c_node->_private); + } +} + + +static void +mark(xmlNodeSetPtr node_set) +{ + VALUE rb_node; + int jnode; + + for (jnode = 0; jnode < node_set->nodeNr; jnode++) { + rb_node = ruby_object_get(node_set->nodeTab[jnode]); + if (rb_node) { + rb_gc_mark(rb_node); + } + } +} + +static void +xpath_node_set_del(xmlNodeSetPtr cur, xmlNodePtr val) +{ + /* + * For reasons outlined in xml_namespace.c, here we reproduce xmlXPathNodeSetDel() except for the + * offending call to xmlXPathNodeSetFreeNs(). + */ + int i; + + if (cur == NULL) { return; } + if (val == NULL) { return; } + + /* + * find node in nodeTab + */ + for (i = 0; i < cur->nodeNr; i++) + if (cur->nodeTab[i] == val) { break; } + + if (i >= cur->nodeNr) { /* not found */ + return; + } + cur->nodeNr--; + for (; i < cur->nodeNr; i++) { + cur->nodeTab[i] = cur->nodeTab[i + 1]; + } + cur->nodeTab[cur->nodeNr] = NULL; +} + + +static void +deallocate(xmlNodeSetPtr node_set) +{ + /* + * For reasons outlined in xml_namespace.c, here we reproduce xmlXPathFreeNodeSet() except for the + * offending call to xmlXPathNodeSetFreeNs(). + */ + NOKOGIRI_DEBUG_START(node_set) ; + if (node_set->nodeTab != NULL) { + xmlFree(node_set->nodeTab); + } + + xmlFree(node_set); + NOKOGIRI_DEBUG_END(node_set) ; +} + + +static VALUE +allocate(VALUE klass) +{ + return noko_xml_node_set_wrap(xmlXPathNodeSetCreate(NULL), Qnil); +} + + +/* + * call-seq: + * dup + * + * Duplicate this NodeSet. Note that the Nodes contained in the NodeSet are not + * duplicated (similar to how Array and other Enumerable classes work). + */ +static VALUE +duplicate(VALUE self) +{ + xmlNodeSetPtr node_set; + xmlNodeSetPtr dupl; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + dupl = xmlXPathNodeSetMerge(NULL, node_set); + + return noko_xml_node_set_wrap(dupl, rb_iv_get(self, "@document")); +} + +/* + * call-seq: + * length + * + * Get the length of the node set + */ +static VALUE +length(VALUE self) +{ + xmlNodeSetPtr node_set; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + return node_set ? INT2NUM(node_set->nodeNr) : INT2NUM(0); +} + +/* + * call-seq: + * push(node) + * + * Append +node+ to the NodeSet. + */ +static VALUE +push(VALUE self, VALUE rb_node) +{ + xmlNodeSetPtr node_set; + xmlNodePtr node; + + Check_Node_Set_Node_Type(rb_node); + + Data_Get_Struct(self, xmlNodeSet, node_set); + Data_Get_Struct(rb_node, xmlNode, node); + + xmlXPathNodeSetAdd(node_set, node); + + return self; +} + +/* + * call-seq: + * delete(node) + * + * Delete +node+ from the Nodeset, if it is a member. Returns the deleted node + * if found, otherwise returns nil. + */ +static VALUE +delete (VALUE self, VALUE rb_node) +{ + xmlNodeSetPtr node_set; + xmlNodePtr node; + + Check_Node_Set_Node_Type(rb_node); + + Data_Get_Struct(self, xmlNodeSet, node_set); + Data_Get_Struct(rb_node, xmlNode, node); + + if (xmlXPathNodeSetContains(node_set, node)) { + xpath_node_set_del(node_set, node); + return rb_node; + } + return Qnil ; +} + + +/* + * call-seq: + * &(node_set) + * + * Set Intersection — Returns a new NodeSet containing nodes common to the two NodeSets. + */ +static VALUE +intersection(VALUE self, VALUE rb_other) +{ + xmlNodeSetPtr node_set, other ; + xmlNodeSetPtr intersection; + + if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) { + rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet"); + } + + Data_Get_Struct(self, xmlNodeSet, node_set); + Data_Get_Struct(rb_other, xmlNodeSet, other); + + intersection = xmlXPathIntersection(node_set, other); + return noko_xml_node_set_wrap(intersection, rb_iv_get(self, "@document")); +} + + +/* + * call-seq: + * include?(node) + * + * Returns true if any member of node set equals +node+. + */ +static VALUE +include_eh(VALUE self, VALUE rb_node) +{ + xmlNodeSetPtr node_set; + xmlNodePtr node; + + Check_Node_Set_Node_Type(rb_node); + + Data_Get_Struct(self, xmlNodeSet, node_set); + Data_Get_Struct(rb_node, xmlNode, node); + + return (xmlXPathNodeSetContains(node_set, node) ? Qtrue : Qfalse); +} + + +/* + * call-seq: + * |(node_set) + * + * Returns a new set built by merging the set and the elements of the given + * set. + */ +static VALUE +rb_xml_node_set_union(VALUE rb_node_set, VALUE rb_other) +{ + xmlNodeSetPtr c_node_set, c_other; + xmlNodeSetPtr c_new_node_set; + + if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) { + rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet"); + } + + Data_Get_Struct(rb_node_set, xmlNodeSet, c_node_set); + Data_Get_Struct(rb_other, xmlNodeSet, c_other); + + c_new_node_set = xmlXPathNodeSetMerge(NULL, c_node_set); + c_new_node_set = xmlXPathNodeSetMerge(c_new_node_set, c_other); + + return noko_xml_node_set_wrap(c_new_node_set, rb_iv_get(rb_node_set, "@document")); +} + +/* + * call-seq: + * -(node_set) + * + * Difference - returns a new NodeSet that is a copy of this NodeSet, removing + * each item that also appears in +node_set+ + */ +static VALUE +minus(VALUE self, VALUE rb_other) +{ + xmlNodeSetPtr node_set, other; + xmlNodeSetPtr new; + int j ; + + if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) { + rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet"); + } + + Data_Get_Struct(self, xmlNodeSet, node_set); + Data_Get_Struct(rb_other, xmlNodeSet, other); + + new = xmlXPathNodeSetMerge(NULL, node_set); + for (j = 0 ; j < other->nodeNr ; ++j) { + xpath_node_set_del(new, other->nodeTab[j]); + } + + return noko_xml_node_set_wrap(new, rb_iv_get(self, "@document")); +} + + +static VALUE +index_at(VALUE self, long offset) +{ + xmlNodeSetPtr node_set; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + if (offset >= node_set->nodeNr || abs((int)offset) > node_set->nodeNr) { + return Qnil; + } + + if (offset < 0) { offset += node_set->nodeNr ; } + + return noko_xml_node_wrap_node_set_result(node_set->nodeTab[offset], self); +} + +static VALUE +subseq(VALUE self, long beg, long len) +{ + long j; + xmlNodeSetPtr node_set; + xmlNodeSetPtr new_set ; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + if (beg > node_set->nodeNr) { return Qnil ; } + if (beg < 0 || len < 0) { return Qnil ; } + + if ((beg + len) > node_set->nodeNr) { + len = node_set->nodeNr - beg ; + } + + new_set = xmlXPathNodeSetCreate(NULL); + for (j = beg ; j < beg + len ; ++j) { + xmlXPathNodeSetAddUnique(new_set, node_set->nodeTab[j]); + } + return noko_xml_node_set_wrap(new_set, rb_iv_get(self, "@document")); +} + +/* + * call-seq: + * [index] -> Node or nil + * [start, length] -> NodeSet or nil + * [range] -> NodeSet or nil + * slice(index) -> Node or nil + * slice(start, length) -> NodeSet or nil + * slice(range) -> NodeSet or nil + * + * Element reference - returns the node at +index+, or returns a NodeSet + * containing nodes starting at +start+ and continuing for +length+ elements, or + * returns a NodeSet containing nodes specified by +range+. Negative +indices+ + * count backward from the end of the +node_set+ (-1 is the last node). Returns + * nil if the +index+ (or +start+) are out of range. + */ +static VALUE +slice(int argc, VALUE *argv, VALUE self) +{ + VALUE arg ; + long beg, len ; + xmlNodeSetPtr node_set; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + if (argc == 2) { + beg = NUM2LONG(argv[0]); + len = NUM2LONG(argv[1]); + if (beg < 0) { + beg += node_set->nodeNr ; + } + return subseq(self, beg, len); + } + + if (argc != 1) { + rb_scan_args(argc, argv, "11", NULL, NULL); + } + arg = argv[0]; + + if (FIXNUM_P(arg)) { + return index_at(self, FIX2LONG(arg)); + } + + /* if arg is Range */ + switch (rb_range_beg_len(arg, &beg, &len, (long)node_set->nodeNr, 0)) { + case Qfalse: + break; + case Qnil: + return Qnil; + default: + return subseq(self, beg, len); + } + + return index_at(self, NUM2LONG(arg)); +} + + +/* + * call-seq: + * to_a + * + * Return this list as an Array + */ +static VALUE +to_array(VALUE self) +{ + xmlNodeSetPtr node_set ; + VALUE list; + int i; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + list = rb_ary_new2(node_set->nodeNr); + for (i = 0; i < node_set->nodeNr; i++) { + VALUE elt = noko_xml_node_wrap_node_set_result(node_set->nodeTab[i], self); + rb_ary_push(list, elt); + } + + return list; +} + +/* + * call-seq: + * unlink + * + * Unlink this NodeSet and all Node objects it contains from their current context. + */ +static VALUE +unlink_nodeset(VALUE self) +{ + xmlNodeSetPtr node_set; + int j, nodeNr ; + + Data_Get_Struct(self, xmlNodeSet, node_set); + + nodeNr = node_set->nodeNr ; + for (j = 0 ; j < nodeNr ; j++) { + if (! NOKOGIRI_NAMESPACE_EH(node_set->nodeTab[j])) { + VALUE node ; + xmlNodePtr node_ptr; + node = noko_xml_node_wrap(Qnil, node_set->nodeTab[j]); + rb_funcall(node, rb_intern("unlink"), 0); /* modifies the C struct out from under the object */ + Data_Get_Struct(node, xmlNode, node_ptr); + node_set->nodeTab[j] = node_ptr ; + } + } + return self ; +} + + +VALUE +noko_xml_node_set_wrap(xmlNodeSetPtr c_node_set, VALUE document) +{ + int j; + VALUE rb_node_set ; + + if (c_node_set == NULL) { + c_node_set = xmlXPathNodeSetCreate(NULL); + } + + rb_node_set = Data_Wrap_Struct(cNokogiriXmlNodeSet, mark, deallocate, c_node_set); + + if (!NIL_P(document)) { + rb_iv_set(rb_node_set, "@document", document); + rb_funcall(document, decorate, 1, rb_node_set); + } + + /* make sure we create ruby objects for all the results, so they'll be marked during the GC mark phase */ + for (j = 0 ; j < c_node_set->nodeNr ; j++) { + noko_xml_node_wrap_node_set_result(c_node_set->nodeTab[j], rb_node_set); + } + + return rb_node_set ; +} + +VALUE +noko_xml_node_wrap_node_set_result(xmlNodePtr node, VALUE node_set) +{ + if (NOKOGIRI_NAMESPACE_EH(node)) { + return noko_xml_namespace_wrap_xpath_copy((xmlNsPtr)node); + } else { + return noko_xml_node_wrap(Qnil, node); + } +} + + +void +noko_init_xml_node_set(void) +{ + cNokogiriXmlNodeSet = rb_define_class_under(mNokogiriXml, "NodeSet", rb_cObject); + + rb_define_alloc_func(cNokogiriXmlNodeSet, allocate); + + rb_define_method(cNokogiriXmlNodeSet, "length", length, 0); + rb_define_method(cNokogiriXmlNodeSet, "[]", slice, -1); + rb_define_method(cNokogiriXmlNodeSet, "slice", slice, -1); + rb_define_method(cNokogiriXmlNodeSet, "push", push, 1); + rb_define_method(cNokogiriXmlNodeSet, "|", rb_xml_node_set_union, 1); + rb_define_method(cNokogiriXmlNodeSet, "-", minus, 1); + rb_define_method(cNokogiriXmlNodeSet, "unlink", unlink_nodeset, 0); + rb_define_method(cNokogiriXmlNodeSet, "to_a", to_array, 0); + rb_define_method(cNokogiriXmlNodeSet, "dup", duplicate, 0); + rb_define_method(cNokogiriXmlNodeSet, "delete", delete, 1); + rb_define_method(cNokogiriXmlNodeSet, "&", intersection, 1); + rb_define_method(cNokogiriXmlNodeSet, "include?", include_eh, 1); + + decorate = rb_intern("decorate"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_processing_instruction.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_processing_instruction.c new file mode 100644 index 0000000..65a34f9 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_processing_instruction.c @@ -0,0 +1,54 @@ +#include + +VALUE cNokogiriXmlProcessingInstruction; + +/* + * call-seq: + * new(document, name, content) + * + * Create a new ProcessingInstruction element on the +document+ with +name+ + * and +content+ + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr xml_doc; + xmlNodePtr node; + VALUE document; + VALUE name; + VALUE content; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "3*", &document, &name, &content, &rest); + + Data_Get_Struct(document, xmlDoc, xml_doc); + + node = xmlNewDocPI( + xml_doc, + (const xmlChar *)StringValueCStr(name), + (const xmlChar *)StringValueCStr(content) + ); + + noko_xml_document_pin_node(node); + + rb_node = noko_xml_node_wrap(klass, node); + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +void +noko_init_xml_processing_instruction() +{ + assert(cNokogiriXmlNode); + /* + * ProcessingInstruction represents a ProcessingInstruction node in an xml + * document. + */ + cNokogiriXmlProcessingInstruction = rb_define_class_under(mNokogiriXml, "ProcessingInstruction", cNokogiriXmlNode); + + rb_define_singleton_method(cNokogiriXmlProcessingInstruction, "new", new, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_reader.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_reader.c new file mode 100644 index 0000000..4f87e18 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_reader.c @@ -0,0 +1,719 @@ +#include + +VALUE cNokogiriXmlReader; + +static void +dealloc(xmlTextReaderPtr reader) +{ + NOKOGIRI_DEBUG_START(reader); + xmlFreeTextReader(reader); + NOKOGIRI_DEBUG_END(reader); +} + +static int +has_attributes(xmlTextReaderPtr reader) +{ + /* + * this implementation of xmlTextReaderHasAttributes explicitly includes + * namespaces and properties, because some earlier versions ignore + * namespaces. + */ + xmlNodePtr node ; + node = xmlTextReaderCurrentNode(reader); + if (node == NULL) { + return (0); + } + + if ((node->type == XML_ELEMENT_NODE) && + ((node->properties != NULL) || (node->nsDef != NULL))) { + return (1); + } + return (0); +} + +static void +Nokogiri_xml_node_namespaces(xmlNodePtr node, VALUE attr_hash) +{ + xmlNsPtr ns; + VALUE key; + + if (node->type != XML_ELEMENT_NODE) { return ; } + + ns = node->nsDef; + while (ns != NULL) { + + key = rb_enc_str_new_cstr(XMLNS_PREFIX, rb_utf8_encoding()); + if (ns->prefix) { + rb_str_cat_cstr(key, ":"); + rb_str_cat_cstr(key, (const char *)ns->prefix); + } + + key = rb_str_conv_enc(key, rb_utf8_encoding(), rb_default_internal_encoding()); + rb_hash_aset(attr_hash, + key, + (ns->href ? NOKOGIRI_STR_NEW2(ns->href) : Qnil) + ); + ns = ns->next ; + } +} + + +/* + * call-seq: + * default? + * + * Was an attribute generated from the default value in the DTD or schema? + */ +static VALUE +default_eh(VALUE self) +{ + xmlTextReaderPtr reader; + int eh; + + Data_Get_Struct(self, xmlTextReader, reader); + eh = xmlTextReaderIsDefault(reader); + if (eh == 0) { return Qfalse; } + if (eh == 1) { return Qtrue; } + + return Qnil; +} + +/* + * call-seq: + * value? + * + * Does this node have a text value? + */ +static VALUE +value_eh(VALUE self) +{ + xmlTextReaderPtr reader; + int eh; + + Data_Get_Struct(self, xmlTextReader, reader); + eh = xmlTextReaderHasValue(reader); + if (eh == 0) { return Qfalse; } + if (eh == 1) { return Qtrue; } + + return Qnil; +} + +/* + * call-seq: + * attributes? + * + * Does this node have attributes? + */ +static VALUE +attributes_eh(VALUE self) +{ + xmlTextReaderPtr reader; + int eh; + + Data_Get_Struct(self, xmlTextReader, reader); + eh = has_attributes(reader); + if (eh == 0) { return Qfalse; } + if (eh == 1) { return Qtrue; } + + return Qnil; +} + +/* + * call-seq: + * namespaces + * + * Get a hash of namespaces for this Node + */ +static VALUE +namespaces(VALUE self) +{ + xmlTextReaderPtr reader; + xmlNodePtr ptr; + VALUE attr ; + + Data_Get_Struct(self, xmlTextReader, reader); + + attr = rb_hash_new() ; + + if (! has_attributes(reader)) { + return attr ; + } + + ptr = xmlTextReaderExpand(reader); + if (ptr == NULL) { return Qnil; } + + Nokogiri_xml_node_namespaces(ptr, attr); + + return attr ; +} + +/* + :call-seq: attribute_nodes() → Array + + Get the attributes of the current node as an Array of Attr + */ +static VALUE +rb_xml_reader_attribute_nodes(VALUE rb_reader) +{ + xmlTextReaderPtr c_reader; + xmlNodePtr c_node; + VALUE attr_nodes; + int j; + + Data_Get_Struct(rb_reader, xmlTextReader, c_reader); + + if (! has_attributes(c_reader)) { + return rb_ary_new() ; + } + + c_node = xmlTextReaderExpand(c_reader); + if (c_node == NULL) { + return Qnil; + } + + attr_nodes = noko_xml_node_attrs(c_node); + + /* ensure that the Reader won't be GCed as long as a node is referenced */ + for (j = 0 ; j < RARRAY_LEN(attr_nodes) ; j++) { + rb_iv_set(rb_ary_entry(attr_nodes, j), "@reader", rb_reader); + } + + return attr_nodes; +} + +/* + * call-seq: + * attribute_at(index) + * + * Get the value of attribute at +index+ + */ +static VALUE +attribute_at(VALUE self, VALUE index) +{ + xmlTextReaderPtr reader; + xmlChar *value; + VALUE rb_value; + + Data_Get_Struct(self, xmlTextReader, reader); + + if (NIL_P(index)) { return Qnil; } + index = rb_Integer(index); + + value = xmlTextReaderGetAttributeNo( + reader, + (int)NUM2INT(index) + ); + if (value == NULL) { return Qnil; } + + rb_value = NOKOGIRI_STR_NEW2(value); + xmlFree(value); + return rb_value; +} + +/* + * call-seq: + * attribute(name) + * + * Get the value of attribute named +name+ + */ +static VALUE +reader_attribute(VALUE self, VALUE name) +{ + xmlTextReaderPtr reader; + xmlChar *value ; + VALUE rb_value; + + Data_Get_Struct(self, xmlTextReader, reader); + + if (NIL_P(name)) { return Qnil; } + name = StringValue(name) ; + + value = xmlTextReaderGetAttribute(reader, (xmlChar *)StringValueCStr(name)); + if (value == NULL) { return Qnil; } + + rb_value = NOKOGIRI_STR_NEW2(value); + xmlFree(value); + return rb_value; +} + +/* + * call-seq: + * attribute_count + * + * Get the number of attributes for the current node + */ +static VALUE +attribute_count(VALUE self) +{ + xmlTextReaderPtr reader; + int count; + + Data_Get_Struct(self, xmlTextReader, reader); + count = xmlTextReaderAttributeCount(reader); + if (count == -1) { return Qnil; } + + return INT2NUM((long)count); +} + +/* + * call-seq: + * depth + * + * Get the depth of the node + */ +static VALUE +depth(VALUE self) +{ + xmlTextReaderPtr reader; + int depth; + + Data_Get_Struct(self, xmlTextReader, reader); + depth = xmlTextReaderDepth(reader); + if (depth == -1) { return Qnil; } + + return INT2NUM((long)depth); +} + +/* + * call-seq: + * xml_version + * + * Get the XML version of the document being read + */ +static VALUE +xml_version(VALUE self) +{ + xmlTextReaderPtr reader; + const char *version; + + Data_Get_Struct(self, xmlTextReader, reader); + version = (const char *)xmlTextReaderConstXmlVersion(reader); + if (version == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(version); +} + +/* + * call-seq: + * lang + * + * Get the xml:lang scope within which the node resides. + */ +static VALUE +lang(VALUE self) +{ + xmlTextReaderPtr reader; + const char *lang; + + Data_Get_Struct(self, xmlTextReader, reader); + lang = (const char *)xmlTextReaderConstXmlLang(reader); + if (lang == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(lang); +} + +/* + * call-seq: + * value + * + * Get the text value of the node if present. Returns a utf-8 encoded string. + */ +static VALUE +value(VALUE self) +{ + xmlTextReaderPtr reader; + const char *value; + + Data_Get_Struct(self, xmlTextReader, reader); + value = (const char *)xmlTextReaderConstValue(reader); + if (value == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(value); +} + +/* + * call-seq: + * prefix + * + * Get the shorthand reference to the namespace associated with the node. + */ +static VALUE +prefix(VALUE self) +{ + xmlTextReaderPtr reader; + const char *prefix; + + Data_Get_Struct(self, xmlTextReader, reader); + prefix = (const char *)xmlTextReaderConstPrefix(reader); + if (prefix == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(prefix); +} + +/* + * call-seq: + * namespace_uri + * + * Get the URI defining the namespace associated with the node + */ +static VALUE +namespace_uri(VALUE self) +{ + xmlTextReaderPtr reader; + const char *uri; + + Data_Get_Struct(self, xmlTextReader, reader); + uri = (const char *)xmlTextReaderConstNamespaceUri(reader); + if (uri == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(uri); +} + +/* + * call-seq: + * local_name + * + * Get the local name of the node + */ +static VALUE +local_name(VALUE self) +{ + xmlTextReaderPtr reader; + const char *name; + + Data_Get_Struct(self, xmlTextReader, reader); + name = (const char *)xmlTextReaderConstLocalName(reader); + if (name == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(name); +} + +/* + * call-seq: + * name + * + * Get the name of the node. Returns a utf-8 encoded string. + */ +static VALUE +name(VALUE self) +{ + xmlTextReaderPtr reader; + const char *name; + + Data_Get_Struct(self, xmlTextReader, reader); + name = (const char *)xmlTextReaderConstName(reader); + if (name == NULL) { return Qnil; } + + return NOKOGIRI_STR_NEW2(name); +} + +/* + * call-seq: + * base_uri + * + * Get the xml:base of the node + */ +static VALUE +rb_xml_reader_base_uri(VALUE rb_reader) +{ + VALUE rb_base_uri; + xmlTextReaderPtr c_reader; + xmlChar *c_base_uri; + + Data_Get_Struct(rb_reader, xmlTextReader, c_reader); + + c_base_uri = xmlTextReaderBaseUri(c_reader); + if (c_base_uri == NULL) { + return Qnil; + } + + rb_base_uri = NOKOGIRI_STR_NEW2(c_base_uri); + xmlFree(c_base_uri); + + return rb_base_uri; +} + +/* + * call-seq: + * state + * + * Get the state of the reader + */ +static VALUE +state(VALUE self) +{ + xmlTextReaderPtr reader; + Data_Get_Struct(self, xmlTextReader, reader); + return INT2NUM((long)xmlTextReaderReadState(reader)); +} + +/* + * call-seq: + * node_type + * + * Get the type of readers current node + */ +static VALUE +node_type(VALUE self) +{ + xmlTextReaderPtr reader; + Data_Get_Struct(self, xmlTextReader, reader); + return INT2NUM((long)xmlTextReaderNodeType(reader)); +} + +/* + * call-seq: + * read + * + * Move the Reader forward through the XML document. + */ +static VALUE +read_more(VALUE self) +{ + xmlTextReaderPtr reader; + xmlErrorPtr error; + VALUE error_list; + int ret; + + Data_Get_Struct(self, xmlTextReader, reader); + + error_list = rb_funcall(self, rb_intern("errors"), 0); + + xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher); + ret = xmlTextReaderRead(reader); + xmlSetStructuredErrorFunc(NULL, NULL); + + if (ret == 1) { return self; } + if (ret == 0) { return Qnil; } + + error = xmlGetLastError(); + if (error) { + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } else { + rb_raise(rb_eRuntimeError, "Error pulling: %d", ret); + } + + return Qnil; +} + +/* + * call-seq: + * inner_xml + * + * Read the contents of the current node, including child nodes and markup. + * Returns a utf-8 encoded string. + */ +static VALUE +inner_xml(VALUE self) +{ + xmlTextReaderPtr reader; + xmlChar *value; + VALUE str; + + Data_Get_Struct(self, xmlTextReader, reader); + + value = xmlTextReaderReadInnerXml(reader); + + str = Qnil; + if (value) { + str = NOKOGIRI_STR_NEW2((char *)value); + xmlFree(value); + } + + return str; +} + +/* + * call-seq: + * outer_xml + * + * Read the current node and its contents, including child nodes and markup. + * Returns a utf-8 encoded string. + */ +static VALUE +outer_xml(VALUE self) +{ + xmlTextReaderPtr reader; + xmlChar *value; + VALUE str = Qnil; + + Data_Get_Struct(self, xmlTextReader, reader); + + value = xmlTextReaderReadOuterXml(reader); + + if (value) { + str = NOKOGIRI_STR_NEW2((char *)value); + xmlFree(value); + } + return str; +} + +/* + * call-seq: + * from_memory(string, url = nil, encoding = nil, options = 0) + * + * Create a new reader that parses +string+ + */ +static VALUE +from_memory(int argc, VALUE *argv, VALUE klass) +{ + VALUE rb_buffer, rb_url, encoding, rb_options; + xmlTextReaderPtr reader; + const char *c_url = NULL; + const char *c_encoding = NULL; + int c_options = 0; + VALUE rb_reader, args[3]; + + rb_scan_args(argc, argv, "13", &rb_buffer, &rb_url, &encoding, &rb_options); + + if (!RTEST(rb_buffer)) { rb_raise(rb_eArgError, "string cannot be nil"); } + if (RTEST(rb_url)) { c_url = StringValueCStr(rb_url); } + if (RTEST(encoding)) { c_encoding = StringValueCStr(encoding); } + if (RTEST(rb_options)) { c_options = (int)NUM2INT(rb_options); } + + reader = xmlReaderForMemory( + StringValuePtr(rb_buffer), + (int)RSTRING_LEN(rb_buffer), + c_url, + c_encoding, + c_options + ); + + if (reader == NULL) { + xmlFreeTextReader(reader); + rb_raise(rb_eRuntimeError, "couldn't create a parser"); + } + + rb_reader = Data_Wrap_Struct(klass, NULL, dealloc, reader); + args[0] = rb_buffer; + args[1] = rb_url; + args[2] = encoding; + rb_obj_call_init(rb_reader, 3, args); + + return rb_reader; +} + +/* + * call-seq: + * from_io(io, url = nil, encoding = nil, options = 0) + * + * Create a new reader that parses +io+ + */ +static VALUE +from_io(int argc, VALUE *argv, VALUE klass) +{ + VALUE rb_io, rb_url, encoding, rb_options; + xmlTextReaderPtr reader; + const char *c_url = NULL; + const char *c_encoding = NULL; + int c_options = 0; + VALUE rb_reader, args[3]; + + rb_scan_args(argc, argv, "13", &rb_io, &rb_url, &encoding, &rb_options); + + if (!RTEST(rb_io)) { rb_raise(rb_eArgError, "io cannot be nil"); } + if (RTEST(rb_url)) { c_url = StringValueCStr(rb_url); } + if (RTEST(encoding)) { c_encoding = StringValueCStr(encoding); } + if (RTEST(rb_options)) { c_options = (int)NUM2INT(rb_options); } + + reader = xmlReaderForIO( + (xmlInputReadCallback)noko_io_read, + (xmlInputCloseCallback)noko_io_close, + (void *)rb_io, + c_url, + c_encoding, + c_options + ); + + if (reader == NULL) { + xmlFreeTextReader(reader); + rb_raise(rb_eRuntimeError, "couldn't create a parser"); + } + + rb_reader = Data_Wrap_Struct(klass, NULL, dealloc, reader); + args[0] = rb_io; + args[1] = rb_url; + args[2] = encoding; + rb_obj_call_init(rb_reader, 3, args); + + return rb_reader; +} + +/* + * call-seq: + * reader.empty_element? # => true or false + * + * Returns true if the current node is empty, otherwise false. + */ +static VALUE +empty_element_p(VALUE self) +{ + xmlTextReaderPtr reader; + + Data_Get_Struct(self, xmlTextReader, reader); + + if (xmlTextReaderIsEmptyElement(reader)) { + return Qtrue; + } + + return Qfalse; +} + +static VALUE +rb_xml_reader_encoding(VALUE rb_reader) +{ + xmlTextReaderPtr c_reader; + const char *parser_encoding; + VALUE constructor_encoding; + + constructor_encoding = rb_iv_get(rb_reader, "@encoding"); + if (RTEST(constructor_encoding)) { + return constructor_encoding; + } + + Data_Get_Struct(rb_reader, xmlTextReader, c_reader); + parser_encoding = (const char *)xmlTextReaderConstEncoding(c_reader); + if (parser_encoding == NULL) { return Qnil; } + return NOKOGIRI_STR_NEW2(parser_encoding); +} + +void +noko_init_xml_reader() +{ + /* + * The Reader parser allows you to effectively pull parse an XML document. + * Once instantiated, call Nokogiri::XML::Reader#each to iterate over each + * node. Note that you may only iterate over the document once! + */ + cNokogiriXmlReader = rb_define_class_under(mNokogiriXml, "Reader", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlReader); + + rb_define_singleton_method(cNokogiriXmlReader, "from_memory", from_memory, -1); + rb_define_singleton_method(cNokogiriXmlReader, "from_io", from_io, -1); + + rb_define_method(cNokogiriXmlReader, "attribute", reader_attribute, 1); + rb_define_method(cNokogiriXmlReader, "attribute_at", attribute_at, 1); + rb_define_method(cNokogiriXmlReader, "attribute_count", attribute_count, 0); + rb_define_method(cNokogiriXmlReader, "attribute_nodes", rb_xml_reader_attribute_nodes, 0); + rb_define_method(cNokogiriXmlReader, "attributes?", attributes_eh, 0); + rb_define_method(cNokogiriXmlReader, "base_uri", rb_xml_reader_base_uri, 0); + rb_define_method(cNokogiriXmlReader, "default?", default_eh, 0); + rb_define_method(cNokogiriXmlReader, "depth", depth, 0); + rb_define_method(cNokogiriXmlReader, "empty_element?", empty_element_p, 0); + rb_define_method(cNokogiriXmlReader, "encoding", rb_xml_reader_encoding, 0); + rb_define_method(cNokogiriXmlReader, "inner_xml", inner_xml, 0); + rb_define_method(cNokogiriXmlReader, "lang", lang, 0); + rb_define_method(cNokogiriXmlReader, "local_name", local_name, 0); + rb_define_method(cNokogiriXmlReader, "name", name, 0); + rb_define_method(cNokogiriXmlReader, "namespace_uri", namespace_uri, 0); + rb_define_method(cNokogiriXmlReader, "namespaces", namespaces, 0); + rb_define_method(cNokogiriXmlReader, "node_type", node_type, 0); + rb_define_method(cNokogiriXmlReader, "outer_xml", outer_xml, 0); + rb_define_method(cNokogiriXmlReader, "prefix", prefix, 0); + rb_define_method(cNokogiriXmlReader, "read", read_more, 0); + rb_define_method(cNokogiriXmlReader, "state", state, 0); + rb_define_method(cNokogiriXmlReader, "value", value, 0); + rb_define_method(cNokogiriXmlReader, "value?", value_eh, 0); + rb_define_method(cNokogiriXmlReader, "xml_version", xml_version, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_relax_ng.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_relax_ng.c new file mode 100644 index 0000000..e55f54e --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_relax_ng.c @@ -0,0 +1,185 @@ +#include + +VALUE cNokogiriXmlRelaxNG; + +static void +dealloc(xmlRelaxNGPtr schema) +{ + NOKOGIRI_DEBUG_START(schema); + xmlRelaxNGFree(schema); + NOKOGIRI_DEBUG_END(schema); +} + +/* + * call-seq: + * validate_document(document) + * + * Validate a Nokogiri::XML::Document against this RelaxNG schema. + */ +static VALUE +validate_document(VALUE self, VALUE document) +{ + xmlDocPtr doc; + xmlRelaxNGPtr schema; + VALUE errors; + xmlRelaxNGValidCtxtPtr valid_ctxt; + + Data_Get_Struct(self, xmlRelaxNG, schema); + Data_Get_Struct(document, xmlDoc, doc); + + errors = rb_ary_new(); + + valid_ctxt = xmlRelaxNGNewValidCtxt(schema); + + if (NULL == valid_ctxt) { + /* we have a problem */ + rb_raise(rb_eRuntimeError, "Could not create a validation context"); + } + +#ifdef HAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS + xmlRelaxNGSetValidStructuredErrors( + valid_ctxt, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + xmlRelaxNGValidateDoc(valid_ctxt, doc); + + xmlRelaxNGFreeValidCtxt(valid_ctxt); + + return errors; +} + +/* + * call-seq: + * read_memory(string) + * + * Create a new RelaxNG from the contents of +string+ + */ +static VALUE +read_memory(int argc, VALUE *argv, VALUE klass) +{ + VALUE content; + VALUE parse_options; + xmlRelaxNGParserCtxtPtr ctx; + xmlRelaxNGPtr schema; + VALUE errors; + VALUE rb_schema; + int scanned_args = 0; + + scanned_args = rb_scan_args(argc, argv, "11", &content, &parse_options); + if (scanned_args == 1) { + parse_options = rb_const_get_at(rb_const_get_at(mNokogiriXml, rb_intern("ParseOptions")), rb_intern("DEFAULT_SCHEMA")); + } + + ctx = xmlRelaxNGNewMemParserCtxt((const char *)StringValuePtr(content), (int)RSTRING_LEN(content)); + + errors = rb_ary_new(); + xmlSetStructuredErrorFunc((void *)errors, Nokogiri_error_array_pusher); + +#ifdef HAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS + xmlRelaxNGSetParserStructuredErrors( + ctx, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + schema = xmlRelaxNGParse(ctx); + + xmlSetStructuredErrorFunc(NULL, NULL); + xmlRelaxNGFreeParserCtxt(ctx); + + if (NULL == schema) { + xmlErrorPtr error = xmlGetLastError(); + if (error) { + Nokogiri_error_raise(NULL, error); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + rb_schema = Data_Wrap_Struct(klass, 0, dealloc, schema); + rb_iv_set(rb_schema, "@errors", errors); + rb_iv_set(rb_schema, "@parse_options", parse_options); + + return rb_schema; +} + +/* + * call-seq: + * from_document(doc) + * + * Create a new RelaxNG schema from the Nokogiri::XML::Document +doc+ + */ +static VALUE +from_document(int argc, VALUE *argv, VALUE klass) +{ + VALUE document; + VALUE parse_options; + xmlDocPtr doc; + xmlRelaxNGParserCtxtPtr ctx; + xmlRelaxNGPtr schema; + VALUE errors; + VALUE rb_schema; + int scanned_args = 0; + + scanned_args = rb_scan_args(argc, argv, "11", &document, &parse_options); + + Data_Get_Struct(document, xmlDoc, doc); + doc = doc->doc; /* In case someone passes us a node. ugh. */ + + if (scanned_args == 1) { + parse_options = rb_const_get_at(rb_const_get_at(mNokogiriXml, rb_intern("ParseOptions")), rb_intern("DEFAULT_SCHEMA")); + } + + ctx = xmlRelaxNGNewDocParserCtxt(doc); + + errors = rb_ary_new(); + xmlSetStructuredErrorFunc((void *)errors, Nokogiri_error_array_pusher); + +#ifdef HAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS + xmlRelaxNGSetParserStructuredErrors( + ctx, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + schema = xmlRelaxNGParse(ctx); + + xmlSetStructuredErrorFunc(NULL, NULL); + xmlRelaxNGFreeParserCtxt(ctx); + + if (NULL == schema) { + xmlErrorPtr error = xmlGetLastError(); + if (error) { + Nokogiri_error_raise(NULL, error); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + rb_schema = Data_Wrap_Struct(klass, 0, dealloc, schema); + rb_iv_set(rb_schema, "@errors", errors); + rb_iv_set(rb_schema, "@parse_options", parse_options); + + return rb_schema; +} + +void +noko_init_xml_relax_ng() +{ + assert(cNokogiriXmlSchema); + cNokogiriXmlRelaxNG = rb_define_class_under(mNokogiriXml, "RelaxNG", cNokogiriXmlSchema); + + rb_define_singleton_method(cNokogiriXmlRelaxNG, "read_memory", read_memory, -1); + rb_define_singleton_method(cNokogiriXmlRelaxNG, "from_document", from_document, -1); + + rb_define_private_method(cNokogiriXmlRelaxNG, "validate_document", validate_document, 1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser.c new file mode 100644 index 0000000..5d953be --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser.c @@ -0,0 +1,310 @@ +#include + +VALUE cNokogiriXmlSaxParser ; + +static ID id_start_document, id_end_document, id_start_element, id_end_element; +static ID id_start_element_namespace, id_end_element_namespace; +static ID id_comment, id_characters, id_xmldecl, id_error, id_warning; +static ID id_cdata_block; +static ID id_processing_instruction; + +static void +start_document(void *ctx) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + + xmlParserCtxtPtr ctxt = NOKOGIRI_SAX_CTXT(ctx); + + if (NULL != ctxt && ctxt->html != 1) { + if (ctxt->standalone != -1) { /* -1 means there was no declaration */ + VALUE encoding = Qnil ; + VALUE standalone = Qnil; + VALUE version; + if (ctxt->encoding) { + encoding = NOKOGIRI_STR_NEW2(ctxt->encoding) ; + } else if (ctxt->input && ctxt->input->encoding) { + encoding = NOKOGIRI_STR_NEW2(ctxt->input->encoding) ; + } + + version = ctxt->version ? NOKOGIRI_STR_NEW2(ctxt->version) : Qnil; + + switch (ctxt->standalone) { + case 0: + standalone = NOKOGIRI_STR_NEW2("no"); + break; + case 1: + standalone = NOKOGIRI_STR_NEW2("yes"); + break; + } + + rb_funcall(doc, id_xmldecl, 3, version, encoding, standalone); + } + } + + rb_funcall(doc, id_start_document, 0); +} + +static void +end_document(void *ctx) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + rb_funcall(doc, id_end_document, 0); +} + +static void +start_element(void *ctx, const xmlChar *name, const xmlChar **atts) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + VALUE attributes = rb_ary_new(); + const xmlChar *attr; + int i = 0; + if (atts) { + while ((attr = atts[i]) != NULL) { + const xmlChar *val = atts[i + 1]; + VALUE value = val != NULL ? NOKOGIRI_STR_NEW2(val) : Qnil; + rb_ary_push(attributes, rb_ary_new3(2, NOKOGIRI_STR_NEW2(attr), value)); + i += 2; + } + } + + rb_funcall(doc, + id_start_element, + 2, + NOKOGIRI_STR_NEW2(name), + attributes + ); +} + +static void +end_element(void *ctx, const xmlChar *name) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + rb_funcall(doc, id_end_element, 1, NOKOGIRI_STR_NEW2(name)); +} + +static VALUE +attributes_as_array(int attributes_len, const xmlChar **c_attributes) +{ + VALUE rb_array = rb_ary_new2((long)attributes_len); + VALUE cNokogiriXmlSaxParserAttribute; + + cNokogiriXmlSaxParserAttribute = rb_const_get_at(cNokogiriXmlSaxParser, rb_intern("Attribute")); + if (c_attributes) { + /* Each attribute is an array of [localname, prefix, URI, value, end] */ + int i; + for (i = 0; i < attributes_len * 5; i += 5) { + VALUE rb_constructor_args[4], rb_attribute; + + rb_constructor_args[0] = RBSTR_OR_QNIL(c_attributes[i + 0]); /* localname */ + rb_constructor_args[1] = RBSTR_OR_QNIL(c_attributes[i + 1]); /* prefix */ + rb_constructor_args[2] = RBSTR_OR_QNIL(c_attributes[i + 2]); /* URI */ + + /* value */ + rb_constructor_args[3] = NOKOGIRI_STR_NEW((const char *)c_attributes[i + 3], + (c_attributes[i + 4] - c_attributes[i + 3])); + + rb_attribute = rb_class_new_instance(4, rb_constructor_args, cNokogiriXmlSaxParserAttribute); + rb_ary_push(rb_array, rb_attribute); + } + } + + return rb_array; +} + +static void +start_element_ns( + void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *uri, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + + VALUE attribute_ary = attributes_as_array(nb_attributes, attributes); + + VALUE ns_list = rb_ary_new2((long)nb_namespaces); + + if (namespaces) { + int i; + for (i = 0; i < nb_namespaces * 2; i += 2) { + rb_ary_push(ns_list, + rb_ary_new3((long)2, + RBSTR_OR_QNIL(namespaces[i + 0]), + RBSTR_OR_QNIL(namespaces[i + 1]) + ) + ); + } + } + + rb_funcall(doc, + id_start_element_namespace, + 5, + NOKOGIRI_STR_NEW2(localname), + attribute_ary, + RBSTR_OR_QNIL(prefix), + RBSTR_OR_QNIL(uri), + ns_list + ); +} + +/** + * end_element_ns was borrowed heavily from libxml-ruby. + */ +static void +end_element_ns( + void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *uri) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + + rb_funcall(doc, id_end_element_namespace, 3, + NOKOGIRI_STR_NEW2(localname), + RBSTR_OR_QNIL(prefix), + RBSTR_OR_QNIL(uri) + ); +} + +static void +characters_func(void *ctx, const xmlChar *ch, int len) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + VALUE str = NOKOGIRI_STR_NEW(ch, len); + rb_funcall(doc, id_characters, 1, str); +} + +static void +comment_func(void *ctx, const xmlChar *value) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + VALUE str = NOKOGIRI_STR_NEW2(value); + rb_funcall(doc, id_comment, 1, str); +} + +static void +warning_func(void *ctx, const char *msg, ...) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + char *message; + VALUE ruby_message; + + va_list args; + va_start(args, msg); + vasprintf(&message, msg, args); + va_end(args); + + ruby_message = NOKOGIRI_STR_NEW2(message); + free(message); + rb_funcall(doc, id_warning, 1, ruby_message); +} + +static void +error_func(void *ctx, const char *msg, ...) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + char *message; + VALUE ruby_message; + + va_list args; + va_start(args, msg); + vasprintf(&message, msg, args); + va_end(args); + + ruby_message = NOKOGIRI_STR_NEW2(message); + free(message); + rb_funcall(doc, id_error, 1, ruby_message); +} + +static void +cdata_block(void *ctx, const xmlChar *value, int len) +{ + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + VALUE string = NOKOGIRI_STR_NEW(value, len); + rb_funcall(doc, id_cdata_block, 1, string); +} + +static void +processing_instruction(void *ctx, const xmlChar *name, const xmlChar *content) +{ + VALUE rb_content; + VALUE self = NOKOGIRI_SAX_SELF(ctx); + VALUE doc = rb_iv_get(self, "@document"); + + rb_content = content ? NOKOGIRI_STR_NEW2(content) : Qnil; + + rb_funcall(doc, + id_processing_instruction, + 2, + NOKOGIRI_STR_NEW2(name), + rb_content + ); +} + +static void +deallocate(xmlSAXHandlerPtr handler) +{ + NOKOGIRI_DEBUG_START(handler); + free(handler); + NOKOGIRI_DEBUG_END(handler); +} + +static VALUE +allocate(VALUE klass) +{ + xmlSAXHandlerPtr handler = calloc((size_t)1, sizeof(xmlSAXHandler)); + + handler->startDocument = start_document; + handler->endDocument = end_document; + handler->startElement = start_element; + handler->endElement = end_element; + handler->startElementNs = start_element_ns; + handler->endElementNs = end_element_ns; + handler->characters = characters_func; + handler->comment = comment_func; + handler->warning = warning_func; + handler->error = error_func; + handler->cdataBlock = cdata_block; + handler->processingInstruction = processing_instruction; + handler->initialized = XML_SAX2_MAGIC; + + return Data_Wrap_Struct(klass, NULL, deallocate, handler); +} + +void +noko_init_xml_sax_parser() +{ + cNokogiriXmlSaxParser = rb_define_class_under(mNokogiriXmlSax, "Parser", rb_cObject); + + rb_define_alloc_func(cNokogiriXmlSaxParser, allocate); + + id_start_document = rb_intern("start_document"); + id_end_document = rb_intern("end_document"); + id_start_element = rb_intern("start_element"); + id_end_element = rb_intern("end_element"); + id_comment = rb_intern("comment"); + id_characters = rb_intern("characters"); + id_xmldecl = rb_intern("xmldecl"); + id_error = rb_intern("error"); + id_warning = rb_intern("warning"); + id_cdata_block = rb_intern("cdata_block"); + id_start_element_namespace = rb_intern("start_element_namespace"); + id_end_element_namespace = rb_intern("end_element_namespace"); + id_processing_instruction = rb_intern("processing_instruction"); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser_context.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser_context.c new file mode 100644 index 0000000..6044934 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_parser_context.c @@ -0,0 +1,281 @@ +#include + +VALUE cNokogiriXmlSaxParserContext ; + +static void +deallocate(xmlParserCtxtPtr ctxt) +{ + NOKOGIRI_DEBUG_START(ctxt); + + ctxt->sax = NULL; + + xmlFreeParserCtxt(ctxt); + + NOKOGIRI_DEBUG_END(ctxt); +} + +/* + * call-seq: + * parse_io(io, encoding) + * + * Parse +io+ object with +encoding+ + */ +static VALUE +parse_io(VALUE klass, VALUE io, VALUE encoding) +{ + xmlParserCtxtPtr ctxt; + xmlCharEncoding enc = (xmlCharEncoding)NUM2INT(encoding); + + ctxt = xmlCreateIOParserCtxt(NULL, NULL, + (xmlInputReadCallback)noko_io_read, + (xmlInputCloseCallback)noko_io_close, + (void *)io, enc); + if (ctxt->sax) { + xmlFree(ctxt->sax); + ctxt->sax = NULL; + } + + return Data_Wrap_Struct(klass, NULL, deallocate, ctxt); +} + +/* + * call-seq: + * parse_file(filename) + * + * Parse file given +filename+ + */ +static VALUE +parse_file(VALUE klass, VALUE filename) +{ + xmlParserCtxtPtr ctxt = xmlCreateFileParserCtxt(StringValueCStr(filename)); + return Data_Wrap_Struct(klass, NULL, deallocate, ctxt); +} + +/* + * call-seq: + * parse_memory(data) + * + * Parse the XML stored in memory in +data+ + */ +static VALUE +parse_memory(VALUE klass, VALUE data) +{ + xmlParserCtxtPtr ctxt; + + if (NIL_P(data)) { + rb_raise(rb_eArgError, "data cannot be nil"); + } + if (!(int)RSTRING_LEN(data)) { + rb_raise(rb_eRuntimeError, "data cannot be empty"); + } + + ctxt = xmlCreateMemoryParserCtxt(StringValuePtr(data), + (int)RSTRING_LEN(data)); + if (ctxt->sax) { + xmlFree(ctxt->sax); + ctxt->sax = NULL; + } + + return Data_Wrap_Struct(klass, NULL, deallocate, ctxt); +} + +static VALUE +parse_doc(VALUE ctxt_val) +{ + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctxt_val; + xmlParseDocument(ctxt); + return Qnil; +} + +static VALUE +parse_doc_finalize(VALUE ctxt_val) +{ + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctxt_val; + + if (NULL != ctxt->myDoc) { + xmlFreeDoc(ctxt->myDoc); + } + + NOKOGIRI_SAX_TUPLE_DESTROY(ctxt->userData); + return Qnil; +} + +/* + * call-seq: + * parse_with(sax_handler) + * + * Use +sax_handler+ and parse the current document + */ +static VALUE +parse_with(VALUE self, VALUE sax_handler) +{ + xmlParserCtxtPtr ctxt; + xmlSAXHandlerPtr sax; + + if (!rb_obj_is_kind_of(sax_handler, cNokogiriXmlSaxParser)) { + rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::SAX::Parser"); + } + + Data_Get_Struct(self, xmlParserCtxt, ctxt); + Data_Get_Struct(sax_handler, xmlSAXHandler, sax); + + /* Free the sax handler since we'll assign our own */ + if (ctxt->sax && ctxt->sax != (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) { + xmlFree(ctxt->sax); + } + + ctxt->sax = sax; + ctxt->userData = (void *)NOKOGIRI_SAX_TUPLE_NEW(ctxt, sax_handler); + + xmlSetStructuredErrorFunc(NULL, NULL); + + rb_ensure(parse_doc, (VALUE)ctxt, parse_doc_finalize, (VALUE)ctxt); + + return Qnil; +} + +/* + * call-seq: + * replace_entities=(boolean) + * + * Should this parser replace entities? & will get converted to '&' if + * set to true + */ +static VALUE +set_replace_entities(VALUE self, VALUE value) +{ + xmlParserCtxtPtr ctxt; + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + if (Qfalse == value) { + ctxt->replaceEntities = 0; + } else { + ctxt->replaceEntities = 1; + } + + return value; +} + +/* + * call-seq: + * replace_entities + * + * Should this parser replace entities? & will get converted to '&' if + * set to true + */ +static VALUE +get_replace_entities(VALUE self) +{ + xmlParserCtxtPtr ctxt; + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + if (0 == ctxt->replaceEntities) { + return Qfalse; + } else { + return Qtrue; + } +} + +/* + * call-seq: line + * + * Get the current line the parser context is processing. + */ +static VALUE +line(VALUE self) +{ + xmlParserCtxtPtr ctxt; + xmlParserInputPtr io; + + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + io = ctxt->input; + if (io) { + return INT2NUM(io->line); + } + + return Qnil; +} + +/* + * call-seq: column + * + * Get the current column the parser context is processing. + */ +static VALUE +column(VALUE self) +{ + xmlParserCtxtPtr ctxt; + xmlParserInputPtr io; + + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + io = ctxt->input; + if (io) { + return INT2NUM(io->col); + } + + return Qnil; +} + +/* + * call-seq: + * recovery=(boolean) + * + * Should this parser recover from structural errors? It will not stop processing + * file on structural errors if set to true + */ +static VALUE +set_recovery(VALUE self, VALUE value) +{ + xmlParserCtxtPtr ctxt; + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + if (value == Qfalse) { + ctxt->recovery = 0; + } else { + ctxt->recovery = 1; + } + + return value; +} + +/* + * call-seq: + * recovery + * + * Should this parser recover from structural errors? It will not stop processing + * file on structural errors if set to true + */ +static VALUE +get_recovery(VALUE self) +{ + xmlParserCtxtPtr ctxt; + Data_Get_Struct(self, xmlParserCtxt, ctxt); + + if (ctxt->recovery == 0) { + return Qfalse; + } else { + return Qtrue; + } +} + +void +noko_init_xml_sax_parser_context() +{ + cNokogiriXmlSaxParserContext = rb_define_class_under(mNokogiriXmlSax, "ParserContext", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlSaxParserContext); + + rb_define_singleton_method(cNokogiriXmlSaxParserContext, "io", parse_io, 2); + rb_define_singleton_method(cNokogiriXmlSaxParserContext, "memory", parse_memory, 1); + rb_define_singleton_method(cNokogiriXmlSaxParserContext, "file", parse_file, 1); + + rb_define_method(cNokogiriXmlSaxParserContext, "parse_with", parse_with, 1); + rb_define_method(cNokogiriXmlSaxParserContext, "replace_entities=", set_replace_entities, 1); + rb_define_method(cNokogiriXmlSaxParserContext, "replace_entities", get_replace_entities, 0); + rb_define_method(cNokogiriXmlSaxParserContext, "recovery=", set_recovery, 1); + rb_define_method(cNokogiriXmlSaxParserContext, "recovery", get_recovery, 0); + rb_define_method(cNokogiriXmlSaxParserContext, "line", line, 0); + rb_define_method(cNokogiriXmlSaxParserContext, "column", column, 0); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_push_parser.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_push_parser.c new file mode 100644 index 0000000..20426ca --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_sax_push_parser.c @@ -0,0 +1,168 @@ +#include + +VALUE cNokogiriXmlSaxPushParser ; + +static void +deallocate(xmlParserCtxtPtr ctx) +{ + NOKOGIRI_DEBUG_START(ctx); + if (ctx != NULL) { + NOKOGIRI_SAX_TUPLE_DESTROY(ctx->userData); + xmlFreeParserCtxt(ctx); + } + NOKOGIRI_DEBUG_END(ctx); +} + +static VALUE +allocate(VALUE klass) +{ + return Data_Wrap_Struct(klass, NULL, deallocate, NULL); +} + +/* + * call-seq: + * native_write(chunk, last_chunk) + * + * Write +chunk+ to PushParser. +last_chunk+ triggers the end_document handle + */ +static VALUE +native_write(VALUE self, VALUE _chunk, VALUE _last_chunk) +{ + xmlParserCtxtPtr ctx; + const char *chunk = NULL; + int size = 0; + + + Data_Get_Struct(self, xmlParserCtxt, ctx); + + if (Qnil != _chunk) { + chunk = StringValuePtr(_chunk); + size = (int)RSTRING_LEN(_chunk); + } + + xmlSetStructuredErrorFunc(NULL, NULL); + + if (xmlParseChunk(ctx, chunk, size, Qtrue == _last_chunk ? 1 : 0)) { + if (!(ctx->options & XML_PARSE_RECOVER)) { + xmlErrorPtr e = xmlCtxtGetLastError(ctx); + Nokogiri_error_raise(NULL, e); + } + } + + return self; +} + +/* + * call-seq: + * initialize_native(xml_sax, filename) + * + * Initialize the push parser with +xml_sax+ using +filename+ + */ +static VALUE +initialize_native(VALUE self, VALUE _xml_sax, VALUE _filename) +{ + xmlSAXHandlerPtr sax; + const char *filename = NULL; + xmlParserCtxtPtr ctx; + + Data_Get_Struct(_xml_sax, xmlSAXHandler, sax); + + if (_filename != Qnil) { filename = StringValueCStr(_filename); } + + ctx = xmlCreatePushParserCtxt( + sax, + NULL, + NULL, + 0, + filename + ); + if (ctx == NULL) { + rb_raise(rb_eRuntimeError, "Could not create a parser context"); + } + + ctx->userData = NOKOGIRI_SAX_TUPLE_NEW(ctx, self); + + ctx->sax2 = 1; + DATA_PTR(self) = ctx; + return self; +} + +static VALUE +get_options(VALUE self) +{ + xmlParserCtxtPtr ctx; + Data_Get_Struct(self, xmlParserCtxt, ctx); + + return INT2NUM(ctx->options); +} + +static VALUE +set_options(VALUE self, VALUE options) +{ + xmlParserCtxtPtr ctx; + Data_Get_Struct(self, xmlParserCtxt, ctx); + + if (xmlCtxtUseOptions(ctx, (int)NUM2INT(options)) != 0) { + rb_raise(rb_eRuntimeError, "Cannot set XML parser context options"); + } + + return Qnil; +} + +/* + * call-seq: + * replace_entities + * + * Should this parser replace entities? & will get converted to '&' if + * set to true + */ +static VALUE +get_replace_entities(VALUE self) +{ + xmlParserCtxtPtr ctx; + Data_Get_Struct(self, xmlParserCtxt, ctx); + + if (0 == ctx->replaceEntities) { + return Qfalse; + } else { + return Qtrue; + } +} + +/* + * call-seq: + * replace_entities=(boolean) + * + * Should this parser replace entities? & will get converted to '&' if + * set to true + */ +static VALUE +set_replace_entities(VALUE self, VALUE value) +{ + xmlParserCtxtPtr ctx; + Data_Get_Struct(self, xmlParserCtxt, ctx); + + if (Qfalse == value) { + ctx->replaceEntities = 0; + } else { + ctx->replaceEntities = 1; + } + + return value; +} + +void +noko_init_xml_sax_push_parser() +{ + cNokogiriXmlSaxPushParser = rb_define_class_under(mNokogiriXmlSax, "PushParser", rb_cObject); + + rb_define_alloc_func(cNokogiriXmlSaxPushParser, allocate); + + rb_define_method(cNokogiriXmlSaxPushParser, "options", get_options, 0); + rb_define_method(cNokogiriXmlSaxPushParser, "options=", set_options, 1); + rb_define_method(cNokogiriXmlSaxPushParser, "replace_entities", get_replace_entities, 0); + rb_define_method(cNokogiriXmlSaxPushParser, "replace_entities=", set_replace_entities, 1); + + rb_define_private_method(cNokogiriXmlSaxPushParser, "initialize_native", initialize_native, 2); + rb_define_private_method(cNokogiriXmlSaxPushParser, "native_write", native_write, 2); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_schema.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_schema.c new file mode 100644 index 0000000..a8175e6 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_schema.c @@ -0,0 +1,284 @@ +#include + +VALUE cNokogiriXmlSchema; + +static void +dealloc(xmlSchemaPtr schema) +{ + NOKOGIRI_DEBUG_START(schema); + xmlSchemaFree(schema); + NOKOGIRI_DEBUG_END(schema); +} + +/* + * call-seq: + * validate_document(document) + * + * Validate a Nokogiri::XML::Document against this Schema. + */ +static VALUE +validate_document(VALUE self, VALUE document) +{ + xmlDocPtr doc; + xmlSchemaPtr schema; + xmlSchemaValidCtxtPtr valid_ctxt; + VALUE errors; + + Data_Get_Struct(self, xmlSchema, schema); + Data_Get_Struct(document, xmlDoc, doc); + + errors = rb_ary_new(); + + valid_ctxt = xmlSchemaNewValidCtxt(schema); + + if (NULL == valid_ctxt) { + /* we have a problem */ + rb_raise(rb_eRuntimeError, "Could not create a validation context"); + } + +#ifdef HAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS + xmlSchemaSetValidStructuredErrors( + valid_ctxt, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + xmlSchemaValidateDoc(valid_ctxt, doc); + + xmlSchemaFreeValidCtxt(valid_ctxt); + + return errors; +} + +/* + * call-seq: + * validate_file(filename) + * + * Validate a file against this Schema. + */ +static VALUE +validate_file(VALUE self, VALUE rb_filename) +{ + xmlSchemaPtr schema; + xmlSchemaValidCtxtPtr valid_ctxt; + const char *filename ; + VALUE errors; + + Data_Get_Struct(self, xmlSchema, schema); + filename = (const char *)StringValueCStr(rb_filename) ; + + errors = rb_ary_new(); + + valid_ctxt = xmlSchemaNewValidCtxt(schema); + + if (NULL == valid_ctxt) { + /* we have a problem */ + rb_raise(rb_eRuntimeError, "Could not create a validation context"); + } + +#ifdef HAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS + xmlSchemaSetValidStructuredErrors( + valid_ctxt, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + xmlSchemaValidateFile(valid_ctxt, filename, 0); + + xmlSchemaFreeValidCtxt(valid_ctxt); + + return errors; +} + +/* + * call-seq: + * read_memory(string) + * + * Create a new Schema from the contents of +string+ + */ +static VALUE +read_memory(int argc, VALUE *argv, VALUE klass) +{ + VALUE content; + VALUE parse_options; + int parse_options_int; + xmlSchemaParserCtxtPtr ctx; + xmlSchemaPtr schema; + VALUE errors; + VALUE rb_schema; + int scanned_args = 0; + xmlExternalEntityLoader old_loader = 0; + + scanned_args = rb_scan_args(argc, argv, "11", &content, &parse_options); + if (scanned_args == 1) { + parse_options = rb_const_get_at(rb_const_get_at(mNokogiriXml, rb_intern("ParseOptions")), rb_intern("DEFAULT_SCHEMA")); + } + parse_options_int = (int)NUM2INT(rb_funcall(parse_options, rb_intern("to_i"), 0)); + + ctx = xmlSchemaNewMemParserCtxt((const char *)StringValuePtr(content), (int)RSTRING_LEN(content)); + + errors = rb_ary_new(); + xmlSetStructuredErrorFunc((void *)errors, Nokogiri_error_array_pusher); + +#ifdef HAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS + xmlSchemaSetParserStructuredErrors( + ctx, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + if (parse_options_int & XML_PARSE_NONET) { + old_loader = xmlGetExternalEntityLoader(); + xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader); + } + + schema = xmlSchemaParse(ctx); + + if (old_loader) { + xmlSetExternalEntityLoader(old_loader); + } + + xmlSetStructuredErrorFunc(NULL, NULL); + xmlSchemaFreeParserCtxt(ctx); + + if (NULL == schema) { + xmlErrorPtr error = xmlGetLastError(); + if (error) { + Nokogiri_error_raise(NULL, error); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + rb_schema = Data_Wrap_Struct(klass, 0, dealloc, schema); + rb_iv_set(rb_schema, "@errors", errors); + rb_iv_set(rb_schema, "@parse_options", parse_options); + + return rb_schema; +} + +/* Schema creation will remove and deallocate "blank" nodes. + * If those blank nodes have been exposed to Ruby, they could get freed + * out from under the VALUE pointer. This function checks to see if any of + * those nodes have been exposed to Ruby, and if so we should raise an exception. + */ +static int +has_blank_nodes_p(VALUE cache) +{ + long i; + + if (NIL_P(cache)) { + return 0; + } + + for (i = 0; i < RARRAY_LEN(cache); i++) { + xmlNodePtr node; + VALUE element = rb_ary_entry(cache, i); + Data_Get_Struct(element, xmlNode, node); + if (xmlIsBlankNode(node)) { + return 1; + } + } + + return 0; +} + +/* + * call-seq: + * from_document(doc) + * + * Create a new Schema from the Nokogiri::XML::Document +doc+ + */ +static VALUE +from_document(int argc, VALUE *argv, VALUE klass) +{ + VALUE document; + VALUE parse_options; + int parse_options_int; + xmlDocPtr doc; + xmlSchemaParserCtxtPtr ctx; + xmlSchemaPtr schema; + VALUE errors; + VALUE rb_schema; + int scanned_args = 0; + xmlExternalEntityLoader old_loader = 0; + + scanned_args = rb_scan_args(argc, argv, "11", &document, &parse_options); + + Data_Get_Struct(document, xmlDoc, doc); + doc = doc->doc; /* In case someone passes us a node. ugh. */ + + if (scanned_args == 1) { + parse_options = rb_const_get_at(rb_const_get_at(mNokogiriXml, rb_intern("ParseOptions")), rb_intern("DEFAULT_SCHEMA")); + } + parse_options_int = (int)NUM2INT(rb_funcall(parse_options, rb_intern("to_i"), 0)); + + if (has_blank_nodes_p(DOC_NODE_CACHE(doc))) { + rb_raise(rb_eArgError, "Creating a schema from a document that has blank nodes exposed to Ruby is dangerous"); + } + + ctx = xmlSchemaNewDocParserCtxt(doc); + + errors = rb_ary_new(); + xmlSetStructuredErrorFunc((void *)errors, Nokogiri_error_array_pusher); + +#ifdef HAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS + xmlSchemaSetParserStructuredErrors( + ctx, + Nokogiri_error_array_pusher, + (void *)errors + ); +#endif + + if (parse_options_int & XML_PARSE_NONET) { + old_loader = xmlGetExternalEntityLoader(); + xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader); + } + + schema = xmlSchemaParse(ctx); + + if (old_loader) { + xmlSetExternalEntityLoader(old_loader); + } + + xmlSetStructuredErrorFunc(NULL, NULL); + xmlSchemaFreeParserCtxt(ctx); + + if (NULL == schema) { + xmlErrorPtr error = xmlGetLastError(); + if (error) { + Nokogiri_error_raise(NULL, error); + } else { + rb_raise(rb_eRuntimeError, "Could not parse document"); + } + + return Qnil; + } + + rb_schema = Data_Wrap_Struct(klass, 0, dealloc, schema); + rb_iv_set(rb_schema, "@errors", errors); + rb_iv_set(rb_schema, "@parse_options", parse_options); + + return rb_schema; + + return Qnil; +} + +void +noko_init_xml_schema() +{ + cNokogiriXmlSchema = rb_define_class_under(mNokogiriXml, "Schema", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlSchema); + + rb_define_singleton_method(cNokogiriXmlSchema, "read_memory", read_memory, -1); + rb_define_singleton_method(cNokogiriXmlSchema, "from_document", from_document, -1); + + rb_define_private_method(cNokogiriXmlSchema, "validate_document", validate_document, 1); + rb_define_private_method(cNokogiriXmlSchema, "validate_file", validate_file, 1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_syntax_error.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_syntax_error.c new file mode 100644 index 0000000..e7d3dd8 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_syntax_error.c @@ -0,0 +1,85 @@ +#include + +VALUE cNokogiriXmlSyntaxError; + +void +Nokogiri_structured_error_func_save(libxmlStructuredErrorHandlerState *handler_state) +{ + /* this method is tightly coupled to the implementation of xmlSetStructuredErrorFunc */ + handler_state->user_data = xmlStructuredErrorContext; + handler_state->handler = xmlStructuredError; +} + +void +Nokogiri_structured_error_func_save_and_set(libxmlStructuredErrorHandlerState *handler_state, + void *user_data, + xmlStructuredErrorFunc handler) +{ + Nokogiri_structured_error_func_save(handler_state); + xmlSetStructuredErrorFunc(user_data, handler); +} + +void +Nokogiri_structured_error_func_restore(libxmlStructuredErrorHandlerState *handler_state) +{ + xmlSetStructuredErrorFunc(handler_state->user_data, handler_state->handler); +} + +void +Nokogiri_error_array_pusher(void *ctx, xmlErrorPtr error) +{ + VALUE list = (VALUE)ctx; + Check_Type(list, T_ARRAY); + rb_ary_push(list, Nokogiri_wrap_xml_syntax_error(error)); +} + +void +Nokogiri_error_raise(void *ctx, xmlErrorPtr error) +{ + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); +} + +VALUE +Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error) +{ + VALUE msg, e, klass; + + klass = cNokogiriXmlSyntaxError; + + if (error && error->domain == XML_FROM_XPATH) { + klass = cNokogiriXmlXpathSyntaxError; + } + + msg = (error && error->message) ? NOKOGIRI_STR_NEW2(error->message) : Qnil; + + e = rb_class_new_instance( + 1, + &msg, + klass + ); + + if (error) { + rb_iv_set(e, "@domain", INT2NUM(error->domain)); + rb_iv_set(e, "@code", INT2NUM(error->code)); + rb_iv_set(e, "@level", INT2NUM((short)error->level)); + rb_iv_set(e, "@file", RBSTR_OR_QNIL(error->file)); + rb_iv_set(e, "@line", INT2NUM(error->line)); + rb_iv_set(e, "@str1", RBSTR_OR_QNIL(error->str1)); + rb_iv_set(e, "@str2", RBSTR_OR_QNIL(error->str2)); + rb_iv_set(e, "@str3", RBSTR_OR_QNIL(error->str3)); + rb_iv_set(e, "@int1", INT2NUM(error->int1)); + rb_iv_set(e, "@column", INT2NUM(error->int2)); + } + + return e; +} + +void +noko_init_xml_syntax_error() +{ + assert(cNokogiriSyntaxError); + /* + * The XML::SyntaxError is raised on parse errors + */ + cNokogiriXmlSyntaxError = rb_define_class_under(mNokogiriXml, "SyntaxError", cNokogiriSyntaxError); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_text.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_text.c new file mode 100644 index 0000000..eb78e23 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_text.c @@ -0,0 +1,48 @@ +#include + +VALUE cNokogiriXmlText ; + +/* + * call-seq: + * new(content, document) + * + * Create a new Text element on the +document+ with +content+ + */ +static VALUE +new (int argc, VALUE *argv, VALUE klass) +{ + xmlDocPtr doc; + xmlNodePtr node; + VALUE string; + VALUE document; + VALUE rest; + VALUE rb_node; + + rb_scan_args(argc, argv, "2*", &string, &document, &rest); + + Data_Get_Struct(document, xmlDoc, doc); + + node = xmlNewText((xmlChar *)StringValueCStr(string)); + node->doc = doc->doc; + + noko_xml_document_pin_node(node); + + rb_node = noko_xml_node_wrap(klass, node) ; + rb_obj_call_init(rb_node, argc, argv); + + if (rb_block_given_p()) { rb_yield(rb_node); } + + return rb_node; +} + +void +noko_init_xml_text() +{ + assert(cNokogiriXmlCharacterData); + /* + * Wraps Text nodes. + */ + cNokogiriXmlText = rb_define_class_under(mNokogiriXml, "Text", cNokogiriXmlCharacterData); + + rb_define_singleton_method(cNokogiriXmlText, "new", new, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_xpath_context.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_xpath_context.c new file mode 100644 index 0000000..c481900 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xml_xpath_context.c @@ -0,0 +1,406 @@ +#include + +VALUE cNokogiriXmlXpathContext; + +/* + * these constants have matching declarations in + * ext/java/nokogiri/internals/NokogiriNamespaceContext.java + */ +static const xmlChar *NOKOGIRI_BUILTIN_PREFIX = (const xmlChar *)"nokogiri-builtin"; +static const xmlChar *NOKOGIRI_BUILTIN_URI = (const xmlChar *)"https://www.nokogiri.org/default_ns/ruby/builtins"; + +static void +deallocate(xmlXPathContextPtr ctx) +{ + NOKOGIRI_DEBUG_START(ctx); + xmlXPathFreeContext(ctx); + NOKOGIRI_DEBUG_END(ctx); +} + +/* find a CSS class in an HTML element's `class` attribute */ +static const xmlChar * +builtin_css_class(const xmlChar *str, const xmlChar *val) +{ + int val_len; + + if (str == NULL) { return (NULL); } + if (val == NULL) { return (NULL); } + + val_len = xmlStrlen(val); + if (val_len == 0) { return (str); } + + while (*str != 0) { + if ((*str == *val) && !xmlStrncmp(str, val, val_len)) { + const xmlChar *next_byte = str + val_len; + + /* only match if the next byte is whitespace or end of string */ + if ((*next_byte == 0) || (IS_BLANK_CH(*next_byte))) { + return ((const xmlChar *)str); + } + } + + /* advance str to whitespace */ + while ((*str != 0) && !IS_BLANK_CH(*str)) { + str++; + } + + /* advance str to start of next word or end of string */ + while ((*str != 0) && IS_BLANK_CH(*str)) { + str++; + } + } + + return (NULL); +} + +/* xmlXPathFunction to wrap builtin_css_class() */ +static void +xpath_builtin_css_class(xmlXPathParserContextPtr ctxt, int nargs) +{ + xmlXPathObjectPtr hay, needle; + + CHECK_ARITY(2); + + CAST_TO_STRING; + needle = valuePop(ctxt); + if ((needle == NULL) || (needle->type != XPATH_STRING)) { + xmlXPathFreeObject(needle); + XP_ERROR(XPATH_INVALID_TYPE); + } + + CAST_TO_STRING; + hay = valuePop(ctxt); + if ((hay == NULL) || (hay->type != XPATH_STRING)) { + xmlXPathFreeObject(hay); + xmlXPathFreeObject(needle); + XP_ERROR(XPATH_INVALID_TYPE); + } + + if (builtin_css_class(hay->stringval, needle->stringval)) { + valuePush(ctxt, xmlXPathNewBoolean(1)); + } else { + valuePush(ctxt, xmlXPathNewBoolean(0)); + } + + xmlXPathFreeObject(hay); + xmlXPathFreeObject(needle); +} + + +/* xmlXPathFunction to select nodes whose local name matches, for HTML5 CSS queries that should ignore namespaces */ +static void +xpath_builtin_local_name_is(xmlXPathParserContextPtr ctxt, int nargs) +{ + xmlXPathObjectPtr element_name; + + assert(ctxt->context->node); + + CHECK_ARITY(1); + CAST_TO_STRING; + CHECK_TYPE(XPATH_STRING); + element_name = valuePop(ctxt); + + valuePush(ctxt, xmlXPathNewBoolean(xmlStrEqual(ctxt->context->node->name, element_name->stringval))); + + xmlXPathFreeObject(element_name); +} + + +/* + * call-seq: + * register_ns(prefix, uri) + * + * Register the namespace with +prefix+ and +uri+. + */ +static VALUE +register_ns(VALUE self, VALUE prefix, VALUE uri) +{ + xmlXPathContextPtr ctx; + Data_Get_Struct(self, xmlXPathContext, ctx); + + xmlXPathRegisterNs(ctx, + (const xmlChar *)StringValueCStr(prefix), + (const xmlChar *)StringValueCStr(uri) + ); + return self; +} + +/* + * call-seq: + * register_variable(name, value) + * + * Register the variable +name+ with +value+. + */ +static VALUE +register_variable(VALUE self, VALUE name, VALUE value) +{ + xmlXPathContextPtr ctx; + xmlXPathObjectPtr xmlValue; + Data_Get_Struct(self, xmlXPathContext, ctx); + + xmlValue = xmlXPathNewCString(StringValueCStr(value)); + + xmlXPathRegisterVariable(ctx, + (const xmlChar *)StringValueCStr(name), + xmlValue + ); + + return self; +} + + +/* + * convert an XPath object into a Ruby object of the appropriate type. + * returns Qundef if no conversion was possible. + */ +static VALUE +xpath2ruby(xmlXPathObjectPtr xobj, xmlXPathContextPtr xctx) +{ + VALUE retval; + + assert(xctx->doc); + assert(DOC_RUBY_OBJECT_TEST(xctx->doc)); + + switch (xobj->type) { + case XPATH_STRING: + retval = NOKOGIRI_STR_NEW2(xobj->stringval); + xmlFree(xobj->stringval); + return retval; + + case XPATH_NODESET: + return noko_xml_node_set_wrap(xobj->nodesetval, + DOC_RUBY_OBJECT(xctx->doc)); + + case XPATH_NUMBER: + return rb_float_new(xobj->floatval); + + case XPATH_BOOLEAN: + return (xobj->boolval == 1) ? Qtrue : Qfalse; + + default: + return Qundef; + } +} + +void +Nokogiri_marshal_xpath_funcall_and_return_values(xmlXPathParserContextPtr ctx, int nargs, VALUE handler, + const char *function_name) +{ + VALUE result, doc; + VALUE *argv; + VALUE node_set = Qnil; + xmlNodeSetPtr xml_node_set = NULL; + xmlXPathObjectPtr obj; + + assert(ctx->context->doc); + assert(DOC_RUBY_OBJECT_TEST(ctx->context->doc)); + + argv = (VALUE *)calloc((size_t)nargs, sizeof(VALUE)); + for (int j = 0 ; j < nargs ; ++j) { + rb_gc_register_address(&argv[j]); + } + + doc = DOC_RUBY_OBJECT(ctx->context->doc); + + for (int j = nargs - 1 ; j >= 0 ; --j) { + obj = valuePop(ctx); + argv[j] = xpath2ruby(obj, ctx->context); + if (argv[j] == Qundef) { + argv[j] = NOKOGIRI_STR_NEW2(xmlXPathCastToString(obj)); + } + xmlXPathFreeNodeSetList(obj); + } + + result = rb_funcall2(handler, rb_intern((const char *)function_name), nargs, argv); + + for (int j = 0 ; j < nargs ; ++j) { + rb_gc_unregister_address(&argv[j]); + } + free(argv); + + switch (TYPE(result)) { + case T_FLOAT: + case T_BIGNUM: + case T_FIXNUM: + xmlXPathReturnNumber(ctx, NUM2DBL(result)); + break; + case T_STRING: + xmlXPathReturnString( + ctx, + xmlCharStrdup(StringValueCStr(result)) + ); + break; + case T_TRUE: + xmlXPathReturnTrue(ctx); + break; + case T_FALSE: + xmlXPathReturnFalse(ctx); + break; + case T_NIL: + break; + case T_ARRAY: { + VALUE args[2]; + args[0] = doc; + args[1] = result; + node_set = rb_class_new_instance(2, args, cNokogiriXmlNodeSet); + Data_Get_Struct(node_set, xmlNodeSet, xml_node_set); + xmlXPathReturnNodeSet(ctx, xmlXPathNodeSetMerge(NULL, xml_node_set)); + } + break; + case T_DATA: + if (rb_obj_is_kind_of(result, cNokogiriXmlNodeSet)) { + Data_Get_Struct(result, xmlNodeSet, xml_node_set); + /* Copy the node set, otherwise it will get GC'd. */ + xmlXPathReturnNodeSet(ctx, xmlXPathNodeSetMerge(NULL, xml_node_set)); + break; + } + default: + rb_raise(rb_eRuntimeError, "Invalid return type"); + } +} + +static void +ruby_funcall(xmlXPathParserContextPtr ctx, int nargs) +{ + VALUE handler = Qnil; + const char *function = NULL ; + + assert(ctx); + assert(ctx->context); + assert(ctx->context->userData); + assert(ctx->context->function); + + handler = (VALUE)(ctx->context->userData); + function = (const char *)(ctx->context->function); + + Nokogiri_marshal_xpath_funcall_and_return_values(ctx, nargs, handler, function); +} + +static xmlXPathFunction +lookup(void *ctx, + const xmlChar *name, + const xmlChar *ns_uri) +{ + VALUE xpath_handler = (VALUE)ctx; + if (rb_respond_to(xpath_handler, rb_intern((const char *)name))) { + return ruby_funcall; + } + + return NULL; +} + +NORETURN(static void xpath_generic_exception_handler(void *ctx, const char *msg, ...)); +static void +xpath_generic_exception_handler(void *ctx, const char *msg, ...) +{ + char *message; + + va_list args; + va_start(args, msg); + vasprintf(&message, msg, args); + va_end(args); + + rb_raise(rb_eRuntimeError, "%s", message); +} + +/* + * call-seq: + * evaluate(search_path, handler = nil) + * + * Evaluate the +search_path+ returning an XML::XPath object. + */ +static VALUE +evaluate(int argc, VALUE *argv, VALUE self) +{ + VALUE search_path, xpath_handler; + VALUE retval = Qnil; + xmlXPathContextPtr ctx; + xmlXPathObjectPtr xpath; + xmlChar *query; + + Data_Get_Struct(self, xmlXPathContext, ctx); + + if (rb_scan_args(argc, argv, "11", &search_path, &xpath_handler) == 1) { + xpath_handler = Qnil; + } + + query = (xmlChar *)StringValueCStr(search_path); + + if (Qnil != xpath_handler) { + /* FIXME: not sure if this is the correct place to shove private data. */ + ctx->userData = (void *)xpath_handler; + xmlXPathRegisterFuncLookup(ctx, lookup, (void *)xpath_handler); + } + + xmlResetLastError(); + xmlSetStructuredErrorFunc(NULL, Nokogiri_error_raise); + + /* For some reason, xmlXPathEvalExpression will blow up with a generic error */ + /* when there is a non existent function. */ + xmlSetGenericErrorFunc(NULL, xpath_generic_exception_handler); + + xpath = xmlXPathEvalExpression(query, ctx); + xmlSetStructuredErrorFunc(NULL, NULL); + xmlSetGenericErrorFunc(NULL, NULL); + + if (xpath == NULL) { + xmlErrorPtr error = xmlGetLastError(); + rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error)); + } + + retval = xpath2ruby(xpath, ctx); + if (retval == Qundef) { + retval = noko_xml_node_set_wrap(NULL, DOC_RUBY_OBJECT(ctx->doc)); + } + + xmlXPathFreeNodeSetList(xpath); + + return retval; +} + +/* + * call-seq: + * new(node) + * + * Create a new XPathContext with +node+ as the reference point. + */ +static VALUE +new (VALUE klass, VALUE nodeobj) +{ + xmlNodePtr node; + xmlXPathContextPtr ctx; + VALUE self; + + Data_Get_Struct(nodeobj, xmlNode, node); + + xmlXPathInit(); + + ctx = xmlXPathNewContext(node->doc); + ctx->node = node; + + xmlXPathRegisterNs(ctx, NOKOGIRI_BUILTIN_PREFIX, NOKOGIRI_BUILTIN_URI); + xmlXPathRegisterFuncNS(ctx, (const xmlChar *)"css-class", NOKOGIRI_BUILTIN_URI, + xpath_builtin_css_class); + xmlXPathRegisterFuncNS(ctx, (const xmlChar *)"local-name-is", NOKOGIRI_BUILTIN_URI, + xpath_builtin_local_name_is); + + self = Data_Wrap_Struct(klass, 0, deallocate, ctx); + return self; +} + +void +noko_init_xml_xpath_context(void) +{ + /* + * XPathContext is the entry point for searching a Document by using XPath. + */ + cNokogiriXmlXpathContext = rb_define_class_under(mNokogiriXml, "XPathContext", rb_cObject); + + rb_undef_alloc_func(cNokogiriXmlXpathContext); + + rb_define_singleton_method(cNokogiriXmlXpathContext, "new", new, 1); + + rb_define_method(cNokogiriXmlXpathContext, "evaluate", evaluate, -1); + rb_define_method(cNokogiriXmlXpathContext, "register_variable", register_variable, 2); + rb_define_method(cNokogiriXmlXpathContext, "register_ns", register_ns, 2); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xslt_stylesheet.c b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xslt_stylesheet.c new file mode 100644 index 0000000..0b75886 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/ext/nokogiri/xslt_stylesheet.c @@ -0,0 +1,362 @@ +#include + +VALUE cNokogiriXsltStylesheet ; + +static void +mark(nokogiriXsltStylesheetTuple *wrapper) +{ + rb_gc_mark(wrapper->func_instances); +} + +static void +dealloc(nokogiriXsltStylesheetTuple *wrapper) +{ + xsltStylesheetPtr doc = wrapper->ss; + + NOKOGIRI_DEBUG_START(doc); + xsltFreeStylesheet(doc); /* commented out for now. */ + NOKOGIRI_DEBUG_END(doc); + + free(wrapper); +} + +static void +xslt_generic_error_handler(void *ctx, const char *msg, ...) +{ + char *message; + + va_list args; + va_start(args, msg); + vasprintf(&message, msg, args); + va_end(args); + + rb_str_cat2((VALUE)ctx, message); + + free(message); +} + +VALUE +Nokogiri_wrap_xslt_stylesheet(xsltStylesheetPtr ss) +{ + VALUE self; + nokogiriXsltStylesheetTuple *wrapper; + + self = Data_Make_Struct(cNokogiriXsltStylesheet, nokogiriXsltStylesheetTuple, + mark, dealloc, wrapper); + + ss->_private = (void *)self; + wrapper->ss = ss; + wrapper->func_instances = rb_ary_new(); + + return self; +} + +/* + * call-seq: + * parse_stylesheet_doc(document) + * + * Parse a stylesheet from +document+. + */ +static VALUE +parse_stylesheet_doc(VALUE klass, VALUE xmldocobj) +{ + xmlDocPtr xml, xml_cpy; + VALUE errstr, exception; + xsltStylesheetPtr ss ; + Data_Get_Struct(xmldocobj, xmlDoc, xml); + + errstr = rb_str_new(0, 0); + xsltSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler); + + xml_cpy = xmlCopyDoc(xml, 1); /* 1 => recursive */ + ss = xsltParseStylesheetDoc(xml_cpy); + + xsltSetGenericErrorFunc(NULL, NULL); + + if (!ss) { + xmlFreeDoc(xml_cpy); + exception = rb_exc_new3(rb_eRuntimeError, errstr); + rb_exc_raise(exception); + } + + return Nokogiri_wrap_xslt_stylesheet(ss); +} + + +/* + * call-seq: + * serialize(document) + * + * Serialize +document+ to an xml string. + */ +static VALUE +serialize(VALUE self, VALUE xmlobj) +{ + xmlDocPtr xml ; + nokogiriXsltStylesheetTuple *wrapper; + xmlChar *doc_ptr ; + int doc_len ; + VALUE rval ; + + Data_Get_Struct(xmlobj, xmlDoc, xml); + Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper); + xsltSaveResultToString(&doc_ptr, &doc_len, xml, wrapper->ss); + rval = NOKOGIRI_STR_NEW(doc_ptr, doc_len); + xmlFree(doc_ptr); + return rval ; +} + +/* + * call-seq: + * transform(document) + * transform(document, params = {}) + * + * Apply an XSLT stylesheet to an XML::Document. + * + * [Parameters] + * - +document+ (Nokogiri::XML::Document) the document to be transformed. + * - +params+ (Hash, Array) strings used as XSLT parameters. + * + * [Returns] Nokogiri::XML::Document + * + * *Example* of basic transformation: + * + * xslt = <<~XSLT + * + * + * + * + * + * + * + *

+ *
    + * + *
  1. + *
    + *
+ * + * + *
+ * XSLT + * + * xml = <<~XML + * + * + * + * EMP0001 + * Accountant + * + * + * EMP0002 + * Developer + * + * + * XML + * + * doc = Nokogiri::XML::Document.parse(xml) + * stylesheet = Nokogiri::XSLT.parse(xslt) + * + * ⚠ Note that the +h1+ element is empty because no param has been provided! + * + * stylesheet.transform(doc).to_xml + * # => "\n" + + * # "

\n" + + * # "
    \n" + + * # "
  1. EMP0001
  2. \n" + + * # "
  3. EMP0002
  4. \n" + + * # "
\n" + + * # "\n" + * + * *Example* of using an input parameter hash: + * + * ⚠ The title is populated, but note how we need to quote-escape the value. + * + * stylesheet.transform(doc, { "title" => "'Employee List'" }).to_xml + * # => "\n" + + * # "

Employee List

\n" + + * # "
    \n" + + * # "
  1. EMP0001
  2. \n" + + * # "
  3. EMP0002
  4. \n" + + * # "
\n" + + * # "\n" + * + * *Example* using the XSLT.quote_params helper method to safely quote-escape strings: + * + * stylesheet.transform(doc, Nokogiri::XSLT.quote_params({ "title" => "Aaron's List" })).to_xml + * # => "\n" + + * # "

Aaron's List

\n" + + * # "
    \n" + + * # "
  1. EMP0001
  2. \n" + + * # "
  3. EMP0002
  4. \n" + + * # "
\n" + + * # "\n" + * + * *Example* using an array of XSLT parameters + * + * You can also use an array if you want to. + * + * stylesheet.transform(doc, ["title", "'Employee List'"]).to_xml + * # => "\n" + + * # "

Employee List

\n" + + * # "
    \n" + + * # "
  1. EMP0001
  2. \n" + + * # "
  3. EMP0002
  4. \n" + + * # "
\n" + + * # "\n" + * + * Or pass an array to XSLT.quote_params: + * + * stylesheet.transform(doc, Nokogiri::XSLT.quote_params(["title", "Aaron's List"])).to_xml + * # => "\n" + + * # "

Aaron's List

\n" + + * # "
    \n" + + * # "
  1. EMP0001
  2. \n" + + * # "
  3. EMP0002
  4. \n" + + * # "
\n" + + * # "\n" + * + * See: Nokogiri::XSLT.quote_params + */ +static VALUE +transform(int argc, VALUE *argv, VALUE self) +{ + VALUE xmldoc, paramobj, errstr, exception ; + xmlDocPtr xml ; + xmlDocPtr result ; + nokogiriXsltStylesheetTuple *wrapper; + const char **params ; + long param_len, j ; + int parse_error_occurred ; + + rb_scan_args(argc, argv, "11", &xmldoc, ¶mobj); + if (NIL_P(paramobj)) { paramobj = rb_ary_new2(0L) ; } + if (!rb_obj_is_kind_of(xmldoc, cNokogiriXmlDocument)) { + rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::Document"); + } + + /* handle hashes as arguments. */ + if (T_HASH == TYPE(paramobj)) { + paramobj = rb_funcall(paramobj, rb_intern("to_a"), 0); + paramobj = rb_funcall(paramobj, rb_intern("flatten"), 0); + } + + Check_Type(paramobj, T_ARRAY); + + Data_Get_Struct(xmldoc, xmlDoc, xml); + Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper); + + param_len = RARRAY_LEN(paramobj); + params = calloc((size_t)param_len + 1, sizeof(char *)); + for (j = 0 ; j < param_len ; j++) { + VALUE entry = rb_ary_entry(paramobj, j); + const char *ptr = StringValueCStr(entry); + params[j] = ptr; + } + params[param_len] = 0 ; + + errstr = rb_str_new(0, 0); + xsltSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler); + xmlSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler); + + result = xsltApplyStylesheet(wrapper->ss, xml, params); + free(params); + + xsltSetGenericErrorFunc(NULL, NULL); + xmlSetGenericErrorFunc(NULL, NULL); + + parse_error_occurred = (Qfalse == rb_funcall(errstr, rb_intern("empty?"), 0)); + + if (parse_error_occurred) { + exception = rb_exc_new3(rb_eRuntimeError, errstr); + rb_exc_raise(exception); + } + + return noko_xml_document_wrap((VALUE)0, result) ; +} + +static void +method_caller(xmlXPathParserContextPtr ctxt, int nargs) +{ + VALUE handler; + const char *function_name; + xsltTransformContextPtr transform; + const xmlChar *functionURI; + + transform = xsltXPathGetTransformContext(ctxt); + functionURI = ctxt->context->functionURI; + handler = (VALUE)xsltGetExtData(transform, functionURI); + function_name = (const char *)(ctxt->context->function); + + Nokogiri_marshal_xpath_funcall_and_return_values(ctxt, nargs, handler, (const char *)function_name); +} + +static void * +initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri) +{ + VALUE modules = rb_iv_get(mNokogiriXslt, "@modules"); + VALUE obj = rb_hash_aref(modules, rb_str_new2((const char *)uri)); + VALUE args = { Qfalse }; + VALUE methods = rb_funcall(obj, rb_intern("instance_methods"), 1, args); + VALUE inst; + nokogiriXsltStylesheetTuple *wrapper; + int i; + + for (i = 0; i < RARRAY_LEN(methods); i++) { + VALUE method_name = rb_obj_as_string(rb_ary_entry(methods, i)); + xsltRegisterExtFunction(ctxt, + (unsigned char *)StringValueCStr(method_name), uri, method_caller); + } + + Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple, + wrapper); + inst = rb_class_new_instance(0, NULL, obj); + rb_ary_push(wrapper->func_instances, inst); + + return (void *)inst; +} + +static void +shutdownFunc(xsltTransformContextPtr ctxt, + const xmlChar *uri, void *data) +{ + nokogiriXsltStylesheetTuple *wrapper; + + Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple, + wrapper); + + rb_ary_clear(wrapper->func_instances); +} + +/* + * call-seq: + * register(uri, custom_handler_class) + * + * Register a class that implements custom XSLT transformation functions. + */ +static VALUE +registr(VALUE self, VALUE uri, VALUE obj) +{ + VALUE modules = rb_iv_get(self, "@modules"); + if (NIL_P(modules)) { rb_raise(rb_eRuntimeError, "wtf! @modules isn't set"); } + + rb_hash_aset(modules, uri, obj); + xsltRegisterExtModule((unsigned char *)StringValueCStr(uri), initFunc, shutdownFunc); + return self; +} + +void +noko_init_xslt_stylesheet() +{ + rb_define_singleton_method(mNokogiriXslt, "register", registr, 2); + rb_iv_set(mNokogiriXslt, "@modules", rb_hash_new()); + + cNokogiriXsltStylesheet = rb_define_class_under(mNokogiriXslt, "Stylesheet", rb_cObject); + + rb_undef_alloc_func(cNokogiriXsltStylesheet); + + rb_define_singleton_method(cNokogiriXsltStylesheet, "parse_stylesheet_doc", parse_stylesheet_doc, 1); + rb_define_method(cNokogiriXsltStylesheet, "serialize", serialize, 1); + rb_define_method(cNokogiriXsltStylesheet, "transform", transform, -1); +} diff --git a/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/gumbo-parser/CHANGES.md b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/gumbo-parser/CHANGES.md new file mode 100644 index 0000000..277b3a2 --- /dev/null +++ b/vendor/bundle/ruby/3.1.0/gems/nokogiri-1.13.1-x86_64-linux/gumbo-parser/CHANGES.md @@ -0,0 +1,63 @@ +## Gumbo 0.10.1 (2015-04-30) + +Same as 0.10.0, but with the version number bumped because the last version-number commit to v0.9.4 makes GitHub think that v0.9.4 is the latest version and so it's not highlighted on the webpage. + +## Gumbo 0.10.0 (2015-04-30) + +* Full support for `